;===========================================================================
;Robot Master Mayhem - Constants Template (statedef -3) V.1
;Template by Acey
;Based on Megaman by Chaotic
;www.infinitymugenteam.com
;===========================================================================

;---------------------------------------------------------------------------
; States that are executed while in self state (use statedef -3)
;---------------------------------------------------------------------------

[Statedef -3]

[State -3, Fffffinish!!]
type = Helper
triggerall = NumHelper(30000)=0
trigger1 = Winko
helpertype = normal
name = "Finish"
ID = 30000
stateno = 30000
ownpal = 1
ignorehitpause = 1
supermovetime = 9999
pausemovetime = 9999


;[State -3, Fake helper]
;type = helper
;trigger1 = roundstate = 2 && !numhelper(9900)
;helpertype = Normal
;id = 9900
;pos = 0,0
;postype = p1
;name = "Fake Helper"
;stateno = 9900
;supermovetime = 9999999999
;pausemovetime = 9999999999

[State -3, VarAdd]
type = VarAdd
trigger1 = (HitPauseTime = 1) && (P2MoveType = H) && (MoveHit = 1) && (StateNo < 3000)
trigger2 = ProjHitTime(0) = 1
v = 21
value = 1
ignorehitpause = 1

[State -3, VarReset]
type = VarSet
trigger1 = P2MoveType != H
v = 21
value = 0

[State -3, AttackMulSet]
type = AttackMulSet
trigger1 = StateNo >= 3000
value = 1

[State -3, AttackMulSet]
type = AttackMulSet
triggerall = StateNo < 3000
trigger1 = Var(21) <= 1
value = 1

[State -3, AttackMulSet]
type = AttackMulSet
triggerall = StateNo < 3000
trigger1 = Var(21) = 2
value = 0.8

[State -3, AttackMulSet]
type = AttackMulSet
triggerall = StateNo < 3000
trigger1 = Var(21) = 3
value = 0.6

[State -3, AttackMulSet]
type = AttackMulSet
triggerall = StateNo < 3000
trigger1 = Var(21) = 4
value = 0.4

[State -3, AttackMulSet]
type = AttackMulSet
triggerall = StateNo < 3000
trigger1 = Var(21) >= 5
value = .2

[State 8510, Pó]
type = Explod
trigger1 = Stateno = 52 && time = 1
;trigger2 = Stateno = 240 && animelem = 8
trigger2 = Stateno = 1102 && time = 1
trigger3 = Stateno = 1112 && time = 1
trigger4 = Stateno = 1122 && time = 1
trigger5 = Stateno = 106 && time = 1
trigger6 = Stateno = 352 && AnimElemTime(2) = 1
anim = 8510
ID = 8510
postype = P1
pos = 0,4
sprpriority = -1
ownpal = 1
scale = 1.4, 1.2

[State -3, Land]
type = PlaySnd
trigger1 = StateNo = 52 && Time = 1
value = 8100,0

;--------------------------
;Remove Hyper FX

[State -3, Explod]
type = RemoveExplod
trigger1 = StateNo != [3000,4999]
ID = 8900

[State -3, Explod]
type = RemoveExplod
trigger1 = Roundstate = 4
ID = 8901

[State -3, Explod]
type = RemoveExplod
trigger1 = Var(20) > 0
ID = 8900

[State -3, Explod]
type = RemoveExplod
trigger1 = StateNo != [3000,4999]
ID = 8998

[State -3, Explod]
type = RemoveExplod
trigger1 = Roundstate = 4
ID = 8998

[State -3, Explod]
type = RemoveExplod
trigger1 = Var(20) > 0
ID = 8998

[State -3, Explod]
type = RemoveExplod
trigger1 = StateNo != [3000,4999]
ID = 8997

[State -3, Explod]
type = RemoveExplod
trigger1 = Roundstate = 4
ID = 8997

[State -3, Explod]
type = RemoveExplod
trigger1 = Var(20) > 0
ID = 8997

[State -3, Explod]
type = RemoveExplod
trigger1 = StateNo != [3000,4999]
ID = 8999

[State -3, Explod]
type = RemoveExplod
trigger1 = Roundstate = 4
ID = 8999

[State -3, Explod]
type = RemoveExplod
trigger1 = Var(20) > 0
ID = 8999

;--------------------------
;Reset Vars

[State -3, MSSM]
type = VarRandom
trigger1 = 1
v = 23
range = 0,8

[State -3, Super Jump]
type = VarSet
trigger1 = Stateno = 0
v = 12
value = 0

[State -3, Afterimagetime]
type = Afterimagetime
trigger1 = stateno != [3000,4999]
time = 0

[State -3, ctrl set]
type = ctrlset
trigger1 = roundstate = 4
value = 0

;----------------------------------------------------------------------------------------------
;No music for intro
[State -3, AssertSpecial]
type = AssertSpecial
trigger1 = roundno=1
trigger1 = roundstate<2
flag = nomusic
ignorehitpause = 1

;--------------------------------------
;;Super Jump Enemy Locator xD

;PLAYER 1
;[State -3]
;type = Explod
;triggerall = p2name = "Gutsman"
;triggerall = roundstate > 1
;triggerall = numenemy > 0
;trigger1 = screenpos y <0
;trigger1 = screenpos y > 220 - (const(size.head.pos.y))
;trigger2 = P2bodyDist y < -200
;anim = 9098 + ((enemy,id)<id)
;id = 9098
;pos = ceil(screenpos x),20+(screenpos y>0)*216;208
;postype = left;back
;sprpriority = 4
;ignorehitpause = 1
;ontop = 1
;ownpal = 1
;bindtime = -1
;persistent = 1
;;facing = (facing)
;removetime = 1
;scale= .75,.75

;PLAYER 2
;[State -3]
;type = Explod
;triggerall = p2name = "Gutsman"
;triggerall = roundstate > 1
;triggerall = numenemy > 0
;triggerall = alive = 1 
;trigger1 = enemynear, screenpos y <0
;trigger2 = enemynear, screenpos y > 220 - (const(size.head.pos.y))
;trigger3 = P2bodyDist y > 200
;anim = 9099 - ((enemy,id)<id)
;id = 9099
;pos = ceil((enemynear,screenpos x)),20+(enemynear, screenpos y>0)*216
;postype = left
;sprpriority = 4
;ignorehitpause = 1
;ontop = 1
;ownpal = 1
;bindtime = -1
;persistent = 1
;;facing = (facing)
;removetime = 1
;scale= .75,.75
