actor MagicCardBoss : BaseMM8BDMWep_CBM 
{
Tag "$TAGC_BF"
dropitem "MagicCardWepCDropped"
Weapon.AmmoUse 0
Weapon.AmmoGive 600
Obituary "$OB_MAGICCARD"
Inventory.Pickupmessage "Magic... away!"
weapon.ammotype "SnortSnortAmmo"
inventory.icon "MAGII"
States
{
Spawn:
C_0B F 1
loop

Ready:
MGCH A 0 ACS_ExecuteAlways(998,0,DYE_MAGICMAN)
MGCH A 0 //A_GunFlash
goto Ready1
Ready0:
MGCH A 1 A_WeaponReady
MGCH A 0 A_GiveInventory("SnortSnortAmmo",3)
Ready1:
MGCH A 0 A_JumpIfInventory("SnortSnortAmmo",100,"Ready2")
MGCH A 1 A_WeaponReady(WRF_NOPRIMARY|WRF_ALLOWRELOAD)
MGCH A 0 A_GiveInventory("SnortSnortAmmo",3)
loop
Ready2:
MGCH A 1 A_WeaponReady(WRF_ALLOWRELOAD)
MGCH A 0 A_GiveInventory("SnortSnortAmmo",3)
loop

Deselect:
MGCH AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
MGCH A 1 A_Lower
Loop
Select:
MGCH AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
MGCH A 1 A_Raise
Loop

Fire:
MGCH A 0 A_JumpIfInventory("IsBot",1,"BotFire")
MGCH A 1 A_GunFlash("Flash.Fire")
MGCH A 0 A_PlaySound("weapon/magiccard",1)
MGCH A 0 A_GiveInventory("MagicmanMain1_CI",1)
MGCH A 2 Offset(18,41)//A_GiveInventory("SnortSnortAmmo",4)
MGCH AAAAAAAA 2 Offset(36,52)//A_GiveInventory("SnortSnortAmmo",4)
MGCH A 2 Offset(23,43)//A_GiveInventory("SnortSnortAmmo",4)
MGCH A 2 Offset(13,37)//A_GiveInventory("SnortSnortAmmo",4)
MGCH A 2 Offset(7,35)//A_GiveInventory("SnortSnortAmmo",4)
Goto Ready1//24

AltFire:
MGCH A 1 Offset(-20,29)A_GiveInventory("SnortSnortAmmo",2)
MGCH A 0 A_PlaySound("weapon/MagicM_Orb",6,0.70)
MGCH A 0 A_GiveInventory("MagicmanMainCBM_CI",1)
MGCH BCBA 2 Offset(-40,13)A_GiveInventory("SnortSnortAmmo",6)
MGCH A 2 Offset(-28,15)A_GiveInventory("SnortSnortAmmo",6)
MGCH A 2 Offset(-16,18)A_GiveInventory("SnortSnortAmmo",6)
MGCH A 2 Offset(-9,22)A_GiveInventory("SnortSnortAmmo",6)
MGCH A 2 Offset(-3,27)A_GiveInventory("SnortSnortAmmo",6)
Goto Ready1//17

Reload:
MGCH A 0 A_JumpIfInventory("KingDumbsPreciousLittleBabyBoy",1,"SwapCams")
MGCH A 0 A_JumpIfInventory("BabyBoyOut",1,"Ready1")
MGCH A 1 A_GunFlash("Flash.Reload")
MGCH A 0 ACS_NamedExecuteWithResult("BULL_SetState",1)
MGCH A 0 A_PlaySound("weapon/BombThrow",1)
MGCH A 0 A_GiveInventory("MagicmanReload_CI",1)
MGCH A 2 Offset(18,41)A_GiveInventory("SnortSnortAmmo",6)
MGCH AAAAAAAA 2 Offset(36,52)A_GiveInventory("SnortSnortAmmo",6)
MGCH A 2 Offset(23,43)A_GiveInventory("SnortSnortAmmo",6)
MGCH A 2 Offset(13,37)A_GiveInventory("SnortSnortAmmo",6)
MGCH A 2 Offset(7,35)A_GiveInventory("SnortSnortAmmo",6)
Goto Ready1//24

SwapCams:
MGCH A 0 A_JumpIfInventory("OnceC",1,"UnSwapCams")
TNT1 A 0 ChangeCamera(400+TID,0,0)
TNT1 A 0 A_GiveInventory("OnceC")
SwapBuffer:
MGCH A 1
MGCH A 0 A_JumpIf(ACS_NamedExecuteWithResult("Get_Button_R"),"SwapBuffer")
Goto Ready1
UnSwapCams:
MGCH A 0
TNT1 A 0 ChangeCamera(0,0,0)
TNT1 A 0 A_TakeInventory("OnceC")
UnSwapBuffer:
MGCH A 1
MGCH A 0 A_JumpIf(ACS_NamedExecuteWithResult("Get_Button_R"),"UnSwapBuffer")
Goto Ready1

Flash.Fire:
TNT1 A 0 A_GiveInventory("MagicCardCooldown_RC",1)
MGCH A 0 A_JumpIfInventory("PowerRage_ST",1,"Flash_Mainfire_R")
MGCH DEFGHIJK 1
TNT1 A 5
stop
Flash.Reload:
MGCH TSHIJK 1
TNT1 A 7
stop
Flash_Mainfire_R:
MGCH DFHK 1
TNT1 A 3
stop

BotFire:
MGCH A 0 A_Jump(128,"Altfire")
MGCH A 0 A_GiveInventory("SnortSnortAmmo",100)
goto Fire+1
}
}

actor MagicCardBosB : BaseMM8BDMWep_CBM//MagicCardBoss
{
tag "$TAGC_BF2"
dropitem "MagicCardWepCDropped"
inventory.icon "MAGII2"
Weapon.AmmoUse 0
Weapon.AmmoGive 600
Obituary "$OB_MAGICCARD"
Inventory.Pickupmessage "Magic... away!"
weapon.ammotype "SnortSnortAmmo"
States
{
Spawn:
C_0B F 1
loop//MGB8 X 1
Ready:
MGKH A 0 ACS_ExecuteAlways(998,0,DYE_MAGICMAN)
MGKH A 0 //A_GunFlash
goto Ready1
Ready0:
MGKH A 1 A_WeaponReady(WRF_ALLOWRELOAD)
MGKH A 0 A_GiveInventory("SnortSnortAmmo",3)
Ready1:
MGKH A 0 A_JumpIfInventory("SnortSnortAmmo",300,"Ready2")
MGKH A 1 A_WeaponReady(WRF_NOFIRE|WRF_ALLOWRELOAD)
MGKH A 0 A_GiveInventory("SnortSnortAmmo",3)
loop
Ready2:
MGKH A 1 A_WeaponReady(WRF_ALLOWRELOAD)
MGKH A 0 A_GiveInventory("SnortSnortAmmo",3)
loop

Deselect:
MGKH AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
MGKH A 1 A_Lower
Loop
Select:
MGKH AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
MGKH A 1 A_Raise
Loop

Fire:
MGKH B 0 A_JumpIfInventory("IsBot",1,"BotFire")
MGKH B 0 A_GunFlash("Flash.Fire")
MGKH B 1 A_JumpIfInventory("PowerRage_ST",1,1)
MGKH B 1 A_TakeInventory("FakeMagicFlag",99)
goto BallThrow

Altfire:
MGKH B 1 A_JumpIfInventory("PowerRage_ST",1,1)
MGKH B 1 A_GiveInventory("FakeMagicFlag",1)
goto BallThrow

BallThrow:
MGKH C 1 A_GiveInventory("MagicBallThrow_P",1)
MGKH BC 1 
MGKH B 0 A_PlaySound("weapon/MagicShot",1,1.0)
MGKH B 0 A_SpawnItemEx("MagicBallEmergency",0,0,28)
MGKH B 0 A_SpawnItemEx("MagicHologram",0,0,0,0,0,0,0,1,0)
MGKH B 0 A_SpawnItemEx("MagicBall",cos(-pitch)*0,0,28+sin(-pitch),cos(-pitch)*32,0,sin(-pitch)*32,0,33)
MGKH B 0 A_Stop
MGKH B 0 A_ChangeFlag("NONSHOOTABLE",1)
MGKH B 0 A_GiveInventory("InvulnerableOn_Pickup",1)
MGKH B 0 A_ChangeFlag("NOTELEPORT",1)
MGKH B 0 A_ChangeFlag("SOLID",0)
MGKH B 0 A_TakeInventory("UnSolid",1)
MGKH B 1 A_ChangeFlag("PICKUP",0)
goto InvisibleLoop

InvisibleLoop:
MGKH B 1
MGKH B 0 A_JumpIfInventory("MagicBallEnd",1,"InvisibleEnd")
MGKH C 1
MGKH B 0 A_JumpIfInventory("MagicBallEnd",1,"InvisibleEnd")
loop

InvisibleEnd:
MGKH C 1 A_JumpIf(256,1)
wait
InvisibleEnd2:
MGKH C 1 A_GiveInventory("MagicBallEnd",1)
MGKH C 0 A_ChangeFlag("NONSHOOTABLE",0)
MGKH C 0 A_GiveInventory("InvulnerableOff_Pickup",1)
MGKH C 0 A_ChangeFlag("PICKUP",1)
MGKH C 0 A_ChangeFlag("NOTELEPORT",0)
MGKH C 0 A_SpawnItemEx("ResolidifyPlayer_H")
MGKH C 0 A_JumpIfInventory("IsBot",1,"BotFire2")
goto BallEnd2
BallEnd2:
MGB8 C 0 ThrustThingZ(0,1,0,1)
MGKH CBC 2
MGKH BA 2 A_GiveInventory("SnortSnortAmmoResync_P",1)
MGKH A 12 A_TakeInventory("ProjectilePortDead",99)
Goto Ready1//Ready+2

Reload:
MGKH A 0 A_JumpIfInventory("KingDumbsPreciousLittleBabyBoy",1,"SwapCams")
MGKH A 0 A_JumpIfInventory("BabyBoyOut",1,"Ready0")
MGKH A 1 A_GunFlash("Flash.Reload")
MGKH A 0 ACS_NamedExecuteWithResult("BULL_SetState",1)
MGKH A 0 A_PlaySound("weapon/BombThrow",1)
MGKH A 0 A_GiveInventory("MagicmanReload_CI",1)
MGKH A 2 Offset(18,41)A_GiveInventory("SnortSnortAmmo",4)
MGKH AAAAAAAA 2 Offset(36,52)A_GiveInventory("SnortSnortAmmo",4)
MGKH A 2 Offset(23,43)A_GiveInventory("SnortSnortAmmo",4)
MGKH A 2 Offset(13,37)A_GiveInventory("SnortSnortAmmo",4)
MGKH A 2 Offset(7,35)A_GiveInventory("SnortSnortAmmo",4)
Goto Ready1//24

SwapCams:
MGKH A 0 A_JumpIfInventory("OnceC",1,"UnSwapCams")
TNT1 A 0 ChangeCamera(400+TID,0,0)
TNT1 A 0 A_GiveInventory("OnceC")
SwapBuffer:
MGKH A 1
MGKH A 0 A_JumpIf(ACS_NamedExecuteWithResult("Get_Button_R"),"SwapBuffer")
Goto Ready1
UnSwapCams:
MGKH A 0
TNT1 A 0 ChangeCamera(0,0,0)
TNT1 A 0 A_TakeInventory("OnceC")
UnSwapBuffer:
MGKH A 1
MGKH A 0 A_JumpIf(ACS_NamedExecuteWithResult("Get_Button_R"),"UnSwapBuffer")
Goto Ready1

Flash.Fire:
MGCH S 0
MGCH RST 2
stop
Flash.Reload:
MGCH TSHIJK 1
TNT1 A 7
stop
BotFire:
MGKH A 0 A_Jump(128,"Altfire")
goto Fire+1
BotFire2:
MGKH A 0 A_SelectWeapon("MagicCardBoss")
goto Ready+2

}
}

actor SnortSnortAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 600
+INVENTORY.IGNORESKILL
}

actor MagicCardCooldown : Powerup
{
+INVENTORY.ADDITIVETIME
Powerup.Duration 11
}

actor MagicBallEnd : OnceC{}
actor MagicBallEndFix : OnceC{}
actor MerryChristmasFlag : OnceC{}
actor MagicBallCooldown : Powerup
{
Powerup.Duration 35
}
actor FakeMagicFlag : OnceC{}

actor BabyBoyOut : Powerup
{
Powerup.Duration 6
}
actor KingDumbsPreciousLittleBabyBoy : OnceC{}//merry christmas kd!
actor InfanticideFlag : Powerup
{
Powerup.Duration 5
}
actor RomperLockFlag : OnceC{}

actor RomperSNDDelay : OnceC{}

actor RomperKillItem : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
inventory.icon "RompIcon"
scale 2.0
inventory.pickupmessage "King Dumb's Christmas Gift. Handle with care."
Tag "$TAGC_BF3"
+INVBAR
states
{
Spawn:
RSRM Q 1
loop
Use:
TNT1 A 0 A_JumpIfInventory("OnceC",1,"PickupL")
TNT1 A 0 A_PlaySoundEx("item/ItemUseMM9","SoundSlot6")
TNT1 A 0 A_GiveInventory("InfanticideFlag",1)
fail
PickupL:
TNT1 A 0 A_PlaySoundEx("item/ItemUseMM9","SoundSlot6")
TNT1 A 0 A_GiveInventory("RomperLockFlag_P",1)
fail
}
}

actor MagicCardCooldown_RC : CustomInventory
{
States
{
Pickup:
TNT1 A 0
TNT1 A 0 A_JumpIfInventory("PowerRage_ST",1,"PickupR")
TNT1 A 0 A_GiveInventory("MagicCardCooldown",1)
goto PickupR
PickupR:
TNT1 A 0 A_GiveInventory("MagicCardCooldown",1)
TNT1 A 0 A_TakeInventory("SnortSnortAmmo",100)
stop
}
}

actor RomperLockFlag_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0
TNT1 A 0 A_JumpIfInventory("RomperLockFlag",1,"PickupN")
TNT1 A 0 A_GiveInventory("RomperLockFlag",1)
stop
PickupN:
TNT1 A 0 A_TakeInventory("RomperLockFlag",1)
stop
}
}


actor MagicBallThrow_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_TakeInventory("MagicBallEndFix",99)
TNT1 A 0 A_TakeInventory("MagicBallEnd",99)
TNT1 A 0 A_TakeInventory("SnortSnortAmmo",300)
stop
}
}

actor SnortSnortAmmoResync_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_GiveInventory("SnortSnortAmmo",1)
TNT1 A 0 A_TakeInventory("SnortSnortAmmo",1)
stop
}
}

actor MagicCardB
{
translation "192:192=216:216","198:198=3:3"
PROJECTILE
Damagetype "MagicM_Card" 
Obituary "$OB_MAGICCARD"
+NOCLIP
+NOINTERACTION
+THRUGHOST
+NOTARGETSWITCH
+DONTREFLECT
+SEEKERMISSILE
ReactionTime 70
damage (0)
Radius 5
Height 5
speed 60
scale 2.5
States
{
Spawn:
X_BH A 0
TNT1 A 0
TNT1 A 0 ACS_NamedExecuteAlways("BULL_Tidifier", 0)
X_BH A 0 A_RearrangePointers(0,0,2)
X_BH AA 1 A_SpawnItemEx("MagicCardDamagerB",0,0,0,momx,momy,momz,0,8+32)
X_BH BBCCCCCC 1 A_SpawnItemEx("MagicCardDamagerB",0,0,0,momx,momy,momz,0,8+32)
X_BH D 0 A_ScaleVelocity(0.5)
X_BH DD 1 A_SpawnItemEx("MagicCardDamagerB",0,0,0,momx,momy,momz,0,8+32)
X_BH D 0 A_ScaleVelocity(0.5)
X_BH EE 1 A_SpawnItemEx("MagicCardDamagerB",0,0,0,momx,momy,momz,0,8+32)
X_BH E 0 A_ScaleVelocity(-2.0)
X_BH FF 1 A_SpawnItemEx("MagicCardDamagerB",0,0,0,momx,momy,momz,0,8+32)
//X_BH R 0 A_SpawnItemEx("ReturningMagicCardB",0,0,0,0,0,0,0,1)
goto Spawn2
Spawn2:
X_BH B 0
X_BH B 0 A_FaceTarget
goto Spawn3
Spawn3:
X_BH B 0
X_BH B 0 A_JumpIfCloser(64,"Death")
X_BH BB 0 A_SeekerMissile(90,90,2)
X_BH BB 1 A_SpawnItemEx("MagicCardDamagerB",0,0,0,momx,momy,momz,0,8+32)
X_BH B 0 A_JumpIfCloser(64,"Death")
X_BH BB 0 A_SeekerMissile(90,90,2)
X_BH CC 1 A_SpawnItemEx("MagicCardDamagerB",0,0,0,momx,momy,momz,0,8+32)
X_BH C 0 A_JumpIfCloser(64,"Death")
X_BH BB 0 A_SeekerMissile(90,90,2)
X_BH DD 1 A_SpawnItemEx("MagicCardDamagerB",0,0,0,momx,momy,momz,0,8+32)
X_BH D 0 A_JumpIfCloser(64,"Death")
X_BH BB 0 A_SeekerMissile(90,90,2)
X_BH EE 1 A_SpawnItemEx("MagicCardDamagerB",0,0,0,momx,momy,momz,0,8+32)
X_BH E 0 A_JumpIfCloser(64,"Death")
X_BH BB 0 A_SeekerMissile(90,90,2)
X_BH FF 1 A_SpawnItemEx("MagicCardDamagerB",0,0,0,momx,momy,momz,0,8+32)
X_BH F 0 A_JumpIfCloser(64,"Death")
X_BH BB 0 A_SeekerMissile(90,90,2)

X_BH B 0 A_CountDown
X_BH B 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"Death")
loop
Death:
X_BH A 0
Stop
}
}

actor MagicCardBB : MagicCardB{translation "192:192=205:205","198:198=74:74"}
actor MagicCardBR : MagicCardB{translation "192:192=171:171","198:198=41:41"}
actor MagicCardBO : MagicCardB{translation "192:192=104:104","198:198=128:128"}
actor MagicCardBP : MagicCardB{translation "192:192=229:229","198:198=232:232"}

actor MagicCardBF : MagicCardB
{
translation "192:192=216:216","198:198=3:3"
States
{
Spawn:
X_BH M 0
X_BH M 0 A_RearrangePointers(0,0,2)
X_BH MM 1 A_SpawnItemEx("MagicCardDamagerBF",0,0,0,momx,momy,momz,0,8)
X_BH NNOOOOOO 1 A_SpawnItemEx("MagicCardDamagerBF",0,0,0,momx,momy,momz,0,8)
X_BH P 0 A_ScaleVelocity(0.5)
X_BH PP 1 A_SpawnItemEx("MagicCardDamagerBF",0,0,0,momx,momy,momz,0,8)
X_BH P 0 A_ScaleVelocity(0.5)
X_BH QQ 1 A_SpawnItemEx("MagicCardDamagerBF",0,0,0,momx,momy,momz,0,8)
X_BH Q 0 A_ScaleVelocity(-2.0)
X_BH RR 1 A_SpawnItemEx("MagicCardDamagerBF",0,0,0,momx,momy,momz,0,8)
goto Spawn2
Spawn2:
X_BH N 0 A_FaceTarget
goto Spawn3
Spawn3:
X_BH N 0
X_BH N 0 A_JumpIfCloser(64,"Death")
X_BH NN 0 A_SeekerMissile(90,90,2)
X_BH NN 1 A_SpawnItemEx("MagicCardDamagerBF",0,0,0,momx,momy,momz,0,8)
X_BH N 0 A_JumpIfCloser(64,"Death")
X_BH OO 1 A_SpawnItemEx("MagicCardDamagerBF",0,0,0,momx,momy,momz,0,8)
X_BH O 0 A_JumpIfCloser(64,"Death")
X_BH PP 1 A_SpawnItemEx("MagicCardDamagerBF",0,0,0,momx,momy,momz,0,8)
X_BH P 0 A_JumpIfCloser(64,"Death")
X_BH QQ 1 A_SpawnItemEx("MagicCardDamagerBF",0,0,0,momx,momy,momz,0,8)
X_BH Q 0 A_JumpIfCloser(64,"Death")
X_BH RR 1 A_SpawnItemEx("MagicCardDamagerBF",0,0,0,momx,momy,momz,0,8)
X_BH R 0 A_JumpIfCloser(64,"Death")

X_BH N 0 A_CountDown
X_BH N 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"Death")
loop
Death:
X_BH M 0
Stop
}
}


actor MagicCardBFB : MagicCardBF{translation "192:192=205:205","198:198=74:74"}
actor MagicCardBFR : MagicCardBF{translation "192:192=171:171","198:198=41:41"}
actor MagicCardBFO : MagicCardBF{translation "192:192=104:104","198:198=128:128"}
actor MagicCardBFP : MagicCardBF{translation "192:192=229:229","198:198=232:232"}

actor MagicCardDamagerB
{
PROJECTILE
+DONTSPLASH
+DONTBLAST
+THRUGHOST
+PICKUP
Damagetype "MagicM_Card" 
Obituary "$OB_MAGICCARD"
Damage (12)
+PIERCEARMOR
radius 16
height 8
States
{
Spawn:
TNT1 A 1
stop
}
}

actor MagicM_CardProtect : PowerProtection
{
Powerup.Duration 5
DamageFactor "MagicM_Card", 0.0
}

actor MagicM_Card2Protect : PowerProtection
{
Powerup.Duration 5
DamageFactor "MagicM_Card2", 0.0
}

actor MagicCardDamagerBF : MagicCardDamagerB
{
Damagetype "MagicCardBF"
Obituary "$OB_FAKEMAGICCARD"
Damage (1)
+PIERCEARMOR
}

actor MagicM_OrbShot
{
Translation "204:204=197:197", "195:195=241:241", "250:250=229:229", "249:249=109:109"
PROJECTILE
+HEXENBOUNCE
Damagetype "MagicM_Orb"
Obituary "$OB_MAGICBALL"
ReactionTime 7
Damage (9)
Radius 14
Height 20
Speed 40
scale 2.5
states
{
Spawn:
MGB9 Q 0
TNT1 A 0 ACS_NamedExecuteAlways("BULL_Tidifier", 0)
SpawnLOOP:
MGB9 Q 0
MGB9 QR 2 A_SpawnItemEx("MagicM_OrbShotFX1",random(-8,2),random(-18,18),random(-18,18),momx*0.25,momy*0.25,momz*0.25,0,9)
MGB9 Q 0 A_CountDown
loop
Death:
MGB9 SSTT 2 A_SpawnItemEx("MagicM_OrbShotFX2",random(-6,4),random(-20,20),random(-20,20),0,0,0,0,1)
stop
}
}
actor MagicM_OrbShotB : MagicM_OrbShot{Translation "204:204=205:205","195:195=74:74","250:250=196:196","249:249=199:199"}
actor MagicM_OrbShotR : MagicM_OrbShot{Translation "204:204=171:171","195:195=41:41","250:250=170:170","249:249=43:43"}
actor MagicM_OrbShotO : MagicM_OrbShot{Translation "204:204=104:104","195:195=128:128","250:250=138:138","249:249=131:131"}
actor MagicM_OrbShotP : MagicM_OrbShot{Translation "204:204=229:229","195:195=232:232","250:250=214:214","249:249=223:223"}

actor MagicM_OrbShotFX1 : BasicClientSide
{
Renderstyle "None"
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SetArg(3,random(0,15))
TNT1 AA 1 A_SpawnItemEx("MagicM_OrbShotFX2",random(-8,8),random(-24,24),random(-24,24),momx*(-1+0.05*Args[3]),momy*(-1+0.05*Args[3]),momz*(-1+0.05*Args[3]),0,9,32)
stop
}
}
actor MagicM_OrbShotFX2 : BasicClientSide
{
Scale 2.0
States
{
Spawn:
TNT1 A 0
TNT1 A random(0,1)A_SetScale(ScaleX+random(-5,5)*0.1)
MGB9 U random(1,2)A_Jump(128,1)
MGB9 V random(1,2)A_Jump(64,1)
MGB9 W random(1,2)A_Jump(16,1)
MGB9 X random(1,2)
stop
}
}

actor MagicBall
{
translation "199:199=176:176","202:202=218:218"
PROJECTILE
Damagetype "MagicCard"
Obituary "$OB_MAGICBALL"
+DONTBLAST
+DONTREFLECT
+THRUGHOST
+SKYEXPLODE
-NOGRAVITY
ReactionTime 60
gravity 0.9
Damage (0)
Radius 16
Height 56
Speed 20
scale 2.5
states
{
Spawn:
MGB8 M 0
MGB8 M 0 ACS_ExecuteAlways(815,0,200)//200
MGB8 M 0 ThrustThingZ(0,20,0,1)
MGB8 M 0 A_GiveToTarget("MagicBallPickupSync",1)
MGB8 M 1 A_JumpIfInTargetInventory("MagicBallEnd",1,"Death")
MGB8 M 0 A_GiveToTarget("MagicBallPickupSync",1)
MGB8 M 1 A_JumpIfInTargetInventory("MagicBallEnd",1,"Death")
goto Spawn2+2
Spawn2:
MGB8 M 0 A_GiveToTarget("MagicBallCooldown",1)
MGIC G 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"Death")
MGB8 MMNNOOPP 1 A_JumpIfInTargetInventory("MagicBallEnd",1,"Death")
MGB8 M 0 A_CountDown
loop
Death:
TNT1 A 0 A_GiveInventory("ProjectilePortDead",1)
TNT1 A 0 A_ChangeFlag("NOINTERACTION",1)
TNT1 A 0 A_Stop
TNT1 A 0 A_ChangeFlag("NOGRAVITY",1)
TNT1 A 0 A_GiveToTarget("MagicBallEnd",1)
TNT1 A 0 //A_GiveToTarget("MagicBallPickupSync2",1)
TNT1 A 0 //A_PlaySound("weapon/napalm",1,1.0)
TNT1 A 0 A_SpawnItemEx("MagicFirework",0,0,9,0,0,12)
TNT1 A 0 A_SpawnItemEx("MagicBallFX",0,0,0,0,0,0,0,1)
TNT1 A 0 A_JumpIfInTargetInventory("FakeMagicFlag",1,"Death2")
TNT1 A 0 A_SpawnItemEx("MagicBallExplosion",0,0,16)
TNT1 AA 1 A_GiveToTarget("MagicBallPickupSync2",1)
stop
Death2:
TNT1 A 2 A_SpawnItemEx("MagicBallExplosion2",0,0,16)
TNT1 AA 1 A_GiveToTarget("MagicBallPickupSync2",1)
stop
}
}

actor MagicBallEmergency : MagicBall
{
+NOINTERACTION
+NOGRAVITY
ReactionTime 240
Radius 2
Height 2
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_GiveToTarget("MagicBallPickupSync",1)
Spawn2:
TNT1 AA 1 A_JumpIfInTargetInventory("MagicBallEnd",1,"Death3")
MGIC G 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"Death")
TNT1 A 0 A_CountDown
TNT1 A 0 A_JumpIfInTargetInventory("MagicBallCooldown",1,"Spawn2")
goto Death3
Death:
TNT1 A 0 A_GiveToTarget("MagicBallEndFix",1)
goto Death3
Death3:
TNT1 A 0 A_GiveToTarget("MagicBallEnd",1)
TNT1 AA 1 A_GiveToTarget("MagicBallPickupSync2",1)
stop
}
}

actor MagicBallExplosion : BasicExplosion
{
Damagetype "DMGNoHitstun"//ClassPain
Obituary "$OB_MAGICBALL"
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_JumpIfInTargetInventory("PowerSpread_ST",1,"Spawn_S")
TNT1 A 2 A_Explode(18,64,0,0,18)
stop
Spawn_S:
TNT1 AAA 0 A_Explode(18,64,0,0,18)
TNT1 A 2
stop
}
}

actor MagicBallExplosion2 : MagicBallExplosion
{
Obituary "$OB_FAKEMAGICBALL"
}

actor MagicBallPickupSync : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_GiveInventory("MagicBallCooldown",1)
TNT1 A 0 A_SetTranslucent(0.0,0)
stop
}
}

actor MagicBallPickupSync2 : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_SetTranslucent(1.0,0)
stop
}
}

actor MagicBallB : MagicBall{translation "199:199=74:74","202:202=205:205"}
actor MagicBallR : MagicBall{translation "199:199=41:41","202:202=171:171"}
actor MagicBallO : MagicBall{translation "199:199=128:128", "202:202=104:104"}
actor MagicBallP : MagicBall{translation "199:199=232:232", "202:202=229:229"}

actor MagicFirework
{
-SOLID
+NOGRAVITY
+NOINTERACTION
scale 2.5
States
{
Spawn:
DOMP G 2
DOMP G 0 A_Stop
DOMP H 4 A_SpawnItemEx("MagicFireworkExp",random(-15,15),random(-15,15),10)
DOMP H 4 A_SpawnItemEx("MagicFireworkExp",random(-15,15),random(-15,15),0)
DOMP H 4 A_SpawnItemEx("MagicFireworkExp",random(-15,15),random(-15,15),-10)
stop
}
}

actor MagicFireworkExp
{
-SOLID
scale 2.0
+NOGRAVITY
+NOINTERACTION
States
{
Spawn:
DOMP IJKLMN 4
stop
}
}

actor MagicBallFX
{
-SOLID
+NOGRAVITY
+NOINTERACTION
Scale 2.5
radius 0
height 0
States
{
Spawn:
MGB8 Q 2
TNT1 A 2
MGB8 R 2
TNT1 A 2
MGB8 S 2
TNT1 A 2
MGB8 T 2
stop
}
}

actor MagicBirdsSound : BasicHelper
{
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_PlaySound("weapon/MagicBirds",1,1.0)
stop
}
}

actor MagicHomingBirds
{
PROJECTILE
damagetype "MagicM_Bird"
Obituary "$OB_MAGICBIRD"
+DONTSEEKINVISIBLE//
+SEEKERMISSILE
+NOEXPLODEFLOOR
reactiontime 10
damage (3)
Radius 6
Height 5
speed 19
scale 2.0
States
{
Spawn:
TNT1 AA 0
TNT1 A 0 ACS_NamedExecuteAlways("BULL_Tidifier", 0)
TNT1 A 1
TNT1 A 0 A_ChangeFlag(NOEXPLODEFLOOR,FALSE)
TNT1 A 0 A_Jump(256,1,2,3,4,5,6,7,8,9,10,11,12)
Spawn2:
MGB8 AAABBBCCCDDD 1 A_SeekerMissile(1,4,3,64,3)
MGB8 A 0 A_CountDown
loop
Death:
UMFX IJK 2
XMFX D 2
stop
}
}

actor ConfettiMagic : Confetti
{
+THRUGHOST
}

actor ConfettiMagicSpawner : ConfettiSpawner
{
ReactionTime 10//10
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_PlaySoundEx("misc/partyball", 1)
goto Spawn2
Spawn2:
TNT1 AAA 0 A_SpawnItemEx("ConfettiMagic",random(-16, 16),random(-16, 16),Random(8, 16),random(-3,3), random(-3,3), random(1,-1),0)
TNT1 A 1 A_CountDown
Loop
}
}

actor ConfettiPickup : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_SpawnItemEx("ConfettiMagicSpawner",0,0,28)
stop
}
}

actor MagicHologram
{
var int user_TID;
-SOLID
+NOGRAVITY
+DONTBLAST
+DONTREFLECT
+THRUACTORS
//+NOINTERACTION
height 56
radius 16
scale 2.5
renderstyle translucent
alpha 0.5
States
{
Spawn:
MGIC G 0
Spawn2:
MGIC G 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"Death")
MGIC G 0 A_JumpIfInTargetInventory("MagicBallEnd",1,"End")
MGIC G 1
loop
End:
TNT1 A 0 A_JumpIfInTargetInventory("MagicBallEndFix",1,2)
TNT1 A 0 A_JumpIfInTargetInventory("FakeMagicFlag",1,"TeleportBack")
TNT1 A 0 A_GiveInventory("ConfettiPickup",1)
TNT1 A 0 A_GiveToTarget("ConfettiPickup",1)
TNT1 A 0 A_GiveToTarget("MagicTeleportScaleV",1)
EndBirds:
TNT1 A 0 A_ChangeFlag("MISSILE",1)
TNT1 A 0 //ACS_ExecuteAlways(790,0)
TNT1 A 0 A_GiveInventory("MagicBirdAttack",1)
goto Death
TeleportBack:
TNT1 A 0 A_GiveToTarget("MagicBirdAttack2",1)
TNT1 A 0 A_GiveToTarget("MagicTeleportScaleV",1)
//TNT1 A 1
//TNT1 A 0 Thing_Move(ACS_ExecuteWithResult(257,0),0,1)
TNT1 A 0 A_SetUserVar("user_TID",ACS_ExecuteWithResult(257,0))
TNT1 A 0 Thing_ChangeTID(0,user_TID+600)
TNT1 A 0 Thing_Move(user_TID,TID,1)
TNT1 A 0 A_GiveToTarget("Nudge",1)
//TNT1 A 0 Thing_ChangeTID(0,0)
goto Death
Death:
TNT1 A 1
stop
}
}

actor MagicHologramBirds : MagicHologram
{
States
{
Spawn:
TNT1 A 0 
goto EndBirds
}
}

actor MagicBirdAttack2 : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_SpawnItemEx("MagicHologramBirds",0,0,0,0,0,0,0,1,0)
stop
}
}

actor MagicTeleportScaleV : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_ScaleVelocity(0.1)
stop
}
}

actor MagicBirdAttack : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_SpawnItemEx("MagicBirdsSound",0,0,16)
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("MagicHomingBirds",4,0,56,16,0,0.65,0,1)
TNT1 A 0 A_SpawnItemEx("MagicHomingBirds",4,28,42,16,0,0.35,-4,1)
TNT1 A 0 A_SpawnItemEx("MagicHomingBirds",4,-28,42,16,0,0.35,4,1)
TNT1 A 0 A_SpawnItemEx("MagicHomingBirds",4,0,28,16,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("MagicHomingBirds",4,28,14,16,0,-0.35,-4,1)
TNT1 A 0 A_SpawnItemEx("MagicHomingBirds",4,-28,14,16,0,-0.35,4,1)
TNT1 A 0 A_SpawnItemEx("MagicHomingBirds",4,0,0,16,0,-0.65,0,1)
TNT1 A 0 A_JumpIfInTargetInventory("PowerSpread_ST",1,"Pickup_S")
//SpawnItemEx Simulation of the below
//TNT1 A 0 A_CustomMissile("MagicHomingBirds",56,0,0,2,2)
//TNT1 A 0 A_CustomMissile("MagicHomingBirds",42,28,-4,2,1)
//TNT1 A 0 A_CustomMissile("MagicHomingBirds",42,-28,4,2,1)
//TNT1 A 0 A_CustomMissile("MagicHomingBirds",28,0,0,2,0)
//TNT1 A 0 A_CustomMissile("MagicHomingBirds",14,28,-4,2,-1)
//TNT1 A 0 A_CustomMissile("MagicHomingBirds",14,-28,4,2,-1)
//TNT1 A 0 A_CustomMissile("MagicHomingBirds",0,0,0,2,-2)
stop
Pickup_S:
TNT1 A 0 A_SpawnItemEx("MagicHomingBirds",4,0,56,16,0,0.65,15,1)
TNT1 A 0 A_SpawnItemEx("MagicHomingBirds",4,28,42,16,0,0.35,11,1)
TNT1 A 0 A_SpawnItemEx("MagicHomingBirds",4,-28,42,16,0,0.35,19,1)
TNT1 A 0 A_SpawnItemEx("MagicHomingBirds",4,0,28,16,0,0,15,1)
TNT1 A 0 A_SpawnItemEx("MagicHomingBirds",4,28,14,16,0,-0.35,11,1)
TNT1 A 0 A_SpawnItemEx("MagicHomingBirds",4,-28,14,16,0,-0.35,19,1)
TNT1 A 0 A_SpawnItemEx("MagicHomingBirds",4,0,0,16,0,-0.65,15,1)

TNT1 A 0 A_SpawnItemEx("MagicHomingBirds",4,0,56,16,0,0.65,-15,1)
TNT1 A 0 A_SpawnItemEx("MagicHomingBirds",4,28,42,16,0,0.35,-19,1)
TNT1 A 0 A_SpawnItemEx("MagicHomingBirds",4,-28,42,16,0,0.35,-11,1)
TNT1 A 0 A_SpawnItemEx("MagicHomingBirds",4,0,28,16,0,0,-15,1)
TNT1 A 0 A_SpawnItemEx("MagicHomingBirds",4,28,14,16,0,-0.35,-19,1)
TNT1 A 0 A_SpawnItemEx("MagicHomingBirds",4,-28,14,16,0,-0.35,-11,1)
TNT1 A 0 A_SpawnItemEx("MagicHomingBirds",4,0,0,16,0,-0.65,-15,1)
stop
}
}

actor MagicM_Romper
{
Translation "198:198=41:41", "192:192=215:215","202:202=210:210"
PROJECTILE
+HEXENBOUNCE
-NOGRAVITY
-BOUNCEONFLOORS
bouncecount 10
Damagetype "DMG_NoHitstun"
Obituary "$OB_MAGICROMPER"
Damage (1)
Radius 10
Height 20
Speed 20
scale 2.5
states
{
Spawn:
MGB7 AA 0
SpawnLOOP:
MGB7 A 0 A_JumpIfInTargetInventory("MerryChristmasFlag",1,"SpawnJOLLY")
MGB7 A 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"Grinched")
MGB7 ABAC 1 A_GiveToTarget("BabyBoyOut")
loop
SpawnJOLLY:
MGB7 D 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"Grinched")
MGB7 DEDF 1 A_GiveToTarget("BabyBoyOut") // Fix :)
loop
Death:
MGB7 A 1 A_CheckFloor(1)
goto Grinched
MGB7 A 0 A_SpawnItemEx("MagicM_RomperCam",0,0,20,0,0,0,0,1)
MGB7 A 0 A_SpawnItemEx("MagicM_RomperCamBody",0,0,2,0,0,0,0,1)
stop
XDeath:
Grinched:
X_2E D 0 A_PlaySound("weapon/blastpuff",0,0.5)
UMFX J 2
XMFX S 2
UMFX JK 2
stop
}
}
actor MagicM_RomperB : MagicM_Romper{Translation "192:192=205:205","198:198=74:74","202:202=205:205"}
actor MagicM_RomperR : MagicM_Romper{Translation "192:192=171:171","198:198=41:41","202:202=171:171"}
actor MagicM_RomperO : MagicM_Romper{Translation "192:192=104:104","198:198=128:128","202:202=104:104"}
actor MagicM_RomperP : MagicM_Romper{Translation "192:192=229:229","198:198=232:232","202:202=229:229"}

actor MagicM_RomperCam : MagicM_Romper
{
PROJECTILE
+NOEXPLODEFLOOR
+NOGRAVITY
Damagetype "DMG_NoHitstun"
Obituary "$OB_MAGICBALL"
Damage (0)
-NOBLOCKMAP
+FRIENDLY
+SHOOTABLE
-DONTRIP
+NOBLOOD
+QUICKTORETALIATE
+NOTARGETSWITCH

mass 0x7ffffffff
painchance 256
health 1
states
{
Spawn:
MGB7 "#" 0
MGB7 "#" 0
MGB7 "#" 0 A_PlaySoundEx("weapon/rminestick","Weapon")
MGB7 "#" 0 A_GiveInventory("RomperSNDDelay",1)
TNT1 "#" 0 A_JumpIfInTargetInventory("MerryChristmasFlag",1,"HOLLYSpawn")
TNT1 A 3 A_GiveToTarget("KingDumbsPreciousLittleBabyBoy")
TNT1 A 0 Thing_ChangeTID(0,400+ACS_ExecuteWithResult(257,0))
goto SpawnLOOP
HOLLYSpawn:
TNT1 A 3 A_GiveToTarget("KingDumbsPreciousLittleBabyBoy")
TNT1 D 0 Thing_ChangeTID(0,400+ACS_ExecuteWithResult(257,0))
SpawnLOOP:
TNT1 "#" 1 A_GiveToTarget("BabyBoyOut")
MGB7 "#" 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"Death")
MGB7 "#" 0 A_JumpIfInTargetInventory("InfanticideFlag",1,"Death")
MGB7 "#" 0 A_JumpIfInTargetInventory("OnceC",1,"CamCheck")
MGB7 "#" 0 A_TakeInventory("AtomicFireAmmo",999)
MGB7 "#" 0 A_JumpIfInventory("RomperSNDDelay",1,"SpawnLOOP")
MGB7 "#" 0 A_PlaySound("misc/lightelevatorend",1,0.25)
MGB7 "#" 0 A_GiveInventory("RomperSNDDelay",1)
goto SpawnLOOP
CamCheck:
MGB7 "#" 0 A_JumpIfInTargetInventory("RomperLockFlag",1,"MakeDaNoise")
MGB7 "#" 0 ACS_NamedExecuteWithResult("CCBM_PitchAngleSetter",1)
MakeDaNoise:
MGB7 "#" 0 A_JumpIfInventory("AtomicFireAmmo",1,"SpawnLOOP")
MGB7 "#" 0 A_PlaySound("misc/clnwindup",1,0.25)
MGB7 "#" 0 A_GiveInventory("AtomicFireAmmo")
MGB7 "#" 0 A_TakeInventory("RomperSNDDelay",1)
goto SpawnLOOP
Crash:
XDeath:
Death:
MGB7 "#" 0 A_TakeFromTarget("KingDumbsPreciousLittleBabyBoy",999)
MGB7 "#" 0 A_TakeFromTarget("OnceC",999)
MGB7 "#" 0 A_GiveToTarget("InfanticideFlag",1)
MGB7 "#" 0 A_TakeFromTarget("RomperLockFlag",999)
stop
}
}

actor MagicM_RomperCamBody : MagicM_Romper
{
PROJECTILE
+NOINTERACTION
states
{
Spawn:
MGB7 "#" 0
MGB7 "#" 0
MGB7 "#" 0 A_JumpIfInTargetInventory("MerryChristmasFlag",1,"HOLLYSpawn")
MGB7 A 3 A_GiveToTarget("KingDumbsPreciousLittleBabyBoy")
goto SpawnLOOP
HOLLYSpawn:
MGB7 D 3 A_GiveToTarget("KingDumbsPreciousLittleBabyBoy")
SpawnLOOP:
MGB7 "#" 1 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"Death")
MGB7 "#" 0 A_JumpIfInTargetInventory("InfanticideFlag",1,"Death")
loop
Crash:
XDeath:
Death:
MGB7 "#" 0 A_TakeFromTarget("KingDumbsPreciousLittleBabyBoy",999)
MGB7 "#" 0 A_TakeFromTarget("OnceC",999)
MGB7 "#" 0 A_TakeFromTarget("RomperLockFlag",999)
X_2E D 0 A_PlaySound("weapon/blastpuff",0,0.5)
UMFX J 2
XMFX S 2
UMFX JK 2
stop
}
}

actor MagicmanMain1_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("MagicCardB",0,1,0,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("MagicCardBB",0,1,0,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("MagicCardBR",0,1,0,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("MagicCardBO",0,1,0,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("MagicCardBP",0,1,0,0)
goto Done
}
}

actor MagicmanMain2_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("MagicCardBF",0,0,0,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("MagicCardBFB",0,0,0,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("MagicCardBFR",0,0,0,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("MagicCardBFO",0,0,0,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("MagicCardBFP",0,0,0,0)
goto Done
}
}


actor MagicmanMain3_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("MagicCardBF",(random(0,1)*2-1)*random(1,10),0,0,0,0,(random(0,1)*2-1)*random(1,10))
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("MagicCardBFB",(random(0,1)*2-1)*random(1,10),0,0,0,0,(random(0,1)*2-1)*random(1,10))
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("MagicCardBFR",(random(0,1)*2-1)*random(1,10),0,0,0,0,(random(0,1)*2-1)*random(1,10))
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("MagicCardBFO",(random(0,1)*2-1)*random(1,10),0,0,0,0,(random(0,1)*2-1)*random(1,10))
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("MagicCardBFP",(random(0,1)*2-1)*random(1,10),0,0,0,0,(random(0,1)*2-1)*random(1,10))
goto Done
}
}

actor MagicmanMainCBM_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("MagicM_OrbShot",0,0,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("MagicM_OrbShotB",0,0,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("MagicM_OrbShotR",0,0,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("MagicM_OrbShotO",0,0,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("MagicM_OrbShotP",0,0,8,0)
goto Done
}
}

actor MagicmanReload_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("MagicM_Romper",0,0,0,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("MagicM_RomperB",0,0,0,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("MagicM_RomperR",0,0,0,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("MagicM_RomperO",0,0,0,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("MagicM_RomperP",0,0,0,0)
goto Done
}
}
