////////////////////
// ECLIPSE PART2  //		
////////////////////


actor GammaTrampleProtection : PowerProtection
{
	damagefactor "Trample", 0.0
	damagefactor "Destruction", 0.0
	damagefactor "Destroy", 0.0
	damagefactor "Remove", 0.0
	powerup.duration 0x7FFFFFFD 
}

actor GammaPlayerMoveLeft : CustomInventory
{
	states
	{
	Pickup:
	TNT1 A 0 A_ChangeVelocity(0, CallAcs("GetGammaSpeed") * 0.02, 0.0, CVF_RELATIVE)
	stop
	}
}

actor GammaPlayerMoveRight : CustomInventory
{
	states
	{
	Pickup:
	TNT1 A 0 A_ChangeVelocity(0, -CallAcs("GetGammaSpeed") * 0.02, 0.0, CVF_RELATIVE)
	stop
	}
}

actor GammaPlayerMoveForward : CustomInventory
{
	states
	{
	Pickup:
	TNT1 A 0 A_ChangeVelocity(CallAcs("GetGammaSpeed") * 0.02, 0, 0.0, CVF_RELATIVE)
	stop
	}
}

actor GammaPlayerMoveBackward : CustomInventory
{
	states
	{
	Pickup:
	TNT1 A 0 A_ChangeVelocity(-CallAcs("GetGammaSpeed") * 0.02, 0.0, 0.0, CVF_RELATIVE)
	stop
	}
}

actor GammaPlayerJumpCooldown : Powerup
{
powerup.duration 10
}

actor GammaPlayerShotInv : Powerup
{
powerup.duration 10
}

actor GammaPunchoutModeProtection : PowerProtection
{
	powerup.duration 999999
	damagefactor "NoPain", 0.0
	damagefactor "EclipsePunch", 1.0
}

actor EclipsePunchDamager
{
+MISSILE
height 1
radius 1
renderstyle none
damagetype "EclipsePunch"
species "Enemy"
+THRUSPECIES
+THRUACTORS
states
{
Spawn:
PLAY A 0
PLAY A 1 A_Explode(5, 500, 0, 0, 5)
stop
}
}

actor EclipseBuilding
{
-SOLID
scale 0.5
radius 2
height 32
translation "192:192=207:207", "198:198=195:195"
+SHOOTABLE
+THRUACTORS
+NOTAUTOAIMED
mass 99999
damagefactor "NoPain", 0.0
health 1
height 32
radius 8
+NODAMAGE
painchance "Trample", 128
painchance "Destroy", 256
painchance "Remove", 256
states
{
Spawn:
TNT1 A 1 A_TakeInventory("CutterFlag", 9999)
ECLP A 0 A_Jump(128, "Scraper1", "Scraper2", "Scraper3", "Scraper4")
ECLP A 0 A_GiveInventory("CutterFlag", 1)
ECLP A 0 A_Jump(256, "Building1", "Building2", "Building3", "Death")
goto Building1
Scraper1:
ECL5 G 35
Goto Idle
Scraper2:
ECL5 H 35
Goto Idle
Scraper3:
ECL5 I 35
Goto Idle
Scraper4:
ECL5 J 35
Goto Idle
Building1:
ECL5 K 35
Goto Idle
Building2:
ECL5 L 35
Goto Idle
Building3:
ECL5 M 35
Goto Idle
Idle:
ECL5 "#" -1
Pain:
"####" "#" 0 A_ChangeFlag("SHOOTABLE", 0)
"####" "#" 0 A_LookEx(LOF_NOSOUNDCHECK, 0, 400, 0, 360, "DeathFX")
goto InvisEnd
DeathFX:
"####" "#" 0 A_JumpIfInventory("CutterFlag", 1, "SmallDeath")
ECL5 N 1 
goto SmallDeath+1
SmallDeath:
ECL5 O 1
"####" "####" 0 A_SpawnItemEx("EclipseBuildingGib", random(0, 4), 0, random(4, 8), frandom(0.5, 2), 0, frandom(0.1, 1), random(0,360), SXF_TRANSFERTRANSLATION) 
"####" "####" 0 A_SpawnItemEx("EclipseBuildingGib", random(0, 4), 0, random(8, 16), frandom(0.5, 2), 0, frandom(0.1, 1), random(0,360), SXF_TRANSFERTRANSLATION) 
"####" "####" 0 A_SpawnItemEx("EclipseBuildingGib", random(0, 4), 0, random(16, 32), frandom(0.5, 2), 0, frandom(0.1, 1), random(0,360), SXF_TRANSFERTRANSLATION) 
"####" "#" 0 A_Jump(25, "End") 
"####" "#" 7 A_SpawnItemEx("EclipseBuildingExplosion", frandom(-3, 3), frandom(-3, 3), random(0, 5) + (10 * 1))
"####" "#" 0 A_Jump(25, "End")
"####" "#" 7 A_SpawnItemEx("EclipseBuildingExplosion", frandom(-3, 3), frandom(-3, 3), random(0, 5) + (10 * 2))
"####" "#" 0 A_Jump(25, "End")
"####" "#" 7 A_SpawnItemEx("EclipseBuildingExplosion", frandom(-3, 3), frandom(-3, 3), random(0, 5) + (10 * 3))
goto End
Pain.Remove:
InvisEnd:
TNT1 A 1
End:
"####" "#" -1
stop
Death:
TNT1 A 1
stop
}
}

actor EclipseBuildingGib
{
	translation "192:192=207:207", "198:198=195:195"
	scale 0.5
	PROJECTILE
	+THRUACTORS
	-NOGRAVITY
	gravity 0.3
	states
	{
	Spawn:
	TNT1 A 0
	TNT1 A 0 A_Jump(128, "Gib1", "Gib2", "Gib3", "Gib4")
	Gib1:
	ECL5 P 10
	stop
	Gib2:
	ECL5 Q 10
	stop
	Gib3:
	ECL5 R 10
	stop
	Gib4:
	ECL5 S 10
	stop
	}
}

actor EclipseGib
{
	translation "192:192=67:67", "198:198=4:4"
	scale 0.4
	PROJECTILE
	+THRUACTORS
	-NOGRAVITY
	gravity 1.0
	states
	{
	Spawn:
	TNT1 A 0
	TNT1 A 0 A_Jump(128, "Gib1", "Gib2", "Gib3", "Gib4")
	Gib1:
	ECL5 U 10
	stop
	Gib2:
	ECL5 Q 10
	stop
	Gib3:
	ECL5 T 10
	stop
	Gib4:
	ECL5 S 10
	stop
	}
}

actor EclipseBuildingExplosion
{
	scale 0.5
	+NOINTERACTION
	+MISSILE
	states
	{
		Spawn:
		ASEX ABCDEF 2
		stop
	}
}

actor EclipseTrample32
{
	damage 0
	+THRUACTORS
	height 2
	radius 2
	damagetype "Trample"
	+MISSILE
	
	states
	{
		Spawn:
		TNT1 A 0
		TNT1 A 1 A_Explode(1, 32, 0, 0, 32)
		stop
	}
	
}

actor EclipseTrample64 : EclipseTrample32
{
	states
	{
		Spawn:
		TNT1 A 0
		TNT1 A 1 A_Explode(1, 64, 0, 0, 64)
		stop
	}
}

actor EclipseDestroy64 : EclipseTrample64
{
	damagetype "Destroy"
}

actor GammaPlayerPunchHitbox
{
PROJECTILE
damage (100)
speed 25
renderstyle none
states
{
Spawn:
PLAY A 3
stop
Death:
ECL3 A 0 A_PlaySoundEx("misc/gamma2punchhit", "Voice")
PLAY A 5 A_Quake(2, 4, 0, 128)
stop
}
}

actor GammaFists_Campaign : MegaBuster
{
Weapon.SlotNumber 0
+WEAPON.CHEATNOTWEAPON
-WEAPON.DONTBOB
States
{
Ready:
GMAH A 0 A_JumpIfInventory("IceSlasherAmmo", 1, "AnimeFistsReady")
GMAH A 0 A_JumpIfInventory("MegaBallAmmo", 1, "LowerToFists")
GMAH A 0 A_JumpIfInventory("WildCoilAmmo", 1, "GameOverGun")
GMAH M 1 offset (-0, 32) A_WeaponReady(WRF_NOBOB)
loop

Tutorial:
TNT1 A 1 A_GiveInventory("MegaBallAmmo", 1)
GMAH A 0 A_JumpIfInventory("WildCoilAmmo", 1, "GameOver")
TNT1 A 0 A_JumpIfInventory("RollingCutterAmmo", 1, "Tutorial")
Goto RaiseToFists
LowerToGun:
GMAH A 2 offset (-0, 32)
GMAH A 2 offset (-0, 42)
GMAH A 2 offset (-0, 52)
GMAH A 2 offset (-0, 62)
GMAH A 2 offset (-0, 72)
GMAH A 2 offset (-0, 82)
GMAH A 2 offset (-0, 92)
GMAH A 2 offset (-0, 112)
GMAH A 2 offset (-0, 142)
WaitingForRecover:
GMAH A 1 offset (-0, 142)
GMAH A 0 offset (-0, 32) A_JumpIfInventory("PowerStoneAmmo", 1, "WaitingForRecover")
GunRaise:
GMAH M 4 offset (-0, 122)
GMAH M 2 offset (-0, 112)
GMAH M 2 offset (-0, 92)
GMAH M 2 offset (-0, 82)
GMAH M 2 offset (-0, 72)
GMAH M 2 offset (-0, 62)
GMAH M 2 offset (-0, 52)
GMAH M 2 offset (-0, 42)
GMAH M 2 offset (-0, 32)
Goto Ready
LowerToFists:
GMAH M 2 offset (-0, 32)
GMAH M 2 offset (-0, 42)
GMAH M 2 offset (-0, 52)
GMAH M 2 offset (-0, 62)
GMAH M 2 offset (-0, 72)
GMAH M 2 offset (-0, 82)
GMAH M 2 offset (-0, 92)
GMAH M 2 offset (-0, 112)
GMAH M 2 offset (-0, 122)
GMAH M 0 A_JumpIfInventory("RollingCutterAmmo", 1, "Tutorial")
RaiseToFists:
GMAH A 4 offset (-0, 122)
GMAH A 2 offset (-0, 112)
GMAH A 2 offset (-0, 92)
GMAH A 2 offset (-0, 82)
GMAH A 2 offset (-0, 72)
GMAH A 2 offset (-0, 62)
GMAH A 2 offset (-0, 52)
GMAH A 2 offset (-0, 42)
GMAH A 2 offset (-0, 32) 
GMAH M 0 A_JumpIfInventory("AstroCrushAmmo", 1, "AnimeFistsReady")
TNT1 A 0 offset (-0, 32) A_GiveInventory("MegaBallAmmo", 1)
TNT1 A 0 offset (-0, 32) A_TakeInventory("TenguBladeAmmo", 9999)
TNT1 A 0 offset (-0, 32) A_TakeInventory("BreakDashAmmo", 9999)
TNT1 A 0 offset (-0, 32) A_TakeInventory("AtomicFireAmmo", 9999)
TNT1 A 0 offset (-0, 32) A_TakeInventory("TimeStopperAmmo", 9999)
goto FistsReady
Altfire:
Fire:
GMAH M 0 A_JumpIfInventory("AstroCrushAmmo", 1, "AnimeDashStart")
BusterFireStart:
GMAH N 0 A_GiveInventory("GammaPlayerShotInv", 1)
GMAH M 1 offset (-3, 32)
GMAH M 1 offset (-9, 22)
GMAH M 2 offset (-15, 12)
BusterFire:
GMAH N 0 A_Quake(1, 5, 0, 10, "")
GMAH N 0 A_GiveInventory("GammaPlayerShotInv", 1)
GMAH N 0 A_PlayWeaponSound("misc/gamma2shot")
GMAH N 0 A_FireCustomMissile("GammaPlayerProjectile", 0, 0, 8, 10)
GMAH NOM 5 offset (-15, 12)
GMAH A 0 A_JumpIfInventory("WildCoilAmmo", 1, "GameOverGun")
GMAH A 0 A_JumpIfInventory("MegaBallAmmo", 1, "BusterLower")
GMAH M 1 A_Refire("BusterFire")
goto BusterLower
BusterLower:
GMAH M 1 offset (-15, 12)
GMAH M 1 offset (-9, 22)
GMAH M 1 offset (-3, 32)
Goto Ready
FistsReady:
GMAH A 0 A_JumpIfInventory("SolarBlazeAmmo", 1, "Ending")
GMAH A 0 A_JumpIfInventory("ScorchWheelAmmo", 1, "Cutscene")
GMAH A 0 A_JumpIfInventory("WildCoilAmmo", 1, "GameOver")
GMAH A 0 A_JumpIfInventory("PowerStoneAmmo", 1, "LowerToGun")
GMAH A 0 A_JumpIfInventory("SkullBarrierAmmo", 1, "Uppercut")
GMAH A 0 A_JumpIfInventory("AtomicFireAmmo", 1, "Punch")
GMAH A 0 A_JumpIfInventory("BreakDashAmmo", 1, "DashLeft")
GMAH A 0 A_JumpIfInventory("TenguBladeAmmo", 1, "DashRight")
GMAH A 1 offset (-0, 32) A_WeaponReady(WRF_NOBOB)
loop
DashLeft:
GMAH A 0 A_JumpIfInventory("PowerStoneAmmo", 1, "LowerToGun")
ECL3 A 0 A_PlaySoundEx("misc/gamma2dash", "Voice")
GMAH A 1 offset (-40, 36)
GMAH A 1 offset (-60, 40)
GMAH A 1 offset (-70, 44)
GMAH A 1 offset (-75, 46)
GMAH A 2 offset (-78, 46)
GMAH A 2 offset (-80, 46)
GMAH A 2 offset (-81, 46)
GMAH A 2 offset (-81, 46)
GMAH A 2 offset (-85, 46)
GMAH A 1 offset (-75, 46)
GMAH A 1 offset (-60, 40)
GMAH A 1 offset (-20, 32)
Goto FistsReady
DashRight:
GMAH A 0 A_JumpIfInventory("PowerStoneAmmo", 1, "LowerToGun")
ECL3 A 0 A_PlaySoundEx("misc/gamma2dash", "Voice")
GMAH A 1 offset (40, 36)
GMAH A 1 offset (60, 40)
GMAH A 1 offset (70, 44)
GMAH A 1 offset (75, 46)
GMAH A 2 offset (78, 46)
GMAH A 2 offset (80, 46)
GMAH A 2 offset (81, 46)
GMAH A 2 offset (81, 46)
GMAH A 2 offset (85, 46)
GMAH A 1 offset (75, 46)
GMAH A 1 offset (60, 40)
GMAH A 1 offset (20, 32)
Goto FistsReady
//Fire:
Uppercut:
GMAH FL 2 offset (-0, 1) A_Recoil(3)
ECL3 A 0 A_PlaySoundEx("misc/gamma2chargeupper", "Voice")
GMAH GGHGHGHGHGHGGGGGGGG 1 A_Stop
GMAH I 1 A_Recoil(-20)
GMAH A 0 A_Quake(9, 40, 0, 128)
GMAH I 0 ACS_NAmedExecuteAlways("GammaUppercut", 0)
GMAH I 1 A_ChangeVelocity(12, 0, 8, CVF_RELATIVE|CVF_REPLACE)
ECL3 A 0 A_PlaySoundEx("misc/gamma2upperhit", "Voice")
GMAH JJ 1
GMAH K 40
GMAH JI 6
GMAH J 0 A_JumpIfInventory("AstroCrushAmmo", 1, "AnimeFistsReady")
goto LowerToGun
Punch:
GMAH D 0 A_TakeInventory("AtomicFireAmmo", 9999)
GMAH A 0 A_JumpIfInventory("PowerStoneAmmo", 1, "LowerToGun")
GMAH A 0 A_PlaysoundEx("misc/gamma2swing", CHAN_VOICE)
GMAH A 0 A_JumpIfInventory("AstroCrushAmmo", 1, "AnimePunches")
GMAH A 0 ACS_NamedExecute("GammaPunchThrust",0)
GMAH B 0 A_JumpIfInventory("ChargeKickAmmo", 1, "PunchLeft")
PunchRight:
GMAH B 0 offset (-0, 32) A_GiveInventory("ChargeKickAmmo", 1)
GMAH A 0 A_JumpIfInventory("AstroCrushAmmo", 1, "AnimePunchRight")
GMAH BB 1 offset (-10, 22)
GMAH BB 1 offset (-20, 17) //A_Recoil(-1)
GMAH BC 1 offset (-30, 12) //A_Recoil(-5)
GMAH C 0 ACS_NamedExecuteAlways("GammaPunched", 0)
GMAH CCCCCCC 1 offset (-40, 12) //A_Stop
GMAH BB 3 offset (-35, 12)// A_Recoil(2)
GMAH A 0 A_JumpIfInventory("BreakDashAmmo", 1, "DashLeft")
GMAH A 0 A_JumpIfInventory("TenguBladeAmmo", 1, "DashRight")
GMAH B 1 offset (-20, 17)
GMAH A 0 A_JumpIfInventory("BreakDashAmmo", 1, "DashLeft")
GMAH A 0 A_JumpIfInventory("TenguBladeAmmo", 1, "DashRight")
GMAH B 1 offset (-10, 22)
GMAH A 0 A_JumpIfInventory("BreakDashAmmo", 1, "DashLeft")
GMAH A 0 A_JumpIfInventory("TenguBladeAmmo", 1, "DashRight")
GMAH B 1 offset (0, 32)
Goto FistsReady
PunchLeft:
GMAH D 0 A_TakeInventory("ChargeKickAmmo", 9999)
GMAH A 0 A_JumpIfInventory("AstroCrushAmmo", 1, "AnimePunchLeft")
GMAH B 0 offset (-0, 32)
GMAH DD 1 offset (10, 22)
GMAH DD 1 offset (20, 17)
GMAH DE 1 offset (30, 12) //A_Recoil(-5)
GMAH C 0 ACS_NamedExecuteAlways("GammaPunched", 0)
GMAH EEEEEEE 1 offset (40, 12) //A_Stop
GMAH DD 3 offset (35, 12) //A_Recoil(2)
GMAH A 0 A_JumpIfInventory("BreakDashAmmo", 1, "DashLeft")
GMAH A 0 A_JumpIfInventory("TenguBladeAmmo", 1, "DashRight")
GMAH D 1 offset (20, 17)
GMAH A 0 A_JumpIfInventory("BreakDashAmmo", 1, "DashLeft")
GMAH A 0 A_JumpIfInventory("TenguBladeAmmo", 1, "DashRight")
GMAH D 1 offset (10, 22)
GMAH A 0 A_JumpIfInventory("BreakDashAmmo", 1, "DashLeft")
GMAH A 0 A_JumpIfInventory("TenguBladeAmmo", 1, "DashRight")
GMAH D 1 offset (0, 32)
Goto FistsReady
GameOverGun:
GMAH A 0 A_GiveInventory("WildCoilAmmo", 1)
GMAH M 2 offset (-0, 32)
GMAH M 2 offset (-0, 42)
GMAH M 2 offset (-0, 52)
GMAH M 2 offset (-0, 62)
GMAH M 2 offset (-0, 72)
GMAH M 2 offset (-0, 82)
GMAH M 2 offset (-0, 92)
GMAH M 2 offset (-0, 112)
GameOver:
GMAH A 0 A_GiveInventory("WildCoilAmmo", 1)
GameOverWait:
GMAH M 1 offset (-0, 122)
GMAH M 0 offset (-0, 122) A_JumpIfInventory("WildCoilAmmo", 1, "GameOverWait")
Goto RaiseToFists
GameOverFists:
GMAH A 0 A_GiveInventory("WildCoilAmmo", 1)
GMAH A 2 offset (-0, 32)
GMAH A 2 offset (-0, 42)
GMAH A 2 offset (-0, 52)
GMAH A 2 offset (-0, 62)
GMAH A 2 offset (-0, 72)
GMAH A 2 offset (-0, 82)
GMAH A 2 offset (-0, 92)
GMAH A 2 offset (-0, 112)
GMAH A 2 offset (-0, 142)
Goto GameOver
Cutscene:
GMAH M 0 offset (-0, 122)
GMAH A 1 offset (-0, 32) A_JumpIfInventory("WildCoilAmmo", 1, "GameOverFists")
loop

AnimeFistsReady:
GMAH A 0 A_JumpIfInventory("SolarBlazeAmmo", 1, "Ending")
GMAH A 0 A_JumpIfInventory("MegaBallAmmo", 1, "AnimeDashEnd")
GMAH A 0 A_JumpIfInventory("WildCoilAmmo", 1, "GameOver")
GMAH A 1 offset (-0, 32) A_WeaponReady(WRF_NOBOB)
loop
AnimeDashStart:
ECL3 A 0 A_PlaySoundEx("misc/gamma2jet", "Body")
AnimeDash:
GMAH A 0 A_JumpIfInventory("MegaBallAmmo", 1, "AnimeDashEnd")
GMAH A 1 offset (-0, 42) A_Recoil(-ACS_NamedExecuteWithREsult("GetGammaSpeed"))
GMAH A 0 A_JumpIfInventory("MegaBallAmmo", 1, "AnimeDashEnd")
GMAH A 1 offset (-0, 44) //A_Recoil(-2)
GMAH A 0 A_JumpIfInventory("MegaBallAmmo", 1, "AnimeDashEnd")
GMAH A 1 offset (-0, 46) A_Recoil(-ACS_NamedExecuteWithREsult("GetGammaSpeed"))
GMAH A 0 A_JumpIfInventory("MegaBallAmmo", 1, "AnimeDashEnd")
GMAH A 1 offset (-0, 47) //A_Recoil(-2)
GMAH A 0 A_JumpIfInventory("MegaBallAmmo", 1, "AnimeDashEnd")
GMAH A 2 offset (-0, 48) A_Recoil(-ACS_NamedExecuteWithREsult("GetGammaSpeed"))
GMAH A 0 A_JumpIfInventory("MegaBallAmmo", 1, "AnimeDashEnd")
GMAH A 1 offset (-0, 47) //A_Recoil(-2)
GMAH A 0 A_JumpIfInventory("MegaBallAmmo", 1, "AnimeDashEnd")
GMAH A 1 offset (-0, 46) A_Recoil(-ACS_NamedExecuteWithREsult("GetGammaSpeed"))
GMAH A 0 A_JumpIfInventory("MegaBallAmmo", 1, "AnimeDashEnd")
GMAH A 1 offset (-0, 44) //A_Recoil(-2)
GMAH A 0 A_JumpIfInventory("MegaBallAmmo", 1, "AnimeDashEnd")
GMAH A 1 offset (-0, 42) A_Refire("AnimeDash")
GMAH A 8 offset (-0, 32)
Goto AnimeFistsReady
AnimeDashEnd:
GMAH A 1 offset (-0, 38) A_GiveInventory("MegaBallAmmo", 1)
Goto FistsReady

AnimePunches:
GMAH D 0 A_TakeInventory("AtomicFireAmmo", 9999)
GMAH A 0 ACS_NamedExecute("GammaPunchThrust",0,1)
GMAH B 0 A_JumpIfInventory("ChargeKickAmmo", 1, "AnimePunchLeft")
AnimePunchRight:
GMAH B 0 offset (-0, 32) A_GiveInventory("ChargeKickAmmo", 1)
GMAH B 1 offset (-20, 17) //A_Recoil(-1)
GMAH BC 1 offset (-30, 12) //A_Recoil(-5)
GMAH C 0 ACS_NamedExecuteAlways("GammaPunched", 0)
GMAH CCCCCCCC 1 offset (-40, 12) //A_Stop
GMAH B 1 offset (-35, 12)// A_Recoil(2)
GMAH A 0 A_JumpIfInventory("BreakDashAmmo", 1, "DashLeft")
GMAH A 0 A_JumpIfInventory("TenguBladeAmmo", 1, "DashRight")
GMAH B 1 offset (-10, 22)
GMAH A 0 A_JumpIfInventory("BreakDashAmmo", 1, "DashLeft")
GMAH A 0 A_JumpIfInventory("TenguBladeAmmo", 1, "DashRight")
GMAH B 1 offset (0, 32) 
Goto FistsReady
AnimePunchLeft:
GMAH D 0 A_TakeInventory("ChargeKickAmmo", 9999)
GMAH B 0 offset (-0, 32)
GMAH D 1 offset (20, 17)
GMAH DE 1 offset (30, 12) //A_Recoil(-5)
GMAH C 0 ACS_NamedExecuteAlways("GammaPunched", 0)
GMAH EEEEEEEE 1 offset (40, 12) //A_Stop
GMAH D 1 offset (35, 12) //A_Recoil(2)
GMAH A 0 A_JumpIfInventory("BreakDashAmmo", 1, "DashLeft")
GMAH A 0 A_JumpIfInventory("TenguBladeAmmo", 1, "DashRight")
GMAH D 1 offset (10, 22)
GMAH A 0 A_JumpIfInventory("BreakDashAmmo", 1, "DashLeft")
GMAH A 0 A_JumpIfInventory("TenguBladeAmmo", 1, "DashRight")
GMAH D 1 offset (0, 32)
Goto FistsReady


Ending:
GMAH P 0 A_PlaySoundEx("misc/gamma2chargeupper", "Voice")
GMAH PQPQPQPQPQPPPPPPPP 1 offset (10, 22)
GMAH R 2 offset (20, 22)
FMAG W 0 A_PlaySoundEx("misc/gamma2endhit", "Voice")
GMAH S 40 offset (50, 12) ACS_NamedExecute("EclipseEndPain", 0)//A_Quake(9, 10, 0, 255, 0)
GMAH R 6 offset (40, 12)
GMAH P 0 A_PlaySoundEx("misc/gamma2chargeupper", "Voice")
GMAH TUTUTUTUTUTUUUUUUU 1 offset (-10, 22)
GMAH V 2 offset (-10, 22)
FMAG W 0 A_PlaySoundEx("misc/gamma2endhit", "Voice")
GMAH W 50 offset (-30, 12) ACS_NamedExecute("EclipseEndPain", 0)//A_Quake(9, 10, 0, 255, 0)
GMAH W 1 offset (-30, 10) A_Quake(2, 20*35, 0, 255, 0)
GMAH W 1 offset (-31, 12)
GMAH W 1 offset (-32, 10)
GMAH W 1 offset (-29, 13)
GMAH W 1 offset (-30, 10)
GMAH W 1 offset (-29, 12)
GMAH W 1 offset (-31, 13)
GMAH W 1 offset (-29, 12)
GMAH W 1 offset (-29, 13)
GMAH W 1 offset (-32, 13)
GMAH W 1 offset (-31, 10)
GMAH W 1 offset (-31, 13)
GMAH W 1 offset (-31, 10)
GMAH W 1 offset (-31, 13)
GMAH W 1 offset (-31, 10)
GMAH W 1 offset (-29, 13)
GMAH W 1 offset (-29, 13)
GMAH W 1 offset (-30, 10)
GMAH W 1 offset (-29, 13)
GMAH W 1 offset (-30, 10)
GMAH W 1 offset (-29, 11)
GMAH W 1 offset (-31, 13)
GMAH W 1 offset (-32, 13)
GMAH W 1 offset (-29, 12)
GMAH W 1 offset (-32, 13)
GMAH W 1 offset (-32, 13)
GMAH W 1 offset (-29, 12)
GMAH W 1 offset (-30, 11)
GMAH W 1 offset (-29, 12)
GMAH W 1 offset (-32, 10)
GMAH W 1 offset (-29, 10)
GMAH W 1 offset (-30, 11)
GMAH W 1 offset (-31, 10)
GMAH W 1 offset (-30, 12)
GMAH W 1 offset (-32, 12)
GMAH W 0 A_PlaySoundEx("misc/gamma2jet", "Voice")
GMAH W 0 A_GiveInventory("SolarBlazeAmmo", 1)
EndLoop:
GMAH W 1 offset (-34, 7) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-28, 16) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-28, 9) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-31, 10) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-27, 7) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-32, 8) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-35, 16) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-26, 10) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-30, 7) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-26, 14) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-35, 16) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-27, 14) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-29, 14) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-34, 10) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-35, 12) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-27, 9) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-28, 16) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-30, 8) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-31, 15) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-34, 11) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-29, 16) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-32, 9) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-30, 16) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-32, 8) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-33, 13) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-34, 12) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-33, 7) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-29, 8) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-33, 7) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-33, 16) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-34, 8) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-32, 9) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-34, 8) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-31, 8) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
GMAH W 1 offset (-31, 15) A_JumpIfInventory("TopSpinAmmo", 1, "EndEject")
loop
EndEject:
HSPR N 0 A_WeaponReady(WRF_NOSWITCH|WRF_NOFIRE) // reset hud
HSPR NOPQR 2 // offset (-0, 1)
TNT1 A -1
stop
}
}

actor GammaPlayerIntro
{
	scale 0.5
	+NOGRAVITY
	states
	{
		Spawn:
		TNT1 A 0
		TNT1 A 0 A_ChangeVelocity(0, 0, -0.6, CVF_REPLACE)
		TNT1 A 0 A_SpawnItemEx("GammaPlayerJetPackFX")
		TNT1 A 0 A_SpawnItemEx("GammaPlayerJetPackFX2")
		Intro:
		GMA2 B 1 A_JumpIf(floorz-z==0, "Land")
		loop
		Land:
		TNT1 A 0 A_Quake(3, 8, 0, 512, "")
		TNT1 A 0 A_PlaySoundEx("misc/bigstomp", "Voice", 0, 0)
		TNT1 A 0 A_GiveInventory("CutterFlag", 1)
		GMA2 A 0 A_SpawnItemEx("GammaPlayerLandDustSpawn")
		GMA2 CDDEEEEE 7
		GMA2 AAAAAAAA 5
		GMA2 A 0 A_JumpIf(ACS_NamedExecuteWithResult("HasBeatGame", 0) == true, "Bonus") // if has beaten game
		//GMA2 A 0 A_JumpIfInventory("CutterFlag", 1, "Bonus")
		GMA2 AAAAAAAAAAAAA 5
		GMA2 A 0 A_PlaySoundEx("misc/gamma2sparkle", 0, 0, 1)
		GMA2 FGH 2
		GMA2 A -1
		stop
		Bonus:
		GMA2 IJJJJJJJJJJJJJ 4
		GMA2 A 0 A_PlaySoundEx("misc/gamma2sparkle", 0, 0, 1)
		GMA2 KLM 2
		GMA2 J -1
		stop
	}
}

actor GammaPlayerJetPackFX
{
	PROJECTILE
	+NOINTERACTION
	translation "210:215=200:200"
	scale 0.5
	reactiontime 0
	
	states
	{
	Spawn:
	TNT1 A 0 A_JumpIfInTargetInventory("CutterFlag", 1, "Death")
	ASEX CBA 2 A_Warp(AAPTR_TARGET, -4, 6 - reactiontime, 56, 0, WARPF_NOCHECKPOSITION) 
	loop
	Death:
	TNT1 A 0
	stop
	}
}

actor GammaPlayerJetPackFX2 : GammaPlayerJetPackFX
{
	reactiontime 12
}

actor GammaPlayerProjectile
{
	PROJECTILE
	scale 1.4
	Speed 20
	damage (100)
	radius 8
	height 8
	damagetype "Gamma"
	states
	{
	Spawn:
	CHBU ABCD 1 A_SpawnItemEx("GammaPlayerProjectileFX")
	loop
	XDeath:
	Death:
	CHBU A 0 A_SpawnITemEx("GammaPlayerProjectileExplode")
	stop
	//XDeath:
	TNT1 A 0
	stop
	Crash:
	TNT1 AAAA 2 A_SpawnITemEx("GammaPlayerProjectileFizzle", random(-3, 3), random(-3, 3), random(0, 3), 0, 0, frandom(0.5, 2))
	stop
	}
}

actor GammaPlayerProjectileFizzle
{
	scale 0.2
	PROJECTILE
	+NOINTERACTION
	translation "4:4=60:60", "80:92=249:249"
	states
	{
		Spawn:
		POOF B 1 A_FadeOut(0.05)
		loop
	}
}

actor GammaPlayerProjectileExplode
{
	+FORCEXYBILLBOARD
	scale 1.0
	PROJECTILE
	+NOINTERACTION
	damagetype "Trample"
	translation "210:215=197:197"
	states
	{
	Spawn:
	ASEX A 0
	ASEX A 0 A_Explode(1, 32, 0, 0, 32)
	ASEX A 0 A_playSoundEx("misc/mm3explosion", "Weapon", 0, 0)
	ASEX ABDEFGH 3
	stop
	}
}

actor GammaPlayerProjectileFX
{
	scale 1.0
	renderstyle add
	+NOINTERACTION
	
	states
	{
	Spawn:
	CHBU AAAAAAA 1 A_SetScale(scalex - 0.05, scaley - 0.05)
	Fade:
	CHBU A 0 A_SetScale(scalex - 0.05, scaley - 0.05)
	CHBU A 1 A_FadeOut(0.1)
	loop
	}
}

actor GammaPlayerLandDustSpawn
{
	+NOINTERACTION
	+MISSILE
	reactiontime 5
	
	damagetype "Trample"
	
	states
	{
		Spawn:
		TNT1 A 0
		TNT1 A 0 A_Explode(1, 32, 0, 0, 32)
		TNT1 AAAAAA 0 A_SpawnITemEx("GammaPlayerLandDust", 10, 0, 0, random(2, 8), 0, -1, random(0,360))
		TNT1 A 1 A_CountDown
		loop
	}
}

actor GammaPlayerLandDust
{
	scale 0.5
	+NOINTERACTION
	+FORCEXYBILLBOARD
	
	states
	{
	Spawn:
	Fade:
	POOF B 0 A_ScaleVelocity(0.8)
	POOF B 0 A_ChangeVelocity(0, 0, 0.06)
	POOF B 1 A_FadeOut(0.02)
	loop
	}
}

actor GammaPlayerFootstep : GammaPlayerLandDustSpawn
{
	states
	{
		Spawn:
		TNT1 A 0
		TNT1 A 0 A_Explode(1, 10, 0, 0, 10)
		stop
	}
}

actor GammaPlayerDamageFX
{
	+NOINTERACTION
	+MISSILE
	height 1
	radius 1
	scale 0.08
	var int user_zoffs;
	var int user_yoffs;
	
	states
	{
	Spawn:
	TNT1 A 0
	TNT1 A 0 A_SetUserVar(user_zoffs, random(-5.0, 5.0))
	TNT1 A 0 A_SetUserVar(user_yoffs, random(-10.0, 10.0))
	FX:
	ASEX ABCDEF 2 A_Warp(AAPTR_TARGET, 8, user_yoffs, 50.0 + user_zoffs, 0, WARPF_COPYINTERPOLATION|WARPF_NOCHECKPOSITION) 
	stop
	}
}

actor GammaPlayerDeathFX : GammaPlayerDamageFX
{
	states
	{
	Spawn:
	TNT1 A 0
	TNT1 A 0 A_SetUserVar(user_zoffs, random(-10.0, 10.0))
	TNT1 A 0 A_SetUserVar(user_yoffs, random(-10.0, 10.0))
	FX:
	ASEX ABCDEF 2 A_Warp(AAPTR_TARGET, 8, user_yoffs, user_zoffs, 0, WARPF_COPYINTERPOLATION|WARPF_NOCHECKPOSITION) 
	stop
	}
}

actor GammaPlayerPunchFX
{
	+NOINTERACTION
	+MISSILE
	scale 0.2
	states
	{
		Spawn:
		TNT1 A 0
		TNT1 A 0 A_Warp(AAPTR_TARGET, 12, frandom(-2, 2), 50.0 +  frandom(-0.5, 0.5), 0, WARPF_COPYINTERPOLATION|WARPF_NOCHECKPOSITION) 
		FX:
		ECL5 AABB 1 A_SpawnItemEx("EclipseGib", 8, random(-5, 5), random(-5, 5), 0, random(-5, 5), random(1, 5), 0)  
		ELC5 CDEF 2
		stop
	}
}

actor GammaPlayerPowerParticle
{
	PROJECTILE
	translation "198:198=192:192"
	renderstyle add
	scale 0.7
	states
	{
		Spawn:
		INTQ EE 1 A_FadeOut(0.04)
		INTQ E 0 A_ScaleVelocity(0.9)
		INTQ FF 1 A_FadeOut(0.04)
		INTQ E 0 A_ScaleVelocity(0.9)
		INTQ GG 1 A_FadeOut(0.04)
		INTQ E 0 A_ScaleVelocity(0.9)
		INTQ FF 1 A_FadeOut(0.04)
		INTQ E 0 A_ScaleVelocity(0.9)
		loop
	}
}

actor GammaPlayerPowerParticleSpawner : CustomInventory
{
	states
	{
		Pickup:
		TNT1 A 0 A_SpawnItemEx("GammaPlayerPowerParticle", 50, 0, 10, velx, vely, random(2, 5), random(-90,90), SXF_ABSOLUTEVELOCITY)
		stop
	}
}

actor EclipseCloudSpam
{
	+NOINTERACTION
	states
	{
	Spawn:
	TNT1 A 1 A_SpawnITemEx("EclipseCloud", 0, 0, 0, 20, frandom(-2, 2), frandom(2, 4))
	TNT1 A 1 A_SpawnITemEx("EclipseCloud", 0, 0, 0, 20, frandom(-2, 2), frandom(-2, -4))
	TNT1 A 1 A_SpawnITemEx("EclipseCloud", 0, 0, 0, 20, frandom(2, 4), frandom(-2, 2))
	TNT1 A 1 A_SpawnITemEx("EclipseCloud", 0, 0, 0, 20, frandom(-2, -4), frandom(-2, 2))
	loop
	}
}

actor EclipseCloud : WeaponArchiveCloud
{
+NOGRAVITY
scale 2.5
states
{
Spawn:
TNT1 A 0
//TNT1 A 0 A_ChangeVelocity(0, 0, -80, 0)
W_RC O 0 A_Jump(128, "Other")
Cloud1:
W_RC O 1 A_ScaleVelocity(1.01)
loop
Other:
W_RC P 1 A_ScaleVelocity(1.01)
loop
}
}

actor EclipseSun
{
+NOINTERACTION
scale 0.55
	states
	{
		Spawn:
		CSPP IJKL 7
		loop
	}
}

actor Gamma2IntoSun
{
+NOINTERACTION
-SOLID
	scale 0.50
	states
	{
	Spawn:
	GMA2 N 230
	Fade:
	GMA2 N 1 A_FadeOut(0.1)
	loop
	}
}

actor DuoGhostProp
{
	scale 2.5
	alpha 0.0
	renderstyle translucent
	//+NOINTERACTION

	states
	{
	Spawn:
	TNT1 A 0
	TNT1 A 1 //ACS_NamedExecuteAlways("Duoghostbob", 0)
	Floating:
	ODUO L 1
	loop
	Fade:
	ODUO L 8 A_FadeIn(0.001)
	loop
	}
}

actor DuoGhostEnergy
{
radius 2
height 2
renderstyle none
+NOGRAVITY
states
{
Spawn:
PLAY A 90 A_SpawnItemEx("DuoGhostFX", random(0, 8), random(-120, 120), 0, 0, 0, frandom(0.75, 1))
loop
}
}

actor DuoGhostFX
{
scale 3.0
+NOGRAVITY
-SOLID
states
{
Spawn:
RBFX TUTUTUTUTUTUTUTUTUTU 6
Fade:
RBFX TTTTTTUUUUUU 1 A_FadeOut(0.01)
loop
}
}


actor GenesisUnitSleep
{
	-SOLID
	Height 32
	Radius 64
	Scale 2.5
	States
	{
	Spawn:
		GNUS AB 45
		GNUS A 45 A_SpawnItemEx("GenesisUnitSleepZZZ", 0, 0, 48, 0, 0, 0, 0)
		GNUS B 45
	loop
	}
}

actor GenesisUnitSleepZZZ
{
PROJECTILE
+THRUACTORS
Radius 32
Height 32
scale 2.5
States
{
Spawn:
GNUS CDEFG 6
TNT1 A -1
stop
}
}