actor Ringman_W : BaseMM8BDMWep_CBM
{
tag "$TAGC_4E"
dropitem "RingBoomerangWep"
Weapon.AmmoUse 0
Weapon.AmmoGive 0
Weapon.AmmoUse2 0
Weapon.AmmoGive2 0
Obituary "$OB_RINGBOOMERANG"
Inventory.Pickupmessage "Power up! Ring Thing Cometh!"
weapon.ammotype "AntiMegaManAmmo"
weapon.ammotype2 "AntiMegaManAmmo"
//+WEAPON.NOAUTOFIRE
States
{
Spawn:
C_04 E 1
loop

Deselect:
RINA A 0
goto DeselectSwap
Select:
RINA A 0
goto SelectSwap

Ready:
RINA A 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_RINGMAN)
RINA A 0 A_JumpIfInventory("Once",1,"Ready1")
RINA A 0 A_GiveInventory("RingFlag",1)
RINA A 0 A_GiveInventory("RingFlag2",1)
RINA A 0 A_GiveInventory("HasRing",1)
RINA A 0 A_GiveInventory("HasRing2",1)
RINA A 0 A_GiveInventory("Once",1)
goto Ready1
Ready1:
RINA A 0 A_GunFlash("Flash",1)
goto Ready2

Ready2:
TNT1 A 0 A_JumpIfInventory("HasRing",1,"Ready3")
TNT1 A 0 A_JumpIfInventory("RingFlag",1,"Ready4")
TNT1 A 0 A_JumpIfInventory("RingCoolDown_A",1,"Ready2b")
TNT1 A 0 A_JumpIfInventory("HasRing2",1,"Ready2a")
TNT1 A 0 A_JumpIfInventory("RingFlag2",1,"Ready2b")
goto Ready2a
Ready2a:
TNT1 A 0 A_JumpIfInventory("MissingRing",40,"RingRefund")
TNT1 A 1 A_WeaponReady
TNT1 A 0 A_GiveInventory("MissingRing",1)
loop
Ready2b:
TNT1 A 0 A_JumpIfInventory("MissingRing",40,"RingRefund")
TNT1 A 1 A_WeaponReady(8)
TNT1 A 0 A_GiveInventory("MissingRing",1)
goto Ready2+2

Ready3:
RINA K 0 A_JumpIfInventory("RingCoolDown_A",1,"Ready3b")
RINA K 0 A_JumpIfInventory("HasRing2",1,"Ready3a")
RINA K 0 A_JumpIfInventory("RingFlag2",1,"Ready3b")
goto Ready3a
Ready3a:
RINA K 1 A_WeaponReady
wait
Ready3b:
RINA K 1 A_WeaponReady(8)
goto Ready3

Ready4:
RINA Q 0 A_JumpIfInventory("RingCoolDown_A",1,"Ready4b")
RINA Q 0 A_JumpIfInventory("HasRing2",1,"Ready4a")
RINA Q 0 A_JumpIfInventory("RingFlag2",1,"Ready4b")
goto Ready4a
Ready4a:
RINA Q 0 A_JumpIfInventory("MissingRing",40,"RingRefund")
RINA Q 1 A_WeaponReady(4)
RINA Q 0 A_GiveInventory("MissingRing",1)
Goto Ready2
Ready4b:
RINA Q 0 A_JumpIfInventory("MissingRing",40,"RingRefund")
RINA Q 1 A_WeaponReady(12)
RINA Q 0 A_GiveInventory("MissingRing",1)
goto Ready2

RingRefund:
RINA A 0 A_TakeInventory("MissingRing",999)
RINA A 0 A_GiveInventory("RingFlag",1)
RINA A 0 A_GiveInventory("HasRing",1)
Goto Ready2

Fire:
RINA K 0 A_JumpIfInventory("HasRing",1,"ThrowRing")
RINA K 0 A_GiveInventory("RingFlag",1)
Goto Ready2
ThrowRing:
RINA K 0 A_TakeInventory("RingFlag",1)
RINA K 0 A_TakeInventory("HasRing",1)
RINA K 0 A_PlaySoundEx("weapon/ringboomerang","Weapon")
RINA K 0 A_FireCustomMissile("RingM_RingToss1",0,1,-8,0)
goto ThrowRing2
ThrowRing2:
RINA L 0
RINA L 0 A_JumpIfInventory("RingCoolDown_A",1,"ThrowRingX")
RINA L 0 A_GiveInventory("RingMainFlag",1)
RINA L 1 A_WeaponReady(6)
RINA M 0 A_GiveInventory("RingMainFlag",1)
RINA M 1 A_WeaponReady(6)
RINA N 0 A_GiveInventory("RingMainFlag",1)
RINA N 1 A_WeaponReady(6)
RINA O 0 A_GiveInventory("RingMainFlag",1)
RINA O 1 A_WeaponReady(6)
RINA P 0 A_GiveInventory("RingMainFlag",1)
RINA P 1 A_WeaponReady(6)
TNT1 A 0 A_GiveInventory("RingMainFlag",1)
TNT1 A 1 A_WeaponReady(6)
TNT1 A 0 A_TakeInventory("RingMainFlag",99)
Goto Ready2
ThrowRingX:
RINA L 0 A_GiveInventory("RingMainFlag",1)
RINA L 1
RINA L 0 A_JumpIfInventory("RingCoolDown_A",1,1)
goto ThrowRing2+4
RINA M 0 A_GiveInventory("RingMainFlag",1)
RINA M 1
RINA M 0 A_JumpIfInventory("RingCoolDown_A",1,1)
goto ThrowRing2+6
RINA N 0 A_GiveInventory("RingMainFlag",1)
RINA N 1
RINA N 0 A_JumpIfInventory("RingCoolDown_A",1,1)
goto ThrowRing2+8
RINA O 0 A_GiveInventory("RingMainFlag",1)
RINA O 1
RINA O 0 A_JumpIfInventory("RingCoolDown_A",1,1)
goto ThrowRing2+10
RINA P 0 A_GiveInventory("RingMainFlag",1)
RINA P 1
RINA P 0 A_JumpIfInventory("RingCoolDown_A",1,1)
goto ThrowRing2+12
TNT1 A 1 A_TakeInventory("RingMainFlag",99)
Goto Ready2

Altfire:
RINA K 0 A_JumpIfInventory("HasRing2",1,"AltThrowRing")
RINA K 0 A_GiveInventory("RingFlag2",1)
RINA K 0 A_JumpIfInventory("RingMainFlag",1,"AltfireX2")
Goto Ready2
AltThrowRing:
RINA K 0 A_GunFlash("LeftThrow",1)
RINA K 0 A_JumpIfInventory("RingMainFlag",1,"AltfireX")
Goto Ready2

AltfireX:
RINA L 0 A_JumpIfInventory("RingMainFlag",6,10)
RINA L 0 A_JumpIfInventory("RingMainFlag",5,8)
RINA L 0 A_JumpIfInventory("RingMainFlag",4,6)
RINA L 0 A_JumpIfInventory("RingMainFlag",3,4)
RINA L 0 A_JumpIfInventory("RingMainFlag",2,2)
RINA LMNOP 1
TNT1 A 1
TNT1 A 0 A_TakeInventory("RingMainFlag",99)
goto Ready2

AltfireX2:
RINA L 0 A_JumpIfInventory("RingMainFlag",6,15)
RINA L 0 A_JumpIfInventory("RingMainFlag",5,12)
RINA L 0 A_JumpIfInventory("RingMainFlag",4,9)
RINA L 0 A_JumpIfInventory("RingMainFlag",3,6)
RINA L 0 A_JumpIfInventory("RingMainFlag",2,3)
RINA L 1 A_JumpIfInventory("HasRing2",1,"AltfireX3")
RINA M 0 A_GiveInventory("RingMainFlag",1)
RINA M 1 A_JumpIfInventory("HasRing2",1,"AltfireX3")
RINA N 0 A_GiveInventory("RingMainFlag",1)
RINA N 1 A_JumpIfInventory("HasRing2",1,"AltfireX3")
RINA O 0 A_GiveInventory("RingMainFlag",1)
RINA O 1 A_JumpIfInventory("HasRing2",1,"AltfireX3")
RINA P 0 A_GiveInventory("RingMainFlag",1)
RINA P 1 A_JumpIfInventory("HasRing2",1,"AltfireX3")
TNT1 A 0 A_GiveInventory("RingMainFlag",1)
TNT1 A 1 A_JumpIfInventory("HasRing2",1,"AltfireX3")
TNT1 A 0 A_TakeInventory("RingMainFlag",99)
Goto Ready2
AltfireX3:
RINA L 0 A_JumpIfInventory("RingMainFlag",6,15)
RINA L 0 A_JumpIfInventory("RingMainFlag",5,12)
RINA L 0 A_JumpIfInventory("RingMainFlag",4,9)
RINA L 0 A_JumpIfInventory("RingMainFlag",3,6)
RINA L 0 A_JumpIfInventory("RingMainFlag",2,3)
RINA L 1 A_WeaponReady(6)
RINA M 0 A_GiveInventory("RingMainFlag",1)
RINA M 1 A_WeaponReady(6)
RINA N 0 A_GiveInventory("RingMainFlag",1)
RINA N 1 A_WeaponReady(6)
RINA O 0 A_GiveInventory("RingMainFlag",1)
RINA O 1 A_WeaponReady(6)
RINA P 0 A_GiveInventory("RingMainFlag",1)
RINA P 1 A_WeaponReady(6)
TNT1 A 0 A_GiveInventory("RingMainFlag",1)
TNT1 A 1 A_WeaponReady(6)
TNT1 A 0 A_TakeInventory("RingMainFlag",99)
Goto Ready2

Flash:
TNT1 A 0 A_JumpIfInventory("HasRing2",1,"LeftHold")
TNT1 A 0 A_JumpIfInventory("RingFlag2",1,"LeftCall")
TNT1 A 0 A_JumpIfInventory("MissingRing2",40,"RingRefund2")
TNT1 A 1
TNT1 A 0 A_GiveInventory("MissingRing2",1)
loop
LeftHold:
RINA A 1 A_RailWait
loop
LeftCall:
RINA G 0 A_JumpIfInventory("MissingRing2",40,"RingRefund2")
RINA G 1
RINA G 0 A_GiveInventory("MissingRing2",1)
goto Flash
LeftThrow:
RINA A 0 A_TakeInventory("RingFlag2",1)
RINA A 0 A_TakeInventory("HasRing2",1)
RINA A 0 A_GiveInventory("RingCoolDown_A",1)
RINA A 0 A_PlaySoundEx("weapon/ringboomerang","Body")
RINA A 0 A_FireCustomMissile("RingM_RingToss2",0,1,8,0)
RINA ABCDEF 1
TNT1 A 1
goto Flash
RingRefund2:
RINA A 0 A_TakeInventory("MissingRing2",999)
RINA A 0 A_GiveInventory("RingFlag2",1)
RINA A 0 A_GiveInventory("HasRing2",1)
Goto Flash

}
}

actor AntiMegaManAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 2
+INVENTORY.IGNORESKILL
}

actor RingFlag : Inventory{}//Rings return
actor RingFlag2 : Inventory{}

actor HasRing : Inventory{}//Have rings
actor HasRing2 : Inventory{}

actor MissingRing : Inventory//Lost ring delay
{
inventory.amount 1
inventory.maxamount 100
}
actor MissingRing2 : MissingRing {}

actor RingReturnFlag : Inventory{}//Ring tells itself to return

actor RingLowFlag : Inventory{}//Ring is weaker

actor IsRing2Flag : Inventory{}//I am specifically Altfire Ring

actor RingCoolDown_A : Powerup//Delay for altfire to mainfire throwing/recalling
{
Powerup.duration 7
}

actor RingMainFlag : Inventory
{
inventory.amount 1
inventory.maxamount 10
}

actor RingM_Ring1Protect : PowerProtection
{
Powerup.Duration 12
DamageFactor "RingM_Ring1", 0.225
}
actor RingM_Ring2Protect : PowerProtection
{
Powerup.Duration 12
DamageFactor "RingM_Ring2", 0.225
}

actor RingM_ChimeSnd_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 ACS_NamedExecuteWithResult("cbm_LocalRingSnd")
//TNT1 A 0 A_PlaySound("weapon/RingChime",4,0.35)//Local doesn't exist
stop
}
}

actor RingM_RingToss1 : ProjSpawnFuncActor
{
var int user_POWER;
Translation "192:192=229:229"
PROJECTILE
damagetype "RingM_Ring1"
Obituary "$OB_RINGBOOMERANG"
+RIPPER
+SKYEXPLODE
+NOTARGETSWITCH
+BOUNCEONFLOORS
+BOUNCEONWALLS
+BOUNCEONCEILINGS
+ALLOWBOUNCEONACTORS
+CANBOUNCEWATER
+DONTREFLECT
ReactionTime 1
damage (80+user_POWER*100+CallACS("core_checkrune",RUNE_RAGE,2)*(40+user_POWER*50))
Radius 12
Height 12
speed 65
scale 2.5
states
{
Spawn:
RINA W 0
RINA W 1
RINA W 1 A_JumpIfInTargetInventory("PlayerPropertyRage",1,"Spawn_R")
RINA XXYYZZ 1
RINA W 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"SuperDeath")
goto Spawn2
Spawn_R:
RINA XYZ 1
RINA W 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"SuperDeath")
goto Spawn2+2
Spawn2:
RINA W 0 A_GiveInventory("RingM_RingFunc_P",1)
RINA W 1 A_JumpIfInventory("RingReturnFlag",1,"Return")
RINA W 0 A_GiveInventory("RingM_RingFunc_P",1)
RINA W 1 A_JumpIfInventory("RingReturnFlag",1,"Return")
RINA X 0 A_SpawnItemEx("RingmanRangeGleam",0,0,16)
RINA X 0 A_SetUserVar("user_POWER",1)
RINA X 0 A_GiveToTarget("RingM_ChimeSnd_P")
goto Spawn3
Spawn3:
RINA X 0 A_GiveInventory("RingM_RingFunc_P",1)
RINA X 1 A_JumpIfInventory("RingReturnFlag",1,"Return")
RINA X 0 A_GiveInventory("RingM_RingFunc_P",1)
RINA X 1 A_JumpIfInventory("RingReturnFlag",1,"Return")
RINA Y 0 A_GiveInventory("RingM_RingFunc_P",1)
RINA Y 1 A_JumpIfInventory("RingReturnFlag",1,"Return")
RINA Y 0 A_GiveInventory("RingM_RingFunc_P",1)
RINA Y 1 A_JumpIfInventory("RingReturnFlag",1,"Return")
RINA Z 0 A_GiveInventory("RingM_RingFunc_P",1)
RINA Z 1 A_JumpIfInventory("RingReturnFlag",1,"Return")
RINA Z 0 A_GiveInventory("RingM_RingFunc_P",1)
RINA Z 1 A_JumpIfInventory("RingReturnFlag",1,"Return")
RINA W 0 A_GiveInventory("RingM_RingFunc_P",1)
RINA W 1 A_JumpIfInventory("RingReturnFlag",1,"Return")
RINA W 0 A_GiveInventory("RingM_RingFunc_P",1)
RINA W 1 A_JumpIfInventory("RingReturnFlag",1,"Return")

RINA W 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"SuperDeath")
RINA W 0 A_SpawnItemEx("RingmanRangeGleam",0,0,16)
loop

Return:
RINA W 0 A_GiveInventory("ResyncPickup",1)
RINA W 0 A_Stop
RINA W 0 A_ChangeFlag("RIPPER",0)
RINA WWXXYYZZ 1 A_GiveInventory("ResyncPickup",1)
RINA W 1 A_CountDown
wait

Death:
RINA W 0 A_JumpIfInventory("IsRing2Flag",1,"Death3")
RINA W 0 A_JumpIf(user_POWER,"Death2")
RINA W 0 A_SpawnItemEx("RingM_RingReturnLow1")
stop
Death2:
RINA W 0 A_SpawnItemEx("RingM_RingReturn1")
stop
Death3:
RINA W 0 A_JumpIf(user_POWER,"Death4")
RINA W 0 A_SpawnItemEx("RingM_RingReturnLow2")
stop
Death4:
RINA W 0 A_SpawnItemEx("RingM_RingReturn2")
stop

SuperDeath:
TNT1 A 0
stop
}
}

actor RingM_RingReturn1 : RingM_RingToss1
{
+SEEKERMISSILE
+NOINTERACTION
damage (0)
ReactionTime 30
States
{
Spawn:
RINA W 0
RINA W 0 A_RearrangePointers(AAPTR_DEFAULT,AAPTR_DEFAULT,AAPTR_TARGET)//Target >> Tracer
goto Spawn2

Spawn2:
RINA W 0 A_JumpIfCloser(60,"Death")
RINA W 0 A_FaceTracer
RINA W 0 A_SeekerMissile(90,90,SMF_PRECISE)
RINA W 0 A_TakeFromTarget("MissingRing")
RINA W 1 A_SpawnItemEx("RingM_RingDamager1",0,0,0,momx,momy,momz,0,8+32)
RINA W 0 A_JumpIfCloser(60,"Death")
RINA W 1 A_SpawnItemEx("RingM_RingDamager1",0,0,0,momx,momy,momz,0,8+32)
RINA X 0 A_JumpIfCloser(60,"Death")
RINA X 1 A_SpawnItemEx("RingM_RingDamager1",0,0,0,momx,momy,momz,0,8+32)
RINA X 0 A_JumpIfCloser(60,"Death")
RINA X 1 A_SpawnItemEx("RingM_RingDamager1",0,0,0,momx,momy,momz,0,8+32)
RINA Y 0 A_JumpIfCloser(60,"Death")
TNT1 A 0 A_SpawnItemEx("RingmanRangeGleam",0,0,16)
RINA Y 1 A_SpawnItemEx("RingM_RingDamager1",0,0,0,momx,momy,momz,0,8+32)
RINA Y 0 A_JumpIfCloser(60,"Death")
RINA Y 1 A_SpawnItemEx("RingM_RingDamager1",0,0,0,momx,momy,momz,0,8+32)
RINA Z 0 A_JumpIfCloser(60,"Death")
RINA Z 1 A_SpawnItemEx("RingM_RingDamager1",0,0,0,momx,momy,momz,0,8+32)
RINA Z 0 A_JumpIfCloser(60,"Death")
RINA Z 1 A_SpawnItemEx("RingM_RingDamager1",0,0,0,momx,momy,momz,0,8+32)
RINA W 0 A_CountDown
RINA W 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")
loop

Spawn3:
RINA W 0 A_JumpIfCloser(60,"Death")
RINA W 0 A_FaceTracer
RINA W 0 A_SeekerMissile(90,90,SMF_PRECISE)
RINA W 0 A_TakeFromTarget("MissingRing")
RINA W 1 A_SpawnItemEx("RingM_RingDamagerLow1",0,0,0,momx,momy,momz,0,8+32)
RINA W 0 A_JumpIfCloser(60,"Death")
RINA W 1 A_SpawnItemEx("RingM_RingDamagerLow1",0,0,0,momx,momy,momz,0,8+32)
RINA X 0 A_JumpIfCloser(60,"Death")
RINA X 1 A_SpawnItemEx("RingM_RingDamagerLow1",0,0,0,momx,momy,momz,0,8+32)
RINA X 0 A_JumpIfCloser(60,"Death")
RINA X 1 A_SpawnItemEx("RingM_RingDamagerLow1",0,0,0,momx,momy,momz,0,8+32)
RINA Y 0 A_JumpIfCloser(60,"Death")
RINA Y 1 A_SpawnItemEx("RingM_RingDamagerLow1",0,0,0,momx,momy,momz,0,8+32)
RINA Y 0 A_JumpIfCloser(60,"Death")
RINA Y 1 A_SpawnItemEx("RingM_RingDamagerLow1",0,0,0,momx,momy,momz,0,8+32)
RINA Z 0 A_JumpIfCloser(60,"Death")
RINA Z 1 A_SpawnItemEx("RingM_RingDamagerLow1",0,0,0,momx,momy,momz,0,8+32)
RINA Z 0 A_JumpIfCloser(60,"Death")
RINA Z 1 A_SpawnItemEx("RingM_RingDamagerLow1",0,0,0,momx,momy,momz,0,8+32)
RINA W 0 A_CountDown
RINA W 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")
loop
Death:
TNT1 A 0 A_GiveToTarget("HasRing",1)
TNT1 A 1 A_PlaySoundEx("weapon/CutterCatch","Weapon")
stop
}
}

actor RingM_RingReturnLow1 : RingM_RingReturn1
{
states
{
Spawn:
RINA W 0
RINA W 0 A_GiveInventory("RingLowFlag",1)
RINA W 0 A_RearrangePointers(AAPTR_DEFAULT,AAPTR_DEFAULT,AAPTR_TARGET)
goto Spawn3
}
}



actor RingM_RingToss2 : RingM_RingToss1
{
damagetype "RingM_Ring2"
states
{
Spawn:
RINA W 0
RINA W 0 A_GiveInventory("IsRing2Flag",1)
goto RingM_RingToss1::Spawn
Death:
RINA W 0 A_JumpIf(user_POWER,"Death2")
RINA W 0 A_SpawnItemEx("RingM_RingReturnLow2")
stop
Death2:
RINA W 0 A_SpawnItemEx("RingM_RingReturn2")
stop
}
}

actor RingM_RingReturn2 : RingM_RingReturn1
{
damagetype "RingM_Ring2"
states
{
Spawn:
RINA W 0
RINA W 0 A_GiveInventory("IsRing2Flag",1)
RINA W 0 A_RearrangePointers(0,0,2)
goto Spawn2

Spawn2:
RINA W 0 A_JumpIfCloser(60,"Death")
RINA W 0 A_FaceTracer
RINA W 0 A_SeekerMissile(90,90,SMF_PRECISE)
RINA W 0 A_TakeFromTarget("MissingRing2")
RINA W 1 A_SpawnItemEx("RingM_RingDamager2",0,0,0,momx,momy,momz,0,8+32)
RINA W 0 A_JumpIfCloser(60,"Death")
RINA W 1 A_SpawnItemEx("RingM_RingDamager2",0,0,0,momx,momy,momz,0,8+32)
RINA X 0 A_JumpIfCloser(60,"Death")
RINA X 1 A_SpawnItemEx("RingM_RingDamager2",0,0,0,momx,momy,momz,0,8+32)
RINA X 0 A_JumpIfCloser(60,"Death")
RINA X 1 A_SpawnItemEx("RingM_RingDamager2",0,0,0,momx,momy,momz,0,8+32)
RINA Y 0 A_JumpIfCloser(60,"Death")
TNT1 A 0 A_SpawnItemEx("RingmanRangeGleam",0,0,16)
RINA Y 1 A_SpawnItemEx("RingM_RingDamager2",0,0,0,momx,momy,momz,0,8+32)
RINA Y 0 A_JumpIfCloser(60,"Death")
RINA Y 1 A_SpawnItemEx("RingM_RingDamager2",0,0,0,momx,momy,momz,0,8+32)
RINA Z 0 A_JumpIfCloser(60,"Death")
RINA Z 1 A_SpawnItemEx("RingM_RingDamager2",0,0,0,momx,momy,momz,0,8+32)
RINA Z 0 A_JumpIfCloser(60,"Death")
RINA Z 1 A_SpawnItemEx("RingM_RingDamager2",0,0,0,momx,momy,momz,0,8+32)
RINA W 0 A_CountDown
RINA W 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")
loop

Spawn3:
RINA W 0 A_JumpIfCloser(60,"Death")
RINA W 0 A_FaceTracer
RINA W 0 A_SeekerMissile(90,90,SMF_PRECISE)
RINA W 0 A_TakeFromTarget("MissingRing2")
RINA W 1 A_SpawnItemEx("RingM_RingDamagerLow2",0,0,0,momx,momy,momz,0,8+32)
RINA W 0 A_JumpIfCloser(60,"Death")
RINA W 1 A_SpawnItemEx("RingM_RingDamagerLow2",0,0,0,momx,momy,momz,0,8+32)
RINA X 0 A_JumpIfCloser(60,"Death")
RINA X 1 A_SpawnItemEx("RingM_RingDamagerLow2",0,0,0,momx,momy,momz,0,8+32)
RINA X 0 A_JumpIfCloser(60,"Death")
RINA X 1 A_SpawnItemEx("RingM_RingDamagerLow2",0,0,0,momx,momy,momz,0,8+32)
RINA Y 0 A_JumpIfCloser(60,"Death")
RINA Y 1 A_SpawnItemEx("RingM_RingDamagerLow2",0,0,0,momx,momy,momz,0,8+32)
RINA Y 0 A_JumpIfCloser(60,"Death")
RINA Y 1 A_SpawnItemEx("RingM_RingDamagerLow2",0,0,0,momx,momy,momz,0,8+32)
RINA Z 0 A_JumpIfCloser(60,"Death")
RINA Z 1 A_SpawnItemEx("RingM_RingDamagerLow2",0,0,0,momx,momy,momz,0,8+32)
RINA Z 0 A_JumpIfCloser(60,"Death")
RINA Z 1 A_SpawnItemEx("RingM_RingDamagerLow2",0,0,0,momx,momy,momz,0,8+32)
RINA W 0 A_CountDown
RINA W 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")
loop

Death:
TNT1 A 0 A_GiveToTarget("HasRing2",1)
TNT1 A 1 A_PlaySoundEx("weapon/CutterCatch","Weapon")
stop
}
}

actor RingM_RingReturnLow2 : RingM_RingReturn2
{
damagetype "RingM_Ring2"
states
{
Spawn:
RINA W 0
RINA W 0 A_GiveInventory("IsRing2Flag",1)
RINA W 0 A_GiveInventory("RingLowFlag",1)
RINA W 0 A_RearrangePointers(0,0,2)
goto Spawn3
}
}


actor RingM_RingFunc_P : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_JumpIfInventory("IsRing2Flag",1,"Pickup2")
TNT1 A 0 A_JumpIf(momx*momx+momy*momy+momz*momz<22,"ForceReturn")
TNT1 A 0 A_JumpIfInTargetInventory("RingFlag",1,"Return")
TNT1 A 0 A_TakeFromTarget("MissingRing")
stop
ForceReturn:
TNT1 A 0 A_GiveToTarget("RingFlag",1)
Return:
TNT1 A 0 A_GiveInventory("RingReturnFlag",1)
stop
Pickup2:
TNT1 A 0 A_JumpIf(momx*momx+momy*momy+momz*momz<22,"ForceReturn2")
TNT1 A 0 A_JumpIfInTargetInventory("RingFlag2",1,"Return")
TNT1 A 0 A_TakeFromTarget("MissingRing2")
stop
ForceReturn2:
TNT1 A 0 A_GiveToTarget("RingFlag2",1)
goto Return
}
}

actor RingM_RingDamager1
{
PROJECTILE
damagetype "RingM_Ring1"
Obituary "$OB_RINGBOOMERANG"
+DONTBLAST
+DONTSPLASH
damage (180+CallACS("core_checkrune",RUNE_RAGE,2)*90)
radius 12
height 12
States
{
Spawn:
TNT1 A 2
stop
}
}

actor RingM_RingDamagerLow1 : RingM_RingDamager1
{
damage (80+CallACS("core_checkrune",RUNE_RAGE,2)*40)
}


actor RingM_RingDamager2 : RingM_RingDamager1
{
damagetype "RingM_Ring2"
}
actor RingM_RingDamagerLow2 : RingM_RingDamagerLow1
{
damagetype "RingM_Ring2"
}

actor RingmanRangeGleam : BasicGraphicEffect
{
Renderstyle "Normal"
Alpha 1.0
States
{
SpawnFrame:
FLAS CBABC 2 bright
stop
}
}


//actor Ringman_W_NormalBar : NormalBar {Args 215,230}
actor Ringman_W_ScriptBar : ScriptBar {}