Remove functions from left use item use field
This commit is contained in:
@@ -2,13 +2,9 @@ module Dodge.Item.Weapon.Utility where
|
||||
import Dodge.Data
|
||||
import Dodge.Base.Coordinate
|
||||
import Dodge.Default
|
||||
--import Dodge.Picture.Layer
|
||||
import Dodge.Creature.Action
|
||||
import Dodge.Item.Weapon.TriggerType
|
||||
import Dodge.Item.Weapon.ExtraEffect
|
||||
import Dodge.Wall.ForceField
|
||||
import Dodge.Wall.Move
|
||||
--import Sound.Data
|
||||
import Geometry
|
||||
import Picture
|
||||
import qualified IntMapHelp as IM
|
||||
@@ -16,10 +12,7 @@ import Shape
|
||||
import ShapePicture
|
||||
|
||||
import Data.Maybe
|
||||
--import qualified Data.Map.Strict as M
|
||||
import Control.Lens
|
||||
--import Control.Monad
|
||||
|
||||
rewindGun :: Item
|
||||
rewindGun = defaultLeftItem
|
||||
{ _itInvColor = cyan
|
||||
@@ -29,7 +22,7 @@ rewindGun = defaultLeftItem
|
||||
}
|
||||
, _itEffect = ItRewindEffect rewindEffect []
|
||||
, _itUse = defaultlUse
|
||||
& lUse .~ useRewindGun
|
||||
& lUse .~ LRewind --useRewindGun
|
||||
& eqEq . eqSite .~ GoesOnChest
|
||||
}
|
||||
& itType . iyBase .~ LEFT REWINDER
|
||||
@@ -46,24 +39,10 @@ rewindEffect itm cr w
|
||||
w' = w & rewindWorlds .~ []
|
||||
& timeFlow .~ NormalTimeFlow
|
||||
|
||||
useRewindGun :: Item -> Creature -> World -> World
|
||||
useRewindGun _ _ w = case _rewindWorlds w of
|
||||
[w'] -> rewindusing w' [w']
|
||||
(w':ws) -> rewindusing w' ws
|
||||
_ -> w
|
||||
where
|
||||
rewindusing w' ws = w
|
||||
& maybeWorld .~ Just' ( w'
|
||||
-- & creatures . ix (_crID cr) .~ cr
|
||||
& upbuts
|
||||
& rewindWorlds .~ ws
|
||||
)
|
||||
upbuts = (keys .~ _keys w) . (mouseButtons .~ _mouseButtons w)
|
||||
|
||||
-- needs to shift this item to the current inventory slot
|
||||
shrinkGun :: Item
|
||||
shrinkGun = defaultLeftItem
|
||||
{_itUse = defaultlUse {_lUse = hammerCheckL useShrinkGun}
|
||||
{_itUse = defaultlUse & lUse .~ LShrink -- hammerCheckL useShrinkGun
|
||||
-- , _itFloorPict = shrinkGunPic
|
||||
, _itAttachment = AttachBool True
|
||||
}
|
||||
@@ -72,24 +51,12 @@ shrinkGun = defaultLeftItem
|
||||
shrinkGunPic :: Item -> SPic
|
||||
shrinkGunPic _ = noPic $ colorSH violet $ upperPrismPoly 5 $ square 5
|
||||
|
||||
-- be careful changing this around; potential problems include updating the
|
||||
-- creature but using the old crInvSel value
|
||||
-- 22.05.23 this has been changed from using invids to items
|
||||
useShrinkGun :: Item -> Creature -> World -> World
|
||||
useShrinkGun it cr w = if _atBool $ _itAttachment it
|
||||
then tryResize 0.5 $ stripNoItems cr . f False UndroppableIdentified . dropExcept cr invid
|
||||
else tryResize 1 $ f True Uncursed . setMinInvSize defaultInvSize cr
|
||||
where
|
||||
invid = _ipInvID $ _itPos it
|
||||
tryResize x g = maybe w g $ sizeSelf x cr w
|
||||
f isInUse cstatus = creatures . ix (_crID cr) . crInv . ix invid %~
|
||||
( (itAttachment . atBool .~ isInUse) . (itCurseStatus .~ cstatus) )
|
||||
|
||||
blinkGun :: Item
|
||||
blinkGun = defaultLeftItem
|
||||
{ _itInvColor = cyan
|
||||
, _itUse = defaultlUse
|
||||
& lUse .~ hammerCheckL (shootL $ const blinkAction)
|
||||
& lUse .~ LBlink --hammerCheckL (shootL $ const blinkAction)
|
||||
& eqEq . eqSite .~ GoesOnWrist
|
||||
-- , _itFloorPict = const . noPic . colorSH chartreuse $ upperPrismPoly 2 $ square 2
|
||||
}
|
||||
@@ -98,7 +65,7 @@ blinkGun = defaultLeftItem
|
||||
unsafeBlinkGun :: Item
|
||||
unsafeBlinkGun = blinkGun
|
||||
& itType . iyBase .~ LEFT BLINKERUNSAFE
|
||||
& itUse . lUse .~ hammerCheckL (shootL $ const unsafeBlinkAction)
|
||||
& itUse . lUse .~ LUnsafeBlink --hammerCheckL (shootL $ const unsafeBlinkAction)
|
||||
& itUse . eqEq . eqViewDist ?~ 400
|
||||
|
||||
--effectGun :: String -> (Creature -> World -> World) -> Item
|
||||
|
||||
Reference in New Issue
Block a user