

;-2
[StateDef -2]


; -----------------------------------------------
; ------------------------------
; 监测R0 - R4各个阶段的帧数
[state ccc] ; R0
type = varadd
triggerall = !ishelper
trigger1 = roundstate = 0
var(7) = 1
ignorehitpause = 1



[state ccc] ; R1
type = varadd
triggerall = !ishelper
trigger1 = roundstate = 1
var(8) = 1
ignorehitpause = 1


[state ccc] ; R3
type = varadd
triggerall = !ishelper
trigger1 = roundstate = 3
var(9) = 1
ignorehitpause = 1


[state ccc] ; R4
type = varadd
triggerall = !ishelper
trigger1 = roundstate = 4
var(10) = 1
ignorehitpause = 1




;------------------------------------------------------------------------
;-----------------------------------------------------------------------

;召唤 56个helper，为直死做准备

[State -2, Helper]
type = Helper
trigger1 = root,var(0) < 56
helpertype = player
name = "hehe"
ID = 110
stateno = 789
supermovetime = 99999999
pausemovetime = 99999999
ignorehitpause = 1



[State -2, HelperMax统计]
Type = Null
Trigger1 = !NumPartner
Trigger1 = var(0) := (var(0) | NumHelper + Enemy,NumHelper + Enemy(NumEnemy > 1),NumHelper * (NumEnemy > 1))
Trigger2 = NumPartner
Trigger2 = var(0) := (var(0) | NumHelper + Partner,NumHelper + Enemy,NumHelper + Enemy(NumEnemy > 1),NumHelper * (NumEnemy > 1))
IgnorehitPause = 1



; -------------------------------------

;时止
[state 1]
type = pause
trigger1 = !sysvar(0)
time = 2
movetime = 2
UnHittable = 0
ignorehitpause = 1
[state 2]
type = superpause
trigger1 = !sysvar(0)
anim = -1
time = 2
movetime = 2
UnHittable = 0
darken = 0
p2defmul = 1
ignorehitpause = 1


; sysvar(0) 为 是否直死的开关（flag）。0为开，1为关

[state ]
type = varset
triggerall = !ishelper
trigger1 = !enemy,alive
sysvar(0) = 1
ignorehitpause = 1

[state ]
type = varset
triggerall = !ishelper
trigger1 = enemy,alive
sysvar(0) = 0
ignorehitpause = 1


[state ] ; sysvar(0)为0时候，即“开”。进入直死前的攻击状态（获取hitpausetime）
type = SelfState
triggerall = !ishelper
trigger1 = !sysvar(0)
value = 666777
persistent = 256
ignorehitpause = 1

[state ] ; sysvar(0)为1时候，即“关”。此时进入 170 安全状态（常态）
type = SelfState
triggerall = !ishelper
trigger1 = sysvar(0)
value = 170
persistent = 256
ignorehitpause = 1



; helper统一进入 受击状态  （为直死做准备）
[state ]
type = SelfState
triggerall = ishelper
trigger1 = 1
value = 789       ; 受击状态
ignorehitpause = 1





;---------------------------------

; 直死前的攻击状态（获取hitpausetime）

;攻击获取hitpausetime
[statedef 666777]
type    = S
movetype= A
physics = S

[State anim变更]
type = Changeanim
triggerall = !ishelper
trigger1 = 1
value = 999110
ignorehitpause = 1



[State 凍結用hitdef] ; 获取hitpausetime（冻结）用
type = HitDef
triggerall =!hitpausetime
trigger1 = 1
attr =,AA,AT,SA
damage = 0,0
numhits = 0
pausetime = 233333333333,0
sparkno = -1
guard.sparkno = -1
affectteam = F
ignorehitpause = 1

;直死
[state ]
type = SelfState
triggerall = hitpausetime
trigger1 = !sysvar(0)
value = 666
persistent = 256
ignorehitpause = 1


; 在攻击过程中，不能跳走。除非条件不同。否则跳转的优先级 高于 hitdef。
; 也有一种可能：hitpausetime必须和下方的helper碰撞后才能产生，而此时已经转走了。 这种可能 有待实践
;[state ]
;type = SelfState
;triggerall = !hitpausetime
;trigger1 = 1
;value = 170
;persistent = 256
;ignorehitpause = 1


;-----------------------------------

; 受击
[Statedef 789]
type = U
movetype = U
physics = U
movehitpersist = 1
hitdefpersist = 1

[State 789, 1]
type = ChangeAnim
trigger1 = Anim != 789110
value = 789110

[State -2];BGM禁止
type = AssertSpecial
trigger1 = 1
flag = nomusic
supermovetime = 9999999999999
pausemovetime = 9999999999999

[State 789, 不可控]
type = Ctrlset
trigger1 = ishelper(110)
value = 0
ignorehitpause = 1

[State 789, helper透明化]
type = AssertSpecial
trigger1 = ishelper(110)
flag = invisible
flag2 = noshadow
ignorehitpause = 1

[State 789, lifeset]
type = Lifeset
trigger1 = ishelper(110)
value = 9999999999999
ignorehitpause = 1

[State 789, 镜头固定]
type = Screenbound
trigger1 = ishelper(110)
value = 0
ignorehitpause = 1

[State 789, 绑定根级]
type = Bindtoroot
trigger1 = ishelper(110)
pos = 0, 0
ignorehitpause = 1

[State 789, 挤压设定]
type = Playerpush
trigger1 = ishelper(110)
value = 1
ignorehitpause = 1

[State 789, helper转向设定]
type = Turn
triggerall = ishelper(110)
trigger1 = facing != root,facing
ignorehitpause = 1

[State 789, 装甲]
type = Hitoverride
trigger1 = ishelper(110)
time = -1
slot = 1
attr = SCA, AA, AT, AP
stateno = 789
ignorehitpause = 1



; 准固定
[state ]
type = changestate
trigger1 = 1
value = 170
persistent = 256
ignorehitpause = 1


