Tray

Veteran
Veteran
Joined
Sep 7, 2018
Messages
39
Reaction score
6
First Language
English
Primarily Uses
RMMV
Ok so i have the recoil damage working perfectly except for 1 thing. I can get it to return "Physical" damage without an issue but for the life of me i cant figure out how to return elemental damage.

if (value > 0 && this.isPhysical()) { var recoil = Math.floor(Math.random() * (16 - 8 + 1) + 8); a.gainHp(-recoil); }

That is the base of the reocil damage formula im using. It checks to see if the mob deals more then 0 damage and that the monster is dealing physical damage then does a random damage calculation for the recoil that is then returned to the mob. which then im using yanfly plugin for <Custome React Effect>

I know the above is not showing any element. If someone would be kind enough to help/show how to change this from physical to an element damage please. I dont mean the check for the monster i want that to stay physical but the recoil damage change it from physical to elemental

I want to change the recoil damage from physical to elemental so i can add each elemental so that way monsters that have resistance to certen elmentals will eaither heal or take less damage bassed on the resistance or nulifaction of a certen element
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
8,859
Reaction score
6,668
First Language
English
Primarily Uses
RMMV
There isn't actually any such thing as "elemental damage." Giving a skill's damage an element type just causes it to be modified by the target's element rate after the damage is calculated.

So you'd have to manually do that inside your notetag: recoil*=this.calcElementRate(target);

If you're doing anything fancy, like multiple elements with Yanfly's Elements Core, you may have to use more/different code.
 

Tray

Veteran
Veteran
Joined
Sep 7, 2018
Messages
39
Reaction score
6
First Language
English
Primarily Uses
RMMV
Ok thank you ATT_Turan

Ok so after playing with it some

if (value > 0 && this.isPhysical()) { var recoil = Math.floor(Math.random() * (16 - 8 + 1) + 8) var elementRate = a.elementRate(3); var damage = recoil * elementRate; a.gainHp(-damage); a.startAnimation(3); // Show animation on the monster }

This is checking the elementrate of the #3 in the database and is working but its also returning 2 values which i cant figure out why from what i understand this should still only return 1 value

The first value its returning seems to be correct for what i want. The monster has a 50% rate to the #3 element and the first damage value has been 50% of the damage which max should be no higher then 8 and after 20 trys it was never higher then 8. But the 2nd value its showing is all over the place anywhere from 3 to 100 not sure what the 2nd value is even for right now


ok ok so again playing with it some more its not returning two values its returning a decimal value is there a way to always make it return a whole number? instead of like 5.5 damage

-------------------------------------------------------------------------------------------------------

Ok i decided to leave the above incase anyone else is looking for something simuler. So again after playing around with it. This is what i came up with and it seems to be working 100% finaly lol

<Custom React Effect> if (value > 0 && this.isPhysical()) { var recoil = Math.floor(Math.random() * (16 - 8 + 1) + 8); var elementRate = a.elementRate(3); var combinedValue = Math.ceil(recoil * elementRate); a.gainHp(-combinedValue); a.startAnimation(3); } </Custom React Effect>

Im using yanfly plugins the <Custom React Effect> can be placed on skill notes. However since this is technicaly a buff im using a state for this. The skill addes "Spike" state to the player and then this is placed in the state Note section for anyone wondering. (This is replicating Blaze Spikes from Final Fantasy 11)

This checks to make sure the monster deals more then 0 damage and doesnt miss and checks to make sure its physical not magical damage. then randoms between 8 and 16 damage then checks the elementalrate #3 (which is fire for me) of the monster then calculates the resistance and rounds to the nearest whole number before returning the damge back to the monster and then plays animation #3 in the database on the monster
 
Last edited:

Latest Threads

Latest Profile Posts

You can search the internet. It seems fine to call children little petri dishes. My wife and I raised 4 of them and they brought everything home. But apparently calling students plague bearers is a bridge too far. :LZSlol:
Which universe are you from? Berenstain or Berenstein?
Trying out Greedfall. The story is interesting and the voice acting is good, but holy cow are the faces and their animations distractingly terrible.
Ok so I guess I don't need 400+ events on one map.
inPr9l.png


Continuing our countdown with Capsule Monster #12 Scared Crow! This support CapMon can attack from distance with it’s Scared Bow and blind enemies!
https://thelastyurisamurai.itch.io/capsule-monsters-tactics

Forum statistics

Threads
131,667
Messages
1,222,071
Members
173,412
Latest member
King24
Top