Implement combat

Put a bunch of gormlaks randomly on the level, and implement combat via
damaging those gormlaks by one point.
This commit is contained in:
Griffin Smith 2019-09-21 12:43:54 -04:00
parent dd16166665
commit d632a30d05
7 changed files with 96 additions and 35 deletions

View file

@ -3,6 +3,7 @@ module Xanthous.Entities.Character
( Character(..)
, characterName
, inventory
, characterDamage
, mkCharacter
, pickUpItem
) where
@ -22,6 +23,7 @@ import Xanthous.Entities.Item
data Character = Character
{ _inventory :: !(Vector Item)
, _characterName :: !(Maybe Text)
, _characterDamage :: !Word
}
deriving stock (Show, Eq, Generic)
deriving anyclass (CoArbitrary, Function)
@ -50,6 +52,7 @@ mkCharacter :: Character
mkCharacter = Character
{ _inventory = mempty
, _characterName = Nothing
, _characterDamage = 1
}
pickUpItem :: Item -> Character -> Character