设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 9221|回复: 14
打印 上一主题 下一主题

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

[复制链接]

Lv2.观梦者

梦石
0
星屑
6500
在线时间
59 小时
注册时间
2013-10-29
帖子
3
跳转到指定楼层
1
发表于 2016-6-4 11:12:01 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

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

JAVASCRIPT 代码复制
  1. //=============================================================================
  2. // color item.js
  3. //=============================================================================
  4.  
  5. /*:
  6.  * @plugindesc 将装备可以通过颜色区分品质
  7.  * @author waker3
  8.  *
  9.  * @help 区分装备品质,在物品注释区填写<quality:7>来实现装备颜色变换,数字为1-7对应颜色代码里有。
  10.  * 66站上VA版有一个类似的脚本,基本思想何其一致,觉得还不错就写了一个类似的MV版本。
  11.  */
  12.  
  13. (function() {
  14.         var _drawItemName = Window_Base.prototype.drawItemName
  15.  
  16.         Window_Base.prototype.drawItemName = function(item, x, y, width) {
  17.     width = width || 312;
  18.  
  19.  
  20.         Color1 = '#FFFFFF' // 一般品质的色彩(白,1)
  21.     Color2 = '#008000' //平庸品质的色彩(绿,2)
  22.     Color3 = '#0000FF'//# 精良品质的色彩(蓝,3)
  23.     Color4 = '#9400D3'  //  # 卓越品质的色彩(紫,4)
  24.     Color5 = '#FF0000'// # 神秘品质的色彩(红,5)
  25.     Color6 = '#FFA500'  //  # 传说品质的色彩(橙,6)
  26.     Color7 = '#FFFF00'//  # 特殊品质的色彩(黄,7)
  27.     if (item)
  28.         {
  29.                 var iconBoxWidth = Window_Base._iconWidth + 24;
  30.                 var result = item.meta.quality;
  31.                 //if (result)
  32.                 //{
  33.             if(result == '1')
  34.               {
  35.             YANSE = Color1;
  36.                     this.contents.fillRect(x-1, y+2, 34, -2, Color1);
  37.                     this.contents.fillRect(x-1, y+2-1, 2, 32, Color1);
  38.                     this.contents.fillRect(x-1, y+2+31, 34, 2, Color1);
  39.                     this.contents.fillRect(x+33, y+2, -2, 32, Color1);
  40.                     //this.contents.fillRect(x+2+32, y+2, 1+2, 33+2, '#ff1493');
  41.             this.drawIcon(item.iconIndex, x, y+2 );
  42.  
  43.                     this.changeTextColor(Color1);
  44.             this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
  45.                }
  46.        else if (result == '2')
  47.           {
  48.         YANSE = Color2;
  49.                 this.contents.fillRect(x-1, y+2, 34, -2, Color2);
  50.                 this.contents.fillRect(x-1, y+2-1, 2, 32, Color2);
  51.                 this.contents.fillRect(x-1, y+2+31, 34, 2, Color2);
  52.                 this.contents.fillRect(x+33, y+2, -2, 32, Color2);
  53.                 //this.contents.fillRect(x+2+32, y+2, 1+2, 33+2, '#ff1493');
  54.         this.drawIcon(item.iconIndex, x, y+2 );
  55.  
  56.                 this.changeTextColor(Color2);
  57.         this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
  58.       }
  59.           else if (result == '3')
  60.                   {
  61.         YANSE = Color3;
  62.                 this.contents.fillRect(x-1, y+2, 34, -2, Color3);
  63.                 this.contents.fillRect(x-1, y+2-1, 2, 32, Color3);
  64.                 this.contents.fillRect(x-1, y+2+31, 34, 2, Color3);
  65.                 this.contents.fillRect(x+33, y+2, -2, 32, Color3);
  66.                 //this.contents.fillRect(x+2+32, y+2, 1+2, 33+2, '#ff1493');
  67.         this.drawIcon(item.iconIndex, x, y+2 );
  68.  
  69.                 this.changeTextColor(Color3);
  70.         this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
  71.         }
  72.            else if (result == '4')
  73.           {
  74.         YANSE = Color4;
  75.                 this.contents.fillRect(x-1, y+2, 34, -2, Color4);
  76.                 this.contents.fillRect(x-1, y+2-1, 2, 32, Color4);
  77.                 this.contents.fillRect(x-1, y+2+31, 34, 2, Color4);
  78.                 this.contents.fillRect(x+33, y+2, -2, 32, Color4);
  79.                 //this.contents.fillRect(x+2+32, y+2, 1+2, 33+2, '#ff1493');
  80.         this.drawIcon(item.iconIndex, x, y+2 );
  81.  
  82.                 this.changeTextColor(Color4);
  83.         this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
  84.       }
  85.           else if (result == '5')
  86.                   {
  87.         YANSE = Color5;
  88.                 this.contents.fillRect(x-1, y+2, 34, -2, Color5);
  89.                 this.contents.fillRect(x-1, y+2-1, 2, 32, Color5);
  90.                 this.contents.fillRect(x-1, y+2+31, 34, 2, Color5);
  91.                 this.contents.fillRect(x+33, y+2, -2, 32, Color5);
  92.                 //this.contents.fillRect(x+2+32, y+2, 1+2, 33+2, '#ff1493');
  93.         this.drawIcon(item.iconIndex, x, y+2 );
  94.  
  95.                 this.changeTextColor(Color5);
  96.         this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
  97.           }
  98.           else if (result == '6')
  99.           {
  100.         YANSE = Color6;
  101.                 this.contents.fillRect(x-1, y+2, 34, -2, Color6);
  102.                 this.contents.fillRect(x-1, y+2-1, 2, 32, Color6);
  103.                 this.contents.fillRect(x-1, y+2+31, 34, 2, Color6);
  104.                 this.contents.fillRect(x+33, y+2, -2, 32, Color6);
  105.                 //this.contents.fillRect(x+2+32, y+2, 1+2, 33+2, '#ff1493');
  106.         this.drawIcon(item.iconIndex, x, y+2 );
  107.  
  108.                 this.changeTextColor(Color6);
  109.         this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
  110.       }
  111.           else if (result == '7')
  112.           {
  113.         YANSE = Color7;
  114.                 this.contents.fillRect(x-1, y+2, 34, -2, Color7);
  115.                 this.contents.fillRect(x-1, y+2-1, 2, 32, Color7);
  116.                 this.contents.fillRect(x-1, y+2+31, 34, 2, Color7);
  117.                 this.contents.fillRect(x+33, y+2, -2, 32, Color7);
  118.                 //this.contents.fillRect(x+2+32, y+2, 1+2, 33+2, '#ff1493');
  119.         this.drawIcon(item.iconIndex, x, y+2 );
  120.  
  121.                 this.changeTextColor(Color7);
  122.         this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
  123.       }
  124.           else {
  125.          this.drawIcon(item.iconIndex, x, y+2 );
  126.  
  127.                 this.resetTextColor();
  128.         this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
  129.            }
  130.  
  131.     }
  132.         //else
  133.         //{
  134.         //        his.drawIcon(item.iconIndex, x, y+2 );
  135.         //       
  136.                 //this.resetTextColor();
  137.      //   this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);}
  138.  
  139.  
  140.                 //this.contents.fillRect(x+-1, y+1, 34, 34, '#ff1493');
  141.                 //this.contents.fillRect(x-1, y+2, 34, -2, '#ff1493');
  142.                 //this.contents.fillRect(x-1, y+2-1, 2, 32, '#ff1493');
  143.                 //this.contents.fillRect(x-1, y+2+31, 34, 2, '#ff1493');
  144.                 //this.contents.fillRect(x+33, y+2, -2, 32, '#ff1493');
  145.                 //this.contents.fillRect(x+2+32, y+2, 1+2, 33+2, '#ff1493');
  146.         //this.drawIcon(item.iconIndex, x, y+2 );
  147.  
  148.                 //this.changeTextColor('#ff1493');
  149.         //this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
  150.    // }
  151.     //}
  152.         ;
  153.  
  154.  
  155. }
  156. })();

yanse.JPG (29.02 KB, 下载次数: 56)

效果图

效果图

评分

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

查看全部评分

Lv1.梦旅人

梦石
0
星屑
50
在线时间
491 小时
注册时间
2015-1-7
帖子
124
2
发表于 2016-6-4 12:32:15 | 只看该作者
能不能用于说明
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
6500
在线时间
59 小时
注册时间
2013-10-29
帖子
3
3
 楼主| 发表于 2016-6-4 20:14:02 | 只看该作者
西姐 发表于 2016-6-4 12:32
能不能用于说明

那个好像不行。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
12 小时
注册时间
2016-4-19
帖子
17
4
发表于 2016-6-5 15:00:46 | 只看该作者
楼主  这个要怎样使用  加上插件后是一堆乱码  也没法用
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
14206
在线时间
718 小时
注册时间
2011-7-16
帖子
1428

开拓者

5
发表于 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
另外,我的插件、范例、游戏都在这里
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
641 小时
注册时间
2015-7-29
帖子
211
6
发表于 2017-9-7 17:19:27 | 只看该作者
装备可以设置颜色了,并且有了va的边框,非常不错。希望可以完善下,敌人掉落时也显示颜色
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
69
在线时间
0 小时
注册时间
2018-11-30
帖子
32
7
发表于 2018-11-30 05:10:13 | 只看该作者
感谢楼主分享
回复 支持 反对

使用道具 举报

Lv2.观梦者

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

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

点评

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

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
84
在线时间
7 小时
注册时间
2021-3-5
帖子
12
9
发表于 2021-3-15 11:03:42 | 只看该作者
为啥我添加上去了我的装备名称都不显示了
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
48
在线时间
5 小时
注册时间
2022-6-21
帖子
6
10
发表于 2022-7-10 16:00:49 | 只看该作者
大佬威武
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-20 07:30

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表