Advertisement
jerry2810

EquipmentRarity v1.1

Oct 31st, 2015
35
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // EquipmentRarityColors.js
  3. //=============================================================================
  4. //v1.1
  5. /*:
  6.  * @plugindesc Changes the weapons color based on rarity value you assign.
  7.  * @author Jeremy Cannady
  8.  *
  9.  *
  10.  * @help Changes the Items color based on the rarity you assign in the note field.
  11.  *
  12.  *
  13.  <itemRarity:1> Uncommon
  14.  <itemRarity:2>
  15.  <itemRarity:3>
  16.  <itemRarity:4>
  17.  <itemRarity:5> Super Rare Mega Death Thingy
  18.  *
  19.  *
  20.  *
  21. */
  22.  
  23. (function(){
  24. var copyOfDrawItemName = Window_Base.prototype.drawItemName;
  25. Window_Base.prototype.drawItemName = function(item, x, y, width) {
  26. copyOfDrawItemName.call(this,item, x, y, width);
  27.         width = width || 312;
  28.         var iconBoxWidth = this.lineHeight();
  29.         var padding = (iconBoxWidth - Window_Base._iconWidth) / 2;
  30.         if(item){
  31.             var rarity = parseInt(item.meta.itemRarity);
  32.             //Change the this.textColor(x) where x is the color you want based off the system window.png
  33.             if(rarity == 1){this.changeTextColor(this.textColor(3)) //Green
  34.             }else if (rarity == 2){this.changeTextColor(this.textColor(1))//Blue
  35.             }else if (rarity == 3){this.changeTextColor(this.textColor(20))//Orange
  36.             }else if (rarity == 4){this.changeTextColor(this.textColor(10))//Red
  37.             }else if (rarity == 5){this.changeTextColor(this.textColor(17))//Purple
  38.             }else{this.resetTextColor();};
  39.                 this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
  40.         };
  41. };
  42. })();
Advertisement
RAW Paste Data Copied
Advertisement