YesNoOk
avatar

[TUTORIAL] (飛び道具を跳ね返し方法)PROJECTILE REFLECTION (Read 37327 times)

Started by Vans, February 09, 2017, 11:15:58 am
Share this topic:
[TUTORIAL] (飛び道具を跳ね返し方法)PROJECTILE REFLECTION
#1  February 09, 2017, 11:15:58 am
  • ****
    • China
    • http://vans.trinitymugen.net/
This tutorial will explain and show how to use the projectile reflection system I developed. This tutorial will be divided in TWO parts, just like the system.

1. The FIRST part will cover how to apply this system during the creation of projectiles.
2. The SECOND part will cover how to apply this system during the creation of reflectors.

These two parts co-exist and are necessary for reflection to work properly.

I reserve this post for any further important information that may arise.



このガイドは飛び道具を跳ね返しシステムの説明です。ガイドは二つに分割される。

1.最初は飛び道具の跳ね返し行動です。
2.後はリフレクターの行動。

この二つは大事な物から、ちゃんと二つを使えばきちんと飛び道具の跳ね返しできます。
Last Edit: February 09, 2017, 11:22:13 am by Vans
Re: [TUTORIAL] (飛び道具を跳ね返し方法)PROJECTILE REFLECTION
#2  February 09, 2017, 11:21:44 am
  • ****
    • China
    • http://vans.trinitymugen.net/
How to program reflection compatibility for projectiles.
飛び道具の行動について。


This is the place to start for those who are programming reflection behavior to a projectile.

In order to use this system, we have 3 important requirements to meet.

  • This system only works for helper-based projectiles.
  • This helper should have system variables number 0 and number 1 free (sysvar(0) & sysvar(1)).
    Since further expansions are likely to be made in the future, I would like to ask everyone to keep all system variables free as best as possible. These have been picked because they're the least used and will serve a very standard purpose from now on.
  • An empty (dummy) animation in the .air file with the number of YOUR choosing. The only requirement is that the animation contains no sprite data in it.

Things I will NOT cover in this guide:

  • How to program projectiles.
  • How to transfer projectile controller logic to helper-based logic.
  • Basics of coding with variables.

If you have any questions regarding any of the three topics I have mentioned, you should ask a question in one of the many help forums first. I will refrain from answering any questions regarding any of these three topics in this thread.

If you meet the previous three requirements, we can begin!

The projectile portion of the system requires to things: a set of headers (that I will provide) and a brand new state to define the behavior of the projectile once it is reflected.

I kindly ask everyone to keep the headers labeled just as I provide them here, this makes it easy to follow which parts belong to the reflection and which don't. This is to help people that might stumble upon it without looking at this guide. Thank you.

Step 1.

Locate the helper of the projectile you wish to make reflectable and insert this header in the state where the helper is created:

Code:
;=======================================;
;PROJECTILE REFLECTION COMPATIBILITY    ;
;飛び道具を跳ね返し行動設定               ;
;by Vans                                ;
;GUIDE:                                 ;
;FOR PROJECTILE / 飛び道具で            ;
;sysvar(0) = 131072                     ;
;sysvar(1) = REFLECTED_BEHAVIOR_STATE   ;
;=======================================;
[State 1005, COMPATIBILITY]
type = VarSet
trigger1 = !time
sysvar(0) = 131072
[State 1005, REFLECTED STATE]
type = VarSet
trigger1 = !time
sysvar(1) = REFLECTED_BEHAVIOR_STATE
;=======================================;

Explanation:

  • The number 131072 identifies the object as a projectile that is COMPATIBLE with reflection.
  • The REFLECTED_BEHAVIOR_STATE is the state where your helper should go to when it is reflected.

Notes:

If you wish to make your projectile UNREFLECTABLE, simply specify the REFLECTED_BEHAVIOR_STATE as the same state the projectile should be in when it is moving normally. Typically, this is the same state where you put the header.

Step 2.

Create the REFLECTED_BEHAVIOR_STATE. This state defines the behavior your projectile should have once it is reflected.

Typically, this state is simply a copy of your original projectile state with some modifications:

First, do NOT forget that we still need the header:

Code:
;=======================================;
;PROJECTILE REFLECTION COMPATIBILITY    ;
;飛び道具を跳ね返し行動設定               ;
;by Vans                                ;
;GUIDE:                                 ;
;FOR PROJECTILE / 飛び道具で            ;
;sysvar(0) = 131072                     ;
;sysvar(1) = REFLECTED_BEHAVIOR_STATE   ;
;=======================================;
[State 1005, COMPATIBILITY]
type = VarSet
trigger1 = !time
sysvar(0) = 131072
[State 1005, REFLECTED STATE]
type = VarSet
trigger1 = !time
sysvar(1) = NORMAL_BEHAVIOR_STATE**********************
;=======================================;

Notes:

Like in the previous case, sysvar(1) specifies the behavior of your projectile once it is reflected. However, we are reflecting a second time in this case. This means that the value for sysvar(1) should now be the state that defines the normal behavior of your projectile.

Step 3.

In the REFLECTED_BEHAVIOR_STATE, locate the hitdef of your projectile and change the following parameters:

Code:
affectteam = F
;=======================================;
;PROJECTILE REFLECTION COMPATIBILITY    ;
;飛び道具を跳ね返し行動設定               ;
;by Vans                                ;
;GUIDE:                                 ;
;FOR PROJECTILE / 飛び道具で          ;
;sysvar(0) = 131072                     ;
;sysvar(1) = REFLECTED_BEHAVIOR_STATE   ;
;=======================================;
id = sysvar(0)
;=======================================;

Explanation

  • The flag affectteam = F is required for the projectile to hit you back.
  • The id = sysvar(0) line is required to detect the reflected projectile as a compatible projectile once more.

Step 4.

Go to the portion of the code that defines the end of the reflected projectile behavior, located in the same state as the hitdef. Typically, this is a ChangeState.

Before this final ChangeState, place the following piece of code:

Code:
;=======================================;
;PROJECTILE REFLECTION COMPATIBILITY    ;
;飛び道具を跳ね返し行動設定               ;
;by Vans                                ;
;GUIDE:                                 ;
;FOR PROJECTILE / 飛び道具で          ;
;sysvar(0) = 131072                     ;
;sysvar(1) = REFLECTED_BEHAVIOR_STATE   ;
;FOR REFLECTOR / 飛び道具を跳ね返するHELPERで;
;sysvar(0) = 262144                    ;
;=======================================;
[State 1007, Turn]
type = Turn
trigger1 = movecontact
trigger1 = root,NumProjID(262144)
persistent = 0
ignorehitpause = 1
[State 1206, ChangeState]
type = ChangeState
trigger1 = movecontact
trigger1 = root,NumProjID(262144)
value = sysvar(1)
ctrl = 0
ignorehitpause = 1
;=======================================;

Explanation:

  • The value 262144 identifies an object that acts as a COMPATIBLE reflector.
  • In this case specifically, the code NumProjID(262144) identifies if your character is attempting to reflect their own projectile.
  • If you look closely, this changestate will revert your projectile to NORMAL_PROJECTILE_BEHAVIOR if it is reflected by your own reflector.
  • If your character does not use or posses a reflector, then this piece of code is kept for compatibility. Please, do not skip this step.

Conclusion.

If you followed all the steps correctly, then your projectile should now be compatible with reflection.

You can find characters that possess compatible reflectors and projectiles in my folder.

For beginners, I recommend examining the code in Athena as it is the most basic implementation (projectile + reflector).

Athena's Psycho Ball helper begins in Statedef 1005. Feel free to examine my code as an example.

You can test if your implementation was correct by reflecting your projectile with Athena, Rugal or Chizuru.

This concludes the first part of this guide.


(Japanese will come later).



Cómo programar compatibilidad con la reflexión de proyectiles





Este es el primer paso para programar el comportamiento de un proyectil al ser reflejado.

Para usar este sistema tenemos 3 requerimientos:

  • El sistema funciona con proyectiles programados con helpers.
  • El helper debe tener las dos variables de sistema 0 y 1 completamente libres (sysvar(0) & sysvar(1)).
    Es muy probable que se hagan expansiones en el futuro, por esta razón me gustaría pedir que dejemos libres las variables de sistema lo mejor posible. Estas variables fueron elegidas porque son las que menos se usan y ahora tendrán una gran utilidad a nivel de sistema.
  • Una animación vacía (o dummy) en el archivo .air, el número de esta animación no importa. El único requerimiento es que la animación no dibuje sprites en pantalla si es utilizada.

Estás son algunas cosas que no voy a cubrir en este tutorial:

  • Cómo programar proyectiles.
  • Cómo convertir proyectiles hechos con el controlador de projectile a proyectiles hechos con helpers.
  • Programación básica usando variables.

Si hay alguna pregunta con respecto a estas tres cosas que mencioné, recomiendo hacer una pregunta en alguno de los foros de ayuda primero. En este topic no abordare preguntas sobre esos tres temas para mantener la discusión limpia.

Si cumples los tres requerimientos que puse al principio, entonces ya podemos empezar!

La parte de proyectiles de este sistema requiere dos cosas: un set de encabezados (que voy a proporcionar) y un estado (statedef) nuevo para definir el comportamiento del proyectil cuando es reflejado.

Me gustaría, de ser posible, que todos mantuvieramos los encabezados etiquetados como los pongo aquí, así es más fácil seguir qué partes vienen del sistema y cuales no. Esto es para ayudar a las personas que encuentren el sistema sin tener acceso a esta guía. ¡Gracias!

Paso 1.

Encuentra el helper del proyectil que quieres hacer compatible y coloca este header en el estado donde el helper es creado:


Code:
;=======================================;
;PROJECTILE REFLECTION COMPATIBILITY    ;
;飛び道具を跳ね返し行動設定               ;
;by Vans                                ;
;GUIDE:                                 ;
;FOR PROJECTILE / 飛び道具で            ;
;sysvar(0) = 131072                     ;
;sysvar(1) = REFLECTED_BEHAVIOR_STATE   ;
;=======================================;
[State 1005, COMPATIBILITY]
type = VarSet
trigger1 = !time
sysvar(0) = 131072
[State 1005, REFLECTED STATE]
type = VarSet
trigger1 = !time
sysvar(1) = REFLECTED_BEHAVIOR_STATE
;=======================================;

Explicación:

  • El número 131072 identifica el objecto como un proyectil que es COMPATIBLE con el sistema de reflexión.
  • La linea REFLECRED_BEHAVIOR_STATE es el estado al que debe ir tu helper cuando es reflejado.

Notas:

Si quieres que tu proyectil sea NO REFLEJABLE, entonces especifica REFLECTED_BEHAVIOR_STATE como el mismo estado en el que debe estar el helper cuando se mueve de manera normal. Usualmente este estado es el mismo donde pusiste el header.

Paso 2.

Crea el estado con número REFLECTED_BEHAVIOR_STATE. Este estado va a definir el comportamiento de tu proyectil cuando es reflejado.

De manera usual este estado es una copia del estado original de tu proyectil con algunas modificaciones.

Primero, es importante que en este nuevo state no olvidemos el encabezado:

Code:
;=======================================;
;PROJECTILE REFLECTION COMPATIBILITY    ;
;飛び道具を跳ね返し行動設定               ;
;by Vans                                ;
;GUIDE:                                 ;
;FOR PROJECTILE / 飛び道具で            ;
;sysvar(0) = 131072                     ;
;sysvar(1) = REFLECTED_BEHAVIOR_STATE   ;
;=======================================;
[State 1005, COMPATIBILITY]
type = VarSet
trigger1 = !time
sysvar(0) = 131072
[State 1005, REFLECTED STATE]
type = VarSet
trigger1 = !time
sysvar(1) = NORMAL_BEHAVIOR_STATE**********************
;=======================================;

Notas:

Como en el primer paso, sysvar(1) especifica el comportamiento del proyectil cuando es reflejado. Como estamos reflejando un proyectil que ya fue reflejado una vez, entonces el valor de esta variable (NORMAL_BEHAVIOR_STATE) debe ser el estado de tu helper cuando el comportamiento es normal.

Paso 3.

En el estado con número REFLECTED_BEHAVIOR_STATE localiza el hitdef de tu proyectil y cambia los siguientes parámetros:

Code:
affectteam = F
;=======================================;
;PROJECTILE REFLECTION COMPATIBILITY    ;
;飛び道具を跳ね返し行動設定               ;
;by Vans                                ;
;GUIDE:                                 ;
;FOR PROJECTILE / 飛び道具で          ;
;sysvar(0) = 131072                     ;
;sysvar(1) = REFLECTED_BEHAVIOR_STATE   ;
;=======================================;
id = sysvar(0)
;=======================================;

Explicación:

  • El flag de affectteam = F es necesaria para que el proyectil pueda pegarte de regreso.
  • La linea de id = sysvar(0) is necesaria para detectar que el proyectil reflejado también es compatible.

Parte 4.

Ve a la porción del código que define el final del comportamiento del proyectil que ha sido reflejado, localizado en el mismo estado que el hitdef. De manera usual, este final es un ChangeState.

Antes de este ChangeState final, agrega el siguiente pedazo de código:

Code:
;=======================================;
;PROJECTILE REFLECTION COMPATIBILITY    ;
;飛び道具を跳ね返し行動設定               ;
;by Vans                                ;
;GUIDE:                                 ;
;FOR PROJECTILE / 飛び道具で          ;
;sysvar(0) = 131072                     ;
;sysvar(1) = REFLECTED_BEHAVIOR_STATE   ;
;FOR REFLECTOR / 飛び道具を跳ね返するHELPERで;
;sysvar(0) = 262144                    ;
;=======================================;
[State 1007, Turn]
type = Turn
trigger1 = movecontact
trigger1 = root,NumProjID(262144)
persistent = 0
ignorehitpause = 1
[State 1206, ChangeState]
type = ChangeState
trigger1 = movecontact
trigger1 = root,NumProjID(262144)
value = sysvar(1)
ctrl = 0
ignorehitpause = 1
;=======================================;

Explicación:

  • El número 262144 identifica un objecto que actúa como reflector COMPATIBLE.
  • En este caso específico, la linea NumProjID(262144) identifica si tu personaje está intentando reflejar su propio proyectil.
  • Si observas con cuidado, este ChangeState hará que tu proyectil vaya a NORMAL_PROJECTILE_BEHAVIOR si es reflejado por un reflector propio (reflejado dos veces)
  • Si tu personaje no tiene o no hace uso reflectores entonces este pedazo de código está aquí para preservar compatibilidad. ¡Por favor no hay que saltar este paso!

Conclusión.

Si seguiste todos los pasos de manera completa, entonces tu proyectil debería ser compatible con el sistema de reflexión!

Para más ejemplos, mi folder contiene personajes que son compatibles con esta reflexión y tienen una diversidad de ejemplos de distintos proyectiles y reflectores.

Para principiantes, recomiendo revisar el código en Athena, pues es la implementación más básica (proyectil + reflector).

El helper de Pyscho Ball de Athena comienza en el Statedef 1005. Es un buen ejemplo e invito a todos a revisarlo para verlo en acción.

Para probar si la implementación es correcta, es suficiente con intentar reflejar el proyectil con Athena, Rugal o Chizuru.

¡Esto concluye la primera parte de la guía!
Last Edit: February 24, 2017, 09:38:09 am by Vans
Re: [TUTORIAL] (飛び道具を跳ね返し方法)PROJECTILE REFLECTION
#3  February 09, 2017, 11:21:59 am
  • ****
    • China
    • http://vans.trinitymugen.net/
(Reserved for Part 2)

     Posted: February 24, 2017, 09:38:43 am
I have added spanish! I'm still writing part 2, I hope I will be done soon.
Last Edit: February 24, 2017, 09:38:43 am by Vans
Re: [TUTORIAL] (飛び道具を跳ね返し方法)PROJECTILE REFLECTION
#4  October 05, 2018, 09:27:30 pm
    • Mexico
Muchas gracias amigo :),intentare implementar su codigo amigo es un gran aporte, ya que es lo que estaba buscando amigo haber si me sale amigo, esperando que me respondas y la parte 2 :)
Last Edit: October 05, 2018, 09:32:15 pm by Mazter Arzate
Re: [TUTORIAL] (飛び道具を跳ね返し方法)PROJECTILE REFLECTION
#5  October 21, 2020, 02:28:30 pm
  • ***
  • In a few minutes, bitch
    • Germany
Hi Vans, sup. I've been using your reflector as of late and found a a glitch that doesn't seem to have anything to do with your code. It seems to be one of MUGEN's random "fuck you, this doesn't work".

This specific hitbox will not hit back when projectiles are reflected. Its CvS2 Haohmaru's Tornado.

Code:
Clsn1Default: 1
  Clsn1[0] = -33, -64, 7, 0
Clsn2Default: 1
  Clsn2[0] = -20, -64, 20, 0

You can see the glitch on video here:
https://streamable.com/6ulbnh

For some reason it hits back when up close, but it wont when far away. You would think this me not coding properly but it really isn't. If you move the clsn1 7 pixels to the right, it will suddenly work. If you try making it 7 pixels larger to the right, it wont work. If you try making it 7 pixels shorter to the left, it wont work. If you try moving the clsn2 7 pixels to the right, it wont work.

I successfully implemented compatibility in the past, my Terry gets his Power Wave reflected just fine:

https://streamable.com/wqg869

However, if I paste Senpuu Retsu Zan hitbox into Power Wave code, it wont:

https://streamable.com/3e9eah

I honestly don't see what is so wrong about Haohmaru hitbox, but MUGEN does not like it (when reflected). This is not me asking you for help to fix the issue, its just to point out a funny out of nowhere glitch that happens with your reflector just because.

Thanks for all your contributions to the MUGEN scene :)
Re: [TUTORIAL] (飛び道具を跳ね返し方法)PROJECTILE REFLECTION
#6  October 22, 2020, 01:25:33 pm
  • ****
    • China
    • http://vans.trinitymugen.net/
Muchas gracias amigo :),intentare implementar su codigo amigo es un gran aporte, ya que es lo que estaba buscando amigo haber si me sale amigo, esperando que me respondas y la parte 2 :)

Muchas gracias por los comentarios. Si tienes alguna duda, por favor no dudes en preguntar.

Hi Vans,

Dear Karma,

Thank you for your kind words. A good friend informed me about your post, and only now I am able to find some free time to reply to you.

That problem you show is indeed a bit odd. I only had a brief moment to look at your post and videos, and the only thing I noticed is the out-of-the-norm design of the hitboxes in your Whirlwind Slash projectile. Traditionally, Capcom and SNK projectiles use a bigger contact (CLSN2) box, which completely encloses the attack (CLSN1) box. However, I believe in your example this behavior is reversed, your attack box envelops the collision box, so this projectile design is non-standard. Some examples (Hotaru, using KOFXI boxes and Sagat by Jesuszilla, using CvS2 boxes):



I am not 100% sure if this is the cause of your problem, but it is what I could notice immediately.

I am afraid that without direct access to the characters I cannot make any further diagnostics.

You can find me on discord as Vans#9119. Please, do not hesitate to contact me if there are any more questions or comments.


Sincerely,


Vans.
Last Edit: October 22, 2020, 01:41:54 pm by Vans
Re: [TUTORIAL] (飛び道具を跳ね返し方法)PROJECTILE REFLECTION
#7  July 20, 2021, 12:33:51 am
  • *
  • Quien coño te crees que soy!!!!!!
Hola vans!

he estado intentando últimamente aplicar esto..... y lo único que he logrado es hacerme bolas y que los personajes no hagan nada de lo que espero. concretamente, lo que sucede es que el escudo no refleja el proyectil, este se sigue de largo y ni siquiera golpea al char.



     Posted: July 20, 2021, 12:36:42 am
Asi quedo el codigo.


Code:
;---------------------------------------------------------------------------
;(HELPER)闇払い・ヘルパー
[Statedef 1020]
type     = A
movetype = A
physics  = N
ctrl     = 0
anim     = 1020
sprpriority = 5

;este va en el proyectil, como helper
;=======================================;
;PROJECTILE REFLECTION COMPATIBILITY    ;
;?????????????                   ;
;by Vans                                ;
;GUIDE:                                 ;
;FOR PROJECTILE / ?????              ;
;sysvar(0) = 131072                     ;
;sysvar(1) = REFLECTED_BEHAVIOR_STATE   ;
;=======================================;
[State 1005, COMPATIBILITY]
type = VarSet
trigger1 = !time
sysvar(0) = 131072
[State 1005, REFLECTED STATE]
type = VarSet
trigger1 = !time
sysvar(1) = 1021
;=======================================;

;ガード不能連携
[State 1000, ]
type = VarSet
trigger1 = root,stateno = 1450
trigger2 = root,stateno = 4000
trigger3 = root,stateno = 7000
trigger4 = root,stateno = 7100
trigger5 = root,stateno = 9100
var(2) = 1

[State 1000, 無敵]
type = NotHitBy
trigger1 = 1
value = SCA

[State 1000, 特殊効果]
type = AssertSpecial
trigger1 = 1
flag = NoShadow ;影を消す

[State 1000, AirGuard]
type = AssertSpecial
trigger1 = root,var(20) >= 1
trigger1 = p2statetype = A
trigger2 = var(2) = 1
flag = unguardable

[State 1000, AttackDist]
type = AttackDist
trigger1 = var(2) = 0
value = 90

[State 1000, AttackDist]
type = AttackDist
trigger1 = var(2) = 1
value = 0

[state 1000, VelSet]
type = VelSet
trigger1 = time = 0
trigger1 = root,var(15) = 0
x = 4

[state 1000, VelSet]
type = VelSet
trigger1 = time = 0
trigger1 = root,var(15) = 1
x = 8

[State 1000, ヒット定義]
type = HitDef
triggerall = root,var(12) = 0
triggerall = root,var(16) != 1
trigger1 = 1
attr = A, SP
damage    = floor(90*root,fvar(5)),10
getpower  = 135,135
givepower = 10,10
animtype = Hard
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 2,10+root,var(0)
Sparkno = 2;+(root,var(11)*10000)
guard.Sparkno = 42;+(root,var(11)*10000)
sparkxy = 20,-45
hitsound = s1,1+ifelse((root,var(9)),90,(root,var(11))*10)
guardsound = s2,1+ifelse((root,var(9)),90,(root,var(11))*10)
ground.type = Low
ground.hittime = 17
ground.slidetime = 17
ground.velocity = -9
air.velocity = -3.6,-3.8
yaccel = .35
air.fall = 1
fall.recover = 0
fall.recovertime = 94190; fuego rojo
palfx.time = 25
palfx.add = 30,-40,-140
palfx.sinadd = 60,60,50,10
palfx.color = 0
palfx.invertall = 1

[State 1000, ヒット定義]
type = HitDef
triggerall = root,var(12) = 0
triggerall = root,var(16) = 1
trigger1 = 1
attr = A, SP
damage    = floor(90*root,fvar(5)),10
getpower  = 135,135
givepower = 10,10
animtype = Hard
guardflag = MA
hitflag = MAFD
priority = 4, Hit
pausetime = 2,10+root,var(0)
Sparkno = 2;+(root,var(11)*10000)
guard.Sparkno = 42;+(root,var(11)*10000)
sparkxy = 20,-45
hitsound = s1,1+ifelse((root,var(9)),90,(root,var(11))*10)
guardsound = s2,1+ifelse((root,var(9)),90,(root,var(11))*10)
ground.type = Low
ground.hittime = 17
ground.slidetime = 17
ground.velocity = -9
air.velocity = -3.6,-3.8
yaccel = .35
air.fall = 1
fall.recover = 0
fall.recovertime = 94190; fuego rojo
palfx.time = 25
palfx.add = 30,-40,-140
palfx.sinadd = 60,60,50,10
palfx.color = 0
palfx.invertall = 1

[State 1000, Projectile]
type = Projectile
trigger1 = time = 0
projID = 1000
projanim = 1021
projremove = 1
projpriority = 1
projhitanim = -1
projremanim = -1
projsprpriority = 0
projshadow = 0,0,0
projremovetime = -1
offset = 0,0
velocity = vel X, vel Y

;ヒット数測定
[State 1000, ]
type = ParentVaradd
trigger1 = movehit = 1
fvar(1) = 1

[State 1000, ガードクラッシュ値削り]
type = parentvaradd
trigger1 = moveguarded = 1
fvar(10) = 13
ignorehitpause = 1
persistent = 0

[State 1000, スタン値削り]
type = parentvaradd
trigger1 = movehit = 1
fvar(12) = floor(20*root,fvar(14))
ignorehitpause = 1
persistent = 0

[State 1000, ガードクラッシュ値回復不能時間]
type = ParentVarSet
triggerall = root,fvar(11) != 180
triggerall = roundstate = 2
trigger1 = moveguarded = 1
fvar(11) = 180

[State 1000, スタン値回復不能時間]
type = ParentVarSet
triggerall = root,fvar(13) != 120
triggerall = roundstate = 2
trigger1 = movecontact = 1
fvar(13) = 120

;ジャグル設定
[State 1000, Juggle]
type = ParentVarSet
trigger1 = p2statetype = A
trigger1 = movehit
var(12) = 2

;投げ制限
[State 1000, Throw Limitter]
type = ParentVarSet
trigger1 = movehit= 1
var(17) = 1

;スロー処理
[State 1000, ヘルパーを出す]
type = Helper
trigger1 = Movehit = 1
name = "Slow"
stateno = 4900
ID = 4900
helpertype = normal
pos = 0,0
postype = p1
keyctrl = 0
ownpal = 1
ignorehitpause = 1
persistent = 0

;燃え小エフェクト
[State 1000, ヘルパーを出す]
type = Helper
trigger1 = movehit = 1
name = "hit"
stateno = 4910
ID = 4910
helpertype = normal
pos = 0,0
postype = p2
keyctrl = 0
ownpal = 1
ignorehitpause = 1
persistent = 0

[State 1000, このヘルパーを消す]
type = DestroySelf
trigger1 = time >= 300
trigger2 = frontedgedist <= -80

[State 1000, ステート変更]
type = changestate
trigger1 = movecontact
trigger2 = root,numprojID(1000) = 0
value = 1025

;---------------------------------------------------------------------------
;(HELPER)闇払い・ヘルパー
[Statedef 1021]
type     = A
movetype = A
physics  = N
ctrl     = 0
anim     = 1020
sprpriority = 5

;se copia el proyectil a el estado 1007, se a?ade lo siguiente

;=======================================;
;PROJECTILE REFLECTION COMPATIBILITY    ;
;?????????????                   ;
;by Vans                                ;
;GUIDE:                                 ;
;FOR PROJECTILE / ?????              ;
;sysvar(0) = 131072                     ;
;sysvar(1) = REFLECTED_BEHAVIOR_STATE   ;
;=======================================;
[State 1005, COMPATIBILITY]
type = VarSet
trigger1 = !time
sysvar(0) = 131072
[State 1005, REFLECTED STATE]
type = VarSet
trigger1 = !time
sysvar(1) = 1005

;ガード不能連携
[State 1000, ]
type = VarSet
trigger1 = root,stateno = 1450
trigger2 = root,stateno = 4000
trigger3 = root,stateno = 7000
trigger4 = root,stateno = 7100
trigger5 = root,stateno = 9100
var(2) = 1

[State 1000, 無敵]
type = NotHitBy
trigger1 = 1
value = SCA

[State 1000, 特殊効果]
type = AssertSpecial
trigger1 = 1
flag = NoShadow ;影を消す

[State 1000, AirGuard]
type = AssertSpecial
trigger1 = root,var(20) >= 1
trigger1 = p2statetype = A
trigger2 = var(2) = 1
flag = unguardable

[State 1000, AttackDist]
type = AttackDist
trigger1 = var(2) = 0
value = 90

[State 1000, AttackDist]
type = AttackDist
trigger1 = var(2) = 1
value = 0

[state 1000, VelSet]
type = VelSet
trigger1 = time = 0
trigger1 = root,var(15) = 0
x = 4

[state 1000, VelSet]
type = VelSet
trigger1 = time = 0
trigger1 = root,var(15) = 1
x = 8

[State 1000, ヒット定義]
type = HitDef
triggerall = root,var(12) = 0
triggerall = root,var(16) != 1
trigger1 = 1
attr = A, SP
damage    = floor(90*root,fvar(5)),10
getpower  = 135,135
givepower = 10,10
animtype = Hard
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 2,10+root,var(0)
Sparkno = 2;+(root,var(11)*10000)
guard.Sparkno = 42;+(root,var(11)*10000)
sparkxy = 20,-45
hitsound = s1,1+ifelse((root,var(9)),90,(root,var(11))*10)
guardsound = s2,1+ifelse((root,var(9)),90,(root,var(11))*10)
ground.type = Low
ground.hittime = 17
ground.slidetime = 17
ground.velocity = -9
air.velocity = -3.6,-3.8
yaccel = .35
air.fall = 1
fall.recover = 0
fall.recovertime = 94190; fuego rojo
palfx.time = 25
palfx.add = 30,-40,-140
palfx.sinadd = 60,60,50,10
palfx.color = 0
palfx.invertall = 1
;al hitdef
;=======================================;
;PROJECTILE REFLECTION COMPATIBILITY    ;
;?????????????                   ;
;by Vans                                ;
;GUIDE:                                 ;
;FOR PROJECTILE / ?????              ;
;sysvar(0) = 131072                     ;
;sysvar(1) = REFLECTED_BEHAVIOR_STATE   ;
;=======================================;
id = sysvar(0)
affectteam = F
;al final, antes del changestate

[State 1000, ヒット定義]
type = HitDef
triggerall = root,var(12) = 0
triggerall = root,var(16) = 1
trigger1 = 1
attr = A, SP
damage    = floor(90*root,fvar(5)),10
getpower  = 135,135
givepower = 10,10
animtype = Hard
guardflag = MA
hitflag = MAFD
priority = 4, Hit
pausetime = 2,10+root,var(0)
Sparkno = 2;+(root,var(11)*10000)
guard.Sparkno = 42;+(root,var(11)*10000)
sparkxy = 20,-45
hitsound = s1,1+ifelse((root,var(9)),90,(root,var(11))*10)
guardsound = s2,1+ifelse((root,var(9)),90,(root,var(11))*10)
ground.type = Low
ground.hittime = 17
ground.slidetime = 17
ground.velocity = -9
air.velocity = -3.6,-3.8
yaccel = .35
air.fall = 1
fall.recover = 0
fall.recovertime = 94190; fuego rojo
palfx.time = 25
palfx.add = 30,-40,-140
palfx.sinadd = 60,60,50,10
palfx.color = 0
palfx.invertall = 1
;al hitdef
;=======================================;
;PROJECTILE REFLECTION COMPATIBILITY    ;
;?????????????                   ;
;by Vans                                ;
;GUIDE:                                 ;
;FOR PROJECTILE / ?????              ;
;sysvar(0) = 131072                     ;
;sysvar(1) = REFLECTED_BEHAVIOR_STATE   ;
;=======================================;
id = sysvar(0)
affectteam = F
;al final, antes del changestate

[State 1000, Projectile]
type = Projectile
trigger1 = time = 0
projID = 1000
projanim = 1021
projremove = 1
projpriority = 1
projhitanim = -1
projremanim = -1
projsprpriority = 0
projshadow = 0,0,0
projremovetime = -1
offset = 0,0
velocity = vel X, vel Y

;ヒット数測定
[State 1000, ]
type = ParentVaradd
trigger1 = movehit = 1
fvar(1) = 1

[State 1000, ガードクラッシュ値削り]
type = parentvaradd
trigger1 = moveguarded = 1
fvar(10) = 13
ignorehitpause = 1
persistent = 0

[State 1000, スタン値削り]
type = parentvaradd
trigger1 = movehit = 1
fvar(12) = floor(20*root,fvar(14))
ignorehitpause = 1
persistent = 0

[State 1000, ガードクラッシュ値回復不能時間]
type = ParentVarSet
triggerall = root,fvar(11) != 180
triggerall = roundstate = 2
trigger1 = moveguarded = 1
fvar(11) = 180

[State 1000, スタン値回復不能時間]
type = ParentVarSet
triggerall = root,fvar(13) != 120
triggerall = roundstate = 2
trigger1 = movecontact = 1
fvar(13) = 120

;ジャグル設定
[State 1000, Juggle]
type = ParentVarSet
trigger1 = p2statetype = A
trigger1 = movehit
var(12) = 2

;投げ制限
[State 1000, Throw Limitter]
type = ParentVarSet
trigger1 = movehit= 1
var(17) = 1

;スロー処理
[State 1000, ヘルパーを出す]
type = Helper
trigger1 = Movehit = 1
name = "Slow"
stateno = 4900
ID = 4900
helpertype = normal
pos = 0,0
postype = p1
keyctrl = 0
ownpal = 1
ignorehitpause = 1
persistent = 0

;燃え小エフェクト
[State 1000, ヘルパーを出す]
type = Helper
trigger1 = movehit = 1
name = "hit"
stateno = 4910
ID = 4910
helpertype = normal
pos = 0,0
postype = p2
keyctrl = 0
ownpal = 1
ignorehitpause = 1
persistent = 0

;=======================================;
;PROJECTILE REFLECTION COMPATIBILITY    ;
;飛び道具を跳ね返し行動設定               ;
;by Vans                                ;
;GUIDE:                                 ;
;FOR PROJECTILE / 飛び道具で          ;
;sysvar(0) = 131072                     ;
;sysvar(1) = REFLECTED_BEHAVIOR_STATE   ;
;FOR REFLECTOR / 飛び道具を跳ね返するHELPERで;
;sysvar(0) = 262144                    ;
;=======================================;
[State 1007, Turn]
type = Turn
trigger1 = movecontact
trigger1 = root,NumProjID(262144)
persistent = 0
ignorehitpause = 1
[State 1206, ChangeState]
type = ChangeState
trigger1 = movecontact
trigger1 = root,NumProjID(262144)
value = sysvar(1)
ctrl = 0
ignorehitpause = 1
;=======================================;

[State 1000, このヘルパーを消す]
type = DestroySelf
trigger1 = time >= 300
trigger2 = frontedgedist <= -80

[State 1000, ステート変更]
type = changestate
trigger1 = movecontact
trigger2 = root,numprojID(1000) = 0
value = 1025