Zakarijah

I love making maps!
Veteran
Joined
Aug 18, 2019
Messages
138
Reaction score
19
First Language
English
Primarily Uses
RMMV
I'm using Yanfly's Auto passive states and Elemental Core in RMMV


I've created 3 enemy types: Organic-Mechanical-Ethereal
Some can have multiple weaknesses

Ethereal enemies are immune to all physical attacks unless they are Beam-element or have an additional elemental weakness

But I am unsure how to create the skill notetags for a skill that would have two separate damage modifiers based on if the enemy is a specific enemy type or not
 

Zerothedarklord

Veteran
Veteran
Joined
Jun 25, 2013
Messages
335
Reaction score
105
First Language
English
Primarily Uses
RMMV
this could be achieved using an if statement.
 

Soulrender

Jack Of All Trades
Veteran
Joined
Jan 12, 2019
Messages
974
Reaction score
567
First Language
Poland
Primarily Uses
RMMV
I was explaining something similar in other topic, so I repeat myself...
Proper skill formula for skill will solve your problem:
Code:
$dataEnemies[b.enemyId()].meta["mech"] ? strong_formula : weak_formula

I'll explain that formula:
$dataEnemies is a storage of info about your monsters in database. This is an array so you need to point at some index, but because you use it in battles, lets get it from current enemy (b.enemyId())

(For example $dataEnemies[1] will get you all informations about 1st enemy in database - https://prnt.sc/x1reoz

meta.["mech"] - is a method to read your notetag - in this example notetag for enemy will be <mech>
? question mark simply ask interpreter the provided notetag <mech> is in enemy we got from b.enemyId(). If yes, then skill will use stronger_formula, wich can be any skill formula you desire, colon is equivalent to else statement (in case notetag is not found) then it will use other skill formula.

So:

any enemy in battle with the notetag <mech> - https://prnt.sc/x1r3tk will recieve more damage than enemy without that notetag. (if u use my skill formula from above).

Edit: I'll give you all a pattern how to understand the ternary statements in JavaScript:

myStatement ? IamAtrue : IamAFalse;

On left side of colon statement is true, on the right side of colon statement is false
That's a pretty handy thing in using more advanced skill formulas instead of borring regular damages
(a.atk* 2) - (b.def * 3) for instance.
 

oooNUKEooo

Veteran
Veteran
Joined
Sep 22, 2020
Messages
49
Reaction score
10
First Language
br portuguese
Primarily Uses
RMMV
using the yanlfy damage core:

JavaScript:
<damage formula>
    //check if target is from one race... using your passive states:
    if(target.isStateAffected(X)){
        //replace the X above for the one race state id.
        //calculate your damage here. the value variable must receive the final result.
        value = 0; //replace zero with the desired result
    }
    else if(target.isStateAffected(Y)){
        //replace the Y above for the next race state id.
        //calculate your damage here. the value variable must receive the final result.
        value = 0; //replace zero with the desired result
    }
    else if if(target.isStateAffected(Z)){
        //replace the Z above for the last race state id.
        //calculate your damage here. the value variable must receive the final result.
        value = 0; //replace zero with the desired result
    }
</damage formula>

another method would be creating 3 passive states and with the buffs and states core plugin (im assuming you have all yanfly plugins), create a reaction to each damage:

the code bellow will receive the damage you planned and change it according to the conditions and return the new damage in the variable value.

Code:
<Custom React Effect>
   //this would go in the ethereal state notetag. adapt the code for the others.
   // i assume you know how to perform if(condition || condition && condition){}else if(){}else{} checks.

   //check to see if skill causes hp damage:
   if(this.isHpEffect() && value > 0){
      //check to see if the attack contains the element (or more than one) that would cause damage.
      //replace X with the element type id in your editor.
      if(this.getItemElements().contains(X)){
         //calculate your damage here. if needed, check for other things and create variables.
         //at this point, the damage caused by the skill is stored in the variable "value'. to use  it in your new formulas, create a variable and make it receive the variable value content:
         var newDamage = value;
         //and make your calculations, like halving or doubling the damage:
         newDamage *= 0.5;
         newDamage *= 2;
         //when you reach a desired formula, make the variable value receive the result:
         value = newDamage;
      }
}
</Custom React Effect>
 
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts

I haven't been on here in forever wow(missed my forum birthday T-T). Anyways, I'm dabbling in BGMs, here's something I'm actually willing to share.

Binge-watched 6 episodes of the Erased anime... And that means I've watched half of it?! Sigh...
I'm bad at base-building games (looking at other players created an aesthetically beautiful base compared to me), but IDK why I keep playing the game and seek more of it.
Pyra and Mythra in smash ultimate are way too OP. They're basically Smash 4 Bayonetta 2.0, and not in a good way. Very toxic and unfair. At least they're hot tho.
attack on titan keep reaching a new height with each episode, aaa I can't wait another week for a new episode at this point

Forum statistics

Threads
109,197
Messages
1,042,961
Members
141,698
Latest member
ZetabrandX
Top