actor PowerStoneBoss : BaseMM8BDMWep_CBM 
{
dropitem "PowerStoneWepCDropped"
Weapon.AmmoUse 0
Weapon.AmmoGive 3
Weapon.SlotNumber 1
Obituary "$OB_POWERSTONE"
weapon.ammotype "CantStopTheRockAmmo"
States
{
Spawn:
C_05 C 1
loop
Ready:
POWB E 0 ACS_ExecuteAlways(998,0,802)
goto Ready2
Ready2:
POWB E 0 A_JumpIfInventory("StoneBossLeap2",1,"ReadyAir")
POWB E 1 A_WeaponReady
goto Ready2+1
ReadyAir:
POWB E 1 A_WeaponReady(8)
goto Ready2
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
POWB E 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
POWB E 1 A_Raise
Loop
Fire:
POWB E 0 A_JumpIfInventory("StoneBossLeap",1,"FireLeap")
POWB E 0 A_PlaySoundEx("weapon/powerstone","Weapon")
POWB E 2 offset(0,28)
POWB F 2 offset(0,42)
POWB F 2 offset(0,34)
POWB E 0 //A_JumpIf(pitch<350 && pitch>=270, "FireUp")
POWB E 0 A_JumpIf(pitch>0 && pitch<=90, "FireDown")
POWB G 3 offset(0,48) A_GiveInventory("StonemanMain1_CI",1)
goto FireEnd
FireDown:
POWB G 3 offset(0,48) A_GiveInventory("StonemanMain2_CI",1)
goto FireEnd
FireEnd:
POWB G 2 offset(0,34)
POWB G 2 offset(0,48)
POWB F 2 offset(0,26)
POWB F 2 offset(0,40)
POWB E 2 offset(0,20)
POWB E 2 offset(0,22)
POWB E 2 offset(0,24)
POWB E 2 offset(0,26)
POWB E 2 offset(0,28)
POWB E 2 offset(0,30)
Goto Ready2

FireLeap:
POWB E 0 A_GiveInventory("StoneBossLeap2",1)
POWB E 0 A_GiveInventory("LadderEnable",1)
POWB E 0 A_TakeInventory("StoneBossLeap",9999)
POWB E 0 A_TakeInventory("StoneBossCharge",9999)
POWB E 0 ACS_ExecuteAlways(648,0,3)//1.0 speed and jump
POWB E 0 A_GunFlash
goto Fire+1

Flash:
TNT1 A 0 A_JumpIf(z-floorz==0,7)
TNT1 A 0 A_JumpIf(momz==0,3)
TNT1 A 0 A_JumpIfInventory("IsDead",1,"NoFlash")
TNT1 A 1
loop
TNT1 A 1
TNT1 A 0 A_JumpIf(z-floorz==0,2)
TNT1 A 0 A_JumpIf(momz==0,1)
goto Flash+2
TNT1 A 1 A_TakeInventory("StoneBossLeap2",9)
goto Flash+2

Altfire:
POWB E 0 A_JumpIfInventory("StoneBossCharge",1,"AltfireStomp")
POWB E 0 A_GiveInventory("StoneBossCharge",1)
POWB HI 2
StoneCharge:
POWB J 0 A_JumpIfInventory("StoneBossCharge",15,"StoneCharge2")//A_PlaySoundEx("weapon/HeatShield","Weapon")
POWB J 2
POWB J 0 A_GiveInventory("StoneBossCharge",1)
POWB J 0 A_Refire("StoneCharge")
goto StoneJump
StoneCharge2:
POWB J 0 A_JumpIfInventory("StoneBossCharge",30,"StoneCharge3")
POWB J 2 offset(0,35)
POWB J 0 A_GiveInventory("StoneBossCharge",1)
POWB J 0 A_Refire("StoneCharge2")
goto StoneJump
StoneCharge3:
POWB J 0 A_JumpIfInventory("StoneBossCharge",45,"StoneCharge4")
POWB J 2 offset(0,38)
POWB J 0 A_GiveInventory("StoneBossCharge",1)
POWB J 0 A_Refire("StoneCharge3")
goto StoneJump
StoneCharge4:
POWB J 0 A_JumpIfInventory("StoneBossCharge",60,"StoneCharge5")
POWB J 2 offset(0,41)
POWB J 0 A_GiveInventory("StoneBossCharge",1)
POWB J 0 A_Refire("StoneCharge4")
goto StoneJump
StoneCharge5:
POWB J 0 A_JumpIfInventory("StoneBossCharge",75,"StoneCharge6")
POWB J 2 offset(0,44)
POWB J 0 A_GiveInventory("StoneBossCharge",1)
POWB J 0 A_Refire("StoneCharge5")
goto StoneJump
StoneCharge6:
POWB J 0 A_JumpIfInventory("StoneBossCharge",90,"StoneCharge7")
POWB J 2 offset(0,47)
POWB J 0 A_GiveInventory("StoneBossCharge",1)
POWB J 0 A_Refire("StoneCharge6")
goto StoneJump
StoneCharge7:
POWB J 2 offset(0,50)A_RailWait
POWB J 0 A_Refire(1)
goto StoneJump
POWB J 2 offset(0,47)A_RailWait
POWB J 0 A_Refire("StoneCharge7")
goto StoneJump
StoneJump:
POWB J 0 ACS_ExecuteAlways(191,0,4)//1.75 speed//9
POWB J 0 ACS_ExecuteAlways(648,0,1)//No jump
POWB J 0 A_Recoil(-10)//A_Recoil(-25)
POWB J 0 A_GiveInventory("StoneBossLeap",1)
POWB J 0 A_TakeInventory("JumpCancler",1)
POWB J 0 A_GiveInventory("LadderDisable",1)
POWB J 0 offset(0,30) A_SpawnItemEx("StoneCrushHead",0,0,56,0,0,20)

POWB J 0 A_JumpIfInventory("StoneBossCharge",90,"AltfireJump6")
POWB J 0 A_JumpIfInventory("StoneBossCharge",75,"AltfireJump5")
POWB J 0 A_JumpIfInventory("StoneBossCharge",60,"AltfireJump4")
POWB J 0 A_JumpIfInventory("StoneBossCharge",45,"AltfireJump3")
POWB J 0 A_JumpIfInventory("StoneBossCharge",30,"AltfireJump2")
POWB J 0 A_JumpIfInventory("StoneBossCharge",15,"AltfireJump")
POWB I 1 ThrustThingZ(0,60,0,0)
goto AltfireRise
AltfireJump:
POWB I 1 ThrustThingZ(0,72,0,0)
goto AltfireRise
AltfireJump2:
POWB I 1 ThrustThingZ(0,84,0,0)
goto AltfireRise
AltfireJump3:
POWB I 1 ThrustThingZ(0,96,0,0)
goto AltfireRise
AltfireJump4:
POWB I 1 ThrustThingZ(0,108,0,0)
goto AltfireRise
AltfireJump5:
POWB I 1 ThrustThingZ(0,120,0,0)
goto AltfireRise
AltfireJump6:
POWB I 1 ThrustThingZ(0,132,0,0)
goto AltfireRise
AltfireRise:
POWB I 1 ThrustThingZ(0,4,1,1)
POWB I 0 A_SpawnItemEx("StoneCrushHead",0,0,56,0,0,20)
POWB H 1 ThrustThingZ(0,4,1,1)
POWB H 0 A_SpawnItemEx("StoneCrushHead",0,0,56,0,0,20)
POWB H 1 ThrustThingZ(0,4,1,1)
POWB H 0 A_SpawnItemEx("StoneCrushHead",0,0,56,0,0,20)

Fallcheck:
POWB F 0 ThrustThingZ(0,1,1,1)
POWB F 0 A_SpawnItemEx("StoneCrushHead",0,0,56,0,0,20)
POWB F 0 A_JumpIf(momz<=0,"Fall")
POWB F 1 A_WeaponReady(2)//6//WRF_NOPRIMARY
loop

Fall:
POWB G 0 ThrustThingZ(0,1,1,1)//10
POWB G 0 A_SpawnItemEx("StoneCrush",0,0,-10,0,0,-10)
POWB G 0 A_JumpIf(z-floorz==0, "Shockland")
POWB G 0 A_JumpIfInventory("StoneBossLeap",999,"Shockland")
POWB G 0 A_GiveInventory("StoneBossLeap",1)
POWB G 1 A_WeaponReady(2)
loop

AltfireStomp:
POWB G 1 ThrustThingZ(0,60,1,1)
POWB G 0 A_SpawnItemEx("StoneCrush",0,0,-10,0,0,-10)
POWB G 0 A_GiveInventory("StoneBossLeap",1)
POWB G 0 A_JumpIf(z-floorz==0, "Shockland")
POWB G 0 A_Refire("AltfireStomp")
goto Fall

//POWB E 0 A_ReFire("AltfireRise")
//POWB EEEEEEEEE 1 A_SpawnItemEx("StoneCrushHead",0,0,56,0,0,20)
/*POWB F 2 A_Stop
POWB F 0 A_SpawnItemEx("StoneCrush",0,0,-64,0,0,-60)
POWB G 1 ThrustThingZ(0,120,1,0)
POWB G 5 A_JumpIf(z-floorz==0, "Shockland")
POWB G 1 ThrustThingZ(0,120,1,0)
POWB G 5 A_JumpIf(z-floorz==0, "Shockland")
POWB G 1 ThrustThingZ(0,120,1,0)
POWB G 5 A_JumpIf(z-floorz==0, "Shockland")
POWB G 1 ThrustThingZ(0,120,1,0)
POWB G 5 A_JumpIf(z-floorz==0, "Shockland")
POWB G 1 ThrustThingZ(0,120,1,0)
POWB G 5 A_JumpIf(z-floorz==0, "Shockland")
POWB G 1 ThrustThingZ(0,120,1,0)
POWB G 5 A_JumpIf(z-floorz==0, "Shockland")
POWB G 1 ThrustThingZ(0,120,1,0)
POWB G 5 A_JumpIf(z-floorz==0, "Shockland")*/
Shockland:
POWB G 0 A_GiveInventory("LadderEnable",1)
POWB G 0 A_TakeInventory("StoneBossLeap",9999)
POWB G 0 A_TakeInventory("StoneBossCharge",9999)
POWB G 0 A_PlaySoundEX("misc/hugequake","Weapon")
POWB G 0 A_GiveInventory("StonemanAlt_CI",1)
POWB F 0 A_FireCustomMissile("StoneQuakeDamage",0,0,0,0)
POWB F 0 A_Stop
//POWB F 0 A_GiveInventory("StopinatorFlag",1)
//POWB F 0 A_SpawnItemEx("StopinatorHelper",1)
POWB F 1 SetPlayerProperty(0,1,0)
POWB F 0 A_Stop
POWB FFEEEEEEEE 2
//POWB FFFFEEEEEEEEEEEEEEEE 1 A_Stop
POWB F 0 SetPlayerProperty(0,0,0)
//POWB E 0 A_TakeInventory("StopinatorFlag",9999)
POWB E 0 ACS_ExecuteAlways(648,0,3)//1.0 speed and jump
POWB E 15 
NoAmmo:
POWB E 0
//POWB E 1 ACS_Execute(979,0)
Goto Ready2
}
}


actor CantStopTheRockAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 3
+INVENTORY.IGNORESKILL
}

actor StoneBossCharge : Inventory
{
inventory.amount 1
inventory.maxamount 90
}

actor StoneBossLeap : Inventory
{
inventory.amount 1
inventory.maxamount 999
}

actor StoneBossLeap2 : OnceC {}

actor PowerStoneManSpawner : PowerStoneSpawner
{
Translation "192:192=215:215", "198:198=216:216"
Speed 1
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("PowerStoneMan",46,0,0,0,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("PowerStoneMan",46,0,0,0,0,0,180,1)
stop
}
}

actor PowerStoneManSpawnerB : PowerStoneManSpawner{translation "192:192=205:205", "198:198=74:74"}
actor PowerStoneManSpawnerR : PowerStoneManSpawner{translation "192:192=171:171", "198:198=41:41"}
actor PowerStoneManSpawnerO : PowerStoneManSpawner{translation "192:192=104:104", "198:198=128:128"}
actor PowerStoneManSpawnerP : PowerStoneManSpawner{translation "192:192=229:229", "198:198=232:232"}

actor PowerStoneMan
{
PROJECTILE
Radius 38
Height 10
damage (25)
damagetype "PowerStone"
Obituary "$OB_POWERSTONE"
speed 0
//var int user_startwepangle;
var int user_speed;
var int user_num;
var int user_time;
var int user_time_add;
scale 2.5
States
{
Spawn:
POWB U 0
TNT1 A 0 A_SetUserVar("user_speed",30)
TNT1 A 0 A_SetUserVar("user_num",1500)
TNT1 A 0 A_SetUserVar("user_time",40)
TNT1 A 0 A_SetUserVar("user_time_add",14)
Spawn2:
TNT1 A 0 A_Setangle(angle-user_num/user_time)
POWB U 1 A_ChangeVelocity(user_speed,0,0,3)
TNT1 A 0 A_SetUserVar("user_time",user_time+user_time_add)
TNT1 A 0 A_Setangle(angle-user_num/user_time)
POWB U 1 A_ChangeVelocity(user_speed,0,0,3)
TNT1 A 0 A_SetUserVar("user_time",user_time+user_time_add)
TNT1 A 0 A_Setangle(angle-user_num/user_time)
POWB V 1 A_ChangeVelocity(user_speed,0,0,3)
TNT1 A 0 A_SetUserVar("user_time",user_time+user_time_add)
TNT1 A 0 A_Setangle(angle-user_num/user_time)
POWB V 1 A_ChangeVelocity(user_speed,0,0,3)
TNT1 A 0 A_SetUserVar("user_time",user_time+user_time_add)
TNT1 A 0 A_Setangle(angle-user_num/user_time)
POWB W 1 A_ChangeVelocity(user_speed,0,0,3)
TNT1 A 0 A_SetUserVar("user_time",user_time+user_time_add)
TNT1 A 0 A_Setangle(angle-user_num/user_time)
POWB W 1 A_ChangeVelocity(user_speed,0,0,3)
TNT1 A 0 A_SetUserVar("user_time",user_time+user_time_add)
Spawn3:
TNT1 A 0 A_Setangle(angle-user_num/user_time)
POWB X 1 A_ChangeVelocity(user_speed,0,0,3)
TNT1 A 0 A_SetUserVar("user_time",user_time+user_time_add)
loop
Death:
TNT1 A 0
stop
}
}

actor StoneCrush
{
PROJECTILE
+DONTBLAST
damage (5)
Radius 15
Height 2
Obituary "$OB_STONECRUSH"
Damagetype "ClassPainLess2"
renderstyle none
States
{
Spawn:
PLAY A 1
stop
}
}

actor StoneCrushHead : StoneCrush
{
damage (15)
Obituary "$OB_STONEHEAD"
States
{
Spawn:
PLAY A 0
PLAY A 1
stop
}
}

actor StoneQuakeDamage
{
+NOGRAVITY
+DONTBLAST
//+MISSILE
+SKYEXPLODE
+NOINTERACTION
+NOCLIP
+RIPPER
+THRUACTORS
+THRUGHOST
height 2
radius 200
damage (15)
Obituary "$OB_STONECRUSH"
damagetype "NeutralShock"
-SOLID
States
{
Spawn:
TNT1 A 0
TNT1 AAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("MMFX_XYZ",random(-200,200),random(-200,200),0,0,0,0,0,4)
TNT1 A 0
TNT1 A 0 A_ChangeFlag("NOCLIP",0)
TNT1 A 0 A_ChangeFlag("NOINTERACTION",0)
TNT1 A 0 A_ChangeFlag("THRUACTORS",0)
TNT1 A 0 A_ChangeFlag("MISSILE",1)
TNT1 A 1
stop
}
}

actor StoneHandBoss
{
Translation "192:192=215:215", "198:198=216:216"
PROJECTILE
+SEEKERMISSILE
+SCREENSEEKER
+FLOORHUGGER
+NOINTERACTION
height 32
radius 16
scale 2.5
damagetype "PowerStone"
Obituary "$OB_STONEHAND"
damage (10)
speed 15
ReactionTime 20
States
{
Spawn:
TNT1 A 2
TNT1 A 0 A_Stop
POWB TSRQPONK 2
POWB K 0 A_ChangeFlag("NOINTERACTION",0)
POWB K 0 A_ChangeVelocity(20,0,0,3)
Spawn2:
POWB LM 2 A_SeekerMissile(2,10,3,50,6)
POWB L 0 A_CountDown
loop
Death:
POWB K 0 A_Stop
POWB KNOPQRST 2 
stop
Crash:
XDeath:
TNT1 A 1
stop
}
}

actor StoneHandBossB : StoneHandBoss{translation "192:192=205:205", "198:198=74:74"}
actor StoneHandBossR : StoneHandBoss{translation "192:192=171:171", "198:198=41:41"}
actor StoneHandBossO : StoneHandBoss{translation "192:192=104:104", "198:198=128:128"}
actor StoneHandBossP : StoneHandBoss{translation "192:192=229:229", "198:198=232:232"}




actor StonemanMain1_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("PowerStoneManSpawner",0,0,0,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("PowerStoneManSpawnerB",0,0,0,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("PowerStoneManSpawnerR",0,0,0,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("PowerStoneManSpawnerO",0,0,0,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("PowerStoneManSpawnerP",0,0,0,0)
goto Done
}
}

actor StonemanMain2_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("PowerStoneManSpawner",0,0,0,-8)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("PowerStoneManSpawnerB",0,0,0,-8)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("PowerStoneManSpawnerR",0,0,0,-8)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("PowerStoneManSpawnerO",0,0,0,-8)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("PowerStoneManSpawnerP",0,0,0,-8)
goto Done
}
}

actor StonemanAlt_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("StoneHandBoss",0,0,0,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("StoneHandBossB",0,0,0,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("StoneHandBossR",0,0,0,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("StoneHandBossO",0,0,0,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("StoneHandBossP",0,0,0,0)
goto Done
}
}

