Move item effect functions
This commit is contained in:
@@ -20,24 +20,12 @@ rewindGun = defaultLeftItem
|
||||
{ _wpMaxCharge = 250
|
||||
, _wpCharge = 0
|
||||
}
|
||||
, _itEffect = ItRewindEffect rewindEffect []
|
||||
, _itEffect = ItRewindEffect RewindEffect []
|
||||
, _itUse = defaultlUse
|
||||
& lUse .~ LRewind --useRewindGun
|
||||
& eqEq . eqSite .~ GoesOnChest
|
||||
}
|
||||
& itType . iyBase .~ LEFT REWINDER
|
||||
rewindEffect :: Item -> Creature -> World -> World
|
||||
rewindEffect itm cr w
|
||||
| Just invid == _crLeftInvSel cr = w & rewindWorlds %~ (take maxcharge . (w' : ))
|
||||
& ptrWpCharge .~ length (_rewindWorlds w)
|
||||
| otherwise = w & rewindWorlds .~ []
|
||||
& ptrWpCharge .~ 0
|
||||
where
|
||||
invid = _ipInvID $ _itPos itm
|
||||
ptrWpCharge = creatures . ix (_crID cr) . crInv . ix invid . itConsumption . wpCharge
|
||||
maxcharge = _wpMaxCharge . _itConsumption $ itm
|
||||
w' = w & rewindWorlds .~ []
|
||||
& timeFlow .~ NormalTimeFlow
|
||||
|
||||
-- needs to shift this item to the current inventory slot
|
||||
shrinkGun :: Item
|
||||
|
||||
Reference in New Issue
Block a user