attacks that effect player and enemy

Joined
Aug 16, 2015
Messages
102
Reaction score
2
First Language
English
Primarily Uses
RMVXA
I want to make attacks that would hurt the enemy but also have an effect on the player. like an attack that does 50 damage to the enemy, then 10 to the user or an attack that adds a debuff or state after use.
 

MeowFace

Meow
Veteran
Joined
Feb 22, 2015
Messages
1,034
Reaction score
184
First Language
Meowish
Primarily Uses
in your damage formula:

a.hp -= (math); b.hp -= (math);a = skill user

b = target

to add states, use:

Code:
a.add_state(id); b.add_state(id);
 
Last edited by a moderator:
Joined
Aug 16, 2015
Messages
102
Reaction score
2
First Language
English
Primarily Uses
RMVXA
I wasn't aware that the formula could do that, of course if I would have taken the time to read it I may have figured out. Laziness is a terrible disease that I suffer from. Actually I can't get the formula to damage the user still.
 
Last edited by a moderator:

MeowFace

Meow
Veteran
Joined
Feb 22, 2015
Messages
1,034
Reaction score
184
First Language
Meowish
Primarily Uses
can't help there when you are not showing any examples of how you fail to make it work.
 
Joined
Aug 16, 2015
Messages
102
Reaction score
2
First Language
English
Primarily Uses
RMVXA
battle formula.png

I've tried other things, however I feel this is the closest I've got. 

battle formula.png
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,434
Reaction score
7,713
First Language
German
Primarily Uses
RMMV
I've tried other things, however I feel this is the closest I've got.
That doesn't work because it is not a complete code sequence.If you have more than one command, those commands need to be divided with a ; like in the original example several posts above.

Additionally, it's a.hp -= 10 or alternatively a.hp = a.hp - 10 if you want to change a.hp.

And third, the last number of any working code sequence will always be the damage to be reduced from the target. Having b.hp as part of the last number will usually autokill all targets because their HP-Number will be the damage caused.

Corrected it's

Code:
a.hp-=10;30
That will do 10 damage to the skill user and 30 damage to the skill target.
 

MeowFace

Meow
Veteran
Joined
Feb 22, 2015
Messages
1,034
Reaction score
184
First Language
Meowish
Primarily Uses
Like what Andar explained above, 

need -= to minus something from a variable (in this case, hp)

and you need to separate the lines (commands) using ; in between them.

check the example i've 1st shown you.

and like what Andar said, if you are setting it up under damage formula, any numbers on the last line (code behind the last ; ) will be counted as damage against the target. so you can skip the b.hp -= 10; code. note, if a formula ends with ; it will run a nil as damage
 

MeowFace

Meow
Veteran
Joined
Feb 22, 2015
Messages
1,034
Reaction score
184
First Language
Meowish
Primarily Uses
You're welcome!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,051
Messages
1,018,549
Members
137,837
Latest member
Dabi
Top