[Statedef -2]
;攻撃力補正------------------------------------------------------------
[State -2]
type = AttackMulSet
trigger1 = !Ishelper
trigger1 = var(1) = 0
value = (1+fvar(1))*(1+fvar(5))

[State -2]
type = AttackMulSet
trigger1 = !Ishelper
trigger1 = var(1) = 1
value = (1+fvar(1))*(1+fvar(2))*(1+fvar(5))

;防御力補正------------------------------------------------------------
[State -2]
type = DefenceMulSet
trigger1 = !Ishelper
trigger1 = var(1) = 0
value = 1.0

[State -2]
type = DefenceMulSet
trigger1 = !Ishelper
trigger1 = var(1) = 1
value = (1+fvar(3))

;コンボ補正------------------------------------------------------------
[State -2]
type = varset
triggerall = !Ishelper
trigger1 = !Numtarget
fvar(1) = 0

[State -2]
type = varset
triggerall = !Ishelper
triggerall = Numtarget
trigger1 = target,GetHitVar(hitcount) = [1,2]
fvar(1) = 0

[State -2]
type = varset
triggerall = !Ishelper
triggerall = Numtarget
trigger1 = target,GetHitVar(hitcount) = 3
fvar(1) = -0.1

[State -2]
type = varset
triggerall = !Ishelper
triggerall = Numtarget
trigger1 = target,GetHitVar(hitcount) = [4,5]
fvar(1) = -0.2

[State -2]
type = varset
triggerall = !Ishelper
triggerall = Numtarget
trigger1 = target,GetHitVar(hitcount) = [6,7]
fvar(1) = -0.3

[State -2]
type = varset
triggerall = !Ishelper
triggerall = Numtarget
trigger1 = target,GetHitVar(hitcount) = 8
fvar(1) = -0.4

[State -2]
type = varset
triggerall = !Ishelper
triggerall = Numtarget
trigger1 = target,GetHitVar(hitcount) = 9
fvar(1) = -0.5

[State -2]
type = varset
triggerall = !Ishelper
triggerall = Numtarget
trigger1 = target,GetHitVar(hitcount) = 10
fvar(1) = -0.6

[State -2]
type = varset
triggerall = !Ishelper
triggerall = Numtarget
trigger1 = target,GetHitVar(hitcount) >= 11
fvar(1) = -0.7

;lifeによる攻撃力補正--------------------------------------------------
;（ほんとはlife差で補正がかかるんだけど、めんどくさいのでこれで最大1.2倍）
[State -2]
type = varset
trigger1 = !Ishelper
fvar(5) = (lifemax-life)*0.0002

;ファンクラブ補正------------------------------------------------------
[State -2]
type = varset
trigger1 = !Ishelper
trigger1 = numhelper(17000) != 0
trigger1 = helper(17000),stateno = 17005
fvar(6) = 2.0

[State -2]
type = varset
trigger1 = !Ishelper
trigger1 = numhelper(17000) = 0
fvar(6) = 0.0

;援軍判断------------------------------------------------------------------------
[State -2]
type = varset
triggerall = !Ishelper
triggerall = power >= 1000
triggerall = numhelper(17050)+numhelper(17060) > 0
trigger1 = numhelper(17050) = 1
trigger1 = helper(17050),stateno = 17051
trigger2 = numhelper(17060) = 1
trigger2 = helper(17060),stateno = 17061
trigger3 = numhelper(17060) = 1
trigger3 = numhelper(17070) = 1
trigger3 = helper(17070),stateno = 17071
var(8) = 1

[State -2]
type = varset
triggerall = !Ishelper
trigger1 = numhelper(17050) = 1
trigger1 = helper(17050),stateno != 17051
trigger2 = numhelper(17060) = 1
trigger2 = helper(17060),stateno != 17061
trigger3 = numhelper(17060) = 1
trigger3 = numhelper(17070) = 1
trigger3 = helper(17070),stateno != 17071
trigger4 = power < 1000
var(8) = 0

[State -2, 攻撃命令];ラファエル
type = varset
triggerall = !Ishelper
triggerall = var(59) <= 0
triggerall = command = "start"
triggerall = Numhelper(17050) > 0
trigger1 = helper(17050),stateno = 17051
trigger1 = var(8) = 1
var(9) = 1

[State -2, 攻撃命令(AI用)];ラファエル
type = varset
triggerall = !Ishelper
triggerall = var(59) >= 6
triggerall = Numhelper(17050) > 0
triggerall = helper(17050),stateno = 17051
triggerall = var(8) = 1
trigger1 = stateno >= 0
trigger1 = Random <= var(59)*100 || var(59) >= 10 && Random <= 1000
var(9) = 1

[State -2, 攻撃命令];ウォルナット1
type = varset
triggerall = !Ishelper
triggerall = var(59) <= 0
triggerall = command = "start"
triggerall = Numhelper(17060) > 0
trigger1 = helper(17060),stateno = 17061
trigger1 = var(8) = 1
trigger1 = Numhelper(17070) = 0
var(9) = 2

[State -2, 攻撃命令(AI用)];ウォルナット1
type = varset
triggerall = !Ishelper
triggerall = var(59) >= 6
triggerall = Numhelper(17060) > 0
triggerall = helper(17060),stateno = 17061
triggerall = var(8) = 1
triggerall = Numhelper(17070) = 0
trigger1 = stateno >= 0
trigger1 = Random <= var(59)*100 || var(59) >= 10 && Random <= 1000
var(9) = 2

[State -2, 攻撃命令];ウォルナット1
type = varset
triggerall = !Ishelper
triggerall = var(59) <= 0
triggerall = command = "start"
triggerall = Numhelper(17060) > 0
trigger1 = helper(17060),stateno = 17061
trigger1 = var(8) = 1
trigger1 = Numhelper(17070) = 1
trigger1 = helper(17070),stateno = 17071
var(9) = 3

[State -2, 攻撃命令(AI用)];ウォルナット1
type = varset
triggerall = !Ishelper
triggerall = var(59) >= 6
triggerall = Numhelper(17060) > 0
triggerall = helper(17060),stateno = 17061
triggerall = var(8) = 1
triggerall = Numhelper(17070) = 1
triggerall = helper(17070),stateno = 17071
trigger1 = stateno >= 0
trigger1 = Random <= var(59)*100 || var(59) >= 10 && Random <= 1000
var(9) = 3

;攻撃命令自動解除------------------------------------------------------
[State -2]
type = varset
triggerall = !Ishelper
trigger1 = numhelper(17050) = 1
trigger1 = helper(17050),stateno != 17051
trigger2 = numhelper(17060) = 1
trigger2 = helper(17060),stateno != 17061
trigger3 = numhelper(17060) = 1
trigger3 = numhelper(17070) = 1
trigger3 = helper(17070),stateno != 17071
var(9) = 0
;開始時アイテム--------------------------------------------------------
[State -2]
type = VarRandom
triggerall = !Ishelper
triggerall = time%2 = 0
triggerall = RoundState = 0
trigger1 = RoundsExisted = 0
trigger1 = TeamMode = Turns
trigger1 = RoundNo > 0
trigger2 = TeamMode = single
trigger2 = RoundNo = 1
trigger3 = TeamMode = simul
trigger3 = RoundNo = 1
v = 58
range = 1,3
Persistent = 0
ignorehitpause=1

;アイテム破損--------------------------------------------------------
[State -2]
type = VarRandom
trigger1 = !Ishelper
v = 7
range = 1,100
ignorehitpause=1

;幅変化--------------------------------------------------------
[State -2]
type = Width
trigger1 = var(1) = 1
trigger1 = stateno != 14102
player = 18,8

;ロックされた時とKOされたときのファントムoff---------------------------------
[State -2]
type = varset
triggerall = !Ishelper
trigger1 = GetHitVar(IsBound)
trigger2 = life = 0
trigger3 = Numhelper(11000) = 0;分身バグ対策
trigger4 = MoveType = H
trigger4 = stateno != [150,155]
trigger4 = stateno != [5000,5210]
trigger4 = stateno != [15600,15603]
var(1) = 0

;ファントムゲージ------------------------------------------------------------
[State -2]
type = Helper
triggerall = (RoundState < 3) && (NumEnemy != 0)
trigger1 = (NumHelper(20010) = 0)
trigger1 = TeamSide = 1
helpertype = normal
name = "fantomgage,1P"
stateno = 20010
postype = back
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 99999
pausemovetime = 99999
ID = 20010

[State -2]
type = Helper
triggerall = (RoundState < 3) && (NumEnemy != 0)
trigger1 = (NumHelper(20011) = 0)
trigger1 = TeamSide = 2
helpertype = normal
name = "fantomgage,2P"
stateno = 20011
postype = back
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 99999
pausemovetime = 99999
ID = 20011

;ブレイク------------------------------------------------------
[State -2]
type = ChangeState
triggerall = !Ishelper
trigger1 = stateno != 15600
trigger1 = var(1) = 1
trigger1 = fvar(0) >= 1.0
value = 15600

;ゲージ管理----------------------------------------------------
[State -2]
type = varadd
triggerall = !Ishelper
trigger1 = var(1) = 1
fvar(0) = ifelse(GethitVar(damage)>0,0.003*GethitVar(damage)*(1+fvar(3)),0)

[State -2]
type = varadd
triggerall = !Ishelper
trigger1 = var(1) = 0
fvar(0) = -0.01

[State -2]
type = varset
triggerall = !Ishelper
trigger1 = fvar(0) <= 0
fvar(0) = 0

[State -2]
type = varset
triggerall = !Ishelper
trigger1 = fvar(0) >= 1.0
fvar(0) = 1.0


;やられ--------------------------------------------------------
[State -2]
type = VarRandom
trigger1 = !Ishelper
v = 0
range = 6
Persistent = 0
ignorehitpause=1

[State -2]
type = PlaySnd
triggerall = !Ishelper
triggerall = (RoundState = 2)
triggerall = (Alive)
triggerall = var(0) = 1
trigger1 = (Stateno = 5000) && (MoveType = H) && (Time = 1)
trigger2 = (Stateno = 5010) && (MoveType = H) && (Time = 1)
trigger3 = (Stateno = 5020) && (MoveType = H) && (Time = 1)
trigger4 = (Stateno = 5070) && (MoveType = H) && (Time = 1)
value = s1, ifelse(var(1) = 0,0,4)
channel = 1
Persistent = 0

[State -2]
type = PlaySnd
triggerall = !Ishelper
triggerall = (RoundState = 2)
triggerall = (Alive)
triggerall = var(0) = 2
trigger1 = (Stateno = 5000) && (MoveType = H) && (Time = 1)
trigger2 = (Stateno = 5010) && (MoveType = H) && (Time = 1)
trigger3 = (Stateno = 5020) && (MoveType = H) && (Time = 1)
trigger4 = (Stateno = 5070) && (MoveType = H) && (Time = 1)
value = s1, ifelse(var(1) = 0,1,5)
channel = 1
Persistent = 0

[State -2]
type = PlaySnd
triggerall = !Ishelper
triggerall = (RoundState = 2)
triggerall = (Alive)
triggerall = var(0) = 3
trigger1 = (Stateno = 5000) && (MoveType = H) && (Time = 1)
trigger2 = (Stateno = 5010) && (MoveType = H) && (Time = 1)
trigger3 = (Stateno = 5020) && (MoveType = H) && (Time = 1)
trigger4 = (Stateno = 5070) && (MoveType = H) && (Time = 1)
value = s1, ifelse(var(1) = 0,2,6)
channel = 1
Persistent = 0

[State -2]
type = PlaySnd
triggerall = !Ishelper
triggerall = (RoundState = 2)
triggerall = (Alive)
triggerall = var(0) = 4
trigger1 = (Stateno = 5000) && (MoveType = H) && (Time = 1)
trigger2 = (Stateno = 5010) && (MoveType = H) && (Time = 1)
trigger3 = (Stateno = 5020) && (MoveType = H) && (Time = 1)
trigger4 = (Stateno = 5070) && (MoveType = H) && (Time = 1)
value = s1, ifelse(var(1) = 0,3,7)
channel = 1
Persistent = 0

;着地音--------------------------------------
[State -2]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 52
trigger2 = stateno = 106
value = 10,4

;必殺技エフェクト消滅---------------------------------
[State -2]
type = RemoveExplod
trigger1 = stateno != 12000
ID = 12000

[State -2]
type = RemoveExplod
trigger1 = stateno != 12001
ID = 12010

[State -2]
type = RemoveExplod
trigger1 = stateno != 12002
ID = 12020

;デバック用---------------------------------
[State -2]
type = DisplayToClipboard
trigger1 = 1
text="var(59) %d / fvar(0) %f / var(1) %d / var(9) %d\n" 
params = var(59),fvar(0),var(1),var(9)
