赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 98 |
经验 | 64047 |
最后登录 | 2021-9-10 |
在线时间 | 291 小时 |
Lv4.逐梦者
- 梦石
- 9
- 星屑
- 785
- 在线时间
- 291 小时
- 注册时间
- 2007-12-15
- 帖子
- 256
|
- # ● パーティ編成機能 ベータ版
- # 設定方法:イベント『パーティに加える』で5人以上加えます
- # メニュー『パーティ』から、4人までのパーティを編成してください
- #
- # これはベータ版ですので、バグが発生する可能性が高く、
- # レイアウトも既存のツクールに似せてあります
- # 何か起こったら、サイトの掲示板・Web拍手へご報告お願いします
- #
- #==============================================================================
- # ■ Vocab
- #==============================================================================
- module Vocab
- # パーティ編成 の名前
- def self.party
- return "编成"
- end
- end
- #==============================================================================
- # ■ Scene_Menu
- #==============================================================================
- class Scene_Menu < Scene_Base
- #--------------------------------------------------------------------------
- # ● コマンドウィンドウの作成
- #--------------------------------------------------------------------------
- def create_command_window
- s1 = Vocab::item
- s2 = Vocab::skill
- s3 = Vocab::equip
- s4 = Vocab::status
- s5 = Vocab::party
- s6 = Vocab::save
- s7 = Vocab::game_end
- @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
- @command_window.index = @menu_index
- if $game_party.members.size == 0 # パーティ人数が 0 人の場合
- @command_window.draw_item(0, false) # アイテムを無効化
- @command_window.draw_item(1, false) # スキルを無効化
- @command_window.draw_item(2, false) # 装備を無効化
- @command_window.draw_item(3, false) # ステータスを無効化
- @command_window.draw_item(4, false) # パーティを無効化
- end
- if $game_system.save_disabled # セーブ禁止の場合
- @command_window.draw_item(5, false) # セーブを無効化
- end
- end
- #--------------------------------------------------------------------------
- # ● コマンド選択の更新
- #--------------------------------------------------------------------------
- def update_command_selection
- if Input.trigger?(Input::B)
- Sound.play_cancel
- $scene = Scene_Map.new
- elsif Input.trigger?(Input::C)
- if $game_party.members.size == 0 and @command_window.index < 4
- Sound.play_buzzer
- return
- elsif $game_system.save_disabled and @command_window.index == 4
- Sound.play_buzzer
- return
- end
- Sound.play_decision
- case @command_window.index
- when 0 # アイテム
- $scene = Scene_Item.new
- when 1,2,3 # スキル、装備、ステータス
- start_actor_selection
- when 4 # パーティ
- $scene = Scene_Party.new
- when 5 # セーブ
- $scene = Scene_File.new(true, false, false)
- when 6 # ゲーム終了
- $scene = Scene_End.new
- end
- end
- end
- end
- #==============================================================================
- # ■ Game_Party
- #==============================================================================
- class Game_Party
- #--------------------------------------------------------------------------
- # ● パーティ最大人数の取得
- #--------------------------------------------------------------------------
- def max_members
- return MAX_MEMBERS
- end
- #--------------------------------------------------------------------------
- # ● 待機アクターの取得
- #--------------------------------------------------------------------------
- def out_actors
- @out_actors = [] if @out_actors == nil
- return @out_actors
- end
- #--------------------------------------------------------------------------
- # ● 待機メンバーの取得
- #--------------------------------------------------------------------------
- def out_members
- result = []
- for i in out_actors
- result.push($game_actors[i])
- end
- return result
- end
- #--------------------------------------------------------------------------
- # ● アクターを加える 改
- # actor_id : アクター ID
- #--------------------------------------------------------------------------
- def add_actor(actor_id)
- return if @actors.include?(actor_id)
- return if out_actors.include?(actor_id)
- if @actors.size < MAX_MEMBERS
- @actors.push(actor_id)
- $game_player.refresh
- else
- add_out_actor(actor_id)
- end
- end
- #--------------------------------------------------------------------------
- # ● 待機アクターを加える
- # actor_id : アクター ID
- #--------------------------------------------------------------------------
- def add_out_actor(actor_id)
- return if out_actors.include?(actor_id)
- @out_actors.push(actor_id)
- end
- #--------------------------------------------------------------------------
- # ● アクターを直接加える
- #--------------------------------------------------------------------------
- def actor_direct_push(actor, index)
- n = actor != nil ? actor.id : nil
- @actors[index] = n
- @actors.uniq!
- @actors.compact!
- $game_player.refresh
- end
- #--------------------------------------------------------------------------
- # ● 待機アクターを直接加える
- #--------------------------------------------------------------------------
- def out_actor_direct_push(actor, index)
- n = actor != nil ? actor.id : nil
- @out_actors[index] = n
- @out_actors.uniq!
- @out_actors.compact!
- end
- #--------------------------------------------------------------------------
- # ● アクターを外す 改
- #--------------------------------------------------------------------------
- def remove_actor(actor_id)
- @actors.delete(actor_id)
- out_actors # 初期化のため
- @out_actors.delete(actor_id)
- $game_player.refresh
- end
- end
- #==============================================================================
- # ■ Window_PartyIn
- #------------------------------------------------------------------------------
- # パーティ編成画面で、現在のパーティを表示するウィンドウです。
- #==============================================================================
- class Window_PartyIn < Window_Selectable
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- # x : ウィンドウの X 座標
- # y : ウィンドウの Y 座標
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, 384, 416)
- refresh
- end
- #--------------------------------------------------------------------------
- # ● リフレッシュ
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- plus = $game_party.members.size < $game_party.max_members ? 1 : 0
- @item_max = $game_party.members.size + plus
- for actor in $game_party.members
- draw_actor_face(actor, 2, actor.index * 96 + 2, 92)
- x = 104
- y = actor.index * 96 + WLH / 2
- draw_actor_name(actor, x, y)
- draw_actor_class(actor, x + 120, y)
- draw_actor_level(actor, x, y + WLH * 1)
- draw_actor_state(actor, x, y + WLH * 2)
- draw_actor_hp(actor, x + 120, y + WLH * 1)
- draw_actor_mp(actor, x + 120, y + WLH * 2)
- end
- end
- #--------------------------------------------------------------------------
- # ● カーソルの更新
- #--------------------------------------------------------------------------
- def update_cursor
- if @index < 0 # カーソルなし
- self.cursor_rect.empty
- elsif @index < @item_max # 通常
- self.cursor_rect.set(0, @index * 96, contents.width, 96)
- elsif @index >= 100 # 自分
- self.cursor_rect.set(0, (@index - 100) * 96, contents.width, 96)
- else # 全体
- self.cursor_rect.set(0, 0, contents.width, @item_max * 96)
- end
- end
- end
- #==============================================================================
- # ■ Window_PartyOut
- #------------------------------------------------------------------------------
- # パーティ編成画面で、パーティ以外のアクターを表示するウィンドウです。
- #==============================================================================
- class Window_PartyOut < Window_Selectable
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- # x : ウィンドウの X 座標
- # y : ウィンドウの Y 座標
- #--------------------------------------------------------------------------
- def initialize
- super(384, 0, 160, 416)
- refresh
- end
- #--------------------------------------------------------------------------
- # ● リフレッシュ
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- @item_max = $game_party.out_members.size + 1
- for i in 0...$game_party.out_members.size
- actor = $game_party.out_members[i]
- draw_actor_name(actor, 4, WLH * i)
- end
- end
- end
- #==============================================================================
- # ■ Scene_Map
- #------------------------------------------------------------------------------
- # マップ画面の処理を行うクラスです。
- #==============================================================================
- class Scene_Map < Scene_Base
- #--------------------------------------------------------------------------
- # ● 画面切り替えの実行 改
- #--------------------------------------------------------------------------
- def update_scene_change
- return if $game_player.moving? # プレイヤーの移動中?
- case $game_temp.next_scene
- when "battle"
- call_battle
- when "shop"
- call_shop
- when "name"
- call_name
- when "menu"
- call_menu
- when "save"
- call_save
- when "debug"
- call_debug
- when "gameover"
- call_gameover
- when "title"
- call_title
- when "party"
- call_party
- else
- $game_temp.next_scene = nil
- end
- end
- #--------------------------------------------------------------------------
- # ● パーティ編成画面への切り替え
- #--------------------------------------------------------------------------
- def call_party
- $game_temp.next_scene = nil
- $scene = Scene_Party.new
- end
- end
- #==============================================================================
- # ■ Scene_Party
- #------------------------------------------------------------------------------
- # パーティ編成画面の処理を行うクラスです。
- #==============================================================================
- class Scene_Party < Scene_Base
- #--------------------------------------------------------------------------
- # ● 開始処理
- #--------------------------------------------------------------------------
- def start
- super
- create_menu_background
- @party_window = Window_PartyIn.new
- @party_window.active = false
- @party_window.index = -1
- @party_out_window = Window_PartyOut.new
- @party_out_window.active = true
- @party_out_window.index = 0
- end
- #--------------------------------------------------------------------------
- # ● 終了処理
- #--------------------------------------------------------------------------
- def terminate
- super
- dispose_menu_background
- @party_window.dispose
- @party_out_window.dispose
- end
- #--------------------------------------------------------------------------
- # ● 元の画面へ戻る
- #--------------------------------------------------------------------------
- def return_scene
- $scene = Scene_Menu.new(4)
- end
- #--------------------------------------------------------------------------
- # ● フレーム更新
- #--------------------------------------------------------------------------
- def update
- super
- update_menu_background
- @party_window.update
- @party_out_window.update
- if @party_out_window.active
- update_out_selection
- elsif @party_window.active
- update_in_selection
- end
- end
- #--------------------------------------------------------------------------
- # ● パーティ外アクター選択の更新
- #--------------------------------------------------------------------------
- def update_out_selection
- if Input.trigger?(Input::B)
- Sound.play_cancel
- return_scene
- elsif Input.trigger?(Input::C)
- Sound.play_decision
- @party_out_window.active = false
- @party_window.active = true
- @party_window.index = 0
- end
- end
- #--------------------------------------------------------------------------
- # ● アクター選択の更新
- #--------------------------------------------------------------------------
- def update_in_selection
- if Input.trigger?(Input::B)
- Sound.play_cancel
- @party_window.active = false
- @party_window.index = -1
- @party_out_window.active = true
- elsif Input.trigger?(Input::C)
- if @party_out_window.index >= $game_party.out_members.size
- if @party_window.index >= $game_party.members.size or
- $game_party.members.size <= 1
- Sound.play_buzzer
- return
- end
- end
- Sound.play_decision
- in_actor = $game_party.members[@party_window.index]
- out_actor = $game_party.out_members[@party_out_window.index]
- $game_party.out_actor_direct_push(in_actor, @party_out_window.index)
- $game_party.actor_direct_push(out_actor, @party_window.index)
- @party_window.refresh
- @party_out_window.refresh
- @party_window.active = false
- @party_window.index = -1
- @party_out_window.active = true
- end
- end
- end
- #==============================================================================
- # ■ Scene_File
- #==============================================================================
- class Scene_File < Scene_Base
- #--------------------------------------------------------------------------
- # ● 元の画面へ戻る 改
- #--------------------------------------------------------------------------
- def return_scene
- if @from_title
- $scene = Scene_Title.new
- elsif @from_event
- $scene = Scene_Map.new
- else
- $scene = Scene_Menu.new(5)
- end
- end
- end
- #==============================================================================
- # ■ Scene_End
- #==============================================================================
- class Scene_End < Scene_Base
- #--------------------------------------------------------------------------
- # ● 元の画面へ戻る 改
- #--------------------------------------------------------------------------
- def return_scene
- $scene = Scene_Menu.new(6)
- end
- end
复制代码
云大可否帮忙把此脚本改成 1号角色固定无法替换
谢谢了 |
|