=end
module RPG
class Weapon
#--------------------------------------------------------------------------
# ● 遠距離アニメーション
#--------------------------------------------------------------------------
def flying_anime
# ID 指定 の例(武器的id,分类是根据飞行武器的动画id)
case @id
when 34 #回旋武器(类似回力镖)的id
return [103,32,true,true]
when 5,18,19,20 #远程武器1(弓箭类)的id
return [101,32,false,false]
when 21,22,23,24 #远程武器2(铳类)的id
return [102,32,false,false]
end
return [0,0,false,false]
end
end
class Skill
#--------------------------------------------------------------------------
# ● 遠距離アニメーション
#--------------------------------------------------------------------------
def flying_anime
# ID 指定 の例(技能的id,分类是根据飞行武器的动画id)
case @id
when 82 #回旋技能(类似回力镖)的id
return [103,32,true,true]
when 123,74,75,76 #远程技能1(弓箭类)的id
return [101,32,true,true]
when 77,78,79,80 #远程技能2(铳类)的id
return [102,32,false,false]
end
return [0,0,false,false]
end
end
class Item
#--------------------------------------------------------------------------
# ● 遠距離アニメーション
#--------------------------------------------------------------------------
def flying_anime
case @id
when 34 #抛击类道具(如炸弹一类)的id
return [104,32,false,true]
end
return [0,0,false,false]
end
end
end
class Spriteset_Battle
include Side_view
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias side_veiw_initialize initialize
def initialize
side_veiw_initialize
# アクタースプライトを解放
for sprite in @actor_sprites
sprite.dispose
end
# アクタースプライトを作成
@actor_sprites = []
for i in 1..Party_max
@actor_sprites.push(Sprite_Battler.new(@viewport1))
end
update
end
#--------------------------------------------------------------------------
# ● 画面のスクロール
#--------------------------------------------------------------------------
if method_defined?("screen_scroll")
alias side_view_screen_scroll screen_scroll
def screen_scroll
side_view_screen_scroll
# アクターの位置補正
for actor in $game_party.actors
actor.real_x = @real_x
actor.real_y = @real_y
actor.real_zoom = @real_zoom
end
end
end
end
class Sprite_Battler < RPG::Sprite
include Side_view
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# viewport : ビューポート
# battler : バトラー (Game_Battler)
#--------------------------------------------------------------------------
def initialize(viewport, battler = nil)
super(viewport)
@battler = battler
@battler_visible = false
@weapon = Sprite_Weapon.new(viewport, battler)
@flying = Sprite_Flying.new(viewport, battler)
@shadow = []
@fly = 0
@fly_direction = 1
@rand = rand(10)
self.effect_clear
end
#--------------------------------------------------------------------------
# ● 解放
#--------------------------------------------------------------------------
alias side_view_dispose dispose
def dispose
side_view_dispose
@weapon.dispose
@flying.dispose
if @_target_sprite != nil
@_target_sprite.bitmap.dispose
@_target_sprite.dispose
@_target_sprite = nil
end
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
super
# バトラーが nil の場合
if @battler == nil
self.bitmap = nil
@weapon.bitmap = nil
loop_animation(nil)
return
end
# バトラー更新
@battler.update
# バトラーアニメのデータ取得
@anime_type = @battler.anime_type
# ファイル名か色相が現在のものと異なる場合
if @battler.is_a?(Game_Actor) or ([email protected]_a?(Game_Actor) and [email protected])
change = (@battler.character_name != @battler_name or @battler.character_hue != @battler_hue)
elsif @battler.is_a?(Game_Enemy)
change = (@battler.battler_name != @battler_name or @battler.battler_hue != @battler_hue)
else
return
end
if change
# ビットマップを取得、設定
if @battler.is_a?(Game_Actor) or ([email protected]_a?(Game_Actor) and [email protected])
@battler_name = @battler.character_name
@battler_hue = @battler.character_hue
self.bitmap = RPG::Cache.character(@battler_name, @battler_hue)
@width = bitmap.width / 4
@height = bitmap.height / 4
else
@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
end
self.ox = @width / 2
self.oy = @height / 2
@battler.height = @height
@flag = true
# 戦闘不能または隠れ状態なら不透明度を 0 にする
if @battler.dead? or @battler.hidden
self.opacity = 0
end
end
if (@battler.is_a?(Game_Actor) and
(@battler.anime_type != @anime_type or @battler.pattern != @pattern or @flag)) or
([email protected]_a?(Game_Actor) and [email protected])
# ビットマップを取得、設定
@pattern = @battler.pattern
self.ox = @width / 2
self.oy = @height / 2
@sx = @pattern * @width
sy = @anime_type % 4 * @height
x = sy / (@height * 2) + 4
if [email protected]_a?(Game_Actor) and [email protected] and x == 4
x = 6
end # here!!
@sy = (x - 2) / 2 * @height
self.src_rect.set(@sx, @sy, @width, @height)
self.zoom_x = CHAR_ZOOM
self.zoom_y = CHAR_ZOOM
@battler.height = @height
@flag = false
end
# 飛行
update_fly
# シェイク
update_shake
# 回転
update_turning
# 反転
update_reverse
# 移動
update_moving
# 追加アニメ
update_add_anime
# エフェクト効果の適用
update_effect
# アニメーション ID が現在のものと異なる場合
flag = RTAB ? true : @battler.damage == nil
if flag and @battler.state_animation_id != @state_animation_id
@state_animation_id = @battler.state_animation_id
loop_animation($data_animations[@state_animation_id])
end
# シェイク
if @battler.shake
self.start_shake(5, 5, 5)
@battler.shake = false
end
# 明滅
if @battler.blink
blink_on
else
blink_off
end
# 不可視の場合
unless @battler_visible
flag = RTAB ? (@battler.damage.size < 2 or @battler.damage_pop.size < 2) :
(@battler.damage == nil or @battler.damage_pop)
# 出現
if not @battler.hidden and not @battler.dead? and flag
appear
@battler_visible = true
end
end
if RTAB
# ダメージ
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
end
# 可視の場合
if @battler_visible
# 武器アニメ
@weapon.battler = @battler
@weapon.update
# 遠距離アニメ
@flying.battler = @battler
@flying.update
# 逃走
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
if RTAB
# アニメーション
if [email protected]?
for animation in @battler.animation.reverse
if animation[2]
animation($data_animations[animation[0]], animation[1], true)
else
animation($data_animations[animation[0]], animation[1])
end
@battler.animation.delete(animation)
end
end
else
# アニメーション
if @battler.animation_id != 0
animation = $data_animations[@battler.animation_id]
animation(animation, @battler.animation_hit)
@battler.animation_id = 0
end
end
# ダメージ
if !RTAB and @battler.damage_pop
damage(@battler.damage, @battler.critical)
@battler.damage = nil
@battler.critical = false
@battler.damage_pop = false
end
flag = RTAB ? (@battler.damage.empty? and $scene.dead_ok?(@battler)) :
@battler.damage == nil
# コラプス
if flag and @battler.dead?
if @battler.is_a?(Game_Actor)
$game_system.se_play($data_system.actor_collapse_se)
elsif @battler.is_a?(Game_Enemy)
$game_system.se_play($data_system.enemy_collapse_se)
end
collapse
@battler_visible = false
end
end
# スプライトの座標を設定
self.x = @battler.screen_x + @effect_ox
self.y = @battler.screen_y + @effect_oy
self.z = @battler.screen_z
self.zoom_x = @battler.real_zoom
self.zoom_y = @battler.real_zoom
# ウェイトカウントを減らす
@battler.wait_count -= 1
@battler.wait_count2 -= 1
# アニメーション待ち時間取得
@battler.animation_duration = @_animation_duration
if @battler.is_a?(Game_Actor) or ([email protected]_a?(Game_Actor) and [email protected])
self.zoom_x *= CHAR_ZOOM
self.zoom_y *= CHAR_ZOOM
@weapon.x = self.x + 2
@weapon.y = self.y + 6
@weapon.angle = 75 - (4 - @battler.pattern) * 45
if self.mirror
@weapon.angle += @weapon.angle - 180
end
if ([email protected]_a?(Game_Actor) and [email protected])
@weapon.angle = [email protected]-90
end
end
# 残像
if @battler.shadow
if Graphics.frame_count % 2 == 0
shadow = ::Sprite.new(self.viewport)
shadow.bitmap = self.bitmap.dup
shadow.x = self.x
shadow.y = self.y
shadow.ox = self.ox
shadow.oy = self.oy
shadow.mirror = self.mirror
shadow.angle = self.angle
shadow.opacity = 160
shadow.zoom_x = self.zoom_x
shadow.zoom_y = self.zoom_y
if @battler.is_a?(Game_Actor) or ([email protected]_a?(Game_Actor) and [email protected])
shadow.src_rect.set(@sx, @sy, @width, @height)
else
shadow.src_rect.set(0, 0, @width, @height)
end
@shadow.push([shadow,duration = 10,@battler.true_x + @effect_ox,@battler.true_y + @effect_oy])
end
end
for s in @shadow
if !s[0].disposed?
s[0].update
s[1] -= 1
if s[1] < 1
if s[0].bitmap != nil
s[0].bitmap.dispose
end
s[0].dispose
else
s[0].x = @battler.screen_x(s[2])
s[0].y = @battler.screen_y(s[3])
end
else
s = nil
end
end
@shadow.compact!
end
#--------------------------------------------------------------------------
# ● エフェクトによる座標系の更新
#--------------------------------------------------------------------------
def update_effect
# 角度の修正
if @_upside_down
self.angle = (@_turning + 180) % 360
else
self.angle = @_turning
end
# X 座標の修正値
@effect_ox = @_shake + @_moving[0]
# Y 座標の修正値
@effect_oy = -@fly + @_moving[1]
if @_animation == nil or (RTAB and @_animation.empty?)
self.effect_clear
end
end
#--------------------------------------------------------------------------
# ● シェイク更新
#--------------------------------------------------------------------------
def update_shake
if @_shake_duration >= 1 or @_shake != 0
delta = (@_shake_power * @_shake_speed * @_shake_direction) / 10.0
if @_shake_duration <= 1 and @_shake * (@_shake + delta) < 0
@_shake = 0
else
@_shake += delta
end
if @_shake > @_shake_power * 2
@_shake_direction = -1
end
if @_shake < - @_shake_power * 2
@_shake_direction = 1
end
if @_shake_duration >= 1
@_shake_duration -= 1
end
end
end
#--------------------------------------------------------------------------
# ● 飛行更新
#--------------------------------------------------------------------------
def update_fly
if @rand > 0
@rand -= 1
return
end
if @battler.fly != 0
if @fly < @battler.fly / 4
@fly_direction = 1
elsif @fly > @battler.fly / 2
@fly_direction = -1
end
@fly += 0.5 * @fly_direction
end
end
#--------------------------------------------------------------------------
# ● 回転更新
#--------------------------------------------------------------------------
def update_turning
if @_turning_duration > 0 or @_turning != 0
@_turning += @_turning_direction * @_turning_speed / 2.0
# 残り回転数を減らす
if @_turning_direction == -1
if @_turning_duration > 0 and @_turning < 0
@_turning_duration -= 1
end
elsif @_turning_direction == 1
if @_turning_duration > 0 and @_turning >= 360
@_turning_duration -= 1
end
end
# 以下補正
while @_turning < 0
@_turning += 360
end
if @_turning_duration <= 0
@_turning = 0
end
@_turning %= 360
end
end
#--------------------------------------------------------------------------
# ● 左右反転更新
#--------------------------------------------------------------------------
def update_reverse
if @last_reverse != (@_reverse or @battler.reverse)
self.mirror = (@_reverse or @battler.reverse)
@last_reverse = (@_reverse or @battler.reverse)
end
end
#--------------------------------------------------------------------------
# ● 移動更新
#--------------------------------------------------------------------------
def update_moving
@move_distance = (@_move_coordinates[2] - @_move_coordinates[0]).abs +
(@_move_coordinates[3] - @_move_coordinates[1]).abs
if @move_distance > 0
return if @_moving[0] == @_move_coordinates[0] and @_moving[1] == @_move_coordinates[1]
array = @_move_coordinates
x = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @_move_duration) / @move_distance.to_f).to_i
y = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @_move_duration) / @move_distance.to_f).to_i
@_moving = [x, y]
if @_move_quick_return and @_move_duration == 0
@_move_coordinates = [0,0,array[0],array[1]]
@_move_duration = @move_distance
end
@_move_duration -= @_move_speed
@_move_duration = [@_move_duration, 0].max
end
end
#--------------------------------------------------------------------------
# ● 追加アニメ更新 (RTAB限定機能)
#--------------------------------------------------------------------------
def update_add_anime
if RTAB
# アニメーション
if @_add_anime_id != 0
animation = $data_animations[@_add_anime_id]
animation(animation, true)
@_add_anime_id = 0
end
end
end
#--------------------------------------------------------------------------
# ● エフェクト初期化
#--------------------------------------------------------------------------
def effect_clear
@_effect_ox = 0
@_effect_oy = 0
@_shake_power = 0
@_shake_speed = 0
@_shake_duration = 0
@_shake_direction = 1
@_shake = 0
@_upside_down = false
@_reverse = false
@_turning_direction = 1
@_turning_speed = 0
@_turning_duration = 0
@_turning = 0
@_move_quick_return = true
@_move_speed = 0
@_move_coordinates = [0,0,0,0]
@_move_jump = false
@_move_duration = 0
@_moving = [0,0]
@_add_anime_id = 0
end
#--------------------------------------------------------------------------
# ● シェイクの開始
# power : 強さ
# speed : 速さ
# duration : 時間
#--------------------------------------------------------------------------
def start_shake(power, speed, duration)
@_shake_power = power
@_shake_speed = speed
@_shake_duration = duration
end
#--------------------------------------------------------------------------
# ● 上下反転を開始
#--------------------------------------------------------------------------
def start_upside_down
@_upside_down = @_upside_down ? false : true
end
#--------------------------------------------------------------------------
# ● 左右反転を開始
#--------------------------------------------------------------------------
def start_reverse
@_reverse = @_reverse ? false : true
end
#--------------------------------------------------------------------------
# ● 回転を開始
# direction: 方向
# speed : 速さ
# duration : 時間
#--------------------------------------------------------------------------
def start_turning(direction, speed, duration)
@_turning_direction = direction
@_turning_speed = speed
@_turning_duration = duration
@_turning = @_turning_direction == 1 ? 0 : 360
end
#--------------------------------------------------------------------------
# ● 移動を開始
# quick_return : 戻るかどうか
# speed : 速さ
# x : X 座標
# y : Y 座標
#--------------------------------------------------------------------------
def start_moving(quick_return, speed, x, y)
@_move_quick_return = quick_return == 0 ? false : true
@_move_speed = speed
@_move_coordinates = [x,y,@_move_coordinates[0],@_move_coordinates[1]]
distance = (@_move_coordinates[2] - @_move_coordinates[0]).abs +
(@_move_coordinates[3] - @_move_coordinates[1]).abs
@_move_duration = distance
end
#--------------------------------------------------------------------------
# ● アニメ追加を開始
# id : ID
# hit : 命中フラッグ
#--------------------------------------------------------------------------
def start_add_anime(id)
@_add_anime_id = id
end
#--------------------------------------------------------------------------
# ● 各種エフェクトの開始判定
#--------------------------------------------------------------------------
if !method_defined?("side_view_animation_process_timing")
alias side_view_animation_process_timing animation_process_timing
end
def animation_process_timing(timing, hit)
side_view_animation_process_timing(timing, hit)
if (timing.condition == 0) or
(timing.condition == 1 and hit == true) or
(timing.condition == 2 and hit == false)
if timing.se.name =~ SHAKE_FILE
names = timing.se.name.split(/#/)
power = names[1].nil? ? SHAKE_POWER : names[1].to_i
speed = names[2].nil? ? SHAKE_SPEED : names[2].to_i
duration = names[3].nil? ? SHAKE_DURATION : names[3].to_i
# シェイクを開始
self.start_shake(power, speed, duration)
end
if timing.se.name == UPSIDE_DOWN_FILE
# 上下反転を開始
self.start_upside_down
end
if timing.se.name == REVERSE_FILE
# 左右反転を開始
self.start_reverse
end
if timing.se.name =~ TURNING_FILE
names = timing.se.name.split(/#/)
direction = names[1].nil? ? TURNING_DIRECTION : names[1].to_i
speed = names[2].nil? ? TURNING_SPEED : names[2].to_i
duration = names[3].nil? ? TURNING_DURATION : names[3].to_i
# 回転を開始
self.start_turning(direction, speed, duration)
end
if timing.se.name =~ MOVE_FILE
names = timing.se.name.split(/#/)
quick_return= names[1].nil? ? MOVE_RETURN : names[1].to_i
speed = names[2].nil? ? MOVE_SPEED : names[2].to_i
x = names[3].nil? ? MOVE_COORDINATES[0] : names[3].to_i
y = names[3].nil? ? MOVE_COORDINATES[1] : names[4].to_i
# 移動を開始
self.start_moving(quick_return, speed, x, y)
end
if timing.se.name =~ ADD_ANIME_FILE
names = timing.se.name.split(/#/)
id = names[1].nil? ? ADD_ANIME_ID : names[1].to_i
# アニメ追加を開始
self.start_add_anime(id)
end
end
end
end
class Sprite_Flying < RPG::Sprite
include Side_view
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :battler # バトラー
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# viewport : ビューポート
# battler : バトラー (Game_Battler)
#--------------------------------------------------------------------------
def initialize(viewport, battler = nil)
super(viewport)
@battler = battler
@battler_visible = false
end
#--------------------------------------------------------------------------
# ● 解放
#--------------------------------------------------------------------------
def dispose
if self.bitmap != nil
self.bitmap.dispose
end
super
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
super
# バトラーが nil の場合
if @battler == nil
self.bitmap = nil
loop_animation(nil)
return
end
# 遠距離アニメ
flying_animation = @battler.flying_animation
flying_start = flying_animation[0]
flying_end = flying_animation[1]
# アニメーション ID が現在のものと異なる場合
if @anime_id != @battler.flying_anime[0]
@anime_id = @battler.flying_anime[0]
@animation = $data_animations[@anime_id]
end
# アニメーション 開始
if flying_start
loop_animation(@animation)
elsif flying_end
loop_animation(nil)
end
self.x = @battler.flying_x
self.y = @battler.flying_y
self.z = @battler.screen_z + 1000
end
end
module RPG
class Skill
#--------------------------------------------------------------------------
# ● 魔法かどうかの判断
#--------------------------------------------------------------------------
def magic?
if @atk_f == 0
return true
else
return false
end
end
end
end
# アローカーソルの位置修正
class Arrow_Actor < Arrow_Base
include Side_view
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
alias side_view_update update
def update
side_view_update
# スプライトの座標を設定
if self.actor != nil && (self.x != self.actor.screen_x + ARROW_OX or self.y != self.actor.screen_y + ARROW_OY)
self.x = self.actor.screen_x + ARROW_OX
self.y = self.actor.screen_y + ARROW_OY
end
end
end
class Arrow_Enemy < Arrow_Base
include Side_view
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
alias side_view_update update
def update
side_view_update
# スプライトの座標を設定
if self.enemy != nil && self.y != self.enemy.screen_y + self.enemy.height/2
self.x = self.enemy.screen_x
self.y = self.enemy.screen_y + self.enemy.height/2
end
end
end
module Rtab_use
def update_phase4_step3(battler)
# ヘルプウィンドウの更新。アクションの種別で分岐
case battler.current_action.kind
when 0 # 基本
if battler.current_action.basic == 1
@help_window.set_text($data_system.words.guard, 1)
@help_wait = @help_time
end
if battler.is_a?(Game_Enemy) and battler.current_action.basic == 2
@help_window.set_text("逃げる", 1)
@help_wait = @help_time
end
when 1 # スキル
skill = $data_skills[battler.current_action.skill_id]
@help_window.set_text(skill.name, 1)
@help_wait = @help_time
when 2 # アイテム
item = $data_items[battler.current_action.item_id]
@help_window.set_text(item.name, 1)
@help_wait = @help_time
end
# 行動側アニメーション (ID が 0 の場合は白フラッシュ)
if battler.anime1 == 0
battler.white_flash = true
battler.wait = 5
# カメラ設定
if battler.target[0].is_a?(Game_Enemy)
camera_set(battler)
end
else
battler.animation.push([battler.anime1, true])
speller = synthe?(battler)
if speller != nil
for spell in speller
if spell != battler
if spell.current_action.spell_id == 0
spell.animation.push([battler.anime1, true])
else
skill = spell.current_action.spell_id
spell.animation.push([$data_skills[skill].animation1_id, true])
spell.current_action.spell_id = 0
end
end
end
end
battler.wait = 2 * $data_animations[battler.anime1].frame_max - 10
battler.anime1 = 0
end
# ステップ 4 に移行
battler.phase = 4 if !(!battler.animation1_on and battler.action? and !battler.flash?)
end
end
#==============================================================================
# ■ Scene_Battle
#==============================================================================
class Scene_Battle
include Side_view
include Rtab_use if RTAB
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_reader :phase # フェーズ
attr_reader :phase4_step # フェーズ4ステップ
attr_reader :active_battler # 対象の配列
attr_reader :target_battlers # 対象の配列
attr_reader :animation1_id # 行動アニメID
attr_reader :animation2_id # 対象アニメID
#--------------------------------------------------------------------------
# ● メイン処理
#--------------------------------------------------------------------------
alias side_view_main main
def main
# バトラー初期化
for battler in $game_party.actors + $game_troop.enemies
battler.start_battle
end
# 戻す
side_view_main
end
#--------------------------------------------------------------------------
# ● 閃き判定
#--------------------------------------------------------------------------
def flash?
return @flash_flag ? true : false
end
#--------------------------------------------------------------------------
# ● 閃きアニメ待ち時間取得
#--------------------------------------------------------------------------
def flash_duration
animation = nil
if FLASH_ANIME
animation = $data_animations[FLASH_ANIMATION_ID]
end
return animation != nil ? animation.frame_max * 2 + 2 : 0
end
#--------------------------------------------------------------------------
# ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
#--------------------------------------------------------------------------
alias side_view_update_phase4_step2 update_phase4_step2
def update_phase4_step2(*arg)
battler = convert_battler2(*arg)
battler.action
side_view_update_phase4_step2(*arg)
end
#--------------------------------------------------------------------------
# ● フレーム更新 (メインフェーズ ステップ 3 : 行動側アニメーション)
#--------------------------------------------------------------------------
alias side_view_update_phase4_step3 update_phase4_step3
def update_phase4_step3(*arg)
battler = convert_battler2(*arg)
if battler.flash? and FLASH_ANIME
battler.flash_flag["normal"] = true
end
side_view_update_phase4_step3(*arg)
end
#--------------------------------------------------------------------------
# ● フレーム更新 (メインフェーズ ステップ 4 : 対象側アニメーション)
#--------------------------------------------------------------------------
alias side_view_update_phase4_step4 update_phase4_step4
def update_phase4_step4(*arg)
battler = convert_battler2(*arg)
targets = RTAB ? battler.target : @target_battlers
return if !battler.animation2_on and battler.action? if !RTAB
side_view_update_phase4_step4(*arg)
for target in targets
if RTAB
value = nil
if target.damage_sp.include?(battler)
value = target.damage_sp[battler]
end
if target.damage.include?(battler)
if value == nil or value == "Miss"
value = target.damage[battler]
elsif value.is_a?(Numeric) && value > 0
value = target.damage[battler] == "Miss" ? value : target.damage[battler]
end
end
else
value = target.damage
end
if target.is_a?(Game_Actor)
# ダメージの場合
if value.is_a?(Numeric) && value > 0
# シェイクを開始
target.shake = true
end
elsif target.is_a?(Game_Enemy)
# ダメージの場合
if value.is_a?(Numeric) && value > 0
# シェイクを開始
target.shake = true
end
end
end
end
#--------------------------------------------------------------------------
# ● プレバトルフェーズ開始
#--------------------------------------------------------------------------
alias start_phase1_correct start_phase1
def start_phase1
# カメラの設定
# 元々フロントビュー向けの数値になっているため
@zoom_rate = [1.0, 1.0]
start_phase1_correct
end
#--------------------------------------------------------------------------
# ● アクターコマンドフェーズ開始
#--------------------------------------------------------------------------
alias start_phase3_correct start_phase3
def start_phase3
battler = convert_battler
start_phase3_correct
if RTAB
# カメラの設定
# 元々フロントビュー向けの数値になっているため
@camera = "command"
# @spriteset.screen_target(0, 0, 1.0)
end
end
def action_phase(battler)
# action が 1 の場合、バトラーが行動中かどうか確認
if @action == 1 and battler.phase < 3
for target in battler.target
speller = synthe?(target)
if speller == nil
# ターゲットが通常行動中の場合
if @action_battlers.include?(target)
if target.phase > 2
return
end
end
else
# ターゲットが連携スキル発動中の場合
for spell in speller
if @action_battlers.include?(spell)
if spell.phase > 2
return
end
end
end
end
end
end
case battler.phase
when 1
update_phase4_step1(battler)
when 2
update_phase4_step2(battler)
when 3
update_phase4_step3(battler) if !(!battler.animation1_on and battler.action? and !battler.flash?)
when 4
update_phase4_step4(battler) if !(!battler.animation2_on and battler.action?)
when 5
update_phase4_step5(battler)
when 6
update_phase4_step6(battler)
end
end
end dsu_plus_rewardpost_czw作者: 52jinger 时间: 2012-2-13 16:25
用这个脚本只能这样设置队伍位置了,没法单独定义的吧作者: 羞射了 时间: 2012-2-13 16:34
搜索这段
#--------------------------------------------------------------------------
# ● バトル画面 X 座標の取得(カメラ補正無し)
#--------------------------------------------------------------------------
def true_x
return PARTY_X + position * FORMATION_X + @ox
end
#--------------------------------------------------------------------------
# ● バトル画面 Y 座標の取得(カメラ補正無し)
#--------------------------------------------------------------------------
def true_y
# パーティ内の並び順から Y 座標を計算して返す
if self.index != nil
y = position2 * FORMATION_Y + PARTY_Y + @oy - @height / 2
return y
else
return 0
end
end
然后用case self.index
when 0
xy = z
when 1
xy = z
……
end
return xy