Refactor, try to limit dependencies
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
module Dodge.Item.Weapon.Utility where
|
||||
|
||||
import Dodge.Default.Item.Use
|
||||
import Control.Lens
|
||||
import Data.Maybe
|
||||
import Dodge.Base.Coordinate
|
||||
import Dodge.Data
|
||||
import Dodge.Data.World
|
||||
import Dodge.Default
|
||||
import Dodge.Item.Weapon.ExtraEffect
|
||||
import Dodge.Wall.ForceField
|
||||
import Dodge.Wall.Move
|
||||
import Geometry
|
||||
@@ -19,9 +19,9 @@ rewindGun =
|
||||
defaultLeftItem
|
||||
{ _itInvColor = cyan
|
||||
, _itUse =
|
||||
defaultlUse
|
||||
& lUse .~ LRewind --useRewindGun
|
||||
& eqEq . eqSite .~ GoesOnChest
|
||||
defaultLeftUse
|
||||
& leftUse .~ LRewind --useRewindGun
|
||||
& equipEffect . eeSite .~ GoesOnChest
|
||||
}
|
||||
& itEffect . ieInv .~ RewindEffect
|
||||
& itType . iyBase .~ LEFT REWINDER
|
||||
@@ -35,7 +35,7 @@ rewindGun =
|
||||
shrinkGun :: Item
|
||||
shrinkGun =
|
||||
defaultLeftItem
|
||||
& itUse .~ (defaultlUse & lUse .~ LShrink)
|
||||
& itUse .~ (defaultLeftUse & leftUse .~ LShrink)
|
||||
& itParams .~ ShrinkGunParams FullSize
|
||||
& itType . iyBase .~ LEFT SHRINKER
|
||||
|
||||
@@ -47,9 +47,9 @@ blinkGun =
|
||||
defaultLeftItem
|
||||
{ _itInvColor = cyan
|
||||
, _itUse =
|
||||
defaultlUse
|
||||
& lUse .~ LBlink --hammerCheckL (shootL $ const blinkAction)
|
||||
& eqEq . eqSite .~ GoesOnWrist
|
||||
defaultLeftUse
|
||||
& leftUse .~ LBlink --hammerCheckL (shootL $ const blinkAction)
|
||||
& equipEffect . eeSite .~ GoesOnWrist
|
||||
-- , _itFloorPict = const . noPic . colorSH chartreuse $ upperPrismPoly 2 $ square 2
|
||||
}
|
||||
& itType . iyBase .~ LEFT BLINKER
|
||||
@@ -58,33 +58,9 @@ unsafeBlinkGun :: Item
|
||||
unsafeBlinkGun =
|
||||
blinkGun
|
||||
& itType . iyBase .~ LEFT BLINKERUNSAFE
|
||||
& itUse . lUse .~ LUnsafeBlink --hammerCheckL (shootL $ const unsafeBlinkAction)
|
||||
& itUse . eqEq . eqViewDist ?~ 400
|
||||
& itUse . leftUse .~ LUnsafeBlink --hammerCheckL (shootL $ const unsafeBlinkAction)
|
||||
& itUse . equipEffect . eeViewDist ?~ 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
|
||||
forceFieldGun :: Item
|
||||
forceFieldGun =
|
||||
defaultWeapon
|
||||
& itTargeting .~ (targetRBPress & tgDraw .~ TargetDistanceDraw)
|
||||
& itParams .~ ParamMID Nothing
|
||||
& itUse . rUse .~ HeldForceField --useForceFieldGun
|
||||
& itUse . useDelay .~ NoDelay
|
||||
& itUse . useMods .~ AmmoHammerTimeUseOneMod -- this is slightly different
|
||||
-- than the list below
|
||||
--[ hammerCheckI , ammoCheckI , useAmmoAmount 1]
|
||||
& itType . iyBase .~ HELD FORCEFIELDGUN
|
||||
& itUse . heldConsumption .~ (defaultLoadable & laAmmoType .~ ForceFieldAmmo forceField)
|
||||
|
||||
-- I believe because the targeting returns to nothing straight after you release
|
||||
-- the rmb, it is possible for this to do nothing
|
||||
|
||||
Reference in New Issue
Block a user