So as part of my game I'm using a system where two of the three classes require certain weapons to use their skills. It should be no problem for rogues who wield daggers and bows, or warriors wielding two-handed weapons.
However, the remainder are my weapon and shield warriors, who require both a one-handed weapon and a shield to use their skills. Setting their skills to require a one-handed weapon is easy, however I want to cover a scenario where they don't wield a shield, or are dual wielding and logically won't be able to use a shield.
Here's my attempt using Yanfly's Skill Core to check if the user is wielding a shield:
Will that code do, or is there a better way to do it?
However, the remainder are my weapon and shield warriors, who require both a one-handed weapon and a shield to use their skills. Setting their skills to require a one-handed weapon is easy, however I want to cover a scenario where they don't wield a shield, or are dual wielding and logically won't be able to use a shield.
Here's my attempt using Yanfly's Skill Core to check if the user is wielding a shield:
JavaScript:
<Custom Requirement>
//check if user is actor
if (user.isActor()){
// check if has shield equipped
var armors = user.armors();
var shield = armors[1];
if (shield !== 0) {
value = true;
} else {
value = false;
}
} else{
value = true;
}
</Custom Requirement>
Will that code do, or is there a better way to do it?