Continue bullet refactor
This commit is contained in:
@@ -3,26 +3,44 @@ module Dodge.Item.Weapon.Bullet
|
||||
, hvBullet
|
||||
) where
|
||||
import Dodge.Data
|
||||
import Dodge.Particle.Damage
|
||||
|
||||
import Control.Lens
|
||||
import Geometry.Data
|
||||
basicBullet :: AmmoType
|
||||
basicBullet = BulletAmmo
|
||||
{ _amString = "BASIC"
|
||||
, _amBulDams = basicBulDams
|
||||
, _amBulWth = 2
|
||||
, _amBulVel = V2 50 0
|
||||
, _amBulTraj = BasicBulletTrajectory
|
||||
, _amBulEffect = DestroyBullet
|
||||
, _amBulSpawn = BulSpark
|
||||
, _amBullet = defaultBullet
|
||||
}
|
||||
defaultBullet :: Bullet
|
||||
defaultBullet = Bullet
|
||||
{ _buState = NormalBulletState
|
||||
, _buEffect = DestroyBullet
|
||||
, _buSpawn = BulSpark
|
||||
, _buUpdateMod = NoBulletUpdateMod
|
||||
, _buTrajectory = BasicBulletTrajectory
|
||||
, _buVel = V2 50 0
|
||||
, _buDrag = 1
|
||||
, _buPos = 0
|
||||
, _buOldPos = 0
|
||||
, _buWidth = 2
|
||||
, _buTimer = 100
|
||||
, _buDamages = basicBulDams
|
||||
}
|
||||
basicBulDams :: [Damage]
|
||||
basicBulDams =
|
||||
[ Damage PIERCING 100 0 0 0 NoDamageEffect
|
||||
, Damage PUSHDAM 1 0 0 0 . PushBackDamage $ 2
|
||||
]
|
||||
hvBullet :: AmmoType
|
||||
hvBullet = BulletAmmo
|
||||
{ _amString = "HVBULLET"
|
||||
, _amBulDams = hvBulDams
|
||||
, _amBulWth = 6
|
||||
, _amBulVel = V2 80 0
|
||||
, _amBulTraj = BasicBulletTrajectory
|
||||
, _amBulEffect = DestroyBullet
|
||||
, _amBulSpawn = BulSpark
|
||||
, _amBullet = defaultBullet
|
||||
& buWidth .~ 6
|
||||
& buVel .~ V2 80 0
|
||||
& buDamages .~ heavyBulDams
|
||||
}
|
||||
heavyBulDams :: [Damage]
|
||||
heavyBulDams =
|
||||
[ Damage PIERCING 300 0 0 0 NoDamageEffect
|
||||
, Damage PUSHDAM 1 0 0 0 $ PushBackDamage 2
|
||||
]
|
||||
|
||||
@@ -8,8 +8,8 @@ module Dodge.Item.Weapon.BulletGun.Rod
|
||||
) where
|
||||
import Dodge.Data
|
||||
import Dodge.Reloading.Action
|
||||
import Dodge.Particle.Damage
|
||||
import Dodge.Default.Weapon
|
||||
import Dodge.Item.Weapon.Bullet
|
||||
import Dodge.Default
|
||||
import Dodge.Item.Weapon.ZoomScope
|
||||
import Dodge.Item.Weapon.ExtraEffect
|
||||
@@ -57,7 +57,7 @@ bangRod = defaultBulletWeapon
|
||||
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
|
||||
& itUse . useAim . aimHandlePos .~ 5
|
||||
& itUse . useAim . aimMuzPos .~ 30
|
||||
& itConsumption . laAmmoType . amBulDams .~ heavyBulDams
|
||||
& itConsumption . laAmmoType .~ hvBullet
|
||||
elephantGun :: Item
|
||||
elephantGun = bangRod
|
||||
& itType . iyBase .~ HELD ELEPHANTGUN
|
||||
|
||||
@@ -127,7 +127,7 @@ bangCone = defaultBulletWeapon
|
||||
coneRandItemUpdate :: State StdGen (Item -> Item)
|
||||
coneRandItemUpdate = do
|
||||
wth <- state $ randomR (1,5)
|
||||
return (\it -> it & itConsumption . laAmmoType . amBulWth .~ wth)
|
||||
return (itConsumption . laAmmoType . amBullet . buWidth .~ wth)
|
||||
coneRandItemParams :: State StdGen (ItemParams -> ItemParams)
|
||||
coneRandItemParams = do
|
||||
muzv <- state $ randomR (0.5,1)
|
||||
|
||||
Reference in New Issue
Block a user