actor Grenademan : CustWepClassBase
{
Player.ScoreIcon "C_08G0X"
player.displayname "Grenademan"
player.soundclass "grenademanc"

player.maxhealth 1000
health 1000
player.jumpz 10
player.forwardmove 0.74, 0.74
player.sidemove 0.72, 0.72

player.startitem "CBM_BaseFlagPack"

player.startitem "Grenademan_W"
player.startitem "I'llPunishYouAmmo",21
player.startitem "ThatFeltGoodAmmo",6


player.startitem "ThunderBeamWeakness"
player.startitem "SparkShockWeakness"
player.startitem "ThunderBoltWeakness"
player.startitem "ThunderClawWeakness"//
player.startitem "LightningBoltWeakness"
player.startitem "PlugBallWeakness"
player.startitem "ThunderWoolWeakness"
player.startitem "ElectricShockWeakness"


States
{
Spawn:
GREM A 0
GREM B 1
GREM A 1
GREM A 174
GREM S 76
GREM TS 14
Goto Spawn+5
See:
GREM BCDE 5
Goto Spawn
Missile:
GREM F 0 A_JumpIfInventory("VivifyDelay8",1,"Missile2")
GREM F 5
GREM G 4
goto Spawn
Missile2:
GREM P 4
GREM Q 4
GREM O 3
GREM R 4
goto Spawn
ClassPain:
GREM H 0
goto MegamanPain
ClassDeath:
GREM H 0 A_GiveInventory("ThatFeltGoodAmmo",CallACS("cbm_HealthDamageRage",5))
GREM H 0 A_JumpIfInventory("ThatFeltGoodAmmo",27,1)
goto MegamanDeath

GREM H 0 A_JumpIfInventory("ExplodeDeathFlag",1,9)
GREM H 0 A_JumpIfInventory("FallingDeathFlag",1,"MegamanFall")
GREM H 0 A_JumpIfInventory("FlingDeathFlag",1,"G_MegamanFling")
GREM H 0 A_JumpIfInventory("RisingDeathFlag",1,"G_MegamanRise")
GREM H 0 A_JumpIfInventory("IceDeathFlag",1,"G_MegamanIce")

GREM H 0 A_PlaySoundEx("misc/BombCount","Voice")
GREM H 10 bright A_SpawnItemEx("GrenademanDeathFX_H",0,0,0,0,0,0,0,1)
GREM H 0 A_PlaySoundEx("misc/BombCount","Voice")
GREM H 10 bright A_SpawnItemEx("GrenademanDeathFX_H",0,0,0,0,0,0,0,1)
GREM H 0 A_PlaySoundEx("misc/BombCount","Voice")//ExplodeDeathFlag
GREM H 10 bright A_SpawnItemEx("GrenademanDeathFX_H",0,0,0,0,0,0,0,1)
GREM H 0 A_SpawnItemEX("GrenademanDeathBoom",0,0,28,0,0,0,0,1)
goto MegamanGib

G_MegamanFling:
GREM H 0 A_PlaySoundEx("misc/BombCount","Voice")
GREM H 7 bright A_SpawnItemEx("FlashBombFX3_B",Random(-16,16)*random(0,1),Random(16,40)*random(-1,1),Random(-32,32)*random(0,1)+28,random(-7,7)*random(0,1),random(-7,7)*random(0,1),random(-7,7)*random(0,1),random(0,359)*random(0,1),1)
GREM H 0 A_PlaySoundEx("misc/BombCount","Voice")
GREM H 7 bright A_SpawnItemEx("FlashBombFX3_B",Random(-16,16)*random(0,1),Random(16,40)*random(-1,1),Random(-32,32)*random(0,1)+28,random(-7,7)*random(0,1),random(-7,7)*random(0,1),random(-7,7)*random(0,1),random(0,359)*random(0,1),1)
GREM H 0 A_PlaySoundEx("misc/BombCount","Voice")
GREM H 7 bright A_SpawnItemEx("FlashBombFX3_B",Random(-16,16)*random(0,1),Random(16,40)*random(-1,1),Random(-32,32)*random(0,1)+28,random(-7,7)*random(0,1),random(-7,7)*random(0,1),random(-7,7)*random(0,1),random(0,359)*random(0,1),1)
GREM H 0 A_SpawnItemEX("GrenademanDeathBoom",0,0,28,0,0,0,0,1)
GREM H 0 A_GiveInventory("CBM_CritDeathCheck_Snd_P")
GREM H 0 A_SpawnItemEx("FakeDeathFX",0,0,32)
goto MegamanErase

G_MegamanRise:
GREM H 0 A_SetGravity(0.0)
G_RiseMyMegaman:
GREM H 1 A_GiveInventory("GrenademanDeathRise_P")
GREM H 0 A_JumpIf(ceilingz-z<=(height+1),"G_RiseMyMegamanEnd")
GREM H 0 A_JumpIfInventory("BlowDeathTimer",29,"G_RiseMyMegamanEnd")
loop
G_RiseMyMegamanEnd:
GREM H 0 A_Stop
GREM H 1 A_GiveInventory("GrenademanDeathRise_P2")
GREM H 0 A_JumpIfInventory("BlowDeathTimer",30,1)
goto G_RiseMyMegamanEnd+1
GREM H 0 A_SpawnItemEX("GrenademanDeathBoom",0,0,28,0,0,0,0,1)
goto Super::RiseMyMegamanEnd

G_MegamanIce:
GREM H 0 ACS_NamedExecuteWithResult("core_chargecolor",CLR_ICEDEATH,TCLR_ICEDEATH)
GREM H 0 A_PlaySoundEx("*icefreze","Voice")
GREM H 0 A_JumpIfInventory("CriticalDeath",1,23)
GREM H 0 A_PlaySoundEx("misc/BombCount","Weapon")
GREM HHHHHHHHHH 1 bright A_SpawnItemEx("FlashBombFX3_B",Random(-16,16)*random(0,1),Random(16,40)*random(-1,1),Random(-32,32)*random(0,1)+28,random(-7,7)*random(0,1),random(-7,7)*random(0,1),random(-7,7)*random(0,1),random(0,359)*random(0,1),1)
GREM H 0 A_PlaySoundEx("misc/BombCount","Weapon")
GREM HHHHHHHHHH 1 bright A_SpawnItemEx("FlashBombFX3_B",Random(-16,16)*random(0,1),Random(16,40)*random(-1,1),Random(-32,32)*random(0,1)+28,random(-7,7)*random(0,1),random(-7,7)*random(0,1),random(-7,7)*random(0,1),random(0,359)*random(0,1),1)
GREM H 0 A_PlaySoundEx("misc/BombCount","Weapon")//23
GREM HHHHHHHHHH 1 bright A_SpawnItemEx("FlashBombFX3_B",Random(-16,16)*random(0,1),Random(16,40)*random(-1,1),Random(-32,32)*random(0,1)+28,random(-7,7)*random(0,1),random(-7,7)*random(0,1),random(-7,7)*random(0,1),random(0,359)*random(0,1),1)
GREM H 0 A_SpawnItemEX("GrenademanDeathBoom",0,0,28,0,0,0,0,1)
GREM H 0 A_JumpIfInventory("CriticalDeath",1,"MegamanIceGib")
GREM H 0 A_PlaySoundEx("*icedeath","Body")
GREM H 0 A_SpawnItemEx("FrozenDeathFX",0,0,1,0,0,0,0,1)
goto MegamanErase

Death.Suicide:
GREM H 0 A_GiveInventory("ThatFeltGoodAmmo")
goto Super::Death.Suicide
}
}


actor GrenademanDeathRise_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 ThrustThingZ(0,10,0,1)
Check:
TNT1 A 0 A_SpawnItemEx("FlashBombFX3_B",Random(-16,16)*random(0,1),Random(16,40)*random(-1,1),Random(-32,32)*random(0,1)+28,random(-7,7)*random(0,1),random(-7,7)*random(0,1),random(-7,7)*random(0,1),random(0,359)*random(0,1),1)
TNT1 A 0 A_GiveInventory("BlowDeathTimer",1)
TNT1 A 0 A_JumpIfInventory("BlowDeathTimer",31,6)
TNT1 A 0 A_JumpIfInventory("BlowDeathTimer",30,"Snd")
TNT1 A 0 A_JumpIfInventory("BlowDeathTimer",21,4)
TNT1 A 0 A_JumpIfInventory("BlowDeathTimer",20,"Snd")
TNT1 A 0 A_JumpIfInventory("BlowDeathTimer",11,2)
TNT1 A 0 A_JumpIfInventory("BlowDeathTimer",10,"Snd")
TNT1 A 0
stop
Snd:
TNT1 A 0 A_PlaySoundEx("misc/BombCount","Voice")
TNT1 A 0 A_SpawnItemEx("GrenademanDeathFX_H",0,0,0,0,0,0,0,1)
stop
}
}
actor GrenademanDeathRise_P2 : GrenademanDeathRise_P{States{Pickup:goto Check}}

actor GrenademanDeathFX_H : BasicExplosion//BasicHelper
{
RenderStyle None
States
{
Spawn:
TNT1 A 0
TNT1 AA 1 A_SpawnItemEx("FlashBombFX1_B",0,0,28,random(-7,7),random(-7,7),random(-7,7),random(0,359),1)
TNT1 A 0 A_SpawnItemEx("FlashBombFX2_B",Random(-16,16),Random(-16,-40), Random(-32,32)+28,0,0,0,0,1)
TNT1 AA 1 A_SpawnItemEx("FlashBombFX2_B",Random(-16,16),Random(16,40), Random(-32,32)+28,0,0,0,0,1)
TNT1 A 1 A_SpawnItemEx("FlashBombFX1_B",0,0,28,random(-7,7),random(-7,7),random(-7,7),random(0,359),1)
stop
}
}
