player_effects.feature 31.5 KB
Newer Older
Aqualung's avatar
WIP  
Aqualung committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769
@kill_server_after
@clear_player_effects
Feature: PlayerEffects

## Dog_Follow
# TODO

## Balm

Scenario: Balm effect processes correctly when limited by duration
    Given I use the "minimal" database as-is
    And I add player and character "TestBalm01"
    And I set the character's max HP to "30"
    And I set the character's current HP to "1"
    And I give the character a "balm" effect of "20" for "3" turns
    And the server is started
    When I log on as "TestBalm01"
    And I enter the game
    # 1 + 10 (initial effect) = 11 (amount now 10, duration now 3)
    And after "0" turns I have a current HP of "16"
    # 11 + 5 (effect on initial turn) = 16 (amount now 5, duration now 2)
    And after "1" turns I have a current HP of "18"
    # 16 + 2 (effect) = 18 (amount now 3, duration now 1)
    And after "1" turns I have a current HP of "20"
    # 18 + 1 (effect) = 19 (amount now 2, duration now 0)
    # 19 + 1 (third round healing) = 20
    And after "1" turns I have a current HP of "22"
    # 20 + 2 (effect) = 22 (effect completed)
    And after "1" turns I have a current HP of "22"
    And after "1" turns I have a current HP of "23"
    # 22 + 1 (third round healing) = 23

Scenario: Balm effect processes correctly when limited by effect
    Given I use the "minimal" database as-is
    And I add player and character "TestBalm02"
    And I set the character's max HP to "30"
    And I set the character's current HP to "1"
    And I give the character a "balm" effect of "10" for "4" turns
    And the server is started
    When I log on as "TestBalm02"
    And I enter the game
    # 1 + 5 (initial effect) = 6 (amount now 5, duration now 4)
    And after "0" turns I have a current HP of "8"
    # 6 + 2 (effect on initial turn) = 8 (amount now 3, duration now 3)
    And after "1" turns I have a current HP of "9"
    # 8 + 1 (effect) = 9 (amount now 2, duration now 2)
    And after "1" turns I have a current HP of "11"
    # 9 + 1 (effect) = 10 (amount now 1, duration now 1)
    # 10 + 1 (third round healing) = 11
    And after "1" turns I have a current HP of "11"
    # 11 + 0 (effect) = 11 (amount still 1, duration now 0)
    And after "1" turns I have a current HP of "12"
    # 11 + 1 (effect) = 12 (effect completed)
    And after "1" turns I have a current HP of "13"
    # 12 + 1 (third round healing) = 13

## Ale

# bug - No indication of the burp is sent to the player themselves.
@bug
Scenario: Ale effect gives the desired output - same player, beginning
    Given I use the "minimal" database as-is
    And I add player and character "TestAle01"
    And I give the character an "ale" effect of "999" for "2" turns
    And the server is started
    When I log on as "TestAle01"
    And I enter the game
    And I saw a message "You burp loudly."

Scenario: Ale effect gives the desired output - same player, wearing off
    Given I use the "minimal" database as-is
    And I add player and character "TestAle01"
    And I give the character an "ale" effect of "999" for "2" turns
    And the server is started
    When I log on as "TestAle01"
    And I enter the game
    And within "2" turns I see the message "The Ale spell has worn off."

# bug - Burp not indicated to another player in the same cell.
@bug
Scenario: Ale effect gives the desired output - other player in same cell
    Given I use the "minimal" database as-is
    And I add player and character "TestAle01"
    And I give the character an "ale" effect of "999" for "999" turns
    And I add player and character "TestAle02"
    And the server is started
    When I log on as "TestAle02"
    And I enter the game
    And I rest
    Then I cause "TestAle01" to log on and enter the game
    And within "4" turns I see the message "TestAle01_name burps loudly."

Scenario: Ale effect gives the desired output - other player in neighboring cell
    Given I use the "minimal" database as-is
    And I add player and character "TestAle01"
    And I give the character an "ale" effect of "999" for "999" turns
    And I add player and character "TestAle02"
    And the server is started
    When I log on as "TestAle02"
    And I enter the game
    And I move east
    Then I cause "TestAle01" to log on and enter the game
    And within "1" turns I see the message "TestAle01_name burps loudly."

# bug - Initial effect occurs twice.
@bug
Scenario: Ale effect gives the desired output - burp only once
    Given I use the "minimal" database as-is
    And I add player and character "TestAle01"
    And I give the character an "ale" effect of "999" for "999" turns
    And I add player and character "TestAle02"
    And the server is started
    When I log on as "TestAle02"
    And I enter the game
    And I move east
    Then I cause "TestAle01" to log on and enter the game
    And within "2" turns I see the message "TestAle01_name burps loudly." only once


## Beer

# bug - No indication of the burp is sent to the player themselves.
@bug
Scenario: Beer effect gives the desired output - same player, beginning
    Given I use the "minimal" database as-is
    And I add player and character "TestBeer01"
    And I give the character a "beer" effect of "999" for "2" turns
    And the server is started
    When I log on as "TestBeer01"
    And I enter the game
    And I saw a message "You burp."

Scenario: Beer effect gives the desired output - same player, wearing off
    Given I use the "minimal" database as-is
    And I add player and character "TestBeer01"
    And I give the character a "beer" effect of "999" for "2" turns
    And the server is started
    When I log on as "TestBeer01"
    And I enter the game
    And within "2" turns I see the message "The Beer spell has worn off."

# bug - Burp not indicated to another player in the same cell.
@bug
Scenario: Beer effect gives the desired output - other player in same cell
    Given I use the "minimal" database as-is
    And I add player and character "TestBeer01"
    And I give the character a "beer" effect of "999" for "999" turns
    And I add player and character "TestBeer02"
    And the server is started
    When I log on as "TestBeer02"
    And I enter the game
    And I rest
    Then I cause "TestBeer01" to log on and enter the game
    And within "4" turns I see the message "TestBeer01_name burps."

Scenario: Beer effect gives the desired output - other player in neighboring cell
    Given I use the "minimal" database as-is
    And I add player and character "TestBeer01"
    And I give the character a "beer" effect of "999" for "999" turns
    And I add player and character "TestBeer02"
    And the server is started
    When I log on as "TestBeer02"
    And I enter the game
    And I move east
    Then I cause "TestBeer01" to log on and enter the game
    And within "1" turns I see the message "TestBeer01_name burps."

# bug - Initial effect occurs twice.
@bug
Scenario: Beer effect gives the desired output - burp only once
    Given I use the "minimal" database as-is
    And I add player and character "TestBeer01"
    And I give the character a "beer" effect of "999" for "999" turns
    And I add player and character "TestBeer02"
    And the server is started
    When I log on as "TestBeer02"
    And I enter the game
    And I move east
    Then I cause "TestBeer01" to log on and enter the game
    And within "2" turns I see the message "TestBeer01_name burps." only once

## Blindness_Cure
Scenario: Blindness Cure cures Blindness
    Given I use the "minimal" database as-is
    And I add player and character "TestBlind01"
    And I give the character a "blind" effect of "1" for "999" turns
    And the server is started
    And I log on as "TestBlind01"
    And I enter the game
    And within "1" turns I see the message "You are blind!"
    # we shouldn't have to wait a turn to be blind; bug?
    # And I saw a message "You are blind!"
    And I exit the game
    And I exit the chat
    And I log out
    When I give the character a "blindness_cure" effect of "1" for "1" turns
    And I log on as "TestBlind01"
    And I enter the game
    Then I did not see a message "You are blind!"

# bug - blindness cure output is not shown when the player enters the game
@bug
Scenario: Blindness Cure gives appropriate output on curing blindness while offline
    Given I use the "minimal" database as-is
    And I add player and character "TestBlind02"
    And I give the character a "blind" effect of "1" for "999" turns
    And the server is started
    And I log on as "TestBlind02"
    And I enter the game
    And I saw a message "You are blind!"
    And I exit the game
    And I exit the chat
    And I log out
    When I give the character a "blindness_cure" effect of "1" for "1" turns
    And I log on as "TestBlind02"
    And I enter the game
    Then within "1" turns I see the message "Your blindness has been cured!"

Scenario: Blindness Cure gives appropriate output on curing blindness while online
    Given I use the "minimal" database as-is
    And I add player and character "TestBlind03"
    And I give the character a "blind" effect of "1" for "999" turns
    And I put a blindness cure in the character's left hand
    And I start the server and play
    And I enter the game
    And I saw a message "You are blind!"
    When I open and drink "bottle"
    Then within "1" turns I see the message "Your blindness has been cured!"

Scenario: Blindness Cure gives no output if not blind
    Given I use the "minimal" database as-is
    And I add player and character "TestBlind04"
    When I give the character a "blindness_cure" effect of "1" for "1" turns
    And the server is started
    And I log on as "TestBlind04"
    And I enter the game
    Then within "2" turns I never see the message "Your blindness has been cured!"

Scenario: Blindness Cure gives appropriate output when wearing off
    Given I use the "minimal" database as-is
    And I add player and character "TestBlind05"
    And I give the character a "blind" effect of "1" for "999" turns
    And the server is started
    And I log on as "TestBlind05"
    And I enter the game
    And within "1" turns I see the message "You are blind!"
    # we shouldn't have to wait a turn to be blind; bug?
    # And I saw a message "You are blind!"
    And I exit the game
    And I exit the chat
    And I log out
    When I give the character a "blindness_cure" effect of "1" for "1" turns
    And I log on as "TestBlind05"
    And I enter the game
    Then within "1" turns I see the message "The Cure Blindness spell has worn off."

## Coffee

Scenario: Coffee increases stamina
    Given I use the "minimal" database as-is
    And I add player and character "TestCoffee01"
    And I set the character's max stamina to "10"
    And I set the character's current stamina to "1"
    And I put a coffee in the character's left hand
    And the server is started
    And I log on as "TestCoffee01"
    And I enter the game
    When I open "bottle"
    And I drink "bottle"
    Then after "1" turns I have a current stamina of "3"

Scenario: Coffee increases stamina past max
    Given I use the "minimal" database as-is
    And I add player and character "TestCoffee02"
    And I set the character's max stamina to "10"
    And I set the character's current stamina to "10"
    And I put a coffee in the character's left hand
    And the server is started
    And I log on as "TestCoffee02"
    And I enter the game
    When I open "bottle"
    And I drink "bottle"
    Then after "1" turns I have a current stamina of "11"

Scenario: Coffee does not increase max stamina
    Given I use the "minimal" database as-is
    And I add player and character "TestCoffee03"
    And I set the character's "strength" stat to "3"
    And I set the character's max stamina to "10"
    And I set the character's current stamina to "10"
    And I put a coffee in the character's left hand
    And I put a stone halberd in the character's right hand
    And the server is started
    And I log on as "TestCoffee03"
    And I enter the game
    When I open "bottle"
    And I drink "bottle"
    And I have a current stamina of "11"
    And I move east
    And I have a current stamina of "10"
    And I rest
    Then I have a current stamina of "10"

## Drake_Potion

Scenario: Drake potion increases constitution
    Given I use the "minimal" database as-is
    And I add player and character "TestDP01"
    And I set the character's "constitution" stat to "10"
    And I put a drake potion in the character's left hand
    And the server is started
    And I log on as "TestDP01"
    And I enter the game
    When I open "bottle"
    And I drink "bottle"
    Then I have a constitution stat of "11"

Scenario: Drake potion doesn't increase constitution beyond Land max
    Given I use the "minimal" database as-is
    And I add player and character "TestDP02"
    And I set the character's "constitution" stat to "18"
    And I put a drake potion in the character's left hand
    And the server is started
    And I log on as "TestDP02"
    And I enter the game
    When I open "bottle"
    And I drink "bottle"
    Then I have a constitution stat of "18"

Scenario: Drake potion increases max HP and heals fully
    Given I use the "minimal" database as-is
    And I add player and character "TestDP03"
    And I set the character's max HP to "10"
    And I set the character's current HP to "5"
    And I put a drake potion in the character's left hand
    And the server is started
    And I log on as "TestDP03"
    And I enter the game
    When I open "bottle"
    And I drink "bottle"
    Then I have a current and max HP of "14"

Scenario: Drake potion increases max stamina and rests fully
    Given I use the "minimal" database as-is
    And I add player and character "TestDP04"
    And I set the character's max stamina to "10"
    And I set the character's current stamina to "5"
    And I put a drake potion in the character's left hand
    And I start the server and play
    When I open "bottle"
    And I drink "bottle"
    Then I have a current stamina of "14"
    And I rest
    And I have a current stamina of "14"

Scenario: Drake potion restores mana fully
    Given I use the "minimal" database as-is
    And I add player and character "TestDP05"
    And I make the character a thief
    And I set the character's max mana to "10"
    And I set the character's current mana to "5"
    And I put a drake potion in the character's left hand
    And I start the server and play
    And I wait for "1" turns
    And I have a current mana of "5"
    When I open "bottle"
    And I drink "bottle"
    Then I have a current mana of "10"

## Mana_Restore

Scenario: Mana restore potion restores mana fully
    Given I use the "minimal" database as-is
    And I add player and character "TestMR01"
    And I make the character a thief
    And I set the character's max mana to "10"
    And I set the character's current mana to "5"
    And I put a "Mana_Restore" potion in the character's left hand
    And I start the server and play
    And I wait for "1" turns
    And I have a current mana of "5"
    When I open and drink "bottle"
    Then I have a current mana of "10"

## Naphtha

Scenario: Naphtha is fatally poisonous at 50 HP
    Given I use the "minimal" database as-is
    And I add player and character "TestNaph01"
    And I set the character's current and max HP to "50"
    And I put a "Naphtha" potion in the character's left hand
    And I start the server and play
    When I open and drink "bottle"
    Then after "2" turns I have a current HP of "35"
    And after "6" turns I have a current HP of "10"
    And within "3" turns I see the message "You have died from poison."

@slow
Scenario: Naphtha is severely poisonous at 80 HP
    Given I use the "minimal" database as-is
    And I add player and character "TestNaph02"
    And I set the character's current and max HP to "80"
    And I put a "Naphtha" potion in the character's left hand
    And I start the server and play
    When I open and drink "bottle"
    Then after "2" turns I have a current HP of "65"
    And after "3" turns I have a current HP of "52"
    And after "3" turns I have a current HP of "40"
    And after "3" turns I have a current HP of "29"
    And after "3" turns I have a current HP of "19"
    And after "3" turns I have a current HP of "10"
    And after "3" turns I have a current HP of "2"
    And within "2" turns I see the message "The Poison spell has worn off."
    And after "3" turns I have a current HP of "3"

## Nitro - marked TODO in server code

## OrcBalm ("Orc Urine")

Scenario: Drinking orc urine is stunning
    Given I use the "minimal" database as-is
    And I add player and character "TestOrcB01"
    And I put an "OrcBalm" potion in the character's left hand
    And I start the server and play
    When I open and drink "bottle"
    Then I saw the message "You are stunned!"
    And within "6" turns I no longer see the message "You are stunned!"

## Permanent_Mana

# TODO: Tests for effects for which there is not an item in the catalog.

## Stamina_Restore

Scenario: Stamina restore potion rests fully
    Given I use the "minimal" database as-is
    And I add player and character "TestSR01"
    And I set the character's max stamina to "10"
    And I set the character's current stamina to "0"
    And I put a "Stamina_Restore" potion in the character's left hand
    And I start the server and play
    And I have a current stamina of "0"
    When I open and drink "bottle"
    Then I have a current stamina of "10"
    And I rest
    And I have a current stamina of "10"

## Water - has no effect
# TODO: test "no effect"

## Wine - has no effect (I call this a bug.)
# TODO: implement wine effect on server and test it here

## Youth_Potion

Scenario: Youth potion restores youth
    Given I use the "minimal" database as-is
    And I add player and character "TestYP01"
    And I set the character's current age to "75000"
    And I put a "Youth_Potion" potion in the character's left hand
    And I start the server and play
    And I have an age of "ancient"
    When I open and drink "bottle"
    Then I saw the message "You feel young again!"
    And I have an age of "young"

Scenario: Youth potion disappoints the young
    Given I use the "minimal" database as-is
    And I add player and character "TestYP02"
    And I set the character's current age to "14000"
    And I put a "Youth_Potion" potion in the character's left hand
    And I start the server and play
    And I have an age of "very young"
    When I open and drink "bottle"
    Then I saw the message "The fluid is extremely bitter."
    And I have an age of "very young"

## HitsMax
## Hits
## Stamina

# TODO: Tests for effects for which there is not an item in the catalog.

## Permanent_Strength

Scenario: Permanent strength increases strength permanently
    Given I use the "minimal" database as-is
    And I add player and character "TestPS01"
    And I set the character's "strength" stat to "10"
    And I put a "Permanent_Strength" potion in the character's left hand
    And I start the server and play
    And I have a "strength" stat of "10"
    When I open and drink "bottle"
    Then I saw the message "You are stunned!"
    And within "3" turns I no longer see the message "You are stunned!"
    And I have a "strength" stat of "11"

Scenario: Permanent strength does not increase beyond Land max
    Given I use the "minimal" database as-is
    And I add player and character "TestPS02"
    And I set the character's "strength" stat to "18"
    And I put a "Permanent_Strength" potion in the character's left hand
    And I start the server and play
    And I have a "strength" stat of "18"
    When I open and drink "bottle"
    Then I saw the message "You are stunned!"
    And within "3" turns I no longer see the message "You are stunned!"
    And I have a "strength" stat of "18"

## Permanent_Dexterity

Scenario: Permanent dexterity increases dexterity permanently
    Given I use the "minimal" database as-is
    And I add player and character "TestPD01"
    And I set the character's "dexterity" stat to "10"
    And I put a "Permanent_Dexterity" potion in the character's left hand
    And I start the server and play
    And I have a "dexterity" stat of "10"
    When I open and drink "bottle"
    Then I saw the message "You are blind!"
    And within "3" turns I no longer see the message "You are blind!"
    And I have a "dexterity" stat of "11"

Scenario: Permanent dexterity does not increase beyond Land max
    Given I use the "minimal" database as-is
    And I add player and character "TestPD02"
    And I set the character's "dexterity" stat to "18"
    And I put a "Permanent_Dexterity" potion in the character's left hand
    And I start the server and play
    And I have a "dexterity" stat of "18"
    When I open and drink "bottle"
    Then I saw the message "You are blind!"
    And within "3" turns I no longer see the message "You are blind!"
    And I have a "dexterity" stat of "18"

## Permanent_Intelligence, Permanent_Wisdom, Permanent_Constitution, Permanent_Charisma

Scenario Outline: Permanent stat potion increases stat permanently
    Given I use the "minimal" database as-is
    And I add player and character "TestPS01"
    And I set the character's "<stat>" stat to "<init>"
    And I create an "<effect>" potion of amount "<amount>" and duration "0"
    And I put the item in the character's left hand
    And I start the server and play
    And I have a "<stat>" stat of "<init>"
    When I open and drink "bottle"
    And I have a "<stat>" stat of "<expect>"
Examples:
| stat         | effect                 | init | amount | expect |
| intelligence | Permanent_Intelligence | 10   | 1      | 11     |
| intelligence | Permanent_Intelligence | 18   | 2      | 18     |
| constitution | Permanent_Constitution | 10   | 3      | 13     |
| constitution | Permanent_Constitution | 18   | 2      | 18     |
| charisma     | Permanent_Charisma     | 10   | 1      | 11     |
| charisma     | Permanent_Charisma     | 18   | 2      | 18     |
| wisdom       | Permanent_Wisdom       | 10   | 3      | 13     |
| wisdom       | Permanent_Wisdom       | 18   | 2      | 18     |

## Temporary_Strength, Temporary_Dexterity, Temporary_Intelligence, Temporary_Wisdom,
##   Temporary_Constitution, Temporary_Charisma
# Note: We're also verifying that we get temporary boosts even if we're at the max for the Land.

Scenario Outline: Temporary stat potion increases stat temporarily
    Given I use the "minimal" database as-is
    And I add player and character "TestTS01"
    And I set the character's "<stat>" stat to "<init>"
    And I create an "<effect>" potion of amount "<amount>" and duration "2"
    And I put the item in the character's left hand
    And I start the server and play
    And I have a "<stat>" stat of "<init>"
    When I open and drink "bottle"
    And I have a temporary "<stat>" stat of "<amount>"
    And I rest
    And I have a temporary "<stat>" stat of "0"
Examples:
| stat         | effect                 | init | amount |
| strength     | Temporary_Strength     | 10   | 1      |
| strength     | Temporary_Strength     | 18   | 2      |
| dexterity    | Temporary_Dexterity    | 10   | 3      |
| dexterity    | Temporary_Dexterity    | 18   | 2      |
| intelligence | Temporary_Intelligence | 10   | 1      |
| intelligence | Temporary_Intelligence | 18   | 2      |
| constitution | Temporary_Constitution | 10   | 3      |
| constitution | Temporary_Constitution | 18   | 2      |
| charisma     | Temporary_Charisma     | 10   | 1      |
| charisma     | Temporary_Charisma     | 18   | 2      |
| wisdom       | Temporary_Wisdom       | 10   | 3      |
| wisdom       | Temporary_Wisdom       | 18   | 2      |

# TODO: Stack temporary effects

## Shield

# Notes:
# Temporary character attribute "Shielding"; there is a Land.MaxShielding.
# Land max is 9 in the current db.
# Visible via command 'show effects' as "Total Shielding = <value>".
# Value is subtracted from armor class for ranged attacks, half for melee.

Scenario: Temporary shield potion increases shield temporarily
    Given I use the "minimal" database as-is
    And I add player and character "TestTS02"
    And I create a "shield" potion of amount "5" and duration "2"
    And I put the item in the character's left hand
    And I start the server and play
    And I have a shielding of "0"
    When I open and drink "bottle"
    Then I have a shielding of "5"
    And I rest
    And I have a shielding of "0"

Scenario: Temporary shield potion maxes out at Land max
    Given I use the "minimal" database as-is
    And I add player and character "TestTS03"
    And I create a "shield" potion of amount "10" and duration "2"
    And I put the item in the character's left hand
    And I start the server and play
    And I have a shielding of "0"
    When I open and drink "bottle"
    Then I have a shielding of "9"
    And I rest
    And I have a shielding of "0"

# bug - rather than having the amount updated, we wind up with 0?
@bug
Scenario: Multiple temporary shield potions
    Given I use the "minimal" database as-is
    And I add player and character "TestTS04"
    And I create a "shield" potion of amount "6" and duration "99"
    And I put the item in the character's right hand
    And I create a "shield" potion of amount "9" and duration "99"
    And I put the item in the character's left hand
    And I start the server and play
    And I have a shielding of "0"
    When I open and drink "bottle"
    Then I have a shielding of "6"
    And I drop "right"
    And I open and drink "bottle"
    And I have a shielding of "9"

## Resistance and Protection effects
# TODO - verify no unintended resistance/protection
Scenario Outline: Resistance and protection potions have desired effects
    Given I use the "minimal" database as-is
    And I add player and character "TestRP01"
    And I create an "<effect>" potion of amount "<amt>" and duration "3"
    And I put the item in the character's left hand
    And I start the server and play
    And I have a "<resist>" resistance of "0"
    And I have a "<protect>" protection of "0"
    When I open and drink "bottle"
    And I have a "<resist>" resistance of "<resistamt>"
    And I have a "<protect>" protection of "<protectamt>"
    And I rest
    And I have a "<resist>" resistance of "0"
    And I have a "<protect>" protection of "0"
Examples:
| effect                         | amt | resist    | resistamt | protect | protectamt |
| Protection_from_Fire           | 2   | Fire      | 1         | Fire    | 2          |
| Protection_from_Cold           | 3   | Ice       | 1         | Ice     | 3          |
| Protection_from_Fire_and_Ice   | 4   | Fire      | 1         | Fire    | 4          |
| Protection_from_Fire_and_Ice   | 5   | Ice       | 1         | Ice     | 5          |
| Protection_from_Poison         | 6   | Poison    | 1         | Poison  | 6          |
| Protection_from_Stun_and_Death | 8   | Death     | 1         | Death   | 8          |
| Protection_from_Stun_and_Death | 9   | Stun      | 1 | | |
| Protection_from_Blind_and_Fear | 7   | Blind     | 1 | | |
| Protection_from_Blind_and_Fear | 8   | Fear      | 1 | | |
| Resist_Fear                    | 7   | Fear      | 1 | | |
| Resist_Blind                   | 0   | Blind     | 1 | | |
| Resist_Stun                    | 5   | Stun      | 1 | | |
| Resist_Lightning               | 0   | Lightning | 1 | | |

# bug? - Resist_Death adds death resistance but removes death protection when it wears off
# NOTE: Merge with other test when fixed.
@bug
Scenario Outline: Death resistance potion has desired effect
    Given I use the "minimal" database as-is
    And I add player and character "TestRP02"
    And I create an "<effect>" potion of amount "<amt>" and duration "3"
    And I put the item in the character's left hand
    And I start the server and play
    And I have a "<resist>" resistance of "0"
    And I have a "<protect>" protection of "0"
    When I open and drink "bottle"
    And I have a "<resist>" resistance of "<resistamt>"
    And I have a "<protect>" protection of "<protectamt>"
    And I rest
    And I have a "<resist>" resistance of "0"
    And I have a "<protect>" protection of "0"
Examples:
| effect                         | amt | resist    | resistamt | protect | protectamt |
| Resist_Death                   | 3   | Death     | 1 | | |

## Bless

Scenario: Bless potion has desired effect
    Given I use the "minimal" database as-is
    And I add player and character "TestBP01"
    And I set the character's "dexterity" stat to "10"
    And I set the character's "constitution" stat to "8"
    And I create an "Bless" potion of amount "0" and duration "6"
    And I put the item in the character's left hand
    And I start the server and play
    When I open and drink "bottle"
    And I have a "dexterity" stat of "10"
    And I have a temporary "dexterity" stat of "1"
    And I have a "constitution" stat of "8"
    And I have a temporary "constitution" stat of "1"
    And I have a shielding of "1"
    And I rest
    And I have a "dexterity" stat of "10"
    And I have a temporary "dexterity" stat of "0"
    And I have a "constitution" stat of "8"
    And I have a temporary "constitution" stat of "0"
    And I have a shielding of "0"

Scenario: Multiple bless potions have desired effect (i.e. they don't stack)
    Given I use the "minimal" database as-is
    And I add player and character "TestBP02"
    And I set the character's "dexterity" stat to "10"
    And I set the character's "constitution" stat to "8"
    And I create an "Bless" potion of amount "99" and duration "6"
    And I put the item in the character's left hand
    And I put the item in the character's right hand
    And I start the server and play
    When I open and drink "bottle"
    And I drop "right"
    And I open and drink "bottle"
    And I have a "dexterity" stat of "10"
    And I have a temporary "dexterity" stat of "1"
    And I have a "constitution" stat of "8"
    And I have a temporary "constitution" stat of "1"
    And I have a shielding of "1"
    And I rest
    And I have a "dexterity" stat of "10"
    And I have a temporary "dexterity" stat of "0"
    And I have a "constitution" stat of "8"
    And I have a temporary "constitution" stat of "0"
    And I have a shielding of "0"

## Hide_In_Shadows
# Appears to have no effect

## Peek
# Requires a caster, not just a target

## Wizard_Eye
Scenario: Wizard Eye potion results in OOBE
    Given I use the "minimal" database as-is
    And I add player and character "TestHS01"
    And I create an "Wizard_Eye" potion of amount "0" and duration "2"
    And I put the item in the character's left hand
    And I start the server and play
    When I open and drink "bottle"
    Then I saw myself
    And I see my doppelganger in a trance
    And I rest
    And I did not see myself

Scenario: Wizard Eye potion effect visible by others
    Given I use the "minimal" database as-is
    And I add player and character "TestHS01"
    And I create a "Wizard_Eye" potion of amount "0" and duration "50"
    And I put the item in the character's left hand
    And I start the server and play
    When I open and drink "bottle"
    And I add player and character "TestHS02"
    And I log on as "TestHS02"
    And I enter the game
Joe Libipl's avatar
Joe Libipl committed
770 771
    Then I saw a "toad"
    And I see "TestHS01_name" in a trance