;Needle and Bell Trap

[Statedef 601]

type = U

movetype = A

physics = N

anim = 230

velset = 0,0

ctrl= 0

poweradd = 0

facep2 = 1

sprpriority = 2

[State 600, Crouch] ;Crouching Animation

type = ChangeAnim

trigger1 = Statetype = C

trigger1 = !Time || Time = [0,1]

trigger1 = anim != 410

value = 410

ignorehitpause = 1

[State 600, Aerial] ;In-Air Animation

type = ChangeAnim

trigger1 = Statetype = A

trigger1 = !Time || Time = [0,1]

trigger1 = anim != 440

value = 440

ignorehitpause = 1

[State 600, VarSet_X] ;P2 Distance Away From P1

type = VarSet ;Along the X Axis

trigger1 = AnimElemTime(3) < 0

trigger1 = anim = 440 && Enemynear(0), Alive

fv = 0

value = Facing*(Enemynear(0), Pos X - Pos X)

ignorehitpause = 1

[State 600, VarSet_Y];P2 Distance Away From P1

type = VarSet ;Along the Y Axis

trigger1 = AnimElemTime(3) < 0

trigger1 = anim = 440 && Enemynear(0), Alive

trigger1 = Pos Y != (Enemynear(0), Pos Y) ;P1 Pos does not equal to P2 Pos Y

fv = 1

value = (Enemynear(0), Pos Y - Pos Y)

ignorehitpause = 1

[State 600, VarRangeSet]

type = VarRangeSet

triggerall = fvar(1) != 0

trigger1 = Pos Y = (Enemynear(0), Pos Y) ;Trigger when P1's Pos Y = P2's Pos Y

trigger2 = Movetype = H || Stateno != 601 ;Trigger if P1 is Hit

fvalue = 0 ;or out of the current state number

first = 0

last = 1

ignorehitpause = 1

[State 600, AngleDraw]

type = AngleDraw

trigger1 = fvar(1) != 0

trigger1 = (atan(fvar(1)/fvar(0))*(180/pi)) = (-90, 90)

value = (atan(-fvar(1)/fvar(0))*(180/pi)) ;Precursor for Angling P1

ignorehitpause = 1

[State 600, AngleSet]

type = AngleSet

trigger1 = fvar(1) != 0

trigger1 = (atan(fvar(1)/fvar(0))*(180/pi)) = (-90,90)

value = (atan(-fvar(1)/fvar(0))*(180/pi)) ;Visual Mainfestation of P1's Assigned Angle

ignorehitpause = 1

[State 600, Whoosh_Snd]

type = PlaySnd

trigger1 = AnimElem = 2

value = S2,1

[State 600, Projectile-Released_Snd]

type = PlaySnd

trigger1 = AnimElem = 2

value = S2,15

[State 600, Projectile Throw]

type = Helper

trigger1 = AnimElem = 2 && Statetype = A && fvar(0) != 0

name = "Projectile w/o String"

ID = 221

stateno = 221

pos = 21*sin(fvar(0)/abs(atan(fvar(1)/fvar(0)))),-23;*cos(fvar(1)/(atan(fvar(1)/fvar(0))))

ownpal = 1

[State 600, Projectile Throw]

type = Helper

trigger1 = AnimElem = 2 && (Statetype != A || fvar(0) = 0)

name = "Projectile w/o String"

ID = 221

stateno = 221

pos = (ifelse((Statetype=S),34,ifelse((Statetype=A),21,28))),(ifelse((Statetype=S),-28,ifelse((Statetype=A),-25,-19)))

ownpal = 1

;String

[Statedef 223]

movetype = A

physics = N

anim = 6026

velset = 0,0

ctrl = 0

sprpriority = 2

hitcountpersist = 1

[State 0, VarSet]

type = VarSet

trigger1 = parent, var(0) = 1

v = 0 ;fv = 10

value = 1

[State 0, VarSet] ;Distance Between Spawner and "String" Helper

type = VarSet ;Along the X Axis

trigger1 = Parent, NumHelper(221)

trigger1 = (Helper(221), ParentDist X) != 0

;trigger1 = parent, stateno != 604

fv = 0

value = Facing*(Helper(221), ParentDist X)

[State 0, VarSet];Distance Between Spawner and "String" Helper

type = VarSet ;Along the Y Axis

trigger1 = Parent, NumHelper(221)

trigger1 = (Helper(221), ParentDist Y) != 0

trigger1 = parent, stateno != 604

fv = 1

value = (Helper(221), ParentDist Y)

[State 0, VarSet]

type = VarSet

trigger1 = numtarget && movehit = 1

fv = 2

value = target, Pos X

[State 0, VarSet]

type = VarSet

trigger1 = numtarget = 1 && movehit = 1

v = 2

value = target, ID

[State 0, VarSet]

type = VarSet

trigger1 = fvar(0) != 0

trigger1 = parent, stateno != 604

fv = 3

value = atan(-fvar(1)/fvar(0))*(180/pi)

ignorehitpause = 1

[State 0, VarSet]

type = VarSet

trigger1 = parent, numhelper(600)

trigger1 = parent, stateno = 604

trigger1 = helper(600),fvar(4) != 0

fv = 3

value = helper(600), fvar(4)

ignorehitpause = 1

[State 0, AngleDraw]

type = AngleDraw

trigger1 = fvar(3) != 0

;value = fvar(3)

scale = -fvar(0)/133, 1

ignorehitpause = 1

;=============================================================

[State 221, Offset]

type = Offset

triggerall = Enemynear(0), Alive

triggerall = Enemynear(0), Statetype = A

trigger1 = frontedgebodydist > 10

trigger2 = numtarget && movecontact

y = -16

ignorehitpause = 1

[State 221, VarSet_X]

type = VarSet

trigger1 = Parent, stateno = 600 || Parent, stateno = 601

trigger1 = Parent, fvar(0)

trigger1 = (frontedgedist > 0) && (pos y < 0) && !movecontact

fv = 2

value = parent, fvar(0)

ignorehitpause = 1

[State 221, VarSet_Y]

type = VarSet

trigger1 = Parent, stateno = 600 || Parent, stateno = 601

trigger1 = Enemynear(0), Alive

trigger1 = Parent, fvar(1) != 0

trigger1 = (frontedgedist > 0) && (pos y < 0) && !movecontact

fv = 3

value = parent, fvar(1)

ignorehitpause = 1

[State 221, AngleDraw]

type = AngleDraw

trigger1 = anim != 6006 ;&& frontedgedist > 0

trigger1 = (atan(-fvar(3)/fvar(2))*(180/pi)) = (-90, 90)

trigger1 = fvar(2) != 0

value = (atan(-fvar(3)/fvar(2))*(180/pi))

ignorehitpause = 1

[State 221, AngleSet]

type = AngleSet

trigger1 = anim != 6006 ;&& frontedgedist > 0

trigger1 = (atan(-fvar(3)/fvar(2))*(180/pi)) = (-90, 90)

trigger1 = fvar(2) != 0

value = (atan(-fvar(3)/fvar(2))*(180/pi))

ignorehitpause = 1

[State 221, ParentVarSet]

type = VarSet

trigger1 = fvar(3) != 0

fv = 4

value = Exp(0.5*ln((fvar(2) * fvar(2))+(fvar(3) * fvar(3))))

[State 221, ParentVarSet]

type = ParentVarSet

trigger1 = (parent, stateno = 601)

fvar(2) = fvar(4)

ignorehitpause = 1

;=============================================================