Start refactoring held item use

This commit is contained in:
2022-07-20 16:03:35 +01:00
parent 2c6e5e818a
commit eeb98eb151
18 changed files with 164 additions and 109 deletions
+13 -13
View File
@@ -101,25 +101,25 @@ unsafeBlinkGun = blinkGun
& itUse . lUse .~ hammerCheckL (shootL $ const unsafeBlinkAction)
& itUse . eqEq . eqViewDist ?~ 400
effectGun :: String -> (Creature -> World -> World) -> Item
effectGun name eff = defaultWeapon
{ _itUse = defaultrUse
& rUse .~ const eff
& useMods .~ [hammerCheckI]
}
& itType . iyBase .~ EFFGUN name
autoEffectGun :: String -> (Creature -> World -> World) -> Item
autoEffectGun name eff = defaultWeapon
{ _itUse = defaultrUse {_rUse = const eff}
}
& itType . iyBase .~ AUTOEFFGUN name
--effectGun :: String -> (Creature -> World -> World) -> Item
--effectGun name eff = defaultWeapon
-- { _itUse = defaultrUse
-- & rUse .~ const eff
-- & useMods .~ [hammerCheckI]
-- }
-- & itType . iyBase .~ EFFGUN name
--autoEffectGun :: String -> (Creature -> World -> World) -> Item
--autoEffectGun name eff = defaultWeapon
-- { _itUse = defaultrUse {_rUse = const eff}
-- }
-- & itType . iyBase .~ AUTOEFFGUN name
forceFieldGun :: Item
forceFieldGun = defaultWeapon
{ _itConsumption = defaultLoadable & laAmmoType .~ ForceFieldAmmo forceField
, _itTargeting = targetRBPress & tgDraw .~ targetDistanceDraw
, _itParams = ParamMID Nothing
}
& itUse . rUse .~ useForceFieldGun
& itUse . rUse .~ HeldForceField --useForceFieldGun
& itUse . useDelay .~ NoDelay
& itUse . useMods .~
[ hammerCheckI , ammoCheckI , useAmmoAmount 1]