actor AirShooterBoss : BaseMM8BDMWep_CBM
{
tag "$TAGC_2B"
dropitem "AirShooterWepCDropped"
Weapon.AmmoUse 0
Weapon.AmmoGive 28
Obituary "$OB_AIRSHOOTER"
weapon.ammotype "Can'tDefeatAmmo"
States
{
Spawn:
C_02 B 1
loop
Ready:
AIRA A 0 ACS_ExecuteAlways(998,0,DYE_AIRMAN)
AIRA A 0 A_GunFlash
goto Ready2
Ready2:
AIRA A 0 A_JumpIfInventory("Can'tDefeatAmmo",4,"Ready3")
AIRA A 5 A_WeaponReady(8)
AIRA A 0 A_JumpIfInventory("AirTurbineFlag",1,"Ready2")
AIRA A 0 A_GiveInventory("Can'tDefeatAmmo",1)
loop
Ready3:
AIRA A 5 A_WeaponReady
AIRA A 0 A_JumpIfInventory("AirTurbineFlag",1,"Ready3")
AIRA A 0 A_GiveInventory("Can'tDefeatAmmo",1)
loop
Deselect:
AIRA AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
AIRA A 1 A_Lower
Loop
Select:
AIRA AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
AIRA A 1 A_Raise
Loop
Fire:
AIRA A 0 A_JumpIfInventory("IsBot",1,"BotFire")
AIRA A 0 A_PlaySoundEx("weapon/airshooter","Weapon")
AIRA A 0 A_GiveInventory("AirmanMain_CI",1)
AIRA BC 6
AIRA A 7
Goto Ready2
AltFire:
AIRA A 0 A_GiveInventory("VivifyDelay6",1)
AIRA A 0 A_Refire(1)
AIRA A 0 A_PlaySoundEx("weapon/airwall","Body")
AIRA A 0 A_TakeInventory("Can'tDefeatAmmo",4,1)
AIRA A 0 A_GiveInventory("AirmanAlt_CI",1)
AIRA BC 6
AIRA A 7
Goto Ready2

BotFire:
AIRA A 0 A_JumpIfCloser(350,"BotFire2")
AIRA A 0 A_JumpIfInventory("Can'tDefeatAmmo",4,"AltFire")
AIRA A 5
AIRA A 0 A_GiveInventory("Can'tDefeatAmmo",1)
goto AltFire
BotFire2:
TNT1 A 0 A_Jump(192,"BotFire3")
goto BotFire+1
BotFire3:
AIRA A 0
goto Fire+1


Flash:
TNT1 A 0 A_JumpIfInventory("IsDead",1,"NoFlash")
TNT1 A 0 A_JumpIfInventory("AirTurbineFlag",1,3)
TNT1 A 1
loop
TNT1 A 0 A_JumpIfInventory("IsDead",1,"NoFlash")
TNT1 A 1 A_GiveInventory("AirmanFlashState_P")
TNT1 A 0 A_JumpIfInventory("AirTurbineFlag",1,3)
TNT1 A 1 A_PlaySoundEx("S3_K/MetalSpark","SoundSlot7")
TNT1 A 0 ACS_ExecuteAlways(CORE_ACS_191,0,APROP_Speed,1,1)
loop
TNT1 A 0
goto Flash+3
}
}

actor Can'tDefeatAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 28
+INVENTORY.IGNORESKILL
}

actor AirTurbineFlag : OnceC {}

actor AirTurbineDelay : Inventory
{
inventory.amount 1
inventory.maxamount 33
}

actor AirmanItem : BasicClassItem
{
inventory.icon "AIRICON"
inventory.pickupmessage "ARBABRRBAL"
Tag "Toggle Air Shoes"
states
{
Spawn:
AIRA Z 1
loop
Use:
TNT1 A 0 A_JumpIfInventory("AirTurbineFlag",1,"Take")
TNT1 A 0 A_JumpIfInventory("Can'tDefeatAmmo",2,"Use2")
fail
Use2:
TNT1 A 0 A_PlaySoundEx("class/windstart","SoundSlot7")
TNT1 A 0 A_TakeInventory("AirTurbineDelay")
TNT1 A 0 A_GiveInventory("AirTurbineFlag",1)
fail
Take:
TNT1 A 0 A_TakeInventory("AirTurbineFlag")
fail
}
}

actor AirmanFlashState_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_CheckFloor(2)
TNT1 A 0 A_SpawnItemEX("AirTurbineFX",random(32,64),0,random(8,64),0,0,frandom(0.1,1.1),random(90,270),1)
TNT1 A 0 A_JumpIfInventory("Can'tDefeatAmmo",1,"P_Check")
TNT1 A 0 A_TakeInventory("AirTurbineDelay")
TNT1 A 0 A_TakeInventory("AirTurbineFlag")
stop
P_Check:
TNT1 A 0 A_JumpIfInventory("AirTurbineDelay",1,3)
TNT1 A 0 A_TakeInventory("Can'tDefeatAmmo",1,1)
TNT1 A 0 A_GiveInventory("AirTurbineDelay",33)
TNT1 A 0
TNT1 A 0 A_CheckFloor("P_Ground")
TNT1 A 0 ACS_ExecuteAlways(CORE_ACS_191,0,APROP_Speed,2,1)
TNT1 A 0 A_TakeInventory("AirTurbineDelay",3)
stop
P_Ground:
TNT1 A 0 ACS_ExecuteAlways(CORE_ACS_191,0,APROP_Speed,1,1)
TNT1 A 0 A_TakeInventory("AirTurbineDelay",1)
stop
}
}

actor AirTurbineFX : BasicClientSide
{
Scale 2.5
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Jump(4,"FX10")
TNT1 A 0 A_SetScale(ScaleX-frandom(0,1))
TNT1 A 0 A_Jump(256,"FX1","FX2","FX3","FX4","FX5","FX6","FX7","FX8","FX9")
FX1:
AIRA J 1
AIRA KLMN 2
stop
FX2:
AIRA IJ 1
AIRA KLM 2
AIRA N 3
stop
FX3:
AIRA K 2
AIRA LM 3
AIRA N 2
stop
FX4:
AIRA LM 3
AIRA N 4
stop
FX5:
AIRA IJ random(0,1)
AIRA KLMN random(1,2)
stop
FX6:
AIRA IJ random(1,2)
AIRA KLM random(2,3)
AIRA N random(0,1)
stop
FX7:
AIRA IJKLMN random(1,2)
stop
FX8:
AIRA J 1
AIRA KL random(1,2)
AIRA MN random(2,3)
stop
FX9:
AIRA I 1
AIRA JKLMN 2
stop
FX10:
AIRA IJKLMN random(1,3)
stop
}
}

/*
actor AirWind
{
PROJECTILE
Radius 32
Height 24
scale 2.5
speed 40
States
{
Spawn:
AIWI ABCD 3 A_RadiusThrust (740000, 1, 0)
loop
}
}
*/

actor Airman_AirShot
{
PROJECTILE
damagetype "AirM_Shot"
Obituary "$OB_AIRSHOOTER"
+NOEXPLODEFLOOR
damage (120)//150
Radius 7//6
Height 8//7
speed 28
scale 2.5
States
{
Spawn:
TNT1 A 0
TNT1 A 0 ThrustThing(angle*256/360,8,1,0)
TNT1 A 0 A_Jump(256,1,2,3,4,5,6)
AIRS AABBCC 1 ThrustThingZ(0,3-(momz <= 0),0,1)
goto Spawn+3
Death:
AIRS GHIJ 2
stop
}
}

actor Airman_AirShotB : Airman_AirShot{translation "198:198=74:74"}
actor Airman_AirShotR : Airman_AirShot{translation "198:198=41:41"}
actor Airman_AirShotO : Airman_AirShot{translation "198:198=128:128"}
actor Airman_AirShotP : Airman_AirShot{translation "198:198=232:232"}

actor Airman_AirWall_H : BasicHelper
{
States
{
Spawn:
AIRS A 0
AIRS A 0 A_SpawnItemEx("Airman_AirWall",2,0,0,15,0,0,0,1)
AIRS A 0 A_SpawnItemEx("Airman_AirWall",2,0,0,15,random(4,8),random(-2,2),0,1)
AIRS A 0 A_SpawnItemEx("Airman_AirWall",2,0,0,15,random(-8,-4),random(-2,2),0,1)
AIRS A 0 A_SpawnItemEx("Airman_AirWall",2,0,0,15,random(12,16),random(-3,3),0,1)
AIRS A 0 A_SpawnItemEx("Airman_AirWall",2,0,0,15,random(-16,-12),random(-3,3),0,1)
AIRS A 0 A_SpawnItemEx("Airman_AirWall",2,0,0,15,random(20,24),random(-4,4),0,1)
AIRS A 0 A_SpawnItemEx("Airman_AirWall",2,0,0,15,random(-24,-20),random(-4,4),0,1)
stop
}
}

actor Airman_AirWall_HB : Airman_AirWall_H{translation "198:198=74:74"}
actor Airman_AirWall_HR : Airman_AirWall_H{translation "198:198=41:41"}
actor Airman_AirWall_HO : Airman_AirWall_H{translation "198:198=128:128"}
actor Airman_AirWall_HP : Airman_AirWall_H{translation "198:198=232:232"}

actor Airman_AirWall : Airman_AirShot
{
var int user_A;
damagetype "AirM_Wall"
-NOEXPLODEFLOOR
+BOUNCEONFLOORS
+BOUNCEONWALLS
+BOUNCEONCEILINGS
BounceFactor 0.5
WallBounceFactor 0.5
damage (90)
Radius 8
Height 10
speed 0
States
{
Spawn:
AIRS A 0
AIRS A 0 A_SetUserVar("user_A",ACS_ExecuteWithResult(259,4)*360/256)//Record Player Angle
AIRS A 0 ACS_ExecuteAlways(259,0,1)//Player Pitch
AIRS AABBCC 1 A_Recoil(3)
AIRS A 0 A_Stop
AIRS ABC 2
AIRS A 0 A_SpawnItemEx("Airman_AirWall2",0,0,0,cos(-pitch)*22,0,sin(-pitch)*22,user_A,5)
stop
}
}

actor AirM_WallProtect : PowerProtection
{
Powerup.Duration 4
DamageFactor "AirM_Wall", 0.19
}

actor Airman_AirWall2 : Airman_AirShot
{
damagetype "AirM_Wall"
-NOEXPLODEFLOOR
damage (150)
Radius 8
Height 10
speed 22
States
{
Spawn:
AIRS AABBCC 1 A_ScaleVelocity(1.05)
loop
}
}

actor AirmanMain_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("Airman_AirShot",-18,0,-8,0)//-18
TNT1 A 0 A_FireCustomMissile("Airman_AirShot",18,0,-8,0)//15
TNT1 A 0 A_FireCustomMissile("Airman_AirShot",0,1,-8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("Airman_AirShotB",-18,0,-8,0)
TNT1 A 0 A_FireCustomMissile("Airman_AirShotB",18,0,-8,0)
TNT1 A 0 A_FireCustomMissile("Airman_AirShotB",0,1,-8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("Airman_AirShotR",-18,0,-8,0)
TNT1 A 0 A_FireCustomMissile("Airman_AirShotR",18,0,-8,0)
TNT1 A 0 A_FireCustomMissile("Airman_AirShotR",0,1,-8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("Airman_AirShotO",-18,0,-8,0)
TNT1 A 0 A_FireCustomMissile("Airman_AirShotO",18,0,-8,0)
TNT1 A 0 A_FireCustomMissile("Airman_AirShotO",0,1,-8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("Airman_AirShotP",-18,0,-8,0)
TNT1 A 0 A_FireCustomMissile("Airman_AirShotP",18,0,-8,0)
TNT1 A 0 A_FireCustomMissile("Airman_AirShotP",0,1,-8,0)
goto Done
}
}



actor AirmanAlt_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("Airman_AirWall_H",0,0,-8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("Airman_AirWall_HB",0,0,-8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("Airman_AirWall_HR",0,0,-8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("Airman_AirWall_HO",0,0,-8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("Airman_AirWall_HP",0,0,-8,0)
goto Done
}
}
