Skip to content

Commit

Permalink
Tests for Harvest and Status.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielBingham committed Jan 13, 2024
1 parent 3b3c6d1 commit b61cd8c
Show file tree
Hide file tree
Showing 5 changed files with 595 additions and 6 deletions.
51 changes: 50 additions & 1 deletion data/characters/gird.json
Original file line number Diff line number Diff line change
@@ -1 +1,50 @@
{"name": "gird", "description": "", "details": "", "sex": "male", "position": "standing", "speed": "walking", "attributes": {"strength": 10, "maxStrength": 10, "stamina": 10, "maxStamina": 10, "constitution": 10, "maxConstitution": 10}, "reserves": {"calories": 1934, "maxCalories": 2400, "thirst": 3414, "maxThirst": 4000, "sleep": 12, "maxSleep": 16}, "bodyType": "bipedal", "body": {"wounds": {}, "worn": {}}, "inventory": ["pile of serviceberries", "pile of serviceberries", "handful of serviceberries", "handful of serviceberries", "handful of serviceberries", "handful of serviceberries", "handful of serviceberries", "handful of serviceberries", "handful of serviceberries", "handful of serviceberries", "handful of serviceberries", "handful of serviceberries", "pile of serviceberries", "pile of serviceberries", "pile of serviceberries", "pile of serviceberries", "pile of serviceberries", "pile of serviceberries"], "room": 5166}
{
"attributes": {
"constitution": 10,
"maxConstitution": 10,
"maxStamina": 10,
"maxStrength": 10,
"stamina": 10,
"strength": 10
},
"body": {
"worn": {},
"wounds": {}
},
"bodyType": "bipedal",
"description": "",
"details": "",
"inventory": [
"pile of serviceberries",
"pile of serviceberries",
"handful of serviceberries",
"handful of serviceberries",
"handful of serviceberries",
"handful of serviceberries",
"handful of serviceberries",
"handful of serviceberries",
"handful of serviceberries",
"handful of serviceberries",
"handful of serviceberries",
"handful of serviceberries",
"pile of serviceberries",
"pile of serviceberries",
"pile of serviceberries",
"pile of serviceberries",
"pile of serviceberries",
"pile of serviceberries"
],
"name": "gird",
"position": "standing",
"reserves": {
"calories": 1934,
"maxCalories": 2400,
"maxSleep": 16,
"maxThirst": 4000,
"sleep": 12,
"thirst": 3414
},
"room": 5166,
"sex": "male",
"speed": "walking"
}
3 changes: 2 additions & 1 deletion game/commands/crafting.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ def finish(self, player, cancelled=False):
player.write("\nYou didn't harvest long enough to produce anything.")
return


if harvest.consumed:
if in_inventory:
player.character.inventory.remove(item)
Expand All @@ -173,7 +174,7 @@ def finish(self, player, cancelled=False):
else:
harvest.harvested = True

player.write("\nYou " + harvest.action + " " + results + " from " + item.description + ".")
player.write("\nYou %s %s from %s." % (harvest.action, results, item.description))
self.library.room.writeToRoom(player.character,
"%s %s from %s." %
(player.character.name, harvest.action, item.description))
Expand Down
4 changes: 2 additions & 2 deletions game/store/models/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ def fromJson(self, data):

self.consumed = data['consumed']

if 'replaceWith' in data:
self.replace_with = data['replaceWith']
if 'replacedWith' in data:
self.replaced_with = data['replacedWith']

self.calories = data['calories']
self.time = data['time']
Expand Down
Loading

0 comments on commit b61cd8c

Please sign in to comment.