| 
 
| 赞 | 0 |  
| VIP | 0 |  
| 好人卡 | 20 |  
| 积分 | 17 |  
| 经验 | 42858 |  
| 最后登录 | 2025-10-19 |  
| 在线时间 | 761 小时 |  
 Lv3.寻梦者 
	梦石0 星屑1731 在线时间761 小时注册时间2013-9-23帖子211 
 | 
| 本帖最后由 午睡的风铃 于 2015-10-28 14:14 编辑 
 这绝对是我之前瞎改脚本改出的问题(─.─|||
 下面重新改了下,你测试下,把之前的那个删掉吧。
 说来哥们初中毕业,英语考分个位数,对各种语言一窍不通,改脚本全靠脸熟= =!  如果再有问题我尽量解决。
 
   复制代码#==============================================================================
# ■ Game_Actor
#==============================================================================
# 截图上的坐标,这部分来自你那个工程的最后一段里,可以删掉。
class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # ● 战斗者调 X 坐标。
  #--------------------------------------------------------------------------
  def screen_x
    if self.index != nil
      case self.index
      when 0          
        return 270
      when 1
        return 340
      when 2
        return 410
      when 3
        return 480
      end
    else
      return 0
    end
  end
  #--------------------------------------------------------------------------
  # ● 战斗者调 Y 坐标。
  #--------------------------------------------------------------------------
  def screen_y
    if self.index != nil
      case self.index
      when 0           
        return 400
      when 1
        return 360
      when 2
        return 320
      when 3
        return 280
      end
    else
      return 0
    end
  end
end
# ↑↑↑ -=-=- 以上部分请删除 -=-=-
#==============================================================================
# ■ Window_BattleStatus
#==============================================================================
class Window_BattleStatus2 < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 初始化对象
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, window_width, window_height)
    refresh
    self.opacity = 0
    self.openness = 0
  end
  #--------------------------------------------------------------------------
  # ● 获取窗口的宽度
  #--------------------------------------------------------------------------
  def window_width
    Graphics.width - 200
  end
  #--------------------------------------------------------------------------
  # ● 获取窗口的高度
  #--------------------------------------------------------------------------
  def window_height
    Graphics.height + 200
  end
  #--------------------------------------------------------------------------
  # ● 获取项目数
  #--------------------------------------------------------------------------
  def item_max
    $game_party.battle_members.size
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    draw_all_items
  end
  #--------------------------------------------------------------------------
  # ● 绘制项目
  #--------------------------------------------------------------------------
  def draw_item(index)
    actor = $game_party.battle_members[index]
    draw_basic_area(basic_area_rect(index), actor)
    draw_gauge_area(gauge_area_rect(index), actor)
  end
  #--------------------------------------------------------------------------
  # ● 获取基本区域的矩形
  #--------------------------------------------------------------------------
  def basic_area_rect(index)
    rect = item_rect_for_text(index)
    rect.width -= gauge_area_width + 10
    rect
  end
  #--------------------------------------------------------------------------
  # ● 获取值槽区域的矩形
  #--------------------------------------------------------------------------
  def gauge_area_rect(index)
    rect = item_rect_for_text(index)
    rect.x += rect.width - gauge_area_width
    rect.width = gauge_area_width
    rect
  end
  #--------------------------------------------------------------------------
  # ● 获取值槽区域的宽度
  #--------------------------------------------------------------------------
  def gauge_area_width
    return 220
  end
  #--------------------------------------------------------------------------
  # ● 绘制基本区域
  #--------------------------------------------------------------------------
  def draw_basic_area(rect, actor)
    # 乌鸦飞过....
  end
  #--------------------------------------------------------------------------
  # ● 绘制值槽区域
  #--------------------------------------------------------------------------
  def draw_gauge_area(rect, actor)
    if $data_system.opt_display_tp
      draw_gauge_area_with_tp(rect, actor)
    else
      draw_gauge_area_without_tp(rect, actor)
    end
  end
  #--------------------------------------------------------------------------
  # ● 绘制值槽区域(包括 TP)
  #--------------------------------------------------------------------------
  def draw_gauge_area_with_tp(rect, actor)
    contents.font.size = 18
    ax = actor.screen_x - 240
    ay = actor.screen_y + 116
    draw_text(ax, ay,      30, line_height, "HP")
    draw_text(ax, ay + 16, 30, line_height, "MP")
    draw_text(ax, ay + 32, 30, line_height, "TP")
    draw_text(ax + 8, ay,      52, line_height, actor.hp, 2)
    draw_text(ax + 8, ay + 16, 52, line_height, actor.mp, 2)
    draw_text(ax + 8, ay + 32, 52, line_height, actor.tp.to_i, 2)
  end
  #--------------------------------------------------------------------------
  # ● 绘制值槽区域(不包括 TP)
  #--------------------------------------------------------------------------
  def draw_gauge_area_without_tp(rect, actor)
    contents.font.size = 18
    ax = actor.screen_x - 240
    ay = actor.screen_y + 132
    draw_text(ax, ay,      30, line_height, "HP")
    draw_text(ax, ay + 16, 30, line_height, "MP")
    draw_text(ax + 8, ay,      52, line_height, actor.hp, 2)
    draw_text(ax + 8, ay + 16, 52, line_height, actor.mp, 2)
  end
end
#==============================================================================
# ■ Window_PartyCommand
#==============================================================================
class Window_PartyCommand < Window_Command
  #--------------------------------------------------------------------------
  # ● 初始化对象
  #--------------------------------------------------------------------------
  def initialize
    super(388, 372)
    self.openness = 0
    deactivate
  end
  #--------------------------------------------------------------------------
  # ● 获取窗口的宽度
  #--------------------------------------------------------------------------
  def window_width
    return 96
  end
  #--------------------------------------------------------------------------
  # ● 获取显示行数
  #--------------------------------------------------------------------------
  def visible_line_number
    return 2
  end
  #--------------------------------------------------------------------------
  # ● 获取对齐方式
  #--------------------------------------------------------------------------
  def alignment
    return 1
  end
end
#==============================================================================
# ■ Window_ActorCommand
#==============================================================================
class Window_ActorCommand < Window_Command
  #--------------------------------------------------------------------------
  # ● 获取对齐方式
  #--------------------------------------------------------------------------
  def alignment
    return 1
  end
  #--------------------------------------------------------------------------
  # ● 获取窗口的宽度
  #--------------------------------------------------------------------------
  def window_width
    return 96
  end
  #--------------------------------------------------------------------------
  # ● 设置
  #--------------------------------------------------------------------------
  def setup(actor)
    @actor = actor
    self.x = actor.screen_x - self.width / 2
    self.y = actor.screen_y - 240
    clear_command_list
    make_command_list
    refresh
    select(0)
    show.activate
    open
  end
end
#==============================================================================
# ■ Window_BattleEnemy
#==============================================================================
class Window_BattleEnemy < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 显示窗口
  #--------------------------------------------------------------------------
  def show
    if @info_viewport
      width_remain = Graphics.width
      self.x = 0
      @info_viewport.rect.width = width_remain
      select(0)
    end
    super
  end
end
#==============================================================================
# ■ Window_BattleSkill
#==============================================================================
class Window_BattleSkill < Window_SkillList
  #--------------------------------------------------------------------------
  # ● 初始化对象
  #--------------------------------------------------------------------------
  def initialize(help_window, info_viewport)
    y = help_window.height
    super(0, y, Graphics.width, Graphics.height - help_window.height)
    self.visible = false
    @help_window = help_window
    @info_viewport = info_viewport
  end
end
#==============================================================================
# ■ Window_BattleItem
#==============================================================================
class Window_BattleItem < Window_ItemList
  #--------------------------------------------------------------------------
  # ● 初始化对象
  #--------------------------------------------------------------------------
  def initialize(help_window, info_viewport)
    y = help_window.height
    super(0, y, Graphics.width, Graphics.height - help_window.height)
    self.visible = false
    @help_window = help_window
    @info_viewport = info_viewport
  end
end
#==============================================================================
# ■ Scene_Battle
#==============================================================================
class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # ● 更新信息显示的显示端口
  #--------------------------------------------------------------------------
  def update_info_viewport
    move_info_viewport(320) if @party_command_window.active
    move_info_viewport(320) if @actor_command_window.active
    move_info_viewport(0) if BattleManager.in_turn?
  end
  #--------------------------------------------------------------------------
  # ● 生成状态窗口
  #--------------------------------------------------------------------------
  def create_status_window
    @status_window = Window_BattleStatus2.new
    @status_window.x = 520
    @status_window.y = -200
  end
  #--------------------------------------------------------------------------
  # ● 生成信息显示的显示端口
  #--------------------------------------------------------------------------
  def create_info_viewport
    @info_viewport = Viewport.new
    @info_viewport.rect.y = 0
    @info_viewport.rect.height = Graphics.height
    @info_viewport.z = 100
    @info_viewport.ox = 64
    @status_window.viewport = @info_viewport
  end
  #--------------------------------------------------------------------------
  # ● 生成队伍指令窗口
  #--------------------------------------------------------------------------
  def create_party_command_window
    @party_command_window = Window_PartyCommand.new
    px = (Graphics.width - @party_command_window.width) / 2
    py = (Graphics.height - @party_command_window.height) / 2
    @party_command_window.x = px
    @party_command_window.y = py
    @party_command_window.viewport = @viewport
    @party_command_window.set_handler(:fight,  method(:command_fight))
    @party_command_window.set_handler(:escape, method(:command_escape))
    @party_command_window.unselect
  end
  #--------------------------------------------------------------------------
  # ● 生成角色指令窗口
  #--------------------------------------------------------------------------
  def create_actor_command_window
    @actor_command_window = Window_ActorCommand.new
    @actor_command_window.viewport = @viewport
    @actor_command_window.set_handler(:attack, method(:command_attack))
    @actor_command_window.set_handler(:skill,  method(:command_skill))
    @actor_command_window.set_handler(:guard,  method(:command_guard))
    @actor_command_window.set_handler(:item,   method(:command_item))
    @actor_command_window.set_handler(:cancel, method(:prior_command))
    @actor_command_window.x = Graphics.width
  end
  #--------------------------------------------------------------------------
  # ● 生成技能窗口
  #--------------------------------------------------------------------------
  def create_skill_window
    @skill_window = Window_BattleSkill.new(@help_window, @info_viewport)
    @skill_window.z = 200
    @skill_window.set_handler(:ok,     method(:on_skill_ok))
    @skill_window.set_handler(:cancel, method(:on_skill_cancel))
  end
  #--------------------------------------------------------------------------
  # ● 生成物品窗口
  #--------------------------------------------------------------------------
  def create_item_window
    @item_window = Window_BattleItem.new(@help_window, @info_viewport)
    @item_window.z = 200
    @item_window.set_handler(:ok,     method(:on_item_ok))
    @item_window.set_handler(:cancel, method(:on_item_cancel))
  end
  #--------------------------------------------------------------------------
  # ● 生成角色窗口
  #--------------------------------------------------------------------------
  def create_actor_window
    @actor_window = Window_BattleActor.new(@info_viewport)
    @actor_window.z = 300
    @actor_window.y = Graphics.height - @actor_command_window.height
    @actor_window.set_handler(:ok,     method(:on_actor_ok))
    @actor_window.set_handler(:cancel, method(:on_actor_cancel))
  end
  #--------------------------------------------------------------------------
  # ● 生成敌人窗口
  #--------------------------------------------------------------------------
  def create_enemy_window
    @enemy_window = Window_BattleEnemy.new(@info_viewport)
    @enemy_window.y = Graphics.height - @enemy_window.height
    @enemy_window.z = 300
    @enemy_window.set_handler(:ok,     method(:on_enemy_ok))
    @enemy_window.set_handler(:cancel, method(:on_enemy_cancel))
  end
end
 | 
 评分
查看全部评分
 |