YesNoOk
avatar

Poison Effect [SOLVED]  (Read 332 times)

Started by Steimpunk, December 14, 2010, 02:35:28 am
Share this topic:
Poison Effect [SOLVED]
New #1  December 14, 2010, 02:35:28 am
  • **
  • Progress: ongoing
    • USA
I'm trying to implement a code that will have a poison effect.
  • First, the character creates a helper, nicknamed "POISON".
  • The helper actually has the rest of the code.
  • I prefer not to add code to other characters, unless completely necessary.

This creates the helper...
Code:
[State 0, Helper]
type = Helper
trigger1 = !Time
helpertype = normal
name = "poison"
ID = 1010
stateno = 1011
ownpal = 1
pausemovetime = 0

This is the helper's actual state...
Code:
[Statedef 1011, POISON]
type    = S
movetype= A
physics = N
juggle  = 1
velset = 0,0
ctrl = 0
anim = 1010
poweradd = 0

[State 0, VarSet]
type = VarSet
trigger1 = !Time
var(0) = 0

[State 200, 1]
type = HitDef
trigger1 = !Time
attr = A, HP
damage = 0
animtype = Light
affectteam = B
sparkxy = -10, -32
hitsound = S17, 0
guardsound = 6, 0
ground.type = High
ground.hittime = 0
ground.slidetime = 0
ground.velocity = 0
air.velocity = 0

[State 0, VarSet]
type = VarSet
trigger1 = movecontact
var(0) = 1

[State 0, BindToTarget]
type = BindToTarget
trigger1 = !Time
time = -1

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = 1
value = -1
ID = -1

[State 0, TargetPowerAdd]
type = TargetPowerAdd
trigger1 = (var(0)>0)
value = -15

[State 1010, 2]
type = PlaySnd
trigger1 = Time = 1
value = 0, 0

[State 1010, 3]
type = DestroySelf
trigger1 = Time = 500

The player does have a hit frame to trigger the HitDef, which I assume is necessary for the helper to target the right player. - If this is unnecessary, even better.

During the 500 ticks before it is destroyed, the helper only deals 2 damage to each player that was affected, and the 2 damage is applied the instant that it hits.
Last Edit: December 14, 2010, 09:12:30 pm by hogaraka
Re: Poison Effect
#2  December 14, 2010, 02:51:04 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Not quite right. Have the helper hit once, have p2 enter a custom state and attack the helper. Have the helper REVERSE that attack and restart p2's states. Then let everythign return to normal. The helper will only retain it's target if it has been recieved via reversaldef. A simple hit will not work. And hitting p2 over and over again is rude.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: Poison Effect
#3  December 14, 2010, 02:59:11 am
  • **
  • Progress: ongoing
    • USA
I don't want it to "hit" over and over; i'm aiming for a steady life drain effect.
I'll try this solution out first though, because I'm not exactly sure what you meant.
I will let you know how it worked out...

Now, it's having no effect at all. Again, I'm not sure if I understood what you meant...  :???:
Here's the new code:

The poison:
Code:
[Statedef 1011, POISON]
type    = S
movetype= A
physics = N
juggle  = 1
velset = 0,0
ctrl = 0
anim = 1010

[State 200, 1]
type = HitDef
trigger1 = !Time
attr = A, HP
damage = 0
animtype = Light
affectteam = B
sparkxy = -10, -32
hitsound = S17, 0
guardsound = 6, 0
ground.type = High
ground.hittime = 0
ground.slidetime = 0
ground.velocity = 0
air.velocity = 0
p2stateno = 1012

[State 0, BindToTarget]
type = BindToTarget
trigger1 = 1

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = 1
value = -1

[State 0, TargetPowerAdd]
type = TargetPowerAdd
trigger1 = 1
value = -15

[State 0, ReversalDef]
type = ReversalDef
trigger1 = 1
reversal.attr = C,HT
p1stateno = -1

[State 1010, 2]
type = PlaySnd
trigger1 = Time = 1
value = 0, 0

[State 1010, 3]
type = DestroySelf
trigger1 = Time = 500

The state that p2 enters:
Code:
[Statedef 1012, Poison Hit]
type    = U
movetype= A
physics = U
juggle  = 1
ctrl = 0
anim = 1011

[State 200, 1]
type = HitDef
trigger1 = !Time
attr = C, HT
damage = 0
animtype = Light
affectteam = B
sparkxy = -10, -32
hitsound = -1
sparkno = -1
guardsound = 6, 0
ground.type = High
ground.hittime = 0
ground.slidetime = 0
ground.velocity = 0
air.velocity = 0

[State 1010, 3]
type = ChangeState
trigger1 = !Time
value = cond((statetype=A),50,0)
Last Edit: December 14, 2010, 03:26:44 am by hogaraka
Re: Poison Effect
#4  December 14, 2010, 03:34:38 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
The reversaldef should put p2 in a custom state for a couple of ticks as well. Possibly worth having the helper changestate to something else just to keep all the rest out of it. Clsn2's should not be needed at all. Make sure the reds overlap so the reversal is working.

Let us know how that goes. I haven't actually done this before but i do know the theory.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: Poison Effect
New #5  December 14, 2010, 04:08:10 am
  • **
  • Progress: ongoing
    • USA
It works perfectly now! Thank you!  :D
Just in case you were curious, this is the working version:

My only note is that in the second poison state, i set the DestroySelf trigger to "time = 99", instead of 100 because it takes effect even when "time = 0". Over these 100 ticks, it causes 100 damage and -1000 power.

Poison (State 1)
Code:
[Statedef 1011, POISON]
type    = S
movetype= A
physics = N
juggle  = 1
velset = 0,0
ctrl = 0
anim = 1011

[State 200, 1]
type = HitDef
trigger1 = !time
attr = A, HP
affectteam = B
hitsound = -1
guardsound = -1
p1stateno = 1012
p2stateno = 1013

[State 1010, 3]
type = DestroySelf
trigger1 = !animtime

Poison (State 2)
Code:
[Statedef 1012, POISON2]
type    = S
movetype= A
physics = N
juggle  = 1
anim = 1011

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !time
value = 1011
elem = 9

[State 0, ReversalDef]
type = ReversalDef
trigger1 = 1
reversal.attr = C, HT
p1stateno = -1

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = 1
value = -10

[State 0, TargetPowerAdd]
type = TargetPowerAdd
trigger1 = 1
value = -1

[State 1010, 3]
type = DestroySelf
trigger1 = Time = 99

P2 Custom State
Code:
[Statedef 1013, Poison Hit]
type    = U
movetype= A
physics = U
juggle  = 1
ctrl = 0
anim = 1013

[State 200, 1]
type = HitDef
trigger1 = !Time
attr = C, HT
hitsound = -1
sparkno = -1
guardsound = -1

[State 1010, 3]
type = SelfState
trigger1 = !time
value = cond((statetype=A),50,0)
Last Edit: December 14, 2010, 10:38:19 pm by hogaraka
Re: Poison Effect
#6  December 14, 2010, 04:16:36 am
  • *****
  • Mega Klinklang confirmed
    • USA
    • ricepigeon.webs.com
Do be aware that there is a glitch that can occur where pressing back can cause the life drain to stop. I encountered this with Hina and fixed it, but I don't recall exactly what caused it.

Also it works in both Winmugen and 1.0 in case you were curious.

<<-- Updated 09/14/14

You limit yourself so badly when you try to avoid variables. When you get over your fear of the "complexity" of variables, you will find yourself in a better place: A beautiful world where coding is actually fun.