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

Project1

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

[已经过期] 求教一下这个脚本如何添加一个职业对应的换人位置

[复制链接]

Lv2.观梦者

梦石
0
星屑
596
在线时间
797 小时
注册时间
2014-7-1
帖子
578

开拓者

跳转到指定楼层
1
发表于 2016-9-24 08:27:02 | 只看该作者 回帖奖励 |正序浏览 |阅读模式

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

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

x
本帖最后由 jiushiainilip19 于 2016-9-24 08:35 编辑

职业有 前卫 中卫 后卫

我的游戏中战斗角色为5人(实际可以加入总英雄人数很多)  在更换队伍的时候

角色:一   :只能更换前卫职业英雄
角色:二   :只能更换前卫职业英雄
角色:三   :只能更换中卫职业英雄
角色:四   :只能更换中卫职业英雄
角色:五   :只能更换后卫职业英雄

还有一个问题:就是角色加入的时候如果一 二号都已经存在前卫了 则在加入的时候不会添加到界面中 后因为前卫已经满了强制移动到仓库中

需要自己手动进行更换。

总体来说就是需要做到:游戏出战只能出战 2个前卫 2个中卫 1个后卫  

有没有这样的脚本呢? 或者我用的这个是否可以更改做到这个效果呢?

RUBY 代码复制
  1. module Sword
  2. #=======================================
  3. #★ 魔劍工舖 - 人物倉庫 1.04
  4. # [url]http://blog.yam.com/a870053jjkj/[/url]
  5. #=======================================
  6. =begin
  7. ● 函數
  8. 呼叫方法:$scene = Sword_FigureDepot.new
  9. 移動同伴:$game_party.move_figure_depot(角色編號)
  10. 交換同伴:$game_party.move_figure_depot(角色編號一, 角色編號二)
  11. 倉庫變量:$game_party.figepot
  12. 禁止變量:$game_party.figepotX
  13. ----------------------------------------------------------------
  14. ○ 只在戰鬥畫面中有效的設置
  15. 戰鬥呼叫:$scene.figure_depot7
  16. ========================================
  17. ● 所需腳本
  18. XP與VX資料轉換(1.01):[url]http://blog.yam.com/a870053jjkj/article/33973184[/url]
  19. =end
  20. #=======================================
  21. #● 功能設定
  22. Sword7_HELP = ['夥伴倉庫:至少要有一人出战', 1] # [幫助窗口文字, 靠邊],靠邊:0左;1中;2右
  23. Sword7_FISI = 5 # 設定持有隊員的上限數量,有減少或增多上限才要修改
  24. Sword7_DESI = 99 # 設定倉庫中最多能存放的人物數量
  25. Sword7_Add = 2 # 設定上限時增加隊員的情況,0為照加;1為不加;2為移到倉庫
  26. #=======================================
  27.   $Sword ? $Sword[7] = true : $Sword = {7=>true} # 腳本使用標誌
  28.   ($Sword_VX = false ; RPG::Weather rescue $Sword_VX = true) if $Sword_VX == nil
  29. end
  30. #=======================================
  31. #■ 同伴的類
  32. class Game_Party
  33.   include Sword # 連接自定設置
  34.   attr_accessor :figepot    # 倉庫空間
  35.   attr_accessor :figepotX   # 禁止存放列表
  36.   #-------------------------------------------------------------
  37.   #● 初始化物件
  38.   alias sword7_initialize initialize
  39.   def initialize ; sword7_initialize ; @figepot, @figepotX = [], [] ;
  40.   end
  41.   #-------------------------------------------------------------
  42.   #● 加入同伴
  43.   alias sword7_add_actor add_actor
  44.   def add_actor(actor_id)
  45.     if @figepot.include?(actor_id) ; return # 防止出現分身
  46.     elsif XPVX.members.size + 1 > Sword7_FISI and Sword7_Add == 1 ; return
  47.     elsif XPVX.members.size + 1 > Sword7_FISI and Sword7_Add == 2 and
  48.     @figepot.size + 1 <= Sword7_DESI
  49.       @figepot += [actor_id] ; return
  50.     end
  51.     sword7_add_actor(actor_id)
  52.   end
  53.   #-------------------------------------------------------------
  54.   #● 角色離開
  55.   alias sword7_remove_actor remove_actor
  56.   def remove_actor(actor_id)
  57.     if @figepot.include?(actor_id) ; @figepot.delete(actor_id)  # 倉庫的同伴離開
  58.     else ; sword7_remove_actor(actor_id) # 目前指定同伴離開
  59.     end
  60.   end
  61.   #-------------------------------------------------------------
  62.   #● 同伴與倉庫的移動處理(角色編號一, 角色編號二)
  63.   def move_figure_depot(actor_id, depot_id = nil)
  64.     ending = false # 結果
  65.     if depot_id  # 交換的場合
  66.       if i1 = XPVX.members.index(
  67.       $game_actors[actor_id]) and i2 = @figepot.index(depot_id) #and not actor_id == 1
  68.         XPVX.members(i1, depot_id) ; @figepot[i2], ending = actor_id, true
  69.       elsif i1 = XPVX.members.index(
  70.       $game_actors[depot_id]) and i2 = @figepot.index(actor_id)
  71.         XPVX.members(i1, actor_id) ; @figepot[i2], ending = depot_id, true
  72.       end
  73.     else # 移動的場合
  74.       if XPVX.members.include?($game_actors[actor_id]) #and not actor_id == 1# 在隊伍中的話
  75.         remove_actor(actor_id) ; @figepot += [actor_id] ; ending = true
  76.       elsif @figepot.include?(actor_id) # 在倉庫中的話
  77.         @figepot -= [actor_id] ; add_actor(actor_id) ; ending = true
  78.       end
  79.     end
  80.     $game_player.refresh # 更新領隊
  81.     ending # 返回結果
  82.   end
  83. end
  84. #=======================================
  85. #■ 人物倉庫窗口
  86. class WSword_FigureDepot < Window_Base
  87.   include Sword # 連接自定設置
  88.   attr_accessor :figmax # 總人數
  89.   attr_accessor :line   # 滾動行數
  90.   attr_accessor :index  # 游標位置
  91.   #-------------------------------------------------------------
  92.   #● 初始化物件(倉庫標誌)
  93.   def initialize(mode) # mode:0為目前隊員(偽)、1為倉庫隊員(真)
  94.     @mode = mode == 0 ? false : true
  95.     # [窗口寬度/2, 說明窗口高度, HP與SP修正, 游標寬度, 名稱Y座標修正, 窗口高度]
  96.     [url=home.php?mod=space&uid=280620]@xpvx[/url] = [XPVX.width / 2, XPVX.wlh] + ($Sword_VX ? [36, Graphics.width / 1.7 - 32, 4] :
  97.     [0, 386, 0]) + [XPVX.height - XPVX.wlh]
  98.     super(mode * @xpvx[0], @xpvx[1], @xpvx[0], @xpvx[5])
  99.     @index = @mode ? -2 : 0 # 設定選項起始位置
  100.     [url=home.php?mod=space&uid=401263]@line[/url] = 0 # 記錄往下滾動了多少行
  101.     refresh
  102.   end
  103.   #-------------------------------------------------------------
  104.   #● 更新內容
  105.   def refresh
  106.     #○ 重新產生顯示用的位圖
  107.     if @mode # 倉庫顯示用位圖高度,除此以外則是目前隊伍窗口
  108.       a, b = $game_party.figepot.size, $game_party.figepot.size == Sword7_DESI ? 0 : 64
  109.     else ; a, b = XPVX.members.size, XPVX.members.size == Sword7_FISI ? 0 : 64
  110.     end
  111.     self.contents = Bitmap.new(width - 32, a * 64 + b)
  112.         self.windowskin = RPG::Cache.windowskin("palskin1")
  113.         self.opacity = 150
  114.     self.contents.font.color = normal_color
  115.     ii = 0 # 隊員存在數
  116.     a = @mode ? $game_party.figepot : XPVX.members
  117.     #○ 產生隊員清單
  118.     for i in a
  119.       next if i == nil
  120.       i = i.id unless @mode
  121.       if $Sword_VX
  122.         #draw_actor_face(actor, 18, 64 * ii + 48)
  123.         #draw_character($game_actors[i].character_name, $game_actors[i].character_index, 18, 64 * ii + 48)
  124.       else
  125. #        cache = $Sword_VX ? Cache.character($game_actors[i].character_name) :
  126. #        RPG::Cache.character($game_actors[i].character_name, $game_actors[i].character_hue)
  127. #       self.contents.blt(4, 64 * ii +  (64 - cache.height / 4) / 2, cache,
  128. #       Rect.new(0, 0, cache.width / 4, cache.height / 4))
  129.       end
  130.       self.contents.font.size = 18 if $Sword_VX
  131.       draw_actor_name($game_actors[i], 36, 64 * ii + @xpvx[4]) # 名稱
  132.       #draw_actor_partyface($game_actors[i], 72, 64 * ii + 56)
  133.       draw_actor_level($game_actors[i], 36, 64 * ii + 32) # 等級
  134.       self.contents.font.size = 18
  135.       draw_actor_hp($game_actors[i], 152 - @xpvx[2], 64 * ii + 2) # HP
  136.       $Sword_VX ?
  137.       draw_actor_mp($game_actors[i], 152 - @xpvx[2], 64 * ii + 30) : # MP(VX)
  138.       draw_actor_sp($game_actors[i], 152 - @xpvx[2], 64 * ii + 30) # SP(XP)
  139.       self.contents.font.size = 22
  140.       ii += 1
  141.     end
  142.     update_cursor_rect
  143.     #○ 設定上限
  144.     @figmax = @mode ? [ii, Sword7_DESI - 1].min : [ii, Sword7_FISI - 1].min
  145.     @figmax = 0 if @figmax == -2
  146.   end
  147.   #-------------------------------------------------------------
  148.   #● 更新游標
  149.   def update_cursor_rect
  150.     XPVX.se_cursor
  151.     self.cursor_rect.set(0, 64 * (@index - @line), @xpvx[3], 64)
  152.   end
  153. end
  154. #=======================================
  155. #■ 戰鬥畫面
  156. class Scene_Battle
  157.   #-------------------------------------------------------------
  158.   #● 主處理
  159.   alias sword7_main main
  160.   def main
  161.     @figure_depot7 = Sword_FigureDepot.new(false) ; sword7_main ; @figure_depot7.dispose
  162.   end
  163.   #-------------------------------------------------------------
  164.   #● 更新
  165.   alias sword7_update update
  166.   def update
  167.     if @figure_depot7.visible # 更新人物倉庫
  168.       @figure_depot7.update
  169.       (@figure_depot7.status_update = false ; @status_window.refresh ; to_reset7) if
  170.       @figure_depot7.status_update # 需要更新狀態窗口的場合
  171.       return
  172.     end
  173.     sword7_update
  174.   end
  175.   #-------------------------------------------------------------
  176.   #● 顯示人物倉庫
  177.   def figure_depot7 ; @figure_depot7.visible = true ; end
  178.   #-------------------------------------------------------------
  179.   #● 重置行動順序
  180.   def to_reset7
  181.     return if @phase != 3 # 非在隊伍命令選擇的話就中斷
  182.     @actor_index = XPVX.members.size - 1 unless XPVX.members[@actor_index]
  183.     @actor_index -= 1
  184.     phase3_next_actor
  185.   end
  186. end
  187. #=======================================
  188. #■ 人物倉庫畫面(與戰鬥畫面共用)
  189. class Sword_FigureDepot
  190.   include Sword # 連接自定設置
  191.   attr_reader    :visible # 整體畫面顯示標誌(nil狀態時為不使用)
  192.   attr_accessor :status_update # 戰鬥中的狀態窗口更新標誌
  193.   #-------------------------------------------------------------
  194.   #● 初始化物件(顯示標誌)
  195.   def initialize(visible = nil) ; @visible = visible ; main unless @visible.nil? ; end
  196.   #-------------------------------------------------------------
  197.   #● 主處理
  198.   def main
  199.     @xpvx = $Sword_VX ? 4 : 5 # 設定滾動條件
  200.     @help_window = Window_Help.new # 產生幫助窗口
  201.     @help_window.set_text(Sword7_HELP[0], Sword7_HELP[1])
  202.         @help_window.windowskin = RPG::Cache.windowskin("help")
  203.         @help_window.opacity = 200
  204.         @bg = Sprite.new
  205.         @bg.bitmap = RPG::Cache.picture("backround_bar")
  206.     @figure_wsword = WSword_FigureDepot.new(0) # 產生目前隊員窗口
  207.     @depot_wsword = WSword_FigureDepot.new(1) # 產生人物倉庫窗口
  208.     @depot_wsword.active = false
  209.     self.visible = @visible
  210.     return unless @visible.nil?
  211.     Graphics.transition(30, "Graphics/Transitions/Unbenannt-4")
  212.     loop{Graphics.update ; Input.update ; update ; break if $scene != self}
  213.     Graphics.freeze
  214.     dispose # 釋放
  215.   end
  216.   #-------------------------------------------------------------
  217.   #● 更新
  218.   def update
  219.     return if @visible == false # 整體畫面沒有顯示的場合
  220.     @figure_wsword.update ; @depot_wsword.update # 更新窗口
  221.     if @figure_wsword.active ; update_figure # 目前隊員窗口活動時
  222.     elsif @depot_wsword.active ; update_depot # 人物倉庫窗口活動時
  223.     end
  224.   end
  225.   #-------------------------------------------------------------
  226.   #● 更新目前隊員窗口
  227.   def update_figure
  228.     if Input.trigger?(Input::B) # 按下取消鍵的場合
  229.       return XPVX.se_buzzer if XPVX.members.empty? # 隊伍為空的情況
  230.       XPVX.se_cancel
  231.       if @visible ; self.visible = false ; @status_update = true
  232.       else ; $scene = Scene_Menu.new(6)
  233.       end
  234.     elsif Input.trigger?(Input::C) or Input.trigger?(Input::RIGHT)
  235.       return XPVX.se_buzzer if
  236.       $game_party.figepotX.include?(XPVX.members[@figure_wsword.index].id) if
  237.       XPVX.members[@figure_wsword.index] # 確認選擇的角色是否能移入倉庫中
  238.       # 開始選擇倉庫中的角色
  239.       XPVX.se_decision
  240.       @figure_wsword.active = false
  241.       @depot_wsword.active = true
  242.       @depot_wsword.index = 0
  243.       @depot_wsword.update_cursor_rect
  244.     elsif Input.trigger?(Input::UP) # 向上移動游標
  245.       @figure_wsword.index -= 1
  246.       if @figure_wsword.figmax >= @xpvx # 滾動
  247.         if @figure_wsword.index - @figure_wsword.line == -1
  248.           @figure_wsword.line -= 1 ; @figure_wsword.oy -= 64
  249.         end
  250.         if @figure_wsword.oy== -64 # 當選樣回到頂部時
  251.           @figure_wsword.line = @figure_wsword.figmax - @xpvx
  252.           @figure_wsword.oy = @figure_wsword.line * 64
  253.           @figure_wsword.index = @figure_wsword.figmax
  254.         end
  255.       elsif @figure_wsword.index == -1
  256.         @figure_wsword.index = @figure_wsword.figmax
  257.       end
  258.       @figure_wsword.update_cursor_rect
  259.     elsif Input.trigger?(Input::DOWN) # 向下移動游標
  260.       @figure_wsword.index == @figure_wsword.figmax ?
  261.       @figure_wsword.index = 0 : @figure_wsword.index += 1
  262.       if @figure_wsword.figmax >= @xpvx # 滾動
  263.         if @figure_wsword.index - @figure_wsword.line == @xpvx + 1 # 滾動開始
  264.           @figure_wsword.line += 1 ; @figure_wsword.oy += 64
  265.         end
  266.         if @figure_wsword.index == 0 # 當選樣回到頂部時
  267.           @figure_wsword.line = 0 ; @figure_wsword.oy = 0
  268.         end
  269.       end
  270.       @figure_wsword.update_cursor_rect
  271.     end
  272.   end
  273.   #-------------------------------------------------------------
  274.   #● 更新人物倉庫窗口
  275.   def update_depot
  276.     if Input.trigger?(Input::B) or Input.trigger?(Input::LEFT)
  277.       XPVX.se_cancel ; end_depot
  278.     elsif Input.trigger?(Input::C) # 更換隊員
  279.       XPVX.se_decision
  280.       if XPVX.members[@figure_wsword.index] and
  281.       $game_party.figepot[@depot_wsword.index] # 交換
  282.         $game_party.move_figure_depot(XPVX.members[@figure_wsword.index].id,
  283.         $game_party.figepot[@depot_wsword.index])
  284.       elsif XPVX.members[@figure_wsword.index] # 移動(隊伍)
  285.         $game_party.move_figure_depot(XPVX.members[@figure_wsword.index].id)
  286.       elsif $game_party.figepot[@depot_wsword.index] # 移動(倉庫)
  287.         $game_party.move_figure_depot($game_party.figepot[@depot_wsword.index])
  288.       end
  289.       @figure_wsword.refresh ; @depot_wsword.refresh ; end_depot # 更新
  290.     elsif Input.trigger?(Input::UP)
  291.       @depot_wsword.index -= 1
  292.       if @depot_wsword.figmax >= @xpvx # 滾動
  293.         if @depot_wsword.index - @depot_wsword.line == -1
  294.           @depot_wsword.line -= 1 ; @depot_wsword.oy -= 64
  295.         end
  296.         if @depot_wsword.oy == -64 # 當選樣回到頂部時
  297.           @depot_wsword.line = @depot_wsword.figmax - @xpvx
  298.           @depot_wsword.oy = @depot_wsword.line * 64
  299.           @depot_wsword.index = @depot_wsword.figmax
  300.         end
  301.       elsif @depot_wsword.index == -1
  302.         @depot_wsword.index = @depot_wsword.figmax
  303.       end
  304.       @depot_wsword.update_cursor_rect
  305.     elsif Input.trigger?(Input::DOWN)
  306.       @depot_wsword.index == @depot_wsword.figmax ?
  307.       @depot_wsword.index = 0 : @depot_wsword.index += 1
  308.       if @depot_wsword.figmax >= @xpvx # 滾動
  309.         if @depot_wsword.index - @depot_wsword.line == @xpvx + 1 # 滾動開始
  310.           @depot_wsword.line += 1 ; @depot_wsword.oy += 64
  311.         end
  312.         if @depot_wsword.index == 0 # 當選樣回到頂部時
  313.           @depot_wsword.line = 0 ; @depot_wsword.oy = 0
  314.         end
  315.       end
  316.       @depot_wsword.update_cursor_rect
  317.     end
  318.   end
  319.   #-------------------------------------------------------------
  320.   #● 返回目前隊員選擇
  321.   def end_depot
  322.     @figure_wsword.active, @depot_wsword.active, @depot_wsword.index = true, false, -2
  323.     @depot_wsword.oy, @depot_wsword.line = 0, 0
  324.     @depot_wsword.update_cursor_rect
  325.   end
  326.   #-------------------------------------------------------------
  327.   #● 整體畫面顯示與活動=(顯示標誌)
  328.   def visible=(visible)
  329.     return if @visible.nil? # 如果是nil的情況就中斷
  330.     @help_window.z = @figure_wsword.z = @depot_wsword.z = 999
  331.     @visible = @help_window.visible = @figure_wsword.visible =
  332.     @depot_wsword.visible = visible
  333.     @figure_wsword.refresh ; @depot_wsword.refresh
  334.   end
  335.   #-------------------------------------------------------------
  336.   #● 釋放這個畫面的窗口
  337.   def dispose
  338.     @help_window.dispose ; @figure_wsword.dispose ; @depot_wsword.dispose
  339. #    $game_player.refresh # 更新領隊
  340.     @bg.dispose
  341.   end
  342. end


RUBY 代码复制
  1. #=======================================
  2. #★ 魔劍工舖 - XP與VX資料轉換 1.02
  3. # [url]http://blog.yam.com/a870053jjkj/[/url]
  4. #=======================================
  5.   $Sword ? $Sword[77] = true : $Sword = {77=>true} # 腳本使用標誌
  6.   ($Sword_VX = false ; RPG::Weather rescue $Sword_VX = true) if $Sword_VX == nil
  7. #=======================================
  8. #■ XP與VX資料類
  9. class Sword_XPVX
  10.   #-------------------------------------------------------------
  11.   #● 獲取RM檔案的附檔名
  12.   def vice_file ; $Sword_VX ? 'rvdata' : 'rxdata' ; end
  13.   #-------------------------------------------------------------
  14.   #● 遊戲畫面寬度
  15.   def width ; $Sword_VX ? Graphics.width : 640 ; end
  16.   #-------------------------------------------------------------
  17.   #● 遊戲畫面高度
  18.   def height ; $Sword_VX ? Graphics.height : 480 ; end
  19.   #-------------------------------------------------------------
  20.   #● 單行窗口高度
  21.   def wlh ; $Sword_VX ? Window_Base::WLH + 20 : 64 ; end
  22.   #-------------------------------------------------------------
  23.   #● 演奏游標SE
  24.   def se_cursor
  25.     $Sword_VX ? Sound.play_cursor : $game_system.se_play($data_system.cursor_se)
  26.   end
  27.   #-------------------------------------------------------------
  28.   #● 演奏確定SE
  29.   def se_decision
  30.     $Sword_VX ? Sound.play_decision : $game_system.se_play($data_system.decision_se)
  31.   end
  32.   #-------------------------------------------------------------
  33.   #● 演奏取消SE
  34.   def se_cancel
  35.     $Sword_VX ? Sound.play_cancel : $game_system.se_play($data_system.cancel_se)
  36.   end
  37.   #-------------------------------------------------------------
  38.   #● 演奏凍結SE
  39.   def se_buzzer
  40.     $Sword_VX ? Sound.play_buzzer : $game_system.se_play($data_system.buzzer_se)
  41.   end
  42.   #-------------------------------------------------------------
  43.   #● 演奏裝備SE
  44.   def se_equip
  45.     $Sword_VX ? Sound.play_equip : $game_system.se_play($data_system.equip_se)
  46.   end
  47.   #-------------------------------------------------------------
  48.   #● 演奏存檔SE
  49.   def se_save
  50.     $Sword_VX ? Sound.play_save : $game_system.se_play($data_system.save_se)
  51.   end
  52.   #-------------------------------------------------------------
  53.   #● 演奏讀檔SE
  54.   def se_load
  55.     $Sword_VX ? Sound.play_load : $game_system.se_play($data_system.load_se)
  56.   end
  57.   #-------------------------------------------------------------
  58.   #● 演奏商店SE
  59.   def se_shop
  60.     $Sword_VX ? Sound.play_shop : $game_system.se_play($data_system.shop_se)
  61.   end
  62.   #-------------------------------------------------------------
  63.   #● 演奏戰鬥開始SE
  64.   def se_battle_start
  65.     $Sword_VX ? Sound.play_battle_start :
  66.     $game_system.se_play($data_system.battle_start_se)
  67.   end
  68.   #-------------------------------------------------------------
  69.   #● 演奏角色擊倒SE
  70.   def se_actor_collapse
  71.     $Sword_VX ? Sound.play_actor_collapse :
  72.     $game_system.se_play($data_system.actor_collapse_se)
  73.   end
  74.   #-------------------------------------------------------------
  75.   #● 演奏敵人擊倒SE
  76.   def se_enemy_collapse
  77.     $Sword_VX ? Sound.play_enemy_collapse :
  78.     $game_system.se_play($data_system.enemy_collapse_se)
  79.   end
  80.   #-------------------------------------------------------------
  81.   #● 獲取動畫圖塊位圖(圖片檔案名稱, 色相)
  82.   def animation(filename, hue)
  83.     $Sword_VX ? Cache.animation(filename, hue) : RPG::Cache.animation(filename, hue)
  84.   end
  85.   #-------------------------------------------------------------
  86.   #● 獲取戰鬥圖位圖(圖片檔案名稱, 色相)
  87.   def battler(filename, hue)
  88.     $Sword_VX ? Cache.battler(filename, hue) : RPG::Cache.battler(filename, hue)
  89.   end
  90.   #-------------------------------------------------------------
  91.   #● 獲取行走圖位圖(圖片檔案名稱, 色相)
  92.   def character(filename, hue)
  93.     $Sword_VX ? Cache.character(filename) : RPG::Cache.character(filename, hue)
  94.   end
  95.   #-------------------------------------------------------------
  96.   #● 獲取遠景圖位圖(圖片檔案名稱, 色相)
  97.   def parallax(filename, hue)
  98.     $Sword_VX ? Cache.parallax(filename) : RPG::Cache.parallax(filename, hue)
  99.   end
  100.   #-------------------------------------------------------------
  101.   #● 獲取圖片位圖(圖片檔案名稱)
  102.   def picture(filename)
  103.     $Sword_VX ? Cache.picture(filename) : RPG::Cache.picture(filename)
  104.   end
  105.   #-------------------------------------------------------------
  106.   #● 獲取隊伍列表(索引, 新值)
  107.   def members(index = nil, new_id = nil)
  108.     new_id = new_id.id if new_id.is_a?(Game_Actor)
  109.     if index ; if $Sword_VX ; $game_party.actors[index] = new_id
  110.     else ; $game_party.actors[index] = $game_actors[new_id]
  111.     end ; end
  112.     $Sword_VX ? $game_party.members : $game_party.actors
  113.   end
  114.   #-------------------------------------------------------------
  115.   #● 獲取道具數量(道具數據)
  116.   def item_number(item)
  117.     if $Sword_VX ; $game_party.item_number(item) # 道具
  118.     else ; case item
  119.       when RPG::Item ; $game_party.item_number(item.id) # 物品
  120.       when RPG::Weapon ; $game_party.weapon_number(item.id) # 武器
  121.       when RPG::Armor ; $game_party.armor_number(item.id) # 防具
  122.       end
  123.     end
  124.   end
  125.   #-------------------------------------------------------------
  126.   #● 增減道具(道具數據, 增減量, 包含已裝備標誌)
  127.   def gain_item(item, n, include_equip = true)
  128.     if $Sword_VX ; $game_party.gain_item(item, n, include_equip) # 道具
  129.     else
  130.       number = item_number(item) ; n1 = n + number # 獲取持有數量
  131.       case item
  132.       when RPG::Item ; $game_party.gain_item(item.id, n) # 物品
  133.       when RPG::Weapon # 武器
  134.         members.each{|actor| break if n1 >= 0
  135.         (actor.equip(0, 0) ; n1 += 1) if actor.weapon_id == item.id} if include_equip and n1 < 0
  136.         $game_party.gain_weapon(item.id, n)
  137.       when RPG::Armor # 防具
  138.         members.each{|actor| break if n1 >= 0
  139.         (actor.equip(1, 0) ; n1 += 1) if actor.armor1_id == item.id
  140.         (actor.equip(2, 0) ; n1 += 1) if actor.armor2_id == item.id and n1 >= 0
  141.         (actor.equip(3, 0) ; n1 += 1) if actor.armor3_id == item.id and n1 >= 0
  142.         (actor.equip(4, 0) ; n1 += 1) if actor.armor4_id == item.id and n1 >= 0} if
  143.         include_equip and n1 < 0
  144.         $game_party.gain_armor(item.id, n)
  145.       end
  146.     end
  147.   end
  148.   #-------------------------------------------------------------
  149.   #● 獲取防具數據的屬性列表(防具編號)
  150.   def armor_element(id)
  151.     $Sword_VX ? $data_armors[id].element_set : $data_armors[id].guard_element_set
  152.   end
  153.   #-------------------------------------------------------------
  154.   #● 獲取防具數據的狀態列表(防具編號)
  155.   def armor_state(id)
  156.     $Sword_VX ? $data_armors[id].state_set : $data_armors[id].guard_state_set
  157.   end
  158. end
  159. XPVX = Sword_XPVX.new # 定義常量
  160. #=======================================
  161. #■ 同伴的類
  162. if $Sword_VX
  163.   class Game_Party < Game_Unit
  164.    attr_accessor :actors     # 目前隊伍中的角色
  165.   end
  166. end
学习使我疲劳,打工使我疲惫,恋爱使我伤身,吸烟伤我肺腑,饮酒损我形象,旅游使我破费,月底不见铜板,只有在论坛里面看看各种大佬才能使我进去
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

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

GMT+8, 2024-9-22 07:20

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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