Advertisement
Maliki79

Mal_ItemCore_Ext_Changable_Max

Nov 12th, 2016
368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // Maliki's YF Item Core Extension - Changable Instance Item Maxes
  3. // Mal_ItemCore_Ext_Changable_Max.js
  4. // version 1.0
  5. //=============================================================================
  6. /*:  
  7.  * @plugindesc ver1.0 - Allows you to change the Max number of Instance Items, Weapons, or Armors in game.
  8.  * @author Maliki79
  9.  *
  10.  * @help For maximum compatibility, put this plugin DIRECTLY UNDER YF'S ITEM CORE PLUGIN!
  11.  * In order to use this plugin, you simply have to make the following script calls:
  12.  *  $gameParty.changeInstItemMax(x);
  13.  *  $gameParty.changeInstWeaponMax(x);
  14.  *  $gameParty.changeInstArmorMax(x);
  15.  * With x being an integer.
  16.  *
  17.  * Also, make sure you have the item category set to feature instance items from the original plugin's parameters, or you may cause a crash.
  18.  * Note that using this plugin, you can put a negative value reducing the amount of Instance Items in a category.
  19.  * For the most part there shouldn't be any issues, but make sure not to set the amount so that the items number goes below 1.
  20.  */
  21.  
  22. Game_Party.prototype.changeInstItemMax = function(amount) {
  23. this.insItemMax = this.insItemMax || 0;
  24. number = Math.floor(amount) || 0;
  25. this.insItemMax += number;
  26. }
  27.  
  28. Game_Party.prototype.changeInstWeaponMax = function(amount) {
  29. this.insWeaponMax = this.insWeaponMax || 0;
  30. number = Math.floor(amount) || 0;
  31. this.insWeaponMax += number;
  32. }
  33.  
  34. Game_Party.prototype.changeInstArmorMax = function(amount) {
  35. this.insArmorMax = this.insArmorMax || 0;
  36. number = Math.floor(amount) || 0;
  37. this.insArmorMax += number;
  38. }
  39.  
  40. Game_Party.prototype.getIndependentItemTypeMax = function(item) {
  41.     if (!item) return 0;
  42.     if (DataManager.isItem(item)) return Yanfly.Param.ItemMaxItems + (this.insItemMax || 0);
  43.     if (DataManager.isWeapon(item)) return Yanfly.Param.ItemMaxWeapons + (this.insWeaponMax || 0);
  44.     if (DataManager.isArmor(item)) return Yanfly.Param.ItemMaxArmors + (this.insArmorMax || 0);
  45. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement