multiple discrete instances of elemental damage in a damage formula?

jonthefox

Veteran
Veteran
Joined
Jan 3, 2015
Messages
1,431
Reaction score
593
Primarily Uses
Wondering if it's possible to do something like this with the damage formula:

10 (fire) damage + 20 (ice) damage + 30 (physical) damage.

If the target has no elemental resistances to anything, the target would receive 60 damage.

If the target has 100% ice resistance, the target would receive 40 damage ( 10 fire + 30 physical).

If the target has 50% ice resistance, the target would receive 50 damage (10 fire + 10 ice (halved) + 30 physical).



Basically, the damage formula would contain different damage totals that individually factored in a target's elemental resistance. Could this be done, and if so how?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,335
Reaction score
7,658
First Language
German
Primarily Uses
RMMV
not by default, you'll need a plugin to change the engine behaviour.

theoretically this is possible to do with the damage formula alone, but that would get extremely complex and error-prone.

the first problem is that the engine by default multiplies the result of the damage formula with the elemental damage rate of the set element. You would have to divide by that to prevent a doubled effect.
it is better if a plugin removes that part in favor of other handling if you want to do this.

the second problem is that the code needed to get the damage rates for elements into the damage formula is not short, and having it done multiple times would make the formula difficult to read.
So the second function of that hypothetical plugin should be to provide a shortcut-function to write that into the damage formula.

I don't know of a plugin that does this, but should be easy to do if you request one.
 

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
1,923
Reaction score
534
First Language
English
Primarily Uses
N/A
The easiest way to do this in the engine alone (albiet, in a bit of a clunky way) is to make new elements that are hybrid elements
 

Another Fen

Veteran
Veteran
Joined
Jan 23, 2013
Messages
564
Reaction score
275
First Language
German
Primarily Uses
You should be able to include elemental resistances in the damage formula.
I'm not sure if MZ changed anything here, but in MV you could use
b.elementRate(12)
for the targets elemental resistance (to element 12). Of course the end result of the damage formula would still be modified through the actual element of that skill if you chose one.

So something like this could maybe work:
10 * b.elementRate(2) + 20 * b.elementRate(3) + 30 * b.elementRate(1)

Edit: So yeah, what Andar has already suggested :)
 

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

Latest Threads

Latest Posts

Latest Profile Posts

grief... lol... I keep seeing request for MZ versions of MV plugins. this is why I haven't moved over and just MZ for my MV project.
Egg-sitting minigame is coming along nicely. Are you a bad enough dino to keep all these raptor eggs warm?

I forgot to post the animated version of the previous map I was working on. I'm still arguing with myself on if I like the stark blue ground better than the undergrowth ground used on the waterfall map. Hmm...
now that fmod is free for indie(<200k revenue), it would be interesting to see someone add fmod support for rpg maker
Can't say I can't promise progress on a project just yet. But I can say I had fun databasing tonight. :)

Forum statistics

Threads
105,802
Messages
1,016,579
Members
137,496
Latest member
sulthorne
Top