;===========================================
;	立ち弱攻撃
;===========================================
[StateDef 200]
type     = S
movetype = A
physics  = S
juggle   = 1
velset   = 0,0
ctrl     = 0
;anim     = 200
sprpriority = 2
facep2   = ifelse(PrevStateNo = 2222,0,1)

[State -2,中攻撃]
type = Varadd
triggerall = PrevStateNo != 2222
trigger1 = Time = 0
var(1) = 1

[State 200, アーマーステートから来たのでなければアニメ200を一枚目から]
type = ChangeAnim
triggerall = PrevStateNo != 2222
trigger1 = Time = 0
value = 200

[State 200,アーマーステートから来たのならアニメ200をvar(3)枚目から];
type = ChangeAnim
triggerall = PrevStateNo = 2222
trigger1 = Time = 0
value = 200
elem = var(17)

[State 200]
type = PlaySnd
trigger1 = Time = 2
value = s0,0

[State 200]
type = HitDef
trigger1 = AnimElem = 3
trigger1 = var(30) = 0
attr              = S, NA
damage            = 20,0
animtype          = Light
getpower          = ifelse(var(1) <= 49,25,20),ifelse(var(1) <= 49,15,10)
guardflag         = MA
hitflag           = MAF
priority          = 3,Hit
pausetime         = 6,11
sparkxy           = -10,-25
hitsound          = s0,3
guardsound        = 0,10
ground.type       = High
ground.slidetime  = 6
ground.hittime    = 15
ground.velocity   = -4.6,0
airguard.velocity = -1.9,-0.8
air.type          = High
air.velocity      = -1.4,-3
air.hittime       = 17

[State 200]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1


;===========================================
;	立ち中攻撃
;===========================================
[Statedef 205]
type     = S
movetype = A
physics  = S
juggle   = 1
velset   = 0,0
ctrl     = 0
;anim     = 205
sprpriority = 2
facep2   = ifelse(PrevStateNo = 2222,0,1)

[State -2,中攻撃]
type = Varadd
triggerall = PrevStateNo != 2222
trigger1 = Time = 0
var(1) = 3

[State 200, ChangeAnim]		;アーマーステートから来ていない場合はアニメを普通に設定
type = ChangeAnim
triggerall = PrevStateNo != 2222
trigger1 = Time = 0
value = 205

[State 200, ChangeAnim]		;アーマーステートから来ている場合は格納済みのAnimElemNoから開始
type = ChangeAnim
triggerall = PrevStateNo = 2222
trigger1 = Time = 0
value = 205
elem = var(17)


[State 205]
type = PlaySnd
trigger1 = AnimElem = 4
value = s0,1

[State 205]
type = PlaySnd
trigger1 = AnimElem = 9
value = s0,2

[State 205]
type = VelSet
trigger1 = AnimElem >= 10
x = 5.5

[State 205,]
type = HitDef
trigger1 = AnimElem = 5
trigger1 = var(30) = 0
attr              = S, NA
damage            = 40,0
animtype          = Light
getpower          = ifelse(var(1) <= 49,50,40),ifelse(var(1) <= 49,20,10)
guardflag         = MA
hitflag           = MAF
priority          = 3,Hit
pausetime         = 6,14
sparkxy           = -10,-35
hitsound          = s0,4
guardsound        = 0,10
ground.type       = High
ground.slidetime  = 6
ground.hittime    = 20
ground.velocity   = -4.6,0
airguard.velocity = -1.9,-0.8
air.type          = High
air.velocity      = -1.4,-3
air.hittime       = 22


[State -3, AI]
type = MoveHitReset
TriggerAll = Var(59) >= 1
trigger1 = Time = 26
Trigger1 = MoveContact


[State 205, 2]
type = HitDef
trigger1 = AnimElem = 10
attr              = S, NA
damage            = 60,0
animtype          = Hard
getpower          = ifelse(var(1) <= 49,70,55),ifelse(var(1) <= 49,20,10)
guardflag         = HA
hitflag           = MAF
priority          = 3,Hit
pausetime         = 6,20
sparkxy           = -10,-76
hitsound          = s0,5
guardsound        = 0,10
ground.type       = High
ground.slidetime  = 6
ground.hittime    = 20
ground.velocity   = -4.6,0
airguard.velocity = -1.9,-0.8
air.type          = High
air.velocity      = -1.4,-3
air.hittime       = 22

[State 205, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;===========================================
;	立ち強攻撃
;===========================================
[Statedef 210];強攻撃
type     = S
movetype = A
physics  = S
velset   = 0,0
ctrl     = 0
facep2   = ifelse((PrevStateNo != 2222)&&(PrevStateNo != 211),1,0)
;anim     = 210

[State -2,強攻撃]
type = Varadd
triggerall = PrevStateNo != 2222
triggerall = PrevStateNo != 211
trigger1 = Time = 0
var(1) = 3

[State 200, ChangeAnim]		;アーマーステートから来ている場合は格納済みのAnimElemNoから開始
type = ChangeAnim
triggerall = PrevStateNo != 2222
triggerall = PrevStateNo != 211
trigger1 = Time = 0
value = 210

[State 200, ChangeAnim]		;アーマーステートから来ている場合は格納済みのAnimElemNoから開始
type = ChangeAnim
triggerall = Time = 0
trigger1 = PrevStateNo = 2222
trigger2 = PrevStateNo = 211
value = 210
elem = var(17)

[State 210]
type = HitOverride
trigger1 = AnimElem = 1, >=0
trigger1 = AnimElem = 11, <0
attr = SCA, NA, SA, HA, NP, SP, HP
time = 5
stateno = 211

[State 210,]
type = PlaySnd
trigger1 = AnimElem = 7
value = s0,6

[State 210,]
type = PlaySnd
trigger1 = AnimElem = 11
value = s0,8

[State 210, ]
type = HitDef
triggerAll = MoveContact =0
trigger1 = AnimElem = 9, >=0
trigger1 = AnimElem = 11, <0
attr              = S, NA
damage            = 80,20
animtype          = Hard
getpower          = 0,0
givepower         = 300,150
guardflag         = HA
hitflag           = MAFP
pausetime         = 10,10
sparkxy           = -10,-70
hitsound          = s0,7
guardsound        = 0,10
ground.type       = Trip
ground.slidetime  = 13
ground.hittime    = 15
air.velocity      = 0,5
;p2stateno    = 5100
;p2getp1state=0
id = 210

[State 210]
type = TargetState
triggerall = numtarget(210)
trigger1 = MoveHit
trigger1 = target(210), stateno != 212
value = 212
id = 210
;ignorehitpause = 1
persistent = 0

[State 210]
type = EnvShake
trigger1 = AnimElem = 12
time  = 18
ampl  = 6
freq  = 176 
phase = 100

[State 210]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;===========================================
;	強攻撃アーマー
;===========================================

[Statedef 211]
type =U
movetype = H
physics = N
ctrl = 0
sprpriority = 2
movehitpersist = 1

[State 211]
type = LifeAdd
trigger1 = alive
trigger1 = life > 0
value = -ceil(Gethitvar(damage)/3)
ignorehitpause = 1
persistent = 0

[State 211]
type = PalFX
trigger1 = Time = 0
time = 5
add = 250,20,20

[State 211]
type = changestate
trigger1 = !alive
value = 5050
ignorehitpause = 1

[State 211]
type = VarAdd
trigger1 = Time = 0
var(17) = 1
ignorehitpause = 1

[State 211]
type = ChangeState
trigger1 = Time >= 0
;trigger1 = PrevStateNo = 210
value = 210


[Statedef 212]
type    = L
movetype= H
physics = N

[State 212, 1]
type = VelSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) = 0
trigger1 = vel x > 1
x = 1

[State 212, EnvShake]
type = FallEnvShake
trigger1 = Time = 0

[State 212, Var] ;Save fall velocity
type = VarSet
trigger1 = Time = 0
sysvar(1) = floor(vel y)

[State 212, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = (anim != [5051,5059]) && (anim != [5061,5069])
trigger2 = !SelfAnimExist(5100 + (anim % 10))
value = 5100

[State 212, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
trigger1 = time = 0
trigger1 = (anim = [5051,5059]) || (anim = [5061,5069])
trigger1 = SelfAnimExist(5100 + (anim % 10))
value = 5100 + (anim % 10)

[State 212, 4]
type = PosSet
trigger1 = Time = 0
y = 0

[State 212, 5]
type = VelSet
trigger1 = Time = 0
y = 0

[State 212, 6] ;Reduce speed
type = VelMul
trigger1 = Time = 0
x = 0.75

[State 212, 7]
type = SelfState
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) = 0
value = 5110 ;HIT_LIEDOWN

[State 212, 8]
type = GameMakeAnim
trigger1 = Time = 1
value = 60 + (sysvar(1) > 5) + (sysvar(1) > 14)
pos = 0, 0
under = sysvar(1) <= 14

[State 212, 9]
type = HitFallDamage
trigger1 = Time = 3

[State 212, 10]
type = PlaySnd
trigger1 = Time = 1
value = F7, (sysvar(1) > 5) + (sysvar(1) > 14)

[State 212, 11]
type = PosFreeze
trigger1 = 1

[State 212, 12]
type = SelfState
trigger1 = AnimTime = 0
value = 5101

[State 212, 13]
type = ForceFeedback
trigger1 = Time = 0
waveform = sinesquare
ampl = 128,-3,-.2,.005
time = 20

;===========================================
;	ジャンプ中攻撃
;===========================================
[Statedef 215]
type     = A
movetype = A
physics  = A
ctrl     = 0
anim     = 215

[State 210]
type = velset
trigger1 = AnimElem = 1, >= 0
trigger1 = AnimElem = 5, < 0
Y = 0

[State 210]
type = velset
trigger1 = AnimElem = 5
X = -3
Y = -8

[State 210]
type = velset
trigger1 = AnimElem = 7
X = 0

[State 210]
type = velset
trigger1 = AnimElem = 14
X = 13
Y = 12

[State 210,]
type = PlaySnd
trigger1 = AnimElem = 3
value = s0,21

[State 210,]
type = PlaySnd
trigger1 = AnimElem = 14
value = s0,22

[State 215]
type = NotHitBy
trigger1 = Time >= 0
value = , NP, SP, HP

[State -2]
type = Helper
trigger1 = numhelper(3035) = 0
trigger1 = Time >= 0
ID = 3035
name = "graze"
postype = P1
pos = 0,0
sprpriority = 2
stateno = 3035
helpertype = normal
keyctrl = 0
ownpal = 1

[State 205,]
type = HitDef
triggerAll = MoveContact =0
trigger1 = AnimElem = 15
attr              = A, NA
damage            = 60,10
animtype          = Light
getpower          = ifelse(var(1) <= 49,80,45),ifelse(var(1) <= 49,30,10)
guardflag         = HA
hitflag           = MAF
priority          = 3,Hit
pausetime         = 3,7
sparkxy           = -10,-35
hitsound          = s0,7
guardsound        = s0,23
ground.type       = High
ground.slidetime  = 6
ground.hittime    = 10
ground.velocity   = -2,-9
air.velocity = -6,-3
fall = 1
fall.recover = 0

;===========================================
;	ジャンプ中攻撃
;===========================================
[Statedef 216]
type     = S
movetype = A
physics  = S
veladd   = 0,0
ctrl     = 0
anim     = 216

[State 52, 1]
type = VelSet
trigger1 = Time = 0
y = 0

[State 52, 2]
type = PosSet
trigger1 = Time = 0
y = 0

[State 210]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1


;===========================================
;	ジャンプ強攻撃
;===========================================
[Statedef 220]
type     = A
movetype = A
physics  = A
ctrl     = 0
;anim     = 220

[State 210]
type = velset
trigger1 = time < 20
trigger2 = PrevStateNo != 222
X = 0
Y = 0

[State 210]
type = velset
trigger1 = time >= 20
trigger2 = PrevStateNo = 222
trigger2 = var(19) = 20
Y = 18

[State 210]
type = ChangeAnim
triggerall = Time = 0
trigger1 = var(19) <= 0
value = 220

[State 210]
type = ChangeAnim
triggerall = Time = 0
trigger1 = var(19) > 0
value = 220
elem = var(19)

[State 210]
type = VarAdd
trigger1 = AnimElem = 1
trigger2 = AnimElem = 2
trigger3 = AnimElem = 3
trigger4 = AnimElem = 4
trigger5 = AnimElem = 5
trigger6 = AnimElem = 6
trigger7 = AnimElem = 7
trigger8 = AnimElem = 8
trigger9 = AnimElem = 9
trigger10 = AnimElem = 10
trigger11 = AnimElem = 11
trigger12 = AnimElem = 12
trigger13 = AnimElem = 13
trigger14 = AnimElem = 14
trigger15 = AnimElem = 15
trigger16 = AnimElem = 16
trigger17 = AnimElem = 17
trigger18 = AnimElem = 18
trigger19 = AnimElem = 19
trigger20 = AnimElem = 20
var(19) = 1
ignorehitpause = 1

[State 210]
type = varset
trigger1 = var(19) > 20
var(19) = 20

[State 210]
type = HitOverride
triggerall = var(19) > 0
trigger1 = Time >= 0
attr = SCA, NA, SA, HA, NP, SP, HP
time = 5
stateno = 222

[State 210, ]
type = HitDef
triggerAll = MoveContact = 0
trigger1 = AnimElem = 16, >=0
attr              = A, NA
damage            = 130,50
animtype          = Hard
getpower          = 10,0
givepower         = 300,150
guardflag         = HA
hitflag           = MAFP
pausetime         = 5,5
sparkno           = 3
sparkxy           = -10,-20
hitsound          = s0,7
guardsound        = 0,10
ground.type       = Trip
ground.slidetime  = 13
ground.hittime    = 15
air.velocity      = 0,5
fall = 1
fall.recover = 0
id = 220

[State 210]
type = TargetState
triggerall = numtarget(220)
trigger1 = MoveHit
trigger1 = target(220), stateno != 223
value = 223
id = 220
;ignorehitpause = 1
persistent = 0

;===========================================
;	ジャンプ強攻撃着地
;===========================================
[Statedef 221]
type     = S
movetype = A
physics  = S
ctrl     = 0
;anim     = 221
sprpriority = 0

[State 200, アーマーステートから来たのでなければアニメ200を一枚目から]
type = ChangeAnim
triggerall = PrevStateNo != 2222
trigger1 = Time = 0
value = 221

[State 200,アーマーステートから来たのならアニメ200をvar(3)枚目から];
type = ChangeAnim
triggerall = PrevStateNo = 2222
trigger1 = Time = 0
value = 221
elem = var(18)


[State 221]
type = PlaySnd
triggerall = PrevStateNo != 222
trigger1 = time = 0
value = s0,8

[State 221]
type = LifeAdd
triggerall = PrevStateNo != 222
trigger1 = time = 0
trigger1 = alive
trigger1 = life > 0
value = -50
ignorehitpause = 1
persistent = 0

[State 222]
type = changestate
trigger1 = !alive
value = 5050
ignorehitpause = 1

[State 221]
type = Helper
trigger1 = time = 0
trigger1 = numhelper(3037) = 0
ID = 3037
name = "wave"
postype = p1
pos  = -5,-10
sprpriority = 2
stateno = 3037
helpertype = normal
keyctrl = 0
ownpal = 1

[State 221]
type = EnvShake
trigger1 = Time = 0
time  = 15
ampl  = 6
freq  = 176 
phase = 100

[State 221]
type = HitDef
trigger1 = MoveContact =0
trigger1 = AnimElem = 1,>= 0
trigger1 = AnimElem = 5,<= 10
attr              = S, NA
damage            = 40,20
animtype          = Hard
getpower          = 10,0
givepower         = 300,150
guardflag         = LA
hitflag           = MAFP-
pausetime         = 10,10
sparkno           = -1
hitsound          = s0,10
guardsound        = 0,10
ground.type       = Trip
ground.slidetime  = 13
ground.hittime    = 15
ground.velocity   = -10,3
air.velocity 	  = -10,-4
fall = 1
fall.recover = 0
id = 221

[State 210]
type = TargetState
triggerall = numtarget(221)
trigger1 = MoveHit
trigger1 = target(221), stateno != 223
value = 223
id = 221
;ignorehitpause = 1
persistent = 0


[State 221]
type = statetypeset
trigger1 = AnimElem = 6
movetype = I

[State 221]
type = VelSet
trigger1 = Time = 0
y = 0

[State 221]
type = PosSet
trigger1 = Time = 0
y = 0

[State 221]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;===========================================
;	ジャンプ強攻撃アーマー
;===========================================

[Statedef 222]
type =U
movetype = H
physics = N
ctrl = 0
sprpriority = 2
movehitpersist = 1

[State 222]
type = LifeAdd
trigger1 = alive
trigger1 = life > 0
value = -ceil(Gethitvar(damage)/3)
ignorehitpause = 1
persistent = 0

[State 222]
type = PalFX
trigger1 = Time = 0
time = 5
add = 250,20,20

[State 222]
type = changestate
trigger1 = !alive
value = 5050
ignorehitpause = 1

[State 222]
type = ChangeState
trigger1 = Time >= 0
trigger1 = Pos Y >= 0
value = 221

[State 222]
type = ChangeState
trigger1 = Time >= 0
value = 220

;---------------------------------------------------------------------------
;相手
[Statedef 223]
type    = A
movetype= H
physics = N
velset = 0,0

[State 5070, 1]
type = ChangeAnim 
trigger1 = 1
value = 5070

[State 5070, 2]
type = ChangeState
trigger1 = HitShakeOver
value = 224

[State 5070, 3]
type = ForceFeedback
trigger1 = time = 0
time = 12
waveform = sinesquare
ampl = 140

[Statedef 224]
type    = A
movetype= H
physics = N

[State 5071, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 1

[State 5071, 2] ;Acceleration
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5071, 3] ;Hit ground
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 15
type = ChangeState
value = 225

[Statedef 225]
type    = L
movetype= H
physics = N

[State 5110, EnvShake]
type = FallEnvShake
trigger1 = Time = 0

[State 5110, 1] ;For hit up/up-diag type (from state 5081)
type = ChangeAnim
persistent = 0
trigger1 = SelfAnimExist(5110 + (anim % 10))
trigger1 = anim = [5081,5089]
value = 5110 + (anim % 10)

[State 5110, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim != [5161,5169]
trigger2 = !SelfAnimExist(5170 + (anim % 10))
value = 5170

[State 5110, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim = [5161,5169]
trigger1 = SelfAnimExist(5170 + (anim % 10))
value = 5170 + (anim % 10)

[State 5110, 4]
type = HitFallDamage
trigger1 = Time = 0

[State 5110, 5]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5110, Var] ;Get fall velocity
type = VarSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) != 0
sysvar(1) = floor(vel y)

[State 5110, 6]
type = PlaySnd
trigger1 = Time = 0
trigger1 = !SysVar(0)
value = F7, (sysvar(1) > 5) + (sysvar(1) > 14)

[State 5110, 7]
type = GameMakeAnim
trigger1 = Time = 0
trigger1 = !SysVar(0)
value = 60 + (sysvar(1) > 5) + (sysvar(1) > 14)
pos = 0, 0
under = sysvar(1) <= 14

[State 5110, 8]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5110, 9] ;For hit up type
type = ChangeAnim
persistent = 0
triggerall = anim = [5171,5179]
triggerall = SelfAnimExist(5110 + (anim % 10))
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground anim
value = 5110 + (anim % 10)

[State 5110, 10] ;For normal
type = ChangeAnim
persistent = 0
triggerall = Anim != [5111,5119]
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
value = 5110

[State 5110, 11] ;If just died
type = SelfState
triggerall = !alive
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
trigger3 = Anim = [5110,5119]
value = 5150

[State 5110, 12]
type = VarSet
trigger1 = SysVar(0)
trigger1 = Time = 0
sysvar(0) = 0

[State 5110, 13] ;Friction
type = VelMul
trigger1 = 1
x = 0.85

[State 5110, 14]
type = ForceFeedback
trigger1 = alive
trigger1 = Time = 0
time = 8
ampl = 240
waveform = sine

[State 5110, 15]
type = ForceFeedback
trigger1 = !alive
trigger1 = Time = 0
ampl = 200, 7, -.467
time = 30
waveform = sine

[State 5110, 11]
type = SelfState
trigger1 = Time >= 60
value = 5120


;===========================================
;	その他アーマー
;===========================================

[Statedef 2222]
type = U
movetype = H
physics = N
ctrl = 0
sprpriority = 2
movehitpersist = 1

[State 211, PalFX]
type = PalFX
trigger1 = Time = 0
time = 5
add = 250,20,20
ignorehitpause = 1

[State 9999, PosFreeze]
type = PosFreeze
trigger1 = 1
value = 1
ignorehitpause = 1

[State 222]
type = LifeAdd
trigger1 = alive
trigger1 = life > 0
value = floor(-Gethitvar(damage)*0.9)
ignorehitpause = 1
persistent = 0

[State 211]
type = ChangeState
trigger1 = Time >= 0
value = var(15)
ctrl = var(16)
ignorehitpause = 1