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

Project1

 找回密码
 注册会员
搜索
查看: 1592|回复: 0

[VIPArcher] 【物品颜色描绘】——帮助增强特制版(噗,

[复制链接]

无限の剣制

梦石
0
星屑
9905
在线时间
5019 小时
注册时间
2013-2-28
帖子
5030

开拓者贵宾

发表于 2014-10-8 08:59:35 | 显示全部楼层 |阅读模式

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

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

x
本帖最后由 VIPArcher 于 2014-11-29 18:15 编辑
  1. #encoding:utf-8
  2. #==============================================================================
  3. # ■ 物品颜色描绘
  4. # By :VIPArcher
  5. #  -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。
  6. #==============================================================================
  7. $VIPArcherScript ||= {};$VIPArcherScript[:itemcolor] = 20141007
  8. module VIPArcher;end
  9. module VIPArcher::ItemColor
  10.   RIM = true #是否描绘边框
  11.   FILL = true #是否填充边框
  12.   #为了方便设置品质等级,
  13.   Color_Lv = {
  14.     0 => 0,
  15.     1 => 24,
  16.     2 => 1,
  17.     3 => 30,
  18.     4 => 27,
  19.     5 => 18,
  20.     6 => 14
  21. # 品质  控制符颜色编号
  22. # 继续添加
  23.     }
  24. end
  25. class RPG::BaseItem
  26.   include VIPArcher::ItemColor
  27.   #--------------------------------------------------------------------------
  28.   # ● 获取道具的品质
  29.   #--------------------------------------------------------------------------
  30.   def color
  31.     @note =~ /\<(?:color|品质|颜色)\s*(\d+)\>/
  32.     $1.nil? ? 0 : [[$1.to_i,Color_Lv.size - 1].min,0].max
  33.   end
  34. end
  35. #==============================================================================
  36. # ■ 游戏中所有窗口的父类
  37. #==============================================================================
  38. class Window_Base < Window
  39.   include VIPArcher::ItemColor
  40.   #--------------------------------------------------------------------------
  41.   # ● 描绘物品
  42.   #--------------------------------------------------------------------------
  43.   def draw_item_name(item, x, y, enabled = true, width = 172)
  44.     return unless item
  45.     item_color = text_color(Color_Lv[item.color])
  46.     change_color(item_color, enabled)
  47.     self.color_fill_rect(x,y,item_color) if RIM
  48.     draw_icon(item.icon_index, x, y, enabled)
  49.     draw_text(x + 24, y, width, line_height, item.name)
  50.   end
  51.   #--------------------------------------------------------------------------
  52.   # ● 绘制图标边框
  53.   #--------------------------------------------------------------------------
  54.   def color_fill_rect(x,y,item_color)
  55.     item_alpha = item_color.clone
  56.     item_alpha.alpha = 160
  57.     contents.fill_rect(x+1 ,y+1 ,22, 22 ,item_alpha) if FILL
  58.     contents.fill_rect(x+1 ,y+1 ,22, 1  ,item_color)
  59.     contents.fill_rect(x   ,y+2 ,1 , 20 ,item_color)
  60.     contents.fill_rect(x+1 ,y+22,22, 1  ,item_color)
  61.     contents.fill_rect(x+23,y+2 ,1 , 20 ,item_color)
  62.   end
  63. end
复制代码
Q&A
Q:物品颜色描绘已经有多个版本,而且好像功能比这个还多。为什么再写一个呢?
A:为了装逼就像标题说的,为了让帮助增强也能描绘物品的颜色特制的脚本。
拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

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

GMT+8, 2024-3-29 20:38

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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