YEP.72 – Item Durability

Yanfly Engine Plugins is a plugin library made for RPG Maker MV, a wonderful piece of software to help you make that role playing game of your dreams. You can find out more about RPG Maker MV here.

You can grab the plugin here:

English Mirror

Independent Weapons and Armors will now have a Durability value. Over the course of battle, equipment durability will drop based on actions performed, damage taken, and the like. When a piece of equipment’s durability value reaches 0, the piece of equipment will break. Durability can be repaired by items and increased by skills, too.


Introduction


Please wait while you are redirected...or Click Here if you do not want to wait.

This plugin requires YEP_ItemCore. Make sure this plugin is located under YEP_ItemCore in the plugin list.

Independent Weapons and Armors will now have a Durability value. Over the course of battle, equipment durability will drop based on actions performed, damage taken, and the like. When a piece of equipment’s durability value reaches 0, the piece of equipment will break. Durability can be repaired by items and increased by skills, too.


Notetags


The following notetags can be used to adjust item durability for equipment.

Weapon and Armor Notetags:

<Durability: x>
This sets the item’s default durability value to x. This is the starting durability value for the item. If this notetag isn’t used, the independent equipment will refer to the value in the plugin parameters.

<Durability Variance: x>
This alters the starting durability value with a variance of x. This means there can be a variance of -x to +x for the durability starting value.

<Durability Maximum: x>
This is the maximum durability value the independent equipment can have. When repairing durability, the item’s durability value cannot exceed this amount. This amount is dependent on the base item’s durability value.

<Bypass Durability>
<Unbreakable>
This sets the item to not have bypass the durability system and making the independent item unbreakable.

<Break Sound Name: filename>
<Break Sound Volume: x>
<Break Sound Pitch: x>
<Break Sound Pan: +x>
<Break Sound Pan: -x>
This changes the sound effect played when using this piece of equipment is broken in battle. Filenames are case sensitive and do not include the file extension into the filename.

Item, Weapon, Armor Notetags:

<Repair Durability: x>
This will repair any weapon or armor’s durability by x. The repair effect is accessed from the weapon or armor’s action menu.

<Repair Weapon: x>
<Repair Armor: x>
This will specifically repair only weapons or armors by x amount. The repair effect is accessed from the weapon or armor’s action menu.

<Repair WType x: y>
<Repair AType x: y>
This will specifically repair only weapon-type x or armor-type x by y amount. The repair is accessed from the weapon or armor’s action menu.

<Repair Sound Name: filename>
<Repair Sound Volume: x>
<Repair Sound Pitch: x>
<Repair Sound Pan: +x>
<Repair Sound Pan: -x>
This changes the sound effect played when using this item to repair the durability of another item.

<Unbreakable Durability>
Removes the equipment’s durability and makes it unbreakable.

<Unbreakable Weapon>
<Unbreakable Armor>
Removes the weapon or armor’s durability and makes it unbreakable.

<Unbreakable WType x>
<Unbreakable AType x>
Removes durability for specifically weapon-type x or armor-type x and makes it unbreakable. Filenames are case sensitive and do not include the file extension into the filename.

Skill and Item Notetags:

<User Weapon Durability: +x>
<User Weapon Durability: -x>
Each hit of this skill/item will cause all of the user’s weapon(s) durability to be altered by +x or -x. If it reaches 0 or lower, the weapon will break.

<User All Weapon Durability: +x>
<User All Weapon Durability: -x>
Each hit of this skill/item will cause all of the user’s weapon(s) durability to be altered by +x or -x. If it reaches 0 or lower, the weapon will break.

<User Random Weapon Durability: +x>
<User Random Weapon Durability: -x>
Each hit of this skill/item will cause a random weapon equipped by the user to have its durability altered by +x or -x. If it reaches 0 or lower, the weapon will break.

<User Armor Durability: +x>
<User Armor Durability: -x>
Each hit of this skill/item will cause the user’s armor(s) durability to be altered by +x or -x. Depending on the ‘Damage All’ plugin parameter, this will affect either all armors or affect a random armor piece. If the item reaches 0 or lower, the armor will break.

<User All Armor Durability: +x>
<User All Armor Durability: -x>
Each hit of this skill/item will cause all of the user’s armor(s) durability to be altered by +x or -x. If it reaches 0 or lower, the armor will break.

<User Random Armor Durability: +x>
<User Random Armor Durability: -x>
Each hit of this skill/item will cause a random armor equipped by the user to have its durability altered by +x or -x. If it reaches 0 or lower, the armor will break.

<Target Weapon Durability: +x>
<Target Weapon Durability: -x>
Each hit of this skill/item will cause all of the target’s weapon(s) durability to be altered by +x or -x. If it reaches 0 or lower, the weapon will break.

<Target All Weapon Durability: +x>
<Target All Weapon Durability: -x>
Each hit of this skill/item will cause all of the target’s weapon(s) durability to be altered by +x or -x. If it reaches 0 or lower, the weapon will break.

<Target Random Weapon Durability: +x>
<Target Random Weapon Durability: -x>
Each hit of this skill/item will cause a random weapon equipped by the target to have its durability altered by +x or -x. If it reaches 0 or lower, the weapon will break.

<Target Armor Durability: +x>
<Target Armor Durability: -x>
Each hit of this skill/item will cause the target’s armor(s) durability to be altered by +x or -x. Depending on the ‘Damage All’ plugin parameter, this will affect either all armors or affect a random armor piece. If the item reaches 0 or lower, the armor will break.

<Target All Armor Durability: +x>
<Target All Armor Durability: -x>
Each hit of this skill/item will cause all of the target’s armor(s) durability to be altered by +x or -x. If it reaches 0 or lower, the armor will break.

<Target Random Armor Durability: +x>
<Target Random Armor Durability: -x>
Each hit of this skill/item will cause a random armor equipped by the target to have its durability altered by +x or -x. If it reaches 0 or lower, the armor will break.


Lunatic Mode – Custom Break Effect


For those with JavaScript proficiency, you can use this notetag to have your weapons and/or armors produce special effects when they break.

Weapon and Armor Notetags:

<Custom Break Effect>
var newItem = $dataitems[1];
$gameParty.gainItem(newItem, 1);
</Custom Break Effect>
This effect will only occur if the item breaks as a result of durability reaching 0 or lower from an action.


Lunatic Mode – Custom Repair Effect


For those with JavaScript proficiency, you can use this notetag to have your repair item perform a custom effect when it is used to repair a piece of equipment.

Item, Weapon, and Armor Notetags:

<Custom Repair Effect>
item.price += 200;
</Custom Repair Effect>
The ‘item’ variable refers to the item being repaired. Any changes made to it will be saved for the independent item.


Lunatic Mode – Custom Weapon/Armor Durability Modifiers


For those with JavaScript proficiency, you can use these notetags to have your skill and item actions alter the target’s equipment durability.

Skill and Item Notetags:

<Custom User All Weapon Durability>
value -= user.atk;
</Custom User All Weapon Durability>

<Custom User Random Weapon Durability>
value -= user.atk;
</Custom User Random Weapon Durability>

<Custom User All Armor Durability>
value -= user.atk;
</Custom User All Armor Durability>

<Custom User Random Armor Durability>
value -= user.atk;
</Custom User Random Armor Durability>
The ‘value’ variable determines how to affect the user’s weapon/armor. If ‘value’ is negative, durability will drop. If ‘value’ is positive, then durability will increase. If the user’s  equipment reaches 0 or lower, the equipment will break.

<Custom Target All Weapon Durability>
value -= user.atk;
</Custom Target All Weapon Durability>

<Custom Target Random Weapon Durability>
value -= user.atk;
</Custom Target Random Weapon Durability>

<Custom Target All Armor Durability>
value -= user.atk;
</Custom Target All Armor Durability>

<Custom Target Random Armor Durability>
value -= user.atk;
</Custom Target Random Armor Durability>
The ‘value’ variable determines how to affect the target’s weapon/armor. If ‘value’ is negative, durability will drop. If ‘value’ is positive, then durability will increase. If the target’s equipment reaches 0 or lower, the equipment will break.


Plugin Commands


There are a few plugin commands you can utilize to show/hide the Repair option in the Item Action Window and/or enable/disable it.

Plugin Commands

ShowRepairDurability
HideRepairDurability
– This will show/hide the Repair command in the Item Action Window.

EnableRepairDurability
DisableRepairDurability
– This will enable/disable the Repair command in the Item Action Window.


Happy RPG Making!