查看: 1027|回复: 1

[有事请教] [已解决]【布阵位法原创】脚本出错第一个脚本和窗口对应...

[复制链接]
梦石
0
星屑
7296
在线时间
1244 小时
注册时间
2015-8-15
回帖
473
发表于 2024-7-9 13:49:20 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 金芒芒 于 2024-7-11 14:16 编辑

[pre lang="ruby"]#==============================================================================
# ■ Scene_zhenwei
#------------------------------------------------------------------------------
#  处理菜单画面的类。
#==============================================================================

class Scene_zhenwei
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #     zhenwei_index : 命令光标的初期位置,zhenwei_index = 9,chuzhan_index = 0
  #--------------------------------------------------------------------------
  def initialize(zhenwei_index = 0)
    @zhenwei_index = zhenwei_index
  #  @chuzhan_index = chuzhan_index
    @wait_time = 0
  end
  #--------------------------------------------------------------------------
  # ● 主处理
  #--------------------------------------------------------------------------
  def main#(zhenwei_index=0)
    # 生成地图背景
    @zhenwei_TransparentBackground = Spriteset_Map.new
    @chuzhan_IndexCommand = Window_chuzhanCommand.new
    # 生成出战菜单选项
    @zhenwei_IndexCommand = Window_zhenweiCommand.new#(zhenwei_index = 0)
   # @zhenwei_IndexCommand = Window_zhenweiCommand.new
  #  @zhenwei_IndexCommand.index = @zhenwei_index

    # 冻结
    Graphics.transition
    update while  $scene == self
    # 不切换场景就一直循环
   # update while $scene == self
    # 渐变
    Graphics.freeze
    @zhenwei_IndexCommand.dispose
#   @chuzhan_IndexCommand.dispose
     #update
     
  end
  #--------------------------------------------------------------------------
  # ● 刷新画面
  #--------------------------------------------------------------------------
  def update
    Graphics.update
    Input.update
    @wait_time -= 1
#    @spriteset.update
  #  @zhenwei_IndexCommand.active=true
     # @window_CB_selected_troop.update
     # return
   # end
    @zhenwei_IndexCommand.update
  
    update_zhenwei_IndexCommand
#   break

end
  #--------------------------------------------------------------------------
  # ● 刷新画面 (命令窗口被激活的情况下)
  #--------------------------------------------------------------------------
  def update_zhenwei_IndexCommand
# end
    # 按下 C 键的情况下
    if Input.trigger?(Input::C)
         # @zhenwei_IndexCommand.zhenwei_index == 0
        if  @zhenwei_IndexCommand.zhenwei_index == 0
         @zhenwei_IndexCommand.zhenwei_1_spawn
        elsif
        if  @zhenwei_IndexCommand.zhenwei_index == 1
         @zhenwei_IndexCommand.zhenwei_2_spawn
        elsif
        if  @zhenwei_IndexCommand.zhenwei_index == 2
         @zhenwei_IndexCommand.zhenwei_3_spawn
        elsif
        if  @zhenwei_IndexCommand.zhenwei_index == 3
         @zhenwei_IndexCommand.zhenwei_4_spawn
        elsif
        if  @zhenwei_IndexCommand.zhenwei_index == 4
         @zhenwei_IndexCommand.zhenwei_5_spawn
        elsif
        if  @zhenwei_IndexCommand.zhenwei_index == 5
         @zhenwei_IndexCommand.zhenwei_6_spawn
        elsif
        if  @zhenwei_IndexCommand.zhenwei_index == 6
         @zhenwei_IndexCommand.zhenwei_7_spawn
        elsif
        if  @zhenwei_IndexCommand.zhenwei_index == 7
         @zhenwei_IndexCommand.zhenwei_8_spawn
        elsif
        if  @zhenwei_IndexCommand.zhenwei_index == 8
         @zhenwei_IndexCommand.zhenwei_9_spawn
        elsif
        if  @zhenwei_IndexCommand.zhenwei_index == 9
         @zhenwei_IndexCommand.zhenwei_10_spawn
              end
            end
          end
         end
        end
      end
     end
    end
  end
end
    # 按下 B 键的情况下
    if Input.trigger?(Input::B)
      # 演奏取消 SE
      $game_system.se_play($data_system.cancel_se)
      # 切换的地图画面
      $scene = Scene_chuzhan.new
      return
    end
end
end
end[/pre]
[pre lang="ruby"]#==============================================================================
# ■ Window_MenuCommand
#------------------------------------------------------------------------------
#  菜单的命令选择行窗口。
#==============================================================================

class Window_zhenweiCommand <  Window_Base
   attr_reader   :chuzhan_index
   attr_reader   :zhenwei_index
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #     actor : 角色
  #--------------------------------------------------------------------------

  def initialize(zhenwei_index=0)
   @zhenwei_index=0
    super(32+200, 32, 480, 320)
   origin_x=120
   origin_y=110
   @zhenwei_base = Sprite.new
   @zhenwei_base.bitmap = RPG::Cache.title("")
   @zhenwei_base.x = 200#origin_x
   @zhenwei_base.y = 20#origin_y
   @zhenwei_buttons = [] #@底部按钮=[]

    @zhenwei_base_1 = Sprite.new #@完成按钮=精灵.new
    @zhenwei_base_1.bitmap = RPG::Cache.title("bottom-button-2-basic")
    @zhenwei_base_1.x = origin_x+10
    @zhenwei_base_1.y = origin_y+50

    @zhenwei_base_2 = Sprite.new #@完成按钮=精灵.new
    @zhenwei_base_2.bitmap = RPG::Cache.title("bottom-button-2-basic")
    @zhenwei_base_2.x = origin_x+80
    @zhenwei_base_2.y = origin_y+100

    @zhenwei_base_3 = Sprite.new #@完成按钮=精灵.new
    @zhenwei_base_3.bitmap = RPG::Cache.title("bottom-button-2-basic")
    @zhenwei_base_3.x = origin_x+10
    @zhenwei_base_3.y = origin_y+160

    @zhenwei_base_4 = Sprite.new #@完成按钮=精灵.new
    @zhenwei_base_4.bitmap = RPG::Cache.title("bottom-button-2-basic")
    @zhenwei_base_4.x = origin_x+80
    @zhenwei_base_4.y = origin_y+180

    @zhenwei_base_5 = Sprite.new #@完成按钮=精灵.new
    @zhenwei_base_5.bitmap = RPG::Cache.title("bottom-button-2-basic")
    @zhenwei_base_5.x = origin_x+10
    @zhenwei_base_5.y = origin_y+240

    @zhenwei_base_6 = Sprite.new #@完成按钮=精灵.new
    @zhenwei_base_6.bitmap = RPG::Cache.title("bottom-button-2-basic")
    @zhenwei_base_6.x = origin_x+180
    @zhenwei_base_6.y = origin_y+50

    @zhenwei_base_7 = Sprite.new #@完成按钮=精灵.new
    @zhenwei_base_7.bitmap = RPG::Cache.title("bottom-button-2-basic")
    @zhenwei_base_7.x = origin_x+240
    @zhenwei_base_7.y = origin_y+80

    @zhenwei_base_8 = Sprite.new #@完成按钮=精灵.new
    @zhenwei_base_8.bitmap = RPG::Cache.title("bottom-button-2-basic")
    @zhenwei_base_8.x = origin_x+180
    @zhenwei_base_8.y = origin_y+160

    @zhenwei_base_9 = Sprite.new #@完成按钮=精灵.new
    @zhenwei_base_9.bitmap = RPG::Cache.title("bottom-button-2-basic")
    @zhenwei_base_9.x = origin_x+240
    @zhenwei_base_9.y = origin_y+180

    @zhenwei_base_10 = Sprite.new #@完成按钮=精灵.new
    @zhenwei_base_10.bitmap = RPG::Cache.title("bottom-button-2-basic")
    @zhenwei_base_10.x = origin_x+180
    @zhenwei_base_10.y = origin_y+240


    @zhenwei_buttons.push @zhenwei_base_1# @底部按钮。按下完成按钮
    @zhenwei_buttons.push @zhenwei_base_2# @底部按钮。按下完成按钮
    @zhenwei_buttons.push @zhenwei_base_3# @底部按钮。按下完成按钮
    @zhenwei_buttons.push @zhenwei_base_4# @底部按钮。按下完成按钮
    @zhenwei_buttons.push @zhenwei_base_5# @底部按钮。按下完成按钮
    @zhenwei_buttons.push @zhenwei_base_6# @底部按钮。按下完成按钮
    @zhenwei_buttons.push @zhenwei_base_7# @底部按钮。按下完成按钮
    @zhenwei_buttons.push @zhenwei_base_8# @底部按钮。按下完成按钮
    @zhenwei_buttons.push @zhenwei_base_9# @底部按钮。按下完成按钮
    @zhenwei_buttons.push @zhenwei_base_10# @底部按钮。按下完成按钮

#  @zhenwei_index = index
# @zhenwei_index =0

    adj_x = 0                       # 调整_x=0
    adj_y = 0                       # 调整_y=0




  #--------------------------------------------------------------------------
  # ● 一些方法的重载
  #--------------------------------------------------------------------------  
  def dispose #定义释放
  #  @zhenwei_base.dispose
    @zhenwei_base_1.dispose
    @zhenwei_base_2.dispose
    @zhenwei_base_3.dispose
    @zhenwei_base_4.dispose
    @zhenwei_base_5.dispose
    @zhenwei_base_6.dispose
    @zhenwei_base_7.dispose
    @zhenwei_base_8.dispose
    @zhenwei_base_9.dispose
    @zhenwei_base_10.dispose
  def z=(z)
    super(z)
  #  @delete_button.z=z+1
#    @zhenwei_base.z=z+1
#    @zhenwei_base_1.z=z+1
#   @zhenwei_base_2.z=z+1
#   @zhenwei_base_3.z=z+1
#   @zhenwei_base_4.z=z+1
#   @zhenwei_base_5.z=z+1
#   @zhenwei_base_6.z=z+1
#   @zhenwei_base_7.z=z+1
#   @zhenwei_base_8.z=z+1
#   @zhenwei_base_9.z=z+1
#   @zhenwei_base_10.z=z+1
   end
    def x=(x)
    super(x)
    adj_x = 0
   # @button_base.x=x+origin_x
#    @zhenwei_base_1.x=x+origin_x+10
#    @zhenwei_base_2.x=x+origin_x+50
#   @zhenwei_base_3.x=x+origin_x+10
#   @zhenwei_base_4.x=x+origin_x+50
#   @zhenwei_base_5.x=x+origin_x+10
#   @zhenwei_base_6.x=x+origin_x+100
#   @zhenwei_base_7.x=x+origin_x+180
  #  @zhenwei_base_8.x=x+origin_x+100
  #  @zhenwei_base_9.x=x+origin_x+180
  #  @zhenwei_base_10.x=x+origin_x+100

  end #
  
  def y=(y)
    super(y)
#   adj_y = 0
#   @zhenwei_base_1.y=y+origin_y+40
#    @zhenwei_base_2.y=y+origin_y+80
#    @zhenwei_base_3.y=y+origin_y+40
#    @zhenwei_base_4.y=y+origin_y+80
#   @zhenwei_base_5.y=y+origin_y+40
#   @zhenwei_base_6.y=y+origin_y+120
#   @zhenwei_base_7.y=y+origin_y+180
#   @zhenwei_base_8.y=y+origin_y+120
  #  @zhenwei_base_9.y=y+origin_y+180
  #  @zhenwei_base_10.y=y+origin_y+120


  end  
  def visible=(visible)
    super(visible)
  #  @zhenwei_base.visible = visible
    @zhenwei_base_1.visible = visible
    @zhenwei_base_2.visible = visible
    @zhenwei_base_3.visible = visible
    @zhenwei_base_4.visible = visible
    @zhenwei_base_5.visible = visible
    @zhenwei_base_6.visible = visible
    @zhenwei_base_7.visible = visible
    @zhenwei_base_8.visible = visible
    @zhenwei_base_9.visible = visible
    @zhenwei_base_10.visible = visible
   # @finish_button.visible = visible
    end  
  end
  def contents_opacity=(opacity)
    super(opacity)
    @zhenwei_base_1.opacity = opacity
    @zhenwei_base_2.opacity = opacity
    @zhenwei_base_3.opacity = opacity
    @zhenwei_base_4.opacity = opacity
    @zhenwei_base_5.opacity = opacity
    @zhenwei_base_6.opacity = opacity
    @zhenwei_base_7.opacity = opacity
    @zhenwei_base_8.opacity = opacity
    @zhenwei_base_9.opacity = opacity
    @zhenwei_base_10.opacity = opacity
    @finish_button.opacity = opacity
    end  
  end

  def index=(index)
    @zhenwei_index=index
  end

  def back_normal(index)
    #p index
      @zhenwei_index = -1
     for i in 0..@max_item_row_2-1
        @zhenwei_buttons.bitmap = RPG::Cache.title("bottom-button-"+(i+1).to_s+"-basic")#+i.to_s)
     end
    else
     @zhenwei_buttons[index].bitmap = RPG::Cache.title("bottom-button-"+(index+1).to_s+"-basic")#+i.to_s)
    end
  end
  #--------------------------------------------------------------------------
  # ● 更新光标矩形
  #--------------------------------------------------------------------------
  def update_cursor_rect
      
      if @zhenwei_index < 0
        for i in 0..@max_item_row_2-1
          back_normal(i)
        end
        return
      end
      #p @index,@second_index                                 
     # @second_index%=2                                            完成
      @zhenwei_buttons[@zhenwei_index].bitmap = RPG::Cache.title("bottom-button-"+(@second_index+1).to_s+"-l")#+i.to_s)
    end
#  end
  #--------------------------------------------------------------------------
  # ● 刷新画面
  #--------------------------------------------------------------------------
  def update
    if self.active
      if Input.repeat?(Input::DOWN)
        $game_system.se_play($data_system.cursor_se)
      
        @v_index = (@v_index+1)%@max_row
        #@last_index = @index
        if @v_index == 0
           #back_normal(@zhenwei_index)
          @zhenwei_index = -1
          for i in 0..@max_item_row_2-1
          back_normal(i)
          end
        else
          #back_normal(@index)
          @zhenwei_index = 1
          #@index%=@max_item_row_2
           if @player_or_enermy == 0
           @groups[@index].bitmap = RPG::Cache.title("team-basic")#+i.to_s)
          else
           @groups[@index].bitmap = RPG::Cache.title("enermy-basic")#+i.to_s)
          end         
        end  
        refresh
      end
      
      if Input.repeat?(Input::UP)
        $game_system.se_play($data_system.cursor_se)
        #back_normal(@index)
        @v_index = (@v_index-1)%@max_row
       # @last_index = @index
        if @v_index == 0
           #back_normal(@zhenwei_index)
          @zhenwei_index = -1
          for i in 0..@max_item_row_2-1
          back_normal(i)
          end
        else
          #back_normal(@index)
          @zhenwei_index = 1
          #@index%=@max_item_row_2
           if @player_or_enermy == 0               #队伍1-5背景
           @groups[@index].bitmap = RPG::Cache.title("team-basic")#+i.to_s)
          else                                    # 敌人队伍1-5背景
           @groups[@index].bitmap = RPG::Cache.title("enermy-basic")#+i.to_s)
          end              
        end  
        refresh
      end
    if @v_index == 0
      # 方向键左被按下的情况下
      if Input.repeat?(Input::RIGHT)
        $game_system.se_play($data_system.cursor_se)
        back_normal(@index)
        @index = (@index+1)%@group_max
        until @able[@index]
          @index = (@index+1)%@group_max
        end
        refresh
      end
      # 方向键右被按下的情况下
      if Input.repeat?(Input::LEFT)
        $game_system.se_play($data_system.cursor_se)
        back_normal(@index)
        @index = (@index+@item_max-1)%@group_max
        until @able[@index]
          @index = (@index+@item_max-1)%@group_max
        end
        refresh
      end
    else # level 2
      # 方向键左被按下的情况下
      if Input.repeat?(Input::RIGHT)
        $game_system.se_play($data_system.cursor_se)
        back_normal(@zhenwei_index)
        @zhenwei_index = (@zhenwei_index+1)%@max_item_row_2
        #p @zhenwei_index
        refresh
      end
      # 方向键右被按下的情况下
      if Input.repeat?(Input::LEFT)
        $game_system.se_play($data_system.cursor_se)
        back_normal(@zhenwei_index)
        @zhenwei_index = (@zhenwei_index-1)%@max_item_row_2
        refresh
      end
    end   # @v_index == 0
      
      

      
      
      
    end   
   
      update_cursor_rect #if @slide_over
  end
  #--------------------------------------------------------------------------
  # ● 获取东西
  #--------------------------------------------------------------------------
  def item_num(index = @index) # 定义项目 (索引=@索引)
    return @selected_units[@index].size
  end
  def set_units(a)
    @selected_units = a
  end  
  #--------------------------------------------------------------------------
  # ● 更新内容
  #--------------------------------------------------------------------------
  def refresh
    for i in 0...@item_max
      @icons.bitmap = nil
    end
    #对于i,单位为0..@选定的单位[@索引]。大小-1
    for i in 0..@selected_units[@index].size-1
      @icons.bitmap = RPG::Cache.icon(Figter_data::CHARACTER_NAME[@selected_units[@index]])
      #p Figter_data::CHARACTER_NAME[twoArray[@index]]
    end
   
  end
  
  #--------------------------------------------------------------------------
  # ● 阵位1
  #--------------------------------------------------------------------------
  def zhenwei_1_spawn
#  @efs_team_spawn[@index]=[9,11]
    $scene = Scene_chuzhan.new(4)
  end
  #--------------------------------------------------------------------------
  # ● 阵位2
  #--------------------------------------------------------------------------
  def zhenwei_2_spawn
   #@efs_team_spawn[@index]=[9,12]
    $scene = Scene_chuzhan.new
  end
  #--------------------------------------------------------------------------
  # ● 阵位3
  #--------------------------------------------------------------------------
  def zhenwei_3_spawn
  # @efs_team_spawn[@index]=[9,13]
   $scene = Scene_chuzhan.new #refresh
  end
  #--------------------------------------------------------------------------
  # ● 阵位4
  #--------------------------------------------------------------------------
  def zhenwei_4_spawn
#  @efs_team_spawn[@index]=[9,14]
  $scene = Scene_chuzhan.new#  refresh
  end
  #--------------------------------------------------------------------------
  # ● 阵位5
  #--------------------------------------------------------------------------
  def zhenwei_5_spawn
  # @efs_team_spawn[@index]=[9,15]
  $scene = Scene_chuzhan.new #   refresh
  end
  #--------------------------------------------------------------------------
  # ● 阵位6
  #--------------------------------------------------------------------------
  def zhenwei_6_spawn
  # @efs_team_spawn[@index]=[9,16]
$scene = Scene_chuzhan.new #  refresh
  end
  #--------------------------------------------------------------------------
  # ● 阵位7
  #--------------------------------------------------------------------------
  def zhenwei_7_spawn
  # @efs_team_spawn[@index]=[9,17]
$scene = Scene_chuzhan.new#   refresh
  end
  #--------------------------------------------------------------------------
  # ● 阵位8
  #--------------------------------------------------------------------------
  def zhenwei_8_spawn
  # @efs_team_spawn[@index]=[9,18]
   $scene = Scene_chuzhan.new #refresh
  end
  #--------------------------------------------------------------------------
  # ● 阵位9
  #--------------------------------------------------------------------------
  def zhenwei_9_spawn
  # @efs_team_spawn[@index]=[9,19]
  $scene = Scene_chuzhan.new # refresh
  end
  #--------------------------------------------------------------------------
  # ● 阵位10
  #--------------------------------------------------------------------------
  def zhenwei_10_spawn
  # @efs_team_spawn[@index]=[9,20]
  $scene = Scene_chuzhan.new # refresh
  end



[/pre]
布阵1.png
4b51ac5253460c7db54720d6d4971b4c_112121o0zv0w8jilj08uv0.png
梦石
0
星屑
7296
在线时间
1244 小时
注册时间
2015-8-15
回帖
473
 楼主| 发表于 2024-7-11 13:35:24 | 显示全部楼层
本帖最后由 金芒芒 于 2024-7-11 13:36 编辑
  1. #==============================================================================
  2. # ■ Scene_zhenwei
  3. #------------------------------------------------------------------------------
  4. #  处理菜单画面的类。
  5. #==============================================================================

  6. class Scene_zhenwei
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化对像
  9.   #     zhenwei_index : 命令光标的初期位置,zhenwei_index = 9,chuzhan_index = 0
  10.   #--------------------------------------------------------------------------
  11.   def initialize(zhenwei_index = 0)
  12.     @zhenwei_index = zhenwei_index
  13. #    @chuzhan_index = chuzhan_index
  14.     @wait_time = 0
  15.   end
  16.   #--------------------------------------------------------------------------
  17.   # ● 主处理
  18.   #--------------------------------------------------------------------------
  19.   def main
  20.     # 生成地图背景
  21.     @zhenwei_TransparentBackground = Spriteset_Map.new
  22.     @chuzhan_IndexCommand = Window_chuzhanCommand.new
  23.     # 生成出战菜单选项
  24.     @zhenwei_IndexCommand = Window_zhenweiCommand.new
  25.     @zhenwei_IndexCommand.index = @zhenwei_index

  26.     # 冻结
  27.     Graphics.transition
  28.     # 不切换场景就一直循环
  29.     update while $scene == self
  30.     # 渐变
  31.     Graphics.freeze
  32.     @zhenwei_IndexCommand.dispose
  33.     @chuzhan_IndexCommand.dispose

  34.   end
  35.   #--------------------------------------------------------------------------
  36.   # ● 刷新画面
  37.   #--------------------------------------------------------------------------
  38.   def update
  39.     Graphics.update
  40.     Input.update
  41.     @wait_time -= 1

  42.     @zhenwei_IndexCommand.update
  43.   
  44.     update_zhenwei_IndexCommand


  45. end

  46.   #--------------------------------------------------------------------------
  47.   # ● 刷新画面 (命令窗口被激活的情况下)
  48.   #--------------------------------------------------------------------------


  49.   #--------------------------------------------------------------------------
  50.   # ● 刷新画面 (命令窗口被激活的情况下)
  51.   #--------------------------------------------------------------------------
  52.   def update_zhenwei_IndexCommand
  53.       
  54.   #  end
  55.    # update_zhenwei_IndexCommand
  56.     # 按下 B 键的情况下
  57.     if Input.trigger?(Input::B)
  58.       # 演奏取消 SE
  59.       $game_system.se_play($data_system.cancel_se)
  60.       # 切换的地图画面
  61.       $scene = Scene_chuzhan.new
  62.       return
  63.     end
  64.     # 按下 C 键的情况下
  65.     if Input.trigger?(Input::C)
  66.       # 命令窗口的光标位置分支
  67.       case @zhenwei_IndexCommand.index
  68.       when 0  # 队组1出生点
  69.         # 演奏确定 SE
  70.         $game_system.se_play($data_system.decision_se)
  71.       if $game_switches[20] == true
  72.        $game_switches[20] = false
  73.        $出战前锋=[9,12]
  74.       # p $出战前锋
  75.        $scene = Scene_chuzhan.new(1)
  76.       end
  77.       if $game_switches[21] == true
  78.        $game_switches[21] = false
  79.        $scene = Scene_chuzhan.new(2)
  80.       end
  81.       if $game_switches[22] == true
  82.        $game_switches[22] = false
  83.        $scene = Scene_chuzhan.new(3)
  84.       end
  85.       if $game_switches[23] == true
  86.        $game_switches[23] = false
  87.        $scene = Scene_chuzhan.new(4)
  88.       end
  89.       if $game_switches[24] == true
  90.        $game_switches[24] = false
  91.        $scene = Scene_chuzhan.new(5)
  92.       end
  93.       if $game_switches[25] == true
  94.        $game_switches[25] = false
  95.        $scene = Scene_chuzhan.new(0)
  96.       end
  97.       when 1  # 队组2出生点
  98.         # 演奏确定 SE
  99.         $game_system.se_play($data_system.decision_se)
  100.       if $game_switches[20] == true
  101.        $game_switches[20] = false
  102.        $scene = Scene_chuzhan.new(1)
  103.       end
  104.       if $game_switches[21] == true
  105.        $game_switches[21] = false
  106.        $scene = Scene_chuzhan.new(2)
  107.       end
  108.       if $game_switches[22] == true
  109.        $game_switches[22] = false
  110.        $scene = Scene_chuzhan.new(3)
  111.       end
  112.       if $game_switches[23] == true
  113.        $game_switches[23] = false
  114.        $scene = Scene_chuzhan.new(4)
  115.       end
  116.       if $game_switches[24] == true
  117.        $game_switches[24] = false
  118.        $scene = Scene_chuzhan.new(5)
  119.       end
  120.       if $game_switches[25] == true
  121.        $game_switches[25] = false
  122.        $scene = Scene_chuzhan.new(0)
  123.       end
  124.       when 2  # 队组3出生点
  125.         # 演奏确定 SE
  126.         $game_system.se_play($data_system.decision_se)
  127.         # 激活状态窗口
  128.       if $game_switches[20] == true
  129.        $game_switches[20] = false
  130.        $scene = Scene_chuzhan.new(1)
  131.       end
  132.       if $game_switches[21] == true
  133.        $game_switches[21] = false
  134.        $scene = Scene_chuzhan.new(2)
  135.       end
  136.       if $game_switches[22] == true
  137.        $game_switches[22] = false
  138.        $scene = Scene_chuzhan.new(3)
  139.       end
  140.       if $game_switches[23] == true
  141.        $game_switches[23] = false
  142.        $scene = Scene_chuzhan.new(4)
  143.       end
  144.       if $game_switches[24] == true
  145.        $game_switches[24] = false
  146.        $scene = Scene_chuzhan.new(5)
  147.       end
  148.       if $game_switches[25] == true
  149.        $game_switches[25] = false
  150.        $scene = Scene_chuzhan.new(0)
  151.       end

  152.       when 3  # 队组4出生点
  153.         # 演奏确定 SE
  154.         $game_system.se_play($data_system.decision_se)
  155.       if $game_switches[20] == true
  156.        $game_switches[20] = false
  157.        $scene = Scene_chuzhan.new(1)
  158.       end
  159.       if $game_switches[21] == true
  160.        $game_switches[21] = false
  161.        $scene = Scene_chuzhan.new(2)
  162.       end
  163.       if $game_switches[22] == true
  164.        $game_switches[22] = false
  165.        $scene = Scene_chuzhan.new(3)
  166.       end
  167.       if $game_switches[23] == true
  168.        $game_switches[23] = false
  169.        $scene = Scene_chuzhan.new(4)
  170.       end
  171.       if $game_switches[24] == true
  172.        $game_switches[24] = false
  173.        $scene = Scene_chuzhan.new(5)
  174.       end
  175.       if $game_switches[25] == true
  176.        $game_switches[25] = false
  177.        $scene = Scene_chuzhan.new(0)
  178.       end
  179.       when 4  # 队组5出生点
  180.         # 演奏确定 SE
  181.         $game_system.se_play($data_system.decision_se)
  182.       if $game_switches[20] == true
  183.        $game_switches[20] = false
  184.        $scene = Scene_chuzhan.new(1)
  185.       end
  186.       if $game_switches[21] == true
  187.        $game_switches[21] = false
  188.        $scene = Scene_chuzhan.new(2)
  189.       end
  190.       if $game_switches[22] == true
  191.        $game_switches[22] = false
  192.        $scene = Scene_chuzhan.new(3)
  193.       end
  194.       if $game_switches[23] == true
  195.        $game_switches[23] = false
  196.        $scene = Scene_chuzhan.new(4)
  197.       end
  198.       if $game_switches[24] == true
  199.        $game_switches[24] = false
  200.        $scene = Scene_chuzhan.new(5)
  201.       end
  202.       if $game_switches[25] == true
  203.        $game_switches[25] = false
  204.        $scene = Scene_chuzhan.new(0)
  205.       end

  206.       when 5  
  207.         $game_system.se_play($data_system.decision_se)
  208.       if $game_switches[20] == true
  209.        $game_switches[20] = false
  210.        $scene = Scene_chuzhan.new(1)
  211.       end
  212.       if $game_switches[21] == true
  213.        $game_switches[21] = false
  214.        $scene = Scene_chuzhan.new(2)
  215.       end
  216.       if $game_switches[22] == true
  217.        $game_switches[22] = false
  218.        $scene = Scene_chuzhan.new(3)
  219.       end
  220.       if $game_switches[23] == true
  221.        $game_switches[23] = false
  222.        $scene = Scene_chuzhan.new(4)
  223.       end
  224.       if $game_switches[24] == true
  225.        $game_switches[24] = false
  226.        $scene = Scene_chuzhan.new(5)
  227.       end
  228.       if $game_switches[25] == true
  229.        $game_switches[25] = false
  230.        $scene = Scene_chuzhan.new(0)
  231.       end

  232.       when 6  
  233.         $game_system.se_play($data_system.decision_se)
  234.       if $game_switches[20] == true
  235.        $game_switches[20] = false
  236.        $scene = Scene_chuzhan.new(1)
  237.       end
  238.       if $game_switches[21] == true
  239.        $game_switches[21] = false
  240.        $scene = Scene_chuzhan.new(2)
  241.       end
  242.       if $game_switches[22] == true
  243.        $game_switches[22] = false
  244.        $scene = Scene_chuzhan.new(3)
  245.       end
  246.       if $game_switches[23] == true
  247.        $game_switches[23] = false
  248.        $scene = Scene_chuzhan.new(4)
  249.       end
  250.       if $game_switches[24] == true
  251.        $game_switches[24] = false
  252.        $scene = Scene_chuzhan.new(5)
  253.       end
  254.       if $game_switches[25] == true
  255.        $game_switches[25] = false
  256.        $scene = Scene_chuzhan.new(0)
  257.       end

  258.       when 7  
  259.         $game_system.se_play($data_system.decision_se)
  260.       if $game_switches[20] == true
  261.        $game_switches[20] = false
  262.        $scene = Scene_chuzhan.new(1)
  263.       end
  264.       if $game_switches[21] == true
  265.        $game_switches[21] = false
  266.        $scene = Scene_chuzhan.new(2)
  267.       end
  268.       if $game_switches[22] == true
  269.        $game_switches[22] = false
  270.        $scene = Scene_chuzhan.new(3)
  271.       end
  272.       if $game_switches[23] == true
  273.        $game_switches[23] = false
  274.        $scene = Scene_chuzhan.new(4)
  275.       end
  276.       if $game_switches[24] == true
  277.        $game_switches[24] = false
  278.        $scene = Scene_chuzhan.new(5)
  279.       end
  280.       if $game_switches[25] == true
  281.        $game_switches[25] = false
  282.        $scene = Scene_chuzhan.new(0)
  283.       end

  284.       when 8  
  285.         $game_system.se_play($data_system.decision_se)
  286.       if $game_switches[20] == true
  287.        $game_switches[20] = false
  288.        $scene = Scene_chuzhan.new(1)
  289.       end
  290.       if $game_switches[21] == true
  291.        $game_switches[21] = false
  292.        $scene = Scene_chuzhan.new(2)
  293.       end
  294.       if $game_switches[22] == true
  295.        $game_switches[22] = false
  296.        $scene = Scene_chuzhan.new(3)
  297.       end
  298.       if $game_switches[23] == true
  299.        $game_switches[23] = false
  300.        $scene = Scene_chuzhan.new(4)
  301.       end
  302.       if $game_switches[24] == true
  303.        $game_switches[24] = false
  304.        $scene = Scene_chuzhan.new(5)
  305.       end
  306.       if $game_switches[25] == true
  307.        $game_switches[25] = false
  308.        $scene = Scene_chuzhan.new(0)
  309.       end

  310.       when 9  
  311.         $game_system.se_play($data_system.decision_se)
  312.       if $game_switches[20] == true
  313.        $game_switches[20] = false
  314.        $scene = Scene_chuzhan.new(1)
  315.       end
  316.       if $game_switches[21] == true
  317.        $game_switches[21] = false
  318.        $scene = Scene_chuzhan.new(2)
  319.       end
  320.       if $game_switches[22] == true
  321.        $game_switches[22] = false
  322.        $scene = Scene_chuzhan.new(3)
  323.       end
  324.       if $game_switches[23] == true
  325.        $game_switches[23] = false
  326.        $scene = Scene_chuzhan.new(4)
  327.       end
  328.       if $game_switches[24] == true
  329.        $game_switches[24] = false
  330.        $scene = Scene_chuzhan.new(5)
  331.       end
  332.       if $game_switches[25] == true
  333.        $game_switches[25] = false
  334.        $scene = Scene_chuzhan.new(0)
  335.        end
  336.       end
  337.       return
  338.     end
  339.   end

  340. end
复制代码
  1. #==============================================================================
  2. # ■ Window_MenuCommand
  3. #------------------------------------------------------------------------------
  4. #  菜单的命令选择行窗口。
  5. #==============================================================================

  6. class Window_zhenweiCommand <  Window_Base         # Window_Selectable
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化对像
  9.   #     width    : 窗口的宽
  10.   #     commands : 命令字符串序列
  11.   #--------------------------------------------------------------------------

  12.   attr_reader   :index
  13.   attr_reader   :slide_over   #滚动结束
  14.   #start load option exit
  15.   #--------------------------------------------------------------------------
  16.   # ● 初始化对像
  17.   #     actor : 角色
  18.   #--------------------------------------------------------------------------
  19.   def initialize(index=0)
  20.     @index = index
  21.     #选项背景
  22.     @button_base = Sprite.new
  23.     @button_base.bitmap = RPG::Cache.title("")
  24.     @button_base.x = 409
  25.     @button_base.y = 56
  26.    
  27.    
  28.     @cur_back = []
  29.     @text_list = []
  30.     @able = []
  31.     #光标
  32.     @item_max = 10
  33.     @column_max = 2
  34.     for i in 0...@item_max
  35.       @able[i] = true
  36.       @cur_back[i] = Sprite.new
  37.       @cur_back[i].bitmap = RPG::Cache.title("title-normal")#+i.to_s)
  38.       @cur_back[i].x = 435+i%4 *86
  39.       @cur_back[i].y = 81#+45*i
  40.       @text_list[i] = Sprite.new
  41.       @text_list[i].bitmap = RPG::Cache.title("index-"+i.to_s)
  42.       @text_list[i].x = 435 + 47+i%4 *86
  43.       @text_list[i].y = 81+9#+45*i + 9
  44.     end
  45.       @cur_back[0].x = 349
  46.       @cur_back[0].y = 145
  47.       @cur_back[1].x = 435
  48.       @cur_back[1].y = 59
  49.       @cur_back[2].x = 521
  50.       @cur_back[2].y = 145
  51.       @cur_back[3].x = 607
  52.       @cur_back[3].y = 59
  53.       @cur_back[4].x = 349
  54.       @cur_back[4].y = 317
  55.       @cur_back[5].x = 435
  56.       @cur_back[5].y = 231
  57.       @cur_back[6].x = 521
  58.       @cur_back[6].y = 317
  59.       @cur_back[7].x = 607
  60.       @cur_back[7].y = 231
  61.       @cur_back[8].x = 435
  62.       @cur_back[8].y = 403
  63.       @cur_back[9].x = 607
  64.       @cur_back[9].y = 403
  65.       @text_list[0].x = 349
  66.       @text_list[0].y = 145
  67.       @text_list[1].x = 435
  68.       @text_list[1].y = 59
  69.       @text_list[2].x = 521
  70.       @text_list[2].y = 145
  71.       @text_list[3].x = 607
  72.       @text_list[3].y = 59
  73.       @text_list[4].x = 349
  74.       @text_list[4].y = 317
  75.       @text_list[5].x = 435
  76.       @text_list[5].y = 231
  77.       @text_list[6].x = 521
  78.       @text_list[6].y = 317
  79.       @text_list[7].x = 607
  80.       @text_list[7].y = 231
  81.       @text_list[8].x = 435
  82.       @text_list[8].y = 403
  83.       @text_list[9].x = 607
  84.       @text_list[9].y = 403

  85.       
  86.       
  87.     @slide_over = false
  88.     super(0, 0, 0, 0)
  89.     self.opacity = 0
  90.     self.active = true
  91.   end
  92.   def origin_x
  93.     return 435
  94.   end
  95.   def origin_y
  96.     return 81
  97.   end
  98.   #--------------------------------------------------------------------------
  99.   # ● 一些方法的重载
  100.   #--------------------------------------------------------------------------  
  101.   def dispose
  102.     @button_base.dispose
  103.     for i in 0...@item_max
  104.       @cur_back[i].dispose
  105.       @text_list[i].dispose
  106.     end
  107.     super
  108.   end
  109.   
  110.   def z=(z)
  111.     super(z)
  112.     @button_base.z=z
  113.     for i in 0...@item_max
  114.       @cur_back[i].z=z
  115.       @text_list[i].z=z
  116.     end
  117.   end
  118.   def visible=(visible)
  119.     super(visible)
  120.     @button_base.visible = visible
  121.     for i in 0...@item_max
  122.       @cur_back[i].visible = visible
  123.       @text_list[i].visible = visible
  124.     end
  125.   end
  126.   def index=(index)
  127.     @index=index
  128.   end
  129.   def disable_item(i)
  130.   end
  131.   #--------------------------------------------------------------------------
  132.   # ● 光标不被选中状态
  133.   #--------------------------------------------------------------------------
  134.   def back_normal(index)
  135.     if index != -1
  136.        @cur_back[index].bitmap = RPG::Cache.title("title-normal")#+i.to_s)
  137.        @text_list[index].bitmap = RPG::Cache.title("index-"+index.to_s)
  138.     end
  139.   end
  140.   def disable_item(index)
  141.     @cur_back[index].bitmap = RPG::Cache.title("title-pressed")#+i.to_s)
  142.     @able[index] = false
  143.     @text_list[index].bitmap = RPG::Cache.title("index-"+index.to_s+"-black")
  144.     #@cur_back[index].color = Color.new(0,0,0,128)
  145.   end
  146.   #--------------------------------------------------------------------------
  147.   # ● 更新光标矩形
  148.   #--------------------------------------------------------------------------
  149.   def update_cursor_rect
  150.     # 光标位置不满 0 的情况下
  151.     if @index < 0
  152.       for i in 0...@item_max
  153.         back_normal(i)
  154.       end
  155.       return
  156.     end
  157.     @cur_back[@index].bitmap = RPG::Cache.title("title-highlight")#+i.to_s)
  158.     @text_list[@index].bitmap = RPG::Cache.title("index-"+index.to_s+"-hl")
  159. #NAME?
  160.     speed = 40#闪烁速度
  161. #    if Graphics.frame_count % speed
  162. #      < speed/2
  163. #      @cur_back[@index].color = Color.new(255,255,255,100+(Graphics.frame_count%speed)*2)
  164. #   else
  165. #     @cur_back[@index].color = Color.new(255,255,255,100+(speed-Graphics.frame_count%speed)*2)
  166. #   end
  167. #NAME?

  168.   end
  169.   #--------------------------------------------------------------------------
  170.   # ● 刷新画面
  171.   #--------------------------------------------------------------------------
  172.   def update
  173.     #@cur_back[i].x = 644#640-188
  174.      @slide_over = true

  175.    
  176.     if self.active
  177.       # 方向键左被按下的情况下
  178.       if Input.repeat?(Input::DOWN)
  179.         $game_system.se_play($data_system.cursor_se)
  180.         back_normal(@index)
  181.         @index = (@index+1)%@item_max
  182.         until @able[@index]
  183.           @index = (@index+1)%@item_max
  184.         end
  185.       end
  186.       # 方向键右被按下的情况下
  187.       if Input.repeat?(Input::UP)
  188.         $game_system.se_play($data_system.cursor_se)
  189.         back_normal(@index)
  190.         @index = (@index+@item_max-1)%@item_max
  191.         until @able[@index]
  192.           @index = (@index+@item_max-1)%@item_max
  193.         end
  194.       end
  195.     end
  196.     # 刷新光标矩形
  197.     update_cursor_rect if @slide_over
  198.   end
  199.   
  200. end
复制代码
阵位破解.png
4b51ac5253460c7db54720d6d4971b4c_112121o0zv0w8jilj08uv0.png
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部