Fold in more ammo parameters, distinguish loadable and charging weapons
This commit is contained in:
@@ -20,20 +20,21 @@ rewindGun :: Item
|
||||
rewindGun = defaultGun
|
||||
{ _itName = "REWINDER"
|
||||
, _itIdentity = Rewinder
|
||||
, _wpAmmo = defaultAmmo
|
||||
{ _wpMaxAmmo = 0
|
||||
, _wpLoadedAmmo = 0
|
||||
, _wpAmmo = ChargeableAmmo
|
||||
{ _wpMaxCharge = 250
|
||||
, _wpCharge = 0
|
||||
}
|
||||
, _itEffect = ItRewindEffect rewindEffect []
|
||||
, _itUse = LeftUse $ \cr invid -> useRewindGun (_crInv cr IM.! invid) cr
|
||||
}
|
||||
rewindEffect :: ItEffect -> Creature -> Int -> World -> World
|
||||
rewindEffect _ cr invid w
|
||||
| Just invid == _crLeftInvSel cr = w & rewindWorlds %~ (take 250 . (w' : ))
|
||||
& creatures . ix (_crID cr) . crInv . ix invid . wpAmmo . wpLoadedAmmo .~ length (_rewindWorlds w)
|
||||
| Just invid == _crLeftInvSel cr = w & rewindWorlds %~ (take maxcharge . (w' : ))
|
||||
& creatures . ix (_crID cr) . crInv . ix invid . wpAmmo . wpCharge .~ length (_rewindWorlds w)
|
||||
| otherwise = w & rewindWorlds .~ []
|
||||
& creatures . ix (_crID cr) . crInv . ix invid . wpAmmo . wpLoadedAmmo .~ 0
|
||||
& creatures . ix (_crID cr) . crInv . ix invid . wpAmmo . wpCharge .~ 0
|
||||
where
|
||||
maxcharge = _wpMaxCharge . _wpAmmo $ _crInv cr IM.! invid
|
||||
w' = w & rewindWorlds .~ []
|
||||
& rewinding .~ True
|
||||
|
||||
@@ -57,9 +58,8 @@ shrinkGun = defaultGun
|
||||
, _wpAmmo = defaultAmmo
|
||||
{ _wpMaxAmmo = 100
|
||||
, _wpLoadedAmmo = 100
|
||||
, _wpReloadTime = 20
|
||||
}
|
||||
, _wpReloadTime = 20
|
||||
, _wpReloadState = 0
|
||||
, _itUseRate = 0
|
||||
, _itUseTime = 0
|
||||
, _itAimStance = TwoHandFlat
|
||||
@@ -97,9 +97,8 @@ blinkGun = defaultGun
|
||||
, _wpAmmo = defaultAmmo
|
||||
{ _wpMaxAmmo = 100
|
||||
, _wpLoadedAmmo = 100
|
||||
, _wpReloadTime = 20
|
||||
}
|
||||
, _wpReloadTime = 20
|
||||
, _wpReloadState = 0
|
||||
, _itUseRate = 0
|
||||
, _itUseTime = 0
|
||||
, _itUse = LeftUse $ hammerCheckL $ shootL aSelfL
|
||||
@@ -138,9 +137,9 @@ forceFieldGun = defaultGun
|
||||
, _wpAmmo = defaultAmmo
|
||||
{ _wpMaxAmmo = 100
|
||||
, _wpLoadedAmmo = 100
|
||||
, _wpReloadTime = 40
|
||||
, _wpReloadState = 0
|
||||
}
|
||||
, _wpReloadTime = 40
|
||||
, _wpReloadState = 0
|
||||
, _itUseRate = 10
|
||||
, _itUseTime = 0
|
||||
, _itUse = undefined
|
||||
|
||||
Reference in New Issue
Block a user