设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 193|回复: 0
打印 上一主题 下一主题

[有事请教] 【已解决】菜单1@C就直接菜单2结果呢

[复制链接]

Lv4.逐梦者

梦石
0
星屑
7474
在线时间
1302 小时
注册时间
2015-8-15
帖子
742
跳转到指定楼层
1
发表于 2024-7-5 07:38:32 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 金芒芒 于 2024-7-5 16:45 编辑

菜单2无法选项直接选项1结果
RUBY 代码复制
  1. #==============================================================================
  2. # ■ Scene_chuzhan
  3. #------------------------------------------------------------------------------
  4. #  处理菜单画面的类。
  5. #==============================================================================
  6.  
  7. class Scene_chuzhan
  8.   #--------------------------------------------------------------------------
  9.   # ● 初始化对像
  10.   #     chuzhan_index : 命令光标的初期位置
  11.   #--------------------------------------------------------------------------
  12.   def initialize(chuzhan_index = 0,zhenwei_index = 0)
  13.     @chuzhan_index = chuzhan_index
  14.     @zhenwei_index = zhenwei_index
  15.     @wait_time = 0
  16.   end
  17.   #--------------------------------------------------------------------------
  18.   # ● 主处理
  19.   #--------------------------------------------------------------------------
  20.   def main
  21.     # 生成地图背景
  22.     @chezhan_TransparentBackground = Spriteset_Map.new
  23.     # 生成出战菜单选项
  24.     @chezhan_IndexCommand = Window_chuzhanCommand.new
  25.     @chezhan_IndexCommand.index = @chuzhan_index
  26.     # 生成阵位列表
  27.     @zhenwei_IndexCommand = Window_zhenweiCommand.new
  28.     @zhenwei_IndexCommand.index = @zhenwei_index
  29.  
  30.     # 冻结
  31.     Graphics.transition
  32.     # 不切换场景就一直循环
  33.     update while $scene == self
  34.     # 渐变
  35.     Graphics.freeze
  36.     @chezhan_IndexCommand.dispose
  37.     @zhenwei_IndexCommand.dispose
  38.   end
  39.   #--------------------------------------------------------------------------
  40.   # ● 刷新画面
  41.   #--------------------------------------------------------------------------
  42.   def update
  43.     Graphics.update
  44.     Input.update
  45.     @wait_time -= 1
  46. # if @chezhan_IndexCommand.active == true
  47.     @chezhan_IndexCommand.update
  48.   #  end
  49.     update_chezhan_IndexCommand
  50.   # if @chezhan_IndexCommand.active == false
  51.    #   @zhenwei_IndexCommand.update
  52.    #   update_zhenwei_IndexCommand
  53.    #  end
  54. #   return zhenweiUpdate_IndexCommand if@chezhan_IndexCommand.active
  55. #  return zhenweiUpdate_IndexCommand if @zhenwei_IndexCommand.active =nil
  56.  
  57. end
  58.  
  59.   #--------------------------------------------------------------------------
  60.   # ● 刷新画面 (命令窗口被激活的情况下)
  61.   #--------------------------------------------------------------------------
  62.   def update_chezhan_IndexCommand
  63.  
  64.   # @chezhan_IndexCommand.update
  65.     # 按下 B 键的情况下
  66.     if Input.trigger?(Input::B)
  67.       $scene = Scene_Map.new
  68.       return
  69.     end
  70.  
  71.     # 按下 C 键的情况下
  72.     if Input.trigger?(Input::C)
  73.       # 命令窗口的光标位置分支
  74.       case  @chezhan_IndexCommand.index
  75.       when 0  # 队组1出生点
  76.         # 演奏确定 SE
  77.         $game_system.se_play($data_system.decision_se)
  78.         # 切换到物品画面
  79.       # $game_switches[队伍1] = true #/ false
  80.        $game_switches[20] = true
  81.        $game_switches[21] = false
  82.        $game_switches[22] = false
  83.        $game_switches[23] = false
  84.        $game_switches[24] = false
  85.        @chezhan_IndexCommand.active = false
  86.        @zhenwei_IndexCommand.active = true
  87.        @zhenwei_IndexCommand.update
  88.        update_zhenwei_IndexCommand
  89.       # $scene = Scene_chuzhan.new(5)
  90.       when 1  # 队组2出生点
  91.         # 演奏确定 SE
  92.         $game_system.se_play($data_system.decision_se)
  93.         # 激活状态窗口
  94.  
  95.  
  96.        $game_switches[20] = false
  97.        $game_switches[21] = true
  98.        $game_switches[22] = false
  99.        $game_switches[23] = false
  100.        $game_switches[24] = false
  101.        @chezhan_IndexCommand.active = false
  102.        @zhenwei_IndexCommand.active = true
  103.      #  $scene = Scene_chuzhan.new
  104.       when 2  # 队组3出生点
  105.         # 演奏确定 SE
  106.         $game_system.se_play($data_system.decision_se)
  107.         # 激活状态窗口
  108.  
  109.  
  110.        $game_switches[20] = false
  111.        $game_switches[21] = false
  112.        $game_switches[22] = true
  113.        $game_switches[23] = false
  114.        $game_switches[24] = false
  115.        @chezhan_IndexCommand.active = false
  116.        @zhenwei_IndexCommand.active = true
  117.       when 3  # 队组4出生点
  118.         # 演奏确定 SE
  119.        $game_system.se_play($data_system.decision_se)
  120.  
  121.  
  122.        $game_switches[20] = false
  123.        $game_switches[21] = false
  124.        $game_switches[22] = false
  125.        $game_switches[23] = true
  126.        $game_switches[24] = false
  127.        @chezhan_IndexCommand.active = false
  128.        @zhenwei_IndexCommand.active = true
  129.  
  130.       when 4  # 队组5出生点
  131.         # 演奏确定 SE
  132.        $game_system.se_play($data_system.decision_se)
  133.  
  134.  
  135.        $game_switches[20] = false
  136.        $game_switches[21] = false
  137.        $game_switches[22] = false
  138.        $game_switches[23] = false
  139.        $game_switches[24] = true
  140.        @chezhan_IndexCommand.active = false
  141.        @zhenwei_IndexCommand.active = true
  142.  
  143.      end
  144.  
  145.  
  146.       return
  147.     end
  148.   end
  149.  
  150.   #--------------------------------------------------------------------------
  151.   # ● 刷新画面 (命令窗口被激活的情况下)
  152.   #--------------------------------------------------------------------------
  153.   def update_zhenwei_IndexCommand
  154.  
  155.     # 按下 B 键的情况下
  156.     if Input.trigger?(Input::B)
  157.       # 演奏取消 SE
  158.       $game_system.se_play($data_system.cancel_se)
  159.       # 切换的地图画面
  160.       $scene = Scene_Map.new
  161.       return
  162.     end
  163.     # 按下 C 键的情况下
  164.     if Input.trigger?(Input::C)
  165.       # 命令窗口的光标位置分支
  166.       case @zhenwei_IndexCommand.index
  167.       when 0  # 队组1出生点
  168.         # 演奏确定 SE
  169.         $game_system.se_play($data_system.decision_se)
  170.         # 切换到物品画面
  171.        # $出战1=[]
  172.        if $game_switches[20] == true
  173.          $出战1=[9.13]
  174.         p $出战1
  175.        end
  176.         if $game_switches[21] == true
  177.          $出战2=[9.113]
  178.         p $出战2
  179.        end
  180.  
  181.        # $scene = Scene_chuzhan.new(1)
  182.       when 1  # 队组2出生点
  183.         # 演奏确定 SE
  184.         $game_system.se_play($data_system.decision_se)
  185.         # 激活状态窗口
  186.         $出战2=[]
  187.        $scene = Scene_chuzhan.new(2)
  188.       when 2  # 队组3出生点
  189.         # 演奏确定 SE
  190.         $game_system.se_play($data_system.decision_se)
  191.         # 激活状态窗口
  192.        $出战3=[]
  193.      $scene = Scene_chuzhan.new(3)
  194.       when 3  # 队组4出生点
  195.         # 演奏确定 SE
  196.         $game_system.se_play($data_system.decision_se)
  197.        $出战4=[]
  198.         # 激活状态窗口
  199.      $scene = Scene_chuzhan.new(4)
  200.  
  201.       when 4  # 队组5出生点
  202.         # 演奏确定 SE
  203.         $game_system.se_play($data_system.decision_se)
  204.        $出战5=[]
  205.         # 队组4出生点
  206.       $scene = Scene_chuzhan.new(5)
  207.       when 5  
  208.         $game_system.se_play($data_system.decision_se)
  209.        $出战=[]
  210.       $scene = Scene_chuzhan.new(6)
  211.       when 6  
  212.         $game_system.se_play($data_system.decision_se)
  213.        $出战=[]
  214.       $scene = Scene_chuzhan.new(7)
  215.       when 7  
  216.         $game_system.se_play($data_system.decision_se)
  217.        $出战=[]
  218.       $scene = Scene_chuzhan.new(8)
  219.       when 8  
  220.         $game_system.se_play($data_system.decision_se)
  221.        $出战=[]
  222.       $scene = Scene_chuzhan.new(9)
  223.       when 9  
  224.         $game_system.se_play($data_system.decision_se)
  225.        $出战=[]
  226.        $scene = Scene_chuzhan.new(0)
  227.  
  228.  
  229.       end
  230.       return
  231.     end
  232.   end
  233.  
  234. end

#==============================================================================
# ■ Scene_chuzhan
#------------------------------------------------------------------------------
#  处理菜单画面的类。
#==============================================================================

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

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

end

  #--------------------------------------------------------------------------
  # ● 刷新画面 (命令窗口被激活的情况下)
  #--------------------------------------------------------------------------
  def update_chezhan_IndexCommand

  # @chezhan_IndexCommand.update
    # 按下 B 键的情况下
    if Input.trigger?(Input::B)
      $scene = Scene_Map.new
      return
    end

    # 按下 C 键的情况下
    if Input.trigger?(Input::C)
      # 命令窗口的光标位置分支
      case  @chezhan_IndexCommand.index
      when 0  # 队组1出生点
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        # 切换到物品画面
      # $game_switches[队伍1] = true #/ false
       $game_switches[20] = true
       $game_switches[21] = false
       $game_switches[22] = false
       $game_switches[23] = false
       $game_switches[24] = false
#      @chezhan_IndexCommand.active = false
#      @zhenwei_IndexCommand.active = true
       $scene = Scene_zhenwei.new(0)
   #    @zhenwei_IndexCommand.update
      # update_zhenwei_IndexCommand
      # $scene = Scene_chuzhan.new(5)
      when 1  # 队组2出生点
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        # 激活状态窗口


       $game_switches[20] = false
       $game_switches[21] = true
       $game_switches[22] = false
       $game_switches[23] = false
       $game_switches[24] = false
       $scene = Scene_zhenwei.new(0)
     #  $scene = Scene_chuzhan.new
      when 2  # 队组3出生点
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        # 激活状态窗口


       $game_switches[20] = false
       $game_switches[21] = false
       $game_switches[22] = true
       $game_switches[23] = false
       $game_switches[24] = false
       @chezhan_IndexCommand.active = false
       @zhenwei_IndexCommand.active = true
      when 3  # 队组4出生点
        # 演奏确定 SE
       $game_system.se_play($data_system.decision_se)


       $game_switches[20] = false
       $game_switches[21] = false
       $game_switches[22] = false
       $game_switches[23] = true
       $game_switches[24] = false
       @chezhan_IndexCommand.active = false
       @zhenwei_IndexCommand.active = true

      when 4  # 队组5出生点
        # 演奏确定 SE
       $game_system.se_play($data_system.decision_se)


       $game_switches[20] = false
       $game_switches[21] = false
       $game_switches[22] = false
       $game_switches[23] = false
       $game_switches[24] = true
       @chezhan_IndexCommand.active = false
       @zhenwei_IndexCommand.active = true

     end

     
      return
    end
  end

  #--------------------------------------------------------------------------
  # ● 刷新画面 (命令窗口被激活的情况下)
  #--------------------------------------------------------------------------
  def update_zhenwei_IndexCommand
      
  #  end
   # update_zhenwei_IndexCommand
    # 按下 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)
      # 命令窗口的光标位置分支
      case @zhenwei_IndexCommand.index
      when 0  # 队组1出生点
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        # 切换到物品画面
       # $出战1=[]

      $scene = Scene_zhenwei.new
       # $scene = Scene_chuzhan.new(1)
      when 1  # 队组2出生点
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        # 激活状态窗口
     #   $出战2=[]
      $scene = Scene_zhenwei.new
      when 2  # 队组3出生点
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        # 激活状态窗口
       $出战3=[]
     $scene = Scene_chuzhan.new(3)
      when 3  # 队组4出生点
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
       $出战4=[]
        # 激活状态窗口
     $scene = Scene_chuzhan.new(4)

      when 4  # 队组5出生点
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
       $出战5=[]
        # 队组4出生点
      $scene = Scene_chuzhan.new(5)
      when 5  
        $game_system.se_play($data_system.decision_se)
       $出战=[]
      $scene = Scene_chuzhan.new(6)
      when 6  
        $game_system.se_play($data_system.decision_se)
       $出战=[]
      $scene = Scene_chuzhan.new(7)
      when 7  
        $game_system.se_play($data_system.decision_se)
       $出战=[]
      $scene = Scene_chuzhan.new(8)
      when 8  
        $game_system.se_play($data_system.decision_se)
       $出战=[]
      $scene = Scene_chuzhan.new(9)
      when 9  
        $game_system.se_play($data_system.decision_se)
       $出战=[]
       $scene = Scene_chuzhan.new(0)


      end
      return
    end
  end

end

选项阵位.png (127.72 KB, 下载次数: 1)

选项阵位.png
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-9-8 10:31

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表