Start restructuring Item datatype

This commit is contained in:
2021-11-27 12:48:23 +00:00
parent fe37f208da
commit bfdac2fad5
16 changed files with 56 additions and 55 deletions
+5 -5
View File
@@ -23,7 +23,7 @@ rewindGun = defaultGun
, _wpMaxAmmo = 0
, _wpLoadedAmmo = 0
, _itEffect = ItRewindEffect rewindEffect []
, _itUse = Left $ \cr invid -> useRewindGun (_crInv cr IM.! invid) cr
, _itUse = LeftUse $ \cr invid -> useRewindGun (_crInv cr IM.! invid) cr
}
rewindEffect :: ItEffect -> Creature -> Int -> World -> World
rewindEffect _ cr invid w
@@ -59,7 +59,7 @@ shrinkGun = defaultGun
, _itUseRate = 0
, _itUseTime = 0
, _itAimStance = TwoHandFlat
, _itUse = Left $ \cr invid -> useShrinkGun (_crInv cr IM.! invid) cr
, _itUse = LeftUse $ \cr invid -> useShrinkGun (_crInv cr IM.! invid) cr
, _itUseModifiers =
[ ammoCheckI
, hammerCheckI
@@ -96,7 +96,7 @@ blinkGun = defaultGun
, _wpReloadState = 0
, _itUseRate = 0
, _itUseTime = 0
, _itUse = Left $ hammerCheckL $ shootL aSelfL
, _itUse = LeftUse $ hammerCheckL $ shootL aSelfL
, _itUseModifiers =
[ ammoCheckI
, hammerCheckI
@@ -118,12 +118,12 @@ aSelfL cr _ = blinkAction cr
effectGun :: String -> (Creature -> World -> World) -> Item
effectGun name eff = defaultGun
{ _itName = name ++ "Gun"
, _itUse = Right $ const eff
, _itUse = RightUse $ const eff
}
autoEffectGun :: String -> (Creature -> World -> World) -> Item
autoEffectGun name eff = defaultAutoGun
{ _itName = name ++ "Gun"
, _itUse = Right $ const eff
, _itUse = RightUse $ const eff
}
forceFieldGun :: Item
forceFieldGun = defaultGun