;---------------------------------------------------------------------------
; States that are always checked (use -2) :
;---------------------------------------------------------------------------

[Statedef -2]

; Play "heh" sound when recovering in air or on ground
[State -2, 1]
type = PlaySnd
triggerall = name = "Karin"
triggerall = Time = 1
trigger1 = stateno = 5201
trigger2 = stateno = 5210
value = S3,4
channel = 0

; Play sound of hopping
[State -2, 1]
type = PlaySnd
triggerall = name = "Karin"
triggerall = time = 1
triggerall = animelem = 1
trigger1 = stateno = 101
trigger2 = stateno = 106
value = S0,27

; Get rid of trailing anims when hit
[State -2, 1]
type = AfterImageTime
;triggerall = name = "Karin"
trigger1 = Movetype = H
time = 0
ignorehitpause = 1

[State -2, Hurt Sound Randomizer]
type = VarRandom
trigger1 = 1
triggerall = name = "Karin"
triggerall = name = "Karin"
v = 7
range = 0,2

[State -2, Ow Sound]
type = PlaySnd
triggerall = alive && time = 1
triggerall = name = "Karin"
trigger1 = stateno = 5001 || stateno = 5011
trigger1 = random < ifelse ((anim % 10) = 1, 400, 750)
trigger2 = stateno = 5040 || stateno = 5050
trigger2 = random < 500
trigger3 = stateno = 5070
trigger4 = stateno = 5100 && random < 250
value = S2,var(7)
channel = 0

[State determiner]
type = varset
trigger1 = name = "Karin"
var(1) = 1
ignorehitpause = 1

[state heh]
type = null;displaytoclipboard
triggerall = name = "Karin"
trigger1 = 1 ;var(1) = 1 && var(10) != 0
text = "Karin can counter and guardcanel any enemy's attack with anim %d. | Hit counter = %d | explod for = %d"
params = var(10), var(12), (7023 + ((helper(6000), var(41)) * 10) + (helper(6000), var(41)))
ignorehitpause = 1

[state hehe]
type = playerpush
triggerall = name = "Karin"
trigger1 = winko
value = 0
ignorehitpause = 1

[state haha]
type = stopsnd
triggerall = name = "Karin"
trigger1 = movetype = h && prevstateno = 500
channel = 4
ignorehitpause = 1

[state haha]
type = attackmulset
triggerall = name = "Karin"
trigger1 = var(1) = 1
value = .75
ignorehitpause = 1



[state ahhahahaha]
type = varset
triggerall = name = "Karin"
trigger1 = p2stateno = 2101 && var(59) = 0 && p2name = "Shadow DIO"
var(59) = 1
persistent = 0
ignorehitpause = 1

[state killer]
type = varadd
triggerall = name = "Karin"
trigger1 = var(59) >= 1 && var(59) < 112 && p2name = "Shadow DIO"
var(59) = 1
ignorehitpause = 1

[state ahhahahaha]
type = varset
triggerall = name = "Karin"
triggerall = p2name = "Shadow DIO"
trigger1 = var(59) >= 111 ;&& p2stateno != 2101
trigger2 = p2stateno = 2100
var(59) = 0
ignorehitpause = 1

[state haha]
type = removeexplod
triggerall = name = "Karin"
trigger1 = p2stateno != 256 && p2movetype != H
trigger2 = p2stateno >= 5100
id = 286
ignorehitpause = 1

[state haha]
type = varset
triggerall = name = "Karin"
trigger1 = 1 && statetype = A && stateno != 471
fvar(1) = vel X
ignorehitpause = 1

[state haha]
type = varset
triggerall = name = "Karin"
trigger1 = 1 && statetype = A && stateno != 471
fvar(2) = vel Y
ignorehitpause = 1

[state haha]
type = assertspecial
triggerall = name = "Karin"
trigger1 = 1 && stateno = 361
flag = nostandguard
flag2 = nocrouchguard
ignorehitpause = 1

[state mmm]
type = nothitby
triggerall = name = "Karin"
trigger1 = prevstateno = [5120,5129]
trigger1 = time = [0,2]
trigger1 = movetype = A || movetype = H
value = SCA
time = 20
ignorehitpause = 1
persistent = 0

