| 赞 | 14 |
| VIP | |
| 好人卡 | |
| 积分 | 6 |
| 经验 | |
| 最后登录 | 2026-8-9 |
| 在线时间 | 797 小时 |
- 梦石
- 0
- 星屑
- 606
- 在线时间
- 797 小时
- 注册时间
- 2014-7-1
- 回帖
- 501

|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
本帖最后由 jiushiainilip19 于 2016-9-24 08:35 编辑
职业有 前卫 中卫 后卫
我的游戏中战斗角色为5人(实际可以加入总英雄人数很多) 在更换队伍的时候
角色:一 :只能更换前卫职业英雄
角色:二 :只能更换前卫职业英雄
角色:三 :只能更换中卫职业英雄
角色:四 :只能更换中卫职业英雄
角色:五 :只能更换后卫职业英雄
还有一个问题:就是角色加入的时候如果一 二号都已经存在前卫了 则在加入的时候不会添加到界面中 后因为前卫已经满了强制移动到仓库中
需要自己手动进行更换。
总体来说就是需要做到:游戏出战只能出战 2个前卫 2个中卫 1个后卫
有没有这样的脚本呢? 或者我用的这个是否可以更改做到这个效果呢?
- module Sword
- #=======================================
- #★ 魔劍工舖 - 人物倉庫 1.04
- # [url]http://blog.yam.com/a870053jjkj/[/url]
- #=======================================
- =begin
- ● 函數
- 呼叫方法:$scene = Sword_FigureDepot.new
- 移動同伴:$game_party.move_figure_depot(角色編號)
- 交換同伴:$game_party.move_figure_depot(角色編號一, 角色編號二)
- 倉庫變量:$game_party.figepot
- 禁止變量:$game_party.figepotX
- ----------------------------------------------------------------
- ○ 只在戰鬥畫面中有效的設置
- 戰鬥呼叫:$scene.figure_depot7
- ========================================
- ● 所需腳本
- XP與VX資料轉換(1.01):[url]http://blog.yam.com/a870053jjkj/article/33973184[/url]
- =end
- #=======================================
- #● 功能設定
- Sword7_HELP = ['夥伴倉庫:至少要有一人出战', 1] # [幫助窗口文字, 靠邊],靠邊:0左;1中;2右
- Sword7_FISI = 5 # 設定持有隊員的上限數量,有減少或增多上限才要修改
- Sword7_DESI = 99 # 設定倉庫中最多能存放的人物數量
- Sword7_Add = 2 # 設定上限時增加隊員的情況,0為照加;1為不加;2為移到倉庫
- #=======================================
- $Sword ? $Sword[7] = true : $Sword = {7=>true} # 腳本使用標誌
- ($Sword_VX = false ; RPG::Weather rescue $Sword_VX = true) if $Sword_VX == nil
- end
- #=======================================
- #■ 同伴的類
- class Game_Party
- include Sword # 連接自定設置
- attr_accessor :figepot # 倉庫空間
- attr_accessor :figepotX # 禁止存放列表
- #-------------------------------------------------------------
- #● 初始化物件
- alias sword7_initialize initialize
- def initialize ; sword7_initialize ; @figepot, @figepotX = [], [] ;
- end
- #-------------------------------------------------------------
- #● 加入同伴
- alias sword7_add_actor add_actor
- def add_actor(actor_id)
- if @figepot.include?(actor_id) ; return # 防止出現分身
- elsif XPVX.members.size + 1 > Sword7_FISI and Sword7_Add == 1 ; return
- elsif XPVX.members.size + 1 > Sword7_FISI and Sword7_Add == 2 and
- @figepot.size + 1 <= Sword7_DESI
- @figepot += [actor_id] ; return
- end
- sword7_add_actor(actor_id)
- end
- #-------------------------------------------------------------
- #● 角色離開
- alias sword7_remove_actor remove_actor
- def remove_actor(actor_id)
- if @figepot.include?(actor_id) ; @figepot.delete(actor_id) # 倉庫的同伴離開
- else ; sword7_remove_actor(actor_id) # 目前指定同伴離開
- end
- end
- #-------------------------------------------------------------
- #● 同伴與倉庫的移動處理(角色編號一, 角色編號二)
- def move_figure_depot(actor_id, depot_id = nil)
- ending = false # 結果
- if depot_id # 交換的場合
- if i1 = XPVX.members.index(
- $game_actors[actor_id]) and i2 = @figepot.index(depot_id) #and not actor_id == 1
- XPVX.members(i1, depot_id) ; @figepot[i2], ending = actor_id, true
- elsif i1 = XPVX.members.index(
- $game_actors[depot_id]) and i2 = @figepot.index(actor_id)
- XPVX.members(i1, actor_id) ; @figepot[i2], ending = depot_id, true
- end
- else # 移動的場合
- if XPVX.members.include?($game_actors[actor_id]) #and not actor_id == 1# 在隊伍中的話
- remove_actor(actor_id) ; @figepot += [actor_id] ; ending = true
- elsif @figepot.include?(actor_id) # 在倉庫中的話
- @figepot -= [actor_id] ; add_actor(actor_id) ; ending = true
- end
- end
- $game_player.refresh # 更新領隊
- ending # 返回結果
- end
- end
- #=======================================
- #■ 人物倉庫窗口
- class WSword_FigureDepot < Window_Base
- include Sword # 連接自定設置
- attr_accessor :figmax # 總人數
- attr_accessor :line # 滾動行數
- attr_accessor :index # 游標位置
- #-------------------------------------------------------------
- #● 初始化物件(倉庫標誌)
- def initialize(mode) # mode:0為目前隊員(偽)、1為倉庫隊員(真)
- @mode = mode == 0 ? false : true
- # [窗口寬度/2, 說明窗口高度, HP與SP修正, 游標寬度, 名稱Y座標修正, 窗口高度]
- [url=home.php?mod=space&uid=280620]@xpvx[/url] = [XPVX.width / 2, XPVX.wlh] + ($Sword_VX ? [36, Graphics.width / 1.7 - 32, 4] :
- [0, 386, 0]) + [XPVX.height - XPVX.wlh]
- super(mode * @xpvx[0], @xpvx[1], @xpvx[0], @xpvx[5])
- @index = @mode ? -2 : 0 # 設定選項起始位置
- [url=home.php?mod=space&uid=401263]@line[/url] = 0 # 記錄往下滾動了多少行
- refresh
- end
- #-------------------------------------------------------------
- #● 更新內容
- def refresh
- #○ 重新產生顯示用的位圖
- if @mode # 倉庫顯示用位圖高度,除此以外則是目前隊伍窗口
- a, b = $game_party.figepot.size, $game_party.figepot.size == Sword7_DESI ? 0 : 64
- else ; a, b = XPVX.members.size, XPVX.members.size == Sword7_FISI ? 0 : 64
- end
- self.contents = Bitmap.new(width - 32, a * 64 + b)
- self.windowskin = RPG::Cache.windowskin("palskin1")
- self.opacity = 150
- self.contents.font.color = normal_color
- ii = 0 # 隊員存在數
- a = @mode ? $game_party.figepot : XPVX.members
- #○ 產生隊員清單
- for i in a
- next if i == nil
- i = i.id unless @mode
- if $Sword_VX
- #draw_actor_face(actor, 18, 64 * ii + 48)
- #draw_character($game_actors[i].character_name, $game_actors[i].character_index, 18, 64 * ii + 48)
- else
- # cache = $Sword_VX ? Cache.character($game_actors[i].character_name) :
- # RPG::Cache.character($game_actors[i].character_name, $game_actors[i].character_hue)
- # self.contents.blt(4, 64 * ii + (64 - cache.height / 4) / 2, cache,
- # Rect.new(0, 0, cache.width / 4, cache.height / 4))
- end
- self.contents.font.size = 18 if $Sword_VX
- draw_actor_name($game_actors[i], 36, 64 * ii + @xpvx[4]) # 名稱
- #draw_actor_partyface($game_actors[i], 72, 64 * ii + 56)
- draw_actor_level($game_actors[i], 36, 64 * ii + 32) # 等級
- self.contents.font.size = 18
- draw_actor_hp($game_actors[i], 152 - @xpvx[2], 64 * ii + 2) # HP
- $Sword_VX ?
- draw_actor_mp($game_actors[i], 152 - @xpvx[2], 64 * ii + 30) : # MP(VX)
- draw_actor_sp($game_actors[i], 152 - @xpvx[2], 64 * ii + 30) # SP(XP)
- self.contents.font.size = 22
- ii += 1
- end
- update_cursor_rect
- #○ 設定上限
- @figmax = @mode ? [ii, Sword7_DESI - 1].min : [ii, Sword7_FISI - 1].min
- @figmax = 0 if @figmax == -2
- end
- #-------------------------------------------------------------
- #● 更新游標
- def update_cursor_rect
- XPVX.se_cursor
- self.cursor_rect.set(0, 64 * (@index - @line), @xpvx[3], 64)
- end
- end
- #=======================================
- #■ 戰鬥畫面
- class Scene_Battle
- #-------------------------------------------------------------
- #● 主處理
- alias sword7_main main
- def main
- @figure_depot7 = Sword_FigureDepot.new(false) ; sword7_main ; @figure_depot7.dispose
- end
- #-------------------------------------------------------------
- #● 更新
- alias sword7_update update
- def update
- if @figure_depot7.visible # 更新人物倉庫
- @figure_depot7.update
- (@figure_depot7.status_update = false ; @status_window.refresh ; to_reset7) if
- @figure_depot7.status_update # 需要更新狀態窗口的場合
- return
- end
- sword7_update
- end
- #-------------------------------------------------------------
- #● 顯示人物倉庫
- def figure_depot7 ; @figure_depot7.visible = true ; end
- #-------------------------------------------------------------
- #● 重置行動順序
- def to_reset7
- return if @phase != 3 # 非在隊伍命令選擇的話就中斷
- @actor_index = XPVX.members.size - 1 unless XPVX.members[@actor_index]
- @actor_index -= 1
- phase3_next_actor
- end
- end
- #=======================================
- #■ 人物倉庫畫面(與戰鬥畫面共用)
- class Sword_FigureDepot
- include Sword # 連接自定設置
- attr_reader :visible # 整體畫面顯示標誌(nil狀態時為不使用)
- attr_accessor :status_update # 戰鬥中的狀態窗口更新標誌
- #-------------------------------------------------------------
- #● 初始化物件(顯示標誌)
- def initialize(visible = nil) ; @visible = visible ; main unless @visible.nil? ; end
- #-------------------------------------------------------------
- #● 主處理
- def main
- @xpvx = $Sword_VX ? 4 : 5 # 設定滾動條件
- @help_window = Window_Help.new # 產生幫助窗口
- @help_window.set_text(Sword7_HELP[0], Sword7_HELP[1])
- @help_window.windowskin = RPG::Cache.windowskin("help")
- @help_window.opacity = 200
- @bg = Sprite.new
- @bg.bitmap = RPG::Cache.picture("backround_bar")
- @figure_wsword = WSword_FigureDepot.new(0) # 產生目前隊員窗口
- @depot_wsword = WSword_FigureDepot.new(1) # 產生人物倉庫窗口
- @depot_wsword.active = false
- self.visible = @visible
- return unless @visible.nil?
- Graphics.transition(30, "Graphics/Transitions/Unbenannt-4")
- loop{Graphics.update ; Input.update ; update ; break if $scene != self}
- Graphics.freeze
- dispose # 釋放
- end
- #-------------------------------------------------------------
- #● 更新
- def update
- return if @visible == false # 整體畫面沒有顯示的場合
- @figure_wsword.update ; @depot_wsword.update # 更新窗口
- if @figure_wsword.active ; update_figure # 目前隊員窗口活動時
- elsif @depot_wsword.active ; update_depot # 人物倉庫窗口活動時
- end
- end
- #-------------------------------------------------------------
- #● 更新目前隊員窗口
- def update_figure
- if Input.trigger?(Input::B) # 按下取消鍵的場合
- return XPVX.se_buzzer if XPVX.members.empty? # 隊伍為空的情況
- XPVX.se_cancel
- if @visible ; self.visible = false ; @status_update = true
- else ; $scene = Scene_Menu.new(6)
- end
- elsif Input.trigger?(Input::C) or Input.trigger?(Input::RIGHT)
- return XPVX.se_buzzer if
- $game_party.figepotX.include?(XPVX.members[@figure_wsword.index].id) if
- XPVX.members[@figure_wsword.index] # 確認選擇的角色是否能移入倉庫中
- # 開始選擇倉庫中的角色
- XPVX.se_decision
- @figure_wsword.active = false
- @depot_wsword.active = true
- @depot_wsword.index = 0
- @depot_wsword.update_cursor_rect
- elsif Input.trigger?(Input::UP) # 向上移動游標
- @figure_wsword.index -= 1
- if @figure_wsword.figmax >= @xpvx # 滾動
- if @figure_wsword.index - @figure_wsword.line == -1
- @figure_wsword.line -= 1 ; @figure_wsword.oy -= 64
- end
- if @figure_wsword.oy== -64 # 當選樣回到頂部時
- @figure_wsword.line = @figure_wsword.figmax - @xpvx
- @figure_wsword.oy = @figure_wsword.line * 64
- @figure_wsword.index = @figure_wsword.figmax
- end
- elsif @figure_wsword.index == -1
- @figure_wsword.index = @figure_wsword.figmax
- end
- @figure_wsword.update_cursor_rect
- elsif Input.trigger?(Input::DOWN) # 向下移動游標
- @figure_wsword.index == @figure_wsword.figmax ?
- @figure_wsword.index = 0 : @figure_wsword.index += 1
- if @figure_wsword.figmax >= @xpvx # 滾動
- if @figure_wsword.index - @figure_wsword.line == @xpvx + 1 # 滾動開始
- @figure_wsword.line += 1 ; @figure_wsword.oy += 64
- end
- if @figure_wsword.index == 0 # 當選樣回到頂部時
- @figure_wsword.line = 0 ; @figure_wsword.oy = 0
- end
- end
- @figure_wsword.update_cursor_rect
- end
- end
- #-------------------------------------------------------------
- #● 更新人物倉庫窗口
- def update_depot
- if Input.trigger?(Input::B) or Input.trigger?(Input::LEFT)
- XPVX.se_cancel ; end_depot
- elsif Input.trigger?(Input::C) # 更換隊員
- XPVX.se_decision
- if XPVX.members[@figure_wsword.index] and
- $game_party.figepot[@depot_wsword.index] # 交換
- $game_party.move_figure_depot(XPVX.members[@figure_wsword.index].id,
- $game_party.figepot[@depot_wsword.index])
- elsif XPVX.members[@figure_wsword.index] # 移動(隊伍)
- $game_party.move_figure_depot(XPVX.members[@figure_wsword.index].id)
- elsif $game_party.figepot[@depot_wsword.index] # 移動(倉庫)
- $game_party.move_figure_depot($game_party.figepot[@depot_wsword.index])
- end
- @figure_wsword.refresh ; @depot_wsword.refresh ; end_depot # 更新
- elsif Input.trigger?(Input::UP)
- @depot_wsword.index -= 1
- if @depot_wsword.figmax >= @xpvx # 滾動
- if @depot_wsword.index - @depot_wsword.line == -1
- @depot_wsword.line -= 1 ; @depot_wsword.oy -= 64
- end
- if @depot_wsword.oy == -64 # 當選樣回到頂部時
- @depot_wsword.line = @depot_wsword.figmax - @xpvx
- @depot_wsword.oy = @depot_wsword.line * 64
- @depot_wsword.index = @depot_wsword.figmax
- end
- elsif @depot_wsword.index == -1
- @depot_wsword.index = @depot_wsword.figmax
- end
- @depot_wsword.update_cursor_rect
- elsif Input.trigger?(Input::DOWN)
- @depot_wsword.index == @depot_wsword.figmax ?
- @depot_wsword.index = 0 : @depot_wsword.index += 1
- if @depot_wsword.figmax >= @xpvx # 滾動
- if @depot_wsword.index - @depot_wsword.line == @xpvx + 1 # 滾動開始
- @depot_wsword.line += 1 ; @depot_wsword.oy += 64
- end
- if @depot_wsword.index == 0 # 當選樣回到頂部時
- @depot_wsword.line = 0 ; @depot_wsword.oy = 0
- end
- end
- @depot_wsword.update_cursor_rect
- end
- end
- #-------------------------------------------------------------
- #● 返回目前隊員選擇
- def end_depot
- @figure_wsword.active, @depot_wsword.active, @depot_wsword.index = true, false, -2
- @depot_wsword.oy, @depot_wsword.line = 0, 0
- @depot_wsword.update_cursor_rect
- end
- #-------------------------------------------------------------
- #● 整體畫面顯示與活動=(顯示標誌)
- def visible=(visible)
- return if @visible.nil? # 如果是nil的情況就中斷
- @help_window.z = @figure_wsword.z = @depot_wsword.z = 999
- @visible = @help_window.visible = @figure_wsword.visible =
- @depot_wsword.visible = visible
- @figure_wsword.refresh ; @depot_wsword.refresh
- end
- #-------------------------------------------------------------
- #● 釋放這個畫面的窗口
- def dispose
- @help_window.dispose ; @figure_wsword.dispose ; @depot_wsword.dispose
- # $game_player.refresh # 更新領隊
- @bg.dispose
- end
- end
复制代码
- #=======================================
- #★ 魔劍工舖 - XP與VX資料轉換 1.02
- # [url]http://blog.yam.com/a870053jjkj/[/url]
- #=======================================
- $Sword ? $Sword[77] = true : $Sword = {77=>true} # 腳本使用標誌
- ($Sword_VX = false ; RPG::Weather rescue $Sword_VX = true) if $Sword_VX == nil
- #=======================================
- #■ XP與VX資料類
- class Sword_XPVX
- #-------------------------------------------------------------
- #● 獲取RM檔案的附檔名
- def vice_file ; $Sword_VX ? 'rvdata' : 'rxdata' ; end
- #-------------------------------------------------------------
- #● 遊戲畫面寬度
- def width ; $Sword_VX ? Graphics.width : 640 ; end
- #-------------------------------------------------------------
- #● 遊戲畫面高度
- def height ; $Sword_VX ? Graphics.height : 480 ; end
- #-------------------------------------------------------------
- #● 單行窗口高度
- def wlh ; $Sword_VX ? Window_Base::WLH + 20 : 64 ; end
- #-------------------------------------------------------------
- #● 演奏游標SE
- def se_cursor
- $Sword_VX ? Sound.play_cursor : $game_system.se_play($data_system.cursor_se)
- end
- #-------------------------------------------------------------
- #● 演奏確定SE
- def se_decision
- $Sword_VX ? Sound.play_decision : $game_system.se_play($data_system.decision_se)
- end
- #-------------------------------------------------------------
- #● 演奏取消SE
- def se_cancel
- $Sword_VX ? Sound.play_cancel : $game_system.se_play($data_system.cancel_se)
- end
- #-------------------------------------------------------------
- #● 演奏凍結SE
- def se_buzzer
- $Sword_VX ? Sound.play_buzzer : $game_system.se_play($data_system.buzzer_se)
- end
- #-------------------------------------------------------------
- #● 演奏裝備SE
- def se_equip
- $Sword_VX ? Sound.play_equip : $game_system.se_play($data_system.equip_se)
- end
- #-------------------------------------------------------------
- #● 演奏存檔SE
- def se_save
- $Sword_VX ? Sound.play_save : $game_system.se_play($data_system.save_se)
- end
- #-------------------------------------------------------------
- #● 演奏讀檔SE
- def se_load
- $Sword_VX ? Sound.play_load : $game_system.se_play($data_system.load_se)
- end
- #-------------------------------------------------------------
- #● 演奏商店SE
- def se_shop
- $Sword_VX ? Sound.play_shop : $game_system.se_play($data_system.shop_se)
- end
- #-------------------------------------------------------------
- #● 演奏戰鬥開始SE
- def se_battle_start
- $Sword_VX ? Sound.play_battle_start :
- $game_system.se_play($data_system.battle_start_se)
- end
- #-------------------------------------------------------------
- #● 演奏角色擊倒SE
- def se_actor_collapse
- $Sword_VX ? Sound.play_actor_collapse :
- $game_system.se_play($data_system.actor_collapse_se)
- end
- #-------------------------------------------------------------
- #● 演奏敵人擊倒SE
- def se_enemy_collapse
- $Sword_VX ? Sound.play_enemy_collapse :
- $game_system.se_play($data_system.enemy_collapse_se)
- end
- #-------------------------------------------------------------
- #● 獲取動畫圖塊位圖(圖片檔案名稱, 色相)
- def animation(filename, hue)
- $Sword_VX ? Cache.animation(filename, hue) : RPG::Cache.animation(filename, hue)
- end
- #-------------------------------------------------------------
- #● 獲取戰鬥圖位圖(圖片檔案名稱, 色相)
- def battler(filename, hue)
- $Sword_VX ? Cache.battler(filename, hue) : RPG::Cache.battler(filename, hue)
- end
- #-------------------------------------------------------------
- #● 獲取行走圖位圖(圖片檔案名稱, 色相)
- def character(filename, hue)
- $Sword_VX ? Cache.character(filename) : RPG::Cache.character(filename, hue)
- end
- #-------------------------------------------------------------
- #● 獲取遠景圖位圖(圖片檔案名稱, 色相)
- def parallax(filename, hue)
- $Sword_VX ? Cache.parallax(filename) : RPG::Cache.parallax(filename, hue)
- end
- #-------------------------------------------------------------
- #● 獲取圖片位圖(圖片檔案名稱)
- def picture(filename)
- $Sword_VX ? Cache.picture(filename) : RPG::Cache.picture(filename)
- end
- #-------------------------------------------------------------
- #● 獲取隊伍列表(索引, 新值)
- def members(index = nil, new_id = nil)
- new_id = new_id.id if new_id.is_a?(Game_Actor)
- if index ; if $Sword_VX ; $game_party.actors[index] = new_id
- else ; $game_party.actors[index] = $game_actors[new_id]
- end ; end
- $Sword_VX ? $game_party.members : $game_party.actors
- end
- #-------------------------------------------------------------
- #● 獲取道具數量(道具數據)
- def item_number(item)
- if $Sword_VX ; $game_party.item_number(item) # 道具
- else ; case item
- when RPG::Item ; $game_party.item_number(item.id) # 物品
- when RPG::Weapon ; $game_party.weapon_number(item.id) # 武器
- when RPG::Armor ; $game_party.armor_number(item.id) # 防具
- end
- end
- end
- #-------------------------------------------------------------
- #● 增減道具(道具數據, 增減量, 包含已裝備標誌)
- def gain_item(item, n, include_equip = true)
- if $Sword_VX ; $game_party.gain_item(item, n, include_equip) # 道具
- else
- number = item_number(item) ; n1 = n + number # 獲取持有數量
- case item
- when RPG::Item ; $game_party.gain_item(item.id, n) # 物品
- when RPG::Weapon # 武器
- members.each{|actor| break if n1 >= 0
- (actor.equip(0, 0) ; n1 += 1) if actor.weapon_id == item.id} if include_equip and n1 < 0
- $game_party.gain_weapon(item.id, n)
- when RPG::Armor # 防具
- members.each{|actor| break if n1 >= 0
- (actor.equip(1, 0) ; n1 += 1) if actor.armor1_id == item.id
- (actor.equip(2, 0) ; n1 += 1) if actor.armor2_id == item.id and n1 >= 0
- (actor.equip(3, 0) ; n1 += 1) if actor.armor3_id == item.id and n1 >= 0
- (actor.equip(4, 0) ; n1 += 1) if actor.armor4_id == item.id and n1 >= 0} if
- include_equip and n1 < 0
- $game_party.gain_armor(item.id, n)
- end
- end
- end
- #-------------------------------------------------------------
- #● 獲取防具數據的屬性列表(防具編號)
- def armor_element(id)
- $Sword_VX ? $data_armors[id].element_set : $data_armors[id].guard_element_set
- end
- #-------------------------------------------------------------
- #● 獲取防具數據的狀態列表(防具編號)
- def armor_state(id)
- $Sword_VX ? $data_armors[id].state_set : $data_armors[id].guard_state_set
- end
- end
- XPVX = Sword_XPVX.new # 定義常量
- #=======================================
- #■ 同伴的類
- if $Sword_VX
- class Game_Party < Game_Unit
- attr_accessor :actors # 目前隊伍中的角色
- end
- end
复制代码 |
|