;---------------------------------------------------------------------------
; Initialize (at the start of the round)
[Statedef 5900]
type = S
[State 5900, 1] ;Clear all int variables
type = VarRangeSet
trigger1 = roundsexisted = 0
value = 0
[State 5900, 2] ;Clear all float variables
type = VarRangeSet
trigger1 = roundsexisted = 0
fvalue = 0
[State 68000, Helper]
type = Helper
trigger1 = !roundsexisted
name = "Grimmchild"
ID = 68000
stateno = 68000
pos = -40,-30
postype = p1
facing = 1
ownpal = 1
[State 68000, Helper]
type = Helper
trigger1 = !roundsexisted > 2
name = "Grimmchild"
ID = 68001
stateno = 68001
pos = -40,-30
postype = p1
facing = 1
ownpal = 1
[State 5900, 3] ;Change palette
type = RemapPal
trigger1 = 1
source = 1,1
dest = 1,palno
[State 5900, 4] ;Intro for round 1
type = ChangeState
trigger1 = roundno = 1
value = 190
[State 5900, turnsintro]
type = changestate
trigger1 = teammode = turns
trigger1 = !roundsexisted && roundno >= 2
value = 190
[State 5900, 5] ;All other rounds
type = ChangeState
trigger1 = 1
value = 0
;--------------------------------------------------------------------------
;Grimmchild Appear
[Statedef 68000]
type = S
movetype = I
anim = 68004
velset = 0
sprpriority = 0
[State 0, Turn] ;Grimmchild should always be facing the same way as ghost
type = Turn
trigger1 = facing != root, facing
[State 68000, Screen]
type = ScreenBound
trigger1 = 1
value = 0;1
[State 68000, Changestate]
type = ChangeState
trigger1 = !roundsexisted && roundno >= 2
trigger2 = animelem = 9
value = 68001
;--------------------------------------------------------------------------
;Grimmchild Idle
[Statedef 68001]
type = S
movetype = I
anim = 68000
velset = 0
sprpriority = 0
[State 0, DisplayToClipboard]
type = DisplayToClipboard
trigger1 = 1
text = "p2bodydist x = %d, p2bodydist y = %d"
params = p2bodydist x,p2bodydist y
[State 68001, Turn] ;Grimmchild should always be facing the same way as ghost
type = Turn
trigger1 = facing != root, facing
[State 68001, VelSet]
type = VelSet
trigger1 = pos x != [(root, pos x - 36) + ((facing = -1) * 90), (root, pos x - 44) + ((facing = -1) * 90)]
x = ifelse(pos x < (root, pos x - 36) + ((facing = -1) * 90), facing, -facing)
[State 68001, VelSet]
type = VelSet
trigger1 = pos x != [(root, pos x - 86) + ((facing = -1) * 90), (root, pos x - 4) + ((facing = -1) * 90)]
x = ifelse(pos x < (root, pos x - 86) + ((facing = -1) * 90), facing*2.5, -facing*2.5)
[State 68001, VelSet]
type = VelSet
trigger1 = pos y != [root, pos y - 40, root, pos y - 39]
y = ifelse(pos y < root, pos y - 40, 1, -1)
[State 68001, VelSet]
type = VelSet
trigger1 = pos y != [root, pos y - 40, root, pos y - 0]
y = ifelse(pos y < root, pos y - 40, 2, -2)
[State 68001, VelSet]
type = VelSet
trigger1 = pos x = [(root, pos x - 36) + ((facing = -1) * 90), (root, pos x - 34) + ((facing = -1) * 90)]
x = 0
[State 68001, VelSet]
type = VelSet
trigger1 = pos y = [root, pos y - 40, root, pos y - 39]
y = 0
[State 68001, Screen]
type = ScreenBound
trigger1 = 1
value = 0;1
[State 0, ChangeState]
type = ChangeState
trigger1 = root, stateno = 3040
value = 68002
;---------------------------------------------------------------------------
; Grimmchild Attack
[Statedef 68002]
type = A
ctrl = 0
velset = 0,0
anim = 68001
[State 68002, 1]
type = Helper
trigger1 = Anim = 68001 && AnimElem = 4
name = "Grimmchild Flame"
ID = 68003
stateno = 68003
pos = 0,-10
postype = p1
facing = 1
ownpal = 1
supermovetime = 0
pausemovetime = 0
[State 68002, ChangeState]
type = ChangeState
trigger1 = root, stateno = 0
value = 68001
;------------------------------
; Grimmchild Flame
[Statedef 68003]
type= A
physics= N
movetype= A
ctrl = 0
anim = 68002
sprpriority = 3
velset = 5,1
juggle = 3
poweradd = 0
[State 68003,Assertspecial]
type = assertspecial
trigger1 = 1
flag = noshadow
[State 68003,playerpush]
type = PlayerPush
trigger1 = 1
value = 0
persistent = 1
[State 68003, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA, AA, AT
time = 1
[State 68003, HitBy]
type = HitBy
trigger1 = 1
value = SCA, AP
time = 1
[State 68003, HitOverride]
type = HitOverride
trigger1 = AnimElem = 1
time = -1
attr = SCA, AP
slot = 0
stateno = 68004
[State 68003, HitDef]
type = HitDef
Trigger1=Movecontact!=[1,5]
Trigger1=Hitcount<2
Trigger1=!moveguarded
attr = A,SP
hitflag = MAF
guardflag = MA
animtype = Medium
air.animtype = Medium
damage = 50,5
pausetime = 1,9
;sparkxy = -10,-20
sparkno = 1
hitsound = 5,2
guardsound = 6,0
ground.type=High
ground.slidetime=18
ground.hittime=18
ground.velocity=-7
air.type=Low
air.hittime=16
air.velocity=-5,-7
yaccel=.5
envshake.time = 3
envshake.freq = 40
envshake.ampl = 2
envshake.phase = 100
givepower = 0
[State 68003, Changestate Movehit]
type = changestate
trigger1 = movehit
value = 68004
[State 68003, Changestate hit ground]
type = Changestate
trigger1 = pos y = 0
value = 68004
;------------------------------
; Grimmchild Flame Bursts
[Statedef 68004]
type = A
physics = N
movetype = I
anim = 68003
velset = 0,0
ctrl = 0
sprpriority = 4
[State 68004, End]
type=destroyself
trigger1= animelem = 5