I'm trying to make a skill where every enemy's hp and mp get halved, so I made a variable for each enemy 1-8's hp and mp, then I realized that would take forever so I came here thanks! :)
Is there a way to make one variable equal to a batch of variables?
● ARCHIVED · READ-ONLY
-
-
No need for all that ^^.
Go into your skill editor in the database and use this formula. It will halve the targets HP by there current health.
hp / 2 This is HP Damage
mp / 2 This is MP Damage
I think these would only work as separate skills though, you can probably force an action when one of the skills are executed.
! -
I tried the hp one and it said null :o Did do it wrong, or do I need to put something else with it? I'm not good with formulas lol
-
It should not say null. Copy and paste the formula out of your skill.
It should be HP damage with
Code:or MP damage withb.hp / 2
Code:b.mp / 2 -
Ah, I forgot to specify a or b xDIt should not say null. Copy and paste the formula out of your skill.
It should be HP damage with
b.hp / 2or MP damage with
Code:b.mp / 2 -
Oh I forgot the "b" thanks, now could I do hp and mp at the same time?
-
do this
Code:This way it halves the mp then deals half hp as damageb.mp*=0.5;b.hp/2 -
Two issues with that ...
b.mp*=0.5 is going to potentially leave you with fractions. Either do this:
b.mp/=2;b.hp/2or this:
Code:b.mp = (b.mp*0.5).to_i;b.hp/2
Also, I suspect the log/popup/whatever notification you have, would only show the hp damage.
This is working on the assumption that you put HP Damage as the type for the skill. If you put it as MP damage, you would need to reverse the formula:
Code:otherwise it's going to calculate half the hp, then take that amount off MP instead.b.hp/=2;b.mp/2 -
yes, it would only show the damage to HP.Also, I suspect the log/popup/whatever notification you have, would only show the hp damage.