Add files, minimal working rewind gun that must be equipped to charge
This commit is contained in:
@@ -26,8 +26,11 @@ rewindGun = defaultGun
|
||||
, _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' : ))
|
||||
& creatures . ix (_crID cr) . crInv . ix invid . wpLoadedAmmo .~ length (_rewindWorlds w)
|
||||
rewindEffect _ cr invid w
|
||||
| Just invid == _crLeftInvSel cr = w & rewindWorlds %~ (take 250 . (w' : ))
|
||||
& creatures . ix (_crID cr) . crInv . ix invid . wpLoadedAmmo .~ length (_rewindWorlds w)
|
||||
| otherwise = w & rewindWorlds .~ []
|
||||
& creatures . ix (_crID cr) . crInv . ix invid . wpLoadedAmmo .~ 0
|
||||
where
|
||||
w' = w & rewindWorlds .~ []
|
||||
& rewinding .~ True
|
||||
|
||||
Reference in New Issue
Block a user