This commit is contained in:
2022-06-08 22:14:50 +01:00
parent b90e8a2118
commit 970858e129
9 changed files with 41 additions and 40 deletions
+8 -8
View File
@@ -136,8 +136,8 @@ flatShieldEquipSPic _ =
)
effectOnEquip :: (Creature -> Item -> World -> World) -> ItEffect
effectOnEquip f = ItInvEffectID
{ _itInvEffect = g f
, _itEffectID = Nothing
{ _ieInv = g f
, _ieMID = Nothing
}
where
g f' itm cr w
@@ -167,9 +167,9 @@ shieldWallDamage dm _ crid w = case _dmType dm of
_ -> w
createShieldWall :: Creature -> Int -> World -> World
createShieldWall cr invid w = case _itEffectID $ _itEffect it of
createShieldWall cr invid w = case _ieMID $ _itEffect it of
Nothing -> let (wlid,w') = createWall ((shieldWall crid) {_wlLine = wlline,_wlID = wlid}) w
in w' & creatures . ix crid . crInv . ix invid . itEffect . itEffectID ?~ wlid
in w' & creatures . ix crid . crInv . ix invid . itEffect . ieMID ?~ wlid
Just wid -> moveWallID wid wlline w
where
crid = _crID cr
@@ -183,10 +183,10 @@ createShieldWall cr invid w = case _itEffectID $ _itEffect it of
therot | crIsAiming cr = vNormal
| otherwise = rotateV (twoFlatHRot cr) . vNormal
removeShieldWall :: Creature -> Int -> World -> World
removeShieldWall cr invid w = case _itEffectID $ _itEffect it of
removeShieldWall cr invid w = case _ieMID $ _itEffect it of
Nothing -> w
Just wid -> w & deleteWallID wid
& creatures . ix crid . crInv . ix invid . itEffect . itEffectID .~ Nothing
& creatures . ix crid . crInv . ix invid . itEffect . ieMID .~ Nothing
where
crid = _crID cr
it = _crInv (_creatures w IM.! crid) IM.! invid
@@ -196,8 +196,8 @@ effectOnOffHeld
-> (Creature -> Int -> World -> World) -- ^ effect when not held
-> ItEffect
effectOnOffHeld f f' = ItInvEffectID
{ _itInvEffect = g
, _itEffectID = Nothing
{ _ieInv = g
, _ieMID = Nothing
}
where
g itm cr w