Refactor reloading to use list of required steps

This commit is contained in:
2022-06-20 19:06:02 +01:00
parent a85cf4d1fb
commit 37eb69c661
16 changed files with 79 additions and 118 deletions
+4 -6
View File
@@ -73,7 +73,7 @@ bangCane = defaultBulletWeapon
} & itUse . useAim . aimStance .~ OneHand
& itType . iyBase .~ BANGCANE
& itConsumption . laMax .~ 1
& itConsumption . laLoadType .~ ActivePartial 10 1 NoTransfer
& itConsumption . laCycle .~ [Insert 10 (Just 1)]
bangCaneX :: Int -> Item
bangCaneX i = bangCane
{ _itUse = ruseAmmoParamsRate 6 upHammer
@@ -139,7 +139,7 @@ rifle = bangCane
& itUse . useAim . aimStance .~ TwoHandTwist
& itType . iyBase .~ RIFLE
& itConsumption . laMax .~ 1
& itConsumption . laLoadType .~ ActiveEject 5 5 NoTransfer
& itConsumption . laCycle .~ [Eject 5, Insert 5 Nothing,Prime 5]
& itUse . useAim . aimWeight .~ 6
& itUse . useAim . aimRange .~ 1
-- & itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
@@ -148,8 +148,7 @@ repeater :: Item
repeater = rifle
& itType . iyModules . at ModRifleMag ?~ EMPTYMODULE
& itType . iyBase .~ REPEATER
& itConsumption . laLoadType . ejectTime .~ 40
& itConsumption . laLoadType . insertTime .~ 40
& itConsumption . laCycle .~ [Eject 5, Insert 15 Nothing,Prime 15]
& itConsumption . laMax .~ 15
& itDimension . dimSPic .~ (\it -> noPic $ baseRifleShape
<> makeTinClipAt 0 (V3 10 (-2) 0) it
@@ -252,8 +251,7 @@ miniGunX i = defaultAutoGun
{ _laMax = 1500
, _laLoaded = 1500
}
& laLoadType . ejectTime .~ 60
& laLoadType . insertTime .~ 60
& laCycle .~ [Eject 40, Insert 40 Nothing,Prime 40]
, _itUse = miniGunUse i
& useDelay .~ WarmUpNoDelay {_warmTime = 0,_warmMax = 100}
& useAim . aimWeight .~ 6
+2 -4
View File
@@ -70,8 +70,7 @@ bangRod = defaultBulletWeapon
}
}
& itConsumption . laMax .~ 1
& itConsumption . laLoadType . ejectTime .~ 10
& itConsumption . laLoadType . insertTime .~ 10
& itConsumption . laCycle .~ [Eject 5, Insert 10 Nothing, Prime 5]
& itType . iyBase .~ BANGROD
& itUse . useAim . aimWeight .~ 8
& itUse . useAim . aimRange .~ 1
@@ -142,7 +141,6 @@ machineGun = bangRod
& useDelay .~ VariableRate {_rateMax = 25, _rateMaxMax = 24, _rateMinMax = 7, _rateTime = 0}
)
& itConsumption . laMax .~ 100
& itConsumption . laLoadType . ejectTime .~ 25
& itConsumption . laLoadType . insertTime .~ 25
& itConsumption . laCycle .~ [Eject 10, Insert 40 Nothing, Prime 10]
& itInvSize .~ 3
& itParams. torqueAfter .~ 0.2 -- not sure if this is necessary?
+3 -4
View File
@@ -78,7 +78,7 @@ bangStick i = defaultBulletWeapon
}
& itType . iyBase .~ BANGSTICK i
& itConsumption . laMax .~ i
& itConsumption . laLoadType .~ ActivePartial 10 1 NoTransfer
& itConsumption . laCycle .~ [Insert 10 (Just 1)]
baseStickShapeX :: Int -> Shape
baseStickShapeX i = foldMap f [0..i-1]
where
@@ -108,7 +108,7 @@ revolver = pistol
& itConsumption .~
(defaultBulletLoadable
& laMax .~ 6
& laLoadType .~ ActivePartial 10 1 NoTransfer )
& laCycle .~ [Insert 10 (Just 1)] )
& itDimension . dimSPic .~ (\it -> noPic $ baseStickShape <> revolverClip it)
& itType . iyBase .~ REVOLVER
@@ -157,8 +157,7 @@ pistol :: Item
pistol = (bangStick 1)
& itConsumption .~ ( defaultBulletLoadable
& laMax .~ 15
& laLoadType . ejectTime .~ 20
& laLoadType . insertTime .~ 20 )
& laCycle .~ [Eject 5, Insert 5 Nothing, Prime 5] )
& itUse .~ ruseAmmoParamsRate 6 upHammer (ammoHammerCheck : pistolAfterHamMods)
& itDimension . dimSPic .~ (\it -> noPic $ baseStickShape <> makeTinClipAt pi (V3 5 2 0) it)
& itParams %~