Skip to content

Commit

Permalink
Regain health when you gain an item
Browse files Browse the repository at this point in the history
  • Loading branch information
chendrix committed Jul 3, 2015
1 parent e12c5fb commit 6bf3c03
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Rogue/Update.elm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ update input ({gameMap,player,playerLocation} as game) =
updatePlayer : Cell -> Player -> Player
updatePlayer cell player =
case cell of
Open {items} -> {player | inventory <- player.inventory `append` items}
Open {items} -> { player
| inventory <- player.inventory `append` items
, hp <- player.hp + toFloat (List.length items)
}
otherwise -> player

updateGameMap : Location -> GameMap -> GameMap
Expand Down

0 comments on commit 6bf3c03

Please sign in to comment.