actor Magicman : CustWepClassBase
{
Player.ScoreIcon "C_0BF0X"
player.displayname "Magicman"
player.soundclass "magicmanc"

player.maxhealth 900
health 900
player.jumpz 10
player.forwardmove 0.8, 0.8
player.sidemove 0.78, 0.78

player.startitem "CBM_BaseFlagPack"

player.startitem "Magicman_W"
player.startitem "Magicman_W2"
player.startitem "SnortSnortAmmo",250

player.weaponslot 1, "Magicman_W"
player.weaponslot 2, "Magicman_W2"


player.startitem "RollingCutterWeakness"
player.startitem "MetalBladeWeakness"
player.startitem "ShadowBladeWeakness"
player.startitem "GyroAttackWeakness"
player.startitem "SilverTomahawkWeakness"
player.startitem "TenguBladeWeakness"//
player.startitem "WheelCutterWeakness"
player.startitem "PhotonMissileWeakness"
player.startitem "ScrewCrusherWeakness"

States
{
Spawn:
MGIC A 0
MGIC B 1
MGIC A 1
Goto Spawn+2
See:
MGIC BCDE 5
Goto Spawn
Missile:
MGIC FG 5
goto Spawn
ClassPain:
MGIC H 0
goto MegamanPain
ClassDeath:
MGIC H 0 A_SpawnItemEx("MagicmanDeathTrick_H",0,0,0,0,0,0,0,1)
goto MegamanDeath
}
}


//A copy of MagicDeath from core, just in case

actor MagicmanDeathTrick_H : BasicHelper
{
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Jump(96, "ConfettiDeath")
TNT1 A 1 A_Jump(96, "CardDeath")
TNT1 A 1 A_Jump(96, "BirdDeath")
stop

ConfettiDeath:
TNT1 A 1 A_SpawnItemEx("MagicMDeath_Confetti_H",0,0,32,0,0,0,0,1)
stop
CardDeath:
TNT1 A 0 A_SpawnItemEx("MagicM_SpadeCard",random(3,6),random(-6,-3),random(30,34),random(3,5),random(3,5),frandom(-2,2),random(0,359),0)
TNT1 A 0 A_SpawnItemEx("MagicM_DiamondCard",random(3,6),random(-6,-3),random(30,34),random(3,5),random(3,5),frandom(-2,2),random(0,359),0)
TNT1 A 0 A_SpawnItemEx("MagicM_HeartCard",random(3,6),random(-6,-3),random(30,34),random(3,5),random(3,5),frandom(-2,2),random(0,359),0)
TNT1 A 0 A_SpawnItemEx("MagicM_ClubCard",random(3,6),random(-6,-3),random(30,34),random(3,5),random(3,5),frandom(-2,2),random(0,359),0)
TNT1 A 1
stop
BirdDeath:
TNT1 AAAA 0 A_SpawnItemEx("MagicMDeath_Dove",random(3,6),random(-6,-3),random(30,34),random(3,5),random(3,5),frandom(-2,2),random(0,359),1)
TNT1 A 1
stop
}
}

actor MagicMDeath_Confetti_H : BasicClientSide
{
ReactionTime 10
States
{
Spawn:
TNT1 A 1
TNT1 AAA 0 A_SpawnItemEx("MagicMDeath_Confetti",random(-16,16),random(-16,16),Random(8,16),random(-3,3),random(-3,3),random(1,-1),0,1)
TNT1 A 0 A_CountDown
Loop
}
}

actor MagicMDeath_Confetti
{
+MISSILE
+DONTBLAST
+DONTREFLECT
+CLIENTSIDEONLY
+LOWGRAVITY
+THRUACTORS
+DONTSPLASH
damage 0
height 2
radius 2
scale 2.0
States
{
Spawn:
PCNF A 0
PCNF A 0 A_Jump(85,"Spawn2")
PCNF A 0 A_Jump(85,"Spawn3")
Spawn1://White
PCNF A 5
PCNF BCD 5 A_ChangeVelocity(momx*0.9,momy*0.9,momz,2)
PCNF ABCDABCD 5 
PCNF AAAAABBBBB 1 A_Fadeout
stop
Spawn2://198/249
MGB7 W 5
MGB7 XWX 5 A_ChangeVelocity(momx*0.9,momy*0.9,momz,2)
MGB7 WXWXWXWX 5
MGB7 WWWWWXXXXX 1 A_Fadeout
stop
Spawn3://192/250/4
MGB7 Y 5
MGB7 Z 5 A_ChangeVelocity(momx*0.9,momy*0.9,momz,2)
PCNF B 5 A_ChangeVelocity(momx*0.9,momy*0.9,momz,2)
MGB7 YZ 5
PCNF B 5
MGB7 YZ 5
PCNF B 5
MGB7 YZ 5
PCNF BBBBB 1 A_Fadeout
MGB7 YYYYY 1 A_Fadeout
stop
}
}

actor MagicMDeath_Dove : BasicClientSide
{
ReactionTime 35
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Jump(256,1,2,3,4)
MGB8 ABCD 2 ThrustThingZ(0,5,0,1)
MGB8 A 0 A_CountDown
goto Spawn+2
}
}

actor MagicM_SpadeCard : BasicClientSide
{
Scale 1.0
States
{
Spawn:
MCRD D 1
goto Spawn2
Spawn2:
"####" "#" 35
stop
}
}

actor MagicM_DiamondCard : MagicM_SpadeCard
{
States
{
Spawn:
MCRD B 1
goto Spawn2
}
}

actor MagicM_HeartCard : MagicM_SpadeCard
{
States
{
Spawn:
MCRD C 1
goto Spawn2
}
}

actor MagicM_ClubCard : MagicM_SpadeCard
{
States
{
Spawn:
MCRD A 1
goto Spawn2
}
}

actor MagicM_KillTrick_H : MagicmanDeathTrick_H
{
States
{
Spawn:
TNT1 A 0
//TNT1 A 0 A_Jump(96,"")
TNT1 A 0 A_Jump(32,"Uno")
TNT1 A 0 A_Jump(128,"Romper")
TNT1 A 0 A_Jump(96,"CardDeath")
TNT1 A 1 A_Jump(256,"ConfettiDeath")
stop
Uno:
TNT1 A 1 A_SpawnItemEx("MagicM_UnoKillTrick",0,0,32,0,0,1,0,1)
stop
Romper:
TNT1 A 1 A_SpawnItemEx("MagicM_RomperKillTrick",0,0,16,0,0,0,random(0,35)*10,9)
stop
}
}

actor MagicM_RomperKillTrick
{
-SOLID
+CANPASS
+THRUACTORS
+NOBLOCKMONST
//+CLIENTSIDEONLY
radius 6
height 6
speed 4
scale 2.0
Args 8
States
{
Spawn:
MGB7 A 0
MGB7 A 8
MGB7 AAAAAAAA 0 A_Wander
MGB7 A 0 A_Jump(1,"RomperF1")
MGB7 A 0 A_Jump(2,"RomperF2")
MGB7 A 0 A_Jump(153,"Romper3")
MGB7 A 0 A_Jump(77,"Romper2")
MGB7 A 0 A_Jump(1,"Romper_T")
Romper1:
MGB7 ABAC 12 A_Wander
MGB7 A 0 A_CountDownArg(0)
loop
Romper2://A_SetSpeed(8)
MGB7 ABACABAC 6 A_Wander
MGB7 A 0 A_CountDownArg(0)
loop
Romper3://A_SetSpeed(6)
MGB7 ABACAB 8 A_Wander
MGB7 A 0 A_CountDownArg(0)
MGB7 ACABAC 8 A_Wander
MGB7 A 0 A_CountDownArg(0)
loop
RomperF:
MGB7 ABACABACABACABACABACABACABACABACABACABACABACABAC 1 A_Wander
MGB7 A 0 A_CountDownArg(0)
loop
RomperF2:
MGB7 ABACABACABACABACABACABAC 2 A_Wander
MGB7 A 0 A_CountDownArg(0)
loop
Romper_T:
MGB7 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_Wander
MGB7 A 0 A_CountDownArg(0)
loop
Death:
TNT1 A 1
stop
}
}
actor MagicM_RomperKillTrickX :  MagicM_RomperKillTrick
{
Args 24
States
{
Spawn:
MGB7 A 0
MGB7 A 8
MGB7 AAAAAAAA 0 A_Wander
MGB7 A 0 A_Jump(64,"RomperF1")
MGB7 A 0 A_Jump(128,"RomperF2")
goto Romper_T
}
}

actor MagicM_UnoKillTrick : BasicWatcher
{
RenderStyle Normal
ReactionTime 24
Scale 1.0
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Jump(256,"Spawn1","Spawn2")
Spawn1:
MGB7 U 1
TNT1 A 1 A_CountDown
loop
Spawn2:
MGB7 V 1
TNT1 A 1 A_CountDown
loop
}
}
