Push item use delay inside datatype, currently broken

This commit is contained in:
2021-11-27 16:37:30 +00:00
parent 224db733f6
commit 8639b2d428
21 changed files with 162 additions and 177 deletions
+5 -19
View File
@@ -25,7 +25,7 @@ rewindGun = defaultGun
, _wpCharge = 0
}
, _itEffect = ItRewindEffect rewindEffect []
, _itUse = LeftUse $ \cr invid -> useRewindGun (_crInv cr IM.! invid) cr
, _itUse = defaultlUse {_lUse = \cr invid -> useRewindGun (_crInv cr IM.! invid) cr}
}
rewindEffect :: ItEffect -> Creature -> Int -> World -> World
rewindEffect _ cr invid w
@@ -60,14 +60,8 @@ shrinkGun = defaultGun
, _wpLoadedAmmo = 100
, _wpReloadTime = 20
}
, _itUseRate = 0
, _itUseTime = 0
, _itAimStance = TwoHandFlat
, _itUse = LeftUse $ \cr invid -> useShrinkGun (_crInv cr IM.! invid) cr
, _itUseModifiers =
[ ammoCheckI
, hammerCheckI
]
, _itUse = defaultlUse {_lUse = \cr invid -> useShrinkGun (_crInv cr IM.! invid) cr}
, _wpSpread = 0.05
, _wpRange = 20
, _itFloorPict = shrinkGunPic
@@ -99,13 +93,7 @@ blinkGun = defaultGun
, _wpLoadedAmmo = 100
, _wpReloadTime = 20
}
, _itUseRate = 0
, _itUseTime = 0
, _itUse = LeftUse $ hammerCheckL $ shootL aSelfL
, _itUseModifiers =
[ ammoCheckI
, hammerCheckI
]
, _itUse = defaultlUse {_lUse = hammerCheckL $ shootL aSelfL}
, _wpSpread = 0.05
, _wpRange = 20
, _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ polygon $ map toV2[(-2,-2),(-2,2),(2,2),(2,0),(0,0),(0,-2)]
@@ -123,12 +111,12 @@ aSelfL cr _ = blinkAction cr
effectGun :: String -> (Creature -> World -> World) -> Item
effectGun name eff = defaultGun
{ _itName = name ++ "Gun"
, _itUse = RightUse $ const eff
, _itUse = defaultrUse {_rUse = const eff}
}
autoEffectGun :: String -> (Creature -> World -> World) -> Item
autoEffectGun name eff = defaultAutoGun
{ _itName = name ++ "Gun"
, _itUse = RightUse $ const eff
, _itUse = defaultrUse {_rUse = const eff}
}
forceFieldGun :: Item
forceFieldGun = defaultGun
@@ -140,8 +128,6 @@ forceFieldGun = defaultGun
, _wpReloadTime = 40
, _wpReloadState = 0
}
, _itUseRate = 10
, _itUseTime = 0
, _itUse = undefined
, _wpSpread = 0.02
, _wpRange = 20