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

Project1

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

[已经过期] 装备颜色脚本整合

[复制链接]

Lv3.寻梦者

灌水局大小姐

梦石
0
星屑
3820
在线时间
1690 小时
注册时间
2012-3-10
帖子
2469
跳转到指定楼层
1
发表于 2014-2-27 12:37:20 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 YeYe. 于 2014-2-28 03:40 编辑

之前30VIP订做的打孔系统存在些问题,不能兼容“物品颜色脚本”唉...都在忙,没人肯帮我!急死我了·············

打孔系统用了这个颜色脚本没用,比如:铜剑@5   应该显示紫色的,但是他连名字都不显示了......................我把自己所有的智慧都用尽了可就是不能如我所愿~

如何整合起来?我把脚本都贴上来了,还带了工程

颜色脚本:
  1. # 装备颜色 @1-6号颜色
  2. module RPG
  3.   class Skill
  4.     def name
  5.       name = @name.split(/@/)[0]
  6.       return name != nil ? name : ''
  7.     end
  8.     def name_color
  9.       name_color = @name.split(/@/)[1]
  10.       return name_color != nil ? name_color.to_i : 0
  11.     end
  12.   end
  13.   class Weapon
  14.     def name
  15.       name = @name.split(/@/)[0]
  16.       return name != nil ? name : ''
  17.     end
  18.     def name_color
  19.       name_color = @name.split(/@/)[1]
  20.       return name_color != nil ? name_color.to_i : 0
  21.     end
  22.   end
  23.   class Item
  24.     def name
  25.       name = @name.split(/@/)[0]
  26.       return name != nil ? name : ''
  27.     end
  28.     def name_color
  29.       name_color = @name.split(/@/)[1]
  30.       return name_color != nil ? name_color.to_i : 0
  31.     end
  32.   end
  33.   class Armor
  34.     def name
  35.       name = @name.split(/@/)[0]
  36.       return name != nil ? name : ''
  37.     end
  38.     def name_color
  39.       name_color = @name.split(/@/)[1]
  40.       return name != nil ? name_color.to_i : 0
  41.     end
  42.   end
  43. end
复制代码
脚本不长应该不难的吧······················改了哪里记得帮我 弄个备注来标记,我要全局搜索 学习学习~!



@狂人 @P叔叔 @高手 @最喜欢帮我的人 @爱人 请帮帮我!这次没有V,过几天充值后本小姐变成了土豪后我们一起做朋友好吗?

Lv1.梦旅人

梦石
0
星屑
50
在线时间
378 小时
注册时间
2013-10-14
帖子
215
来自 2楼
发表于 2014-2-27 16:56:44 | 只看该作者
本帖最后由 batfjtn 于 2014-2-28 15:51 编辑

要改的地方太多了~!!!

不过我敢说你肯定没有看你的自己的工程~~!!

那个打孔系统是独立出来的~!!

所以你需要把所有的颜色脚本都修改~~!!!

首先查看Scene_Menu这个类~~!!

然后查看第128行~~!!

OK亮点出来了~~!!

脚本是$scene = Scene_Smith.new

所以你再查看Scene_Smith这个类~~!!

查看main里的内容~~!!
  1.   def main
  2.     @item = nil
  3.     @target_window = Window_Target.new
  4.     @target_window.visible = false
  5.     @target_window.active = false
  6.     @info_window = Window_Equipment.new
  7.     @disp_window = Window_Equip_Disp.new
  8.     @info_window.item = @item
  9.     @help_window = Window_Help.new
  10.     @disp_window.help_window = @help_window
  11.     @command_window = Window_SmithCommand.new
  12.     @command_window.help_window = @help_window
  13.     @dummy_window = Window_Base.new(288, 128, 352, 352)
  14.     @dummy_window.visible = false
  15.     @equip_window = Window_SmithEquip.new(@item)
  16.     @equip_window.help_window = @help_window
  17.     @item_window = Window_SmithItem.new
  18.     @item_window.help_window = @help_window
  19.     @dscd_window = Window_SmithDscd.new
  20.     @restore_window = Window_SmithRestore.new
  21.     @hole_window = Window_SmithHole.new(@item)
  22.     @dcps_window = Window_SmithDcps.new
  23.     @step = 1
  24.     Graphics.transition
  25.     loop do
  26.       Graphics.update
  27.       Input.update
  28.       update
  29.       if $scene != self
  30.         break
  31.       end
  32.     end
  33.     Graphics.freeze
  34.     @dummy_window.dispose
  35.     @info_window.dispose
  36.     @disp_window.dispose
  37.     @help_window.dispose
  38.     @command_window.dispose
  39.     @equip_window.dispose
  40.     @dscd_window.dispose
  41.     @item_window.dispose
  42.     @restore_window.dispose
  43.     @hole_window.dispose
  44.     @dcps_window.dispose
  45.   end
复制代码
然后问题就出现了~!!

如果你不修改颜色脚本的话是没有办法使用的`~!!

论坛上的颜色脚本都是使用默认类的~~!!

所以这里你需要自己修改一下~!!

此句错误~~!!!!"你的打孔系统是独立出来的`!!"

是物品栏~~!!

这句多余~~!!!!包括的你物品栏也是~~!!!



而颜色脚本的的话都是修改原先的脚本~!!

颜色脚本~~!!
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================
  4. #
  5. # 脚本功能:给不同物品显示不同颜色,类似暗黑破坏神,比如套装为绿色,超级为金色
  6. #           可以更改的种类包括物品、防具、特技、武器。
  7. #
  8. # 使用方法:对于不想为白色表示的物品,在描述中最后添加@6,@4一类的即可。
  9. #           数字为颜色编号,和对话框中的一样。
  10. # ——————————————————————————————————————
  11. module RPG
  12.   class Skill
  13.     def description
  14.       description = @description.split(/@/)[0]
  15.       return description != nil ? description : ''
  16.     end
  17.     def name_color_66RPG
  18.       name_color = @description.split(/@/)[1]
  19.       return name_color != nil ? name_color.to_i : 0
  20.     end
  21.   end
  22.   class Weapon
  23.     def description
  24.       description = @description.split(/@/)[0]
  25.       return description != nil ? description : ''
  26.     end
  27.     def name_color_66RPG
  28.       name_color = @description.split(/@/)[1]
  29.       return name_color != nil ? name_color.to_i : 0
  30.     end
  31.   end
  32.   class Item
  33.     def description
  34.       description = @description.split(/@/)[0]
  35.       return description != nil ? description : ''
  36.     end
  37.     def name_color_66RPG
  38.       name_color = @description.split(/@/)[1]
  39.       return name_color != nil ? name_color.to_i : 0
  40.     end
  41.   end
  42.   class Armor
  43.     def description
  44.       description = @description.split(/@/)[0]
  45.       return description != nil ? description : ''
  46.     end
  47.     def name_color_66RPG
  48.       name_color = @description.split(/@/)[1]
  49.       return name != nil ? name_color.to_i : 0
  50.     end
  51.   end
  52. end
  53. # ——————————————————————————————————————
  54. # 本脚本原创自www.66rpg.com,转载请保留此信息
  55. # ——————————————————————————————————————
  56. class Window_Base < Window
  57.   #--------------------------------------------------------------------------
  58.   # ● 描绘物品名
  59.   #     item : 物品
  60.   #     x    : 描画目标 X 坐标
  61.   #     y    : 描画目标 Y 坐标
  62.   #--------------------------------------------------------------------------
  63.   def draw_item_name(item, x, y)
  64.     if item == nil
  65.       return
  66.     end
  67.     bitmap = RPG::Cache.icon(item.icon_name)
  68.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
  69.     self.contents.font.color = text_color(item.name_color_66RPG)
  70.     self.contents.draw_text(x + 28, y, 212, 32, item.name.to_s)
  71.   end
  72. end
  73. # ——————————————————————————————————————
  74. # 本脚本原创自www.66rpg.com,转载请保留此信息
  75. # ——————————————————————————————————————
  76. class Window_Item
  77.   #--------------------------------------------------------------------------
  78.   # ● 描绘项目
  79.   #     index : 项目编号
  80.   #--------------------------------------------------------------------------
  81.   def draw_item(index)
  82.     item = @data[index]
  83.     case item
  84.     when RPG::Item
  85.       number = $game_party.item_number(item.id)
  86.     when RPG::Weapon
  87.       number = $game_party.weapon_number(item.id)
  88.     when RPG::Armor
  89.       number = $game_party.armor_number(item.id)
  90.     end
  91.     if item.is_a?(RPG::Item) and
  92.        $game_party.item_can_use?(item.id)
  93.       self.contents.font.color = text_color(item.name_color_66RPG)
  94.     else
  95.       self.contents.font.color = disabled_color
  96.     end
  97.     x = 4 + index % 2 * (288 + 32)
  98.     y = index / 2 * 32
  99.     rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  100.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  101.     bitmap = RPG::Cache.icon(item.icon_name)
  102.     opacity = self.contents.font.color == disabled_color ? 128 : 255
  103.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  104.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  105.     self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
  106.     self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
  107.   end
  108. end
  109. # ——————————————————————————————————————
  110. # 本脚本原创自www.66rpg.com,转载请保留此信息
  111. # ——————————————————————————————————————
  112. class Window_EquipItem < Window_Selectable
  113.   #--------------------------------------------------------------------------
  114.   # ● 项目的描绘
  115.   #     index : 项目符号
  116.   #--------------------------------------------------------------------------
  117.   def draw_item(index)
  118.     item = @data[index]
  119.     x = 4 + index % 2 * (288 + 32)
  120.     y = index / 2 * 32
  121.     case item
  122.     when RPG::Weapon
  123.       number = $game_party.weapon_number(item.id)
  124.     when RPG::Armor
  125.       number = $game_party.armor_number(item.id)
  126.     end
  127.     bitmap = RPG::Cache.icon(item.icon_name)
  128.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
  129.     self.contents.font.color = normal_color
  130.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  131.     self.contents.draw_text(x + 130, y, 16, 32, ":", 2)
  132.     self.contents.draw_text(x + 150, y, 24, 32, number.to_s, 2)
  133.   end
  134. end
  135. # ——————————————————————————————————————
  136. # 本脚本原创自www.66rpg.com,转载请保留此信息
  137. # ——————————————————————————————————————
  138. class Window_ShopBuy < Window_Selectable
  139.   #--------------------------------------------------------------------------
  140.   # ● 描绘羡慕
  141.   #     index : 项目编号
  142.   #--------------------------------------------------------------------------
  143.   def draw_item(index)
  144.     item = @data[index]
  145.     # 获取物品所持数
  146.     case item
  147.     when RPG::Item
  148.       number = $game_party.item_number(item.id)
  149.     when RPG::Weapon
  150.       number = $game_party.weapon_number(item.id)
  151.     when RPG::Armor
  152.       number = $game_party.armor_number(item.id)
  153.     end
  154.     # 价格在所持金以下、并且所持数不是 99 的情况下为普通颜色
  155.     # 除此之外的情况设置为无效文字色
  156.     if item.price <= $game_party.gold and number < 99
  157.       self.contents.font.color = text_color(item.name_color_66RPG)
  158.     else
  159.       self.contents.font.color = disabled_color
  160.     end
  161.     x = 4
  162.     y = index * 32
  163.     rect = Rect.new(x, y, self.width - 32, 32)
  164.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  165.     bitmap = RPG::Cache.icon(item.icon_name)
  166.     opacity = self.contents.font.color == disabled_color ? 128 : 255
  167.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  168.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  169.     self.contents.draw_text(x + 240, y, 88, 32, item.price.to_s, 2)
  170.   end
  171. end
  172. # ——————————————————————————————————————
  173. # 本脚本原创自www.66rpg.com,转载请保留此信息
  174. # ——————————————————————————————————————
  175. class Window_ShopSell < Window_Selectable
  176.   #--------------------------------------------------------------------------
  177.   # ● 描绘项目
  178.   #     index : 项目标号
  179.   #--------------------------------------------------------------------------
  180.   def draw_item(index)
  181.     item = @data[index]
  182.     case item
  183.     when RPG::Item
  184.       number = $game_party.item_number(item.id)
  185.     when RPG::Weapon
  186.       number = $game_party.weapon_number(item.id)
  187.     when RPG::Armor
  188.       number = $game_party.armor_number(item.id)
  189.     end
  190.     # 可以卖掉的显示为普通颜色、除此之外设置成无效文字颜色
  191.     if item.price > 0
  192.       self.contents.font.color = text_color(item.name_color_66RPG)
  193.     else
  194.       self.contents.font.color = disabled_color
  195.     end
  196.     x = 4 + index % 2 * (288 + 32)
  197.     y = index / 2 * 32
  198.     rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  199.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  200.     bitmap = RPG::Cache.icon(item.icon_name)
  201.     opacity = self.contents.font.color == disabled_color ? 128 : 255
  202.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  203.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  204.     self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
  205.     self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
  206.   end
  207. end
  208.    
  209. # ——————————————————————————————————————
  210. # 本脚本原创自www.66rpg.com,转载请保留此信息
  211. # ——————————————————————————————————————
  212. class Window_Skill
  213.   #--------------------------------------------------------------------------
  214.   # ● 描绘项目
  215.   #     index : 项目编号
  216.   #--------------------------------------------------------------------------
  217.   def draw_item(index)
  218.     skill = @data[index]
  219.     if @actor.skill_can_use?(skill.id)
  220.       self.contents.font.color = text_color(skill.name_color_66RPG)
  221.     else
  222.       self.contents.font.color = disabled_color
  223.     end
  224.     x = 4 + index % 2 * (288 + 32)
  225.     y = index / 2 * 32
  226.     rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  227.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  228.     bitmap = RPG::Cache.icon(skill.icon_name)
  229.     opacity = self.contents.font.color == disabled_color ? 128 : 255
  230.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  231.     self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
  232.     self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
  233.   end
  234. end
  235. #==============================================================================
  236. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  237. #==============================================================================
复制代码
从第76行到最后面~!!

都是在原本的脚本上添加的新参数~~!!

所以你颜色脚本可以在商店拥有效果~~!

而在物品栏里没有效果~~!!

打完收工~!!

自己修改吧~~!!

点评

每次看到你的解答都会有一种莫名想喜感……打孔脚本是我写的,但是冲突的位置不在这里……  发表于 2014-2-28 14:40
最简单的学习方法就是努力回答别人的问题...
任何教程都没有实践来的重要...
XP小问题都能自己解决了,剩下的就是脚本了...
╰⋛⋋⊱⋋๑角⊱☠c色๑⋌⊰⋌⋚╯
回复 支持 反对

使用道具 举报

Lv3.寻梦者

○赛

梦石
0
星屑
1249
在线时间
1276 小时
注册时间
2013-1-22
帖子
2246

贵宾

3
发表于 2014-2-27 21:09:16 | 只看该作者
装备颜色啊,可以试试我的?设定在脚本里。。
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-30 14:32

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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