[Statedef -3]
;---------------------------
[State 常时AI]
type = Varset
trigger1 = !ishelper
trigger1 = !var(59)
trigger1 = roundstate < 3
trigger1 = alive
trigger1 = 0      ;← 0：Off，1：On 开启后常时启动AI，要手操的请关闭
var(59) = 1
ignorehitpause = 1

[State 开幕狂化]
type = Varset
trigger1 = !ishelper
trigger1 = !var(5) && !(floor(fvar(9)) & 1)
trigger1 = alive      
trigger1 = 0       ;← 0：Off，1：On 开启后开幕进入狂化状态
fvar(9) = floor(fvar(9)) | 1
ignorehitpause = 1

[State 狂化附加设定]
type = Null
trigger1 = 0       ;← 0：Off，1：On 狂化封印：开启后将无法进入狂化状态(开幕狂化等特殊情况不受此设定影响)
trigger2 = 0       ;← 0：Off，1：On 二阶段狂化：开启后在狂化状态下死亡会进入二阶段
trigger3 = 0       ;← 0：Off，1：On 二阶段攻击强化：开启后在二阶段时会随时间提升攻击面并解禁超即死
trigger4 = 0       ;← 0：Off，1：On 二阶段防御强化：开启后二阶段削血难度提升
trigger5 = 0       ;← 0：Off，1：On 直接进入二阶段：开启后普通狂化变为二阶段狂化



trigger1 = fvar(9) := (floor(fvar(9)) | 4) && 0
trigger2 = fvar(9) := (floor(fvar(9)) | 2) && 0
trigger3 = fvar(9) := (floor(fvar(9)) | 8) && 0
trigger4 = fvar(9) := (floor(fvar(9)) | 16) && 0
trigger5 = fvar(9) := (floor(fvar(9)) | 32) && 0
triggerall = !ishelper
triggerall = !var(5)
triggerall = alive
ignorehitpause = 1







;---------------------------
[State ]
type = Varset
trigger1 = !ishelper
sysvar(2) = gametime + 450 * 100
ignorehitpause = 1

[State ]
type = Varset
trigger1 = !ishelper
trigger1 = !sysfvar(4)
trigger1 = var(6)
trigger1 = stateno != 2000
trigger1 = movetype != H
var(6) = 0
ignorehitpause = 1



[State Level]
type = Varset
trigger1 = !ishelper
;trigger1 = !sysfvar(4)
trigger1 = !fvar(5)
fvar(5) = palno
ignorehitpause = 1


[State AI连段限制]
type = Varset
triggerall = !ishelper
;triggerall = !sysfvar(4)
;trigger1 = !numtarget
trigger1 = enemynear(!enemynear,alive && numenemy > 1),movetype != H || enemynear(!enemynear,alive && numenemy > 1),stateno != [5000,5149]
trigger1 = enemynear,statetype != L || enemynear,stateno != [5000,5149]
trigger1 = sysvar(4) < 200 || movetype != A
fvar(6) = 20
ignorehitpause = 1

[State AI连段限制]
type = Varadd
triggerall = !ishelper
triggerall = !sysfvar(4)
triggerall = sysvar(3) = 0 || sysvar(4) < 3100
triggerall = !var(5)
trigger1 = sysvar(4) = 3100
trigger2 = sysvar(4) = 3200
trigger3 = sysvar(4) = 3300
trigger4 = sysvar(4) = 3400
trigger5 = sysvar(4) = 3700
trigger6 = (sysvar(4) = [3600,3604]) && projhit = 1
trigger7 = (movehit = 1) && !hitpausetime; || projhit = 1
fvar(6) = -(1 + 9 * (sysvar(4) >= 3100) + 10 * (sysvar(4) >= 3300))
ignorehitpause = 1

[State AI连段限制]
type = Varadd
triggerall = !ishelper
triggerall = !sysfvar(4)
triggerall = sysvar(3) = 0 || sysvar(4) < 3100 || sysvar(4) = [3600,3604]
triggerall = var(5) && !var(12)
trigger1 = sysvar(4) = 3100
trigger2 = sysvar(4) = 3200
trigger3 = sysvar(4) = 3300
trigger4 = sysvar(4) = 3400
trigger5 = sysvar(4) = 3700
trigger6 = (sysvar(4) = [3600,3604]) && projhit = 1
fvar(6) = -(2 + 4 * (sysvar(4) != [3600,3604]))
ignorehitpause = 1

[State AI连段限制]
type = Varadd
triggerall = !ishelper
triggerall = !sysfvar(4)
triggerall = sysvar(3) = 0 || sysvar(4) < 3100 || sysvar(4) = [3600,3604]
triggerall = var(5) && var(12)
trigger1 = sysvar(4) = 3100
trigger2 = sysvar(4) = 3200
trigger3 = sysvar(4) = 3300
trigger4 = sysvar(4) = 3400
trigger5 = sysvar(4) = 3900
trigger6 = sysvar(4) = 4200
trigger7 = (sysvar(4) = [3600,3604]) && projhit = 1
fvar(6) = ifelse((sysvar(4) = [3600,3604]), -3, -5)
ignorehitpause = 1

[State AI连段限制]
type = Varset
triggerall = !ishelper
triggerall = !sysfvar(4)
trigger1 = fvar(6) < 0
fvar(6) = 0
ignorehitpause = 1






[State ]
type = Varset
trigger1 = !ishelper
fvar(0) = p2bodydist x - enemynear,vel x
ignorehitpause = 1

[State ]
type = Varset
trigger1 = !ishelper
fvar(1) = p2bodydist y + enemynear,vel y
ignorehitpause = 1

[State ]
type = Varset
trigger1 = !ishelper
fvar(2) = p2bodydist x
ignorehitpause = 1

[State ]
type = Varset
trigger1 = !ishelper
fvar(3) = p2bodydist y
ignorehitpause = 1