Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

How do you change the damage using Yanfly's Skill Core plugin?

Status
Not open for further replies.

dragon3025

Villager
Xy$
0.00
How do you change the damage using Yanfly's Skill Core plugin? I thought it was by using "value", this was the notetag that I was using:
Skill #1 will be used when you select
the Attack command.

<Pre-Damage Eval>
console.log("Before Eval");
if ($gameSwitches.value(9)) {
console.log("Switch 9");
if (target.isEnemy()) {
console.log("Targeting Enemy");
value *= 2
} else {
console.log("Targeting Ally");
value /= 2
}
return value
}
</Pre-Damage Eval>

<whole action>
common event: 10
</whole action>
MORE INFO: I'm going to make a button action command system, where the player has to press a button or anything like that with certain timing, and the result will turn switch 9 on or off. The common event runs the button action command system, but for now I just have it set to turn the switch on or off so I can test the skill easier.



I've gotten the skill to run the common event before damage calculation. I need the damage to change while the switch is on in the following way: double when targeting an enemy and halved when targeting an ally.

EDIT: There's this part in the description of Yanfly's Skill Core:

* Those using the <Pre-Damage Eval> and <Post-Damage Eval> are able to make
* use of the damage to be dealt and the damage that has been dealt through
* the 'value' variable. The <Pre-Damage Eval> notetag is capable of altering
* the 'value' variable and return it to have damage affected by its code.

This means I can change the damage using the skill core right?
 
Last edited:

dragon3025

Villager
Xy$
0.00
Bump
[doublepost=1470174381,1469906962][/doublepost]Bump
[doublepost=1470505475][/doublepost]I added more info.
[doublepost=1470787129][/doublepost]Bump
[doublepost=1471061778][/doublepost]Bump
 
Status
Not open for further replies.
Top