Continue refactoring reloading
This commit is contained in:
@@ -154,7 +154,7 @@ smgAfterHamMods =
|
||||
]
|
||||
|
||||
pistol :: Item
|
||||
pistol = (bangStick 1)
|
||||
pistol = bangStick 1
|
||||
& itConsumption .~ ( defaultBulletLoadable
|
||||
& laMax .~ 15
|
||||
& laCycle .~ [Eject 5, Insert 5 Nothing, Prime 5] )
|
||||
|
||||
@@ -173,15 +173,15 @@ rateIncAB exeffFirst exeffCont eff item cr w
|
||||
itRef = _crInvSel cr
|
||||
pointItem = creatures . ix cid . crInv . ix itRef
|
||||
currentRate = _rateMax (_useDelay (_itUse item))
|
||||
repeatFire = _laProgress (_itConsumption item) == FinishedLoading && _rateTime (_useDelay (_itUse item)) == 1
|
||||
firstFire = _laProgress (_itConsumption item) == FinishedLoading && _rateTime (_useDelay (_itUse item)) == 0
|
||||
repeatFire = crWeaponReady cr && _rateTime (_useDelay (_itUse item)) == 1
|
||||
firstFire = crWeaponReady cr && _rateTime (_useDelay (_itUse item)) == 0
|
||||
{- | Apply effect after a warm up. -}
|
||||
-- note this is quite unsafe, requires the item to have the correct delay type
|
||||
withWarmUp
|
||||
:: SoundID -- ^ warm up sound id
|
||||
-> ChainEffect
|
||||
withWarmUp soundID f item cr w
|
||||
| _laProgress (_itConsumption item) /= FinishedLoading = w
|
||||
| crWeaponReady cr = w
|
||||
| curWarmUp < maxWarmUp = w
|
||||
& pointerToItem . itUse . useDelay . warmTime +~ 2
|
||||
& soundContinue (CrWeaponSound cid 0) (_crPos cr) soundID (Just 2)
|
||||
@@ -323,7 +323,7 @@ ammoUseCheck f item cr w
|
||||
cid = _crID cr
|
||||
itRef = _crInvSel cr
|
||||
pointerToItem = creatures . ix cid . crInv . ix itRef
|
||||
fireCondition = _laProgress (_itConsumption item) == FinishedLoading
|
||||
fireCondition = crWeaponReady cr
|
||||
&& _rateTime (_useDelay (_itUse item)) == 0
|
||||
&& _laLoaded (_itConsumption item) > 0
|
||||
-- reloadCondition = _laLoaded (_itConsumption item) == 0
|
||||
@@ -359,7 +359,7 @@ shootL f item cr w
|
||||
cid = _crID cr
|
||||
invid = fromJust $ _itInvPos item
|
||||
pointerToItem = creatures . ix cid . crInv . ix invid
|
||||
fireCondition = _laProgress (_itConsumption item) == FinishedLoading
|
||||
fireCondition = crWeaponReady cr
|
||||
&& _rateTime (_useDelay (_itUse item)) == 0
|
||||
&& _laLoaded (_itConsumption item) > 0
|
||||
-- reloadCondition = _laLoaded (_itConsumption item) == 0
|
||||
|
||||
Reference in New Issue
Block a user