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
973
Reaction score
566
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 found a book about game localization. It costs R$708,00 on Amazon. ;_;
I really wish my game was far enough along for it to be actually playable beyond certain aspects. I think I've crafted a really fun battle system thanks to ATB, fighting game, and Boost point mechanics.
Play test of my current progress on Happy Camper
Cutscene Contest Winners have been announced!

I'm heading back to Orlando tomorrow! My dad and I have forgiven each other, so we're planning to spend Spring Break together. We'll probably go to SeaWorld and Aquatica one day, and maybe even use my air fryer to make something to go with Dad's grilled steak. The train leaves tomorrow, and I'll be working on my game on board!

Forum statistics

Threads
109,111
Messages
1,042,180
Members
141,608
Latest member
Sinthea
Top