Add twisting weapons and feet
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
module Dodge.Item.Weapon.AutoGun
|
||||
where
|
||||
import Dodge.Data
|
||||
import Dodge.Default.Weapon
|
||||
import Dodge.Default
|
||||
import Dodge.Item.Attachment
|
||||
import Dodge.Item.Attachment.Data
|
||||
import Dodge.Item.Weapon.ExtraEffect
|
||||
import Dodge.Item.Weapon.InventoryDisplay
|
||||
import Dodge.Item.Data
|
||||
import Dodge.Picture.Layer
|
||||
import Dodge.Item.Draw
|
||||
import Dodge.Item.Weapon.Bullet
|
||||
import Dodge.Item.Weapon.TriggerType
|
||||
import Dodge.SoundLogic.Synonyms
|
||||
import Dodge.WorldEvent.HitEffect
|
||||
import Dodge.Particle.Bullet.HitEffect
|
||||
import Picture
|
||||
import Geometry
|
||||
|
||||
import qualified Data.Sequence as Seq
|
||||
|
||||
autoGun :: Item
|
||||
autoGun = defaultAutoGun
|
||||
{ _itName = "AUTOGUN"
|
||||
, _itIdentity = AutoGun
|
||||
, _wpMaxAmmo = 30
|
||||
, _wpLoadedAmmo = 30
|
||||
, _wpReloadTime = 80
|
||||
, _wpReloadState = 0
|
||||
, _itUseRate = 6
|
||||
, _itUseTime = 0
|
||||
, _itUse = \_ -> charFiringStrat
|
||||
[('M',autoFireMode)
|
||||
,('S',singleFireMode)
|
||||
]
|
||||
, _wpSpread = autogunSpread
|
||||
, _wpRange = 20
|
||||
, _itHammer = HammerUp
|
||||
, _itFloorPict = onLayer FlItLayer autoGunPict
|
||||
, _itAimingSpeed = 0.4
|
||||
, _itAimingRange = 1
|
||||
, _itZoom = defaultItZoom {_itAimZoomFac = 1.5}
|
||||
, _itEquipPict = pictureWeaponOnAim autoGunPict
|
||||
, _itEffect = wpRecock
|
||||
, _itAttachment = Just $ ItCharMode $ Seq.fromList "MS"
|
||||
, _itScrollUp = incCharMode
|
||||
, _itScrollDown = decCharMode
|
||||
, _itInvDisplay = basicWeaponDisplay
|
||||
, _wpAmmo = basicBullet
|
||||
}
|
||||
autoFireMode, singleFireMode, autoGunNonTwistEff :: Creature -> World -> World
|
||||
autoFireMode = shootWithSound (fromIntegral autoGunSound)
|
||||
. torqueBefore 0.05
|
||||
$ autoGunNonTwistEff
|
||||
singleFireMode = hammerCheck $ shootWithSound (fromIntegral autoGunSound) autoGunNonTwistEff
|
||||
autoGunNonTwistEff = withRecoil 40
|
||||
. withRandomDir (autogunSpread/2)
|
||||
. withMuzFlare
|
||||
. withVelWthHiteff (50,0) 3
|
||||
$ destroyOnImpact bulHitCr bulHitWall' bulHitFF'
|
||||
|
||||
autoGunPict :: Picture
|
||||
autoGunPict = color red $ polygon $ rectNESW 4 12 (-4) (-12)
|
||||
|
||||
autogunSpread :: Float
|
||||
autogunSpread = 0.07
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
module Dodge.Item.Weapon.Bullet
|
||||
where
|
||||
import Dodge.Data
|
||||
import Dodge.WorldEvent.HitEffect
|
||||
import Dodge.Particle.Bullet.HitEffect
|
||||
basicBullet :: Ammo
|
||||
basicBullet = BulletAmmo
|
||||
{ _amString = "BULLET"
|
||||
, _amBulEff = destroyOnImpact bulHitCr bulHitWall' bulHitFF'
|
||||
, _amBulWth = 2
|
||||
, _amBulVel = (30,0)
|
||||
}
|
||||
Reference in New Issue
Block a user