赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 2 |
经验 | 0 |
最后登录 | 2018-8-26 |
在线时间 | 26 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 152
- 在线时间
- 26 小时
- 注册时间
- 2018-7-26
- 帖子
- 11
|
1星屑
本帖最后由 show9999 于 2018-7-28 01:45 编辑
使用了版上先辈分享的 SBS 3.4d + ATB 1.2c95%汉化版
然后再加上国外网站分享的 Resolução 640x480 para for RMVX
进入战斗画面后出现
然后到脚本看内容是
# ATBアクター更新
if member.actor? && member.at_active && !@command_members.include?(member) && member.movable? && !member.action.forcing <-这行出问题
# Mithran 1.1h added && !member.action.forcing
# this flag prevents the command window from being reopened to this character
return start_auto_action(member) if member.auto_action?
return @command_members.push(member)
# ATBエネミー更新
elsif !member.actor? && member.at_active && !@command_members.include?(member) && member.movable?
return start_auto_action(member) unless member.action.forcing
end
end
end
请问怪物位置错误还是分辨率错误呢 ? 搞半天还是没看懂 ..
请版上各位前辈帮忙指教一下 感谢 (m.o.m)
- #==============================================================================
- # ■ Scene_Battle for ATB Ver1.2c
- #------------------------------------------------------------------------------
- # バトル画面の処理を行うクラスです。
- #==============================================================================
- class Scene_Battle < Scene_Base
- #--------------------------------------------------------------------------
- # ● 开始処理
- #--------------------------------------------------------------------------
- alias start_n02 start
- def start
- $gauge_stop = true
- $game_party.atb_customize
- start_n02
- end
- #--------------------------------------------------------------------------
- # ● 终了処理
- #--------------------------------------------------------------------------
- alias terminate_n02 terminate # Enu code; 1.1e
- def terminate
- terminate_n02
- # 二刀流の持ち替え処理を戻す
- for member in $game_party.members
- if member.two_swords_change
- member.change_equip_by_id(1, member.weapon_id)
- member.change_equip_by_id(0, 0)
- member.two_swords_change = false
- end
- member.clear_sprite_effects
- end
- end
- #--------------------------------------------------------------------------
- # ● 戦闘开始の処理
- #--------------------------------------------------------------------------
- alias process_battle_start_n02 process_battle_start
- def process_battle_start
- @end_member = 0
- preemptive if $game_troop.preemptive
- surprise if $game_troop.surprise
- @status_window.visible = true
- process_battle_start_n02
- @status_window.refresh
- $gauge_stop = false
- end
- #--------------------------------------------------------------------------
- # ● 先制処理
- #--------------------------------------------------------------------------
- def preemptive
- $game_troop.preemptive = false
- for member in $game_party.members + $game_troop.members
- member.at_count = 1000 if member.actor?
- member.at_count = N02::ATB_BACKATTACK * -10 if !member.actor?
- end
- end
- #--------------------------------------------------------------------------
- # ● 不意打ち処理
- #--------------------------------------------------------------------------
- def surprise
- $game_troop.surprise = false
- for member in $game_party.members + $game_troop.members
- member.at_count = N02::ATB_BACKATTACK * -10 if member.actor?
- member.at_count = 1000 if !member.actor?
- end
- end
- #--------------------------------------------------------------------------
- # ● 情报表示ビューポートの解放
- #--------------------------------------------------------------------------
- alias dispose_info_viewport_n02 dispose_info_viewport
- def dispose_info_viewport
- dispose_info_viewport_n02
- @cursor.dispose if @cursor != nil && [email protected]?
- @help_window.dispose if @help_window != nil && !@help_window.disposed?
- @help_window = nil
- @help_window2.dispose if @help_window2 != nil && !@help_window2.disposed?
- @help_window2 = nil
- @skill_window.dispose if @skill_window != nil && !@skill_window.disposed?
- @skill_window = nil
- @item_window.dispose if @item_window != nil && !@item_window.disposed?
- @item_window = nil # 1.1b
- end
- #--------------------------------------------------------------------------
- # ● フレーム更新 ※再定义
- #--------------------------------------------------------------------------
- def update
- super
- update_basic(true)
- # plays out party escape; 1.1e
- do_party_escape if @escape && $game_party.inputable? unless @judge
- unless $game_message.visible # メッセージ表示中以外
- return if judge_win_loss if @judge == nil # 胜败判定
- update_scene_change
- end
- end
- #--------------------------------------------------------------------------
- # ● Update Basic
- # frame update, runs the show
- # 1.1h - added a method to process the next common event, if necessary
- #--------------------------------------------------------------------------
- def update_basic(main = false)
- Graphics.update unless main # ゲーム画面を更新
- Input.update unless main # 入力情报を更新
- $game_system.update # タイマーを更新
- $game_troop.update # 敌グループを更新
- @spriteset.update # スプライトセットを更新
- @message_window.update # メッセージウィンドウを更新
- update_info_viewport if !$gauge_stop # 情报表示ビューポートを更新
- # カーソル更新
- @cursor.update if @cursor != nil && @cursor.visible
- # メッセージ表示中はこれ以降処理させない
- if $game_message.visible
- @spriteset.gauge_off
- @info_viewport.visible = false
- return @message_window.visible = true
- end
- return if $gauge_stop
- # 戦闘中断、シーン切り替えの际これ以降は処理させない
- return if @judge
- return if $game_temp.next_scene != nil
- # ATBを更新
- process_battle_event if $game_temp.common_event_id > 0 # run skill common event if necessary
- update_atb
- # ターゲット更新
- update_target if @target_members != nil
- # コマンド入力フェイズ
- start_actor_command_selection if @command_members.size != 0 && !@command_phase
- if @skill_window != nil
- update_skill_selection # スキル选択
- elsif @item_window != nil
- update_item_selection # アイテム选択
- elsif @party_command_window.visible && @party_command_window.active
- update_party_command_selection # パーティコマンド选択
- elsif @actor_command_window.active
- update_actor_command_selection # アクターコマンド选択
- end
- end
- #--------------------------------------------------------------------------
- # ● ATB Update
- # checks and see if any battler is ready to move into the command phase
- # if there is a forcing battler present, put them into action
- # if there is a battler ready to act, put them into action
- #--------------------------------------------------------------------------
- def update_atb
- prepare_forcing_atb # Mithran Force Action fix 1.1e
- if !@forcing_battlers.empty?
- if @active_battler == nil
- set_next_active_battler
- return
- end
- end # end Mithran Force Action fix 1.1e
- for member in $game_party.members + $game_troop.members
- # ACT更新
- # return start_main(member) if member.act_active && !@action_battlers.include?(member) && !member.union_battler && !member.action.forcing
- # 3.4a
- return set_next_action_battlers(member) if member.act_active && !@action_battlers.include?(member) && !member.union_battler && !member.action.forcing
- # ATBアクター更新
- if member.actor? && member.at_active && !@command_members.include?(member) && member.movable? && !member.action.forcing
- # Mithran 1.1h added && !member.action.forcing
- # this flag prevents the command window from being reopened to this character
- return start_auto_action(member) if member.auto_action?
- return @command_members.push(member)
- # ATBエネミー更新
- elsif !member.actor? && member.at_active && !@command_members.include?(member) && member.movable?
- return start_auto_action(member) unless member.action.forcing
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● Set Next Action Battlers *New method 3.4a
- # Was start_main(member) but now has own method name rather than using
- # an existing one (it is only used in one other method)
- #--------------------------------------------------------------------------
- def set_next_action_battlers(member)
- return if @judge
- @message_window.clear
- @action_battlers.push(member) # edited
- @status_window.refresh
- member.charge_start = false
- # アクティブバトラーがいなければ次の行动者をセット
- set_next_active_battler if @active_battler == nil
- end
- #--------------------------------------------------------------------------
- # ● 自动行动开始
- #--------------------------------------------------------------------------
- def start_auto_action(member)
- return if @judge
- # 戦闘行动の作成
- member.make_action if member.union_skill_id == 0
- # チャージ设定
- act_type = charge_set(member)
- # 复数回行动の作成
- member.act_time = member.action_time[0] if !member.actor?
- # 行动ゲージに切り替え
- @spriteset.change_act(act_type, member.actor?, member.index)
- # チャージアクション
- make_charge_action(member)
- end
- #--------------------------------------------------------------------------
- # ++ Charge Set
- #--------------------------------------------------------------------------
- def charge_set(member)
- act_type = member.charge
- # 通常攻撃(二刀のチャージ时间は双方武器の平均)
- if member.actor? && member.action.attack? && member.weapon_id != 0
- act_type = member.weapons[0].charge if member.weapons[0] != nil
- act_type2 = member.weapons[1].charge if member.weapons[1] != nil
- act_type[1] = (act_type[1] + act_type2[1]) / 2 if act_type2 != nil
- elsif member.action.attack?
- act_type = $data_weapons[member.weapon_id].charge if member.actor? && member.weapon_id != 0
- act_type = $data_weapons[member.weapon].charge if !member.actor? && member.weapon != 0
- end
- act_type = $data_skills[member.action.skill_id].charge if member.action.skill?
- act_type = $data_items[member.action.item_id].charge if member.action.item?
- # チャージボーナス加算
- if member.actor?
- act_type[1] += $data_weapons[member.weapon_id].charge_bonus if member.weapon_id != 0
- for i in 0...member.armors.size
- act_type[1] += member.armors[i].charge_bonus if member.armors[i] != nil
- end
- end
- # 1.2c
- for i in 0...member.states.size
- act_type[1] += member.states[i].charge_bonus if member.states[i] != nil
- end
- return act_type
- end
- #--------------------------------------------------------------------------
- # ● 戦闘行动者の准备 ※再定义 Original
- #--------------------------------------------------------------------------
- # def start_main(member)
- # return if @judge
- # @message_window.clear
- # @action_battlers.push(member)
- # @status_window.refresh
- # member.charge_start = false
- # アクティブバトラーがいなければ次の行动者をセット
- # set_next_active_battler if @active_battler == nil
- # end
- #--------------------------------------------------------------------------
- # ● Start Main *Rewrite
- #--------------------------------------------------------------------------
- def start_main
- # 3.4a
- # Contents from the old start_main(members) has been moved to
- # set_next_action_battlers(member). This gets rid of the new argument
- # tacked on to start_main.
- # The original contents of start_main have moved to other methods.
- end
- #--------------------------------------------------------------------------
- # ● ヘルプウインドウの表示 ※再定义
- #--------------------------------------------------------------------------
- def pop_help(obj)
- return if @help_window == nil && obj.extension.include?("HELPHIDE")
- return @help_window.visible = false if obj.extension.include?("HELPHIDE")
- return if @skill_window != nil && @skill_window.visible
- return if @item_window != nil && @item_window.visible
- @help_window = Window_Help.new if @help_window == nil
- @help_window.set_text(obj.name, 1)
- @help_window.visible = true
- end
- #--------------------------------------------------------------------------
- # ● チャージアクション作成
- #--------------------------------------------------------------------------
- def make_charge_action(member)
- action = ""
- case member.action.kind
- when 0
- if member.actor?
- action = member.charge[3] if member.weapon_id == 0
- action = $data_weapons[member.weapon_id].charge[3] if member.weapon_id != 0
- else
- action = member.charge[3] if member.weapon == 0
- action = $data_weapons[member.weapon].charge[3] if member.weapon != 0
- end
- when 1;action = member.action.skill.charge[3]
- when 2;action = member.action.item.charge[3]
- end
- member.charge_action = action
- return if action == ""
- member.charge_start = true
- @spriteset.set_action(member.actor?, member.index, member.charge_action)
- end
- #--------------------------------------------------------------------------
- # ● アクション実行中 ※再定义
- #--------------------------------------------------------------------------
- def playing_action
- loop do
- break if @judge
- update_basic
- # アクティブバトラーに格纳されているアクション情报を见る
- action = @active_battler.play
- next if action == 0
- @active_battler.play = 0
- if action[0] == "Individual"
- individual
- elsif action == "Can Collapse"
- unimmortaling
- elsif action == "Cancel Action"
- break action_end
- elsif action == "End"
- break action_end
- elsif action[0] == "OBJ_ANIM"
- damage_action(action[1])
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 戦闘アクション実行
- #--------------------------------------------------------------------------
- def process_action
- # 合体攻撃処理
- union_possibility?
- process_union_skill if @active_battler.union_skill_id != 0
- return set_next_active_battler if @active_battler.union_battler
- # 暴走混乱処理
- @active_battler.action.prepare unless @active_battler.action.forcing
- # 戦闘行动开始
- $in_action = true
- @message_window.clear
- @active_battler.white_flash = true
- # ヘルプウインドウ表示
- help_on
- # 戦闘アクション実行
- execute_action if @active_battler.action.valid? && @active_battler.restriction < 4
- # ヘルプウインドウ隠蔽
- help_off
- # 强制行动などでバトラーが空になったら次の行动者へ
- return set_next_active_battler if @active_battler == nil
- # HP Slip Damage; 1.1i moved, CrimsonSeas fix
- hp_slip_damage(@active_battler) if N02::ATB_SLIP_DAMAGE == 0
- # MP Slip Damage
- mp_slip_damage(@active_battler) if N02::ATB_SLIP_DAMAGE == 0
- # 戦闘アクション终了
- @message_window.clear
- @active_battler.white_flash = false
- $in_action = false
- @spriteset.gauge_update
- # 合体攻撃终了処理
- end_union_skill if @active_battler.union_skill_id != 0
- # スキル派生がある场合、行动続行
- # return set_next_active_battler if @active_battler.derivation != 0 && !@forcing_battler # Derivation fix, 1.1e
- # エネミーの复数回行动
- return set_next_active_battler if enemy_order
- # 戦闘行动终了
- turn_end(@active_battler)
- # 次の行动者へ
- @action_battlers.delete(@active_battler)
- set_next_active_battler
- end
- #--------------------------------------------------------------------------
- # ● ヘルプウインドウ表示
- #--------------------------------------------------------------------------
- def help_on
- @help_window = Window_Help.new if @help_window == nil
- @help_window.visible = false
- return @help_window.visible = true if @skill_window != nil && @skill_window.visible
- return @help_window.visible = true if @item_window != nil && @item_window.visible
- return @help_window.visible = true if @active_battler.action.guard?
- return @help_window.visible = true if @active_battler.action.kind == 0 && @active_battler.action.basic == 2
- end
- #--------------------------------------------------------------------------
- # ● ヘルプウインドウ隠蔽
- #--------------------------------------------------------------------------
- def help_off
- return if @help_window == nil
- return @help_window.visible = true if @skill_window != nil && @skill_window.visible
- return @help_window.visible = true if @item_window != nil && @item_window.visible
- @help_window.visible = false
- end
- #--------------------------------------------------------------------------
- # ● アクション终了 ※再定义
- #--------------------------------------------------------------------------
- def action_end
- # 初期化
- @individual_target = nil
- @active_battler.active = false
- @active_battler.clear_action_results
- # 念のため不死身化解除
- unimmortaling
- # 反射されていた场合
- if @active_battler.reflex != nil
- if @active_battler.action.skill?
- obj = @active_battler.action.skill
- @active_battler.perfect_skill_effect(@active_battler, obj)
- elsif @active_battler.action.item?
- obj = @active_battler.action.item
- @active_battler.item_effect(@active_battler, obj)
- else
- @active_battler.perfect_attack_effect(@active_battler)
- end
- pop_damage(@active_battler, obj, @active_battler.reflex)
- @active_battler.perform_collapse
- @active_battler.reflex = nil
- wait(N01::COLLAPSE_WAIT)
- end
- # 逆吸収で戦闘不能になった场合
- if @absorb_dead
- @active_battler.perform_collapse
- @absorb_dead = false
- wait(N01::COLLAPSE_WAIT)
- end
- # 次の行动までウエイトを挟む
- wait(N01::ACTION_WAIT)
- end
- #--------------------------------------------------------------------------
- # ● 合体攻撃判定
- #--------------------------------------------------------------------------
- def union_skill?(member)
- # スキルに合体攻撃设定があるかチェック
- for union_action in member.action.skill.union_action
- union_skills = union_action if union_action.size != 0 && union_action.include?(member.action.skill_id)
- end
- return if union_skills == nil
- @partners = []
- @union_targets = union_target_decision(member, member.action.skill)
- @union_target_index = member.action.target_index
- # 合体攻撃メンバーが使用可能かチェック
- for skill_id in union_skills
- for actor in $game_party.members
- if actor.skill_can_use?($data_skills[skill_id]) && actor.skill_id_learn?(skill_id)
- @partners.push(actor)
- actor.union_skill_id = skill_id
- end
- end
- end
- # 合体攻撃使用不可
- if @partners.size != union_skills.size
- for actor in @partners do actor.union_skill_id = 0 end
- @partners = nil
- member.action.clear if !member.action.guard?
- return
- end
- # 合体攻撃使用可
- for actor in @partners
- # パートナーアクション决定
- actor.action.kind = 1
- actor.action.skill_id = actor.union_skill_id
- actor.action.target_index = member.action.target_index
- # コマンド强制キャンセル
- if @command_members.include?(actor)
- force_action_command_cansel(actor)
- start_auto_action(member)
- end
- end
- $in_union_action = true
- @union_size = 0
- end
- #--------------------------------------------------------------------------
- # ● 合体攻撃可能か
- #--------------------------------------------------------------------------
- def union_possibility?
- return if @partners == nil
- for member in @partners
- union_cansel = true unless member.inputable?
- end
- return if !union_cansel
- end_union_skill
- @active_battler.action.clear if !@active_battler.action.guard?
- end
- #--------------------------------------------------------------------------
- # ● 合体攻撃ターゲット决定
- #--------------------------------------------------------------------------
- def union_target_decision(member, obj)
- targets = member.action.make_targets
- # デフォルトの复数回攻撃が设定されていれば単体ターゲットに変换
- targets = [targets[0]] if obj.for_two? or obj.for_three? or obj.dual?
- # ランダムターゲットの场合、一体を选択しランダム范囲を保持
- if obj.extension.include?("RANDOMTARGET")
- randum_targets = targets.dup
- targets = [randum_targets[rand(randum_targets.size)]]
- end
- # ターゲット情报をバトラースプライトに送る
- @spriteset.set_target(member.actor?, member.index, targets)
- return targets
- end
- #--------------------------------------------------------------------------
- # ● 合体攻撃処理
- #--------------------------------------------------------------------------
- def process_union_skill
- @union_size += 1
- if @union_size != @partners.size
- return @active_battler.union_battler = true
- end
- # 合体攻撃スタート
- @action_battlers.delete(@active_battler)
- @active_battler.active = false
- @active_battler = @partners.shift
- @active_battler.act_active = true
- @active_battler.active = true
- @active_battler.union_battler = false
- @active_battler.action.kind = 1
- @active_battler.action.skill_id = @active_battler.union_skill_id
- @active_battler.action.target_index = @union_target_index
- for member in @partners
- member.action.kind = 1
- member.action.skill_id = member.union_skill_id
- member.action.target_index = @union_target_index
- member.mp -= member.calc_mp_cost($data_skills[member.action.skill_id]) if member != @active_battler # 3.4a
- member.force_target = ["N01target_change", @union_targets]
- @spriteset.update_target(true, member.index)
- # アクション実行
- @spriteset.set_action(true, member.index, member.action.skill.base_action)
- end
- @status_window.refresh # 3.4a
- end
- #--------------------------------------------------------------------------
- # ● 合体攻撃终了処理
- #--------------------------------------------------------------------------
- def end_union_skill
- @active_battler.union_skill_id = 0
- @active_battler.union_battler = false
- for member in @partners
- member.union_skill_id = 0
- member.union_battler = false
- member.action.clear
- @action_battlers.delete(member)
- turn_end(member)
- end
- @union_size = 0
- @partners = nil
- $in_union_action = false
- end
- #--------------------------------------------------------------------------
- # ● エネミーの行动回数作成
- #--------------------------------------------------------------------------
- def enemy_order
- return false if @active_battler.actor?
- return false if @active_battler.act_time == 0 or !@active_battler.action.valid?
- return true if rand(100) < @active_battler.action_time[1]
- end
- #--------------------------------------------------------------------------
- # ● Batter Turn End
- # clears action and resets the ATB gauge
- # runs 'end of turn' events as in the setup section
- #--------------------------------------------------------------------------
- def turn_end(member) # rewrite, ATB 1.1h
- member = @active_battler
- forced = member.action.forcing
- member.action.forcing = false # remove forcing flag no matter what
- t_index = member.action.target_index
- $in_action = false
- # アクション终了时のATBゲージ设定
- # If you get an error on this line, it means you need to update your
- # ATB Configurations script to the latest version.
- if !forced || (N02::FORCE_ACTION_CONSUME_GAUGE && forced)
- recharge_action(member)
- elsif member.act_active && !N02::FORCE_ACTION_CONSUME_GAUGE
- @spriteset.gauge_refill(member.actor?, member.index)
- end
- member.action.clear if !member.action.guard?
- member.action.target_index = t_index # perserves target index through action clear
- # needed for 'last target' to work in force action
- process_battle_event
- # ターン経过カウント
- @end_member += 1 if !forced || (N02::FORCE_ACTION_INCREASE_TURN && forced)
- passage = true if N02::ATB_TURN_COUNT == 2
- if @end_member >= $game_party.members.size + $game_troop.members.size
- passage = true if N02::ATB_TURN_COUNT == 0
- passage = true if N02::ATB_TURN_COUNT == 1 && @end_member == 2
- elsif @end_member == ($game_party.members.size + $game_troop.members.size) / 2
- passage = true if N02::ATB_TURN_COUNT == 1
- end
- # スリップダメージ
- if @slip_all_damage
- for battlers in $game_party.members + $game_troop.members do mp_slip_damage(battlers) end
- @slip_all_damage = false
- @slip_all_damaged = true
- end
- return if !passage
- # スリップダメージ
- if N02::ATB_SLIP_DAMAGE == 1 && !@slip_all_damaged
- for battlers in $game_party.members + $game_troop.members do hp_slip_damage(battlers) end
- @slip_all_damage = true
- end
- @slip_all_damaged = false
- @end_member = 0
- $game_troop.increase_turn
- $game_troop.turn_ending = true
- process_battle_event # Mithran 1.1h - correct place for processing battle event
- # otherwise, 'turn ending' events will not work
- $game_troop.turn_ending = false
- @status_window.refresh
- end
- #--------------------------------------------------------------------------
- # ● アクション终了时のATBゲージ设定
- #--------------------------------------------------------------------------
- def recharge_action(member)
- member.act_count = 0
- recharge = member.recharge
- # 通常攻撃(二刀のチャージ时间は双方武器の平均)
- if member.actor? && member.action.attack?
- recharge = member.weapons[0].recharge if member.weapons[0] != nil
- recharge2 = member.weapons[1].recharge if member.weapons[1] != nil
- recharge = (recharge + recharge2) / 2 if recharge2 != nil
- elsif member.action.attack?
- act_type = $data_weapons[member.weapon].charge if member.weapon != 0
- end
- recharge = $data_skills[member.action.skill_id].recharge if member.action.skill?
- recharge = $data_items[member.action.item_id].recharge if member.action.item?
- recharge = N02::ATB_GUARD_RESET if member.action.guard?
- # ATBゲージに切り替え
- @spriteset.change_atb(10 * recharge, member.actor?, member.index)
- @spriteset.gauge_refresh(member.actor?, member.index)
- end
- #--------------------------------------------------------------------------
- # ● Set Next Active Battler
- # sets the next battler to perform an action
- # those that are 'forcing' an action will 'cut in line'
- #--------------------------------------------------------------------------
- def set_next_active_battler # Redefined 1.1e; Mithran's Force Action/escape fix
- @forcing_battlers ||= []
- return if $game_party.all_dead? or $game_troop.all_dead?
- do_party_escape if @escape && $game_party.inputable? unless @judge # plays out party escape; 1.1e
- # 全员の不死身化解除(イベント等で不死身设定がされていれば除く)
- prepare_forcing_atb
- # エネミー复数回行动时
- @action_battlers.shift if @active_battler != nil && !@active_battler.actor? && @active_battler.act_time != 0
- loop do
- if !@forcing_battlers.empty? # Force Action fix 1.1f
- potential = @forcing_battlers.shift
- if potential.action.valid?
- @action_battlers.delete(potential)
- force_action_cleanup(potential)
- @active_battler = potential
- else
- potential.action.clear
- end # Force Action fix 1.1f end
- else
- @active_battler = @action_battlers.shift
- end
- @active_battler.action.clear if @active_battler != nil && @active_battler.dead?
- return if @active_battler == nil
- # 戦闘行动开始
- return process_action if @active_battler.index != nil
- end
- end
- #--------------------------------------------------------------------------
- # ● Process Battle Event
- #--------------------------------------------------------------------------
- def process_battle_event # Redefined 1.1e
- @forcing_battlers ||= []
- members_size = $game_party.members.size
- loop do
- return if judge_win_loss
- return if $game_temp.next_scene != nil
- $game_troop.interpreter.update
- $game_troop.setup_battle_event
- @message_window.update
- if $game_message.visible
- @message_window.visible = true
- @status_window.visible = false
- end
- wait_for_message
- @message_window.visible = false
- @status_window.visible = true
- reset_atb_actor if members_size != $game_party.members.size
- prepare_forcing_atb
- return unless $game_troop.interpreter.running?
- update_basic
- end
- end
- #--------------------------------------------------------------------------
- # ● Prepare Force Action for ATB
- #--------------------------------------------------------------------------
- def prepare_forcing_atb # New method 1.1e; Mithran's Force Action fix
- # changed in 1.1h
- @forcing_battlers ||= []
- if $game_troop.forcing_battler != nil
- member = $game_troop.forcing_battler
- $game_troop.forcing_battler = nil
- force_action_cleanup(member)
- @action_battlers.delete(member)
- @forcing_battlers.delete(member)
- # delete duplicates from the list
- @forcing_battlers.push(member)
- end
- end
- #--------------------------------------------------------------------------
- # ● Force Action Cleanup
- # cleans up all open targeting/selection window, if necessary, in preparation
- # for a force action
- #--------------------------------------------------------------------------
- def force_action_cleanup(member) # new method 1.1h
- return if member.nil?
- if @commander == member
- @message_window.visible = false
- @party_command_window.active = false
- @party_command_window.visible = false
- $in_command = $in_select = $in_target = $in_party_command = false
- @target_members = nil
- @actor_command_window.active = false
- @cursor.visible = false unless $game_party.all_dead? or $game_troop.all_dead?
- @command_phase = false
- target_select_cleanup # new method 1.1h
- end_skill_selection
- end_item_selection
- @party_command_window.active = @actor_command_window.active = false
- @actor_command_window_on = false
- @status_window.index = @actor_index = @actor_command_window.index = -1
- @command_members.delete(@commander)
- @commander = nil
- @actor_command_window.active = false
- @command_members.delete(member)
- @commander = nil
- end
- end
- #--------------------------------------------------------------------------
- # ● Target Select Cleanup
- # removes visible portion of target selection and unsets the global flag
- #--------------------------------------------------------------------------
- def target_select_cleanup # new method 1.1h
- $in_target = false
- @help_window2.dispose if @help_window2 != nil
- @help_window2 = nil
- @help_window.visible = false if @help_window != nil
- @target_members = nil
- end
- #--------------------------------------------------------------------------
- # ● battle_end(result) alias
- #--------------------------------------------------------------------------
- alias battle_end_forcefix battle_end # Force Action fix 1.1e
- def battle_end(result)
- @forcing_battlers = []
- battle_end_forcefix(result)
- end
- #--------------------------------------------------------------------------
- # ● 全员の不死身化解除
- #--------------------------------------------------------------------------
- def member_unimmortaling # Redefined, 1.1e
- for member in $game_party.members + $game_troop.members # all battlers
- next if member.non_dead # stop if they are truly immortal
- next if member.dead? # stop if they are already dead
- member.set_temp_immortal(false) # make them not immortal
- end
- end
- #--------------------------------------------------------------------------
- # ● HPスリップダメージ
- #--------------------------------------------------------------------------
- def hp_slip_damage(member)
- member.clear_action_results
- return if !member.exist?
- member.slip_damage = false
- damage = 0
- # 0ターン解除のステートがあるかチェック
- for state in member.states
- member.remove_state(state.id) if state.extension.include?("ZEROTURNLIFT")
- # スリップダメージ実行 state = [ 対象, 定数, 割合, POP, 戦闘不能许可]
- next unless state.slip_damage #state.extension.include?("SLIPDAMAGE")
- for ext in state.slip_extension
- if ext[0] == "hp"
- base_damage = ext[1] + member.maxhp * ext[2] / 100
- damage += base_damage + base_damage * (rand(5) - rand(5)) / 100
- slip_pop = ext[3] unless ext[3] == nil # 3.4a
- slip_dead = ext[4] unless ext[4] == nil # 3.4a
- slip_damage_flug = true
- member.slip_damage = true
- end
- end
- end
- # デフォルトのスリップダメージ
- # if member.slip_damage? && member.exist? && !slip_damage_flug
- # damage += member.apply_variance(member.maxhp / 10, 10)
- # slip_dead = false
- # slip_pop = true
- # slip_damage_flug = true
- # member.slip_damage = true
- # end
- # 防具の自动回复があるか
- if member.actor? && member.auto_hp_recover && member.exist?
- damage -= member.maxhp / 20
- slip_pop = true
- end
- # 戦闘不能不许可
- damage = member.hp - 1 if damage >= member.hp && slip_dead = false
- member.hp -= damage
- @spriteset.set_damage_pop(member.actor?, member.index, damage) if slip_pop
- member.perform_collapse if member.dead? && member.slip_damage
- member.clear_action_results
- @status_window.refresh
- end
- #--------------------------------------------------------------------------
- # ● MPスリップダメージ
- #--------------------------------------------------------------------------
- def mp_slip_damage(member)
- member.clear_action_results
- return if !member.exist? or member.states.size == 0
- member.slip_damage = false
- mp_damage = 0
- for state in member.states
- next unless state.slip_damage #state.extension.include?("SLIPDAMAGE")
- for ext in state.slip_extension
- if ext[0] == "mp"
- base_damage = ext[1] + member.maxmp * ext[2] / 100
- mp_damage += base_damage + base_damage * (rand(5) - rand(5)) / 100
- slip_pop = ext[2]
- slip_damage_flug = true
- end
- end
- end
- member.mp_damage = mp_damage
- member.mp -= mp_damage
- @spriteset.set_damage_pop(member.actor?, member.index, mp_damage) if slip_pop
- member.clear_action_results
- @status_window.refresh
- end
- #--------------------------------------------------------------------------
- # ● 戦闘行动の実行 : 防御 ※再定义
- #--------------------------------------------------------------------------
- def execute_action_guard
- @help_window.set_text(N01::GUARD_HELP_TEXT, 1)
- @help_window.visible = true
- # バトラーのアクティブ化を解除
- @active_battler.active = false
- wait(45)
- @help_window.visible = false if @help_window != nil
- end
- #--------------------------------------------------------------------------
- # ● 戦闘行动の実行 : 逃走 ※再定义
- #--------------------------------------------------------------------------
- def execute_action_escape
- @spriteset.set_action(false, @active_battler.index, @active_battler.run_success)
- @help_window.set_text(N01::ESCAPED_HELP_TEXT, 1)
- @help_window.visible = true
- # バトラーのアクティブ化を解除
- @active_battler.active = false
- @active_battler.escape
- Sound.play_escape
- wait(45)
- @help_window.visible = false if @help_window != nil
- end
- #--------------------------------------------------------------------------
- # ● パーティコマンド选択の开始 ※再定义
- #--------------------------------------------------------------------------
- def start_party_command_selection
- @info_viewport.visible = true
- @status_window.index = @actor_index = -1
- end
- #--------------------------------------------------------------------------
- # ● 次のアクターのコマンド入力へ ※再定义
- #--------------------------------------------------------------------------
- def next_actor
- end
- #--------------------------------------------------------------------------
- # ● 前のアクターのコマンド入力へ ※再定义
- #--------------------------------------------------------------------------
- def prior_actor
- end
- #--------------------------------------------------------------------------
- # ● アクターコマンド选択の开始 ※再定义
- #--------------------------------------------------------------------------
- def start_actor_command_selection
- $in_command = true
- @command_phase = true
- @command_member_index = 0
- @commander = @command_members[@command_member_index]
- @status_window.active = true
- @status_window.index = @commander.index
- # カーソルセット
- @cursor = Sprite_Cursor.new if @cursor == nil
- @cursor.set(@commander)
- # 动けるキャラのみコマンドアクションを
- @spriteset.set_action(true, @commander.index,@commander.command_b) if @commander.inputable?
- @party_command_window.active = false
- @actor_command_window.setup(@commander)
- @actor_command_window.active = true
- @actor_command_window.index = 0
- @actor_command_window_on = true
- @status_window.refresh
- end
- #--------------------------------------------------------------------------
- # ● コマンド更新 ※再定义
- #--------------------------------------------------------------------------
- def update_actor_command_selection
- # コマンド入力できる状态でなくなればキャンセル
- return reset_command unless commanding?
- if Input.trigger?(Input::B)
- Input.update
- Sound.play_decision
- start_party_command
- elsif Input.trigger?(Input::C)
- Input.update
- case @actor_command_window.index
- when 0 # 攻撃
- Sound.play_decision
- @commander.action.set_attack
- start_target_enemy_selection
- when 1 # スキル
- Sound.play_decision
- $in_select = true
- start_skill_selection
- when 2 # 防御
- Sound.play_decision
- @commander.action.set_guard
- end_command
- when 3 # アイテム
- Sound.play_decision
- $in_select = true
- start_item_selection
- end
- # →キーでコマンドキャラ送り
- elsif Input.trigger?(Input::RIGHT)
- next_commander
- # ←キーでコマンドキャラ戻し
- elsif Input.trigger?(Input::LEFT)
- back_commander
- end
- end
- #--------------------------------------------------------------------------
- # ● コマンド入力できる状态か
- #--------------------------------------------------------------------------
- def commanding?
- return false if @judge or $gauge_stop
- return false if @commander != nil && [email protected]?
- return false if @commander != nil && @commander.union_skill_id != 0
- return false if @commander != nil && @commander.at_count < 1000
- return true
- end
- #--------------------------------------------------------------------------
- # ● コマンドキャラ送り
- #--------------------------------------------------------------------------
- def next_commander
- return if @command_members.size == 1 or @commander == nil
- Audio.se_play("Audio/SE/" + N02::NEXT_SOUND01[2], N02::NEXT_SOUND01[1], N02::NEXT_SOUND01[0])
- # 动けるキャラのみコマンド戻りアクションを
- @spriteset.set_action(true, @commander.index,@commander.command_a) if @commander.inputable?
- # コマンド待ちメンバーのインデックスが最后なら
- if @command_member_index == @command_members.size - 1
- @command_member_index = 0
- # 次のキャラにコマンドを送る
- else
- @command_member_index += 1
- end
- @commander = @command_members[@command_member_index]
- @status_window.index = @commander.index
- @actor_command_window.setup(@commander) # 1.1c
- # カーソルセット
- @cursor.set(@commander)
- # 动けるキャラのみコマンドアクションを
- @spriteset.set_action(true, @commander.index,@commander.command_b) if @commander.inputable?
- end
- #--------------------------------------------------------------------------
- # ● コマンドキャラ戻し
- #--------------------------------------------------------------------------
- def back_commander
- return if @command_members.size == 1 or @commander == nil
- Audio.se_play("Audio/SE/" + N02::NEXT_SOUND01[2], N02::NEXT_SOUND01[1], N02::NEXT_SOUND01[0])
- # 动けるキャラのみコマンド戻りアクションを
- @spriteset.set_action(true, @commander.index,@commander.command_a) if @commander.inputable?
- # コマンド待ちメンバーのインデックスが最初なら
- if @command_member_index == 0
- @command_member_index = @command_members.size - 1
- # 前のキャラにコマンドを送る
- else
- @command_member_index -= 1
- end
- @commander = @command_members[@command_member_index]
- @status_window.index = @commander.index
- # カーソルセット
- @cursor.set(@commander)
- # 动けるキャラのみコマンドアクションを
- @spriteset.set_action(true, @commander.index,@commander.command_b) if @commander.inputable?
- end
- #--------------------------------------------------------------------------
- # ● パーティコマンド选択の开始
- #--------------------------------------------------------------------------
- def start_party_command
- $in_party_command = true
- $in_command = false
- @status_window.refresh
- @status_window.index = @actor_index = -1
- @info_viewport.visible = true
- @message_window.visible = false
- @pre_a_index = @actor_command_window.index
- @actor_command_window.active = false
- @actor_command_window.index = -1
- @party_command_window.active = true
- @party_command_window.index = 0
- @party_command_window.visible = true
- end
- #--------------------------------------------------------------------------
- # ● パーティコマンド选択の更新
- #--------------------------------------------------------------------------
- def update_party_command_selection
- # コマンド入力できる状态でなくなればキャンセル
- return reset_command unless commanding?
- if Input.trigger?(Input::C)
- case @party_command_window.index
- when 0 # 戦う
- Sound.play_decision
- @status_window.index = @actor_index = -1
- end_party_command
- when 1 # 逃げる
- return Sound.play_buzzer if $game_troop.can_escape == false
- Sound.play_decision
- end_party_command
- process_escape if !@escape
- end
- elsif Input.trigger?(Input::B)
- Sound.play_cancel
- end_party_command
- end
- end
- #--------------------------------------------------------------------------
- # ● パーティコマンド选択の终了
- #--------------------------------------------------------------------------
- def end_party_command
- $in_party_command = false
- $in_command = true
- @status_window.refresh
- @message_window.visible = false
- @party_command_window.active = false
- @actor_command_window.active = true
- @party_command_window.visible = false
- @actor_command_window.index = @pre_a_index
- @status_window.index = @commander.index
- @status_window.active = true
- end
- #--------------------------------------------------------------------------
- # ● 逃走の処理 ※再定义
- #--------------------------------------------------------------------------
- def process_escape # redefined by Mithran
- # escape processing method - trimmed to almost nothing
- @escape = true # sets the escape flag for later use
- closed_window # closes all windows
- end
- #--------------------------------------------------------------------------
- # ● do_party_escape
- #--------------------------------------------------------------------------
- def do_party_escape # new method 1.1e, contains most of the old content
- # of the prior escape method
- # it has been largely reordered to play out more naturally given its current
- # position in the code
- reset_atb_actor # sets the atb of all actors to zero
- if $game_troop.preemptive
- success = true
- else
- success = (rand(100) < @escape_ratio)
- end
- for actor in $game_party.members
- if !actor.non_dead
- actor.set_temp_immortal(false) # technically, line is not reached while the non_dead flag is set
- if actor.hp == 0 and not actor.state?(1)
- actor.add_state(1)
- actor.added_states.push(1)
- end
- end
- # unimmortal all battlers, kill them if necessary
- end
- if $game_party.all_dead? # if everyone is dead, end the battle with defeat
- @escape = false
- @judge = true
- process_defeat
- battle_end(2)
- return true
- end
- for actor in $game_party.members # perform run animation
- unless actor.restriction >= 4
- @spriteset.set_action(true, actor.index, success ? actor.run_success : actor.run_ng )
- end
- end
- @info_viewport.visible = false # hide the info viewport
- @message_window.visible = true # show the message window
- text = sprintf(Vocab::EscapeStart, $game_party.name) # format the escape text
- $game_message.texts.push(text) # add it to the $game_message, so the message window grabs it next update
- Sound.play_escape #play escape sound
- if !success
- $game_message.texts.push('\.' + Vocab::EscapeFailure)
- # add fail message if necessary
- end
- wait_for_message # wait for message
- if success
- @judge = true # cut battle short - it seems this flag is used to indicate that the battle is over
- # and as such, no further actions will be performed
- battle_end(1) # end battle with escape
- return true # cut short the calling method
- else
- @escape_ratio += 10 # add 10 to the escape ratio
- $game_party.clear_actions # clear all actions
- @info_viewport.visible = true # make the party display viewport again visible
- @escape = false # unset the escape flag
- for member in $game_party.members
- member.clear_sprite_effects # clear all sprite effects
- end
- return false # the calling method continues as normal
- end
- end
- #--------------------------------------------------------------------------
- # ● アクターのATBを初期化
- #--------------------------------------------------------------------------
- def reset_atb_actor
- @command_members = []
- @commander = nil
- $in_action = @command_phase = false
- $in_command = $in_target = $in_select = false
- @message_window.clear
- for member in $game_party.members
- @action_battlers.delete(member)
- member.white_flash = false
- member.action.clear
- # ATBゲージに切り替え
- @spriteset.change_atb(N02::ATB_RUN_NG * -10, member.actor?, member.index)
- end
- end
- #--------------------------------------------------------------------------
- # ● 开いているウインドウを闭じる
- #--------------------------------------------------------------------------
- def closed_window
- @cursor.dispose if @cursor != nil
- @cursor = nil
- @help_window.dispose if @help_window != nil
- @help_window = nil
- @help_window2.dispose if @help_window2 != nil
- @help_window2 = nil
- @skill_window.dispose if @skill_window != nil
- @skill_window = nil
- @item_window.dispose if @item_window != nil
- @item_window = nil
- @actor_command_window_on = false if @actor_command_window != nil
- @actor_command_window.active = false if @actor_command_window != nil
- @party_command_window.visible = false if @party_command_window != nil
- @party_command_window.active = false if @party_command_window != nil
- @status_window.index = @actor_index = @actor_command_window.index = -1
- end
- #--------------------------------------------------------------------------
- # ● ターゲット选択の开始 ※再定义
- #--------------------------------------------------------------------------
- def start_target_selection(actor = false)
- $in_target = true
- $in_command = $in_select = false
- @target_actors = actor
- @target_members = $game_party.members if @target_actors
- @target_members = $game_troop.members unless @target_actors
- # 不要なウインドウを消す
- @actor_command_window.active = false
- @skill_window.visible = false if @skill_window != nil
- @item_window.visible = false if @item_window != nil
- # 存在しているターゲットで最も番号の低い対象を最初に指すように
- @index = 0
- @max_index = @target_members.size - 1
- # アクターは戦闘不能者でもターゲットできるようにエネミーと区别
- unless @target_actors
- @target_members.size.times do
- break if @target_members[@index].exist?
- @index += 1
- end
- end
- # カーソルセット
- @cursor.set(@target_members[@index])
- @help_window.visible = false if @help_window != nil
- @help_window2 = Window_Help.new if @help_window2 == nil
- @help_window2.set_text_n01add(@target_members[@index])
- end
- #--------------------------------------------------------------------------
- # ● ターゲット选択更新 ※再定义
- #--------------------------------------------------------------------------
- def update_target
- # コマンド入力できる状态でなくなればキャンセル
- return reset_command unless commanding?
- return end_target_selection(cansel = true) if $game_troop.all_dead?
- cursor_down if !@target_members[@index].actor? && !@target_members[@index].exist?
- if Input.trigger?(Input::B)
- Input.update
- Sound.play_cancel
- end_target_selection(cansel = true)
- elsif Input.trigger?(Input::C)
- Input.update
- Sound.play_decision
- @commander.action.target_index = @index
- end_target_selection
- end_skill_selection
- end_item_selection
- @actor_command_window.active = false
- next_actor
- end
- if Input.repeat?(Input::LEFT)
- if @target_actors
- cursor_down if $back_attack
- cursor_up unless $back_attack
- else
- cursor_up if $back_attack
- cursor_down unless $back_attack
- end
- end
- if Input.repeat?(Input::RIGHT)
- if @target_actors
- cursor_up if $back_attack
- cursor_down unless $back_attack
- else
- cursor_down if $back_attack
- cursor_up unless $back_attack
- end
- end
- cursor_up if Input.repeat?(Input::UP)
- cursor_down if Input.repeat?(Input::DOWN)
- end
- #--------------------------------------------------------------------------
- # ● カーソルを前に移动 ※再定义
- #--------------------------------------------------------------------------
- def cursor_up
- Sound.play_cursor
- @target_members.size.times do
- @index += @target_members.size - 1
- @index %= @target_members.size
- break if @target_actors
- break if @target_members[@index].exist?
- end
- # カーソルセット
- @cursor.set(@target_members[@index])
- @help_window2.set_text_n01add(@target_members[@index]) if @help_window2 != nil
- end
- #--------------------------------------------------------------------------
- # ● カーソルを次に移动 ※再定义
- #--------------------------------------------------------------------------
- def cursor_down
- Sound.play_cursor
- @target_members.size.times do
- @index += 1
- @index %= @target_members.size
- break if @target_actors
- break if @target_members[@index].exist?
- end
- # カーソルセット
- @cursor.set(@target_members[@index])
- @help_window2.set_text_n01add(@target_members[@index]) if @help_window2 != nil
- end
- #--------------------------------------------------------------------------
- # ● ターゲット选択の终了 再定义
- #--------------------------------------------------------------------------
- def end_target_selection(cansel = false)
- $in_target = false
- @help_window2.dispose if @help_window2 != nil
- @help_window2 = nil
- @help_window.visible = false if @help_window != nil
- if @skill_window != nil
- @skill_window.visible = @skill_window.active = true
- @help_window.visible = true if @help_window != nil
- @actor_command_window.active = false if cansel
- $in_select = true if cansel
- elsif @item_window != nil
- @item_window.visible = @item_window.active = true
- @help_window.visible = true if @help_window != nil
- @actor_command_window.active = false if cansel
- $in_select = true if cansel
- end
- @target_members = nil
- end_command if !cansel
- # カーソルセット
- @cursor.set(@commander) if cansel
- $in_command = true if cansel && @actor_command_window.index == 0
- @actor_command_window.active = true if cansel && @actor_command_window.index == 0
- end
- #--------------------------------------------------------------------------
- # ● コマンド初期化
- #--------------------------------------------------------------------------
- def reset_command
- @message_window.visible = false
- @party_command_window.active = false
- @commander.action.clear
- @party_command_window.visible = false
- $in_command = $in_select = $in_target = false
- @target_members = nil
- @actor_command_window.active = false
- @cursor.visible = false unless $game_party.all_dead? or $game_troop.all_dead? # bug fix 1.1b
- @command_phase = false
- end_skill_selection
- end_item_selection
- @party_command_window.active = @actor_command_window.active = false
- @actor_command_window_on = false
- @status_window.index = @actor_index = @actor_command_window.index = -1
- @command_members.delete(@commander)
- @commander = nil
- end
- #--------------------------------------------------------------------------
- # ● 强制行动によるコマンドキャンセル
- #--------------------------------------------------------------------------
- def force_action_command_cansel(member)
- return if !member.inputable?
- # Force Action fix 1.1e
- end_target_selection if @commander == member # 1.1f
- return if member.nil?
- @pre_a_index ||= 0
- end_party_command if @commander == member
- # end Force Action fix 1.1e
- # チャージ设定
- act_type = charge_set(member)
- # 行动ゲージに切り替え
- @spriteset.change_act(act_type, member.actor?, member.index)
- # 动けるキャラのみコマンド戻りアクションを
- @spriteset.set_action(true, member.index,member.command_a) if member.actor? && member.inputable?
- # チャージアクション
- make_charge_action(member)
- # 以下の処理はコマンド入力中のアクター限定
- return if !member.actor? or @commander != member
- # カーソル消去
- @cursor.visible = false
- @command_phase = false
- # ウインドウ初期化
- end_skill_selection
- end_item_selection
- $in_target = false
- @help_window2.dispose if @help_window2 != nil
- @help_window2 = nil
- @help_window.visible = false if @help_window != nil
- @party_command_window.active = @actor_command_window.active = false
- @actor_command_window_on = false
- @status_window.index = @actor_index = @actor_command_window.index = -1
- @command_members.delete(member)
- @commander = nil
- @message_window.visible = false
- @party_command_window.active = false
- @party_command_window.visible = false
- $in_command = $in_select = $in_target = false
- end
- #--------------------------------------------------------------------------
- # ● コマンド入力终了
- #--------------------------------------------------------------------------
- def end_command
- return if [email protected]?
- $in_command = false
- $in_select = false
- # カーソル消去
- @cursor.visible = false if @cursor.visible != nil # 1.2a
- @command_phase = false
- # アクション実行时间チェック
- act_type = charge_set(@commander)
- # 行动ゲージに切り替え
- @spriteset.change_act(act_type, true, @commander.index)
- # 动けるキャラのみコマンド戻りアクションを
- @spriteset.set_action(true, @commander.index,@commander.command_a) if @commander.inputable?
- # チャージアクション
- make_charge_action(@commander)
- # 合体攻撃チェック
- union_skill?(@commander) if @commander.action.skill? && @partners == nil
- # ウインドウ初期化
- @party_command_window.active = @actor_command_window.active = false
- @actor_command_window_on = false
- @status_window.index = @actor_index = @actor_command_window.index = -1
- @command_members.delete(@commander)
- @commander = nil
- end
- #--------------------------------------------------------------------------
- # ● 情报表示ビューポートの作成 ※再定义
- #--------------------------------------------------------------------------
- def create_info_viewport
- @command_members = []
- @action_battlers = []
- @info_viewport = Viewport.new(0, 288, 544, 128)
- @info_viewport.z = 100
- @status_window = Window_BattleStatus.new
- @party_command_window = Window_PartyCommand2.new
- @actor_command_window = Window_ActorCommand.new
- @status_window.viewport = @info_viewport
- @actor_command_window.viewport = @info_viewport
- @status_window.x = 128
- @actor_command_window.x = 672
- @info_viewport.visible = false
- @party_command_window.visible = false
- @info_viewport.ox = 128
- end
- #--------------------------------------------------------------------------
- # ● 情报表示ビューポートの更新 ※再定义
- #--------------------------------------------------------------------------
- def update_info_viewport
- @party_command_window.update if @party_command_window.active
- @actor_command_window.update if @actor_command_window.active
- @status_window.update if @status_window.active
- @message_window.visible = false if !$game_message.visible
- @info_viewport.visible = true if !@message_window.visible
- @actor_command_window.x += 32 if @actor_command_window.x < 672 && !@actor_command_window_on
- @actor_command_window.x -= 32 if @actor_command_window.x > 544 && @actor_command_window_on
- end
- #--------------------------------------------------------------------------
- # ● スキル选択の开始 ※再定义
- #--------------------------------------------------------------------------
- def start_skill_selection
- @help_window = Window_Help.new if @help_window == nil
- @help_window.visible = true
- @skill_window = Window_Skill.new(0, 56, 544, 232, @commander)
- @skill_window.z = 1000
- @skill_window.help_window = @help_window
- @actor_command_window.active = false
- end
- #--------------------------------------------------------------------------
- # ● スキル选択の更新 ※再定义
- #--------------------------------------------------------------------------
- def update_skill_selection
- # コマンド入力できる状态でなくなればキャンセル
- return reset_command unless commanding?
- @skill_window.active = true
- @skill_window.update
- @help_window.update
- if Input.trigger?(Input::B)
- Sound.play_cancel
- end_skill_selection
- $in_command = true
- elsif Input.trigger?(Input::C)
- @skill = @skill_window.skill
- if @skill != nil
- @commander.last_skill_id = @skill.id
- end
- if @commander.skill_can_use?(@skill)
- return Sound.play_buzzer if @commander.union_skill?(@skill.id) && [email protected]_skill_can_use?(@skill.id)
- Sound.play_decision
- determine_skill
- else
- Sound.play_buzzer
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● スキルの决定 ※再定义
- #--------------------------------------------------------------------------
- def determine_skill
- @commander.action.set_skill(@skill.id)
- @skill_window.active = false
- if @skill.need_selection?
- if @skill.for_opponent?
- start_target_enemy_selection
- else
- start_target_actor_selection
- end
- else
- end_skill_selection
- end_target_selection
- end
- end
- #--------------------------------------------------------------------------
- # ● スキル选択の终了
- #--------------------------------------------------------------------------
- alias end_skill_selection_n01 end_skill_selection
- def end_skill_selection
- end_skill_selection_n01
- $in_select = false
- end
- #--------------------------------------------------------------------------
- # ● アイテム选択の开始 ※再定义
- #--------------------------------------------------------------------------
- def start_item_selection
- @help_window = Window_Help.new if @help_window == nil
- @help_window.visible = true
- @item_window = Window_Item.new(0, 56, 544, 232)
- @item_window.z = 1000
- @item_window.help_window = @help_window
- @actor_command_window.active = false
- end
- #--------------------------------------------------------------------------
- # ● アイテム选択の更新 ※再定义
- #--------------------------------------------------------------------------
- def update_item_selection
- # コマンド入力できる状态でなくなればキャンセル
- return reset_command unless commanding?
- @item_window.active = true
- @item_window.update
- @help_window.update
- if Input.trigger?(Input::B)
- Sound.play_cancel
- end_item_selection
- $in_command = true # 1.1b
- elsif Input.trigger?(Input::C)
- @item = @item_window.item
- if @item != nil
- $game_party.last_item_id = @item.id
- end
- if $game_party.item_can_use?(@item)
- Sound.play_decision
- determine_item
- else
- Sound.play_buzzer
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● アイテムの决定 ※再定义
- #--------------------------------------------------------------------------
- def determine_item
- @commander.action.set_item(@item.id)
- @item_window.active = false
- if @item.need_selection?
- if @item.for_opponent?
- start_target_enemy_selection
- else
- start_target_actor_selection
- end
- else
- end_item_selection
- end_target_selection
- end
- end
- #--------------------------------------------------------------------------
- # ● アイテム选択の终了
- #--------------------------------------------------------------------------
- alias end_item_selection_n01 end_item_selection
- def end_item_selection
- end_item_selection_n01
- $in_select = false
- end
- #--------------------------------------------------------------------------
- # ● 胜败判定 ※再定义
- #--------------------------------------------------------------------------
- def judge_win_loss
- return true unless $game_temp.in_battle
- if $game_party.all_dead?
- @judge = true
- $gauge_stop = true
- closed_window
- @spriteset.atb_dispose
- $game_troop.clear_actions
- $game_party.clear_actions
- process_defeat
- return true
- elsif $game_troop.all_dead?
- @judge = true
- $gauge_stop = true
- closed_window
- @spriteset.atb_dispose
- $game_troop.clear_actions
- $game_party.clear_actions
- process_victory
- return true
- else
- return false
- end
- end
- end
复制代码
这是版上前辈分享的SBS 3.4d + ATB 1.2c汉化版 156行的地方出现问题
- #==============================================================================
- # * Resolução 640X480 para VX[resolução XP]
- #------------------------------------------------------------------------------
- # Résolution 640x480 (pour RPG Maker VX) par Krazplay
- # Version 1.0 (23/01/2008)
- # Dernière version, commentaires : http://rpgmaker/forum/index.php?topic=12460
- #------------------------------------------------------------------------------
- # Ce script ne fait pas que changer la résolution, il modifie pas mal de choses
- # pour que le jeu soit adapté à sa nouvelle résolution.
- # Sachant que ce script redéfinit pas mal de méthodes, il est vivement conseillé
- # de le placer au-dessus de vos autres scripts ajoutés (mais en-dessous de ceux
- # de base, à part Main évidemment)
- #
- # Résolution de base : 544x416 (17x13 cases de 32 pixels)
- # Nouvelle résolution : 640x480 (20x15 cases de 32 pixels)
- # On gagne donc 96x64 pixels
- #------------------------------------------------------------------------------
- # Toutes les méthodes modifiées :
- #
- # ? Game_Map : calc_parallax_x, calc_parallax_y, setup_scroll,
- # scroll_down, scroll_right
- # ? Game_Player : center
- # ? Sprite_Base : start_animation
- # ? Sprite_Timer : initialize
- # ? Spriteset_Map : create_viewports
- # ? Spriteset_Battle : create_viewports, create_enemies, create_battleback,
- # create_battlefloor
- # ? Window_Help, Window_SkillStatus, Window_Equip : initialize
- # ? Window_Status, Window_SaveFile, Window_NumberInput : initialize
- # ? Window_ShopBuy, Window_ShopStatus : initialize
- # ? Window_MenuStatus : initialize, refresh, update_cursor
- # ? Window_Message : initialize, reset_window
- # ? Scene_Title : create_title_graphic, create_command_window
- # ? Scene_Menu : start
- # ? Scene_Item : start, show_target_window, hide_target_window
- # ? Scene_Skill : start, show_target_window, hide_target_window
- # ? Scene_Equip : create_item_windows
- # ? Scene_End : create_command_window
- # ? Scene_Shop : start
- # ? Scene_Battle : create_info_viewport, start_skill_selection,
- # start_item_selection
- #==============================================================================
- # Agrandir les images Title.png et BattleFloor.png si elles sont trop petites.
- AGRANDIR_IMAGES = true
- Graphics.resize_screen(640, 480)
- #==============================================================================
- # ¦ Game_Objects
- #==============================================================================
- # ? Game_Map #
- class Game_Map
- def calc_parallax_x(bitmap)
- if bitmap == nil
- return 0
- elsif @parallax_loop_x
- return @parallax_x / 16
- elsif loop_horizontal?
- return 0
- else
- w1 = bitmap.width - 640
- w2 = @map.width * 32 - 640
- if w1 <= 0 or w2 <= 0
- return 0
- else
- return @parallax_x * w1 / w2 / 8
- end
- end
- end
- def calc_parallax_y(bitmap)
- if bitmap == nil
- return 0
- elsif @parallax_loop_y
- return @parallax_y / 16
- elsif loop_vertical?
- return 0
- else
- h1 = bitmap.height - 480
- h2 = @map.height * 32 - 480
- if h1 <= 0 or h2 <= 0
- return 0
- else
- return @parallax_y * h1 / h2 / 8
- end
- end
- end
- def setup_scroll
- @scroll_direction = 2
- @scroll_rest = 0
- @scroll_speed = 4
- @margin_x = (width - 20) * 256 / 2 # ? / 2
- @margin_y = (height - 15) * 256 / 2 # ? / 2
- end
- def scroll_down(distance)
- if loop_vertical?
- @display_y += distance
- @display_y %= @map.height * 256
- @parallax_y += distance
- else
- last_y = @display_y
- @display_y = [@display_y + distance, (height - 15) * 256].min
- @parallax_y += @display_y - last_y
- end
- end
- def scroll_right(distance)
- if loop_horizontal?
- @display_x += distance
- @display_x %= @map.width * 256
- @parallax_x += distance
- else
- last_x = @display_x
- @display_x = [@display_x + distance, (width - 20) * 256].min
- @parallax_x += @display_x - last_x
- end
- end
- end
- # ? Game_Player #
- class Game_Player < Game_Character
- CENTER_X = (640 / 2 - 16) * 8 # ? X ? * 8
- CENTER_Y = (480 / 2 - 16) * 8 # ? Y ? * 8
- def center(x, y)
- display_x = x * 256 - CENTER_X # ?
- unless $game_map.loop_horizontal? # ?
- max_x = ($game_map.width - 20) * 256 # ?
- display_x = [0, [display_x, max_x].min].max # ?
- end
- display_y = y * 256 - CENTER_Y # ?
- unless $game_map.loop_vertical? # ?
- max_y = ($game_map.height - 15) * 256 # ?
- display_y = [0, [display_y, max_y].min].max # ?
- end
- $game_map.set_display_pos(display_x, display_y) # ?
- end
- end
- #==============================================================================
- # ¦ Sprites
- #==============================================================================
- # ? Sprite_Base #
- class Sprite_Base < Sprite
- def start_animation(animation, mirror = false)
- dispose_animation
- @animation = animation
- return if @animation == nil
- @animation_mirror = mirror
- @animation_duration = @animation.frame_max * 4 + 1
- load_animation_bitmap
- @animation_sprites = []
- if @animation.position != 3 or not @@animations.include?(animation)
- if @use_sprite
- for i in 0..15
- sprite = ::Sprite.new(viewport)
- sprite.visible = false
- @animation_sprites.push(sprite)
- end
- unless @@animations.include?(animation)
- @@animations.push(animation)
- end
- end
- end
- if @animation.position == 3
- if viewport == nil
- @animation_ox = 640 / 2
- @animation_oy = 480 / 2
- else
- @animation_ox = viewport.rect.width / 2
- @animation_oy = viewport.rect.height / 2
- end
- else
- @animation_ox = x - ox + width / 2
- @animation_oy = y - oy + height / 2
- if @animation.position == 0
- @animation_oy -= height / 2
- elsif @animation.position == 2
- @animation_oy += height / 2
- end
- end
- end
- end
- # ? Sprite_Timer #
- class Sprite_Timer < Sprite
- def initialize(viewport)
- super(viewport)
- self.bitmap = Bitmap.new(88, 48)
- self.bitmap.font.name = "Arial"
- self.bitmap.font.size = 32
- self.x = 640 - self.bitmap.width
- self.y = 0
- self.z = 200
- update
- end
- end
- # ? Spriteset_Map #
- class Spriteset_Map
- def create_viewports
- @viewport1 = Viewport.new(0, 0, 640, 480)
- @viewport2 = Viewport.new(0, 0, 640, 480)
- @viewport3 = Viewport.new(0, 0, 640, 480)
- @viewport2.z = 50
- @viewport3.z = 100
- end
- end
- # ? Spriteset_Battle #
- class Spriteset_Battle
- def create_viewports
- @viewport1 = Viewport.new(0, 0, 640, 480)
- @viewport2 = Viewport.new(0, 0, 640, 480)
- @viewport3 = Viewport.new(0, 0, 640, 480)
- @viewport2.z = 50
- @viewport3.z = 100
- end
- def create_enemies
- @enemy_sprites = []
- for enemy in $game_troop.members.reverse
- enemy.screen_x += 48 # Recentrage des ennemis
- @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
- end
- end
- def create_battleback
- source = $game_temp.background_bitmap
- bitmap = Bitmap.new(640+96, 480+64)
- bitmap.stretch_blt(bitmap.rect, source, source.rect)
- bitmap.radial_blur(90, 12)
- @battleback_sprite = Sprite.new(@viewport1)
- @battleback_sprite.bitmap = bitmap
- @battleback_sprite.ox = 320+48
- @battleback_sprite.oy = 240+32
- @battleback_sprite.x = 320 #272
- @battleback_sprite.y = 208 #176
- @battleback_sprite.wave_amp = 8
- @battleback_sprite.wave_length = 240
- @battleback_sprite.wave_speed = 120
- end
- def create_battlefloor
- @battlefloor_sprite = Sprite.new(@viewport1)
- battle_floor = Cache.system("BattleFloor")
- if AGRANDIR_IMAGES and battle_floor.width < 640
- rect_dest = Rect.new(0, 0, 640, battle_floor.height)
- new_bitmap = Bitmap.new(640, battle_floor.height)
- new_bitmap.stretch_blt(rect_dest, battle_floor, battle_floor.rect)
- @battlefloor_sprite.bitmap = new_bitmap
- else
- @battlefloor_sprite.bitmap = battle_floor
- end
- @battlefloor_sprite.x = 0
- @battlefloor_sprite.y = 192
- @battlefloor_sprite.z = 1
- @battlefloor_sprite.opacity = 128
- end
- end
- #==============================================================================
- # ¦ Windows
- #==============================================================================
- # ? Window_Help #
- class Window_Help < Window_Base
- def initialize
- super(0, 0, 640, WLH + 32)
- end
- end
- # ? Window_MenuStatus #
- class Window_MenuStatus < Window_Selectable
- def initialize(x, y)
- super(x, y, 480, 480)
- refresh
- self.active = false
- self.index = -1
- end
- def refresh
- self.contents.clear
- @item_max = $game_party.members.size
- for actor in $game_party.members
- draw_actor_face(actor, 2, actor.index * (96+21) + 2, 92)
- x = 104
- y = actor.index * (96+21) + 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, 216)
- draw_actor_mp(actor, x + 120, y + WLH * 2, 216)
- end
- end
- def update_cursor
- if @index < 0 # ?
- self.cursor_rect.empty
- elsif @index < @item_max # ?
- self.cursor_rect.set(0, @index * (96+21), 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_SkillStatus #
- class Window_SkillStatus < Window_Base
- def initialize(x, y, actor)
- super(x, y, 640, WLH + 32)
- @actor = actor
- refresh
- end
- end
- # ? Window_Equip #
- class Window_Equip < Window_Selectable
- def initialize(x, y, actor)
- super(x, y, 336+96, WLH * 5 + 32)
- @actor = actor
- refresh
- self.index = 0
- end
- end
- # ? Window_Status #
- class Window_Status < Window_Base
- def initialize(actor)
- super(0, 0, 640, 480)
- @actor = actor
- refresh
- end
- end
- # ? Window_SaveFile #
- class Window_SaveFile < Window_Base
- def initialize(file_index, filename)
- super(0, 56 + file_index % 4 * (90+21), 640, 90)
- @file_index = file_index
- @filename = filename
- load_gamedata
- refresh
- @selected = false
- end
- end
- # ? Window_NumberInput #
- class Window_NumberInput < Window_Base
- def initialize
- super(0, 0, 640, 64)
- @number = 0
- @digits_max = 6
- @index = 0
- self.opacity = 0
- self.active = false
- self.z += 9999
- refresh
- update_cursor
- end
- end
- # ? Window_ShopBuy #
- class Window_ShopBuy < Window_Selectable
- def initialize(x, y)
- super(x, y, 304+96, 304+64)
- @shop_goods = $game_temp.shop_goods
- refresh
- self.index = 0
- end
- end
- # ? Window_ShopStatus #
- class Window_ShopStatus < Window_Base
- def initialize(x, y)
- super(x, y, 240, 304+64)
- @item = nil
- refresh
- end
- end
- # ? Window_Message #
- class Window_Message < Window_Selectable
- def initialize
- super(0, 352, 640, 128)
- self.z = 200
- self.active = false
- self.index = -1
- self.openness = 0
- @opening = false # ?
- @closing = false # ?
- @text = nil # ?
- @contents_x = 0 # ? X ?
- @contents_y = 0 # ? Y ?
- @line_count = 0 # ?
- @wait_count = 0 # ?
- @background = 0 # ?
- @position = 2 # ?
- @show_fast = false # ?
- @line_show_fast = false # ?
- @pause_skip = false # ?
- create_gold_window
- create_number_input_window
- create_back_sprite
- end
- def reset_window
- @background = $game_message.background
- @position = $game_message.position
- if @background == 0 # ?
- self.opacity = 255
- else # ?
- self.opacity = 0
- end
- case @position
- when 0 # ?
- self.y = 0
- @gold_window.y = 360
- when 1 # ?
- self.y = 208
- @gold_window.y = 0
- when 2 # ?
- self.y = 352
- @gold_window.y = 0
- end
- end
- end
- #==============================================================================
- # ¦ Scenes
- #==============================================================================
- # ? Scene_Title #
- class Scene_Title
- def create_title_graphic
- @sprite = Sprite.new
- cache_bitmap = Cache.system("Title")
- if AGRANDIR_IMAGES
- dest_rect = Rect.new(0, 0, Graphics.width, Graphics.height)
- bitmap = Bitmap.new(Graphics.width, Graphics.height)
- bitmap.stretch_blt(dest_rect, cache_bitmap, cache_bitmap.rect)
- @sprite.bitmap = bitmap
- else
- @sprite.bitmap = cache_bitmap
- end
- end
- def create_command_window
- s1 = Vocab::new_game
- s2 = Vocab::continue
- s3 = Vocab::shutdown
- @command_window = Window_Command.new(172, [s1, s2, s3])
- @command_window.x = (640 - @command_window.width) / 2
- @command_window.y = 288
- if @continue_enabled # ?
- @command_window.index = 1 # ?
- else # ?
- @command_window.draw_item(1, false) # ?
- end
- @command_window.openness = 0
- @command_window.open
- end
- end
- # ? Scene_Menu #
- class Scene_Menu < Scene_Base
- def start
- super
- create_menu_background
- create_command_window
- @gold_window = Window_Gold.new(0, 424)
- @status_window = Window_MenuStatus.new(160, 0)
- end
- end
- # ? Scene_Item #
- class Scene_Item < Scene_Base
- def start
- super
- create_menu_background
- @viewport = Viewport.new(0, 0, 640, 480)
- @help_window = Window_Help.new
- @help_window.viewport = @viewport
- @item_window = Window_Item.new(0, 56, 640, 424)
- @item_window.viewport = @viewport
- @item_window.help_window = @help_window
- @item_window.active = false
- @target_window = Window_MenuStatus.new(0, 0)
- hide_target_window
- end
- def show_target_window(right)
- @item_window.active = false
- width_remain = 640 - @target_window.width
- @target_window.x = right ? width_remain : 0
- @target_window.visible = true
- @target_window.active = true
- if right
- @viewport.rect.set(0, 0, width_remain, 480)
- @viewport.ox = 0
- else
- @viewport.rect.set(@target_window.width, 0, width_remain, 480)
- @viewport.ox = @target_window.width
- end
- end
- def hide_target_window
- @item_window.active = true
- @target_window.visible = false
- @target_window.active = false
- @viewport.rect.set(0, 0, 640, 480)
- @viewport.ox = 0
- end
- end
- # ? Scene_Skill #
- class Scene_Skill < Scene_Base
- def start
- super
- create_menu_background
- @actor = $game_party.members[@actor_index]
- @viewport = Viewport.new(0, 0, 640, 480)
- @help_window = Window_Help.new
- @help_window.viewport = @viewport
- @status_window = Window_SkillStatus.new(0, 56, @actor)
- @status_window.viewport = @viewport
- @skill_window = Window_Skill.new(0, 112, 640, 368, @actor)
- @skill_window.viewport = @viewport
- @skill_window.help_window = @help_window
- @target_window = Window_MenuStatus.new(0, 0)
- hide_target_window
- end
- def show_target_window(right)
- @skill_window.active = false
- width_remain = 640 - @target_window.width
- @target_window.x = right ? width_remain : 0
- @target_window.visible = true
- @target_window.active = true
- if right
- @viewport.rect.set(0, 0, width_remain, 480)
- @viewport.ox = 0
- else
- @viewport.rect.set(@target_window.width, 0, width_remain, 480)
- @viewport.ox = @target_window.width
- end
- end
- def hide_target_window
- @skill_window.active = true
- @target_window.visible = false
- @target_window.active = false
- @viewport.rect.set(0, 0, 640, 480)
- @viewport.ox = 0
- end
- end
- # ? Scene_Equip #
- class Scene_Equip < Scene_Base
- def create_item_windows
- @item_windows = []
- for i in 0...EQUIP_TYPE_MAX
- @item_windows[i] = Window_EquipItem.new(0, 208, 640, 272, @actor, i)
- @item_windows[i].help_window = @help_window
- @item_windows[i].visible = (@equip_index == i)
- @item_windows[i].active = false
- @item_windows[i].index = -1
- end
- end
- end
- # ? Scene_End #
- class Scene_End < Scene_Base
- def create_command_window
- s1 = Vocab::to_title
- s2 = Vocab::shutdown
- s3 = Vocab::cancel
- @command_window = Window_Command.new(172, [s1, s2, s3])
- @command_window.x = (640 - @command_window.width) / 2
- @command_window.y = (480 - @command_window.height) / 2
- @command_window.openness = 0
- end
- end
- # ? Scene_Shop #
- class Scene_Shop < Scene_Base
- def start
- super
- create_menu_background
- create_command_window
- @help_window = Window_Help.new
- @gold_window = Window_Gold.new(384+96, 56)
- @dummy_window = Window_Base.new(0, 112, 640, 368)
- @buy_window = Window_ShopBuy.new(0, 112)
- @buy_window.active = false
- @buy_window.visible = false
- @buy_window.help_window = @help_window
- @sell_window = Window_ShopSell.new(0, 112, 640, 368)
- @sell_window.active = false
- @sell_window.visible = false
- @sell_window.help_window = @help_window
- @number_window = Window_ShopNumber.new(0, 112)
- @number_window.active = false
- @number_window.visible = false
- @status_window = Window_ShopStatus.new(400, 112)
- @status_window.visible = false
- end
- end
- # ? Scene_Battle #
- class Scene_Battle < Scene_Base
- def create_info_viewport
- @info_viewport = Viewport.new(0, 288+64, 640, 128)
- @info_viewport.z = 100
- @status_window = Window_BattleStatus.new
- @party_command_window = Window_PartyCommand.new
- @actor_command_window = Window_ActorCommand.new
- @status_window.viewport = @info_viewport
- @party_command_window.viewport = @info_viewport
- @actor_command_window.viewport = @info_viewport
- @status_window.x = 128
- @actor_command_window.x = 544
- @info_viewport.visible = false
- end
- def start_skill_selection
- @help_window = Window_Help.new
- @skill_window = Window_Skill.new(0, 56, 640, 296, @active_battler)
- @skill_window.help_window = @help_window
- @actor_command_window.active = false
- end
- def start_item_selection
- @help_window = Window_Help.new
- @item_window = Window_Item.new(0, 56, 640, 296)
- @item_window.help_window = @help_window
- @actor_command_window.active = false
- end
- end
复制代码
然后这是国外网站找到的544x416换640x480
里面内容都没动过 请大侠指点
|
最佳答案
查看完整内容
嗯,目测大概是因为分辨率扩展的脚本内的619行重新定义了 create_info_viewport 覆盖了ATB里的定义,导致@command_members 未定义。
把那一段的定义替换如下试试?或者把分辨率扩展脚本的位置扔到ATB的上面。
|