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:
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?
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>
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>
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: