赞 | 0 |
VIP | 19 |
好人卡 | 0 |
积分 | 1 |
经验 | 2539 |
最后登录 | 2024-6-20 |
在线时间 | 42 小时 |
Lv1.梦旅人 曹操
- 梦石
- 0
- 星屑
- 121
- 在线时间
- 42 小时
- 注册时间
- 2008-2-28
- 帖子
- 513
|
脚本内容
- # ————————————————————————————————————
- # 本脚本来自www.66rpg.com,转载请保留此信息
- # ————————————————————————————————————
- # リアルタイム・アクティブバトル(RTAB) Ver 1.05
- # 配布元・サポートURL
- # http://members.jcom.home.ne.jp/cogwheel/
- class Scene_Battle
- #--------------------------------------------------------------------------
- # ● 公開インスタンス変数
- #--------------------------------------------------------------------------
- attr_reader :status_window # ステータスウィンドウ
- attr_reader :spriteset # バトルスプライト
- attr_reader :scroll_time # スクリーン移動基本時間
- attr_reader :zoom_rate # 敵バトラー基本位置
- attr_reader :drive # カメラ駆動
- attr_accessor :force # アクション強制度
- attr_accessor :camera # 現在のカメラ所持者
- #--------------------------------------------------------------------------
- # ● ATB基礎セットアップ
- #--------------------------------------------------------------------------
- def atb_setup
- # ATB初期化
- # speed : バトルスピード決定。値が小さいほど早い
- # @active : アクティブ度設定
- # 3 : 常にアクティブ状態
- # 2 : スキル・アイテム選択中のみアクティブゲージが止まる
- # 1 : 2の状態に加え、ターゲット選択時もウェイトが掛かる
- # 0 : 1の状態に加え、コマンド入力時にもウェイトが掛かる
- # @action : 他人が行動中に自分も行動を起こすことを許すか
- # 3 : 自分が行動不能でない限り限り許す
- # 2 : 自分がダメージを受けていない限り許す
- # 1 : 2の状態に加え、ターゲットが行動していない限り許す
- # 0 : 行動を許さない。順番に行動し終えるまで待つ
- # @anime_wait : trueにするとバトルアニメ・ダメージ表示中はウェイトが掛かる
- # @damage_wait : ダメージ表示待ち時間(単位はフレーム)
- # @enemy_speed : 敵の思考速度。1なら即時行動。
- # 1フレーム毎に、1/@enemy_speedの確率で行動を起こす
- # @force : 強制アクションでスキル使用時の強制具合
- # 2:スキルは全て詠唱せず、必ず即時実行
- # 1:単独スキルは詠唱し、連携スキルのみ即時実行
- # 0:全スキル詠唱を行うだけ
- # ($scene.force = x とすることにより、通常イベントのスクリプトから変更可能)
- # @drive : カメラ駆動ON/OFF。trueで駆動ON、falseで駆動OFF
- # @scroll_time : スクリーン移動に要する基本時間
- # @zoom_rate = [i, j] : エネミーのズーム率
- # i が画面最上部に配置した時の拡大率
- # j が画面最下部に配置した時の拡大率
- # 1 倍としたいときも、1.0 と必ず小数で設定すること
- speed = 150
- @active = 1
- @action = 2
- @anime_wait = false
- @damage_wait = 10
- @enemy_speed = 40
- @force = 2
- @drive = true
- @scroll_time = 15
- @zoom_rate = [0.2, 1.0]
- @help_time = 40
- @escape == false
- @camera = nil
- @max = 0
- @turn_cnt = 0
- @help_wait = 0
- @action_battlers = []
- @synthe = []
- @spell_p = {}
- @spell_e = {}
- @command_a = false
- @command = []
- @party = false
- for battler in $game_party.actors + $game_troop.enemies
- spell_reset(battler)
- battler.at = battler.agi * rand(speed / 2)
- battler.damage_pop = {}
- battler.damage = {}
- battler.damage_sp = {}
- battler.critical = {}
- battler.recover_hp = {}
- battler.recover_sp = {}
- battler.state_p = {}
- battler.state_m = {}
- battler.animation = []
- if battler.is_a?(Game_Actor)
- @max += battler.agi
- end
- end
- @max *= speed
- @max /= $game_party.actors.size
- for battler in $game_party.actors + $game_troop.enemies
- battler.atp = 100 * battler.at / @max
- end
- end
- #--------------------------------------------------------------------------
- # ● ATゲージMax時SE
- #--------------------------------------------------------------------------
- def fullat_se
- Audio.se_play("Audio/SE/033-switch02", 80, 100)
- end
- #--------------------------------------------------------------------------
- # ● レベルアップSE
- #--------------------------------------------------------------------------
- def levelup_se
- Audio.se_play("Audio/SE/056-Right02", 80, 100)
- end
- #--------------------------------------------------------------------------
- # ● スキル習得SE
- #--------------------------------------------------------------------------
- def skill_se
- Audio.se_play("Audio/SE/056-Right02", 80, 150)
- end
- end
- class Window_Base < Window
- #--------------------------------------------------------------------------
- # ● ATG の描画
- # actor : アクター
- # x : 描画先 X 座標
- # y : 描画先 Y 座標
- # width : 描画先の幅
- #--------------------------------------------------------------------------
- def draw_actor_atg(actor, x, y, width = 144)
- if @at_gauge == nil
- # plus_x:X座標の位置補正 rate_x:X座標の位置補正(%) plus_y:Y座標の位置補正
- # plus_width:幅の補正 rate_width:幅の補正(%) height:縦幅
- # align1:描画タイプ1 0:左詰め 1:中央揃え 2:右詰め
- # align2:描画タイプ2 0:上詰め 1:中央揃え 2:下詰め
- # align3:ゲージタイプ 0:左詰め 1:右詰め
- @plus_x = 0
- @rate_x = 0
- @plus_y = 16
- @plus_width = 0
- @rate_width = 100
-
-
- # 第一命中判定
- hit_result = (rand(100) < attacker.hit)
- # 命中の場合
- if hit_result == true
- # 基本ダメージを計算
- atk = [attacker.atk - self.pdef / 2, 0].max
- self.damage[attacker] = atk * (20 + attacker.str) / 20
- # 属性修正
- self.damage[attacker] *= elements_correct(attacker.element_set)
- self.damage[attacker] /= 100
- # ダメージの符号が正の場合
- if self.damage[attacker] > 0
- # クリティカル修正
- if rand(100) < 4 * attacker.dex / self.agi
- self.damage[attacker] *= 2
- self.critical[attacker] = true
- end
- # 防御修正
- if self.guarding?
- self.damage[attacker] /= 2
- end
- end
- # 分散
- if self.damage[attacker].abs > 0
- amp = [self.damage[attacker].abs * 15 / 100, 1].max
- self.damage[attacker] += rand(amp+1) + rand(amp+1) - amp
- end
- # 第二命中判定
- eva = 8 * self.agi / attacker.dex + self.eva
- hit = self.damage[attacker] < 0 ? 100 : 100 - eva
- hit = self.cant_evade? ? 100 : hit
- hit_result = (rand(100) < hit)
- end
- # 命中の場合
- if hit_result == true
- # ステート衝撃解除
- remove_states_shock
- # HP からダメージを減算
- # ステート変化
- @state_changed = false
- states_plus(attacker, attacker.plus_state_set)
- states_minus(attacker, attacker.minus_state_set)
- # ミスの場合
- else
- # ダメージに "Miss" を設定
- self.damage[attacker] = "Miss"
- # クリティカルフラグをクリア
- self.critical[attacker] = false
- end
- # メソッド終了
- return true
- end
- #--------------------------------------------------------------------------
- # ● スキルの効果適用
- # user : スキルの使用者 (バトラー)
- # skill : スキル
- #--------------------------------------------------------------------------
- def skill_effect(user, skill)
- # クリティカルフラグをクリア
- self.critical[user] = false
- state_p[user] = []
- state_m[user] = []
- # スキルの効果範囲が HP 1 以上の味方で、自分の HP が 0、
- # またはスキルの効果範囲が HP 0 の味方で、自分の HP が 1 以上の場合
- if ((skill.scope == 3 or skill.scope == 4) and self.hp == 0) or
- ((skill.scope == 5 or skill.scope == 6) and self.hp >= 1)
- # メソッド終了
- return false
- end
- # 有効フラグをクリア
- effective = false
- # コモンイベント ID が有効の場合は有効フラグをセット
- effective |= skill.common_event_id > 0
- # 第一命中判定
- hit = skill.hit
- if skill.atk_f > 0
- hit *= user.hit / 100
- end
- hit_result = (rand(100) < hit)
- # 不確実なスキルの場合は有効フラグをセット
- effective |= hit < 100
- # 命中の場合
- if hit_result == true
- # 威力を計算
- power = skill.power + user.atk * skill.atk_f / 100
- if power > 0
- power -= self.pdef * skill.pdef_f / 200
- power -= self.mdef * skill.mdef_f / 200
- power = [power, 0].max
- end
- # 倍率を計算
- rate = 20
- rate += (user.str * skill.str_f / 100)
- rate += (user.dex * skill.dex_f / 100)
- rate += (user.agi * skill.agi_f / 100)
- rate += (user.int * skill.int_f / 100)
- # 基本ダメージを計算
- self.damage[user] = power * rate / 20
- # 属性修正
- self.damage[user] *= elements_correct(skill.element_set)
- self.damage[user] /= 100
- # ダメージの符号が正の場合
- if self.damage[user] > 0
- # 防御修正
- if self.guarding?
- self.damage[user] /= 2
- end
- end
- # 分散
- if skill.variance > 0 and self.damage[user].abs > 0
- amp = [self.damage[user].abs * skill.variance / 100, 1].max
- self.damage[user] += rand(amp+1) + rand(amp+1) - amp
- end
- # 第二命中判定
- eva = 8 * self.agi / user.dex + self.eva
- hit = self.damage[user] < 0 ? 100 : 100 - eva * skill.eva_f / 100
- hit = self.cant_evade? ? 100 : hit
- hit_result = (rand(100) < hit)
- # 不確実なスキルの場合は有効フラグをセット
- effective |= hit < 100
- end
- # 命中の場合
- if hit_result == true
- # 威力 0 以外の物理攻撃の場合
- if skill.power != 0 and skill.atk_f > 0
- # ステート衝撃解除
- remove_states_shock
- # 有効フラグをセット
- effective = true
- end
- # HP の変動判定
- last_hp = [[self.hp - self.damage[user], self.maxhp].min, 0].max
- # 効果判定
- effective |= self.hp != last_hp
- # ステート変化
- @state_changed = false
- effective |= states_plus(user, skill.plus_state_set)
- effective |= states_minus(user, skill.minus_state_set)
- unless $game_temp.in_battle
- self.damage_effect(user, 1)
- end
- # 威力が 0 の場合
- if skill.power == 0
- # ダメージに空文字列を設定
- self.damage[user] = ""
- # ステートに変化がない場合
- unless @state_changed
- # ダメージに "Miss" を設定
- self.damage[user] = "Miss"
- end
- end
- # ミスの場合
- else
- # ダメージに "Miss" を設定
- self.damage[user] = "Miss"
- end
- # 戦闘中でない場合
- unless $game_temp.in_battle
- # ダメージに nil を設定
- self.damage[user] = nil
- end
- # メソッド終了
- return effective
- end
- #--------------------------------------------------------------------------
- # ● アイテムの効果適用
- # item : アイテム
- #--------------------------------------------------------------------------
- def item_effect(item, user = $game_party.actors[0])
- # クリティカルフラグをクリア
- self.critical[user] = false
- state_p[user] = []
- state_m[user] = []
- # アイテムの効果範囲が HP 1 以上の味方で、自分の HP が 0、
- # またはアイテムの効果範囲が HP 0 の味方で、自分の HP が 1 以上の場合
- if ((item.scope == 3 or item.scope == 4) and self.hp == 0) or
- ((item.scope == 5 or item.scope == 6) and self.hp >= 1)
- # メソッド終了
- return false
- end
- # 有効フラグをクリア
- effective = false
- # コモンイベント ID が有効の場合は有効フラグをセット
- effective |= item.common_event_id > 0
- # 命中判定
- hit_result = (rand(100) < item.hit)
- # 不確実なスキルの場合は有効フラグをセット
- effective |= item.hit < 100
- # 命中の場合
- if hit_result == true
- # 回復量を計算
- self.recover_hp[user] = maxhp * item.recover_hp_rate / 100 +
- item.recover_hp
- self.recover_sp[user] = maxsp * item.recover_sp_rate / 100 +
- item.recover_sp
- if self.recover_hp[user] < 0
- self.recover_hp[user] += self.pdef * item.pdef_f / 20
- self.recover_hp[user] += self.mdef * item.mdef_f / 20
- self.recover_hp[user] = [self.recover_hp[user], 0].min
- end
- # 属性修正
- self.recover_hp[user] *= elements_correct(item.element_set)
- self.recover_hp[user] /= 100
- self.recover_sp[user] *= elements_correct(item.element_set)
- self.recover_sp[user] /= 100
- # 分散
- if item.variance > 0 and self.recover_hp[user].abs > 0
- amp = [self.recover_hp[user].abs * item.variance / 100, 1].max
- self.recover_hp[user] += rand(amp+1) + rand(amp+1) - amp
- end
- if item.variance > 0 and self.recover_sp[user].abs > 0
- amp = [self.recover_sp[user].abs * item.variance / 100, 1].max
- self.recover_sp[user] += rand(amp+1) + rand(amp+1) - amp
- end
- # 回復量の符号が負の場合
- if self.recover_hp[user] < 0
- # 防御修正
- if self.guarding?
- self.recover_hp[user] /= 2
- end
- end
- # HP 回復量の符号を反転し、ダメージの値に設定
- self.damage[user] = -self.recover_hp[user]
- # HP および SP の変動判定
- last_hp = [[self.hp + self.recover_hp[user], self.maxhp].min, 0].max
- last_sp = [[self.sp + self.recover_sp[user], self.maxsp].min, 0].max
- effective |= self.hp != last_hp
- effective |= self.sp != last_sp
- # ステート変化
- @state_changed = false
- effective |= states_plus(user, item.plus_state_set)
- effective |= states_minus(user, item.minus_state_set)
- unless $game_temp.in_battle
- self.damage_effect(user, 2)
- end
- # パラメータ上昇値が有効の場合
- if item.parameter_type > 0 and item.parameter_points != 0
- # パラメータで分岐
- case item.parameter_type
- when 1 # MaxHP
- @maxhp_plus += item.parameter_points
- when 2 # MaxSP
- @maxsp_plus += item.parameter_points
- when 3 # 腕力
- @str_plus += item.parameter_points
- when 4 # 器用さ
- @dex_plus += item.parameter_points
- when 5 # 素早さ
- @agi_plus += item.parameter_points
- when 6 # 魔力
- @int_plus += item.parameter_points
- end
- # 有効フラグをセット
- effective = true
- end
- # HP 回復率と回復量が 0 の場合
- if item.recover_hp_rate == 0 and item.recover_hp == 0
- # ダメージに空文字列を設定
- self.damage[user] = ""
- # SP 回復率と回復量が 0、パラメータ上昇値が無効の場合
- if item.recover_sp_rate == 0 and item.recover_sp == 0 and
- (item.parameter_type == 0 or item.parameter_points == 0)
- # ステートに変化がない場合
- unless @state_changed
- # ダメージに "Miss" を設定
- self.damage[user] = "Miss"
- end
- end
- end
- # ミスの場合
- else
- # ダメージに "Miss" を設定
- self.damage[user] = "Miss"
- end
- # 戦闘中でない場合
- unless $game_temp.in_battle
- # ダメージに nil を設定
- self.damage[user] = nil
- end
- # メソッド終了
- return effective
- end
- #--------------------------------------------------------------------------
- # ● ステート変化 (+) の適用
- # plus_state_set : ステート変化 (+)
- #--------------------------------------------------------------------------
- def states_plus(battler, plus_state_set)
- # 有効フラグをクリア
- effective = false
- # ループ (付加するステート)
- for i in plus_state_set
- # このステートが防御されていない場合
- unless self.state_guard?(i)
- # このステートがフルでなければ有効フラグをセット
- effective |= self.state_full?(i) == false
- # ステートが [抵抗しない] の場合
- if $data_states[i].nonresistance
- # ステート変化フラグをセット
- @state_changed = true
- # ステートを付加
- add_state(i)
- # このステートがフルではない場合
- elsif self.state_full?(i) == false
- # ステート有効度を確率に変換し、乱数と比較
- if rand(100) < [0,100,80,60,40,20,0][self.state_ranks[i]]
- # ステート変化フラグをセット
- @state_changed = true
- # ステートを付加
- self.state_p[battler].push(i)
- end
- end
- end
- end
- # メソッド終了
- return effective
- end
- #--------------------------------------------------------------------------
- # ● ステート変化 (-) の適用
- # minus_state_set : ステート変化 (-)
- #--------------------------------------------------------------------------
- def states_minus(battler, minus_state_set)
- # 有効フラグをクリア
- effective = false
- # ループ (解除するステート)
- for i in minus_state_set
- # このステートが付加されていれば有効フラグをセット
- effective |= self.state?(i)
- # ステート変化フラグをセット
- @state_changed = true
- # ステートを解除
- self.state_m[battler].push(i)
- end
- # メソッド終了
- return effective
- end
- #--------------------------------------------------------------------------
- # ● ダメージ演算
- #--------------------------------------------------------------------------
- def damage_effect(battler, item)
- if item == 2
- self.hp += self.recover_hp[battler]
- self.sp += self.recover_sp[battler]
- if self.recover_sp[battler] != 0
- self.damage_sp[battler] = -self.recover_sp[battler]
- end
- else
- if self.damage[battler].class != String
- self.hp -= self.damage[battler]
- end
- end
- for i in self.state_p[battler]
- add_state(i)
- end
- for i in self.state_m[battler]
- remove_state(i)
- end
- end
- #--------------------------------------------------------------------------
- # ● スリップダメージの効果適用
- #--------------------------------------------------------------------------
- def slip_damage_effect
-
- # ダメージを設定
- self.damage["slip"] = self.maxhp / 10
- # 分散
- if self.damage["slip"].abs > 0
- amp = [self.damage["slip"].abs * 15 / 100, 1].max
- self.damage["slip"] += rand(amp+1) + rand(amp+1) - amp
- end
- # HP からダメージを減算
- self.hp -= self.damage["slip"]
- # メソッド終了
- return true
- end
- end
- #==============================================================================
- # ■ Game_BattleAction
- #------------------------------------------------------------------------------
- # アクション (戦闘中の行動) を扱うクラスです。このクラスは Game_Battler クラ
- # スの内部で使用されます。
- #==============================================================================
- class Game_BattleAction
- #--------------------------------------------------------------------------
- # ● 公開インスタンス変数
- #--------------------------------------------------------------------------
- attr_accessor :spell_id # 合体魔法用スキル ID
- attr_accessor :force_kind # 種別 (基本 / スキル / アイテム)
- attr_accessor :force_basic # 基本 (攻撃 / 防御 / 逃げる)
- attr_accessor :force_skill_id # スキル ID
- #--------------------------------------------------------------------------
- # ● 有効判定
- #--------------------------------------------------------------------------
- def valid?
- return (not (@force_kind == 0 and @force_basic == 3))
- end
- end
- #==============================================================================
- # ■ Game_Actor
- #------------------------------------------------------------------------------
- # アクターを扱うクラスです。このクラスは Game_Actors クラス ($game_actors)
- # の内部で使用され、Game_Party クラス ($game_party) からも参照されます。
- #==============================================================================
- class Game_Actor < Game_Battler
- def skill_can_use?(skill_id)
- return super
- end
- end
- #==============================================================================
- # ■ Game_Enemy
- #------------------------------------------------------------------------------
- # エネミーを扱うクラスです。このクラスは Game_Troop クラス ($game_troop) の
- # 内部で使用されます。
- #==============================================================================
- class Game_Enemy < Game_Battler
- #--------------------------------------------------------------------------
- # ● 公開インスタンス変数
- #--------------------------------------------------------------------------
- attr_accessor :height # 画像の高さ
- attr_accessor :real_x # X座標補正
- attr_accessor :real_y # Y座標補正
- attr_accessor :real_zoom # 拡大率
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- # troop_id : トループ ID
- # member_index : トループメンバーのインデックス
- #--------------------------------------------------------------------------
- def initialize(troop_id, member_index)
- super()
- @troop_id = troop_id
- @member_index = member_index
- troop = $data_troops[@troop_id]
- @enemy_id = troop.members[@member_index].enemy_id
- enemy = $data_enemies[@enemy_id]
- @battler_name = enemy.battler_name
- @battler_hue = enemy.battler_hue
- @hp = maxhp
- @sp = maxsp
- @real_x = 0
- @real_y = 0
- @real_zoom = 1.0
- @fly = 0
- enemy.name.sub(/\\[Ff]\[([0-9]+)\]/) {@fly = $1.to_i}
- @hidden = troop.members[@member_index].hidden
- @immortal = troop.members[@member_index].immortal
- end
- alias :true_x :screen_x
- alias :true_y :screen_y
- #--------------------------------------------------------------------------
- # ● バトル画面 X 座標の取得
- #--------------------------------------------------------------------------
- def screen_x
- return 320 + (true_x - 320) * @real_zoom + @real_x
- end
- #--------------------------------------------------------------------------
- # ● バトル画面 Y 座標の取得
- #--------------------------------------------------------------------------
- def screen_y
- return true_y * @real_zoom + @real_y
- end
- #--------------------------------------------------------------------------
- # ● バトル画面 Z 座標の取得
- #--------------------------------------------------------------------------
- def screen_z
- return true_y + @fly
- end
- #--------------------------------------------------------------------------
- # ● バトル画面 拡大率の取得
- #--------------------------------------------------------------------------
- def zoom
- return ($scene.zoom_rate[1] - $scene.zoom_rate[0]) *
- (true_y + @fly) / 320 + $scene.zoom_rate[0]
- end
- #--------------------------------------------------------------------------
- # ● 攻撃用、バトル画面 X 座標の取得
- #--------------------------------------------------------------------------
- def attack_x(z)
- return (320 - true_x) * z * 0.75
- end
- #--------------------------------------------------------------------------
- # ● 攻撃用、バトル画面 Y 座標の取得
- #--------------------------------------------------------------------------
- def attack_y(z)
- return (160 - (true_y + @fly / 4) * z + @height * zoom * z / 2) * 0.75
- end
- #--------------------------------------------------------------------------
- # ● アクション作成
- #--------------------------------------------------------------------------
- def make_action
- # カレントアクションをクリア
- self.current_action.clear
- # 動けない場合
- unless self.inputable?
- # メソッド終了
- return
- end
- # 現在有効なアクションを抽出
- available_actions = []
- rating_max = 0
- for action in self.actions
- # ターン 条件確認
- n = $game_temp.battle_turn
- a = action.condition_turn_a
- b = action.condition_turn_b
- if (b == 0 and n != a) or
- (b > 0 and (n < 1 or n < a or n % b != a % b))
- next
- end
- # HP 条件確認
- if self.hp * 100.0 / self.maxhp > action.condition_hp
- next
- end
- # レベル 条件確認
- if $game_party.max_level < action.condition_level
- next
- end
- # スイッチ 条件確認
- switch_id = action.condition_switch_id
- if switch_id > 0 and $game_switches[switch_id] == false
- next
- end
- # スキル使用可能 条件確認
- if action.kind == 1
- unless self.skill_can_use?(action.skill_id)
- next
- end
- end
- # 条件に該当 : このアクションを追加
- available_actions.push(action)
- if action.rating > rating_max
- rating_max = action.rating
- end
- end
- # 最大のレーティング値を 3 として合計を計算 (0 以下は除外)
- ratings_total = 0
- for action in available_actions
- if action.rating > rating_max - 3
- ratings_total += action.rating - (rating_max - 3)
- end
- end
- # レーティングの合計が 0 ではない場合
- if ratings_total > 0
- # 乱数を作成
- ;value = rand(ratings_total)
- # 作成した乱数に対応するものをカレントアクションに設定
- for action in available_actions
- if action.rating > rating_max - 3
- if value < action.rating - (rating_max - 3)
- self.current_action.kind = action.kind
- self.current_action.basic = action.basic
- self.current_action.skill_id = action.skill_id
- self.current_action.decide_random_target_for_enemy
- return
- else
- ;value -= action.rating - (rating_max - 3)
- end
- end
- end
- end
- end
- end
- #==============================================================================
- # ■ Game_Party
- #------------------------------------------------------------------------------
- # パーティを扱うクラスです。ゴールドやアイテムなどの情報が含まれます。このク
- # ラスのインスタンスは $game_party で参照されます。
- #==============================================================================
- class Game_Party
- #--------------------------------------------------------------------------
- # ● 全滅判定
- #--------------------------------------------------------------------------
- def all_dead?
- # パーティ人数が 0 人の場合
- if $game_party.actors.size == 0
- return false
- end
- # HP 0 以上のアクターがパーティにいる場合
- for actor in @actors
- if actor.hp > 0 or actor.damage.size > 0
- return false
- end
- end
- # 全滅
- return true
- end
- end
- #==============================================================================
- # ■ Sprite_Battler
- #------------------------------------------------------------------------------
- # バトラー表示用のスプライトです。Game_Battler クラスのインスタンスを監視し、
- # スプライトの状態を自動的に変化させます。
- #==============================================================================
- class Sprite_Battler < RPG::Sprite
- #--------------------------------------------------------------------------
- # ● フレーム更新
- #--------------------------------------------------------------------------
- def update
- super
- # バトラーが nil の場合
- if @battler == nil
- self.bitmap = nil
- loop_animation(nil)
- return
- end
- # ファイル名か色相が現在のものと異なる場合
- if @battler.battler_name != @battler_name or
- @battler.battler_hue != @battler_hue
- # ビットマップを取得、設定
- @battler_name = @battler.battler_name
- @battler_hue = @battler.battler_hue
- self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
- @width = bitmap.width
- @height = bitmap.height
- self.ox = @width / 2
- self.oy = @height
- if @battler.is_a?(Game_Enemy)
- @battler.height = @height
- end
- # 戦闘不能または隠れ状態なら不透明度を 0 にする
- if @battler.dead? or @battler.hidden
- self.opacity = 0
- end
- end
- # アニメーション ID が現在のものと異なる場合
- if @battler.state_animation_id != @state_animation_id
- @state_animation_id = @battler.state_animation_id
- loop_animation($data_animations[@state_animation_id])
- end
- # 表示されるべきアクターの場合
- if @battler.is_a?(Game_Actor) and @battler_visible
- # メインフェーズでないときは不透明度をやや下げる
- if $game_temp.battle_main_phase
- self.opacity += 3 if self.opacity < 255
- else
- self.opacity -= 3 if self.opacity > 207
- end
- end
- # 明滅
- if @battler.blink
- blink_on
- else
- blink_off
- end
- # 不可視の場合
- unless @battler_visible
- # 出現
- if not @battler.hidden and not @battler.dead? and
- (@battler.damage.size < 2 or @battler.damage_pop.size < 2)
- appear
- @battler_visible = true
- end
- end
- # ダメージ
- for battler in @battler.damage_pop
- if battler[0].class == Array
- if battler[0][1] >= 0
- $scene.skill_se
- else
- $scene.levelup_se
- end
- damage(@battler.damage[battler[0]], false, 2)
- else
- damage(@battler.damage[battler[0]], @battler.critical[battler[0]])
- end
- if @battler.damage_sp.include?(battler[0])
- damage(@battler.damage_sp[battler[0]],
- @battler.critical[battler[0]], 1)
- @battler.damage_sp.delete(battler[0])
- end
- @battler.damage_pop.delete(battler[0])
- @battler.damage.delete(battler[0])
- @battler.critical.delete(battler[0])
- end
- # 可視の場合
- if @battler_visible
- # 逃走
- if @battler.hidden
- $game_system.se_play($data_system.escape_se)
- escape
- @battler_visible = false
- end
- # 白フラッシュ
- if @battler.white_flash
- whiten
- @battler.white_flash = false
- end
- # アニメーション
- unless @battler.animation.empty?
- for animation in @battler.animation.reverse
- animation($data_animations[animation[0]], animation[1])
- @battler.animation.delete(animation)
- end
- end
- # コラプス
- if @battler.damage.empty? and @battler.dead?
- if $scene.dead_ok?(@battler)
- if @battler.is_a?(Game_Enemy)
- $game_system.se_play($data_system.enemy_collapse_se)
- else
- $game_system.se_play($data_system.actor_collapse_se)
- end
- collapse
- @battler_visible = false
- end
- end
- end
- # スプライトの座標を設定
- self.x = @battler.screen_x
- self.y = @battler.screen_y
- self.z = @battler.screen_z
- if @battler.is_a?(Game_Enemy)
- self.zoom_x = @battler.real_zoom * @battler.zoom
- self.zoom_y = @battler.real_zoom * @battler.zoom
- end
- end
- end
- #==============================================================================
- # ■ Window_Base
- #------------------------------------------------------------------------------
- # ゲーム中のすべてのウィンドウのスーパークラスです。
- #==============================================================================
- class Window_Base < Window
- #--------------------------------------------------------------------------
- # ● ゲージの描画
- #--------------------------------------------------------------------------
- def gauge_rect_at(width, height, align3,
- color1, color2, color3, color4, color5, color6, color7,
- color8, color9, color10, color11, color12, grade1, grade2)
- # 枠描画
- @at_gauge = Bitmap.new(width, height * 5)
- @at_gauge.fill_rect(0, 0, width, height, color1)
- @at_gauge.fill_rect(1, 1, width - 2, height - 2, color2)
- if (align3 == 1 and grade1 == 0) or grade1 > 0
- color = color3
- color3 = color4
- color4 = color
- end
- if (align3 == 1 and grade2 == 0) or grade2 > 0
- color = color5
- color5 = color6
- color6 = color
- color = color7
- color7 = color8
- color8 = color
- color = color9
- color9 = color10
- color10 = color
- color = color11
- color11 = color12
- color12 = color
- end
- if align3 == 0
- if grade1 == 2
- grade1 = 3
- end
- if grade2 == 2
- grade2 = 3
- end
- end
- # 空ゲージの描画 縦にグラデーション表示
- @at_gauge.gradation_rect(2, 2, width - 4, height - 4,
- color3, color4, grade1)
- # 実ゲージの描画
- @at_gauge.gradation_rect(2, height + 2, width- 4, height - 4,
- color5, color6, grade2)
- @at_gauge.gradation_rect(2, height * 2 + 2, width- 4, height - 4,
- color7, color8, grade2)
- @at_gauge.gradation_rect(2, height * 3 + 2, width- 4, height - 4,
- color9, color10, grade2)
- @at_gauge.gradation_rect(2, height * 4 + 2, width- 4, height - 4,
- color11, color12, grade2)
- end
- end
复制代码
系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~ |
|