赞 | 23 |
VIP | 22 |
好人卡 | 18 |
积分 | 608 |
经验 | 44466 |
最后登录 | 2024-11-9 |
在线时间 | 1934 小时 |
Lv6.析梦学徒 Fuzzy Ginkgo Taciturn Knight
- 梦石
- 0
- 星屑
- 60819
- 在线时间
- 1934 小时
- 注册时间
- 2010-6-26
- 帖子
- 1605
|
本帖最后由 orzfly 于 2012-1-22 20:10 编辑
暂时只改了排版。
那个系统我觉得可能是先天性bug,物品的部分属性无法生效?
Window_Equip- #==============================================================================
- # ■ Window_Equip
- #------------------------------------------------------------------------------
- # 装备画面、显示角色现在装备的物品的窗口。
- #==============================================================================
- class Window_Equip < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化对象
- # x : 窗口的 X 坐标
- # y : 窗口的 Y 坐标
- # actor : 角色
- #--------------------------------------------------------------------------
- def initialize(x, y, actor)
- #super(x, y, 336, WLH * 5 + 32)
- super(x-60, y-56, 264+60, WLH * 5 + 32) #orzFly
- @actor = actor
- refresh
- self.index = 0
- end
- #--------------------------------------------------------------------------
- # ● 获取物品
- #--------------------------------------------------------------------------
- def item
- return @data[self.index]
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- @data = []
- for item in @actor.equips do @data.push(item) end
- @item_max = @data.size
- self.contents.font.color = system_color
- if @actor.two_swords_style
- self.contents.draw_text(4, WLH * 0, 25, WLH, Vocab::weapon1)
- self.contents.draw_text(4, WLH * 1, 25, WLH, Vocab::weapon2)
- else
- self.contents.draw_text(4, WLH * 0, 25, WLH, Vocab::weapon)
- self.contents.draw_text(4, WLH * 1, 25, WLH, Vocab::armor1)
- end
- self.contents.draw_text(4, WLH * 2, 25, WLH, Vocab::armor2)
- self.contents.draw_text(4, WLH * 3, 25, WLH, Vocab::armor3)
- self.contents.draw_text(4, WLH * 4, 25, WLH, Vocab::armor4)
- draw_item_name(@data[0], 30, WLH * 0)
- draw_item_name(@data[1], 30, WLH * 1)
- draw_item_name(@data[2], 30, WLH * 2)
- draw_item_name(@data[3], 30, WLH * 3)
- draw_item_name(@data[4], 30, WLH * 4)
- end
- #--------------------------------------------------------------------------
- # ● 更新帮助文本
- #--------------------------------------------------------------------------
- def update_help
- @help_window.set_text(item == nil ? "" : item.description)
- end
- end
复制代码 Window_EquipItem- #==============================================================================
- # ■ Window_EquipItem
- #------------------------------------------------------------------------------
- # 装备画面、显示变更装备时候补物品列表的窗口。
- #==============================================================================
- class Window_EquipItem < Window_Item
- #--------------------------------------------------------------------------
- # ● 初始化对象
- # x : 窗口的 X 坐标
- # y : 窗口的 Y 坐标
- # width : 窗口的宽
- # height : 窗口的高
- # actor : 角色
- # equip_type : 装备部位 (0~4)
- #--------------------------------------------------------------------------
- def initialize(x, y, width, height, actor, equip_type)
- @actor = actor
- if equip_type == 1 and actor.two_swords_style # 二刀流
- equip_type = 0 # 将盾更改为武器
- end
- @equip_type = equip_type
- super(x-60, y, width+60, height) #orzFly
- @column_max = 1 #orzFly
- refresh #orzFly
- end
- #--------------------------------------------------------------------------
- # ● 列表中包含的物品
- # item : 物品
- #--------------------------------------------------------------------------
- def include?(item)
- return true if item == nil
- if @equip_type == 0
- return false unless item.is_a?(RPG::Weapon)
- else
- return false unless item.is_a?(RPG::Armor)
- return false unless item.kind == @equip_type - 1
- end
- return @actor.equippable?(item)
- end
- #--------------------------------------------------------------------------
- # ● 是否可以使用物品
- # item : 物品
- #--------------------------------------------------------------------------
- def enable?(item)
- return true
- end
- end
复制代码 Window_EquipStatus【改】- #==============================================================================
- # ■ Window_EquipStatus
- #------------------------------------------------------------------------------
- # 装备画面、显示角色能力值变化的窗口。
- #==============================================================================
- class Window_EquipStatus < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对象
- # x : 窗口的 X 坐标
- # y : 窗口的 Y 坐标
- # actor : 角色
- #--------------------------------------------------------------------------
- def initialize(x, y, actor)
- #super(x, y, 208, WLH * 5 + 32)
- super(x, y-56, 280-60, 417) #orzFly4
- @actor = actor
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- #~ def refresh
- #~ self.contents.clear
- def refresh
- d=12.1
- self.contents.clear
- self.contents.font.size = 20
- draw_actor_name(@actor, 4, 0)
- self.contents.draw_text(4, 350, 145, 20, "(按<Q>或<W>切换)",2)
- draw_actor_level(@actor, x, y + WLH * 13)
- draw_actor_state(@actor, x, y + WLH * 1)
-
- self.contents.font.size = 16
- draw_parameter(0, WLH * 1, 0)
- draw_parameter(0, WLH * 2, 1)
- draw_parameter(0, WLH * 3, 2)
- draw_parameter(0, WLH * 4, 3)
- draw_parameter(0, WLH * 5, 4)
- draw_parameter(0, WLH * 6, 5)
- draw_parameter(0, WLH * 7, 6)
- draw_parameter(0, WLH * 8, 7)
- draw_parameter(0, WLH * 9, 8)
- draw_parameter(0, WLH * 10, 9)
- draw_parameter(0, WLH * 11, 10)
-
- end
- #--------------------------------------------------------------------------
- # ● 设置装备变更后的能力值
- # new_atk : 装备变更后的攻击力
- # new_def : 装备变更后的防御力
- # new_spi : 装备变更后的精神力
- # new_agi : 装备变更后的敏捷性
- #--------------------------------------------------------------------------
- def set_new_parameters(new_atk, new_def, new_spi, new_agi, new_eva, new_hit, new_cri, new_upexp, new_equip_chance, new_maxhp, new_maxmp)
- if @new_atk != new_atk or @new_def != new_def or
- @new_spi != new_spi or @new_agi != new_agi or @new_eva != new_eva or @new_hit != new_hit or @new_cri != new_cri or
- @new_upexp !=new_upexp or @new_equip_chance !=new_equip_chance or @new_maxhp !=new_maxhp or @new_maxmp !=new_maxmp
- @new_atk = new_atk
- @new_def = new_def
- @new_spi = new_spi
- @new_agi = new_agi
- @new_eva = new_eva
- @new_hit = new_hit
- @new_cri = new_cri
- @new_upexp = new_upexp
- @new_equip_chance = new_equip_chance
- @new_maxhp = new_maxhp
- @new_maxmp = new_maxmp
- refresh
- end
- end
- #--------------------------------------------------------------------------
- # ● 获取装备变更后的能力值描绘色
- # old_value : 装備変更前の能力値
- # new_value : 装備変更後の能力値
- #--------------------------------------------------------------------------
- def new_parameter_color(old_value, new_value)
- if new_value > old_value # 变强
- return power_up_color
- elsif new_value == old_value # 没有变化
- return normal_color
- else # 变弱
- return power_down_color
- end
- end
- #--------------------------------------------------------------------------
- # ● 描绘能力值
- # x : 描绘目标 X 坐标
- # y : 描绘目标 Y 坐标
- # type : 能力值种类 (0~3)
- #--------------------------------------------------------------------------
- def draw_parameter(x, y, type)
- self.contents.font.color = system_color#orzFly
- case type
- when 0
- name = Vocab::atk
- value = @actor.atk
- new_value = @new_atk
- when 1
- name = Vocab::def
- value = @actor.def
- new_value = @new_def
- when 2
- name = Vocab::spi
- value = @actor.spi
- new_value = @new_spi
- when 3
- name = Vocab::agi
- value = @actor.agi
- new_value = @new_agi
- when 4
- name = "闪躲"
- value = @actor.eva
- new_value = @new_eva
- when 5
- name = "命中"
- value = @actor.hit
- new_value = @new_hit
- when 6
- name = "会心一击%"
- value = @actor.cri
- new_value = @new_cri
- when 7
- name = "额外经验%"
- value = @actor.exp_added-100
- new_value = @new_upexp
- when 8
- name = "极品爆率%"
- value = @actor.equip_chance
- new_value = @new_equip_chance
- when 9
- name = "最大HP"
- value = @actor.maxhp
- new_value = @new_maxhp
- self.contents.font.color = Color.new(255,0,0) #RGB 改颜色
- when 10
- name = "最大MP"
- value = @actor.maxmp
- new_value = @new_maxmp
- self.contents.font.color = text_color(15) #改颜色
- end
- self.contents.draw_text(x + 4, y, 80, WLH, name)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 90, y, 30, WLH, value, 2)
- self.contents.font.color = system_color
- self.contents.draw_text(x + 122, y, 20, WLH, "→", 1)
- if new_value != nil
- self.contents.font.color = new_parameter_color(value, new_value)
- self.contents.draw_text(x + 142, y, 30, WLH, new_value, 2)
- end
- end
- end
复制代码 搜索#orzFly可以看到改动处 这个很简单很简单。
搜索 改颜色 可以看到改颜色的方法 应该已经通俗易懂了吧。
|
|