This commit is contained in:
2021-12-08 22:01:25 +00:00
parent a9139db0a8
commit eeda4f3e39
12 changed files with 98 additions and 36 deletions
+10 -3
View File
@@ -33,8 +33,14 @@ defaultAimParams = AimParams
}
useAmmoParams :: Item -> Creature -> World -> World
useAmmoParams it = withVelWthHiteff (muzvel *.* _amBulVel b) (_rifling $ _itParams it) (_amBulWth b) (_amBulEff b)
useAmmoParams it = withVelWthHiteff
(muzvel *.* _amBulVel b)
(_rifling $ _itParams it)
(_amBulWth b)
muzlength
(_amBulEff b)
where
muzlength = 20
muzvel = _muzVel $ _itParams it
b = _aoType $ _itConsumption it
@@ -49,14 +55,15 @@ withVelWthHiteff
:: Point2 -- ^ Velocity, x direction is forward with respect to the creature
-> Float -- ^ drag
-> Float -- ^ Bullet width
-> Float -- ^ Distance away from creature to create
-> HitEffect -- ^ Bullet effect when hitting creature, wall etc
-> Creature
-> World
-> World
withVelWthHiteff vel drag width hiteff cr = particles .:~ newbul
withVelWthHiteff vel drag width muzlength hiteff cr = particles .:~ newbul
where
newbul = aGenBulAt (Just (_crID cr)) pos (rotateV dir vel) drag hiteff width
pos = _crPos cr +.+ _crRad cr *.* unitVectorAtAngle dir
pos = _crPos cr +.+ muzlength *.* unitVectorAtAngle dir
dir = _crDir cr
{- | Creates a bullet with a given velocity, width, and 'HitEffect' -}
+2 -2
View File
@@ -163,13 +163,13 @@ baseRifleShape = colorSH red $ upperPrismPoly 3 $ rectXH 25 2
autoRifle :: Item
autoRifle = rifle
autoRifle = repeater
& itName .~ "AUTORIFLE"
& itType .~ AUTORIFLE
& itUse . useMods %~ ((ammoCheckI :) . tail)
-- & itUse . useDelay . rateMax .~ 6
assaultRifle :: Item
assaultRifle = rifle
assaultRifle = repeater
& itName .~ "ASSAULTRIFLE"
& itType .~ ASSAULTRIFLE
& itUse . useDelay . rateMax .~ 18