查看: 11314|回复: 14

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

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

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

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

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

[pre lang="javascript" line="1"]//=============================================================================
// color item.js
//=============================================================================

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

(function() {
        var _drawItemName = Window_Base.prototype.drawItemName
       
        Window_Base.prototype.drawItemName = function(item, x, y, width) {
    width = width || 312;
       
       
        Color1 = '#FFFFFF' // 一般品质的色彩(白,1)
    Color2 = '#008000' //平庸品质的色彩(绿,2)
    Color3 = '#0000FF'//# 精良品质的色彩(蓝,3)
    Color4 = '#9400D3'  //  # 卓越品质的色彩(紫,4)
    Color5 = '#FF0000'// # 神秘品质的色彩(红,5)
    Color6 = '#FFA500'  //  # 传说品质的色彩(橙,6)
    Color7 = '#FFFF00'//  # 特殊品质的色彩(黄,7)
    if (item)
        {
                var iconBoxWidth = Window_Base._iconWidth + 24;
                var result = item.meta.quality;
                //if (result)
                //{
            if(result == '1')
              {
            YANSE = Color1;
                    this.contents.fillRect(x-1, y+2, 34, -2, Color1);
                    this.contents.fillRect(x-1, y+2-1, 2, 32, Color1);
                    this.contents.fillRect(x-1, y+2+31, 34, 2, Color1);
                    this.contents.fillRect(x+33, y+2, -2, 32, Color1);
                    //this.contents.fillRect(x+2+32, y+2, 1+2, 33+2, '#ff1493');
            this.drawIcon(item.iconIndex, x, y+2 );
               
                    this.changeTextColor(Color1);
            this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
               }
       else if (result == '2')
          {
        YANSE = Color2;
                this.contents.fillRect(x-1, y+2, 34, -2, Color2);
                this.contents.fillRect(x-1, y+2-1, 2, 32, Color2);
                this.contents.fillRect(x-1, y+2+31, 34, 2, Color2);
                this.contents.fillRect(x+33, y+2, -2, 32, Color2);
                //this.contents.fillRect(x+2+32, y+2, 1+2, 33+2, '#ff1493');
        this.drawIcon(item.iconIndex, x, y+2 );
               
                this.changeTextColor(Color2);
        this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
      }
          else if (result == '3')
                  {
        YANSE = Color3;
                this.contents.fillRect(x-1, y+2, 34, -2, Color3);
                this.contents.fillRect(x-1, y+2-1, 2, 32, Color3);
                this.contents.fillRect(x-1, y+2+31, 34, 2, Color3);
                this.contents.fillRect(x+33, y+2, -2, 32, Color3);
                //this.contents.fillRect(x+2+32, y+2, 1+2, 33+2, '#ff1493');
        this.drawIcon(item.iconIndex, x, y+2 );
               
                this.changeTextColor(Color3);
        this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
        }
           else if (result == '4')
          {
        YANSE = Color4;
                this.contents.fillRect(x-1, y+2, 34, -2, Color4);
                this.contents.fillRect(x-1, y+2-1, 2, 32, Color4);
                this.contents.fillRect(x-1, y+2+31, 34, 2, Color4);
                this.contents.fillRect(x+33, y+2, -2, 32, Color4);
                //this.contents.fillRect(x+2+32, y+2, 1+2, 33+2, '#ff1493');
        this.drawIcon(item.iconIndex, x, y+2 );
               
                this.changeTextColor(Color4);
        this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
      }
          else if (result == '5')
                  {
        YANSE = Color5;
                this.contents.fillRect(x-1, y+2, 34, -2, Color5);
                this.contents.fillRect(x-1, y+2-1, 2, 32, Color5);
                this.contents.fillRect(x-1, y+2+31, 34, 2, Color5);
                this.contents.fillRect(x+33, y+2, -2, 32, Color5);
                //this.contents.fillRect(x+2+32, y+2, 1+2, 33+2, '#ff1493');
        this.drawIcon(item.iconIndex, x, y+2 );
               
                this.changeTextColor(Color5);
        this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
          }
          else if (result == '6')
          {
        YANSE = Color6;
                this.contents.fillRect(x-1, y+2, 34, -2, Color6);
                this.contents.fillRect(x-1, y+2-1, 2, 32, Color6);
                this.contents.fillRect(x-1, y+2+31, 34, 2, Color6);
                this.contents.fillRect(x+33, y+2, -2, 32, Color6);
                //this.contents.fillRect(x+2+32, y+2, 1+2, 33+2, '#ff1493');
        this.drawIcon(item.iconIndex, x, y+2 );
               
                this.changeTextColor(Color6);
        this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
      }
          else if (result == '7')
          {
        YANSE = Color7;
                this.contents.fillRect(x-1, y+2, 34, -2, Color7);
                this.contents.fillRect(x-1, y+2-1, 2, 32, Color7);
                this.contents.fillRect(x-1, y+2+31, 34, 2, Color7);
                this.contents.fillRect(x+33, y+2, -2, 32, Color7);
                //this.contents.fillRect(x+2+32, y+2, 1+2, 33+2, '#ff1493');
        this.drawIcon(item.iconIndex, x, y+2 );
               
                this.changeTextColor(Color7);
        this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
      }
          else {
         this.drawIcon(item.iconIndex, x, y+2 );
               
                this.resetTextColor();
        this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
           }
          
    }
        //else
        //{
        //        his.drawIcon(item.iconIndex, x, y+2 );
        //       
                //this.resetTextColor();
     //   this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);}
       
      
                //this.contents.fillRect(x+-1, y+1, 34, 34, '#ff1493');
                //this.contents.fillRect(x-1, y+2, 34, -2, '#ff1493');
                //this.contents.fillRect(x-1, y+2-1, 2, 32, '#ff1493');
                //this.contents.fillRect(x-1, y+2+31, 34, 2, '#ff1493');
                //this.contents.fillRect(x+33, y+2, -2, 32, '#ff1493');
                //this.contents.fillRect(x+2+32, y+2, 1+2, 33+2, '#ff1493');
        //this.drawIcon(item.iconIndex, x, y+2 );
               
                //this.changeTextColor('#ff1493');
        //this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
   // }
    //}
        ;


}
})();
[/pre]

效果图

效果图

评分

参与人数 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
星屑
15294
在线时间
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.

在本版发帖返回顶部