diff options
| author | troido <troido@protonmail.com> | 2020-03-04 16:10:32 +0100 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2020-03-04 16:10:32 +0100 |
| commit | f8364fb636a8e9276939ae8523966b038388e4ff (patch) | |
| tree | 8edd2f48cda4f2d605cec6df3ca4ec3a974de009 /src/playerstate.rs | |
| parent | 21919636f95a1214b7ed1a3e4aa6527f45b9d073 (diff) | |
added loot/harvest
Diffstat (limited to 'src/playerstate.rs')
| -rw-r--r-- | src/playerstate.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/playerstate.rs b/src/playerstate.rs index c7b5f8c..9d84e5c 100644 --- a/src/playerstate.rs +++ b/src/playerstate.rs @@ -105,14 +105,14 @@ impl PlayerState { inventory: items, health: val.get("health").ok_or(aerr!("player json does not have health"))?.as_i64().ok_or(aerr!("player health not a number"))?, inventory_capacity: inventory.get("capacity").ok_or(aerr!("inventory does no have capacity"))?.as_i64().ok_or(aerr!("inventory capacity not a number"))? as usize, - maximum_health: val.get("maxhealth").ok_or(aerr!("player json does not have maxhealth"))?.as_i64().ok_or(aerr!("maxhealh not a number"))? + maximum_health: val.get("maxhealth").ok_or(aerr!("player json does not have maxhealth"))?.as_i64().ok_or(aerr!("maxhealth not a number"))? }) } pub fn respawn(&mut self) { self.room = None; self.pos = RoomPos::Unknown; - self.health = self.maximum_health; + self.health = self.maximum_health / 2; } pub fn construct(&self, encyclopedia: &Encyclopedia) -> PreEntity { |
