;===================================
;　-3のステート
;  ===================================
[Statedef -3]

[State -3, ＣＰＵ時コンフィグ暴発防止用ヘルパー]
type=helper
trigger1=!NumHelper(20005)
trigger1=roundstate=2
trigger1=alive
trigger1=var(19)=0
Trigger1=PrevStateNo=190||PrevStateNo=5900
Trigger1=ctrl&&stateno=0
helpertype=normal
name="AI"
stateno=20005
ID=20005
pos=9999,9999
keyctrl=1
pausemovetime=2147483647
supermovetime=2147483647
persistent = 0

;念のため↓も付けておく
[State -3, 関係無いステートに行かないように]
type=changestate
trigger1= ishelper(20005)
trigger1= stateno!=20005
value=20005


[State -3, コンフィグ発動フラグセット]
type = Varset
triggerall = !var(19)
triggerall = RoundState = [1,2]
trigger1 = Command = "AI0"
trigger2 = Command = "AI1"
trigger3 = Command = "AI2"
trigger4 = Command = "AI3"
trigger5 = Command = "AI4"
trigger6 = Command = "AI5"
trigger7 = Command = "AI6"
trigger8 = Command = "AI7"
trigger9 = Command = "AI8"
trigger10 = Command = "AI9"
trigger11 = Command = "AI10"
trigger12 = Command = "AI11"
trigger13 = Command = "AI12"
trigger14 = Command = "AI13"
trigger15 = Command = "AI14"
trigger16 = Command = "AI15"
trigger17 = Command = "AI16"
trigger18 = Command = "AI17"
trigger19 = Command = "AI18"
trigger20 = Command = "AI19"
trigger21 = Command = "AI20"
trigger22 = Command = "AI21"
trigger23 = Command = "AI22"
trigger24 = Command = "AI23"
trigger25 = Command = "AI24"
trigger26 = Command = "AI25"
trigger27 = Command = "AI26"
trigger28 = Command = "AI27"
trigger29 = Command = "AI28"
trigger30 = Command = "AI29"
trigger31 = Command = "AI30"
trigger32 = Command = "AI31"
trigger33 = Command = "AI32"
trigger34 = Command = "AI33"
trigger35 = Command = "AI34"
trigger36 = Command = "AI35"
trigger37 = Command = "AI36"
trigger38 = Command = "AI37"
trigger39 = Command = "AI38"
trigger40 = Command = "AI39"
trigger41 = Command = "AI40"
trigger42 = Command = "AI41"
trigger43 = Command = "AI42"
trigger44 = Command = "AI43"
trigger45 = Command = "AI44"
trigger46 = Numhelper(20005) = 1
Trigger46 = Helper(20005),var(59)
;trigger47 = 1
v = 19
value = 1







[State -3, 実演用]
type = changestate
value = 20007
triggerall = var(59) = 0
triggerall = Numhelper(20000) = 1
trigger1 = helper(20000),stateno = 20002
trigger1 = helper(20000),time = 1

[State -3, 戻る]
type = changestate
value = 20009
triggerall = var(59) = 0
trigger1 = (stateno = [20010,21999]) || stateno = 20008
trigger1 = command = "b"
ctrl = 0
ignorehitpause = 1

;==========================================================================================
;火力補正
;==========================================================================================
[State -2, 乗算火力補正戻し]
type = varset
triggerall = 1
trigger1 = enemynear(0),movetype != H
trigger1 = Numtarget(600) = 0
trigger1 = Numtarget(620) = 0
trigger1 = Numtarget(8305) = 0
trigger1 = Numtarget(10765) = 0
trigger1 = Numtarget(10770) = 0
;trigger1 = movetype != A
trigger2 = moveguarded
fv = 5
value = 1

[State -2, 復帰不能補正戻し]
type = varset
triggerall = 1
trigger1 = enemynear(0),movetype != H
trigger1 = Numtarget(600) = 0
trigger1 = Numtarget(620) = 0
trigger1 = Numtarget(8305) = 0
trigger1 = Numtarget(10765) = 0
trigger1 = Numtarget(10770) = 0
;trigger1 = movetype != A
trigger2 = moveguarded
v = 26
value = 100

[State -2, 1]
type = varset
trigger1 = var(26) < 0
v = 26
value = 0
ignorehitpause = 1

[State -2, ノックバック補正戻し]
type = varset
triggerall = 1
trigger1 = enemynear(0),movetype != H
trigger1 = Numtarget(600) = 0
trigger1 = Numtarget(620) = 0
trigger1 = Numtarget(8305) = 0
trigger1 = Numtarget(10765) = 0
trigger1 = Numtarget(10770) = 0
;trigger1 = movetype != A
trigger2 = moveguarded
trigger3 = Numhelper(10740) = 1
v = 24
value = 100



;多段ヒット用
[State -2, 1]
type = MoveHitReset
trigger1 = stateno = 400
trigger1 = animelemtime(13) = 0
trigger2 = stateno = 900
trigger2 = animelemtime(23) = 1


[State -2, varset]
type = varset
trigger1 = movehit = 0
v = 28
value = 0
ignorehitpause = 1

[State -2, 1]
type = varset
trigger1 = enemynear,movetype = A
v = 25
value = 1
ignorehitpause = 1

;=====================
;ここから技別補正値（helper攻撃・多段攻撃は個別のステートで設定）
;=====================
;テンプレ
[State -2, 何か（上書き）]
type = null;varset
trigger1 = var(28) = 0
trigger1 = stateno = 300
trigger1 = movehit
fv = 5
value = ifelse(fvar(5) > 0.70, 0.70, fvar(5)*1)

[State -2, 何か（乗算）]
type = null;varset
trigger1 = var(28) = 0
trigger1 = stateno = 400
trigger1 = movehit
fv = 5
value = ifelse(fvar(5) = 1, fvar(5)*1, fvar(5)*1)


[State -2, 立A（乗算）]
type = varset
trigger1 = var(28) = 0
trigger1 = stateno = 300
trigger1 = movehit
trigger1 = var(26) := var(26) - 2
trigger1 = var(24) := var(24) + 4
fv = 5
value = ifelse(fvar(5) = 1, ceil(fvar(5)*80)*0.01, ceil(fvar(5)*95)*0.01)
ignorehitpause = 1

[State -2, 6A（乗算）]
type = varset
trigger1 = var(28) = 0
trigger1 = stateno = 350
trigger1 = movehit
trigger1 = var(26) := var(26) - 3
trigger1 = var(24) := var(24) + 6
fv = 5
value = ifelse(fvar(5) = 1, ceil(fvar(5)*91)*0.01, ceil(fvar(5)*91)*0.01)
ignorehitpause = 1

[State -2, 立B（乗算）]
type = varset
trigger1 = var(28) = 0
trigger1 = stateno = 400
trigger1 = movehit
trigger1 = var(26) := var(26) - 2
trigger1 = var(24) := var(24) + 4
fv = 5
value = ifelse(fvar(5) = 1, ceil(fvar(5)*91)*0.01, ceil(fvar(5)*91)*0.01)
ignorehitpause = 1

[State -2, 立E（乗算）]
type = varset
trigger1 = var(28) = 0
trigger1 = stateno = 600 || stateno = 620
trigger1 = movehit
trigger1 = var(26) := var(26) - 5
trigger1 = var(24) := var(24) + 10
fv = 5
value = ifelse(fvar(5) = 1, ceil(fvar(5)*83)*0.01, ceil(fvar(5)*83)*0.01)
ignorehitpause = 1

[State -2, 2A（乗算）]
type = varset
trigger1 = var(28) = 0
trigger1 = stateno = 700
trigger1 = movehit
trigger1 = var(26) := var(26) - 2
trigger1 = var(24) := var(24) + 4
fv = 5
value = ifelse(fvar(5) = 1, ceil(fvar(5)*70)*0.01, ceil(fvar(5)*95)*0.01)
ignorehitpause = 1

[State -2, 2B（乗算）]
type = varset
trigger1 = var(28) = 0
trigger1 = stateno = 800
trigger1 = movehit
trigger1 = var(26) := var(26) - 2
trigger1 = var(24) := var(24) + 4
fv = 5
value = ifelse(fvar(5) = 1, ceil(fvar(5)*70)*0.01, ceil(fvar(5)*91)*0.01)
ignorehitpause = 1

[State -2, 2C（乗算）]
type = varset
trigger1 = var(28) = 0
trigger1 = stateno = 900
trigger1 = movehit
trigger1 = var(26) := var(26) - 4
trigger1 = var(24) := var(24) + 8
fv = 5
value = ifelse(fvar(5) = 1, ceil(fvar(5)*83)*0.01, ceil(fvar(5)*83)*0.01)
ignorehitpause = 1

[State -2, 2E（乗算）]
type = varset
trigger1 = var(28) = 0
trigger1 = stateno = 1000 || stateno = 1020
trigger1 = movehit
trigger1 = var(26) := var(26) - 5
trigger1 = var(24) := var(24) + 10
fv = 5
value = ifelse(fvar(5) = 1, ceil(fvar(5)*83)*0.01, ceil(fvar(5)*83)*0.01)
ignorehitpause = 1

[State -2, JA（乗算）]
type = varset
trigger1 = var(28) = 0
trigger1 = stateno = 1100
trigger1 = movehit
trigger1 = var(26) := var(26) - 2
trigger1 = var(24) := var(24) + 4
fv = 5
value = ifelse(fvar(5) = 1, ceil(fvar(5)*80)*0.01, ceil(fvar(5)*95)*0.01)
ignorehitpause = 1

[State -2, JB（乗算）]
type = varset
trigger1 = var(28) = 0
trigger1 = stateno = 1200
trigger1 = movehit
trigger1 = var(26) := var(26) - 2
trigger1 = var(24) := var(24) + 4
fv = 5
value = ifelse(fvar(5) = 1, ceil(fvar(5)*87)*0.01, ceil(fvar(5)*87)*0.01)
ignorehitpause = 1

[State -2, J6B（乗算）]
type = varset
trigger1 = var(28) = 0
trigger1 = stateno = 1250
trigger1 = movehit
trigger1 = var(26) := var(26) - 2
trigger1 = var(24) := var(24) + 4
fv = 5
value = ifelse(fvar(5) = 1, ceil(fvar(5)*91)*0.01, ceil(fvar(5)*91)*0.01)
ignorehitpause = 1

[State -2, JC（乗算）]
type = varset
trigger1 = var(28) = 0
trigger1 = stateno = 1300
trigger1 = movehit
trigger1 = var(26) := var(26) - 4
trigger1 = var(24) := var(24) + 8
fv = 5
value = ifelse(fvar(5) = 1, ceil(fvar(5)*83)*0.01, ceil(fvar(5)*83)*0.01)
ignorehitpause = 1

[State -2, JE（乗算）]
type = varset
trigger1 = var(28) = 0
trigger1 = stateno = 1400
trigger1 = movehit
trigger1 = var(26) := var(26) - 5
trigger1 = var(24) := var(24) + 10
fv = 5
value = ifelse(fvar(5) = 1, ceil(fvar(5)*83)*0.01, ceil(fvar(5)*83)*0.01)
ignorehitpause = 1

[State -2, 杖術・真鉋（乗算）]
type = varset
triggerall = palno <= 11
trigger1 = var(28) = 0
trigger1 = stateno = 3000 || stateno = 3100 || stateno = 3200
trigger1 = movehit
trigger1 = var(26) := var(26) - 2
trigger1 = var(24) := var(24) + 4
fv = 5
value = ifelse(fvar(5) = 1, ceil(fvar(5)*80)*0.01, ceil(fvar(5)*95)*0.01)
ignorehitpause = 1

[State -2, 杖術・真鉋（１２Ｐ）]
type = varset
triggerall = palno = 12
trigger1 = var(28) = 0
trigger1 = stateno = 3000 || stateno = 3100 || stateno = 3200
trigger1 = movehit
trigger1 = var(26) := var(26) - 2
trigger1 = var(24) := var(24) + 4
fv = 5
value = ifelse(fvar(5) = 1, ceil(fvar(5)*80)*0.01, ceil(fvar(5)*100)*0.01)
ignorehitpause = 1
;派生は個別ステート

[State -2, 獣術・陽炎（乗算）]
type = varset
triggerall = palno <= 11
trigger1 = var(28) = 0
trigger1 = stateno = 3400 || stateno = 3500 || stateno = 3600
trigger1 = movehit
trigger1 = var(26) := var(26) - 5
trigger1 = var(24) := var(24) + 10
fv = 5
value = ifelse(fvar(5) = 1, ceil(fvar(5)*83)*0.01, ceil(fvar(5)*83)*0.01)
ignorehitpause = 1

[State -2, 獣術・陽炎（１２Ｐ）]
type = varset
triggerall = palno = 12
trigger1 = var(28) = 0
trigger1 = stateno = 3400 || stateno = 3500 || stateno = 3600
trigger1 = movehit
trigger1 = var(26) := var(26) - 5
trigger1 = var(24) := var(24) + 10
fv = 5
value = ifelse(fvar(5) = 1, ceil(fvar(5)*83)*0.01, ceil(fvar(5)*100)*0.01)
ignorehitpause = 1

[State -2, 無量光の意（乗算）]
type = varset
trigger1 = var(28) = 0
trigger1 = stateno = 10730
trigger1 = movehit
trigger1 = var(26) := var(26) - 20
trigger1 = var(24) := var(24) + 40
fv = 5
value = ifelse(fvar(5) = 1, ceil(fvar(5)*50)*0.01, ceil(fvar(5)*50)*0.01)
ignorehitpause = 1

[State -2, 轟天焦（乗算）]
type = varset
trigger1 = var(28) = 0
trigger1 = stateno = 11690
trigger1 = movehit
trigger1 = var(26) := var(26) - 20
trigger1 = var(24) := var(24) + 40
fv = 5
value = ifelse(fvar(5) = 1, ceil(fvar(5)*50)*0.01, ceil(fvar(5)*50)*0.01)
ignorehitpause = 1

[State -2, ロイヤルオプティクス（乗算）]
type = varset
trigger1 = var(28) = 0
trigger1 = stateno = 13460 || stateno = 13475
trigger1 = movehit
trigger1 = var(26) := var(26) - 10
trigger1 = var(24) := var(24) + 20
fv = 5
value = ifelse(fvar(5) = 1, ceil(fvar(5)*70)*0.01, ceil(fvar(5)*70)*0.01)
ignorehitpause = 1


[State -2, 1];カウンターヒット補正
type = varset
trigger1 = var(28) = 0
trigger1 = movehit
trigger1 = var(25) = 1
fv = 5
value = 1 - 0.01*(floor((100-fvar(5)*100)*0.2)-1)
ignorehitpause = 1

[State -2, 1];ホミキャン、超必による復帰不能補正回復
type = varset
triggerall = time = 1
trigger1 = stateno = 2000 || stateno = 2100 || stateno = 2201 || stateno = 2202
trigger2 = stateno = 8000 || stateno = 8100 || stateno = 8200 || stateno = 8300
v = 26
value = var(26) + ceil((100-var(26))*0.3)
ignorehitpause = 1

[State -2, varset]
type = varset
trigger1 = movehit
v = 28
value = 1
ignorehitpause = 1

[State -2, 1]
type = varset
trigger1 = enemynear,movetype = I
trigger2 = movehit
trigger3 = fvar(5) != 1
trigger4 = Numhelper(10710) >= 1
trigger4 = helper(10710),movehit
v = 25
value = 0
ignorehitpause = 1











[State -2, 1]
type = attackmulset
triggerall = Numhelper(7000) >= 1
trigger1 = 1
value = 1*fvar(5)*0.9*helper(7000),fvar(0)*helper(7000),fvar(2)*helper(7000),fvar(3)
ignorehitpause = 1

;1-(0.3-(0.075*(Life*0.01)))

[State -2, 1];根性値など防御力補正
type = defencemulset
trigger1 = 1
trigger1 = Numhelper(7000) >= 1
value = ifelse(Life > 400,1,1-(0.3-(0.075*(Life*0.01))))*helper(7000),fvar(1)
ignorehitpause = 1


[State -3, 1]
type = destroyself
trigger1 = ishelper = 1













