actor Galaxyman : CustWepClassBase
{
Player.ScoreIcon "C_09H0X"
player.displayname "Galaxyman"
player.soundclass "galaxymanc"

player.maxhealth 850
health 850
player.jumpz 10
player.forwardmove 0.8, 0.8
player.sidemove 0.78, 0.78

player.startitem "CBM_BaseFlagPack"

player.startitem "Galaxyman_W2"
player.startitem "Galaxyman_W"
player.startitem "SpaceTravelAmmo", 168
player.startitem "PortalItem",1

player.weaponslot 1, "Galaxyman_W"
player.weaponslot 2, "Galaxyman_W2"


player.startitem "SuperArmWeakness"
player.startitem "HardKnuckleWeakness"
player.startitem "PowerStoneWeakness"
player.startitem "AstroCrushWeakness"
player.startitem "SpreadDrillWeakness"
player.startitem "ConcreteShotWeakness"//
player.startitem "DeepDiggerWeakness"

States
{
Spawn:
GALX A 0
GALX R 1 A_JumpIfInventory("GalaxyAltFlag",1,"Woosh")
GALX A 1 A_JumpIfInventory("GalaxyAltFlag",1,"Woosh")
Goto Spawn+2
See:
GALX RSTS 5
Goto Spawn
Missile:
GALX F 1
GALX F 0 A_JumpIfInventory("GalaxyAltFlag",1,"Woosh")
GALX F 4
GALX G 4 
goto Spawn
Woosh:
GALX BCDE 4
GALX E 2 A_JumpIfInventory("GalaxyAltFlag",1,"Woosh")
goto Spawn
ClassPain:
GALX H 0
goto MegamanPain
ClassDeath:
GALX H 0 A_JumpIfInventory("GalaxyAltFlag",1,1)
goto MegamanDeath
GALX "]" 0
GALX "]" 0 A_JumpIfInventory("ExplodeDeathFlag",1,"MegamanGib")
GALX "]" 0 A_JumpIfInventory("FallingDeathFlag",1,"MegamanFall")
GALX "]" 0 A_JumpIfInventory("FlingDeathFlag",1,"Galaxy_MegamanFling")
//GALX "]" 0 A_JumpIfInventory("RisingDeathFlag",1,"MegamanRise")
//GALX "]" 0 A_JumpIfInventory("IceDeathFlag",1,"MegamanIce")

GALX Z 5 A_GiveInventory("GalaxyM_FlingCorpse_P")
goto MegamanErase
Galaxy_MegamanFling:
GALX "]" 0 A_PlaySoundEx("weapon/junkend","Voice")
GALX "]" 3
GALX Z 5 A_GiveInventory("GalaxyM_FlingCorpse_P")
goto MegamanErase
}
}

actor GalaxyM_FlingCorpse_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("ExplodeDeathFlag",1,"No")
TNT1 A 0 A_JumpIfInventory("FlingDeathFlag",1,"P_Fling")
TNT1 A 0 A_PlaySoundEx("weapon/junkend","Voice")
TNT1 A 0 A_JumpIfInventory("IceDeathFlag",1,"P_Ice")
TNT1 A 0 A_JumpIfInventory("RisingDeathFlag",1,"P_Rise")
TNT1 A 0 A_SpawnItemEx("GalaxymanBoomFlingCorpse",0,0,0,momx,momy,momz+5,0,1+8)
stop
P_Fling:
TNT1 A 0 A_JumpIfInventory("IceDeathFlag",1,"P_Ice")
TNT1 A 0 A_JumpIfInventory("RisingDeathFlag",1,"P_Rise")
TNT1 A 0 A_SpawnItemEx("GalaxymanBoomFlingCorpse",0,0,0,momx*0.8,momy*0.8,momz*0.8+1,0,1+8)
stop
P_Ice:
TNT1 A 0 A_SpawnItemEx("GalaxymanIceFlingCorpse",0,0,0,momx,momy,momz+5,0,1+8)
stop
P_Rise:
TNT1 A 0 A_SpawnItemEx("GalaxymanRiseFlingCorpse",0,0,0,momx*0.5,momy*0.5,momz+5,0,1+8)
TNT1 A 0 A_Stop
stop
No:
TNT1 A 0
stop
}
}


actor GalaxymanBoomFlingCorpse
{
+MISSILE
+THRUACTORS
+NOBLOCKMAP
-SOLID
Damage(0)
Gravity 0.8
radius 16
height 56
renderstyle translucent
scale 2.5
States
{
Spawn:
GALX "]" 0
GALX "]" 0 A_JumpIfInventory("CriticalDeath",1,"SpawnCheckGib",2)
goto SpawnL
SpawnCheckGib:
GALX "]" 0 A_GiveInventory("CriticalDeath",1)
goto SpawnL
SpawnL:
GALX "]" 1
wait
Death:
TNT1 A 0 A_SetGravity(0.0)
TNT1 A 0 A_SpawnItemEx("FakeDeathFX",0,0,32)
TNT1 A 0 A_JumpIfInventory("CriticalDeath",1,"DeathGibbed")
TNT1 A 4 A_PlaySoundEx("misc/devildeath","Body")
stop
DeathGibbed:
TNT1 A 0 A_PlaySoundEX("misc/gib","SoundSlot6")
TNT1 A 4 A_SpawnItemEX("CriticalDeathSpawner",0,0,0,0,0,0,0,1)
stop
}
}


actor GalaxymanRiseFlingCorpse : GalaxymanBoomFlingCorpse
{
+NOGRAVITY
+SKYEXPLODE
ReactionTime 7
States
{
Spawn:
GALX "]" 0
GALX "]" 0 A_JumpIfInventory("CriticalDeath",1,"SpawnCheckGib",2)
goto SpawnL
SpawnCheckGib:
GALX "]" 0 A_GiveInventory("CriticalDeath",1)
goto SpawnL
SpawnL:
GALX "]]]]]" 1 ThrustThingZ(0,10,0,1)
GALX "]" 0 A_CountDown
loop
}
}

actor GalaxymanIceFlingCorpse : GalaxymanBoomFlingCorpse
{
Translation "192:192=4:4", "198:198=201:201", "3:8=72:72", "243:247=72:72", "208:215=4:4", "202:202=4:4", "199:199=201:201", "204:204=4:4", "195:195=201:201"
States
{
Spawn:
GALX "]" 0
GALX "]" 0 A_PlaySoundEx("misc/freeze","Body")
GALX "]" 0 A_JumpIfInventory("CriticalDeath",1,"SpawnCheckGib",2)
goto SpawnL
SpawnCheckGib:
GALX "]" 0 A_GiveInventory("CriticalDeath",1)
goto SpawnL
SpawnL:
GALX "]" 1 A_SpawnItemEx("FrozenDeathBitFX",frandom(16,48),0,fRandom(16,48),0,0,0,random(0,359))
wait
Death:
TNT1 A 0 A_SetGravity(0.0)
TNT1 A 0 A_PlaySoundEx("misc/icebreak","Body")
TNT1 A 0 A_SpawnItemEx("FrozenDeathFX",0,0,1,0,0,0,0,1)
TNT1 A 0 A_JumpIfInventory("CriticalDeath",1,"DeathGibbed")
TNT1 A 4
stop
}
}