Clear ammo when reloading clip based weaons
This commit is contained in:
@@ -95,8 +95,8 @@ pistol = defaultGun
|
||||
{ _aoType = basicBullet
|
||||
, _ammoMax = 15
|
||||
, _ammoLoaded = 15
|
||||
, _reloadTime = 10
|
||||
, _reloadType = PartialActive 1
|
||||
, _reloadTime = 15
|
||||
, _reloadType = ActivePartial 1
|
||||
}
|
||||
, _itUse = useAmmoParamsRate 8 upHammer
|
||||
[ ammoCheckI
|
||||
|
||||
@@ -38,7 +38,7 @@ module Dodge.Item.Weapon.TriggerType
|
||||
where
|
||||
import Dodge.Data
|
||||
import Dodge.SoundLogic
|
||||
import Dodge.Creature.Action (startReloadingWeapon)
|
||||
import Dodge.Reloading
|
||||
import Dodge.WorldEvent
|
||||
import Dodge.RandomHelp
|
||||
--import Dodge.Default
|
||||
@@ -96,8 +96,8 @@ withThickSmokeI eff item cr w = eff item cr
|
||||
ammoCheckI :: ChainEffect
|
||||
ammoCheckI eff item cr w
|
||||
| _ammoLoaded (_itConsumption item) <= 0 = fromMaybe w (startReloadingWeapon cr w)
|
||||
| _reloadState (_itConsumption item) /= Nothing' = w
|
||||
| otherwise = eff item cr w
|
||||
-- | _reloadState (_itConsumption item) /= Nothing' = w
|
||||
| otherwise = eff item cr $ w & creatures . ix (_crID cr) %~ crStopReloading
|
||||
|
||||
itUseAmmo :: Int -> Item -> Item
|
||||
itUseAmmo x = itConsumption . ammoLoaded %~ (max 0 . subtract x)
|
||||
|
||||
Reference in New Issue
Block a user