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,229
Reaction score
7,614
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
531
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
274
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

I've signed up for a job training program for people with Asperger's Syndrome. I went to a "test run" today so they could see how well I did with simple jobs, and I amazed them. Most new people do it in 30+ minutes, while I finished in a mere 15 minutes. Gives me time to work on a screenplay for Studio MDHR...
People,I have seen that Someone from China/Chile and London is doing a Vaccine Against COVID-19.
Doing anything that yield good result in the long run is like sowing seeds. With proper care, they will grow and bear fruits. I'm excited for tomorrow. :D
Leokids wrote on DarkPlasmaBall's profile.
Hi

Forum statistics

Threads
105,448
Messages
1,013,809
Members
137,102
Latest member
Mitchs98
Top