Attack Start code:
[Statedef 3500]
type = S
movetype= I
physics = S
ctrl = 0
anim = 3101
sprpriority = 2
facep2 = 1
velset = 0,0
[State 3000, Explod]
type = Explod
trigger1 = Time = 0
anim = 8300
id = 8300
supermove = 1
sprpriority = 4
ownpal = 1
[State 3000, VarSet]
type = VarSet
trigger1 = animelem = 2
var(4) = 1
[State 3000, Helper]
type = Helper
trigger1 = animelem = 2
stateno = 8500
supermovetime = 99999999
pos = -15,ceil(-160*const(size.yscale))
ownpal = 1
id = 8500
[State 0, PalFX]
type = envshake
trigger1 = time = 40
time = 16
ampl = -3
ignorehitpause = 1
[State 3000, SuperPause]
type = SuperPause
trigger1 = animelem = 2
time = 36
movetime = 36
darken = 1
anim = -1
p2defmul = 1
poweradd = -5000
[State 3001, PlaySnd]
type = PlaySnd
trigger1 = Time = 0
value = S3001, 0
channel = 0
[State 3001, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
value = 1480,0
channel = 0
[State 0, PalFXWiz]
type = PalFX
triggerall = (time%2)=0
;triggerall = time <= 240
;triggerall = numhelper(3301)
trigger1 = animelemtime(5) >= 0
time = 1
add = 256,-50,-50
mul = 256,200,200
sinadd = 0,0,0,1
invertall = 0
color = 128
[State 0, Helper]
type = Helper
;trigger1 = time = 55
trigger1 = animelem = 8
helpertype = normal
name = "Mind Env"
ID = 3501
stateno = 3501
pos = 0,0
postype = p1
facing = 1
ownpal = 1
persistent = 0
supermovetime = 90
pausemovetime = 90
[State 0]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1
First helper (sends opponent into "confused" state):
[Statedef 3501]
type = A
movetype= A
physics = N
ctrl = 0
anim = 3500
poweradd = 0
sprpriority = 5
velset = 0,0
facep2 = 1
[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = ,NA,SA,NT,ST,HT
time = 2
ignorehitpause = 1
[State 200, 1]
type = HitDef
trigger1 = time = 1
attr = S, NA
palfx.color = 256
palfx.invertall = 1
fall.envshake.ampl = ID
[State 0]
Type = Varset
trigger1 = movehit
Var(35) = Gametime ;TIME WHEN ENEMY GETS CONFUSED
persistent = 0
;I MOVED THIS TO HELPER AND ADJUSTED
[State 200, 1]
type = ParentVarSet ;MOVED HERE, CHANGED TO PARENTVARSET
trigger1 = numtarget
var(36) = target,ID
[State 0]
type = TargetState
trigger1 = movecontact
value = 3503
[State 0, DestroySelf]
type = DestroySelf
trigger1 = animtime = 0
Second helper (should be used to check if opponent has been knocked out of state, then return to said state):
[Statedef 3502]
type = A
movetype= A
physics = N
ctrl = 0
anim = 3500
poweradd = 0
sprpriority = 5
velset = 0,0
facep2 = 1
[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = ,NA,SA,NT,ST,HT
time = 2
ignorehitpause = 1
[State 200, 1]
type = HitDef
trigger1 = PlayerIDExist(root,var(36)) ;P1's VAR
trigger1 = PlayerID(root,var(36)),StateNo = [200, 250]
Id = 1000
;ADD MORE LIKE PRIORITY, MAYBE UNGUARDABLE, IGNOREHITPAUSE, etc
[State 200, 1]
type = TargetState
trigger1 = numtarget(1000)
Value = 3503 ;The Custom state you wanna force p2 back into
[State 0, DestroySelf]
type = DestroySelf
trigger1 = numtarget(1000) ;ADJUSTED
trigger1 = target,stateno = 3503 ;ADDED
"Confused" state:
[Statedef 3503]
type = S
physics = S
ctrl = 1
[State 0]
type = VarSet
trigger1 = time = 0
var(32) = 1
[State 0]
type = VarSet
trigger1 = time = 100
var(32) = 0
[State 0]
Type = SelfState
trigger1 = Gametime > PlayerID(GetHitVar(fall.envshake.ampl)),var(35) + 1000 ;effect duration = 1000
;THIS IS THE 1ST HELPERS PLAYERID FROM THE HITDEF. HELPER'S VAR 35
value = 0
[State 0]
type = SelfState
trigger1 = time = 100
value = 0
I fixed a few things, and wrote some comments... maybe it makes some more sense now