查看: 11537|回复: 14

[原创发布] MV物品颜色品质脚本

[复制链接]
梦石
0
星屑
6500
在线时间
59 小时
注册时间
2013-10-29
回帖
1
发表于 2016-6-4 11:12:01 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
VA图书管里有类似的脚本,还挺不错的,但是看了一下MV的资源略少,就把VA那个装备品质颜色的脚本移植了过来,基本上思想和VA的那个脚本是一样的
但是总的来说这个脚本的效果没有VA的好,代码很简单,有需要就直接拿走吧,记得点赞哦。
javascript:;

  1. //=============================================================================
  2. // color item.js
  3. //=============================================================================

  4. /*:
  5. * @plugindesc 将装备可以通过颜色区分品质
  6. * @author waker3
  7. *
  8. * @help 区分装备品质,在物品注释区填写<quality:7>来实现装备颜色变换,数字为1-7对应颜色代码里有。
  9. * 66站上VA版有一个类似的脚本,基本思想何其一致,觉得还不错就写了一个类似的MV版本。
  10. */

  11. (function() {
  12.         var _drawItemName = Window_Base.prototype.drawItemName
  13.        
  14.         Window_Base.prototype.drawItemName = function(item, x, y, width) {
  15.     width = width || 312;
  16.        
  17.        
  18.         Color1 = '#FFFFFF' // 一般品质的色彩(白,1)
  19.     Color2 = '#008000' //平庸品质的色彩(绿,2)
  20.     Color3 = '#0000FF'//# 精良品质的色彩(蓝,3)
  21.     Color4 = '#9400D3'  //  # 卓越品质的色彩(紫,4)
  22.     Color5 = '#FF0000'// # 神秘品质的色彩(红,5)
  23.     Color6 = '#FFA500'  //  # 传说品质的色彩(橙,6)
  24.     Color7 = '#FFFF00'//  # 特殊品质的色彩(黄,7)
  25.     if (item)
  26.         {
  27.                 var iconBoxWidth = Window_Base._iconWidth + 24;
  28.                 var result = item.meta.quality;
  29.                 //if (result)
  30.                 //{
  31.             if(result == '1')
  32.               {
  33.             YANSE = Color1;
  34.                     this.contents.fillRect(x-1, y+2, 34, -2, Color1);
  35.                     this.contents.fillRect(x-1, y+2-1, 2, 32, Color1);
  36.                     this.contents.fillRect(x-1, y+2+31, 34, 2, Color1);
  37.                     this.contents.fillRect(x+33, y+2, -2, 32, Color1);
  38.                     //this.contents.fillRect(x+2+32, y+2, 1+2, 33+2, '#ff1493');
  39.             this.drawIcon(item.iconIndex, x, y+2 );
  40.                
  41.                     this.changeTextColor(Color1);
  42.             this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
  43.                }
  44.        else if (result == '2')
  45.           {
  46.         YANSE = Color2;
  47.                 this.contents.fillRect(x-1, y+2, 34, -2, Color2);
  48.                 this.contents.fillRect(x-1, y+2-1, 2, 32, Color2);
  49.                 this.contents.fillRect(x-1, y+2+31, 34, 2, Color2);
  50.                 this.contents.fillRect(x+33, y+2, -2, 32, Color2);
  51.                 //this.contents.fillRect(x+2+32, y+2, 1+2, 33+2, '#ff1493');
  52.         this.drawIcon(item.iconIndex, x, y+2 );
  53.                
  54.                 this.changeTextColor(Color2);
  55.         this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
  56.       }
  57.           else if (result == '3')
  58.                   {
  59.         YANSE = Color3;
  60.                 this.contents.fillRect(x-1, y+2, 34, -2, Color3);
  61.                 this.contents.fillRect(x-1, y+2-1, 2, 32, Color3);
  62.                 this.contents.fillRect(x-1, y+2+31, 34, 2, Color3);
  63.                 this.contents.fillRect(x+33, y+2, -2, 32, Color3);
  64.                 //this.contents.fillRect(x+2+32, y+2, 1+2, 33+2, '#ff1493');
  65.         this.drawIcon(item.iconIndex, x, y+2 );
  66.                
  67.                 this.changeTextColor(Color3);
  68.         this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
  69.         }
  70.            else if (result == '4')
  71.           {
  72.         YANSE = Color4;
  73.                 this.contents.fillRect(x-1, y+2, 34, -2, Color4);
  74.                 this.contents.fillRect(x-1, y+2-1, 2, 32, Color4);
  75.                 this.contents.fillRect(x-1, y+2+31, 34, 2, Color4);
  76.                 this.contents.fillRect(x+33, y+2, -2, 32, Color4);
  77.                 //this.contents.fillRect(x+2+32, y+2, 1+2, 33+2, '#ff1493');
  78.         this.drawIcon(item.iconIndex, x, y+2 );
  79.                
  80.                 this.changeTextColor(Color4);
  81.         this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
  82.       }
  83.           else if (result == '5')
  84.                   {
  85.         YANSE = Color5;
  86.                 this.contents.fillRect(x-1, y+2, 34, -2, Color5);
  87.                 this.contents.fillRect(x-1, y+2-1, 2, 32, Color5);
  88.                 this.contents.fillRect(x-1, y+2+31, 34, 2, Color5);
  89.                 this.contents.fillRect(x+33, y+2, -2, 32, Color5);
  90.                 //this.contents.fillRect(x+2+32, y+2, 1+2, 33+2, '#ff1493');
  91.         this.drawIcon(item.iconIndex, x, y+2 );
  92.                
  93.                 this.changeTextColor(Color5);
  94.         this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
  95.           }
  96.           else if (result == '6')
  97.           {
  98.         YANSE = Color6;
  99.                 this.contents.fillRect(x-1, y+2, 34, -2, Color6);
  100.                 this.contents.fillRect(x-1, y+2-1, 2, 32, Color6);
  101.                 this.contents.fillRect(x-1, y+2+31, 34, 2, Color6);
  102.                 this.contents.fillRect(x+33, y+2, -2, 32, Color6);
  103.                 //this.contents.fillRect(x+2+32, y+2, 1+2, 33+2, '#ff1493');
  104.         this.drawIcon(item.iconIndex, x, y+2 );
  105.                
  106.                 this.changeTextColor(Color6);
  107.         this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
  108.       }
  109.           else if (result == '7')
  110.           {
  111.         YANSE = Color7;
  112.                 this.contents.fillRect(x-1, y+2, 34, -2, Color7);
  113.                 this.contents.fillRect(x-1, y+2-1, 2, 32, Color7);
  114.                 this.contents.fillRect(x-1, y+2+31, 34, 2, Color7);
  115.                 this.contents.fillRect(x+33, y+2, -2, 32, Color7);
  116.                 //this.contents.fillRect(x+2+32, y+2, 1+2, 33+2, '#ff1493');
  117.         this.drawIcon(item.iconIndex, x, y+2 );
  118.                
  119.                 this.changeTextColor(Color7);
  120.         this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
  121.       }
  122.           else {
  123.          this.drawIcon(item.iconIndex, x, y+2 );
  124.                
  125.                 this.resetTextColor();
  126.         this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
  127.            }
  128.           
  129.     }
  130.         //else
  131.         //{
  132.         //        his.drawIcon(item.iconIndex, x, y+2 );
  133.         //       
  134.                 //this.resetTextColor();
  135.      //   this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);}
  136.        
  137.       
  138.                 //this.contents.fillRect(x+-1, y+1, 34, 34, '#ff1493');
  139.                 //this.contents.fillRect(x-1, y+2, 34, -2, '#ff1493');
  140.                 //this.contents.fillRect(x-1, y+2-1, 2, 32, '#ff1493');
  141.                 //this.contents.fillRect(x-1, y+2+31, 34, 2, '#ff1493');
  142.                 //this.contents.fillRect(x+33, y+2, -2, 32, '#ff1493');
  143.                 //this.contents.fillRect(x+2+32, y+2, 1+2, 33+2, '#ff1493');
  144.         //this.drawIcon(item.iconIndex, x, y+2 );
  145.                
  146.                 //this.changeTextColor('#ff1493');
  147.         //this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
  148.    // }
  149.     //}
  150.         ;


  151. }
  152. })();
复制代码

效果图

效果图

评分

参与人数 7赞 +7 收起 理由
ZICENI + 1
叶落归根 + 1 我很赞同
逸生ya + 1 精品文章
zhongzouchuan98 + 1
447924513 + 1 我很赞同
b5892654 + 1 我很赞同
嘤嘤怪 + 1

查看全部评分

梦石
0
星屑
50
在线时间
491 小时
注册时间
2015-1-7
回帖
110
发表于 2016-6-4 12:32:15 | 显示全部楼层
能不能用于说明
回复

使用道具 举报

梦石
0
星屑
6500
在线时间
59 小时
注册时间
2013-10-29
回帖
1
 楼主| 发表于 2016-6-4 20:14:02 | 显示全部楼层
西姐 发表于 2016-6-4 12:32
能不能用于说明

那个好像不行。
回复

使用道具 举报

梦石
0
星屑
50
在线时间
12 小时
注册时间
2016-4-19
回帖
12
发表于 2016-6-5 15:00:46 | 显示全部楼层
楼主  这个要怎样使用  加上插件后是一堆乱码  也没法用
回复

使用道具 举报

梦石
0
星屑
15309
在线时间
720 小时
注册时间
2011-7-16
回帖
1373

开拓者

发表于 2017-1-5 16:18:17 | 显示全部楼层
不错,好插件,收藏了
RMMV网络插件,开源免费,内含服务器端,无需强制登录,云数据,弹幕,云存档,排名,兑换码,版本检测,可自由上架下架删除。q群399090587
免打包运行MV游戏,云游戏,安卓App雷神游戏厅,在线玩游戏,上传下载游戏
开源游戏:重装机兵之重装归来【RMMV制作】全球首款按照美剧分季分集的方式发布的游戏
体素画 -- MV画3D像素图的画板
RMMV显示3D模型和场景的插件
RMMV显示spine骨骼动画的插件
RMMV秘密通道插件
突破敌群数量上限8个的插件
在rmmv中显示gif动态图片的插件
一款可以在mv游戏界面的任意位置显示任意文字的插件
RMMV Toast 插件 带物品得失提示,可以设置开启关闭 兼容yep itemcore
制作一个改名卡道具插件、调整标题页面菜单的插件、在标题页面之前显示大段文字的插件、标题页面显示版本号的插件
物品得失自动提示自动上色自动换行插件
我的Q群 663889472
另外,我的插件、范例、游戏都在这里
回复

使用道具 举报

梦石
0
星屑
50
在线时间
641 小时
注册时间
2015-7-29
回帖
188
发表于 2017-9-7 17:19:27 | 显示全部楼层
装备可以设置颜色了,并且有了va的边框,非常不错。希望可以完善下,敌人掉落时也显示颜色
回复

使用道具 举报

梦石
0
星屑
69
在线时间
0 小时
注册时间
2018-11-30
回帖
32
发表于 2018-11-30 05:10:13 | 显示全部楼层
感谢楼主分享
回复

使用道具 举报

梦石
0
星屑
632
在线时间
130 小时
注册时间
2021-1-23
回帖
38
发表于 2021-2-24 12:38:29 | 显示全部楼层
黄谊洲 发表于 2017-9-7 17:19
装备可以设置颜色了,并且有了va的边框,非常不错。希望可以完善下,敌人掉落时也显示颜色 ...

大佬,求教代码怎么使用==不是JS文件,我就不会了

点评

新建个.txt文本, 复制LZ的代码, 贴上到文本里去, 保存, 把后缀改成.js  发表于 2021-2-24 12:58
回复

使用道具 举报

梦石
0
星屑
84
在线时间
7 小时
注册时间
2021-3-5
回帖
10
发表于 2021-3-15 11:03:42 | 显示全部楼层
为啥我添加上去了我的装备名称都不显示了
回复

使用道具 举报

梦石
0
星屑
48
在线时间
5 小时
注册时间
2022-6-21
回帖
6
发表于 2022-7-10 16:00:49 | 显示全部楼层
大佬威武
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部