Hello, so I'm making a conditional for a skill, and I need to check if another skill is "Equipped". Would anyone know the correct term/script for that? This is the plugin I'm referring to:
www.yanfly.moe
So basically, I'm doing a <Custom Show Eval> notetag and this is what I've got so far:
Edit: So far, I've figured out that
Edit2: I also tried
tl;dr...I need to check an Array for a certain Skill ID, thx!
I was also looking at the code in Yanfly's Stormflurry tip 'n tricks and noticed it also deals w/ an array of skills. However, I'm not sure if it'll even be of any help...
Equip Battle Skills (YEP) - Yanfly.moe Wiki
JavaScript:
<Custom Show Eval>
if (!$gameParty.inBattle()) {
visible = true;
} else if ("skill #1337 is equipped") {
visible = true;
} else {
visible = false;
}
</Custom Show Eval>
Edit: So far, I've figured out that
$gameParty.menuActor().battleSkills() gives me the array of skills that are equipped to the current actor. Now, I just need to check for a specific skill ID. In my case, I want to check for skill 271.Edit2: I also tried
$gameParty.menuActor().battleSkills().includes(271) but it returned false, despite skill #271 clearly being shown as equipped (both in console and in-game).tl;dr...I need to check an Array for a certain Skill ID, thx!
I was also looking at the code in Yanfly's Stormflurry tip 'n tricks and noticed it also deals w/ an array of skills. However, I'm not sure if it'll even be of any help...
JavaScript:
<Category: Enchant>
<Help Description>
For \c[4]5\c[0] turns, if unit uses \c[4]Volt\c[0] skills, unit has a \c[4]20%\c[0] chance to strike an additional time for \c[4]40%\c[0] of damage dealt; This effect can chain off itself
</Help Description>
<Custom Establish Effect>
var skills = [];
var skillTypes = [];
// Insert the skills this passive can be used with.
skills.push(681, 689, 697, 705, 713, 719);
// Insert the skill types this passive can be used with.
skillTypes.push(18);
if (this.isSkill() && (skills.contains(this.item().id)) || skillTypes.contains(this.item().stypeId)) {
if (target && target.result() && target.result().hpDamage > 0) {
var originalResult = JsonEx.makeDeepCopy(target._result);
target.clearResult();
var extraDmg = Math.ceil(0.40 * originalResult.hpDamage);
var successRate = 0.20;
var struck = 0;
var maxHits = 5;
for (;;) {
if (target.isAlive() && Math.random() < successRate) {
struck += 1;
target.gainHp(-extraDmg);
target.startDamagePopup();
if (target.isDead()) {
target.performCollapse();
}
target.clearResult();
if (struck >= maxHits) {
break;
}
} else {
break;
}
}
if (struck > 0) {
target.startAnimation(5);
}
target._result = originalResult;
}
}
</Custom Establish Effect>