Tweak turrets

This commit is contained in:
2022-07-28 13:46:22 +01:00
parent 8aeabf3f6c
commit ec4ff84c46
10 changed files with 337 additions and 308 deletions
+20 -1
View File
@@ -6,9 +6,10 @@ module Dodge.Item.Draw (
) where
import Control.Lens
import Data.Maybe
import Dodge.Creature.HandPos
import Dodge.Data.Creature
import Dodge.Item.Draw.SPic
import Dodge.Item.Equipment.Shape
import Dodge.Item.HeldOffset
import ShapePicture
@@ -18,3 +19,21 @@ itemEquipPict cr it = case it ^. itUse of
ituse -> case ituse ^? equipEffect of
Just _ -> pictureOnEquip (itemSPic it) cr it
Nothing -> mempty
pictureOnEquip :: SPic -> Creature -> Item -> SPic
pictureOnEquip sp cr itm = fromMaybe mempty $ do
i <- itm ^? itLocation . ipInvID
epos <- cr ^? crInvEquipped . ix i
return $ equipPosition epos cr sp
equipPosition :: EquipPosition -> Creature -> SPic -> SPic
equipPosition epos cr sh = case epos of
OnLeftWrist -> translateToLeftWrist cr sh
OnRightWrist -> translateToRightWrist cr sh
OnLegs ->
translateToLeftLeg cr sh
<> translateToRightLeg cr (mirrorSPxz sh)
OnHead -> translateToHead cr sh
OnChest -> translateToChest cr sh
OnBack -> translateToBack cr sh
OnSpecial -> sh