;==============================================================================
;[statedef -3]定義
;==============================================================================
[Statedef -3]

;==============================================================================
;　AI発動
;==============================================================================
[State -3,0000]
Type = VarSet
Trigger1 = 1
V = 2
Value = 0        ;Level設定

; 0 : Normal(Default)
; 1 : Very Easy
; 2 : Easy
; 3 : Hard
; 4 : Insane
; 5 : Lunatic

[State -3, AI]
Type = VarSet
TriggerAll = Var(1) != 1
TriggerAll = Var(2) != 0
TriggerAll = RoundState = [1,2]
Trigger1 = Command = "CPU01"
Trigger2 = Command = "CPU02"
Trigger3 = Command = "CPU03"
Trigger4 = Command = "CPU04"
Trigger5 = Command = "CPU05"
Trigger6 = Command = "CPU06"
Trigger7 = Command = "CPU07"
Trigger8 = Command = "CPU08"
Trigger9 = Command = "CPU09"
Trigger10 = Command = "CPU10"
Trigger11 = Command = "CPU11"
Trigger12 = Command = "CPU12"
Trigger13 = Command = "CPU13"
Trigger14 = Command = "CPU14"
Trigger15 = Command = "CPU15"
Trigger16 = Command = "CPU16"
Trigger17 = Command = "CPU17"
Trigger18 = Command = "CPU18"
Trigger19 = Command = "CPU19"
Trigger20 = Command = "CPU20"
Trigger21 = Command = "CPU21"
Trigger22 = Command = "CPU22"
Trigger23 = Command = "CPU23"
Trigger24 = Command = "CPU24"
Trigger25 = Command = "CPU25"
Trigger26 = Command = "CPU26"
Trigger27 = Command = "CPU27"
Trigger28 = Command = "CPU28"
Trigger29 = Command = "CPU29"
Trigger30 = Command = "CPU30"
Trigger31 = Command = "CPU31"
Trigger32 = Command = "CPU32"
Trigger33 = Command = "CPU33"
Trigger34 = Command = "CPU34"
Trigger35 = Command = "CPU35"
Trigger36 = Command = "CPU36"
Trigger37 = Command = "CPU37"
Trigger38 = Command = "CPU38"
Trigger39 = Command = "CPU39"
Trigger40 = Command = "CPU40"
Trigger41 = Command = "AI_41"
Trigger42 = Command = "AI_42"
Trigger43 = Command = "AI_43"
Trigger44 = Command = "AI_44"
Trigger45 = Command = "AI_45"
Trigger46 = Command = "AI_46"
Trigger47 = Command = "AI_47"
Trigger48 = Command = "AI_48"
Trigger49 = Command = "AI_49"
Trigger50 = Command = "AI_50"
Trigger51 = NumHelper(9000) != 0
Trigger51 = Helper(9000),var(1) = 1
Trigger52 = Var(1) = 11
V = 1
Value = 1

[State -3]
Type = ChangeState
TriggerAll = Var(1) = 1 && Var(2) = [4,5]
Trigger1 = RoundState = 3
Trigger1 = Ctrl
Value = 1020

[State -3, AI]
Type = VarSet
TriggerAll = Var(1) = 1
Trigger1 = Life <= 0
Trigger2 = RoundState = 3
V = 1
Value = 11

[State -3]
Type = Helper
TriggerAll = Var(1) = 0
TriggerAll = NumHelper(9000) = 0
TriggerAll = Ctrl && StateNo = 0
TriggerAll = RoundState = 2
Trigger1 = PrevStateNo = 191 || PrevStateNo=5900
StateNo = 9000
PosType = P1
Pos = 0, 0
KeyCtrl = 1
Ownpal = 1
ID = 9000
IgnoreHitPause = 1
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -3]
type=changestate
trigger1= ishelper(9000)
trigger1= stateno!=9000
value=9000

;==============================================================================
;　VeryEasy
;==============================================================================
[State -3]
Type = ChangeState
Trigger1 = Var(1) = 1 && Var(2) = [1,2]
Trigger1 = Var(5)%6 = 0
Trigger1 = command = "a" || command = "x"
Trigger1 = ctrl
Value = 1500
[State -3]
Type = ChangeState
Trigger1 = Var(1) = 1 && Var(2) = [1,2]
Trigger1 = Var(5)%6 = 0
Trigger1 = command = "b" || command = "y"
Trigger1 = ctrl
Value = 1450
;==============================================================================
;　Easy
;==============================================================================
[State -3]
Type = ChangeState
TriggerAll = Var(1) = 1 && Var(2) = [2,3]
TriggerAll = ctrl
Trigger1 = Command="start+a" && Var(20) > 0 && Var(5)%6 != 0
Trigger2 = Command="start+b" && Var(21) > 0 && Var(5)%6 != 1
Trigger3 = Command="start+c" && Var(22) > 0 && Var(5)%6 != 2
Trigger4 = Command="start+x" && Var(23) > 0 && Var(5)%6 != 3
Trigger5 = Command="start+y" && Var(24) > 0 && Var(5)%6 != 4
Value = 1020
[State -3]
Type = ChangeState
Trigger1 = Var(1) = 1 && Var(2) = [1,2]
Trigger1 = Var(5)%6 != 0 && Var(5)%6 != 5
Trigger1 = command = "a" || command = "x"
Trigger1 = ctrl
Value = 1300
[State -3]
Type = ChangeState
Trigger1 = Var(1) = 1 && Var(2) = [1,2]
Trigger1 = Var(5)%6 != 0 && Var(5)%6 != 5
Trigger1 = command = "b" || command = "y"
Trigger1 = ctrl && power >= 1000
Value = 1150
[State -3]
Type = ChangeState
Trigger1 = Var(1) = 1 && Var(2) = [1,2]
Trigger1 = Var(5)%6 != 0 && Var(5)%6 != 5
Trigger1 = command = "c" || command = "z"
Trigger1 = ctrl
Value = 1400
;==============================================================================
;　Hard
;==============================================================================
[State -3]
Type = ChangeState
Trigger1 = Var(1) = 1 && Var(2) = 3
Trigger1 = Var(5)%6 = 0
Trigger1 = EnemyNear,MoveType = A
Trigger1 = ctrl
Value = 1500
[State -3]
Type = ChangeState
Trigger1 = Var(1) = 1 && Var(2) = 3
Trigger1 = Var(5)%6 = 0
Trigger1 = EnemyNear,Ctrl = 0 && (EnemyNear,MoveType != H || EnemyNear,StateNo = [120,159])
Trigger1 = ctrl && EnemyNear,StateNo != [5120,5299]
Value = ifelse(random%12<7,1450,1500)
[State -3]
Type = ChangeState
Trigger1 = Var(1) = 1 && Var(2) = [3,4]
Trigger1 = Var(5)%6 != 0 && Var(5)%6 != 5
Trigger1 = Var(20) <= 5000
Trigger1 = ctrl && power >= 1000
Value = 1150
[State -3]
Type = ChangeState
Trigger1 = Var(1) = 1 && Var(2) = [3,4]
Trigger1 = Var(5)%6 != 0 && Var(5)%6 != 5
Trigger1 = EnemyNear,MoveType = A
Trigger1 = ctrl
Value = 1300
[State -3]
Type = ChangeState
Trigger1 = Var(1) = 1 && Var(2) = [3,4]
Trigger1 = Var(5)%6 != 0 && Var(5)%6 != 5
Trigger1 = EnemyNear,Ctrl = 1
Trigger1 = ctrl
Value = 1400
[State -3]
Type = ChangeState
Trigger1 = Var(1) = 1 && Var(2) = 3
Trigger1 = Var(5)%6 =  5
Trigger1 = EnemyNear,MoveType = A
Trigger1 = ctrl
Value = ifelse(power >= 3000,1250,1200)
[State -3]
Type = ChangeState
Trigger1 = Var(1) = 1 && Var(2) = 3
Trigger1 = Var(5)%6 = 5
Trigger1 = EnemyNear,Ctrl = 1
Trigger1 = ctrl && power >= 3000
Value = 1100
;==============================================================================
;　Insane
;==============================================================================
[State -3]
Type = ChangeState
Trigger1 = Var(1) = 1 && Var(2) = [4,5]
Trigger1 = Var(5)%6 = 0
Trigger1 = EnemyNear,MoveType = A
Trigger1 = ctrl
Value = ifelse(power >= 3000 || (Var(2)=5&&random%12<=5),1550,1500)
[State -3]
Type = ChangeState
Trigger1 = Var(1) = 1 && Var(2) = [4,5]
Trigger1 = Var(5)%6 = 0
Trigger1 = EnemyNear,Ctrl = 0 && (EnemyNear,MoveType != H || EnemyNear,StateNo = [120,159])
Trigger1 = ctrl && EnemyNear,StateNo != [5120,5299]
Value = ifelse((Var(2)=5&&random%12<=5),1550,1450)
[State -3]
Type = ChangeState
Trigger1 = Var(1) = 1 && Var(2) = [4,5]
Trigger1 = Var(5)%6 =  5
Trigger1 = EnemyNear,MoveType = A
Trigger1 = ctrl
Value = ifelse(Var(2) = 5,1250,1200)
[State -3]
Type = ChangeState
Trigger1 = Var(1) = 1 && Var(2) = [4,5]
Trigger1 = Var(5)%6 = 5
Trigger1 = EnemyNear,Ctrl = 1 && Var(20) < EnemyNear,Life*10
Trigger1 = ctrl && (power >= 3000 || Var(2) = 5)
Value = 1100
[State -3]
Type = ChangeState
TriggerAll = Var(1) = 1 && Var(2) = [4,5]
TriggerAll = ctrl
Trigger1 = Var(5)%6 = 0 && Var(21)+Var(22)+Var(23)+Var(24)+Var(26)>0 && Var(20) = [1,5000] 
Trigger2 = Var(5)%6 = 1 && Var(20) = [1,100]
Trigger3 = Var(5)%6 = 2 && Var(20) = [1,100]
Trigger4 = Var(5)%6 = 3 && Var(20) = [1,100]
Trigger5 = Var(5)%6 = 4 && Var(20) = [1,100]
Trigger6 = Var(5)%6 = 5 && Var(20) = [1,300]
Value = 1020
;==============================================================================
;　Lunatic
;==============================================================================
[State -3]
Type = ChangeState
Trigger1 = Var(1) = 1 && Var(2) = 5
Trigger1 = Var(5)%6 != 0 && Var(5)%6 != 5
Trigger1 = EnemyNear,MoveType = A
Trigger1 = ctrl
Value = 1300
[State -3]
Type = ChangeState
Trigger1 = Var(1) = 1 && Var(2) = 5
Trigger1 = Var(5)%6 != 0 && Var(5)%6 != 5
Trigger1 = Var(20) <= 5000
Trigger1 = ctrl
Value = 1150

;==============================================================================
;　アーマー
;==============================================================================
[State -3, VarSet]
Type = VarAdd
TriggerAll = IsHelper = 0
Trigger1 = Var(27) != 0
Trigger1 = Var(5)%6 = 0
V = 20
Value= floor(Var(27))
[State -3, VarSet]
Type = VarAdd
TriggerAll = IsHelper = 0
Trigger1 = Var(27) != 0
Trigger1 = Var(5)%6 = 1
V = 21
Value= floor(Var(27))
[State -3, VarSet]
Type = VarAdd
TriggerAll = IsHelper = 0
Trigger1 = Var(27) != 0
Trigger1 = Var(5)%6 = 2
V = 22
Value= floor(Var(27))
[State -3, VarSet]
Type = VarAdd
TriggerAll = IsHelper = 0
Trigger1 = Var(27) != 0
Trigger1 = Var(5)%6 = 3
V = 23
Value= floor(Var(27))
[State -3, VarSet]
Type = VarAdd
TriggerAll = IsHelper = 0
Trigger1 = Var(27) != 0
Trigger1 = Var(5)%6 = 4
V = 24
Value= floor(Var(27))
[State -3, VarSet]
Type = VarAdd
TriggerAll = IsHelper = 0
Trigger1 = Var(27) != 0
Trigger1 = Var(5)%6 = 5
V = 26
Value= floor(Var(27))

[State -3, VarSet]
Type = VarSet
Trigger1 = Var(27) != 0
V = 27
Value= 0