Advertisement
jerry2810

EquipmentRarityColors

Oct 31st, 2015
1,077
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // EquipmentRarityColors.js
  3. //=============================================================================
  4.  
  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.  
  25. Window_Base.prototype.drawItemName = function(item, x, y, width) {
  26.     width = width || 312;
  27.     if (item) {
  28.         var iconBoxWidth = Window_Base._iconWidth + 4;
  29.         this.resetTextColor();
  30.         this.drawIcon(item.iconIndex, x + 2, y + 2);
  31.         if(typeof item.meta.itemRarity !== "undefined"){
  32.             var rarity = parseInt(item.meta.itemRarity);
  33.             //Change the this.textColor(x) where x is the color you want based off the system window.png
  34.             if(rarity == 1){this.changeTextColor(this.textColor(3)) //Green
  35.             console.log("rarity 1");
  36.             }else if (rarity == 2){this.changeTextColor(this.textColor(1))//Blue
  37.             console.log("rarity 2");
  38.             }else if (rarity == 3){this.changeTextColor(this.textColor(20))//Orange
  39.             console.log("rarity 3");
  40.             }else if (rarity == 4){this.changeTextColor(this.textColor(10))//Red
  41.             console.log("rarity 4");
  42.             }else if (rarity == 5){this.changeTextColor(this.textColor(30))//Purple
  43.             console.log("rarity 5");
  44.             }else{this.resetTextColor();};
  45.        
  46.         };
  47.         this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
  48.         this.resetTextColor();
  49.     };
  50. };
  51. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement