Item Durability (YEP)

From Yanfly.moe Wiki
Jump to navigation Jump to search

Welcome to the wiki! This is where you can find resources from Yanfly.moe, Ækashics.moe,
VisuStella, Caz Wolf, Fallen Angel Olivia, Atelier Irina, and other affiliated content creators.



Download

System

This is a plugin created for RPG Maker MV.

For help on how to install plugins, click here.

For help on how to update plugins, click here.

Got errors with your RPG Maker MV plugin? Click here.

Required Plugins

The following plugins are required in order to use this plugin.

Place the following plugins above this plugin located in the Plugin Manager.

Yanfly Engine Plugins

This plugin is a part of the Yanfly Engine Plugins library.


Introduction

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

NotetagsMV.png

RPG Maker MV's editor is unable to allow for custom traits/properties that a game dev may wish to associate with a database object, event, map, etc. Notetags are used to work around such limitations by allowing the game dev to tag certain traits/properties using specific Notetags declared by the related plugin.

Here is a list of Notetag(s) that you may use.

---

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

JavaScript.png

For advanced users who have an understanding of JavaScript, you can use the following features added by the plugin to further enhance what you can do with your game project.

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.

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.

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

PluginCommandsMV.png

Plugin Commands are event commands that are used to call upon functions added by a plugin that aren't inherently a part of RPG Maker MV.

Here is a list of Plugin Command(s) that you may use:

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.

Changelog

Version 1.04:
- Bypass the isDevToolsOpen() error when bad code is inserted into a script
call or custom Lunatic Mode code segment due to updating to MV 1.6.1.

Version 1.03:
- Updated for RPG Maker MV version 1.5.0.

Version 1.02:
- Lunatic Mode fail safes added.

Version 1.01a:
- Updated for RPG Maker MV version 1.1.0.
- Optimization update.

Version 1.00:
- Finished Plugin!