赞 | 0 |
VIP | 313 |
好人卡 | 0 |
积分 | 1 |
经验 | 6681 |
最后登录 | 2024-1-20 |
在线时间 | 66 小时 |
Lv1.梦旅人 蚂蚁卡卡
- 梦石
- 0
- 星屑
- 116
- 在线时间
- 66 小时
- 注册时间
- 2007-12-16
- 帖子
- 3081
|
- #==============================================================================
- # ■ Window_MenuEquip
- #------------------------------------------------------------------------------
- # 显示菜单画面中经过装备时的窗口。
- #==============================================================================
- class Window_MenuEquip < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化目标
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, 160, 352)
- self.contents = Bitmap.new(width - 32, height - 32)
- refresh
- self.active = false
- self.index = -1
- @color_box = [0,0,0]
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- @item_max = $game_party.actors.size
- for i in 0...$game_party.actors.size
- x = 64
- y = i * 80
- actor = $game_party.actors[i]
- bitmap = Bitmap.new("Graphics/system/menu/headp/" + actor.name + ".png")
- src_rect = Rect.new(0, 0, 42, 66)
- self.contents.blt(x - 64, y + 10, bitmap, src_rect)
- self.draw_actor_state(actor, x - 60, y + 34 + 17)
- # 我全写成散的! =。=
- self.contents.font.color = normal_color
- self.contents.font.size = 20
- self.contents.draw_text(x - 30, y, 120, 32, actor.name)
- self.contents.font.color = system_color
- self.contents.font.color = normal_color
- self.contents.font.size = 16
- self.contents.font.color = system_color
- self.contents.draw_text(x - 30, y + 17 + 17, 32, 32, $data_system.words.hp)
- self.contents.font.color = actor.hp == 0 ? knockout_color :
- actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
- self.contents.draw_text(x - 6, y + 17 + 17, 32, 32, actor.hp.to_s, 2)
- self.contents.font.color = normal_color
- self.contents.draw_text(x - 26 + 48, y + 17 + 17, 12, 32, "/", 1)
- self.contents.draw_text(x - 24 + 56, y + 17 + 17, 32, 32, actor.maxhp.to_s)
- self.contents.font.color = system_color
- self.contents.draw_text(x - 30, y + 34 +17, 32, 32, $data_system.words.sp)
- self.contents.font.color = actor.sp == 0 ? knockout_color :
- actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
- self.contents.draw_text(x - 6, y + 34 + 17, 32, 32, actor.sp.to_s, 2)
- self.contents.font.color = normal_color
- self.contents.draw_text(x - 26 + 48, y + 34 + 17, 12, 32, "/", 1)
- self.contents.draw_text(x - 24 + 56, y + 34 + 17, 32, 32, actor.maxsp.to_s)
-
- self.contents.font.color = system_color
- self.contents.font.size = 16
- # self.contents.draw_text(x - 35, y + 17, 44, 32, $data_system.words.atk)
- # self.contents.draw_text(x - 35, y + 17 + 17, 44, 32, $data_system.words.pdef)
- # self.contents.draw_text(x - 35, y + 17 + 17 + 17, 44, 32, $data_system.words.mdef)
- self.contents.font.color = normal_color
- self.contents.font.size = 20
- self.contents.draw_text(x - 30, y, 160, 32, actor.name)
- self.contents.font.size = 16
- #self.contents.draw_text(x-10, y + 17, 36, 32, actor.atk.to_s, 2)
- # self.contents.draw_text(x-10, y + 17 + 17, 36, 32, actor.pdef.to_s, 2)
- #self.contents.draw_text(x-10, y + 17 + 17 + 17, 36, 32, actor.mdef.to_s, 2)
- if @actor_index == i
- if @new_atk != nil
- @color_box[0] = @new_atk <=> actor.atk
- self.contents.font.size = 12
- self.contents.font.color = system_color
- self.contents.draw_text(x+12, y + 17, 40, 32, "→", 1)
- self.contents.font.size = 16
- self.contents.font.color = @color_box[0] == -1 ? Color.new(0,255,0) : (@color_box[0] == 1 ? Color.new(255,0,0) : normal_color)
- # self.contents.draw_text(x+24, y + 17, 36, 32, @new_atk.to_s, 2)
- end
- if @new_pdef != nil
- @color_box[1] = @new_pdef <=> actor.pdef
- self.contents.font.size = 12
- self.contents.font.color = system_color
- self.contents.draw_text(x+12, y + 17 + 17, 40, 32, "→", 1)
- self.contents.font.size = 16
- self.contents.font.color = @color_box[1] == -1 ? Color.new(0,255,0) : (@color_box[1] == 1 ? Color.new(255,0,0) : normal_color)
- # self.contents.draw_text(x+24, y + 17 + 17, 36, 32, @new_pdef.to_s, 2)
- end
- if @new_mdef != nil
- @color_box[2] = @new_mdef <=> actor.mdef
- self.contents.font.size = 12
- self.contents.font.color = system_color
- self.contents.draw_text(x+12, y + 17 + 17 + 17, 40, 32, "→", 1)
- self.contents.font.size = 16
- self.contents.font.color = @color_box[2] == -1 ? Color.new(0,255,0) : (@color_box[2] == 1 ? Color.new(255,0,0) : normal_color)
- # self.contents.draw_text(x+24, y + 17 + 17 + 17, 36, 32, @new_mdef.to_s, 2)
- end
- end
-
-
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新光标矩形
- #--------------------------------------------------------------------------
- def update_cursor_rect
- if @index < 0
- self.cursor_rect.empty
- else
- self.cursor_rect.set(0, @index * 80, self.width - 32, 80)
- end
- end
- #--------------------------------------------------------------------------
- # ● 变更装备后的能力值设置
- # new_atk : 变更装备后的攻击力
- # new_pdef : 变更装备后的物理防御
- # new_mdef : 变更装备后的魔法防御
- #--------------------------------------------------------------------------
- def set_new_parameters(new_atk, new_pdef, new_mdef, actor_index = -1)
- if @new_atk != new_atk or @new_pdef != new_pdef or @new_mdef != new_mdef
- @new_atk = new_atk
- @new_pdef = new_pdef
- @new_mdef = new_mdef
- refresh
- end
- @actor_index = actor_index if actor_index != -1
- end
- end
复制代码
覆盖 Window_MenuEquip New!
请LZ回复 |
|