Advertisement
jerry2810

EquipmentRarityColors

Nov 1st, 2015
537
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 2.05 KB | None
  1. //=============================================================================
  2. // EquipmentRarityColors.js
  3. //=============================================================================
  4. //v1.2
  5. /*:
  6.  * @plugindesc Changes the weapons color based on rarity value you assign.
  7.  * @author Jeremy Cannady
  8.  *
  9.  * @param Rarity 1 Color
  10.  * @desc Select the color.
  11.  * @default 3
  12.  *
  13.  * @param Rarity 2 Color
  14.  * @desc Select the color.
  15.  * @default 1
  16.  *
  17.  * @param Rarity 3 Color
  18.  * @desc Select the color.
  19.  * @default 20
  20.  *
  21.  * @param Rarity 4 Color
  22.  * @desc Select the color.
  23.  * @default 10
  24.  *
  25.  * @param Rarity 5 Color
  26.  * @desc Select the color.
  27.  * @default 30
  28.  *
  29.  * @help Changes the Items color based on the rarity you assign in the note field.
  30.  *
  31.  *
  32.  <itemRarity:1> Uncommon
  33.  <itemRarity:2>
  34.  <itemRarity:3>
  35.  <itemRarity:4>
  36.  <itemRarity:5> Super Rare Mega Death Thingy
  37. */
  38.  
  39. (function(){
  40. var parameters = PluginManager.parameters('EquipmentRarityColors');
  41. var rarity1color = parameters['Rarity 1 Color'];
  42. var rarity2color = parameters['Rarity 2 Color'];
  43. var rarity3color = parameters['Rarity 3 Color'];
  44. var rarity4color = parameters['Rarity 4 Color'];
  45. var rarity5color = parameters['Rarity 5 Color'];
  46.  
  47. var copyOfDrawItemName = Window_Base.prototype.drawItemName;
  48. Window_Base.prototype.drawItemName = function(item, x, y, width) {
  49.     copyOfDrawItemName.call(this,item, x, y, width);
  50.     width = width || 312;
  51.     var iconBoxWidth = this.lineHeight();
  52.     var padding = (iconBoxWidth - Window_Base._iconWidth) / 2;
  53.     if(item){
  54.         var rarity = parseInt(item.meta.itemRarity);
  55.         if(rarity == 1){this.changeTextColor(this.textColor(rarity1color))
  56.         }else if (rarity == 2){this.changeTextColor(this.textColor(rarity2color))
  57.         }else if (rarity == 3){this.changeTextColor(this.textColor(rarity3color))
  58.         }else if (rarity == 4){this.changeTextColor(this.textColor(rarity4color))
  59.         }else if (rarity == 5){this.changeTextColor(this.textColor(rarity5color))
  60.         }else{this.resetTextColor();};
  61.         this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
  62.     };
  63. };
  64. })();
Advertisement
RAW Paste Data Copied
Advertisement