
//Core Pain as CustomInventory for CBM related changes
//Core Pain

actor CBM_GravityForce4 : PowerProtection
{
Powerup.Duration 6 //20
damagefactor "GravityHold", 5.0
}
actor CBM_GravityForce3 : CBM_GravityForce4{damagefactor "GravityHold", 4.0}
actor CBM_GravityForce2 : CBM_GravityForce4{damagefactor "GravityHold", 3.0}
actor CBM_GravityForce1 : CBM_GravityForce4{damagefactor "GravityHold", 2.0}


actor GravityForcePain_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_GiveInventory("GravityHoldPainPower",1)
TNT1 A 0 A_JumpIf(z-floorz>180,"GravityForce4")
TNT1 A 0 A_JumpIf(z-floorz>128,"GravityForce3")
TNT1 A 0 A_JumpIf(z-floorz>32,"GravityForce2")
TNT1 A 0 A_JumpIf(z-floorz>8,"GravityForce1")
stop
GravityForce4:
TNT1 A 0 A_GiveInventory("CBM_GravityForce4",1)
stop
GravityForce3:
TNT1 A 0 A_GiveInventory("CBM_GravityForce3",1)
stop
GravityForce2:
TNT1 A 0 A_GiveInventory("CBM_GravityForce2",1)
stop
GravityForce1:
TNT1 A 0 A_GiveInventory("CBM_GravityForce1",1)
stop
}
}


actor WindStorm_Pain_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_SpawnItemEx("WindStorm_Pain_H")
stop
}
}
actor WindStorm_Pain_H : BasicWatcher
{
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_JumpIfInventory("NoPushFlag",1,3,AAPTR_TARGET)
TNT1 A 0 A_JumpIfInventory("HalfPushFlag",1,3,AAPTR_TARGET)
TNT1 A 0 ACS_NamedExecuteWithResult("cbm_knockback", -10, 30, false, AAPTR_TARGET)
TNT1 A 0
stop
TNT1 A 0 ACS_NamedExecuteWithResult("cbm_knockback", -5, 15, false, AAPTR_TARGET)
stop
}
}

actor CBM_PainConcreteStart_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("ConcreteVision",1,"ConcreteReset")
TNT1 A 0 A_GiveInventory("ConcreteVision",1)
TNT1 A 0 A_GiveInventory("ConcreteTime",105)
TNT1 A 0 ACS_NamedExecuteWithResult("core_groundplayer",0,1)
TNT1 A 0 A_SpawnItemEx("CBM_ConcreteWatcher_H")
stop
ConcreteReset:
TNT1 A 0 A_GiveInventory("ConcreteTime",105)
stop
}
}

actor CBM_PainConcreteEnd_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 ACS_NamedExecuteWithResult("core_groundplayer",0,0)
TNT1 A 0 A_TakeInventory("ConcreteVision")
stop
}
}

actor CBM_ConcreteWatcher_H : BasicHelper
{
+SERVERSIDEONLY
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_GiveToTarget("CBM_PainConcreteThrust_P",1)
TNT1 A 0 A_TakeFromTarget("ConcreteTime",1)
TNT1 A 0 A_JumpIfInTargetInventory("ConcreteTime",1,"Spawn")
TNT1 A 0 A_GiveToTarget("CBM_PainConcreteEnd_P",1)
stop
}
}

actor CBM_PainConcreteThrust_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("CeilingFlag",1,"Gravityman")
TNT1 AAAAAA 0 A_SpawnItemEx("ConcreteFX",random(-20,20),random(-20,20),0)
TNT1 A 0 A_JumpIf(z-floorz<5,"End")
TNT1 A 0 ThrustThingZ(0,20,1,1)
stop
Gravityman:
TNT1 AAAAAA 0 A_SpawnItemEx("ConcreteFX",random(-20,20),random(-20,20),56)
TNT1 A 0 A_JumpIf(z-ceilingz+56>-5,"End")
TNT1 A 0 ThrustThingZ(0,20,0,1)
stop
End:
TNT1 A 0
stop
}
}


actor TornadoBlow_Pain_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("NoPushFlag",1,3)
TNT1 A 0 A_JumpIfInventory("HalfPushFlag",1,3)
TNT1 A 0 ThrustThingZ(0,60,0,0)
TNT1 A 0
stop
TNT1 A 0 ThrustThingZ(0,30,0,0)
stop
}
}

actor FlingDamage_Pain_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("NoPushFlag",1,4)
TNT1 A 0 A_JumpIfInventory("HalfPushFlag",1,4)
TNT1 A 0 ThrustThing(random(0,255),5,0,0)
TNT1 A 0 ThrustThingZ(0,30,0,0)
TNT1 A 0
stop
TNT1 A 0 ThrustThing(random(0,255),2.5,0,0)
TNT1 A 0 ThrustThingZ(0,15,0,0)
stop
}
}

