RMMV Help configuring YEP_DamageCore Damage-Steps

ScorchedGround

Blizzards most disappointed fan
Veteran
Joined
Apr 12, 2020
Messages
327
Reaction score
471
First Language
German
Primarily Uses
RMMV
YEP_DamageCore enables you to take control over how damage in battles is calculated, so I wanted to use this to straighten out my balancing a bit by making enemies hit a little harder, but receiving less healing.

However I am not quite sure where to put it.
In the beginning, I just put these at the very end of the damage calculation:

#1 Enemy damage amplified
JavaScript:
if (target.isActor() && value > 0 && !critical) {
value = Math.max(value * 1.30, value + 10, value ** 1.04)
}
#2 Enemy Healing reduced
JavaScript:
if (target.isEnemy() value < 0 && !this.isMpEffect) {
value = Math.min(value * 0.6, value + 10)
}
Putting these at the end not only does not work properly,
but also seems to neglect any elemental resistances.

Now here are my questions:
1. Where and how would I integrate these formulas? I don't really care how it gets done in the end, as long as the functionality is there.

2. Concerning #1, how do I make it so that the bonus damage only applies when enemies do the damage?
-> I have some self-damaging abilities

2. Concerning #2, how do I make it so that the reduced healing only applies when enemies do the healing?
-> There are some ways that the player can heal enemies

3. How can I avoid "neglecting elemental resistances"? Basically what happened is that I hit any enemy with an attack they should be weak to, but it dealt "neutral" damage instead.

4. Maybe the conditions can be tidied up a bit?
Basically, all direct damage from Enemy -> Player should be amplified only after all the calculations are done
(That's why I put it at the end)
And all direct HP healing from Enemy -> Enemy should be reduced

DamageCore.png
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,044
Reaction score
1,475
First Language
EN
Primarily Uses
RMMZ
  1. I think you omitted an && in the condition in your second block of code. That will likely cause the entire custom damage sequence to fail to apply, hence the way in which it's ignoring elemental rates (untested). If you check the console (F8 during test) you may see an error message of some kind. Try this instead:
    JavaScript:
    if (target.isEnemy() && value < 0 && !this.isMpEffect()) {
      value = Math.min(value * 0.6, value + 10)
    }

  2. Enemy -> actor damage amplification:
    JavaScript:
    if (user.isEnemy() && target.isActor() && value > 0 && !critical) {
      value = Math.max(value * 1.30, value + 10, value ** 1.04)
    }
    Enemy -> enemy healing reduction (including correction from point 1):
    JavaScript:
    if (user.isEnemy() && target.isEnemy() && value < 0 && !this.isMpEffect()) {
      value = Math.min(value * 0.6, value + 10)
    }

  3. See point 1.

  4. It looks pretty tidy to me, try out the above adjustments and see how it goes~ :kaothx:
[Edit: corrected isMpEffect reference (see follow-up post for details).]
 
Last edited:

ScorchedGround

Blizzards most disappointed fan
Veteran
Joined
Apr 12, 2020
Messages
327
Reaction score
471
First Language
German
Primarily Uses
RMMV
@caethyril
It was that easy, huh?
Well it seems that I flunked the code again,
that's what I get for copy & pasting code so recklessly without checking it again :kaophew:

I was actually aware of user.isEnemy(), and I even tried that, but since I omitted the && it was not going to work either way.

So I thought the plugin needed some other expression for user (some plugins use origin. I believe)

Anyways, I did some testing and everything seems to work as intended now.
Thank you again for your time. :kaojoy:
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,044
Reaction score
1,475
First Language
EN
Primarily Uses
RMMZ
(For Yanfly's plugins, origin is a separate thing: it's used by Buffs & States Core to reference the one who applied a state. :))

It was an easy mistake to make, no worries! Happy RPG Making~ :kaojoy:
 

ScorchedGround

Blizzards most disappointed fan
Veteran
Joined
Apr 12, 2020
Messages
327
Reaction score
471
First Language
German
Primarily Uses
RMMV
@caethyril One thing that I just recently noticed:

For some reason, the healing modifier does not seem to work properly.
So I experimented around for a bit and found out that this code does not work:
(That's the original code that you gave me)

JavaScript:
if (user.isEnemy() && target.isEnemy() && value < 0 && !this.isMpEffect) {
value = Math.max(value * 0.5, value + 10);
}
And after some testing, it seems that !this.isMpEffect is the culprit.
If I use the following code, the value gets modified as it should be:

JavaScript:
if (user.isEnemy() && target.isEnemy() && value < 0) {
value = Math.max(value * 0.5, value + 10);
}
I am not sure what causes this as !this.isMpEffect is proper code to my knowlegde

Luckily this is not a detrimental problem and it's not that much of a problem if this cannot be resolved for whatever reason. I'll just make enemies heal more MP then to balance out the heal modifier.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,044
Reaction score
1,475
First Language
EN
Primarily Uses
RMMZ
Oh, yes! You need brackets after it, i.e.
JavaScript:
if (user.isEnemy() && target.isEnemy() && value < 0 && !this.isMpEffect()) {
  value = Math.max(value * 0.5, value + 10);
}
This will tell it to evaluate the isMpEffect method and reference the result, rather than referencing the function itself. :)

I'll go edit that into my previous post to avoid confusing future people~

More details: isMpEffect is a method on instances of Game_Action. !this.isMpEffect is true if that method is not defined on this...which will never happen, because this is an instance of Game_Action. !this.isMpEffect() will evaluate the method based on this action instance, then "not" the result.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

um... why didn't anyone tell how easy it is to add motions to Sideview battlers? I literally copied the last one, changed the name and index, said where it should play, and boom... I've got intro motions.
Lately when I listen to 1970s songs, I always think that the "real world" is still at mid 70s. What we experience now is a futuristic dream. With this point of view, even 80s and 90s looks super futuristic. :D

The GIF of this seemed too cool to bury in replies. :LZSwink:
You may have slept with my aunt... but, given the circumstances, cheers.

- Professor Ian Duncan, 2013

Forum statistics

Threads
105,532
Messages
1,014,444
Members
137,215
Latest member
unidadind
Top