Improve left use equipment interaction with general equipment

This commit is contained in:
2022-05-23 16:59:24 +01:00
parent c2770e6b5c
commit fa82923a12
4 changed files with 33 additions and 8 deletions
+8 -5
View File
@@ -9,7 +9,7 @@ import Dodge.Default.Weapon
--import Sound.Data
import Geometry
import Picture
import qualified IntMapHelp as IM
--import qualified IntMapHelp as IM
import Shape
import ShapePicture
@@ -27,7 +27,9 @@ rewindGun = defaultGun
, _wpCharge = 0
}
, _itEffect = ItRewindEffect rewindEffect []
, _itUse = defaultlUse {_lUse = useRewindGun}
, _itUse = defaultlUse
& lUse .~ useRewindGun
& eqSite .~ GoesOnChest
}
rewindEffect :: Item -> Creature -> World -> World
rewindEffect itm cr w
@@ -38,7 +40,7 @@ rewindEffect itm cr w
where
invid = fromJust $ _itInvPos itm
ptrWpCharge = creatures . ix (_crID cr) . crInv . ix invid . itConsumption . wpCharge
maxcharge = _wpMaxCharge . _itConsumption $ _crInv cr IM.! invid
maxcharge = _wpMaxCharge . _itConsumption $ itm
w' = w & rewindWorlds .~ []
& timeFlow .~ NormalTimeFlow
@@ -99,8 +101,9 @@ blinkGun = defaultGun
, _reloadTime = 20
}
, _itUse = defaultlUse
{_lUse = hammerCheckL $ shootL aSelfL
} & useHammer .~ upHammer
& lUse .~ hammerCheckL (shootL aSelfL)
& useHammer .~ upHammer
& eqSite .~ GoesOnWrist
-- , _itFloorPict = const . noPic . colorSH chartreuse $ upperPrismPoly 2 $ square 2
}