So my Autoshotgun and Launcher Chaingun don't seem to deselect properly when out of ammo?
I don't think i can set minimum ammo as the shotgun has a magazine as an alternate ammo type and the chaingun is both chaingun and rocket launcher. (2 ammo types)
AutoShotgun
Code: Select all
actor AutoShotgun : Weapon
{
+AMMO_OPTIONAL
+ALT_AMMO_OPTIONAL
spawnid 237
obituary "%o got blasted away by %k's Auto-shotgun."
radius 20
height 16
Inventory.Pickupmessage "You got the Automatic shotgun!"
weapon.slotnumber 3
weapon.selectionorder 700
Weapon.AmmoType1 "Shell"
Weapon.AmmoType2 "ASGClip"
Weapon.AmmoGive1 10
Weapon.AmmoGive2 0
Weapon.AmmoUse 1
//AttackSound "weapons/asgfir"
Damagetype "Normal"
states
{
Spawn:
WASG A -1
stop
Ready:
ASGG A 1 A_WeaponReady(WRF_ALLOWRELOAD)
loop
Deselect:
ASGG A 0 A_Lower
ASGG A 1 A_Lower
loop
Select:
ASGG A 0 A_Raise
ASGG A 1 A_Raise
loop
Fire:
ASGG A 0 A_JumpIfInventory("ASGClip",1,3) //if "has ammo" jump to shoot
ASGG A 0 A_JumpIfInventory("Shell",1,"Reload") //if "has shells" jump to reload
ASGG A 0 A_PlayWeaponSound("Weapons/asgout")//if "out of ammo" click and reset
goto Ready
Goto Reload
ASGG A 1
ASGG A 0 A_TakeInventory("ASGClip",1,TIF_NOTAKEINFINITE)
ASGG L 1 Offset(0,37) A_FireBullets(4,3,9,7,"BulletPuff",0)
ASGG L 0 A_PlaySound("weapons/asgfir",4,1,false,0.3)
ASGG L 0 A_GunFlash
ASGG L 1 Offset(0,34)
ASGG L 1 Offset(0,32)
ASGG M 2
ASGG N 2
ASGG A 3 A_PlaySoundEX("weapons/asgld1","auto",0)
ASGG A 7
ASGG A 0 A_ReFire
ASGG A 2
goto Ready
AltFire:
Burst:
ASGG A 0 A_JumpIfInventory("ASGClip",1,4) //if "has ammo"
ASGG A 0 A_ResetReloadCounter //reset "Burst counter" (start new burst)
ASGG A 0 A_JumpIfInventory("Shell",1,"Reload") //if "has shells"
ASGG A 0 A_PlayWeaponSound("Weapons/asgout")
goto Ready
ASGG A 1
ASGG A 0 A_TakeInventory("ASGClip",1,TIF_NOTAKEINFINITE)
ASGG L 1 Offset(0,37) A_FireBullets(6,5,8,7,"BulletPuff",0)
ASGG L 0 A_PlaySound("weapons/asgfir",4,1,false,0.3)
ASGG L 0 A_GunFlash
ASGG L 1 Offset(0,34)
ASGG L 1 Offset(0,32)
ASGG M 2
ASGG A 0 A_CheckForReload(3,"Burst") //counts 3-shot burst
ASGG N 3
ASGG A 3
ASGG A 0 A_ResetReloadCounter
Goto Ready
Reload:
ASGG G 0 A_JumpIfInventory("ASGClip",0,2)
ASGG G 0 A_JumpIfInventory("Shell",1,3)
ASGG G 0 A_PlayWeaponSound("Weapons/asgout")
Goto Ready
ASGG BCDEF 3
ASGG G 3 A_PlayWeaponSound("Weapons/asgout")
ASGG HIJ 2
ASGG k 12
ASGG JIH 3
Reload2:
ASGG G 0 A_TakeInventory("Shell",1)
ASGG G 0 A_GiveInventory("ASGClip",1)
ASGG G 0 A_JumpIfInventory("ASGClip",0,2)//if "full magazine"
ASGG G 0 A_JumpIfInventory("Shell",1,"Reload2")//if "has shells"
ASGG G 2 A_PlayWeaponSound("Weapons/asgin")
ASGG FEDCB 4
ASGG A 8 A_PlaySound("weapons/asgld1")
goto Ready
Flash:
NULL A 4 bright A_Light1
NULL A 3 bright A_Light2
NULL A 0 bright A_Light0
stop
}
}
ACTOR ASGClip: Ammo
{
Inventory.MaxAmount 30
Ammo.BackpackAmount 0
Ammo.BackpackMaxAmount 30
}
LauncherChaingun
Code: Select all
ACTOR LChaingun : Weapon
{
SpawnID 172
Inventory.PickupMessage "You got the Launcher Chaingun!"
Weapon.SlotNumber 5
Weapon.SelectionOrder 120
Weapon.AmmoType2 "RocketAmmo"
Weapon.AmmoType1 "Clip"
Weapon.AmmoGive2 5
Weapon.AmmoGive1 50
Weapon.AmmoUse2 1
Weapon.AmmoUse1 1
Weapon.Kickback 25
//AttackSound "weapons/LChaingunFire"
+WEAPON.ALT_AMMO_OPTIONAL
+WEAPON.AMMO_OPTIONAL
States
{
Spawn:
LMCG A -1
Stop
Ready:
LMCG B 1 A_WeaponReady
Loop
Deselect:
LMCG B 1 A_Lower
Loop
Select:
LMCG B 1 A_Raise
Loop
Fire:
NULL A 0 A_JumpIfNoAmmo("REmpity")
LMCG C 1 A_PlayWeaponSound("weapons/LChaingunStart")
LMCG BC 1
NULL A 0 A_Refire
Goto WindDown
Hold:
NULL A 0 A_JumpIfNoAmmo("WindDown")
NULL A 0 A_FireCustomMissile("ShotSmokeSpawner",0,0,0+Random(-5,5),0+Random(-5,5),0)
LMCG D 2 bright A_FireBullets(3,3,3,5,"LOSPuff",1)
LMCG D 0 A_PlaySound("weapons/LChaingunFire",4,1,false,0.3)
LMCG D 0 A_GunFlash
NULL A 0 A_Recoil(0.2)
NULL A 0 A_FireCustomMissile("Capsulas1",0,0,15,-10)
LMCG E 3
NULL A 0 A_JumpIfNoAmmo("WindDown")
LMCG D 2 bright A_FireBullets(3,3,3,5,"LOSPuff",1)
LMCG D 0 A_PlaySound("weapons/LChaingunFire",4,1,false,0.3)
LMCG D 0 A_GunFlash
NULL A 0 A_Recoil(0.1)
NULL A 0 A_FireCustomMissile("Capsulas1",0,0,15,-10)
LMCG E 3 bright
NULL A 0 A_Refire
Goto WindDown
WindDown:
LMCG BCBC 4 A_PlayWeaponSound("weapons/LChaingunStop")
LMCG BCB 2 A_JumpIfNoAmmo("REmpity")
NULL A 0 A_ClearRefire
Goto Ready
AltFire:
NULL A 0 A_JumpIfNoAmmo("REmpity")
NULL A 0 A_Recoil(2)
NULL A 0 A_FireCustomMissile("BackSmoke",0,0,9,-5,0)
NULL A 0 A_PlaySound("weapons/LChaingunAltFire",0,1)
LMCG O 12 A_FireCustomMissile("LRocket",0,1,8,-5,0)
LMCG P 12
LMCG B 4 A_Refire
Goto Ready
Flash:
NULL A 2 bright A_Light1
NULL A 1 bright A_Light(3)
NULL A 0 bright A_Light0
stop
REmpity:
LMCG B 12 A_PlayWeaponSound("weapons/sshoto")
NULL A 0 A_ClearRefire
Goto Ready
}
}
ACTOR LRocket
{
Obituary "%o rode %k's LRocket."
Radius 3
Height 3
Speed 50
explosionDamage 200
explosionRadius 192
Scale 0.3
PROJECTILE
+RANDOMIZE
States
{
Spawn:
RCK2 A 1 Bright A_SpawnItem("LRocket-Trail")
Loop
Death:
NULL A 1 A_PlaySound("Weapons/Lexplosion",4,1,false,0.1)
NULL A 1 A_Explode
NULL A 0 A_SpawnItem("LRocket-Flash")
NULL A 1 A_SpawnItem("LRocket-Explosion")
NULL A 1 A_SpawnItem("LRocket-Explosion-Smoke")
Stop
}
}
ACTOR LRocket-Trail
{
Radius 1
Height 1
Scale 0.2
RenderStyle Add
Alpha 0.4
PROJECTILE
+NOGRAVITY
+NOBLOCKMAP
+RANDOMIZE
+FORCEXYBILLBOARD
States
{
Spawn:
SMOK ABCDEFGHI 1
SMOK JKLMNOPQ 1 A_FadeOut
Goto Death
Death:
NULL A 1
Stop
}
}
ACTOR BackSmoke
{
Radius 1
Height 1
Speed 1
Damage 0
Scale 0.3
PROJECTILE
+CLIENTSIDEONLY
+FORCEXYBILLBOARD
States
{
Spawn:
NULL AAAAAAAA 1 A_SpawnItem("LRocket-Trail")
Goto Death
Death:
NULL A 1
Stop
}
}
ACTOR LRocket-Flash
{
Radius 1
Height 1
RenderStyle Add
Alpha 0.3
+CLIENTSIDEONLY
+NOGRAVITY
+FORCEXYBILLBOARD
States
{
Spawn:
NULL A 1 A_SetScale(1,1)
NULL A 0 A_Jump(125,"DeathB")
Goto DeathA
DeathA:
BOOM A 1 Bright A_SetScale(0.5,0.5)
BOOM A 1 Bright A_SetScale(1,1)
BOOM A 1 Bright A_SetScale(1.5,1.5)
BOOM A 1 Bright A_FadeOut
Stop
DeathB:
BOOM B 1 Bright A_SetScale(0.5,0.5)
BOOM B 1 Bright A_SetScale(1,1)
BOOM B 1 Bright A_SetScale(1.5,1.5)
BOOM B 1 Bright A_FadeOut
Stop
}
}
ACTOR LRocket-Explosion
{
Radius 1
Height 1
RenderStyle Add
Alpha 0.9
+CLIENTSIDEONLY
+NOGRAVITY
+FORCEXYBILLBOARD
States
{
Spawn:
HGRN G 1 A_SetScale(0.5,0.5)
HGRN H 1 A_SetScale(1.2,1.2)
HGRN IJKL 4 A_SetScale(1.5,1.5)
HGRN MN 2 A_SetScale(1.2,1.2)
HGRN OP 3 A_SetScale(0.7,0.7)
HGRN QR 4 A_FadeOut
Goto Death
Death:
NULL A 1
Stop
}
}
ACTOR LRocket-Explosion-Smoke
{
Radius 1
Height 1
RenderStyle Add
Alpha 0.1
Scale 2.3
+CLIENTSIDEONLY
+NOGRAVITY
+FORCEXYBILLBOARD
States
{
Spawn:
BLOW A 1 A_SetScale(0.5,0.5)
BLOW B 1 A_SetScale(0.6,0.6)
BLOW C 1 A_SetScale(0.7,0.7)
BLOW D 1 A_SetScale(0.8,0.8)
BLOW E 1 A_SetScale(0.9,0.9)
BLOW F 1 A_SetScale(1.0,1.0)
BLOW G 1 A_SetScale(1.1,1.1)
BLOW H 1 A_SetScale(1.3,1.3)
BLOW I 1 A_SetScale(1.5,1.5)
BLOW J 1 A_SetScale(1.7,1.7)
BLOW K 1 A_SetScale(1.9,1.9)
BLOW L 1 A_SetScale(2.2,2.2)
BLOW M 1 A_SetScale(2.5,2.5)
BLOW N 1 A_SetScale(2.8,2.8)
BLOW O 1 A_FadeOut
Goto Death
Death:
NULL A 1
Stop
}
}
ACTOR Capsulas1
{
Radius 1
Height 1
Speed 25
PROJECTILE
+CLIENTSIDEONLY
+DONTSPLASH
-ACTIVATEIMPACT
States
{
Spawn:
NULL A 1
NULL A 0 A_Die
Goto Death
Death:
NULL A 0 A_CustomMissile("Capsulas2",2,-10,270+random(-15,15),2,45+random(-15,15))
Stop
}
}
ACTOR Capsulas2
{
Height 1.5
Radius 2
Speed 8
Scale .25
SeeSound "weapons/LChaingunCapsulas"
PROJECTILE
+CLIENTSIDEONLY
+DOOMBOUNCE
+DONTSPLASH
- NOGRAVITY
- NOBLOCKMAP
-ACTIVATEIMPACT
States
{
Spawn:
NULL A 0 A_PlaySound("NULL")
LCPJ ACBED 1 A_CustomMissile("CapsulasSmonke",0,0,0,2,0)
Goto Spawn + 1
Death:
NULL A 0 A_Jump(50,4)
NULL A 0 A_Jump(75,10)
NULL A 0 A_Jump(100,16)
NULL A 0 A_Jump(125,22)
LCPJ A 1 A_CustomMissile("CapsulasSmonke",0,0,0,2,0)
LCPJ A 350
LCPJ AAAAA 1 A_FadeOut
Stop
LCPJ B 1 A_CustomMissile("CapsulasSmonke",0,0,0,2,0)
LCPJ B 350
LCPJ BBBBB 1 A_FadeOut
Stop
LCPJ C 1 A_CustomMissile("CapsulasSmonke",0,0,0,2,0)
LCPJ C 350
LCPJ CCCCC 1 A_FadeOut
Stop
LCPJ C 1 A_CustomMissile("CapsulasSmonke",0,0,0,2,0)
LCPJ D 350
LCPJ DDDDD 1 A_FadeOut
Stop
}
}
ACTOR CapsulasSmonke
{
Radius 1
Height 1
Scale 0.125
Speed 1
RenderStyle Add
ALPHA 0.05
PROJECTILE
+CLIENTSIDEONLY
+DONTSPLASH
+NOCLIP
-ACTIVATEIMPACT
States
{
Spawn:
SMKE ABCDEFG 1
Stop
Death:
SMKE H 1
Stop
}
}