about summary refs log tree commit diff
path: root/src/Xanthous/App.hs
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2019-12-23T15·47-0500
committerGriffin Smith <root@gws.fyi>2019-12-23T15·47-0500
commit8ecefddbd4cc9c79478003781877d37b3c80fcc4 (patch)
tree049cc0e8f075cf906442549ce7aec375808aeaaf /src/Xanthous/App.hs
parent6622dd301860765ed16f29f74c9d1348d3aa0d41 (diff)
Use wielded items to calculate damage
Use whatever items the character has wielded, if any, to calculate the
damage they deal when attacking. Currently this shortcuts handedness to
just use the *first* item they have equipped, which is fine since it's
currently only possible to equip something in the right hand.
Diffstat (limited to 'src/Xanthous/App.hs')
-rw-r--r--src/Xanthous/App.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Xanthous/App.hs b/src/Xanthous/App.hs
index 77fbf36850..b278eec237 100644
--- a/src/Xanthous/App.hs
+++ b/src/Xanthous/App.hs
@@ -238,7 +238,7 @@ handleCommand ShowInventory = showPanel InventoryPanel >> continue
 handleCommand Wield = do
   uses (character . inventory . backpack)
        (V.mapMaybe (\item ->
-                      (WieldedItem item) <$> item ^. Item.itemType . wieldable))
+                      WieldedItem item <$> item ^. Item.itemType . wieldable))
     >>= \case
       Empty -> say_ ["wield", "nothing"]
       wieldables ->
@@ -431,7 +431,7 @@ attackAt pos =
       $ \(MenuResult creature) -> attackCreature creature
  where
   attackCreature (creatureID, creature) = do
-    charDamage <- use $ character . characterDamage
+    charDamage <- uses character characterDamage
     let creature' = Creature.damage charDamage creature
         msgParams = object ["creature" A..= creature']
     if Creature.isDead creature'