查看: 1659|回复: 4

[已经解决] 这两个脚本不知道该怎么修改才能不冲突

[复制链接]
梦石
0
星屑
50
在线时间
16 小时
注册时间
2014-12-22
回帖
7
发表于 2014-12-27 22:58:22 | 显示全部楼层 |阅读模式

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

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

×
我使用了一个是可以换人的脚本,另一个是任务栏的脚本,但是两个脚本有冲突,该怎么修改,求助。
梦石
0
星屑
50
在线时间
16 小时
注册时间
2014-12-22
回帖
7
 楼主| 发表于 2014-12-27 23:00:23 | 显示全部楼层
本帖最后由 RyanBern 于 2014-12-28 09:31 编辑

这是第一个脚本,包括了换人和升级加点系统


[pre lang="Ruby"]#==============================================================================
# ■ Window_MenuStatus
#------------------------------------------------------------------------------
#  显示菜单画面和同伴状态的窗口。
#==============================================================================

class Window_MenuStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 初始化目标
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 480, 480)
    self.contents = Bitmap.new(width - 32,  $game_party.actors.size*112)
    refresh
    @top_row = 0
    self.active = false
    self.index = -1
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      x = 64
      y = i * 112
      if i <=3
        self.contents.font.color = Color.new(255,255,0,255)
        self.contents.draw_text(x,y,340,32,"[出战]",2)
        self.contents.font.color = normal_color
      else
        self.contents.font.color = Color.new(128,128,128,255)
        self.contents.draw_text(x,y,340,32,"[待机]",2)
        self.contents.font.color = normal_color
      end      
      actor = $game_party.actors
      draw_actor_graphic(actor, x - 40, y + 80)
      draw_actor_name(actor, x, y)
      draw_actor_class(actor, x + 144, y)
      draw_actor_level(actor, x, y + 32)
      draw_actor_state(actor, x + 90, y + 32)
      draw_actor_exp(actor, x, y + 64)
      draw_actor_hp(actor, x + 236, y + 32)
      draw_actor_sp(actor, x + 236, y + 64)
    end
  end
  #--------------------------------------------------------------------------
  # ● 刷新光标矩形
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    else
      tpy = @index * 112 - self.oy
      self.cursor_rect.set(0, tpy, self.width - 32, 96)
      if @index < @top_row
        @top_row = @index
        self.oy = @top_row *112
      end
      if @index > @top_row+3
        @top_row = @index-3
        self.oy = @top_row *112
      end
    end
  end
end

class Game_Party
  #--------------------------------------------------------------------------
  # ● 全灭判定
  #--------------------------------------------------------------------------
  def all_dead?
    # 同伴人数为 0 的情况下
    if $game_party.actors.size == 0
      return false
    end
    # 同伴中无人 HP 在 0 以上
    for i in 0..3
      if @actors != nil and@actors.hp >0
        return false
      end
    end
    # 全灭
    return true
  end
  #--------------------------------------------------------------------------
  # ● 加入同伴
  #     actor_id : 角色 ID
  #--------------------------------------------------------------------------
  def add_actor(actor_id)
    # 获取角色
    actor = $game_actors[actor_id]
    # 同伴人数未满 4 人、本角色不在队伍中的情况下
    if not @actors.include?(actor)
      # 添加角色
      @actors.push(actor)
      # 还原主角
      $game_player.refresh
    end
  end
end

#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================


class Scene_Menu
# --------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
    @changer = 0
    @where = 0
    @checker = 0
  end
# --------------------------------
  def main
    s1 = $data_system.words.item
    s2 = $data_system.words.skill
    s3 = $data_system.words.equip
    s4 = "状态"
    s5 = "储存进度"
    s6 = "离开游戏"
    s7 = "调整队伍"
    s8 = "升级加点"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7, s8])
    @command_window.index = @menu_index
    if $game_party.actors.size == 0
      @command_window.disable_item(0)
      @command_window.disable_item(1)
      @command_window.disable_item(2)
      @command_window.disable_item(3)
    end
    if $game_system.save_disabled
      @command_window.disable_item(4)
    end
    if $game_party.actors.size == 1
      @command_window.disable_item(6)
    end
    @playtime_window = Window_PlayTime.new
    @playtime_window.x = 0
    @playtime_window.y = 320
    @gold_window = Window_Gold.new
    @gold_window.x = 0
    @gold_window.y = 416
    @status_window = Window_MenuStatus.new
    @status_window.x = 160
    @status_window.y = 0
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @command_window.dispose
    @playtime_window.dispose
    @gold_window.dispose
    @status_window.dispose
  end
# --------------------------------
  def update
    @command_window.update
    @playtime_window.update
    @gold_window.update
    @status_window.update
    if @command_window.active
      update_command
      return
    end
    if @status_window.active
      update_status
      return
    end
  end
# --------------------------------
  def update_command
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Map.new
      return
    end
    if Input.trigger?(Input::C)
      if $game_party.actors.size == 0 and @command_window.index < 4
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      if $game_party.actors.size == 1 and @command_window.index ==6
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      case @command_window.index
      when 0
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Item.new
      when 1
        $game_system.se_play($data_system.decision_se)
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 2
        $game_system.se_play($data_system.decision_se)
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 3
        $game_system.se_play($data_system.decision_se)
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 4
        if $game_system.save_disabled
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Save.new
      when 5
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_End.new
      when 6
        $game_system.se_play($data_system.decision_se)
        @checker = 0
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 7
        $game_system.se_play($data_system.decision_se)
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 8
        $game_system.se_play($data_system.decision_se)
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      end
      return
    end
  end
# --------------------------------
  def update_status
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @command_window.active = true
      @status_window.active = false
      @status_window.index = -1
      return
    end
    if Input.trigger?(Input::C)
      case @command_window.index
      when 1
        if $game_party.actors[@status_window.index].restriction >= 2
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Skill.new(@status_window.index)
      when 2
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Equip.new(@status_window.index)
      when 3
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Status.new(@status_window.index)
      when 6
        $game_system.se_play($data_system.decision_se)
        if @checker == 0
          @changer = $game_party.actors[@status_window.index]
          @where = @status_window.index
          @checker = 1
        else
          $game_party.actors[@where] = $game_party.actors[@status_window.index]
          $game_party.actors[@status_window.index] = @changer
          @checker = 0
          @status_window.refresh
        end
      when 7
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Lvup.new(@status_window.index)
      when 8
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Charactor.new(@status_window.index)
      end
      return
    end
  end
end



    #插件(升级加点,换队伍顺序,人物介绍,动态行走图)

#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================


# 作者: 柳柳
#
# 说明:这是功能我再比较早期的时候发布在幻森,不过那时候比较笨,方法很糟糕
#       这次是拿上就可以用的。
#
# 感谢:Claimh的脚本使我想起这个功能重做了一遍,本想直接用他的,不过他的算法过分
#       冗余了,没好意思用。
#==============================================================================
# 使用方法:默认情况下把静态图变为了走步图。如果想自行修改,提供功能如下:
#
# 角色走步图:draw_walk_actor_graphic
# 角色转向图:draw_turn_actor_graphic
#
# 回复原有静态角色图:删除100行以后的内容。修改下面这个变量可以更改行走速度
#==============================================================================

WALK_REFRESH_FRAME_SPEED = 15  # 刷新的速度,越大越慢,你可以改为3左右试试看

#==============================================================================
# Window_Base
#==============================================================================
class Window_Base < Window
  #--------------------------------------------------------------------------
  # 初始化方法
  #--------------------------------------------------------------------------
  alias initialize_walk initialize
  def initialize(x, y, width, height)
    initialize_walk(x, y, width, height)
    @start_walk = false
    @turn_index = 0
    @turn_phase = 0
  end
  #--------------------------------------------------------------------------
  # ★  角色行走图
  #     actor : 角色
  #     x     : 描绘的 X 坐标
  #     y     : 描绘的 Y 坐标
  #--------------------------------------------------------------------------
  def draw_walk_actor_graphic(actor, x, y)
    bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
    cw = bitmap.width / 4
    ch = bitmap.height / 4
    @start_turn = true
    case @turn_phase
    when 0
      x_x = 0
    when 1
      x_x = cw
    when 2
      x_x = cw * 2
    when 3
      x_x = cw * 3
    end
    src_rect = Rect.new(x_x, 0, cw, ch)
    self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  end
  #--------------------------------------------------------------------------
  # ★  角色转向图
  #     actor : 角色
  #     x     : 描绘的 X 坐标
  #     y     : 描绘的 Y 坐标
  #--------------------------------------------------------------------------
  def draw_turn_actor_graphic(actor, x, y)
    bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
    cw = bitmap.width / 4
    ch = bitmap.height / 4
    @start_turn = true
    case @turn_phase
    when 0
      x_x = 0
    when 1
      x_x = ch
    when 2
      x_x = ch * 3
    when 3
      x_x = ch * 2
    end
    src_rect = Rect.new(0, x_x, cw, ch)
    self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  end
  #--------------------------------------------------------------------------
  #  更新(可别使用刷新,玩命耗费内存= =)
  #--------------------------------------------------------------------------
  alias walk_update update
  def update
    walk_update
    if @start_turn == true
      @turn_index += 1
      if @turn_index == WALK_REFRESH_FRAME_SPEED
        refresh
        @turn_index = 0
        @turn_phase = (@turn_phase+1)%4
      end
    end
  end  
end

#==============================================================================
# Window_Base
#==============================================================================
class Window_Base < Window
  #--------------------------------------------------------------------------
  # 把原有静态图改为动态走步图
  #--------------------------------------------------------------------------
  def draw_actor_graphic(actor, x, y)
    draw_walk_actor_graphic(actor, x, y)
  end
end

#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================

#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================


# 脚本使用设定:

LEVEL_UP_POINT = 3  # 每升一级所增加的点数
LEVEL_UP_VARIABLE = 200  # 储存角色点数的变量编号与角色id编号的差值
                         # 默认情况 = 200,
                         # 则是数据库里1号角色的加点数存于101号变量
                         # 3号角色的加点数存于103号变量。
                         # 你可以直接操作变量赠与角色可分配点数

# 每增加一次点数,各项能力值的变化:357-410行
                        
# 使用方法介绍:

# 本脚本不会取代原升级功能 也就是说,默认的升级还在,但可以用这个功能手动追加点数。
# 如果你想纯粹使用手动加点(而升级不提升能力),只要把数据库中角色升级能力,
# 1-99级全部等于一个相同数值就行了。

# 呼唤加点场景的方法:$scene = Scene_Lvup.new(角色编号,返回菜单编号)。
# 默认都是0号

# 加点场景中,page up,page down换人,如果想加点完毕后返回地图,
# 464行$scene = Scene_Menu.new(0)改为$scene = Scene_Map.new

# 推荐脚本搭配:魔法商店脚本,两者结合,制作自由型RPG

#==============================================================================
# ■ Window_Command
#------------------------------------------------------------------------------
#  一般的命令选择行窗口。(追加定义)
#==============================================================================
class Window_Command < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 项目有效化
  #     index : 项目编号
  #--------------------------------------------------------------------------
  def able_item(index)
    draw_item(index, normal_color)
  end
end
#==============================================================================
# ■ Game_Actor
#------------------------------------------------------------------------------
#  处理角色的类。(再定义)
#==============================================================================
class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # ● 更改 EXP
  #     exp : 新的 EXP
  #--------------------------------------------------------------------------
  def exp=(exp)
    @exp = [[exp, 9999999].min, 0].max
    # 升级
    while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
      @level += 1
      # 增加4点可自由分配的点数
      $game_variables[self.id + LEVEL_UP_VARIABLE] += LEVEL_UP_POINT
      # 学会特技
      for j in $data_classes[@class_id].learnings
        if j.level == @level
          learn_skill(j.skill_id)
        end
      end
    end
    # 降级
    while @exp < @exp_list[@level]
      @level -= 1
    end
    # 修正当前的 HP 与 SP 超过最大值
    @hp = [@hp, self.maxhp].min
    @sp = [@sp, self.maxsp].min
  end
end
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
#  游戏中全部窗口的超级类(追加定义)
#==============================================================================
class Window_Base < Window
  #--------------------------------------------------------------------------
  # ● 描绘 HP
  #     actor : 角色
  #     x     : 描画目标 X 坐标
  #     y     : 描画目标 Y 坐标
  #     width : 描画目标的宽
  #--------------------------------------------------------------------------
  def draw_actor_hp_lvup(actor, x, y)
    self.contents.font.color = system_color
    self.contents.draw_text(x , y, 96, 32, "最大" + $data_system.words.hp)
    if $temp_hp == 0
      self.contents.font.color = normal_color
      self.contents.draw_text(x + 120 , y, 48, 32, actor.maxhp.to_s, 2)
    else
      maxhp = actor.maxhp + $temp_hp
      self.contents.font.color = Color.new(255, 128, 128, 255)
      self.contents.draw_text(x + 120 , y, 48, 32, maxhp.to_s ,2)
      self.contents.font.color = normal_color      
      self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
      if $temp_hp >=0
        self.contents.font.color = Color.new(255, 128, 128, 255)
        self.contents.draw_text(x + 155, y, 36, 32, " +",2)
      else
        self.contents.font.color = Color.new(255,255,0,255)
        self.contents.draw_text(x + 155, y, 36, 32, " -",2)
      end
      self.contents.draw_text(x + 200, y, 36, 32, $temp_hp.to_s, 2)
      self.contents.font.color = normal_color
      self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
    end
  end
  #--------------------------------------------------------------------------
  # ● 描绘 SP
  #     actor : 角色
  #     x     : 描画目标 X 坐标
  #     y     : 描画目标 Y 坐标
  #     width : 描画目标的宽
  #--------------------------------------------------------------------------
  def draw_actor_sp_lvup(actor, x, y)
    self.contents.font.color = system_color
    self.contents.draw_text(x , y, 96, 32, "最大" + $data_system.words.sp)
    if $temp_sp == 0
      self.contents.font.color = normal_color
      self.contents.draw_text(x + 120 , y, 48, 32, actor.maxsp.to_s, 2)
    else
      maxsp = actor.maxsp + $temp_sp
      self.contents.font.color = Color.new(255, 128, 128, 255)
      self.contents.draw_text(x + 120 , y, 48, 32, maxsp.to_s ,2)
      self.contents.font.color = normal_color      
      self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
      if $temp_sp >=0
        self.contents.font.color = Color.new(255, 128, 128, 255)
        self.contents.draw_text(x + 155, y, 36, 32, " +",2)
      else
        self.contents.font.color = Color.new(255,255,0,255)
        self.contents.draw_text(x + 155, y, 36, 32, " -",2)
      end
      self.contents.draw_text(x + 200, y, 36, 32, $temp_sp.to_s, 2)
      self.contents.font.color = normal_color
      self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
    end
  end
  #--------------------------------------------------------------------------
  # ● 描绘能力值
  #     actor : 角色
  #     x     : 描画目标 X 坐标
  #     y     : 描画目标 Y 坐标
  #     type  : 能力值种类 (0~4)
  #--------------------------------------------------------------------------
  def draw_actor_lvup(actor, x, y, type)   
    # 定义数字颜色
    lvup = normal_color
    upcolor = Color.new(255, 128, 128, 255)
    self.contents.font.color = normal_color   
    case type
    when 0
      parameter_name = $data_system.words.str
      parameter_value = actor.str
      parameter_value_temp = parameter_value + $temp_str
      if $temp_str != 0
        lvup = upcolor
        self.contents.draw_text(x + 256, y, 16, 32, "(")
        if $temp_str >= 0
          self.contents.font.color = lvup
          self.contents.draw_text(x + 272, y, 80, 32, "+",0)
        else
          self.contents.font.color = Color.new(255,255,0,255)
          self.contents.draw_text(x + 272, y, 80, 32, "-",0)
        end        
        self.contents.draw_text(x + 272, y, 80, 32, $temp_str.abs.to_s,1)
        self.contents.font.color = normal_color
        self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
      end
    when 1
      parameter_name = $data_system.words.dex
      parameter_value = actor.dex
      parameter_value_temp = parameter_value + $temp_dex
      if $temp_dex != 0
        lvup = upcolor
        self.contents.draw_text(x + 256, y, 16, 32, "(")
        if $temp_dex >= 0
          self.contents.font.color = lvup
          self.contents.draw_text(x + 272, y, 80, 32, "+",0)
        else
          self.contents.font.color = Color.new(255,255,0,255)
          self.contents.draw_text(x + 272, y, 80, 32, "-",0)
        end        
        self.contents.draw_text(x + 272, y, 80, 32, $temp_dex.abs.to_s,1)
        self.contents.font.color = normal_color
        self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
      end
    when 2
      parameter_name = $data_system.words.agi
      parameter_value = actor.agi
      parameter_value_temp = parameter_value + $temp_agi
      if $temp_agi != 0
        lvup = upcolor
        self.contents.draw_text(x + 256, y, 16, 32, "(")
        if $temp_agi >= 0
          self.contents.font.color = lvup
          self.contents.draw_text(x + 272, y, 80, 32, "+",0)
        else
          self.contents.font.color = Color.new(255,255,0,255)
          self.contents.draw_text(x + 272, y, 80, 32, "-",0)
        end        
        self.contents.draw_text(x + 272, y, 80, 32, $temp_agi.abs.to_s,1)
        self.contents.font.color = normal_color
        self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
      end
    when 3
      parameter_name = $data_system.words.int
      parameter_value = actor.int
      parameter_value_temp = parameter_value + $temp_int
      if $temp_int != 0
        lvup = upcolor
        self.contents.draw_text(x + 256, y, 16, 32, "(")
        if $temp_int >= 0
          self.contents.font.color = lvup
          self.contents.draw_text(x + 272, y, 80, 32, "+",0)
        else
          self.contents.font.color = Color.new(255,255,0,255)
          self.contents.draw_text(x + 272, y, 80, 32, "-",0)
        end        
        self.contents.draw_text(x + 272, y, 80, 32, $temp_int.abs.to_s,1)
        self.contents.font.color = normal_color
        self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
      end
    when 4
      parameter_name = "剩余点数"
      parameter_value = $point
      if $point != 0
        lvup = upcolor
      end
    end   
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 120, 32, parameter_name)
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s)   
    if type != 4
      self.contents.draw_text(x + 150, y, 36, 32, "→")
    end  
    self.contents.font.color = lvup
    self.contents.draw_text(x + 180, y, 60, 32, parameter_value_temp.to_s)
    self.contents.font.color = normal_color        
  end
end
#==============================================================================
# ■ Window_lvup
#------------------------------------------------------------------------------
#  显示升级状态窗口。
#==============================================================================
class Window_Lvup < Window_Base
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #     actor : 角色
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(0, 0, 512, 320)
    self.contents = Bitmap.new(width - 32, height - 32)
    @actor = actor
    refresh
  end  
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    draw_actor_graphic(@actor, 40, 112)
    draw_actor_name(@actor, 4, 0)
    draw_actor_class(@actor, 4 + 144, 0)
    draw_actor_level(@actor, 96, 32)
    draw_actor_state(@actor, 96, 64)   
    draw_actor_hp_lvup(@actor, 96+128, 32)
    draw_actor_sp_lvup(@actor, 96+128, 64)
    draw_actor_lvup(@actor, 96, 128, 0)
    draw_actor_lvup(@actor, 96, 160, 1)
    draw_actor_lvup(@actor, 96, 192, 2)
    draw_actor_lvup(@actor, 96, 224, 3)
    draw_actor_lvup(@actor, 96, 256, 4)
  end
end
#==============================================================================
# ■ Window_Help
#------------------------------------------------------------------------------
#  特技及物品的说明、角色的状态显示的窗口。
#==============================================================================
class Window_Lvup_Help < Window_Base
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #--------------------------------------------------------------------------
  def initialize
    super(0, 320, 640, 160)
    self.contents = Bitmap.new(width - 32, height - 32)
    @test = "" #——这个东西用来检测,节约内存专用
  end  
  #--------------------------------------------------------------------------
  # ● 设置文本
  #--------------------------------------------------------------------------
  def lvup_text(text1, text2 = nil, text3 = nil, text4 = nil)
    if @test != text1
      @test = text1
    else
      return
    end   
    self.contents.clear
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 0, self.width - 40, 32, text1)
    if text2 != nil
      self.contents.draw_text(4 , 32, self.width - 40, 32, text2)
    end
    self.contents.font.size -= 4
    if text3 != nil
      self.contents.draw_text(4 , 64, self.width - 40, 32, text3)
    end
    if text4 != nil
      self.contents.draw_text(4 , 96, self.width - 40, 32, text4)
    end
    self.contents.font.size += 4
  end
end
#==============================================================================
# ■ Scene_lvup
#------------------------------------------------------------------------------
#  处理升级画面的类。
#==============================================================================
class Scene_Lvup
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #     actor_index : 角色索引
  #     menu_index : 选项起始位置
  #--------------------------------------------------------------------------
  def initialize(actor_index = 0 , menu_index = 0)
    @actor_index = actor_index
    @menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  # ● 主处理
  #--------------------------------------------------------------------------
  def main
    s1 = "增加体力 HP SP"
    s2 = "增加"+$data_system.words.str
    s3 = "增加"+$data_system.words.dex
    s4 = "增加"+$data_system.words.agi
    s5 = "增加"+$data_system.words.int
    s6 = "确认加点"
    s7 = "点数重置"
    @command_window = Window_Command.new(128, [s1, s2, s3, s4, s5, s6, s7])
    @command_window.index = @menu_index
    # 获取角色
    @actor = $game_party.actors[@actor_index]
    # 将角色的剩余点数带入
    $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]   
    # 初始化临时量
    $temp_str = 0
    $temp_dex = 0
    $temp_agi = 0
    $temp_int = 0
    $temp_hp = 0
    $temp_sp = 0
    #=========================================================================
    # 特别提示:这些设置也可以使用小数,但是可能出现0值意外错误
    #  (各种编程语言都有这种意外),建议还是使用整数,正负不限
    #=========================================================================
    # 每提升一次力量,提升多少附加能力
    #=========================================================================
    @str_hp = 5     # 每提升一次力量附加提升多少HP
    @str_sp = 0     # 每提升一次力量附加提升多少SP
    @str_dex = 1    # 每提升一次力量附加提升多少灵巧
    @str_agi = 1    # 每提升一次力量附加提升多少速度
    @str_int = 0    # 每提升一次力量附加提升多少魔力
    @str_str = 3    # 每提升一次力量附加提升多少力量
    #=========================================================================
    # 每提升一次灵巧,提升多少附加能力
    #=========================================================================
    @dex_hp = 2     # 每提升一次灵巧附加提升多少HP
    @dex_sp = 3     # 每提升一次灵巧附加提升多少SP
    @dex_str = 1    # 每提升一次灵巧附加提升多少力量
    @dex_agi = 1    # 每提升一次灵巧附加提升多少速度
    @dex_int = 0    # 每提升一次灵巧附加提升多少魔力
    @dex_dex = 3    # 每提升一次灵巧附加提升多少灵巧
    #=========================================================================
    # 每提升一次速度,提升多少附加能力
    #=========================================================================
    @agi_hp = 0     # 每提升一次速度附加提升多少HP
    @agi_sp = 0     # 每提升一次速度附加提升多少SP
    @agi_str = 0    # 每提升一次速度附加提升多少力量
    @agi_dex = 1    # 每提升一次速度附加提升多少灵巧
    @agi_int = 0    # 每提升一次速度附加提升多少魔力
    @agi_agi = 3    # 每提升一次速度附加提升多少速度
    #=========================================================================
    # 每提升一次魔力,提升多少附加能力
    #=========================================================================
    @int_hp = 1     # 每提升一次魔力附加提升多少HP
    @int_sp = 15    # 每提升一次魔力附加提升多少SP
    @int_str = -1   # 每提升一次魔力附加提升多少力量
    @int_dex = 0   # 每提升一次魔力附加提升多少灵巧
    @int_agi = 0   # 每提升一次魔力附加提升多少速度
    @int_int = 7   # 每提升一次魔力附加提升多少魔力
    #=========================================================================
    # 每提升一次体力,提升多少附加能力
    #=========================================================================
    @hp = 20       # 每提升一次体力提升多少HP
    @sp = 10       # 每提升一次体力提升多少SP
    @hp_str = 0   # 每提升一次体力提升多少力量
    @hp_dex = 0   # 每提升一次体力提升多少速度
    @hp_agi = 0   # 每提升一次体力提升多少灵巧
    @hp_int = -1   # 每提升一次体力提升多少魔力   
    # 定义说明文字
    @text_hp_sc = "体力可以增加生存的能力,增加HP与SP的最大上限!"
    @text_str_sc = $data_system.words.str + "可以增加物理攻击和物理技能的威力!"
    @text_dex_sc = $data_system.words.dex + "可以提高攻击的命中率和防御系数!"
    @text_agi_sc = $data_system.words.agi + "可以提高行动速度、逃跑成功率!"
    @text_int_sc = $data_system.words.int + "可以提高魔法攻击的效果!"
    @text_save = "保存分配情况并返回游戏"
    @text_reset= "重新分配能力点数"
    @text_2 = "每增加一次此项能力值,可以提升能力值"
    @text_hp = "最大" + $data_system.words.hp + "值"
    @text_sp = "最大" + $data_system.words.sp + "值"
    @text_str = "最大" + $data_system.words.str + "值"
    @text_dex = "最大" + $data_system.words.dex + "值"
    @text_agi = "最大" + $data_system.words.agi + "值"
    @text_int = "最大" + $data_system.words.int + "值"
    s_disable
    # 生成状态窗口
    @lvup_window = Window_Lvup.new(@actor)
    @lvup_window.x = 128
    @lvup_window.y = 0   
    # 生成帮助窗口并初始化帮助文本
    @help_window = Window_Lvup_Help.new   
    # 执行过渡
    Graphics.transition(40, "Graphics/Transitions/" + $data_system.battle_transition)
    # 主循环
    loop do
      # 刷新游戏画面
      Graphics.update
      # 刷新输入信息
      Input.update
      # 刷新画面
      update
      # 如果切换画面就中断循环
      if $scene != self
        break
      end
    end
    # 准备过渡
    Graphics.freeze
    # 释放窗口
    @command_window.dispose
    @lvup_window.dispose
    @help_window.dispose
  end
  #--------------------------------------------------------------------------
  # ● 刷新画面
  #--------------------------------------------------------------------------
  def update
    # 刷新窗口
    @command_window.update
    # 选项明暗判断(因为太消耗资源,所以屏蔽掉了)
    s_disable
    @lvup_window.update
    #=============================================================
    # 按下 B 键的情况下
    #=============================================================
    if Input.trigger?(Input::B)
      # 演奏取消 SE
      $game_system.se_play($data_system.cancel_se)
      # 切换到地图画面
      $scene = Scene_Menu.new
      return
    end
    #=============================================================
    # 按下 C 键的情况下
    #=============================================================
    if Input.trigger?(Input::C)      
      if @command_window.index == 5
          # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        # 将角色的剩余点数带回
        $game_variables[@actor.id + LEVEL_UP_VARIABLE] = $point
        # 将角色点数实际加上
        @actor.str += $temp_str
        @actor.dex += $temp_dex
        @actor.agi += $temp_agi
        @actor.int += $temp_int
        @actor.maxhp += $temp_hp
        @actor.maxsp += $temp_sp
        # 切换到地图画面
        $scene = Scene_Menu.new
        return
      end
      if @command_window.index == 6
          # 演奏确定 SE
        $game_system.se_play($data_system.cancel_se)
          # 将角色的剩余点数带入
        $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]   
          # 初始化临时量
        $temp_str = 0
        $temp_dex = 0
        $temp_agi = 0
        $temp_int = 0
        $temp_hp = 0
        $temp_sp = 0
        @lvup_window.refresh
        return
      end
      if $point == 0
        # 演奏冻结 SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      case @command_window.index
      when 0
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        $temp_hp += @hp
        $temp_sp += @sp
        $temp_str += @hp_str
        $temp_dex += @hp_dex
        $temp_agi += @hp_agi
        $temp_int += @hp_int
        $point -= 1
        @lvup_window.refresh
        s_disable
        return
      when 1
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        $temp_str += @str_str
        $temp_hp += @str_hp
        $temp_sp += @str_sp
        $temp_dex += @str_dex
        $temp_agi += @str_agi
        $temp_int += @str_int
        $point -= 1
        @lvup_window.refresh
        s_disable
        return
      when 2
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        $temp_dex += @dex_dex
        $temp_hp += @dex_hp
        $temp_sp += @dex_sp
        $temp_str += @dex_str
        $temp_agi += @dex_agi
        $temp_int += @dex_int
        $point -= 1
        @lvup_window.refresh
        s_disable
        return
      when 3
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        $temp_agi += @agi_agi
        $temp_hp += @agi_hp
        $temp_sp += @agi_sp
        $temp_str += @agi_str
        $temp_dex += @agi_dex
        $temp_int += @agi_int
        $point -= 1
        @lvup_window.refresh
        s_disable
        return
      when 4
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        $temp_int += @int_int
        $temp_hp += @int_hp
        $temp_sp += @int_sp
        $temp_str += @int_str
        $temp_dex += @int_dex
        $temp_agi += @int_agi
        $point -= 1
        @lvup_window.refresh
        s_disable
        return
      end
    end
    #=============================================================
    # 什么都没有按下的情况
    #=============================================================
    case @command_window.index   
    when 0  # 增加体力
      temptext1 = @text_hp + @hp.to_s + "点   " + @text_str + @hp_str.to_s + "点   " + @text_dex + @hp_dex.to_s + "点"
      temptext2 = @text_sp + @sp.to_s + "点   " + @text_agi + @hp_agi.to_s + "点   " + @text_int + @hp_int.to_s + "点"
      @help_window.lvup_text(@text_hp_sc , @text_2 , temptext1 , temptext2)
    when 1  # 增加力量
      temptext1 = @text_hp + @str_hp.to_s + "点   " + @text_str + @str_str.to_s + "点   " + @text_dex + @str_dex.to_s + "点"
      temptext2 = @text_sp + @str_sp.to_s + "点   " + @text_agi + @str_agi.to_s + "点   " + @text_int + @str_int.to_s + "点"
      @help_window.lvup_text(@text_str_sc , @text_2 , temptext1 , temptext2)
    when 2  # 增加灵巧
      temptext1 = @text_hp + @dex_hp.to_s + "点   " + @text_str + @dex_agi.to_s + "点   " + @text_dex + @dex_dex.to_s + "点"
      temptext2 = @text_sp + @dex_sp.to_s + "点   " + @text_agi + @dex_agi.to_s + "点   " + @text_int + @dex_int.to_s + "点"
      @help_window.lvup_text(@text_dex_sc , @text_2 , temptext1 , temptext2)
    when 3  # 增加速度
      temptext1 = @text_hp + @agi_hp.to_s + "点   " + @text_str + @agi_str.to_s + "点   " + @text_dex + @agi_dex.to_s + "点"
      temptext2 = @text_sp + @agi_sp.to_s + "点   " + @text_agi + @agi_agi.to_s + "点   " + @text_int + @agi_int.to_s + "点"
      @help_window.lvup_text(@text_agi_sc , @text_2 , temptext1 , temptext2)
    when 4  # 增加魔力
      temptext1 = @text_hp + @int_hp.to_s + "点   " + @text_str + @int_str.to_s + "点   " + @text_dex + @int_dex.to_s + "点"
      temptext2 = @text_sp + @int_sp.to_s + "点   " + @text_agi + @int_agi.to_s + "点   " + @text_int + @int_int.to_s + "点"
      @help_window.lvup_text(@text_int_sc , @text_2 , temptext1 , temptext2)
    when 5 # 保存设定
      @help_window.lvup_text(@text_save)
    when 6 # 点数重置
      @help_window.lvup_text(@text_reset)     
    end
    #=============================================================
    # 按下R与L换人的情况
    #=============================================================      
    if Input.trigger?(Input::R)
      # 演奏光标 SE
      $game_system.se_play($data_system.cursor_se)
      # 移至下一位角色
      @actor_index += 1
      @actor_index %= $game_party.actors.size
      # 切换到别的状态画面
      $scene = Scene_Lvup.new(@actor_index , @command_window.index)
      return
    end
    # 按下 L 键的情况下
    if Input.trigger?(Input::L)
      # 演奏光标 SE
      $game_system.se_play($data_system.cursor_se)
      # 移至上一位角色
      @actor_index += $game_party.actors.size - 1
      @actor_index %= $game_party.actors.size
      # 切换到别的状态画面
      $scene = Scene_Lvup.new(@actor_index , @command_window.index)
      return
    end
  end  
  #--------------------------------------------------------------------------
  # ● 选项明暗判断
  #--------------------------------------------------------------------------
  def s_disable
    # 判断剩余点数是否为0,如果为0,那么增加选项表示为暗色
    if $point == 0
      @command_window.disable_item(0)
      @command_window.disable_item(1)
      @command_window.disable_item(2)
      @command_window.disable_item(3)
      @command_window.disable_item(4)
    else
      @command_window.able_item(0)
      @command_window.able_item(1)      
      @command_window.able_item(2)
      @command_window.able_item(3)
      @command_window.able_item(4)
    end
  end
end

#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================

#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
[/pre]



  
回复

使用道具 举报

梦石
0
星屑
50
在线时间
16 小时
注册时间
2014-12-22
回帖
7
 楼主| 发表于 2014-12-27 23:01:18 | 显示全部楼层
本帖最后由 RyanBern 于 2014-12-28 09:32 编辑

这是第二脚本,是任务系统的脚本



[pre lang="Ruby"]#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
#==============================================================================
# Game_System
#------------------------------------------------------------------------------
# 添加内容
#==============================================================================
class Game_System
  attr_accessor :mission #现在执行的任务
  attr_accessor :partmission
  alias carol3_ini initialize
  def initialize
    carol3_ini
    @mission = ""
    @partmission = []
  end
end
#==============================================================================
# ■ Scene_Title
#------------------------------------------------------------------------------
#  处理标题画面的类。
#==============================================================================
class Scene_Title
  alias carol3_title1 main
  def main
    $map_infos = load_data("Data/MapInfos.rxdata")
    for key in $map_infos.keys
      $map_infos[key] = $map_infos[key].name
    end
    $任务 = ""
    $支线 = nil
    $支线完成 = nil
    carol3_title1
  end
end
class Scene_Map
  alias carol3_update update
  def update
    carol3_update
    if $支线 != nil
      for i in 0...$game_system.partmission.size
        if $game_system.partmission == $支线
          $支线 = nil
          break
        end
      end
      if $支线 != nil
        $game_system.partmission.push($支线)
        $支线 = nil
      end
    end
    if $支线完成 != nil
      for i in 0...$game_system.partmission.size
        if $game_system.partmission == $支线完成
          $game_system.partmission.delete($game_system.partmission)
          break
        end
      end
      $支线完成 = nil
    end
  end
end
#==============================================================================
# Window_MenuStatus
#------------------------------------------------------------------------------
# 显示菜单画面和同伴状态的窗口。
#==============================================================================
class Window_MenuStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 初始化目标
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 480, 384)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.active = false
    self.index = -1
    @position = 0
    @count = 0
    @oldposition = 0
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      x = 64
      y = i * 90
      actor = $game_party.actors
      self.contents.font.size = 18
      draw_actor_active_graphic(actor, x - 40, y + 50)
      draw_actor_name(actor, x, y)
      draw_actor_class(actor, x + 144, y)
      draw_actor_level(actor, x, y + 25)
      draw_actor_state(actor, x + 90, y + 25)
      draw_actor_exp(actor, x, y + 50)
      draw_actor_hp(actor, x + 236, y + 25)
      draw_actor_sp(actor, x + 236, y + 50)
    end
  end
  #--------------------------------------------------------------------------
  # ● 绘制行走图
  #--------------------------------------------------------------------------
  def draw_actor_active_graphic(actor, x, y)
    bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
    cw = bitmap.width / 4
    ch = bitmap.height / 4
    p = @position * cw
    src_rect = Rect.new(p, 0, cw, ch)
    self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  end
  #--------------------------------------------------------------------------
  # ● 刷新光标矩形
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    else
      self.cursor_rect.set(0, @index *90-5, self.width - 32, 90)
    end
  end  
  def update
    super
    @count += 1
    @count %= 15
    if @count == 0
      @position = (@position + 1) % 4
    end
    if @position != @oldposition
      @oldposition = @position
      refresh
    end
  end
end
#==============================================================================
# ■ Game_Map
#------------------------------------------------------------------------------
#  处理地图的类。包含卷动以及可以通行的判断功能。
# 本类的实例请参考 $game_map 。
#==============================================================================
class Game_Map
  def name
    return $map_infos[@map_id]
  end
end
#==============================================================================
# Window_RecordBook
#------------------------------------------------------------------------------
# 菜单界面表示信息的窗口
#==============================================================================
class Window_RecordBook < Window_Base
  #--------------------------------------------------------------------------
  # ● 初始化对象
  #--------------------------------------------------------------------------
  def initialize
    super(160, 384, 480, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
    if $任务 == ""
      $任务 = $game_system.mission
    else
      $game_system.mission = $任务
    end
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 刷新画面
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.font.size = 20
    cx = self.contents.text_size("现在地点").width + 24
    self.contents.draw_text(4, 0, cx, 24, "现在地点")
    self.contents.font.color = normal_color
    self.contents.draw_text(4 + cx, 0, 444 - cx, 24, $game_map.name.to_s)  
    self.contents.font.color = system_color
    cx = self.contents.text_size("主线任务").width + 24
    self.contents.draw_text(4, 32, cx, 24, "主线任务")
    self.contents.font.color = Color.new(240,250,75,255)
    self.contents.draw_text(4 + cx, 32, 444 - cx, 24, $game_system.mission.to_s)  
    self.contents.font.color = system_color
    cx = self.contents.text_size("支线任务").width + 24
    self.contents.draw_text(4, 96, cx, 24, "支线任务")
    self.contents.font.color = normal_color
    for i in 0...$game_system.partmission.size
      self.contents.draw_text(4 + cx, 96 + i * 32, 444 - cx, 24, $game_system.partmission.to_s)
    end
  end
end
#==============================================================================
# ■ Scene_Menu
#------------------------------------------------------------------------------
#  处理菜单画面的类。
#==============================================================================
class Scene_Menu
  #--------------------------------------------------------------------------
  # ● 初始化对像
  # menu_index : 命令光标的初期位置
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
    @切换状态暂停 = ""
  end
  #--------------------------------------------------------------------------
  # ● 主处理
  #--------------------------------------------------------------------------
  def main
    # 生成命令窗口
    s1 = " 使用物品"#$data_system.words.item
    s2 = " 使用技能"#$data_system.words.skill
    s3 = " 更改装备"#$data_system.words.equip
    s4 = " 查看状态"
    s5 = " 储存游戏"
    s6 = " 结束游戏"
    s7 = " 查看任务"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
    @command_window.index = @menu_index
    # 同伴人数为 0 的情况下
    if $game_party.actors.size == 0
      # 物品、特技、装备、状态无效化
      @command_window.disable_item(0)
      @command_window.disable_item(1)
      @command_window.disable_item(2)
      @command_window.disable_item(3)
    end
    # 禁止存档的情况下
    if $game_system.save_disabled
      # 存档无效
      @command_window.disable_item(4)
    end
    # 生成游戏时间窗口
    @playtime_window = Window_PlayTime.new
    @playtime_window.x = 0
    @playtime_window.y = 256
    # 生成金钱窗口
    @gold_window = Window_Gold.new
    @gold_window.x = 0
    @gold_window.y = 416
    # 生成状态窗口
    @status_window = Window_MenuStatus.new
    @status_window.x = 160
    @status_window.y = 0
    #—— 生成天书窗口
    @recordbook_window = Window_RecordBook.new
    @recordbook_window.z = 1000
    #—— 生成外边框窗口
    @outside_window = Window_Outside.new
    @outside_window.visible = true
    @outside_window.z = 1001
    # 执行过渡
    Graphics.transition
    # 主循环
    loop do
      # 刷新游戏画面
      Graphics.update
      # 刷新输入信息
      Input.update
      # 刷新画面
      update
      # 如果切换画面就中断循环
      if $scene != self
        break
      end
    end
    # 准备过渡
    Graphics.freeze
    # 释放窗口
    @command_window.dispose
    @playtime_window.dispose
    @gold_window.dispose
    @status_window.dispose
    @outside_window.dispose
    @recordbook_window.dispose
  end
  #--------------------------------------------------------------------------
  # ● 刷新画面
  #--------------------------------------------------------------------------
  def update
    # 刷新窗口
    @command_window.update
    @playtime_window.update
    @gold_window.update
    @status_window.update
    # 命令窗口被激活的情况下: 调用 update_command
    if @command_window.active
      update_command
      return
    end
    # 状态窗口被激活的情况下: 调用 update_status
    if @status_window.active
      update_status
      return
    end
    if @outside_window.visible == false
      update_recordbook
      return
    end
  end
  #--------------------------------------------------------------------------
  # ● 刷新画面 (命令窗口被激活的情况下)
  #--------------------------------------------------------------------------
  def update_command
    # 按下 B 键的情况下
    if Input.trigger?(Input::B)
      # 演奏取消 SE
      $game_system.se_play($data_system.cancel_se)
      # 切换的地图画面
      $scene = Scene_Map.new
      return
    end
    # 按下 C 键的情况下
    if Input.trigger?(Input::C)
      # 同伴人数为 0、存档、游戏结束以外的场合
      if $game_party.actors.size == 0 and @command_window.index < 4
        # 演奏冻结 SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # 命令窗口的光标位置分支
      case @command_window.index
      when 0 # 物品
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        # 切换到物品画面
        $scene = Scene_Item.new
      when 1 # 特技
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        # 激活状态窗口
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 2 # 装备
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        # 激活状态窗口
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 3 # 状态
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        # 激活状态窗口
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 4 # 存档
        # 禁止存档的情况下
        if $game_system.save_disabled
          # 演奏冻结 SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        # 切换到存档画面
        $scene = Scene_Save.new
      when 5 # 游戏结束
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        # 切换到游戏结束画面
        $scene = Scene_End.new
      when 6 # 查看任务
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        @command_window.active = false
        @outside_window.visible = false
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # ● 刷新画面 (查看天书的情况下)
  #--------------------------------------------------------------------------
  def update_recordbook
    if @切换状态暂停 == "天书消失"
      if @recordbook_window.y < 384
        @recordbook_window.y +=64
        @status_window.y -= 16
        return
      else
        @切换状态暂停 = ""
        @outside_window.visible = true
        @command_window.active = true
      end
    else
      if @recordbook_window.y >0
        @recordbook_window.y -= 32
        @status_window.y += 8
        return
      else
        @status_window.visible = false
        if Input.trigger?(Input::B)
          @切换状态暂停 = "天书消失"
          $game_system.se_play($data_system.cancel_se)
          @status_window.visible = true
          return
        end
      end
    end
  end  
  #--------------------------------------------------------------------------
  # ● 刷新画面 (状态窗口被激活的情况下)
  #--------------------------------------------------------------------------
  def update_status
    # 按下 B 键的情况下
    if Input.trigger?(Input::B)
      # 演奏取消 SE
      $game_system.se_play($data_system.cancel_se)
      # 激活命令窗口
      @command_window.active = true
      @status_window.active = false
      @status_window.index = -1
      return
    end
    # 按下 C 键的情况下
    if Input.trigger?(Input::C)
      # 命令窗口的光标位置分支
      case @command_window.index
      when 1 # 特技
        # 本角色的行动限制在 2 以上的情况下
        if $game_party.actors[@status_window.index].restriction >= 2
          # 演奏冻结 SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        # 切换到特技画面
        $scene = Scene_Skill.new(@status_window.index)
      when 2 # 装备
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        # 切换的装备画面
        $scene = Scene_Equip.new(@status_window.index)
      when 3 # 状态
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        # 切换到状态画面
        $scene = Scene_Status.new(@status_window.index)
      end
      return
    end
  end
end
#==============================================================================
# Window_Outside
#------------------------------------------------------------------------------
# 外边框窗口
#==============================================================================
class Window_Outside < Window_Base
  #--------------------------------------------------------------------------
  # ● 初始化对象
  #--------------------------------------------------------------------------
  def initialize
    super(160, 384, 480, 96)
    self.back_opacity = 0
  end
end
#==============================================================================
# ■ Window_PlayTime
#------------------------------------------------------------------------------
# 菜单画面的系统时间表示
#==============================================================================
class Window_PlayTime < Window_Base
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 160, 128)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.size = 18
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.font.color = text_color(6)
    time = Time.now
    text = time.strftime("%x %X")
    self.contents.draw_text(-2, 32, 130, 32, text, 2)
    @total_sec = Graphics.frame_count / Graphics.frame_rate
    hour = @total_sec / 60 / 60
    min = @total_sec / 60 % 60
    sec = @total_sec % 60
    text = sprintf("%02d:%02d:%02d", hour, min, sec)
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 0, 160, 32, "日期与游戏时间")
    self.contents.draw_text(-2, 64, 130, 32, text, 2)
  end
  #--------------------------------------------------------------------------
  # ● 更新
  #--------------------------------------------------------------------------
  def update
    super
    if Graphics.frame_count / Graphics.frame_rate != @total_sec
      refresh
    end
  end
end

#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#======================================================================
[/pre]
回复

使用道具 举报

梦石
0
星屑
9557
在线时间
5074 小时
注册时间
2013-6-21
回帖
3459

开拓者贵宾剧作品鉴家

发表于 2014-12-28 10:53:01 | 显示全部楼层
整合完成,可以拿去看看效果。
为了界面整洁,去掉了任务系统的显示系统时间窗口,换回了游戏默认的时间窗口,感觉那个不是很有必要。
Project6.rar (194.7 KB, 下载次数: 52)
回复

使用道具 举报

梦石
0
星屑
50
在线时间
16 小时
注册时间
2014-12-22
回帖
7
 楼主| 发表于 2014-12-28 12:40:46 | 显示全部楼层
RyanBern 发表于 2014-12-28 10:53
整合完成,可以拿去看看效果。
为了界面整洁,去掉了任务系统的显示系统时间窗口,换回了游戏默认的时间窗 ...

弄好了,可以用,谢谢,谢谢( ゚∀゚)
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部