Project1

标题: 关于宠物脚本的小问题 [打印本页]

作者: 梦到叶子了    时间: 2011-9-18 16:43
标题: 关于宠物脚本的小问题
本帖最后由 梦到叶子了 于 2011-9-18 22:07 编辑

这是梦幻群侠传2的脚本,我加入了鼠标,当设置宠物的时候,如果点鼠标右键返回,就会全部关闭整个宠物窗口回到地图,而用键盘的 ESC就只会返回到上一步,不会关闭全部窗口,如何让鼠标返回正常?
  1. #==============================================================================
  2. # ■ Scene_Baby
  3. #------------------------------------------------------------------------------
  4. #  对召唤兽的管理菜单
  5. #==============================================================================

  6. class Scene_Baby
  7.   #--------------------------------------------------------------------------
  8.   # ● 主处理
  9.   #--------------------------------------------------------------------------
  10.   def initialize(actor_index = 0)
  11.    $kds_baby = actor_index
  12.    $baby_face = 0
  13.    if $game_party.actors[$kds_baby].kds_baby.size > 0
  14.     if $game_party.actors[$kds_baby].kds_canzhan != 0
  15.       $baby_index = $game_actors[$game_party.actors[$kds_baby].kds_canzhan]
  16.     else
  17.       $baby_index = $game_actors[$game_party.actors[$kds_baby].kds_baby[0]]
  18.     end
  19.     $stop = nil
  20.    else
  21.     $stop = 0
  22.    end
  23.   end
  24.   def main
  25.     #宠物界面
  26.    
  27.    @rp = Sprite.new
  28.    @rp.bitmap = RPG::Cache.windowskin("skin_baby")
  29.    
  30.    # @skin = Sprite.new()
  31.    # @skin.bitmap = RPG::Cache.windowskin("skin_baby")
  32.    # @actor = $game_party.actors[0]
  33.    
  34.     @help_window = Window_Help.new
  35.     @help_window.opacity = 0 # 宠物帮助窗口透明度
  36.     @help_window.y = 480-64 #XY坐标
  37.     @item_window = Window_Item2.new
  38.   #  @item_window.opacity = 0 # 宠物物品窗口透明度
  39.     @item_window.active = false
  40.     @item_window.help_window = @help_window
  41.     @item_window.index = -1
  42.     if $game_party.actors[$kds_baby].kds_baby.size > 0
  43.       if $game_party.actors[$kds_baby].kds_canzhan != 0
  44.        @skill_window = Window_Skill.new($game_actors[$game_party.actors[$kds_baby].kds_canzhan])
  45.        @skill_window.opacity = 255 # 宠物特技窗口透明度
  46.        @skill_window.help_window = @help_window
  47.       else
  48.        @skill_window = Window_Skill.new($game_actors[$game_party.actors[$kds_baby].kds_baby[0]])
  49.        @skill_window.help_window = @help_window
  50.       end
  51.     else
  52.       @skill_window = Window_Skill.new(0)
  53.     end
  54.     @skill_window.active = false#true
  55.     @skill_window.index = -1
  56.     @skill_window.update
  57.     s1 = "设置参战"
  58.     s2 = "查看技能"
  59.     s3 = "使用物品"
  60.     s4 = "能力分配"
  61.     s5 = "放生守护"
  62.     s6 = "退出菜单"
  63.     @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5,s6])
  64.     @command_window.opacity = 0 # 宠物普通窗口透明度
  65.     @command_window.y = 480-64-192-32
  66.     if $game_party.actors[$kds_baby].kds_baby.size == 0
  67.     @command_window.disable_item(0)
  68.     @command_window.disable_item(1)
  69.     @command_window.disable_item(2)
  70.     @command_window.disable_item(3)
  71.     @command_window.disable_item(4)
  72.     end
  73.     @command_window.refresh
  74.     @command_window.update
  75.    
  76.     s1 = ""
  77.     s3 = ""
  78.     s2 = ""
  79.     s4 = ""
  80.     s5 = ""
  81.     @command2_window = Window_Command.new(110, [s1, s2, s3, s4, s5],1,16,14)
  82.     @command2_window.x = 160+236+125-6
  83.     @command2_window.y = -4+16+24+22+7+1
  84.     @command2_window.index = -1
  85.     @command2_window.back_opacity = 0
  86.     @command2_window.opacity = 0
  87.     @command2_window.active = false
  88.     @command2_window.help_window = @help_window
  89.    
  90.     if $game_party.actors[$kds_baby].kds_baby.size > 0
  91.       if $game_party.actors[$kds_baby].kds_canzhan != 0
  92.          @status_window = Window_EquipLeft.new($game_actors[$game_party.actors[$kds_baby].kds_canzhan])
  93.       else
  94.          @status_window = Window_EquipLeft.new($game_actors[$game_party.actors[$kds_baby].kds_baby[0]])
  95.       end
  96.     else
  97.       @status_window = Window_EquipLeft.new(0)
  98.     end

  99.     if $game_party.actors[$kds_baby].kds_baby.size > 0
  100.       if $game_party.actors[$kds_baby].kds_canzhan != 0
  101.           @head_window = Window_Head.new($game_actors[$game_party.actors[$kds_baby].kds_canzhan])
  102.       else
  103.           @head_window = Window_Head.new($game_actors[$game_party.actors[$kds_baby].kds_baby[0]])
  104.       end
  105.     else
  106.       @head_window = Window_Head.new(0)
  107.     end
  108.     if $game_party.actors[$kds_baby].kds_baby.size > 0
  109.       if $game_party.actors[$kds_baby].kds_canzhan != 0
  110.          @babys_window = Window_Baby.new($game_actors[$game_party.actors[$kds_baby].kds_canzhan])
  111.       else
  112.          @babys_window = Window_Baby.new($game_actors[$game_party.actors[$kds_baby].kds_baby[0]])
  113.       end
  114.     else
  115.       @babys_window = Window_Baby.new(0)
  116.     end
  117.       @babys_window.index = -1
  118.       @babys_window.update
  119.       @babys_window.active = false
  120.       @babys_window.help_window = @help_window
  121.     Graphics.transition(40, "Graphics/Transitions/" + $data_system.battle_transition)
  122.     loop do
  123.       Graphics.update
  124.       Input.update
  125.       update
  126.       if $scene != self
  127.         break
  128.       end
  129.     end
  130.     # 装备过渡
  131.     Graphics.freeze
  132.     # 释放窗口
  133.     $stop = nil
  134.     @command_window.dispose
  135.     @command2_window.dispose
  136.     @help_window.dispose
  137.     @item_window.dispose
  138.     @head_window.dispose
  139.     @status_window.dispose
  140.     @skill_window.dispose
  141.     @babys_window.dispose
  142.     @rp.dispose
  143.   end
  144.   #--------------------------------------------------------------------------
  145.   # ● 刷新画面
  146.   #--------------------------------------------------------------------------
  147.   def update
  148.     @help_window.update
  149.     $baby_face += 1
  150.     if ($baby_face+12)%12 == 0 and $game_party.actors[$kds_baby].kds_baby.size > 0
  151.        @head_window.refresh
  152.        if $baby_face == 36
  153.           $baby_face = 0
  154.        end
  155.     end
  156.     if @command2_window.active
  157.       @command2_window.update
  158.       up_command2
  159.     end
  160.     if @babys_window.active
  161.        @babys_window.update
  162.        up_babys
  163.     end
  164.     if @skill_window.active
  165.        @skill_window.update
  166.        up_skill
  167.     end
  168.     if @command_window.active
  169.       @command_window.update
  170.       up_command
  171.     end
  172.     if @item_window.active
  173.        @item_window.update
  174.        up_item
  175.     end
  176.   end
  177.   
  178.   def up_command
  179.     if Input.trigger?(Input::B)
  180.       $game_system.se_play($data_system.cancel_se)
  181.       $scene = Scene_Map.new
  182.       return
  183.     end
  184.     if Input.trigger?(Input::C)

  185.      $command_index = @command_window.index
  186.      if @command_window.index != 5 and @command_window.index != 2
  187.        if $game_party.actors[$kds_baby].kds_baby.size == 0
  188.           $game_system.se_play($data_system.buzzer_se)
  189.          return
  190.        end
  191.        $game_system.se_play($data_system.decision_se)
  192.        @command_window.active = false
  193.        @babys_window.index = 0
  194.        @babys_window.active = true
  195.        $baby_index = $game_actors[$game_party.actors[$kds_baby].kds_baby[0]]
  196.        @baby_index = 0
  197.        @babys_window.refresh
  198.        @head_window.refresh
  199.        @skill_window.refresh
  200.        @status_window.refresh2
  201.      elsif @command_window.index == 5
  202.       $game_system.se_play($data_system.cancel_se)
  203.       #$scene = Scene_Map.new
  204.       $scene = Scene_Map.new
  205.      elsif @command_window.index == 2
  206.        if $game_party.actors[$kds_baby].kds_baby.size == 0
  207.           $game_system.se_play($data_system.buzzer_se)
  208.          return
  209.        end
  210.        $game_system.se_play($data_system.decision_se)
  211.        @item_window.update
  212.        @item_window.index = -1
  213.        @command_window.active = false
  214.        @babys_window.index = 0
  215.        @babys_window.active = true
  216.        $baby_index = $game_actors[$game_party.actors[$kds_baby].kds_baby[0]]
  217.        @baby_index = 0
  218.        @babys_window.refresh
  219.        @head_window.refresh
  220.        @skill_window.refresh
  221.        @status_window.refresh2
  222.      end
  223.      return
  224.     end
  225.   end
  226.   
  227.   def up_babys
  228.     if @babys_window.index != @baby_index
  229.        @baby_index = @babys_window.index
  230.        $baby_index = $game_actors[$game_party.actors[$kds_baby].kds_baby[@babys_window.index]]
  231.        @babys_window.refresh
  232.        @head_window.refresh
  233.        @skill_window.refresh
  234.        @status_window.refresh2
  235.     end
  236.     if Input.trigger?(Input::B)
  237.       $game_system.se_play($data_system.cancel_se)
  238.        Graphics.freeze
  239.        @babys_window.index = -1
  240.        @babys_window.active = false
  241.        @command_window.active = true
  242.        @help_window.set_text("")
  243.        Graphics.transition
  244.       return
  245.     end
  246.     if Input.trigger?(Input::C)
  247.        Graphics.freeze
  248.        $game_system.se_play($data_system.decision_se)
  249.        @chong = $game_actors[$game_party.actors[$kds_baby].kds_baby[@babys_window.index]]
  250.        @zhu = $game_party.actors[$kds_baby]
  251.       case  @command_window.index
  252.       when 0
  253.        if $game_party.actors[$kds_baby].kds_canzhan == $game_party.actors[$kds_baby].kds_baby[@babys_window.index]
  254.           $game_party.actors[$kds_baby].kds_canzhan = 0
  255.        else
  256.           $game_party.actors[$kds_baby].kds_canzhan = $game_party.actors[$kds_baby].kds_baby[@babys_window.index]
  257.        end
  258.        @babys_window.refresh
  259.       when 1
  260.        @babys_window.active = false
  261.        @skill_window.index = 0
  262.        @skill_window.active = true
  263.       when 2
  264.        @babys_window.active = false
  265.        @item_window.index = 0
  266.        @item_window.active = true
  267.       when 3
  268.        @babys_window.active = false
  269.        @command2_window.index = 0
  270.        @command2_window.active = true
  271.       when 4
  272.        $game_variables[29] = $game_party.actors[$kds_baby].id
  273.        $game_party.remove_actor(@chong.id)
  274.        @baby_index = 0
  275.        if @babys_window.index > 0
  276.        @babys_window.index -= 1
  277.        end
  278.        if @zhu.kds_baby.size == 0
  279.         $stop = 0
  280.         @babys_window.index = -1
  281.         @babys_window.active = false
  282.         @command_window.active = true
  283.         @help_window.set_text("")
  284.         @command_window.disable_item(0)
  285.         @command_window.disable_item(1)
  286.         @command_window.disable_item(2)
  287.         @command_window.disable_item(3)
  288.         @command_window.disable_item(4)
  289.         @command_window.refresh
  290.         @command_window.update
  291.        end
  292.         @babys_window.refresh
  293.         @head_window.refresh
  294.         @skill_window.refresh
  295.         @status_window.refresh2
  296.       end
  297.       Graphics.transition
  298.       return
  299.     end
  300.   end
  301.   
  302.   def up_skill
  303.     if Input.trigger?(Input::B)
  304.       $game_system.se_play($data_system.cancel_se)
  305.        Graphics.freeze
  306.        @babys_window.active = true
  307.        @skill_window.index = -1
  308.        @skill_window.active = false
  309.        Graphics.transition
  310.       return
  311.     end
  312.   end
  313.    
  314.   def up_item
  315.     if Input.trigger?(Input::B)
  316.       $game_system.se_play($data_system.cancel_se)
  317.        Graphics.freeze
  318.        @babys_window.active = true
  319.        @item_window.index = -1
  320.        @item_window.active = false
  321.        Graphics.transition
  322.       return
  323.     end
  324.     if Input.trigger?(Input::C)
  325.       @item = @item_window.item
  326.        if @item == nil
  327.           $game_system.se_play($data_system.buzzer_se)
  328.          return
  329.        end  

  330.          
  331.        if @item.element_set.include?(11)
  332.         if @chong.skills.include?(@item.recover_hp) == false
  333.           @chong.learn_skill(@item.recover_hp)
  334.         else
  335.           $game_system.se_play($data_system.buzzer_se)
  336.          return
  337.         end
  338.        elsif @item.element_set.include?(12)
  339.           @chong.level = 1
  340.           @chong.maxhp = @chong.base_maxhp
  341.           @chong.maxsp = @chong.base_maxsp
  342.           @chong.str = @chong.base_str
  343.           @chong.dex = @chong.base_dex
  344.           @chong.agi = @chong.base_agi
  345.           @chong.int = @chong.base_int
  346.           @chong.qianli = 0
  347.        end
  348.         $game_system.se_play(@item.menu_se)
  349.         if @item.consumable
  350.           $game_party.lose_item(@item.id, 1)
  351.         end
  352.         @item_window.refresh
  353.         @skill_window.refresh
  354.         @status_window.refresh2
  355.       return
  356.     end
  357.   end

  358.   def  up_command2
  359.     if Input.trigger?(Input::B)
  360.        $game_system.se_play($data_system.cancel_se)
  361.        Graphics.freeze
  362.        @babys_window.active = true
  363.        @command2_window.index = -1
  364.        @command2_window.active = false
  365.        Graphics.transition
  366.       return
  367.     end
  368.     if Input.trigger?(Input::C)
  369.       if @chong.qianli <= 0
  370.         $game_system.se_play($data_system.buzzer_se)
  371.         return
  372.       end
  373.       $game_system.se_play($data_system.decision_se)
  374.       case @command2_window.index
  375.       when 0
  376.         @chong.maxhp += 10
  377.         @chong.hp += 10
  378.       when 1
  379.         @chong.maxsp += 6
  380.         @chong.int += 1
  381.       when 2
  382.         @chong.str += 1
  383.       when 3
  384.         @chong.dex += 1
  385.       when 4
  386.         @chong.agi += 1
  387.       end
  388.       @chong.qianli -= 1
  389.       @status_window.refresh2
  390.     end
  391.   end
  392. end
复制代码
dsu_plus_rewardpost_czw
作者: px.凤翔九天    时间: 2011-9-18 22:08
本帖最后由 px.凤翔九天 于 2011-9-18 22:09 编辑

改完的脚本部分:
  1. #==============================================================================
  2. # ■ Scene_Baby
  3. #------------------------------------------------------------------------------
  4. #  对召唤兽的管理菜单
  5. #==============================================================================

  6. class Scene_Baby
  7.   #--------------------------------------------------------------------------
  8.   # ● 主处理
  9.   #--------------------------------------------------------------------------
  10.   def initialize(actor_index = 0)
  11.    $kds_baby = actor_index
  12.    $baby_face = 0
  13.    if $game_party.actors[$kds_baby].kds_baby.size > 0
  14.     if $game_party.actors[$kds_baby].kds_canzhan != 0
  15.       $baby_index = $game_actors[$game_party.actors[$kds_baby].kds_canzhan]
  16.     else
  17.       $baby_index = $game_actors[$game_party.actors[$kds_baby].kds_baby[0]]
  18.     end
  19.     $stop = nil
  20.    else
  21.     $stop = 0
  22.    end
  23.   end
  24.   def main
  25.     @help_window = Window_Help.new
  26.     @help_window.y = 480-64
  27.     @item_window = Window_Item.new
  28.     @item_window.active = false
  29.     @item_window.help_window = @help_window
  30.     @item_window.index = -1
  31.     if $game_party.actors[$kds_baby].kds_baby.size > 0
  32.       if $game_party.actors[$kds_baby].kds_canzhan != 0
  33.        @skill_window = Window_Skill.new($game_actors[$game_party.actors[$kds_baby].kds_canzhan])
  34.        @skill_window.help_window = @help_window
  35.       else
  36.        @skill_window = Window_Skill.new($game_actors[$game_party.actors[$kds_baby].kds_baby[0]])
  37.        @skill_window.help_window = @help_window
  38.       end
  39.     else
  40.       @skill_window = Window_Skill.new(0)
  41.     end
  42.     @skill_window.active = false
  43.     @skill_window.index = -1
  44.     @skill_window.update
  45.     s1 = "设置参战"
  46.     s2 = "查看技能"
  47.     s3 = "使用物品"
  48.     s4 = "能力分配"
  49.     s5 = "放生宠物"
  50.     s6 = "退出菜单"
  51.     @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5,s6])
  52.     @command_window.y = 480-64-192-32
  53.     if $game_party.actors[$kds_baby].kds_baby.size == 0
  54.     @command_window.disable_item(0)
  55.     @command_window.disable_item(1)
  56.     @command_window.disable_item(2)
  57.     @command_window.disable_item(3)
  58.     @command_window.disable_item(4)
  59.     end
  60.     @command_window.refresh
  61.     @command_window.update
  62.    
  63.     s1 = ""
  64.     s3 = ""
  65.     s2 = ""
  66.     s4 = ""
  67.     s5 = ""
  68.     @command2_window = Window_Command.new(110, [s1, s2, s3, s4, s5],1,16,14)
  69.     @command2_window.x = 160+236+125-6
  70.     @command2_window.y = -4+16+24+22+7+1
  71.     @command2_window.index = -1
  72.     @command2_window.back_opacity = 0
  73.     @command2_window.opacity = 0
  74.     @command2_window.active = false
  75.     @command2_window.help_window = @help_window
  76.    
  77.     if $game_party.actors[$kds_baby].kds_baby.size > 0
  78.       if $game_party.actors[$kds_baby].kds_canzhan != 0
  79.          @status_window = Window_EquipLeft.new($game_actors[$game_party.actors[$kds_baby].kds_canzhan])
  80.       else
  81.          @status_window = Window_EquipLeft.new($game_actors[$game_party.actors[$kds_baby].kds_baby[0]])
  82.       end
  83.     else
  84.       @status_window = Window_EquipLeft.new(0)
  85.     end

  86.     if $game_party.actors[$kds_baby].kds_baby.size > 0
  87.       if $game_party.actors[$kds_baby].kds_canzhan != 0
  88.           @head_window = Window_Head.new($game_actors[$game_party.actors[$kds_baby].kds_canzhan])
  89.       else
  90.           @head_window = Window_Head.new($game_actors[$game_party.actors[$kds_baby].kds_baby[0]])
  91.       end
  92.     else
  93.       @head_window = Window_Head.new(0)
  94.     end
  95.     if $game_party.actors[$kds_baby].kds_baby.size > 0
  96.       if $game_party.actors[$kds_baby].kds_canzhan != 0
  97.          @babys_window = Window_Baby.new($game_actors[$game_party.actors[$kds_baby].kds_canzhan])
  98.       else
  99.          @babys_window = Window_Baby.new($game_actors[$game_party.actors[$kds_baby].kds_baby[0]])
  100.       end
  101.     else
  102.       @babys_window = Window_Baby.new(0)
  103.     end
  104.       @babys_window.index = -1
  105.       @babys_window.update
  106.       @babys_window.active = false
  107.       @babys_window.help_window = @help_window
  108.     Graphics.transition(40, "Graphics/Transitions/" + $data_system.battle_transition)
  109.     loop do
  110.       Graphics.update
  111.       Input.update
  112.       update
  113.       if $scene != self
  114.         break
  115.       end
  116.     end
  117.     # 装备过渡
  118.     Graphics.freeze
  119.     # 释放窗口
  120.     $stop = nil
  121.     @command_window.dispose
  122.     @command2_window.dispose
  123.     @help_window.dispose
  124.     @item_window.dispose
  125.     @head_window.dispose
  126.     @status_window.dispose
  127.     @skill_window.dispose
  128.     @babys_window.dispose
  129.   end
  130.   #--------------------------------------------------------------------------
  131.   # ● 刷新画面
  132.   #--------------------------------------------------------------------------
  133.   def update
  134.     @help_window.update
  135.     $baby_face += 1
  136.     if ($baby_face+12)%12 == 0 and $game_party.actors[$kds_baby].kds_baby.size > 0
  137.        @head_window.refresh
  138.        if $baby_face == 36
  139.           $baby_face = 0
  140.        end
  141.      end
  142.      
  143.     if Input.trigger?(Input::B) and @command_window.active == true
  144.       $game_system.se_play($data_system.cancel_se)
  145.       $scene = Scene_Menu.new(7)
  146.       return
  147.     end

  148.     if @command2_window.active
  149.       @command2_window.update
  150.       up_command2
  151.     end
  152.     if @babys_window.active
  153.        @babys_window.update
  154.        up_babys
  155.     end
  156.     if @skill_window.active
  157.        @skill_window.update
  158.        up_skill
  159.     end
  160.     if @command_window.active
  161.       @command_window.update
  162.       up_command
  163.     end
  164.     if @item_window.active
  165.        @item_window.update
  166.        up_item
  167.     end
  168.     end
  169.   
  170.   def up_command
  171.     if Input.trigger?(Input::B)
  172.        $game_system.se_play($data_system.cancel_se)
  173.        Graphics.freeze
  174.        @babys_window.index = -1
  175.        @babys_window.active = false
  176.        @command_window.active = true
  177.        @help_window.set_text("")
  178.        Graphics.transition
  179.       return
  180.     end
  181.     if Input.trigger?(Input::C)

  182.      $command_index = @command_window.index
  183.      if @command_window.index != 5 and @command_window.index != 2
  184.        if $game_party.actors[$kds_baby].kds_baby.size == 0
  185.           $game_system.se_play($data_system.buzzer_se)
  186.          return
  187.        end
  188.        $game_system.se_play($data_system.decision_se)
  189.        @command_window.active = false
  190.        @babys_window.index = 0
  191.        @babys_window.active = true
  192.        $baby_index = $game_actors[$game_party.actors[$kds_baby].kds_baby[0]]
  193.        @baby_index = 0
  194.        @babys_window.refresh
  195.        @head_window.refresh
  196.        @skill_window.refresh
  197.        @status_window.refresh2
  198.      elsif @command_window.index == 5
  199.       $game_system.se_play($data_system.cancel_se)
  200.       $scene = Scene_Menu.new(7)
  201.      elsif @command_window.index == 2
  202.        if $game_party.actors[$kds_baby].kds_baby.size == 0
  203.           $game_system.se_play($data_system.buzzer_se)
  204.          return
  205.        end
  206.        $game_system.se_play($data_system.decision_se)
  207.        @item_window.update
  208.        @item_window.index = -1
  209.        @command_window.active = false
  210.        @babys_window.index = 0
  211.        @babys_window.active = true
  212.        $baby_index = $game_actors[$game_party.actors[$kds_baby].kds_baby[0]]
  213.        @baby_index = 0
  214.        @babys_window.refresh
  215.        @head_window.refresh
  216.        @skill_window.refresh
  217.        @status_window.refresh2
  218.      end
  219.      return
  220.     end
  221.   end
  222.   
  223.   def up_babys
  224.     if @babys_window.index != @baby_index
  225.        @baby_index = @babys_window.index
  226.        $baby_index = $game_actors[$game_party.actors[$kds_baby].kds_baby[@babys_window.index]]
  227.        @babys_window.refresh
  228.        @head_window.refresh
  229.        @skill_window.refresh
  230.        @status_window.refresh2
  231.     end
  232.     if Input.trigger?(Input::B)
  233.       $game_system.se_play($data_system.cancel_se)
  234.        Graphics.freeze
  235.        @babys_window.index = -1
  236.        @babys_window.active = false
  237.        @command_window.active = true
  238.        @help_window.set_text("")
  239.        Graphics.transition
  240.       return
  241.     end
  242.     if Input.trigger?(Input::C)
  243.        Graphics.freeze
  244.        $game_system.se_play($data_system.decision_se)
  245.        @chong = $game_actors[$game_party.actors[$kds_baby].kds_baby[@babys_window.index]]
  246.        @zhu = $game_party.actors[$kds_baby]
  247.       case  @command_window.index
  248.       when 0
  249.        if $game_party.actors[$kds_baby].kds_canzhan == $game_party.actors[$kds_baby].kds_baby[@babys_window.index]
  250.           $game_party.actors[$kds_baby].kds_canzhan = 0
  251.        else
  252.           $game_party.actors[$kds_baby].kds_canzhan = $game_party.actors[$kds_baby].kds_baby[@babys_window.index]
  253.        end
  254.        @babys_window.refresh
  255.       when 1
  256.        @babys_window.active = false
  257.        @skill_window.index = 0
  258.        @skill_window.active = true
  259.       when 2
  260.        @babys_window.active = false
  261.        @item_window.index = 0
  262.        @item_window.active = true
  263.       when 3
  264.        @babys_window.active = false
  265.        @command2_window.index = 0
  266.        @command2_window.active = true
  267.       when 4
  268.        $game_variables[29] = $game_party.actors[$kds_baby].id
  269.        $game_party.remove_actor(@chong.id)
  270.        @baby_index = 0
  271.        if @babys_window.index > 0
  272.        @babys_window.index -= 1
  273.        end
  274.        if @zhu.kds_baby.size == 0
  275.         $stop = 0
  276.         @babys_window.index = -1
  277.         @babys_window.active = false
  278.         @command_window.active = true
  279.         @help_window.set_text("")
  280.         @command_window.disable_item(0)
  281.         @command_window.disable_item(1)
  282.         @command_window.disable_item(2)
  283.         @command_window.disable_item(3)
  284.         @command_window.disable_item(4)
  285.         @command_window.refresh
  286.         @command_window.update
  287.        end
  288.         @babys_window.refresh
  289.         @head_window.refresh
  290.         @skill_window.refresh
  291.         @status_window.refresh2
  292.       end
  293.       Graphics.transition
  294.       return
  295.     end
  296.   end
  297.   
  298.   def up_skill
  299.     if Input.trigger?(Input::B)
  300.       $game_system.se_play($data_system.cancel_se)
  301.        Graphics.freeze
  302.        @babys_window.active = true
  303.        @skill_window.index = -1
  304.        @skill_window.active = false
  305.        Graphics.transition
  306.       return
  307.     end
  308.   end
  309.    
  310.   def up_item
  311.     if Input.trigger?(Input::B)
  312.       $game_system.se_play($data_system.cancel_se)
  313.        Graphics.freeze
  314.        @babys_window.active = true
  315.        @item_window.index = -1
  316.        @item_window.active = false
  317.        Graphics.transition
  318.       return
  319.     end
  320.     if Input.trigger?(Input::C)
  321.       @item = @item_window.item
  322.        if @item == nil
  323.           $game_system.se_play($data_system.buzzer_se)
  324.          return
  325.        end  

  326.          
  327.        if @item.element_set.include?(11)
  328.         if @chong.skills.include?(@item.recover_hp) == false
  329.           @chong.learn_skill(@item.recover_hp)
  330.         else
  331.           $game_system.se_play($data_system.buzzer_se)
  332.          return
  333.         end
  334.        elsif @item.element_set.include?(12)
  335.         $game_system.se_play(@item.menu_se)
  336.        end
  337.         $game_system.se_play(@item.menu_se)
  338.         if @item.consumable
  339.           $game_party.lose_item(@item.id, 1)
  340.         end
  341.         @item_window.refresh
  342.         @skill_window.refresh
  343.         @status_window.refresh2
  344.       return
  345.     end
  346.   end

  347.   def  up_command2
  348.     if Input.trigger?(Input::B)
  349.        $game_system.se_play($data_system.cancel_se)
  350.        Graphics.freeze
  351.        @babys_window.active = true
  352.        @command2_window.index = -1
  353.        @command2_window.active = false
  354.        Graphics.transition
  355.       return
  356.     end
  357.     if Input.trigger?(Input::C)
  358.       if @chong.qianli <= 0
  359.         $game_system.se_play($data_system.buzzer_se)
  360.         return
  361.       end
  362.       $game_system.se_play($data_system.decision_se)
  363.       case @command2_window.index
  364.       when 0
  365.         @chong.maxhp += 12
  366.         @chong.hp += 12
  367.       when 1
  368.         @chong.maxsp += 5
  369.         @chong.int += 1
  370.       when 2
  371.         @chong.str += 1
  372.       when 3
  373.         @chong.dex += 1.5
  374.       when 4
  375.         @chong.agi += 1
  376.       end
  377.       @chong.qianli -= 1
  378.       @status_window.refresh2
  379.     end
  380.   end
  381. end
复制代码
这部分替换原先的即可。





欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1