| 
 
| 赞 | 0 |  
| VIP | 1 |  
| 好人卡 | 0 |  
| 积分 | 1 |  
| 经验 | 1054 |  
| 最后登录 | 2014-5-30 |  
| 在线时间 | 49 小时 |  
 Lv1.梦旅人 
	梦石0 星屑50 在线时间49 小时注册时间2013-5-23帖子16 | 
| 
本帖最后由 skgame 于 2013-6-9 21:23 编辑
x
加入我们,或者,欢迎回来。您需要 登录 才可以下载或查看,没有帐号?注册会员  
 
   
 
 #==============================================================================# ■ Window_EquipStatus#------------------------------------------------------------------------------#  装備画面で、アクターの能力値変化を表示するウィンドウです。#============================================================================== class Window_EquipStatus < Window_Base  #--------------------------------------------------------------------------  # ● オブジェクト初期化  #--------------------------------------------------------------------------  def initialize(x, y)    super(x, y, 250, 300)    [url=home.php?mod=space&uid=95897]@actor[/url] = nil    @temp_actor = nil    refresh   end  #--------------------------------------------------------------------------  # ● ウィンドウ幅の取得  #--------------------------------------------------------------------------  def window_width    return 250  end  #--------------------------------------------------------------------------  # ● ウィンドウ高さの取得  #--------------------------------------------------------------------------  def window_height    fitting_height(visible_line_number)  end  #--------------------------------------------------------------------------  # ● 表示行数の取得  #--------------------------------------------------------------------------  def visible_line_number    return 12  end  #--------------------------------------------------------------------------  # ● アクターの設定  #--------------------------------------------------------------------------  def actor=(actor)    return if @actor == actor    @actor = actor    refresh  end  #--------------------------------------------------------------------------  # ● リフレッシュ 定义状态栏显示项目  #--------------------------------------------------------------------------  def refresh    contents.clear    return unless @actor    @actor_sprite = Sprite.new      #定义角色头像     @actor_sprite.bitmap = Cache.system(@actor.name)  #定义角色头像路径system下    @actor_sprite.opacity = 255      #定义角色头像 不透明     #draw_actor_face(@actor, 0, 0)    #draw_actor_hp(@actor, 50, 0, width = 75)    #draw_actor_mp(@actor, 130, 0, width = 75)    #draw_actor_level(@actor, 100, 0)    draw_actor_name(@actor, 0, 0) if @actor     draw_xparam_name(x + 4, y)    draw_current_xparam(x + 94, y) if @actor    draw_right_arrow_2(x + 126, y)    draw_new_xparam(x + 150, y) if @temp_actor     8.times {|i| draw_item(0, line_height * (1 + i), i) }  end  #--------------------------------------------------------------------------  # ● 装備変更後の一時アクター設定  #--------------------------------------------------------------------------  def set_temp_actor(temp_actor)    return if @temp_actor == temp_actor    @temp_actor = temp_actor    refresh  end  #--------------------------------------------------------------------------  # ● 項目の描画  #--------------------------------------------------------------------------  def draw_item(x, y, param_id)    #draw_actor_face(@actor, 0, 0)    draw_param_name(x + 4, y, param_id)    draw_current_param(x + 94, y, param_id) if @actor  #94    draw_right_arrow(x + 126, y)   #126    draw_new_param(x + 150, y, param_id) if @temp_actor  end  #--------------------------------------------------------------------------  # ● 能力値の名前を描画  #--------------------------------------------------------------------------  def draw_param_name(x, y, param_id)    change_color(system_color)    draw_text(x, y, 80, line_height, Vocab::param(param_id))  end  #--------------------------------------------------------------------------  # ● 現在の能力値を描画  #--------------------------------------------------------------------------  def draw_current_param(x, y, param_id)    change_color(normal_color)    draw_text(x, y, 32, line_height, @actor.param(param_id), 2)  end  #--------------------------------------------------------------------------  # ● 右向き矢印を描画  #--------------------------------------------------------------------------  def draw_right_arrow(x, y)    change_color(system_color)    draw_text(x, y, 22, line_height, "→", 1)  end  #--------------------------------------------------------------------------  # ● 装備変更後の能力値を描画  #--------------------------------------------------------------------------  def draw_new_param(x, y, param_id)    new_value = @temp_actor.param(param_id)    change_color(param_change_color(new_value - @actor.param(param_id)))    draw_text(x, y, 32, line_height, new_value, 2)  end   #--------------------------------------------------------------------------  # ● 绘制额外能力值的名字  #--------------------------------------------------------------------------  def draw_xparam_name(x, y)    change_color(system_color)    self.contents.font.size = 20    draw_text(x, y + line_height * 9, 80, line_height, "命中率")    draw_text(x, y + line_height * 10 , 80, line_height, "回避率")    draw_text(x, y + line_height * 11 , 80, line_height, "必杀率")    #self.contents.font.size = 18  end  #--------------------------------------------------------------------------  # ● 绘制额外当前能力值  #--------------------------------------------------------------------------  def draw_current_xparam(x, y)    change_color(normal_color)    self.contents.font.size = 20    hit = @actor.xparam(0) * 100    eva = @actor.xparam(1) * 100    cri = @actor.xparam(2) * 100    draw_text(x, y + line_height * 9, 32, line_height, hit.round)    draw_text(x, y + line_height * 10, 32, line_height, eva.round)    draw_text(x, y + line_height * 11, 32, line_height, cri.round)   end  #--------------------------------------------------------------------------  # ● 绘制额外右方向箭头  #--------------------------------------------------------------------------  def draw_right_arrow_2(x, y)    change_color(system_color)    draw_text(x, y + line_height * 9, 22, line_height, "→", 1)    draw_text(x, y + line_height * 10, 22, line_height, "→", 1)    draw_text(x, y + line_height * 11, 22, line_height, "→", 1)    self.contents.font.size = 20  end  #--------------------------------------------------------------------------  # ● 绘制更换装备后的额外能力值  #--------------------------------------------------------------------------  def draw_new_xparam(x, y)    new_hit = @temp_actor.xparam(0) * 100    change_color(param_change_color(new_hit - @actor.xparam(0)*100))    draw_text(x, y+ line_height * 9, 32, line_height, new_hit.round, 2)    new_eva = @temp_actor.xparam(1) * 100    change_color(param_change_color(new_eva - @actor.xparam(1)*100))    draw_text(x, y+ line_height * 10, 32, line_height, new_eva.round, 2)    new_cri = @temp_actor.xparam(2) * 100    change_color(param_change_color(new_cri - @actor.xparam(2)*100))    draw_text(x, y+ line_height * 11, 32, line_height, new_cri.round, 2)    self.contents.font.size = 20  endend
#============================================================================== 
# ■ Window_EquipStatus 
#------------------------------------------------------------------------------ 
#  装備画面で、アクターの能力値変化を表示するウィンドウです。 
#============================================================================== 
  
class Window_EquipStatus < Window_Base 
  #-------------------------------------------------------------------------- 
  # ● オブジェクト初期化 
  #-------------------------------------------------------------------------- 
  def initialize(x, y) 
    super(x, y, 250, 300) 
    [url=home.php?mod=space&uid=95897]@actor[/url] = nil 
    @temp_actor = nil 
    refresh 
  
  end 
  #-------------------------------------------------------------------------- 
  # ● ウィンドウ幅の取得 
  #-------------------------------------------------------------------------- 
  def window_width 
    return 250 
  end 
  #-------------------------------------------------------------------------- 
  # ● ウィンドウ高さの取得 
  #-------------------------------------------------------------------------- 
  def window_height 
    fitting_height(visible_line_number) 
  end 
  #-------------------------------------------------------------------------- 
  # ● 表示行数の取得 
  #-------------------------------------------------------------------------- 
  def visible_line_number 
    return 12 
  end 
  #-------------------------------------------------------------------------- 
  # ● アクターの設定 
  #-------------------------------------------------------------------------- 
  def actor=(actor) 
    return if @actor == actor 
    @actor = actor 
    refresh 
  end 
  #-------------------------------------------------------------------------- 
  # ● リフレッシュ 定义状态栏显示项目 
  #-------------------------------------------------------------------------- 
  def refresh 
    contents.clear 
    return unless @actor 
    @actor_sprite = Sprite.new      #定义角色头像 
  
    @actor_sprite.bitmap = Cache.system(@actor.name)  #定义角色头像路径system下 
    @actor_sprite.opacity = 255      #定义角色头像 不透明 
  
    #draw_actor_face(@actor, 0, 0) 
    #draw_actor_hp(@actor, 50, 0, width = 75) 
    #draw_actor_mp(@actor, 130, 0, width = 75) 
    #draw_actor_level(@actor, 100, 0) 
    draw_actor_name(@actor, 0, 0) if @actor 
  
    draw_xparam_name(x + 4, y) 
    draw_current_xparam(x + 94, y) if @actor 
    draw_right_arrow_2(x + 126, y) 
    draw_new_xparam(x + 150, y) if @temp_actor 
  
    8.times {|i| draw_item(0, line_height * (1 + i), i) } 
  end 
  #-------------------------------------------------------------------------- 
  # ● 装備変更後の一時アクター設定 
  #-------------------------------------------------------------------------- 
  def set_temp_actor(temp_actor) 
    return if @temp_actor == temp_actor 
    @temp_actor = temp_actor 
    refresh 
  end 
  #-------------------------------------------------------------------------- 
  # ● 項目の描画 
  #-------------------------------------------------------------------------- 
  def draw_item(x, y, param_id) 
    #draw_actor_face(@actor, 0, 0) 
    draw_param_name(x + 4, y, param_id) 
    draw_current_param(x + 94, y, param_id) if @actor  #94 
    draw_right_arrow(x + 126, y)   #126 
    draw_new_param(x + 150, y, param_id) if @temp_actor 
  end 
  #-------------------------------------------------------------------------- 
  # ● 能力値の名前を描画 
  #-------------------------------------------------------------------------- 
  def draw_param_name(x, y, param_id) 
    change_color(system_color) 
    draw_text(x, y, 80, line_height, Vocab::param(param_id)) 
  end 
  #-------------------------------------------------------------------------- 
  # ● 現在の能力値を描画 
  #-------------------------------------------------------------------------- 
  def draw_current_param(x, y, param_id) 
    change_color(normal_color) 
    draw_text(x, y, 32, line_height, @actor.param(param_id), 2) 
  end 
  #-------------------------------------------------------------------------- 
  # ● 右向き矢印を描画 
  #-------------------------------------------------------------------------- 
  def draw_right_arrow(x, y) 
    change_color(system_color) 
    draw_text(x, y, 22, line_height, "→", 1) 
  end 
  #-------------------------------------------------------------------------- 
  # ● 装備変更後の能力値を描画 
  #-------------------------------------------------------------------------- 
  def draw_new_param(x, y, param_id) 
    new_value = @temp_actor.param(param_id) 
    change_color(param_change_color(new_value - @actor.param(param_id))) 
    draw_text(x, y, 32, line_height, new_value, 2) 
  end 
   #-------------------------------------------------------------------------- 
  # ● 绘制额外能力值的名字 
  #-------------------------------------------------------------------------- 
  def draw_xparam_name(x, y) 
    change_color(system_color) 
    self.contents.font.size = 20 
    draw_text(x, y + line_height * 9, 80, line_height, "命中率") 
    draw_text(x, y + line_height * 10 , 80, line_height, "回避率") 
    draw_text(x, y + line_height * 11 , 80, line_height, "必杀率") 
    #self.contents.font.size = 18 
  end 
  #-------------------------------------------------------------------------- 
  # ● 绘制额外当前能力值 
  #-------------------------------------------------------------------------- 
  def draw_current_xparam(x, y) 
    change_color(normal_color) 
    self.contents.font.size = 20 
    hit = @actor.xparam(0) * 100 
    eva = @actor.xparam(1) * 100 
    cri = @actor.xparam(2) * 100 
    draw_text(x, y + line_height * 9, 32, line_height, hit.round) 
    draw_text(x, y + line_height * 10, 32, line_height, eva.round) 
    draw_text(x, y + line_height * 11, 32, line_height, cri.round) 
  
  end 
  #-------------------------------------------------------------------------- 
  # ● 绘制额外右方向箭头 
  #-------------------------------------------------------------------------- 
  def draw_right_arrow_2(x, y) 
    change_color(system_color) 
    draw_text(x, y + line_height * 9, 22, line_height, "→", 1) 
    draw_text(x, y + line_height * 10, 22, line_height, "→", 1) 
    draw_text(x, y + line_height * 11, 22, line_height, "→", 1) 
    self.contents.font.size = 20 
  end 
  #-------------------------------------------------------------------------- 
  # ● 绘制更换装备后的额外能力值 
  #-------------------------------------------------------------------------- 
  def draw_new_xparam(x, y) 
    new_hit = @temp_actor.xparam(0) * 100 
    change_color(param_change_color(new_hit - @actor.xparam(0)*100)) 
    draw_text(x, y+ line_height * 9, 32, line_height, new_hit.round, 2) 
    new_eva = @temp_actor.xparam(1) * 100 
    change_color(param_change_color(new_eva - @actor.xparam(1)*100)) 
    draw_text(x, y+ line_height * 10, 32, line_height, new_eva.round, 2) 
    new_cri = @temp_actor.xparam(2) * 100 
    change_color(param_change_color(new_cri - @actor.xparam(2)*100)) 
    draw_text(x, y+ line_height * 11, 32, line_height, new_cri.round, 2) 
    self.contents.font.size = 20 
  end 
end 
 求帮助,谢谢~!
 | 
 |