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

Project1

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

[已经解决] 如何修改装备界面能力值描绘文字的颜色

[复制链接]

Lv1.梦旅人

梦石
0
星屑
55
在线时间
71 小时
注册时间
2010-9-20
帖子
104
跳转到指定楼层
1
发表于 2014-9-24 04:25:17 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
能力值增加显示为绿色
能力值减少显示为红色
看着好别扭怎么让它们调换一下,增加红色减少绿色?
具体调整那个脚本?自查了一些脚本之后发现没有字体颜色更改的语句。

Lv3.寻梦者

灌水局大小姐

梦石
0
星屑
3810
在线时间
1690 小时
注册时间
2012-3-10
帖子
2469
2
发表于 2014-9-24 04:53:14 | 只看该作者
本帖最后由 YeYe. 于 2014-9-24 05:06 编辑

你是指默认脚本的属性增减时显示的颜色吗?

属性增加时显示绿色,减少时显示红色

RUBY 代码复制
  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. #==============================================================================
  4. #==============================================================================
  5. # ■ Window_Base
  6. #------------------------------------------------------------------------------
  7. #  游戏中全部窗口的超级类。
  8. #==============================================================================
  9. class Window_Base < Window
  10.   def up_color
  11.     return Color.new(0, 255, 0)
  12.   end
  13.   def down_color
  14.     return Color.new(255, 0, 0)
  15.   end
  16.   #--------------------------------------------------------------------------
  17.   # ● 描绘能力值
  18.   #     actor : 角色
  19.   #     x     : 描画目标 X 坐标
  20.   #     y     : 描画目标 Y 坐标
  21.   #     type  : 能力值种类 (0~6)
  22.   #--------------------------------------------------------------------------
  23.   def draw_actor_parameter(actor, x, y, type)
  24.     case type
  25.     when 0
  26.       parameter_name = $data_system.words.atk
  27.       parameter_value = actor.atk
  28.     when 1
  29.       parameter_name = $data_system.words.pdef
  30.       parameter_value = actor.pdef
  31.     when 2
  32.       parameter_name = $data_system.words.mdef
  33.       parameter_value = actor.mdef
  34.     when 3
  35.       parameter_name = $data_system.words.str
  36.       parameter_value = actor.str
  37.     when 4
  38.       parameter_name = $data_system.words.dex
  39.       parameter_value = actor.dex
  40.     when 5
  41.       parameter_name = $data_system.words.agi
  42.       parameter_value = actor.agi
  43.     when 6
  44.       parameter_name = $data_system.words.int
  45.       parameter_value = actor.int
  46.     ###############################################################
  47.     when 7
  48.       parameter_name = "回避"
  49.       parameter_value = actor.eva
  50.     end
  51.     self.contents.font.color = system_color
  52.     self.contents.draw_text(x, y, 120, 32, parameter_name)
  53.     self.contents.font.color = normal_color
  54.     self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2)
  55.   end
  56. end
  57. #==============================================================================
  58. # ■ Window_EquipLeft
  59. #------------------------------------------------------------------------------
  60. #  装备画面的、显示角色能力值变化的窗口。
  61. #==============================================================================
  62. class Window_EquipLeft < Window_Base
  63.   UP_ICON = "048-Skill05"
  64.   DOWN_ICON = "047-Skill04"
  65.   #--------------------------------------------------------------------------
  66.   # ● 初始化对像
  67.   #     actor : 角色
  68.   #--------------------------------------------------------------------------
  69.   def initialize(actor)
  70.     super(0, 64, 272, 416)
  71.     self.contents = Bitmap.new(width - 32, height - 32)
  72.     @actor = actor
  73.     refresh
  74.   end
  75.   #--------------------------------------------------------------------------
  76.   # ● 刷新
  77.   #--------------------------------------------------------------------------
  78.   def refresh
  79.     self.contents.clear
  80.     draw_actor_name(@actor, 4, 0)
  81.     draw_actor_level(@actor, 4, 32)
  82.     ###############################################################
  83.     draw_actor_parameter(@actor, 4, 64, 0)
  84.     draw_actor_parameter(@actor, 4, 96, 1)
  85.     draw_actor_parameter(@actor, 4, 128, 2)
  86.     draw_actor_parameter(@actor, 4, 160, 7)
  87.     draw_actor_parameter(@actor, 4, 192, 3)
  88.     draw_actor_parameter(@actor, 4, 224, 4)
  89.     draw_actor_parameter(@actor, 4, 256, 5)
  90.     draw_actor_parameter(@actor, 4, 288, 6)
  91.     if @new_atk != nil
  92.       if @new_atk > @actor.atk
  93.         self.contents.blt(164, 64, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
  94.       elsif @new_atk < @actor.atk
  95.         self.contents.blt(164, 64, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
  96.       end
  97.       self.contents.font.color = @new_atk>@actor.atk ? up_color : down_color
  98.       self.contents.font.color = normal_color if @new_atk == @actor.atk
  99.       self.contents.draw_text(200, 64, 36, 32, @new_atk.to_s, 2)
  100.     end
  101.     if @new_pdef != nil
  102.       if @new_pdef > @actor.pdef
  103.         self.contents.blt(164, 96, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
  104.       elsif @new_pdef < @actor.pdef
  105.         self.contents.blt(164, 96, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
  106.       end
  107.       self.contents.font.color = @new_pdef>@actor.pdef ? up_color : down_color
  108.       self.contents.font.color = normal_color if @new_pdef == @actor.pdef
  109.       self.contents.draw_text(200, 96, 36, 32, @new_pdef.to_s, 2)
  110.     end
  111.     if @new_mdef != nil
  112.       if @new_mdef > @actor.mdef
  113.         self.contents.blt(164, 128, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
  114.       elsif @new_mdef < @actor.mdef
  115.         self.contents.blt(164, 128, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
  116.       end
  117.       self.contents.font.color = @new_mdef>@actor.mdef ? up_color : down_color
  118.       self.contents.font.color = normal_color if @new_mdef == @actor.mdef
  119.       self.contents.draw_text(200, 128, 36, 32, @new_mdef.to_s, 2)
  120.     end
  121.     if @new_eva != nil
  122.       if @new_eva > @actor.eva
  123.         self.contents.blt(164, 160, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
  124.       elsif @new_eva < @actor.eva
  125.         self.contents.blt(164, 160, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
  126.       end
  127.       self.contents.font.color = @new_eva>@actor.eva ? up_color : down_color
  128.       self.contents.font.color = normal_color if @new_eva == @actor.eva
  129.       self.contents.draw_text(200, 160, 36, 32, @new_eva.to_s, 2)
  130.     end
  131.     if @new_str != nil
  132.       if @new_str > @actor.str
  133.         self.contents.blt(164, 192, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
  134.       elsif @new_str < @actor.str
  135.         self.contents.blt(164, 192, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
  136.       end
  137.       self.contents.font.color = @new_str>@actor.str ? up_color : down_color
  138.       self.contents.font.color = normal_color if @new_str == @actor.str
  139.       self.contents.draw_text(200, 192, 36, 32, @new_str.to_s, 2)
  140.     end
  141.     if @new_dex != nil
  142.       if @new_dex > @actor.dex
  143.         self.contents.blt(164, 224, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
  144.       elsif @new_dex < @actor.dex
  145.         self.contents.blt(164, 224, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
  146.       end
  147.       self.contents.font.color = @new_dex>@actor.dex ? up_color : down_color
  148.       self.contents.font.color = normal_color if @new_dex == @actor.dex
  149.       self.contents.draw_text(200, 224, 36, 32, @new_dex.to_s, 2)
  150.     end
  151.     if @new_agi != nil
  152.       if @new_agi > @actor.agi
  153.         self.contents.blt(164, 256, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
  154.       elsif @new_agi < @actor.agi
  155.         self.contents.blt(164, 256, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
  156.       end
  157.       self.contents.font.color = @new_agi>@actor.agi ? up_color : down_color
  158.       self.contents.font.color = normal_color if @new_agi == @actor.agi
  159.       self.contents.draw_text(200, 256, 36, 32, @new_agi.to_s, 2)
  160.     end
  161.     if @new_int != nil
  162.       if @new_int > @actor.int
  163.         self.contents.blt(164, 288, RPG::Cache.icon(UP_ICON), Rect.new(0, 0, 24, 24))
  164.       elsif @new_int < @actor.int
  165.         self.contents.blt(164, 288, RPG::Cache.icon(DOWN_ICON), Rect.new(0, 0, 24, 24))
  166.       end
  167.       self.contents.font.color = @new_int>@actor.int ? up_color : down_color
  168.       self.contents.font.color = normal_color if @new_int == @actor.int
  169.       self.contents.draw_text(200, 288, 36, 32, @new_int.to_s, 2)
  170.     end
  171.   end
  172.   #--------------------------------------------------------------------------
  173.   # ● 变更装备后的能力值设置
  174.   #     new_atk  : 变更装备后的攻击力
  175.   #     new_pdef : 变更装备后的物理防御
  176.   #     new_mdef : 变更装备后的魔法防御
  177.   #--------------------------------------------------------------------------
  178.     ###############################################################
  179.   def set_new_parameters(new_atk, new_pdef, new_mdef, new_eva, new_str, new_dex, new_agi, new_int)
  180.     if @new_atk != new_atk or @new_pdef !=new_pdef or @new_mdef != new_mdef or @new_eva != new_eva or @new_str != new_str or @new_dex !=new_dex or @new_agi != new_agi or @new_int != new_int
  181.       @new_atk = new_atk
  182.       @new_pdef = new_pdef
  183.       @new_mdef = new_mdef
  184.       @new_eva = new_eva
  185.       @new_str = new_str
  186.       @new_dex = new_dex
  187.       @new_agi = new_agi
  188.       @new_int = new_int
  189.       refresh
  190.     end
  191.   end
  192. end
  193. #==============================================================================
  194. # ■ Window_EquipItem
  195. #------------------------------------------------------------------------------
  196. #  装备画面、显示浏览变更装备的候补物品的窗口。
  197. #==============================================================================
  198. class Window_EquipItem < Window_Selectable
  199.   #--------------------------------------------------------------------------
  200.   # ● 初始化对像
  201.   #     actor      : 角色
  202.   #     equip_type : 装备部位 (0~3)
  203.   #--------------------------------------------------------------------------
  204.   def initialize(actor, equip_type)
  205.     ################改了改坐标和高度#################################
  206.     super(272, 256, 368, 224)
  207.     @actor = actor
  208.     @equip_type = equip_type
  209.     @column_max = 1
  210.     refresh
  211.     self.active = false
  212.     self.index = -1
  213.   end
  214.   #--------------------------------------------------------------------------
  215.   # ● 项目的描绘
  216.   #     index : 项目符号
  217.   #--------------------------------------------------------------------------
  218.   def draw_item(index)
  219.     item = @data[index]
  220.     ################改了改坐标#################################
  221.     x = 4
  222.     y = index * 32
  223.     case item
  224.     when RPG::Weapon
  225.       number = $game_party.weapon_number(item.id)
  226.     when RPG::Armor
  227.       number = $game_party.armor_number(item.id)
  228.     end
  229.     bitmap = RPG::Cache.icon(item.icon_name)
  230.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
  231.     self.contents.font.color = normal_color
  232.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  233.     self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
  234.     self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
  235.   end
  236. end
  237. #==============================================================================
  238. # ■ Scene_Equip
  239. #------------------------------------------------------------------------------
  240. #  处理装备画面的类。
  241. #==============================================================================
  242. class Scene_Equip
  243.   #--------------------------------------------------------------------------
  244.   # ● 刷新
  245.   #--------------------------------------------------------------------------
  246.   def refresh
  247.     # 设置物品窗口的可视状态
  248.     @item_window1.visible = (@right_window.index == 0)
  249.     @item_window2.visible = (@right_window.index == 1)
  250.     @item_window3.visible = (@right_window.index == 2)
  251.     @item_window4.visible = (@right_window.index == 3)
  252.     @item_window5.visible = (@right_window.index == 4)
  253.     # 获取当前装备中的物品
  254.     item1 = @right_window.item
  255.     # 设置当前的物品窗口到 @item_window
  256.     case @right_window.index
  257.     when 0
  258.       @item_window = @item_window1
  259.     when 1
  260.       @item_window = @item_window2
  261.     when 2
  262.       @item_window = @item_window3
  263.     when 3
  264.       @item_window = @item_window4
  265.     when 4
  266.       @item_window = @item_window5
  267.     end
  268.     # 右窗口被激活的情况下
  269.     if @right_window.active
  270.       # 删除变更装备后的能力
  271.     ###############################################################
  272.       @left_window.set_new_parameters(nil, nil, nil, nil, nil, nil, nil, nil)
  273.     end
  274.     # 物品窗口被激活的情况下
  275.     if @item_window.active
  276.       # 获取现在选中的物品
  277.       item2 = @item_window.item
  278.       # 变更装备
  279.       last_hp = @actor.hp
  280.       last_sp = @actor.sp
  281.       @actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
  282.       # 获取变更装备后的能力值
  283.     ###############################################################
  284.       new_atk = @actor.atk
  285.       new_pdef = @actor.pdef
  286.       new_mdef = @actor.mdef
  287.       new_eva = @actor.eva
  288.       new_str = @actor.str
  289.       new_dex = @actor.dex
  290.       new_agi = @actor.agi
  291.       new_int = @actor.int
  292.       # 返回到装备
  293.       @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
  294.       @actor.hp = last_hp
  295.       @actor.sp = last_sp
  296.       # 描画左窗口
  297.     ###############################################################
  298.       @left_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_eva, new_str, new_dex, new_agi, new_int)
  299.     end
  300.   end
  301. end
  302. #==============================================================================
  303. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  304. #==============================================================================

评分

参与人数 1梦石 +1 收起 理由
RyanBern + 1 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
71 小时
注册时间
2010-9-20
帖子
104
3
 楼主| 发表于 2014-9-24 10:59:37 | 只看该作者
YeYe. 发表于 2014-9-24 04:53
你是指默认脚本的属性增减时显示的颜色吗?

属性增加时显示绿色,减少时显示红色

果然变过来了=3= 谢谢大神=3=
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-21 14:48

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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