#============================================================================== # ■ VXAce-RGSS3-11 隊列操作拡張 [Ver.1.1.0] by Claimh #------------------------------------------------------------------------------ # 隊列歩行しているメンバーへのイベント操作ができるようになります。 #------------------------------------------------------------------------------ # ● $geme_player.ctrl(index) # 操作するメンバーを決めることができます。 # 0以上 : 隊列のIndex番のメンバーを操作 # -1 : 全員 # -2 : 先頭メンバー以外 #------------------------------------------------------------------------------ # ● $geme_player.follow(true/false) # 追従状態を設定します # true : 追従ON # false : 追従OFF # ※この状態は[移動ループ設定]内のみ保持されます。 # 移動ループが終わるとDEFAULT_FOLLOWの状態に戻ります #------------------------------------------------------------------------------ # ● $geme_player.animation(アニメーションID) # アニメーション表示をします。 #------------------------------------------------------------------------------ # ● $geme_player.balloon(フキダシID) # フキダシ表示をします。 # 1 : びっくり # 2 : はてな # 3 : 音符 # 4 : ハート # 5 : 怒り # 6 : 汗 # 7 : くしゃくしゃ # 8 : 沈黙 # 9 : 電球 # 10 : Zzz #------------------------------------------------------------------------------ #【テクニック】 # ・特定のアクターの操作をする場合、 # $game_actors[アクターID].indexをctrlのindexにすれば操作できます。 # ・プレイヤーに対して移動ルート設定をしている時は$game_player.を省略可能です # ctrl(index) # follow(flag) # animation(id) # balloon(id) #============================================================================== #============================================================================== # ■ Game_Player #============================================================================== class Game_Player < Game_Character DEFAULT_FOLLOW = true # defaultをfollow状態とする #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_reader :ctrl_index # 操作している隊列Index #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- alias initialize_followers initialize def initialize initialize_followers ctrl(0) # Player end #-------------------------------------------------------------------------- # ● 操作対象のIndex変更 #-------------------------------------------------------------------------- def ctrl(i) @ctrl_index = i end #-------------------------------------------------------------------------- # ● 追従状態の変更 #-------------------------------------------------------------------------- def follow(flag) flag ? @followers.move_enable : @followers.move_disable end #-------------------------------------------------------------------------- # ● 操作対象のキャラクタ取得 #-------------------------------------------------------------------------- def ctrl_chr case @ctrl_index when 0 # player return [self] when -1 # all return [self] + @followers.followers when -2 # followers return @followers.followers else # follower if 0 < @ctrl_index and @ctrl_index < $game_party.max_battle_members return [@followers[@ctrl_index-1]] end end return [self] end #-------------------------------------------------------------------------- # ● 移動コマンドの処理 [over ride] #-------------------------------------------------------------------------- PLAYER_ONLY = [ROUTE_END, ROUTE_SCRIPT] def process_move_command(command) return super(command) if PLAYER_ONLY.include?(command.code) @followers.move_disable unless DEFAULT_FOLLOW self.ctrl_chr.each do |c| c.is_a?(Game_Player) ? super(command) : c.process_move_command(command) end end #-------------------------------------------------------------------------- # ● 移動ルート終端の処理 [over ride] #-------------------------------------------------------------------------- def process_route_end super @followers.move_enable end #-------------------------------------------------------------------------- # ● アニメーション表示 #-------------------------------------------------------------------------- def animation(id) self.ctrl_chr.each do |c| c.is_a?(Game_Player) ? super(id) : c.animation(id) end end #-------------------------------------------------------------------------- # ● アニメーション表示中? #-------------------------------------------------------------------------- def animation? self.ctrl_chr.any? { |c| c.animation_id > 0 } end #-------------------------------------------------------------------------- # ● フキダシ表示 #-------------------------------------------------------------------------- def balloon(id) self.ctrl_chr.each do |c| c.is_a?(Game_Player) ? super(id) : c.balloon(id) end end #-------------------------------------------------------------------------- # ● フキダシ表示中? #-------------------------------------------------------------------------- def balloon? self.ctrl_chr.any? { |c| c.balloon_id > 0 } end end #============================================================================== # ■ Game_Followers #============================================================================== class Game_Followers #-------------------------------------------------------------------------- # ● オブジェクト初期化 # leader : 先頭のキャラクター #-------------------------------------------------------------------------- alias initialize_followers initialize def initialize(leader) initialize_followers(leader) @move_enable = true end #-------------------------------------------------------------------------- # ● 全フォロワーの取得 #-------------------------------------------------------------------------- def followers @data end #-------------------------------------------------------------------------- # ● 追従許可 #-------------------------------------------------------------------------- def move_enable @move_enable = true end #-------------------------------------------------------------------------- # ● 追従禁止 #-------------------------------------------------------------------------- def move_disable @move_enable = false end #-------------------------------------------------------------------------- # ● 移動 #-------------------------------------------------------------------------- alias move_followers move def move move_followers if @move_enable end end #============================================================================== # ■ Game_Character #============================================================================== class Game_Character < Game_CharacterBase #-------------------------------------------------------------------------- # ● 操作対象のIndex変更 #-------------------------------------------------------------------------- def ctrl(i) $game_player.ctrl(i) end #-------------------------------------------------------------------------- # ● 追従状態の変更 #-------------------------------------------------------------------------- def follow(flag) $game_player.follow(flag) end #-------------------------------------------------------------------------- # ● アニメーション表示 #-------------------------------------------------------------------------- def animation(id) self.animation_id = id end #-------------------------------------------------------------------------- # ● フキダシ表示 #-------------------------------------------------------------------------- def balloon(id) self.balloon_id = id end end