actor ChargeKickBoss : BaseMM8BDMWep_CBM
{
dropitem "ChargeKickWepCDropped"
Weapon.AmmoUse 3
Weapon.AmmoGive 0
Weapon.SlotNumber 1
Obituary "$OB_CHARGERAM"
weapon.ammotype "ChargeManIsEveryWhereAmmo"
+WEAPON.NOAUTOAIM
Weapon.KickBack 400
States
{
Spawn:
C_05 F 1
loop
Ready:
CHAA A 0 ACS_ExecuteAlways(998,0,805)
CHAA A 0 A_GunFlash
goto Ready1
Ready1a:
CHAA A 0 A_JumpIfInventory("ChargeManIsEveryWhereAmmo",3,"Ready2a")
CHAA A 15 A_WeaponReady(WRF_NOFIRE)
goto Ready1
Ready1:
CHAA A 0 A_JumpIfInventory("ChargeManIsEveryWhereAmmo",3,"Ready2")
CHAA A 1 A_WeaponReady(WRF_NOFIRE)
CHAA A 0 A_GiveInventory("ChargeManIsEveryWhereAmmo",1)
loop
Ready2a:
CHAA A 0 A_JumpIfInventory("ChargeManIsEveryWhereAmmo",3,"Ready3a")
CHAA A 15 A_WeaponReady(WRF_NOSECONDARY)
goto Ready2
Ready2:
CHAA A 0 A_JumpIfInventory("ChargeManIsEveryWhereAmmo",25,"Ready3")
CHAA A 1 A_WeaponReady(WRF_NOSECONDARY)
CHAA A 0 A_GiveInventory("ChargeManIsEveryWhereAmmo",1)
loop
Ready3a:
CHAA A 15 A_WeaponReady
goto Ready2
Ready3:
CHAA A 1 A_WeaponReady
CHAA A 0 A_GiveInventory("ChargeManIsEveryWhereAmmo",1)
loop
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
CHAA A 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
CHAA A 1 A_Raise
Loop
Fire:
CHAA A 0 A_GiveInventory("StunArmor",1)
CHAA A 0 A_JumpIfInventory("IsBot",1,"Hold")
CHAA A 0 SetPlayerProperty(0,1,0)
CHAA A 0 A_ReFire
goto Hold
Hold:
CHAA B 0 A_JumpIfNoAmmo("NoAmmoX")
CHAA B 0 A_PlaySound("weapon/train",0,0.68)
CHAA B 2 A_GiveInventory("ChargeTrainDash",1)
CHAA B 0 A_FireCustomMissile("ChargeTrainClip",0,0,0,0)
CHAA B 0 A_GiveInventory("ChargemanMain_CI",1)
CHAA B 2 A_GiveInventory("ChargeTrainDash",1)
CHAA B 1 A_GiveInventory("ChargeTrainDash",1)
CHAA B 0 A_ReFire
Goto NoAmmoX
NoAmmoX:
CHAA B 0 SetPlayerProperty(0,0,0)
CHAA B 0 A_ClearReFire
CHAA B 0 A_TakeInventory("StunArmor",999)
CHAA B 0 A_JumpIfInventory("IsBot",1,"NoAmmoBot")
goto Ready1a
NoAmmoBot:
CHAA A 0 A_GiveInventory("ChargeManIsEveryWhereAmmo",75)
CHAA A 70 SetPlayerProperty(0,1,0)
CHAA A 0 SetPlayerProperty(0,0,0)
CHAA B 0 A_ClearReFire
Goto Ready1

Altfire:
CHAA A 0 A_JumpIfInventory("ChargeManIsEveryWhereAmmo",25,"CoalAttack")
Goto Ready1
CoalAttack:
CHAA A 0 A_TakeInventory("ChargeManIsEveryWhereAmmo",25)
CHAA A 0 A_PlaySoundEx("weapon/chugga","weapon")
CHAA A 0 A_GunFlash
CHAA A 0 A_SpawnItemEx("TrainSteam",0,0,120,0,0,0,0,1)
CHAA A 0 A_GiveInventory("IsInvunFlag",1)
CHAA A 0 A_ChangeFlag("INVULNERABLE",1)
CHAA A 0 ACS_ExecuteAlways(998,0,815,5)
CHAA A 0 A_SpawnItemEx("CoalSpawner",0,0,56,0,0,0,0,1)
CHAA A 0 A_FireCustomMissile("ChargeAltRadius",0,0,0,0)
CHAA B 0 A_GiveInventory("ChargemanAlt_CI",1)
CHAA CCCCDDDD 1
CHAA E 0 ACS_ExecuteAlways(998,0,805,1)
CHAA E 0 A_TakeInventory("IsInvunFlag",9)
CHAA E 16 A_ChangeFlag("INVULNERABLE",0)
Goto Ready1

Flash:
TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1
TNT1 A 0 A_JumpIfInventory("IsDead",1,"NoFlash")
TNT1 A 0 A_SpawnItemEx("TrainSteam",0,0,120,0,0,0,0,1)
loop
}
}

actor ChargeManIsEveryWhereAmmo : Ammo
{
+INVENTORY.IGNORESKILL 
inventory.amount 1
inventory.maxamount 75
}

actor ChargeTrainDash : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIf(z-floorz==0,"Ground")
goto Air
Air:
TNT1 A 0 A_Recoil(-1.75f)//-4
stop
Ground:
TNT1 A 0 A_Recoil(-4.5f)//-12
stop
//CHAA B 2 A_Recoil(-12)//A_Recoil(-5)
//CHAA B 2// A_Recoil(-5)
//CHAA B 1// A_Recoil(-3)
}
}

actor ChargeTrainClip : BasicExplosion
{
damagetype "ChargeKick"
Obituary "$OB_CHARGERAM"
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Explode(6,76,0,0,12)
stop
}
}

actor ChargeTrain
{
Translation "198:198=225:225", "192:192=4:4"
PROJECTILE
damagetype "ChargeKick"
Obituary "$OB_CHARGERAM"
+DONTBLAST
+DONTREFLECT
damage (9)
Radius 16
Height 28
speed 54
scale 2.5
States
{
Spawn:
STEA MNO 1
stop
}
}

actor ChargeTrainB : ChargeTrain{translation "198:198=74:74","192:192=205:205"}
actor ChargeTrainR : ChargeTrain{translation "198:198=41:41","192:192=171:171"}
actor ChargeTrainO : ChargeTrain{translation "198:198=128:128","192:192=104:104"}
actor ChargeTrainP : ChargeTrain{translation "198:198=232:232","192:192=229:229"}

actor CoalSpawner
{
PROJECTILE
-SOLID
+NOINTERACTION
damage 0
radius 1
height 1
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("RisingCoal",0,0,0,30,0,5.5,0,1)
TNT1 A 0 A_SpawnItemEx("RisingCoal",0,0,0,30,0,5.5,45,1)
TNT1 A 0 A_SpawnItemEx("RisingCoal",0,0,0,30,0,5.5,90,1)
TNT1 A 0 A_SpawnItemEx("RisingCoal",0,0,0,30,0,5.5,135,1)
TNT1 A 0 A_SpawnItemEx("RisingCoal",0,0,0,30,0,5.5,180,1)
TNT1 A 0 A_SpawnItemEx("RisingCoal",0,0,0,30,0,5.5,-45,1)
TNT1 A 0 A_SpawnItemEx("RisingCoal",0,0,0,30,0,5.5,-90,1)
TNT1 A 0 A_SpawnItemEx("RisingCoal",0,0,0,30,0,5.5,-135,1)
TNT1 A 0 A_SpawnItemEx("RisingCoal",0,0,0,26,0,16,27.5,1)
TNT1 A 0 A_SpawnItemEx("RisingCoal",0,0,0,26,0,16,72.5,1)
TNT1 A 0 A_SpawnItemEx("RisingCoal",0,0,0,26,0,16,117.5,1)
TNT1 A 0 A_SpawnItemEx("RisingCoal",0,0,0,26,0,16,162.5,1)
TNT1 A 0 A_SpawnItemEx("RisingCoal",0,0,0,26,0,16,-27.5,1)
TNT1 A 0 A_SpawnItemEx("RisingCoal",0,0,0,26,0,16,-72.5,1)
TNT1 A 0 A_SpawnItemEx("RisingCoal",0,0,0,26,0,16,-117.5,1)
TNT1 A 0 A_SpawnItemEx("RisingCoal",0,0,0,26,0,16,-162.5,1)
TNT1 A 1
stop
}
}

actor ChargeAltRadius : BasicExplosion
{
Obituary "$OB_COALRAIN"
Damagetype "Coal"
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Explode(11,96,0,0,96)
stop
}
}

actor ChargeCoalShot
{
var int user_P;
Translation "198:198=225:225", "202:202=210:210"
PROJECTILE
Obituary "$OB_COALRAIN"
Damagetype "Coal"
-NOGRAVITY
damage (3+user_P)//9
Radius 7
Height 7
speed 30
scale 3.0
States
{
Spawn:
COAL G 0
COAL G 0 ThrustThingZ(0,15,0,1)
COAL GHIJ 2
COAL G 0 A_JumpIf(user_P>=6,"Spawn2")
COAL G 0 A_SetUserVar("user_P",user_P+1)
goto Spawn+2
Spawn2:
COAL G 0 //A_SetScale(3.5)
COAL GHIJ 2
goto Spawn2+1
Death:
//TNT1 A 0 A_LOGINT(user_P)
TNT1 A 0 A_Stop
TNT1 A 0 A_PlaySoundEx("weapon/napalm","weapon")
TNT1 A 0 A_ChangeFlag("NOGRAVITY",1)
TNT1 A 0 //A_SpawnItemEx("CoalSpawner",0,0,56,0,0,0)
TNT1 A 0 A_Explode(6+user_P*0.5,96,0,0,48)
TN_B EFGHIJKLMNOPQRS 1
stop
}
}

actor ChargeCoalShotB : ChargeCoalShot{translation "198:198=74:74","202:202=205:205"}
actor ChargeCoalShotR : ChargeCoalShot{translation "198:198=41:41","202:202=171:171"}
actor ChargeCoalShotO : ChargeCoalShot{translation "198:198=128:128","202:202=104:104"}
actor ChargeCoalShotP : ChargeCoalShot{translation "198:198=232:232","202:202=229:229"}

actor RisingCoal
{
PROJECTILE
Obituary "$OB_COALRAIN"
Damagetype "Coal"
+DONTBLAST
//+SHOOTABLE
Radius 8
Height 10
Damage (2)
speed 30
scale 2.5
States
{
Spawn:
COAL DEF 1
goto Death
Death:
COAL D 0 A_SpawnItemEx("FallingCoal",0,0,0,0,0,0,0,1)
stop
XDeath:
TNT1 A 0
stop
}
}

actor FallingCoal : RisingCoal
{
-NOGRAVITY
Gravity 3
damage (4)//30
States
{
Spawn:
COAL ABC 1
loop
Death:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("OilPitIgnite",0,0,8)
stop
}
}

actor TrainSteam : BasicExplosion
{
scale 2.5
States
{
Spawn:
STEA ABCDE 1
STEA FGHII 3
stop
}
}

actor ChargemanMain_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("ChargeTrain",0,1,0,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("ChargeTrainB",0,1,0,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("ChargeTrainR",0,1,0,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("ChargeTrainO",0,1,0,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("ChargeTrainP",0,1,0,0)
goto Done
}
}

actor ChargemanAlt_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("ChargeCoalShot",0,0,0,24)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("ChargeCoalShotB",0,0,0,24)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("ChargeCoalShotR",0,0,0,24)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("ChargeCoalShotO",0,0,0,24)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("ChargeCoalShotP",0,0,0,24)
goto Done
}
}