Allow to equip left click items

This commit is contained in:
2021-11-27 02:01:12 +00:00
parent 774808663a
commit e7ea7377e2
21 changed files with 93 additions and 116 deletions
+5 -8
View File
@@ -22,9 +22,8 @@ rewindGun = defaultGun
, _itIdentity = Rewinder
, _wpMaxAmmo = 0
, _wpLoadedAmmo = 0
, _itUse = useRewindGun
, _itEffect = ItRewindEffect rewindEffect []
, _itLeftClickUse = Just $ \cr invid -> useRewindGun (_crInv cr IM.! invid) cr
, _itUse = Left $ \cr invid -> useRewindGun (_crInv cr IM.! invid) cr
}
rewindEffect :: ItEffect -> Creature -> Int -> World -> World
rewindEffect _ cr invid w = w & rewindWorlds %~ (take 250 . (w' : ))
@@ -57,12 +56,11 @@ shrinkGun = defaultGun
, _itUseRate = 0
, _itUseTime = 0
, _itAimStance = TwoHandFlat
, _itUse = useShrinkGun
, _itUse = Left $ \cr invid -> useShrinkGun (_crInv cr IM.! invid) cr
, _itUseModifiers =
[ ammoCheckI
, hammerCheckI
]
, _itLeftClickUse = Nothing
, _wpSpread = 0.05
, _wpRange = 20
, _itFloorPict = shrinkGunPic
@@ -95,12 +93,11 @@ blinkGun = defaultGun
, _wpReloadState = 0
, _itUseRate = 0
, _itUseTime = 0
, _itUse = const blinkAction
, _itUse = Left $ hammerCheckL $ shootL aSelfL
, _itUseModifiers =
[ ammoCheckI
, hammerCheckI
]
, _itLeftClickUse = Just $ 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)]
@@ -118,12 +115,12 @@ aSelfL cr _ = blinkAction cr
effectGun :: String -> (Creature -> World -> World) -> Item
effectGun name eff = defaultGun
{ _itName = name ++ "Gun"
, _itUse = const eff
, _itUse = Right $ const eff
}
autoEffectGun :: String -> (Creature -> World -> World) -> Item
autoEffectGun name eff = defaultAutoGun
{ _itName = name ++ "Gun"
, _itUse = const eff
, _itUse = Right $ const eff
}
forceFieldGun :: Item
forceFieldGun = defaultGun