;-----------------------------
;Throwing a ball of death as Beam(sort of) Counter
[Statedef 2481]
type = S
physics = S
movetype = A
ctrl = 0
velset = 0,0
sprpriority = 9
[State 0, StopSnd]
type = StopSnd
trigger1 = time = 0
channel = 5
[State -2, notification]
type = helper
trigger1 = !time && numhelper(13250)=0 && teamside = 1
helpertype=normal
stateno=13250
ID=13250
name="notif-col"
ownpal=1
pausemovetime=65535
supermovetime=65535
ignorehitpause=1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = 1
id = 3202
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = 1
id = 3203
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = 1
id = 2480
[State -2, notification]
type = null;helper
trigger1 = !time && numhelper(13250)=0 && teamside = 1
helpertype=normal
stateno=13250
ID=13250
name="notif-col"
ownpal=1
pausemovetime=65535
supermovetime=65535
ignorehitpause=1
[State 2260, bg]
type = assertspecial
trigger1 = 1
flag = noFG
flag2 = noBG
flag3 = nobardisplay
ignorehitpause = 1
[State 2260, bg]
type = assertspecial
trigger1 = 1
flag = timerfreeze
ignorehitpause = 1
[state 0, 1 tick fix]
type = ChangeAnim
trigger1 = enemy,stateno = 2481 && anim!=3201
value = 3201
[State 13100, shake]
type = envshake
trigger1 = !(time%12)
time = 12
freq = 130
ampl = 3
[State 0, Scale]
type = AngleDraw
trigger1 = 1
scale = .5,.5
[State 0, Position]
type = PosSet
trigger1 = 1
X = ifelse(facing=1, -130, 130)
Y = -20
[State -2];Counter variable from state -2
type = VarSet
trigger1 = !time
var(31) = 0
[State 200, 1];Voice (Haaa)
type = PlaySnd
trigger1 = time = 0 && var(20)
value = 15,14
channel = 0
volume = 355
[State 200, 1];Launching SFX
type = null;PlaySnd
trigger1 = time=4
value = 2401,1
[State 200, 1];Beam clash
type = null;PlaySnd
trigger1 = time=4
value = 2480,0
loop = 1
channel = 5
[State 200, 1];Beam colision voice tatatatata
type = null;PlaySnd
trigger1 = time>40 && fvar(20)<=0.2
value = 2480,1
channel = 5
persistent = 0
[state 17100,scale FX]
type = modifyexplod
trigger1 = numexplod(2481)
scale = 0.25+0.1*(fvar(20)-0.5) ,0.5+0.3*(fvar(20)-0.5)
id = 2481
ignorehitpause = 1
[state 17100,scale FX]
type = modifyexplod
trigger1 = numexplod(2464)
scale = fvar(20)*2. ,0.5+0.3*(fvar(20)-0.5)
id = 2464
ignorehitpause = 1
[State 3000, Center Ball]
type = helper
triggerall = !numhelper(2483)
trigger1 = anim=3201 && animelem=2 && facing=1
helpertype = normal
stateno = 2483
ID = 2483
name = "centerball"
postype = left
pos = 0,0
ownpal = 1
[State 800, count];Smashing counter set
type = VarSet
trigger1 = !time
var(30) = 0
[State 800, count];Smashing counter
type = VarAdd
trigger1 = command="x" || command="y" || command="z" || command="a" || command="b" || command="c" || command="start"
trigger1 = !AIlevel
trigger2 = command = "U" || command = "D" || command = "B" || command = "F"
trigger2 = !AIlevel
trigger3 = AIlevel = 1 && random <= 12 || AIlevel = 2 && random <= 32 || AIlevel = 3 && random <= 70 || AIlevel = 4 && random <= 94 || AIlevel = 5 && random <= 115 || AIlevel = 6 && random <= 174 || AIlevel = 7 && random <=250 || AIlevel = 8 && random <= 400
var(30) = 1
;Proportionality variable for scaling : =1 when beating the opponent by 20, =0 when beaten by 20.
[State 800, count]
type = VarSet
trigger1 = 1
fvar(20) = 0.5+(var(30)-enemy,var(30))/40.0
[State 800, WIN]
type = ChangeState
triggerall = time>10
trigger1 = fvar(20)>=.9
value = 2485
[State 800, no winner, both take damage]
type = ChangeState
trigger1 = time>=300
value = 2489
;------------------------------------------------
; Big Ball Beam Collision
[Statedef 2483]
type = S
movetype= A
physics = N
anim = 190
sprpriority = 5
[State -2, Explod];Big Ball at center
type = Explod
trigger1 = !numexplod(3202) && !time
anim = 3202
removetime = -1
sprpriority = 5
id = 3202
bindtime = -1
ownpal = 1
ontop = 1
sprpriority = 9
postype = p1
pos = 0,0
scale = 1,1
ignorehitpause = 1
pausemovetime = 99999
supermovetime = 99999
[state 17100,move ball FX]
type = Posset
trigger1 = 1
X = floor(160.0*((root,fvar(20))-.5))
Y = -47
[State 1305, timevar]
type = varadd
trigger1 = root,stateno != 2489
var(4) = 1
[State 1305, Scale Explod]
type = ModifyExplod
trigger1 = root,stateno = 2489
scale = 0.7+.1*(time-var(4)),0.7+.1*(time-var(4))
ID = 3202
[State 13100, explosion SND]
type = playsnd
trigger1 = root,stateno = 2489
trigger1 = time-var(4) = 0
value = 0,5
volume = 255
[State 2260, destroy]
type = RemoveExplod
trigger1 = root,stateno != 2481
trigger1 = root,stateno != 2489
[State 2260, destroy]
type = DestroySelf
trigger1 = root,stateno != 2481
trigger1 = root,stateno != 2489