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

Project1

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

[已经过期] 求一个类似宠物捕捉的脚本

[复制链接]

Lv1.梦旅人

梦石
0
星屑
154
在线时间
664 小时
注册时间
2011-9-25
帖子
241
跳转到指定楼层
1
发表于 2012-3-5 20:38:40 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
不知道VA有没有类似口袋怪兽这样捕捉宠物来战斗的脚本?外站的也可以~

Lv1.梦旅人

梦石
0
星屑
174
在线时间
0 小时
注册时间
2012-4-10
帖子
1
2
发表于 2012-4-10 18:45:51 | 只看该作者
#==============================================================================
# ■ Scene_Baby
#------------------------------------------------------------------------------
#  对召唤兽的管理菜单
#==============================================================================

class Scene_Baby
  #--------------------------------------------------------------------------
  # ● 主处理
  #--------------------------------------------------------------------------
  def initialize(actor_index = 0)
   $kds_baby = actor_index
   $baby_face = 0
   if $game_party.actors[$kds_baby].kds_baby.size > 0
    if $game_party.actors[$kds_baby].kds_canzhan != 0
      $baby_index = $game_actors[$game_party.actors[$kds_baby].kds_canzhan]
    else
      $baby_index = $game_actors[$game_party.actors[$kds_baby].kds_baby[0]]
    end
    $stop = nil
   else
    $stop = 0
   end
  end
  def main
    @help_window = Window_Help.new
    @help_window.y = 480-64
    @item_window = Window_Item.new
    @item_window.active = false
    @item_window.help_window = @help_window
    @item_window.index = -1
    if $game_party.actors[$kds_baby].kds_baby.size > 0
      if $game_party.actors[$kds_baby].kds_canzhan != 0
       @skill_window = Window_Skill.new($game_actors[$game_party.actors[$kds_baby].kds_canzhan])
       @skill_window.help_window = @help_window
      else
       @skill_window = Window_Skill.new($game_actors[$game_party.actors[$kds_baby].kds_baby[0]])
       @skill_window.help_window = @help_window
      end
    else
      @skill_window = Window_Skill.new(0)
    end
    @skill_window.active = false
    @skill_window.index = -1
    @skill_window.update
    s1 = "设置参战"
    s2 = "查看技能"
    s3 = "使用物品"
    s4 = "能力分配"
    s5 = "放生宠物"
    s6 = "退出菜单"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5,s6])
    @command_window.y = 480-64-192-32
    if $game_party.actors[$kds_baby].kds_baby.size == 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)
    end
    @command_window.refresh
    @command_window.update
   
    s1 = ""
    s3 = ""
    s2 = ""
    s4 = ""
    s5 = ""
    @command2_window = Window_Command.new(110, [s1, s2, s3, s4, s5],1,16,14)
    @command2_window.x = 160+236+125-6
    @command2_window.y = -4+16+24+22+7+1
    @command2_window.index = -1
    @command2_window.back_opacity = 0
    @command2_window.opacity = 0
    @command2_window.active = false
    @command2_window.help_window = @help_window
   
    if $game_party.actors[$kds_baby].kds_baby.size > 0
      if $game_party.actors[$kds_baby].kds_canzhan != 0
         @status_window = Window_EquipLeft.new($game_actors[$game_party.actors[$kds_baby].kds_canzhan])
      else
         @status_window = Window_EquipLeft.new($game_actors[$game_party.actors[$kds_baby].kds_baby[0]])
      end
    else
      @status_window = Window_EquipLeft.new(0)
    end

    if $game_party.actors[$kds_baby].kds_baby.size > 0
      if $game_party.actors[$kds_baby].kds_canzhan != 0
          @head_window = Window_Head.new($game_actors[$game_party.actors[$kds_baby].kds_canzhan])
      else
          @head_window = Window_Head.new($game_actors[$game_party.actors[$kds_baby].kds_baby[0]])
      end
    else
      @head_window = Window_Head.new(0)
    end
    if $game_party.actors[$kds_baby].kds_baby.size > 0
      if $game_party.actors[$kds_baby].kds_canzhan != 0
         @babys_window = Window_Baby.new($game_actors[$game_party.actors[$kds_baby].kds_canzhan])
      else
         @babys_window = Window_Baby.new($game_actors[$game_party.actors[$kds_baby].kds_baby[0]])
      end
    else
      @babys_window = Window_Baby.new(0)
    end
      @babys_window.index = -1
      @babys_window.update
      @babys_window.active = false
      @babys_window.help_window = @help_window
    Graphics.transition(40, "Graphics/Transitions/" + $data_system.battle_transition)
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    # 装备过渡
    Graphics.freeze
    # 释放窗口
    $stop = nil
    @command_window.dispose
    @command2_window.dispose
    @help_window.dispose
    @item_window.dispose
    @head_window.dispose
    @status_window.dispose
    @skill_window.dispose
    @babys_window.dispose
  end
  #--------------------------------------------------------------------------
  # ● 刷新画面
  #--------------------------------------------------------------------------
  def update
    @help_window.update
    $baby_face += 1
    if ($baby_face+12)%12 == 0 and $game_party.actors[$kds_baby].kds_baby.size > 0
       @head_window.refresh
       if $baby_face == 36
          $baby_face = 0
       end
     end
     
    if Input.trigger?(Input::B) and @command_window.active == true
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Menu.new(7)
      return
    end

    if @command2_window.active
      @command2_window.update
      up_command2
    end
    if @babys_window.active
       @babys_window.update
       up_babys
    end
    if @skill_window.active
       @skill_window.update
       up_skill
    end
    if @command_window.active
      @command_window.update
      up_command
    end
    if @item_window.active
       @item_window.update
       up_item
    end
    end
  
  def up_command
    if Input.trigger?(Input::B)
       $game_system.se_play($data_system.cancel_se)
       Graphics.freeze
       @babys_window.index = -1
       @babys_window.active = false
       @command_window.active = true
       @help_window.set_text("")
       Graphics.transition
      return
    end
    if Input.trigger?(Input::C)

     $command_index = @command_window.index
     if @command_window.index != 5 and @command_window.index != 2
       if $game_party.actors[$kds_baby].kds_baby.size == 0
          $game_system.se_play($data_system.buzzer_se)
         return
       end
       $game_system.se_play($data_system.decision_se)
       @command_window.active = false
       @babys_window.index = 0
       @babys_window.active = true
       $baby_index = $game_actors[$game_party.actors[$kds_baby].kds_baby[0]]
       @baby_index = 0
       @babys_window.refresh
       @head_window.refresh
       @skill_window.refresh
       @status_window.refresh2
     elsif @command_window.index == 5
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Menu.new(7)
     elsif @command_window.index == 2
       if $game_party.actors[$kds_baby].kds_baby.size == 0
          $game_system.se_play($data_system.buzzer_se)
         return
       end
       $game_system.se_play($data_system.decision_se)
       @item_window.update
       @item_window.index = -1
       @command_window.active = false
       @babys_window.index = 0
       @babys_window.active = true
       $baby_index = $game_actors[$game_party.actors[$kds_baby].kds_baby[0]]
       @baby_index = 0
       @babys_window.refresh
       @head_window.refresh
       @skill_window.refresh
       @status_window.refresh2
     end
     return
    end
  end
  
  def up_babys
    if @babys_window.index != @baby_index
       @baby_index = @babys_window.index
       $baby_index = $game_actors[$game_party.actors[$kds_baby].kds_baby[@babys_window.index]]
       @babys_window.refresh
       @head_window.refresh
       @skill_window.refresh
       @status_window.refresh2
    end
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
       Graphics.freeze
       @babys_window.index = -1
       @babys_window.active = false
       @command_window.active = true
       @help_window.set_text("")
       Graphics.transition
      return
    end
    if Input.trigger?(Input::C)
       Graphics.freeze
       $game_system.se_play($data_system.decision_se)
       @chong = $game_actors[$game_party.actors[$kds_baby].kds_baby[@babys_window.index]]
       @zhu = $game_party.actors[$kds_baby]
      case  @command_window.index
      when 0
       if $game_party.actors[$kds_baby].kds_canzhan == $game_party.actors[$kds_baby].kds_baby[@babys_window.index]
          $game_party.actors[$kds_baby].kds_canzhan = 0
       else
          $game_party.actors[$kds_baby].kds_canzhan = $game_party.actors[$kds_baby].kds_baby[@babys_window.index]
       end
       @babys_window.refresh
      when 1
       @babys_window.active = false
       @skill_window.index = 0
       @skill_window.active = true
      when 2
       @babys_window.active = false
       @item_window.index = 0
       @item_window.active = true
      when 3
       @babys_window.active = false
       @command2_window.index = 0
       @command2_window.active = true
      when 4
       $game_variables[29] = $game_party.actors[$kds_baby].id
       $game_party.remove_actor(@chong.id)
       @baby_index = 0
       if @babys_window.index > 0
       @babys_window.index -= 1
       end
       if @zhu.kds_baby.size == 0
        $stop = 0
        @babys_window.index = -1
        @babys_window.active = false
        @command_window.active = true
        @help_window.set_text("")
        @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)
        @command_window.refresh
        @command_window.update
       end
        @babys_window.refresh
        @head_window.refresh
        @skill_window.refresh
        @status_window.refresh2
      end
      Graphics.transition
      return
    end
  end
  
  def up_skill
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
       Graphics.freeze
       @babys_window.active = true
       @skill_window.index = -1
       @skill_window.active = false
       Graphics.transition
      return
    end
  end
   
  def up_item
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
       Graphics.freeze
       @babys_window.active = true
       @item_window.index = -1
       @item_window.active = false
       Graphics.transition
      return
    end
    if Input.trigger?(Input::C)
      @item = @item_window.item
       if @item == nil
          $game_system.se_play($data_system.buzzer_se)
         return
       end  

         
       if @item.element_set.include?(11)
        if @chong.skills.include?(@item.recover_hp) == false
          @chong.learn_skill(@item.recover_hp)
        else
          $game_system.se_play($data_system.buzzer_se)
         return
        end
       elsif @item.element_set.include?(12)
        $game_system.se_play(@item.menu_se)
       end
        $game_system.se_play(@item.menu_se)
        if @item.consumable
          $game_party.lose_item(@item.id, 1)
        end
        @item_window.refresh
        @skill_window.refresh
        @status_window.refresh2
      return
    end
  end

  def  up_command2
    if Input.trigger?(Input::B)
       $game_system.se_play($data_system.cancel_se)
       Graphics.freeze
       @babys_window.active = true
       @command2_window.index = -1
       @command2_window.active = false
       Graphics.transition
      return
    end
    if Input.trigger?(Input::C)
      if @chong.qianli <= 0
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      $game_system.se_play($data_system.decision_se)
      case @command2_window.index
      when 0
        @chong.maxhp += 12
        @chong.hp += 12
      when 1
        @chong.maxsp += 5
        @chong.int += 1
      when 2
        @chong.str += 1
      when 3
        @chong.dex += 1.5
      when 4
        @chong.agi += 1
      end
      @chong.qianli -= 1
      @status_window.refresh2
    end
  end
end

点评

表示脚本盲...求用法吖....  发表于 2012-4-11 21:59
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-22 16:05

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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