about summary refs log tree commit diff
path: root/users/grfn/xanthous/src/Xanthous/Entities/Character.hs
diff options
context:
space:
mode:
Diffstat (limited to 'users/grfn/xanthous/src/Xanthous/Entities/Character.hs')
-rw-r--r--users/grfn/xanthous/src/Xanthous/Entities/Character.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/users/grfn/xanthous/src/Xanthous/Entities/Character.hs b/users/grfn/xanthous/src/Xanthous/Entities/Character.hs
index c18d726a4bfd..f27ed1e475d6 100644
--- a/users/grfn/xanthous/src/Xanthous/Entities/Character.hs
+++ b/users/grfn/xanthous/src/Xanthous/Entities/Character.hs
@@ -32,6 +32,7 @@ module Xanthous.Entities.Character
   , mkCharacter
   , pickUpItem
   , isDead
+  , isFullyHealed
   , damage
   ) where
 --------------------------------------------------------------------------------
@@ -264,6 +265,11 @@ characterDamage
   = fromMaybe defaultCharacterDamage
   . preview (inventory . wielded . wieldedItems . wieldableItem . Raw.damage)
 
+-- | Is the character fully healed up to or past their initial hitpoints?
+isFullyHealed :: Character -> Bool
+isFullyHealed = (>= initialHitpoints) . characterHitpoints
+
+-- | Is the character dead?
 isDead :: Character -> Bool
 isDead = (== 0) . characterHitpoints