| 赞 | 8 |
| VIP | |
| 好人卡 | |
| 积分 | 32 |
| 经验 | |
| 最后登录 | 2026-5-18 |
| 在线时间 | 1439 小时 |
- 梦石
- 0
- 星屑
- 3181
- 在线时间
- 1439 小时
- 注册时间
- 2009-7-27
- 回帖
- 1187
|
发表于 2020-8-3 01:22:14
|
显示全部楼层
本帖最后由 爆焰 于 2020-8-3 03:29 编辑
替换掉原来的脚本
- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
- # ▼▲▼ XRXS26. 人物扩张系统 ver..05 ▼▲▼
- # by 桜雅 在土
- #==============================================================================
- # □ 初始化定义
- #==============================================================================
- module XRXS26
- FRONT_MEMBER_LIMIT = 4 # 战斗参战人数最大值
- BACKWARD_MEMBER_LIMIT = 99 # 待机人数最大值
- BACKWARD_EXP_GAINABLE = false # 待机人物是否获得经验
- MENU_STATUS_STRETCH = false # 3人以下的时候,菜单是否拉伸大小
- end
- #------------------------------------------------------------------------------
- # 菜单页面状态
- #------------------------------------------------------------------------------
- class Window_MenuStatus < Window_Selectable
- # 列数
- COLUMN_MAX = 1
- # 光标高度
- CURSOR_HEIGHT = 96
- # 一行的高度
- LINE_HEIGHT = 116
- end
- #------------------------------------------------------------------------------
- # 菜单场景
- #------------------------------------------------------------------------------
- class Scene_Menu
- MENU_MEMBER_CHANGE_KEY_GO = Input::RIGHT # 进入键
- MENU_MEMBER_CHANGE_KEY_END = Input::LEFT # 离开键
- MENU_MEMBER_CHANGE_INDEX_MIN = 0 # 可更换角色最小编号
- FORCETOBATTLE_ACTORS = [] # 不能待机的角色编号
- UMBATTLABLE_ACTORS = [] # 不能加入战斗的角色编号
- UNMOVABLE_ACTORS = [] # 不能移动的角色编号
- end
- #------------------------------------------------------------------------------
- #
- # 解説
- # Game_Partyの @actors のうち先頭から↑FRONT_MEMBER_LIMIT番目までのアクターを
- # 戦闘メンバーとして、それ以上を待機メンバーとして扱います。
- #
- #==============================================================================
- # ■ Game_Party
- #==============================================================================
- class Game_Party
- #--------------------------------------------------------------------------
- # ○ インクルード
- #--------------------------------------------------------------------------
- include XRXS26
- #--------------------------------------------------------------------------
- # ○ 公開インスタンス変数
- #--------------------------------------------------------------------------
- attr_reader :backword_actors # 待機アクター
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- alias xrxs26_initialize initialize
- def initialize
- xrxs26_initialize
- # 待機メンバー配列を初期化
- @backword_actors = []
- end
- #--------------------------------------------------------------------------
- # ● アクターを加える
- #--------------------------------------------------------------------------
- def add_actor(actor_id)
- # アクターを取得
- actor = $game_actors[actor_id]
- # このアクターがパーティにいない場合
- if not @actors.include?(actor)
- # 満員でないならメンバーに追加
- if @actors.size < (FRONT_MEMBER_LIMIT + BACKWARD_MEMBER_LIMIT)
- # アクターを追加
- @actors.push(actor)
- # プレイヤーをリフレッシュ
- $game_player.refresh
- end
- end
- end
- end
- #==============================================================================
- # ■ Spriteset_Battle
- #==============================================================================
- class Spriteset_Battle
- #--------------------------------------------------------------------------
- # ● インクルード
- #--------------------------------------------------------------------------
- include XRXS26
- #--------------------------------------------------------------------------
- # ● フレーム更新
- #--------------------------------------------------------------------------
- alias xrxs26_initialize initialize
- def initialize
- xrxs26_initialize
- #
- # 以下、五人目以降のアクタースプライトの追加処理---
- #
- # アクターが表示されるビューポートを、とりあえず先頭の人から取得しとく(素
- actor_viewport = @actor_sprites[0].viewport
- # 戦闘参加メンバーが5人以上の場合
- if FRONT_MEMBER_LIMIT > 4
- for i in 5..FRONT_MEMBER_LIMIT
- # アクタースプライトを追加
- @actor_sprites.push(Sprite_Battler.new(actor_viewport))
- @actor_sprites[i-1].battler = $game_party.actors[i-1]
- end
- end
- # ビューポートを更新
- actor_viewport.update
- end
- end
- #==============================================================================
- # ■ Scene_Battle
- #==============================================================================
- class Scene_Battle
- #--------------------------------------------------------------------------
- # ● インクルード
- #--------------------------------------------------------------------------
- include XRXS26
- #--------------------------------------------------------------------------
- # ● メイン処理 をパーティメンバー処理ではさむ
- #--------------------------------------------------------------------------
- alias xrxs26_main main
- def main
- # 待機メンバーへ退避----------
- $game_party.backword_actors[0,0] = $game_party.actors[FRONT_MEMBER_LIMIT, BACKWARD_MEMBER_LIMIT]
- $game_party.actors[FRONT_MEMBER_LIMIT, BACKWARD_MEMBER_LIMIT] = nil
- $game_party.actors.compact!
- # メイン処理
- xrxs26_main
- # 待機メンバーから復帰
- $game_party.actors[$game_party.actors.size,0] = $game_party.backword_actors
- $game_party.backword_actors.clear
- end
- #--------------------------------------------------------------------------
- # ● アフターバトルフェーズ開始
- #--------------------------------------------------------------------------
- alias xrxs26_start_phase5 start_phase5
- def start_phase5
- # 「待機メンバー経験値獲得」が有効 and 待機アクターが一人以上いる
- if BACKWARD_EXP_GAINABLE and $game_party.backword_actors.size >= 1
- # 待機メンバーから復帰
- $game_party.actors[$game_party.actors.size,0] = $game_party.backword_actors
- $game_party.backword_actors.clear
- # 呼び戻す
- xrxs26_start_phase5
- # 待機メンバーへ退避----------
- $game_party.backword_actors[0,0] = $game_party.actors[FRONT_MEMBER_LIMIT, BACKWARD_MEMBER_LIMIT]
- $game_party.actors[FRONT_MEMBER_LIMIT, BACKWARD_MEMBER_LIMIT] = nil
- $game_party.actors.compact!
- else
- # 呼び戻す
- xrxs26_start_phase5
- end
- end
- end
- # ▽△▽ XRXL 4. 第二カーソル 機構 ▽△▽
- # by 桜雅 在土
- #==============================================================================
- # --- XRXS. 第二カーソル 機構 ---
- #------------------------------------------------------------------------------
- # ウィンドウに .index2 プロパティを追加します。
- #==============================================================================
- module XRXS_Cursor2
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize(x, y, w, h)
- super(x, y, h, w)
- # 補助ウィンドウ(透明)を作成:カーソル専用
- @xrxsc2_window = Window_Selectable.new(self.x, self.y, self.width, self.height)
- @xrxsc2_window.opacity = 0
- @xrxsc2_window.active = false
- @xrxsc2_window.index = -1
- end
- #--------------------------------------------------------------------------
- # ○ 第二カーソルの設置
- #--------------------------------------------------------------------------
- def index2
- return @xrxsc2_window.index
- end
- def index2=(index)
- @xrxsc2_window.index = index
- if index == -1
- @xrxsc2_window.cursor_rect.empty
- else
- @xrxsc2_window.x = self.x
- @xrxsc2_window.y = self.y
- @xrxsc2_window.cursor_rect = self.cursor_rect
- end
- end
- #--------------------------------------------------------------------------
- # ○ 先頭の行の設定
- #--------------------------------------------------------------------------
- def top_row=(row)
- super
- # 補助ウィンドウの oy を更新
- pre_oy = @xrxsc2_window.oy
- @xrxsc2_window.oy = self.oy
- @xrxsc2_window.cursor_rect.y -= self.oy - pre_oy
- end
- #--------------------------------------------------------------------------
- # ○ 解放
- #--------------------------------------------------------------------------
- def dispose
- @xrxsc2_window.dispose
- super
- end
- #--------------------------------------------------------------------------
- # ○ X, Y 座標
- #--------------------------------------------------------------------------
- def x=(n)
- super
- @xrxsc2_window.x = self.x unless @xrxsc2_window.nil?
- end
- def y=(n)
- super
- @xrxsc2_window.y = self.y unless @xrxsc2_window.nil?
- end
- end
- # ▼▲▼ XRXS26AX. +入れ替えメニュー ver.2 ▼▲▼ built 081113
- # by 桜雅 在土
- #==============================================================================
- # ■ Window_MenuStatus
- #==============================================================================
- class Window_MenuStatus < Window_Selectable
- #--------------------------------------------------------------------------
- # ○ インクルード
- #--------------------------------------------------------------------------
- include XRXS26
- include XRXS_Cursor2
- #--------------------------------------------------------------------------
- # ● 公開インスタンス変数
- #--------------------------------------------------------------------------
- attr_reader :column_max # 列数
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize
- h = 480
- if MENU_STATUS_STRETCH
- h = FRONT_MEMBER_LIMIT * 116 + 16
- end
- super(0, 0, 480, h)
- h = ($game_party.actors.size - 1) * LINE_HEIGHT + CURSOR_HEIGHT
- self.contents = Bitmap.new(width - 32, h)
- refresh
- self.active = false
- self.index = -1
- end
- #--------------------------------------------------------------------------
- # ○ 1 ページに表示できる行数の取得
- #--------------------------------------------------------------------------
- def page_row_max
- if MENU_STATUS_STRETCH
- return FRONT_MEMBER_LIMIT # 戦闘パーティ最大数
- else
- return [FRONT_MEMBER_LIMIT, 4].max # 戦闘パーティ最大数(最低4)
- end
- end
- #--------------------------------------------------------------------------
- # ○ 先頭の行の取得
- #--------------------------------------------------------------------------
- def top_row
- # ウィンドウ内容の転送元 Y 座標を、1 行の高さ LINE_HEIGHT で割る
- return self.oy / LINE_HEIGHT
- end
- #--------------------------------------------------------------------------
- # ○ 先頭の行の設定
- #--------------------------------------------------------------------------
- def top_row=(row)
- super
- self.oy = self.oy/32 * LINE_HEIGHT
- end
- #--------------------------------------------------------------------------
- # ● カーソルの矩形更新
- #--------------------------------------------------------------------------
- def update_cursor_rect
- super
- unless @index < 0
- y = (self.cursor_rect.y + self.oy) * LINE_HEIGHT/32 - self.oy
- self.cursor_rect.set(0, y, self.cursor_rect.width, CURSOR_HEIGHT)
- end
- end
- end
- #==============================================================================
- # ■ Scene_Menu
- #==============================================================================
- class Scene_Menu
- #--------------------------------------------------------------------------
- # ○ インクルード
- #--------------------------------------------------------------------------
- include XRXS26
- #--------------------------------------------------------------------------
- # ● フレーム更新
- #--------------------------------------------------------------------------
- alias xrxs26ax_update update
- def update
- # インデックスを保存
- @status_index = @status_window.index
- # 呼び戻す
- xrxs26ax_update
- end
- #--------------------------------------------------------------------------
- # ● フレーム更新 (コマンドウィンドウがアクティブの場合)
- #--------------------------------------------------------------------------
- alias xrxs26ax_update_command update_command
- def update_command
- # 呼び戻す
- xrxs26ax_update_command
- # 入れ替え移行キーが押されたとき、@command_window.indexが設定値以上
- if Input.trigger?(MENU_MEMBER_CHANGE_KEY_GO) and
- @command_window.index >= MENU_MEMBER_CHANGE_INDEX_MIN
- # 決定 SE を演奏
- $game_system.se_play($data_system.decision_se)
- # カーソル位置を記憶
- @command_index_before_menu_member_change = @command_window.index
- # 入れ替えウィンドウへ移行
- @command_window.active = false
- @command_window.index = -1
- @status_window.active = true
- @status_window.index = 0
- end
- end
- #--------------------------------------------------------------------------
- # ● フレーム更新 (ステータスウィンドウがアクティブの場合)
- #--------------------------------------------------------------------------
- alias xrxs26ax_update_status update_status
- def update_status
- # 呼び戻す
- if @command_window.index != -1
- xrxs26ax_update_status
- return
- end
- # B ボタンか入れ替え終了キーが押されたとき
- if ((Input.trigger?(Input::B) or Input.trigger?(MENU_MEMBER_CHANGE_KEY_END)) and
- @status_window.index2 == -1 and
- @status_index%@status_window.column_max == 0)
- # キャンセル SE を演奏
- $game_system.se_play($data_system.cancel_se)
- # コマンドウィンドウをアクティブにする
- @command_window.active = true
- @command_window.index = 0
- @status_window.active = false
- @status_window.index = -1
- return
- end
- # B ボタンが押されたとき
- if Input.trigger?(Input::B) and @status_window.index2 >= 0
- @status_window.index = @status_window.index2
- @status_window.index2 = -1
- return
- end
- # 決定キーが押されたとき
- if Input.trigger?(Input::C)
- if @status_window.index2 == -1
- if UNMOVABLE_ACTORS.include?($game_party.actors[@status_window.index].id)
- # ブザー SE を演奏
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # 決定 SE を演奏
- $game_system.se_play($data_system.decision_se)
- # メンバーの入れ替え一人目の決定
- @status_window.index2 = @status_window.index
- else
- if UNMOVABLE_ACTORS.include?($game_party.actors[@status_window.index].id)
- # ブザー SE を演奏
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # どちらかが戦闘メンバー かつ どちらかが戦闘禁止アクター の場合
- if (@status_window.index < FRONT_MEMBER_LIMIT or
- @status_window.index2 < FRONT_MEMBER_LIMIT) and
- (UMBATTLABLE_ACTORS.include?($game_party.actors[@status_window.index].id) or
- UMBATTLABLE_ACTORS.include?($game_party.actors[@status_window.index2].id))
- # ブザー SE を演奏
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # どちらかが待機メンバー かつ どちらかが待機禁止アクター の場合
- if (@status_window.index >= FRONT_MEMBER_LIMIT or
- @status_window.index2 >= FRONT_MEMBER_LIMIT) and
- (FORCETOBATTLE_ACTORS.include?($game_party.actors[@status_window.index].id) or
- FORCETOBATTLE_ACTORS.include?($game_party.actors[@status_window.index2].id))
- # ブザー SE を演奏
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # 決定 SE を演奏
- $game_system.se_play($data_system.decision_se)
- # メンバーの入れ替え二人目の決定と入れ替えの実行
- actor2 = $game_party.actors[@status_window.index]
- actor = $game_party.actors[@status_window.index2]
- $game_party.actors[@status_window.index2] = actor2
- $game_party.actors[@status_window.index] = actor
- @status_window.index = @status_window.index2
- @status_window.index2 = -1
- # プレイヤーをリフレッシュ
- $game_player.refresh
- # ステータスウィンドウをリフレッシュ
- @status_window.refresh
- end
- return
- end
- end
- end
- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
- class Scene_Save
- #--------------------------------------------------------------------------
- # ● 写入存档数据
- # file : 写入用文件对像 (已经打开)
- #--------------------------------------------------------------------------
- def write_save_data(file)
- # 生成描绘存档文件用的角色图形
- characters = []
- for i in 0...[$game_party.actors.size,4].min
- actor = $game_party.actors[i]
- characters.push([actor.character_name, actor.character_hue])
- end
- # 写入描绘存档文件用的角色数据
- Marshal.dump(characters, file)
- # 写入测量游戏时间用画面计数
- Marshal.dump(Graphics.frame_count, file)
- # 增加 1 次存档次数
- $game_system.save_count += 1
- # 保存魔法编号
- # (将编辑器保存的值以随机值替换)
- $game_system.magic_number = $data_system.magic_number
- # 写入各种游戏对像
- Marshal.dump($game_system, file)
- Marshal.dump($game_switches, file)
- Marshal.dump($game_variables, file)
- Marshal.dump($game_self_switches, file)
- Marshal.dump($game_screen, file)
- Marshal.dump($game_actors, file)
- Marshal.dump($game_party, file)
- Marshal.dump($game_troop, file)
- Marshal.dump($game_map, file)
- Marshal.dump($game_player, file)
- end
- end
- class Scene_Battle
- #--------------------------------------------------------------------------
- # ● 设置物品或特技对像方的战斗者
- # scope : 特技或者是物品的范围
- #--------------------------------------------------------------------------
- def set_target_battlers(scope)
- # 行动方的战斗者是敌人的情况下
- if @active_battler.is_a?(Game_Enemy)
- # 效果范围分支
- case scope
- when 1 # 敌单体
- index = @active_battler.current_action.target_index
- @target_battlers.push($game_party.smooth_target_actor(index))
- when 2 # 敌全体
- for actor in 0...[$game_party.actors.size,4].min
- if $game_party.actors[actor].exist?
- @target_battlers.push($game_party.actors[actor])
- end
- end
- when 3 # 我方单体
- index = @active_battler.current_action.target_index
- @target_battlers.push($game_troop.smooth_target_enemy(index))
- when 4 # 我方全体
- for enemy in $game_troop.enemies
- if enemy.exist?
- @target_battlers.push(enemy)
- end
- end
- when 5 # 我方单体 (HP 0)
- index = @active_battler.current_action.target_index
- enemy = $game_troop.enemies[index]
- if enemy != nil and enemy.hp0?
- @target_battlers.push(enemy)
- end
- when 6 # 我方全体 (HP 0)
- for enemy in $game_troop.enemies
- if enemy != nil and enemy.hp0?
- @target_battlers.push(enemy)
- end
- end
- when 7 # 使用者
- @target_battlers.push(@active_battler)
- end
- end
- # 行动方的战斗者是角色的情况下
- if @active_battler.is_a?(Game_Actor)
- # 效果范围分支
- case scope
- when 1 # 敌单体
- index = @active_battler.current_action.target_index
- @target_battlers.push($game_troop.smooth_target_enemy(index))
- when 2 # 敌全体
- for enemy in $game_troop.enemies
- if enemy.exist?
- @target_battlers.push(enemy)
- end
- end
- when 3 # 我方单体
- index = @active_battler.current_action.target_index
- @target_battlers.push($game_party.smooth_target_actor(index))
- when 4 # 我方全体
- for actor in 0...[$game_party.actors.size,4].min
- if $game_party.actors[actor].exist?
- @target_battlers.push($game_party.actors[actor])
- end
- end
- when 5 # 我方单体 (HP 0)
- index = @active_battler.current_action.target_index
- actor = $game_party.actors[index]
- if actor != nil and actor.hp0?
- @target_battlers.push(actor)
- end
- when 6 # 我方全体 (HP 0)
- for actor in 0...[$game_party.actors.size,4].min
- if $game_party.actors[actor] != nil and $game_party.actors[actor].hp0?
- @target_battlers.push($game_party.actors[actor])
- end
- end
- when 7 # 使用者
- @target_battlers.push(@active_battler)
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 生成行动循序
- #--------------------------------------------------------------------------
- def make_action_orders
- # 初始化序列 @action_battlers
- @action_battlers = []
- # 添加敌人到 @action_battlers 序列
- for enemy in $game_troop.enemies
- @action_battlers.push(enemy)
- end
- # 添加角色到 @action_battlers 序列
- for actor in 0...[$game_party.actors.size,4].min
- @action_battlers.push($game_party.actors[actor])
- end
- # 确定全体的行动速度
- for battler in @action_battlers
- battler.make_action_speed
- end
- # 按照行动速度从大到小排列
- @action_battlers.sort! {|a,b|
- b.current_action.speed - a.current_action.speed }
- end
- #--------------------------------------------------------------------------
- # ● 开始结束战斗回合
- #--------------------------------------------------------------------------
- def start_phase5
- # 转移到回合 5
- @phase = 5
- # 演奏战斗结束 ME
- $game_system.me_play($game_system.battle_end_me)
- # 还原为战斗开始前的 BGM
- $game_system.bgm_play($game_temp.map_bgm)
- # 初始化 EXP、金钱、宝物
- exp = 0
- gold = 0
- treasures = []
- # 循环
- for enemy in $game_troop.enemies
- # 敌人不是隐藏状态的情况下
- unless enemy.hidden
- # 获得 EXP、增加金钱
- exp += enemy.exp
- gold += enemy.gold
- # 出现宝物判定
- if rand(100) < enemy.treasure_prob
- if enemy.item_id > 0
- treasures.push($data_items[enemy.item_id])
- end
- if enemy.weapon_id > 0
- treasures.push($data_weapons[enemy.weapon_id])
- end
- if enemy.armor_id > 0
- treasures.push($data_armors[enemy.armor_id])
- end
- end
- end
- end
- # 限制宝物数为 6 个
- treasures = treasures[0..5]
- # 获得 EXP
- for i in 0...[$game_party.actors.size,4].min
- actor = $game_party.actors[i]
- if actor.cant_get_exp? == false
- last_level = actor.level
- actor.exp += exp
- if actor.level > last_level
- @status_window.level_up(i)
- end
- end
- end
- # 获得金钱
- $game_party.gain_gold(gold)
- # 获得宝物
- for item in treasures
- case item
- when RPG::Item
- $game_party.gain_item(item.id, 1)
- when RPG::Weapon
- $game_party.gain_weapon(item.id, 1)
- when RPG::Armor
- $game_party.gain_armor(item.id, 1)
- end
- end
- # 生成战斗结果窗口
- @result_window = Window_BattleResult.new(exp, gold, treasures)
- # 设置等待计数
- @phase5_wait_count = 100
- end
- #--------------------------------------------------------------------------
- # ● 转到输入下一个角色的命令
- #--------------------------------------------------------------------------
- def phase3_next_actor
- # 循环
- begin
- # 角色的明灭效果 OFF
- if @active_battler != nil
- @active_battler.blink = false
- end
- # 最后的角色的情况
- if @actor_index == [$game_party.actors.size-1,3].min
- # 开始主回合
- start_phase4
- return
- end
- # 推进角色索引
- @actor_index += 1
- @active_battler = $game_party.actors[@actor_index]
- @active_battler.blink = true
- # 如果角色是在无法接受指令的状态就再试
- end until @active_battler.inputable?
- # 设置角色的命令窗口
- phase3_setup_command_window
- end
- end
- class Arrow_Actor < Arrow_Base
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- super
- # 光标右
- if Input.repeat?(Input::RIGHT)
- $game_system.se_play($data_system.cursor_se)
- @index += 1
- @index %= [$game_party.actors.size,4].min
- end
- # 光标左
- if Input.repeat?(Input::LEFT)
- $game_system.se_play($data_system.cursor_se)
- @index += $game_party.actors.size - 1
- @index %= [$game_party.actors.size,4].min
- end
- # 设置活动块坐标
- if self.actor != nil
- self.x = self.actor.screen_x
- self.y = self.actor.screen_y
- end
- end
- end
- #==============================================================================
- # ■ Window_Target
- #------------------------------------------------------------------------------
- # 物品画面与特技画面的、使用对像角色选择窗口。
- #==============================================================================
- class Window_Target < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, 336, 480)
- self.contents = Bitmap.new(width - 32, $game_party.actors.size*112)
- self.z += 10
- @item_max = $game_party.actors.size
- @top_row = 0
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- for i in 0...$game_party.actors.size
- x = 4
- y = i * 112
- actor = $game_party.actors[i]
- draw_actor_name(actor, x, y)
- draw_actor_class(actor, x + 144, y)
- draw_actor_level(actor, x + 8, y + 32)
- draw_actor_state(actor, x + 8, y + 64)
- draw_actor_hp(actor, x + 152, y + 32)
- draw_actor_sp(actor, x + 152, y + 64)
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新光标矩形
- #--------------------------------------------------------------------------
- def update_cursor_rect
- # 光标位置 -1 为全选、-2 以下为单独选择 (使用者自身)
- if @index <= -2
- self.cursor_rect.set(0, (@index + 10) * 112, self.width - 32, 96)
- elsif @index == -1
- self.cursor_rect.set(0, 0, self.width - 32, @item_max * 112 - 20)
- else
- tpy = @index * 112 - self.oy
- self.cursor_rect.set(0, tpy, self.width - 32, 96)
- if @index < @top_row
- @top_row = @index
- self.oy = @top_row *112
- end
- if @index > @top_row+3
- @top_row = @index-3
- self.oy = @top_row *112
- end
- end
- end
- end
- #==============================================================================
- # ■ Window_MenuStatus
- #------------------------------------------------------------------------------
- # 显示菜单画面和同伴状态的窗口。
- #==============================================================================
- class Window_MenuStatus < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化目标
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, 480, 480)
- self.contents = Bitmap.new(width - 32, $game_party.actors.size*112)
- refresh
- @top_row = 0
- self.active = false
- self.index = -1
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- @item_max = $game_party.actors.size
- for i in 0...$game_party.actors.size
- x = 64
- y = i * 112
- if i <=3
- self.contents.font.color = Color.new(0,255,0,255)
- self.contents.draw_text(x,y,340,32,"[出战]",2)
- self.contents.font.color = normal_color
- else
- self.contents.font.color = Color.new(128,128,128,255)
- self.contents.draw_text(x,y,340,32,"[待机]",2)
- self.contents.font.color = normal_color
- end
- actor = $game_party.actors[i]
- draw_actor_graphic(actor, x - 40, y + 80)
- draw_actor_name(actor, x, y)
- draw_actor_class(actor, x + 144, y)
- draw_actor_level(actor, x, y + 32)
- draw_actor_state(actor, x + 90, y + 32)
- draw_actor_exp(actor, x, y + 64)
- draw_actor_hp(actor, x + 236, y + 32)
- draw_actor_sp(actor, x + 236, y + 64)
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新光标矩形
- #--------------------------------------------------------------------------
- def update_cursor_rect
- if @index < 0
- self.cursor_rect.empty
- else
- tpy = @index * 112 - self.oy
- self.cursor_rect.set(0, tpy, self.width - 32, 96)
- if @index < @top_row
- @top_row = @index
- self.oy = @top_row *112
- end
- if @index > @top_row+3
- @top_row = @index-3
- self.oy = @top_row *112
- end
- end
- end
- end
- class Game_Party
- #--------------------------------------------------------------------------
- # ● 全灭判定
- #--------------------------------------------------------------------------
- def all_dead?
- # 同伴人数为 0 的情况下
- if $game_party.actors.size == 0
- return false
- end
- # 同伴中无人 HP 在 0 以上
- for i in 0..3
- if @actors[i] != nil and@actors[i].hp >0
- return false
- end
- end
- # 全灭
- return true
- end
- #--------------------------------------------------------------------------
- # ● 加入同伴
- # actor_id : 角色 ID
- #--------------------------------------------------------------------------
- def add_actor(actor_id)
- # 获取角色
- actor = $game_actors[actor_id]
- # 同伴人数未满 4 人、本角色不在队伍中的情况下
- if not @actors.include?(actor)
- # 添加角色
- @actors.push(actor)
- # 还原主角
- $game_player.refresh
- end
- end
- end
复制代码 |
评分
-
查看全部评分
|