First, the coffee, which increases stamina temporarily. It should be easy to confirm that it does,
independent of whether we are already at max stamina or not.
Scenario: Coffee increases stamina
Given I use the "minimal" database
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
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"
But we want to make sure it isn’t increasing max stamina. The boring way would be to log out the
character and check the database, or use a debug command to output the character’s stats (the
player doesn’t seem to be able to see their max stamina, for some reason).
Instead we will find a way to tire a character whose stamina has been boosted by coffee, then have
them rest, and make sure their stamina stops at max. So let’s make a weak character, throw a very
heavy weapon in their hand, and make them walk; that should do it.
Scenario: Coffee does not increase max stamina
Given I use the "minimal" database
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"
For reference, the stone halberd weighs 112.1 units, compared to an iron shortsword which weighs 3.
I’m not super-happy with this test, but it does work to prove that the max stamina is not being
increased.
Believe it or not, in this game, “Drake’s Blood” is ambiguous. In the item catalog there are:
Drake Blood (Quest): A large steel vial which “contains the blood of a lightning drake”, but is
just a quest item and cannot be drunk.
Drake Potion (Con Only): A large porcelain vial with no further description, which has the
Permanent_Constitution effect. Nice, but not the effect we’re looking for now.
Drake Potion: A small porcelain vial, which has the Drake_Potion effect. Bingo!
Drake Potion (mother of pearl): A mother-of-pearl bottle, etched with delicate tracery, which
also has the Drake_Potion effect. But has only a hundredth of the coin value of the normal Drake
Potion. Maybe that’s backwards..?
Scenario: Drake potion increases constitution
Given I use the "minimal" database
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
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
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
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 the server is started
And I log on as "TestDP04"
And I enter the game
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
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 the server is started
And I log on as "TestDP05"
And I enter the game
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"
We had to add some more stat tweaking and stat checking code, but we’ll be using that a lot
anyway. These tests I’m fairly happy with.
In the process, though, I’ve created some fairly ugly test code in the steps. Too much repetition
in handling the various stats. Need to deal with that. Tomorrow.