#==============================================================================
# ?¡ Scene_Battle
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ?œ ƒ?ƒCƒ“?ˆ—?
#--------------------------------------------------------------------------
alias xrxs_bp8_main main
def main
# ƒJƒ?ƒ‰?‰Š?ˆ?’uŒˆ’?
$xcam_x = 0
$xcam_y = 0
$xcam_z = 295
# ƒJƒ?ƒ‰‚????‰‚?–?“I’l
@xcam_x_destination = 0
@xcam_y_destination = 0
@xcam_z_destination = 185
# ?¡?A’?–?ƒoƒgƒ‰?[‚?–³‚µ?B
@xcam_watch_battler = nil
# ?‰Š?‰»
@wait_count_xcam = 0
# –?‚·
xrxs_bp8_main
end
#--------------------------------------------------------------------------
# ?œ ƒtƒŒ?[ƒ€?X?V
#--------------------------------------------------------------------------
alias xrxs_bp8_update update
def update
# ƒJƒ?ƒ‰ˆ?’u‚??X?V?B
if @wait_count_xcam > 0
# ƒEƒFƒCƒgƒJƒEƒ“ƒg‚?Œ¸‚?‚·
@wait_count_xcam -= 1
else
# ƒJƒ?ƒ‰: Z ??•W
if $xcam_z != @xcam_z_destination
if $xcam_z < @xcam_z_destination
distance = [(@xcam_z_destination - $xcam_z)/8, 1].max
else
distance = [(@xcam_z_destination - $xcam_z)/8, -1].min
end
$xcam_z = [[$xcam_z + distance, 74].max, 296].min
end
# ƒJƒ?ƒ‰: X ??•W
if @xcam_watch_battler != nil
if $xcam_x != @xcam_watch_battler.x_pos
if ($xcam_x - @xcam_watch_battler.x_pos).abs < 8
distance = @xcam_watch_battler.x_pos - $xcam_x
elsif $xcam_x < @xcam_watch_battler.x_pos
distance = [(@xcam_watch_battler.x_pos - $xcam_x)/8, 8].max
else
distance = [(@xcam_watch_battler.x_pos - $xcam_x)/8, -8].min
end
maximum = 192 * (296 - $xcam_z) / 111
$xcam_x = [[$xcam_x + distance, -maximum].max, maximum].min
end
elsif $xcam_x != @xcam_x_destination
if ($xcam_x - @xcam_x_destination).abs < 8
distance = @xcam_x_destination - $xcam_x
elsif $xcam_x < @xcam_x_destination
distance = [(@xcam_x_destination - $xcam_x)/8, 8].max
else
distance = [(@xcam_x_destination - $xcam_x)/8, -8].min
end
maximum = 192 * (296 - $xcam_z) / 111
$xcam_x = [[$xcam_x + distance, -maximum].max, maximum].min
end
# ƒJƒ?ƒ‰: Y ??•W
if @xcam_watch_battler != nil
y = @xcam_watch_battler.y_pos/2
if $xcam_y != y
if ($xcam_y - y).abs < 8
distance = y - $xcam_y
elsif $xcam_y < y
distance = [(y - $xcam_y)/8, 8].max
else
distance = [(y - $xcam_y)/8, -8].min
end
maximum = 144 * (296 - $xcam_z) / 111
$xcam_y = [[$xcam_y + distance, -maximum].max, maximum].min
end
elsif $xcam_y != @xcam_y_destination
if $xcam_y < @xcam_y_destination
distance = [(@xcam_y_destination - $xcam_y)/8, 1].max
else
distance = [(@xcam_y_destination - $xcam_y)/8, -1].min
end
maximum = 164 * (296 - $xcam_z) / 111
$xcam_y = [[$xcam_y + distance, -maximum].max, maximum].min
end
end
# ’???Ž??s
xrxs_bp8_update
end
#--------------------------------------------------------------------------
# ?œ ƒp?[ƒeƒBƒRƒ}ƒ“ƒhƒtƒF?[ƒYŠJŽn
#--------------------------------------------------------------------------
alias xrxs_bp8_start_phase2 start_phase2
def start_phase2
# ƒJƒ?ƒ‰?FƒZƒ“ƒ^ƒŠƒ“ƒO
@xcam_watch_battler = nil
@xcam_x_destination = 0
@xcam_z_destination = 185
# –?‚·
xrxs_bp8_start_phase2
end
#--------------------------------------------------------------------------
# ?œ ƒtƒŒ?[ƒ€?X?V (ƒAƒNƒ^?[ƒRƒ}ƒ“ƒhƒtƒF?[ƒY)
#--------------------------------------------------------------------------
alias xrxs_bp8_update_phase3 update_phase3
def update_phase3
# ƒJƒ?ƒ‰‚?ƒLƒƒƒ‰ˆ?’u‚?
if @active_battler != nil and @active_battler.actor_in_battlefield
@xcam_x_destination = @active_battler.x_pos
@xcam_z_destination = 175
end
xrxs_bp8_update_phase3
end
#--------------------------------------------------------------------------
# ?œ ƒtƒŒ?[ƒ€?X?V (ƒAƒNƒ^?[ƒRƒ}ƒ“ƒhƒtƒF?[ƒY : ƒGƒlƒ~?[‘I‘?)
#--------------------------------------------------------------------------
alias xrxs_bp8_update_phase3_enemy_select update_phase3_enemy_select
def update_phase3_enemy_select
# ƒJƒ?ƒ‰?F“Gƒ^?[ƒQƒbƒg‚?ƒY?[ƒ€ƒAƒbƒv
@xcam_x_destination = $game_troop.enemies[@enemy_arrow.index].x_pos * $game_troop.enemies[@enemy_arrow.index].zoom
@xcam_z_destination = 175
# –?‚·
xrxs_bp8_update_phase3_enemy_select
end
#--------------------------------------------------------------------------
# ?œ ƒGƒlƒ~?[‘I‘??I—¹
#--------------------------------------------------------------------------
alias xrxs_bp8_end_enemy_select end_enemy_select
def end_enemy_select
# ƒJƒ?ƒ‰?F’†?S‚?
@xcam_x_destination = 0
@xcam_z_destination = 185
# –?‚·
xrxs_bp8_end_enemy_select
end
#--------------------------------------------------------------------------
# ?œ ƒtƒŒ?[ƒ€?X?V (ƒ?ƒCƒ“ƒtƒF?[ƒY ƒXƒeƒbƒv 2 : ƒAƒNƒVƒ‡ƒ“ŠJŽn)
#--------------------------------------------------------------------------
alias xrxs_bp8_update_phase4_step2 update_phase4_step2
def update_phase4_step2
# –?‚·
xrxs_bp8_update_phase4_step2
# ƒXƒeƒbƒv 3 ‚?ˆ??s‚·‚????‡
if @phase4_step == 3
if @active_battler.is_a?(Game_Enemy) or @active_battler.actor_in_battlefield
# ƒJƒ?ƒ‰?F?s“®ƒoƒgƒ‰?[‚?‚?ƒY?[ƒ€ƒAƒbƒv‚?—–?
@xcam_x_destination = @active_battler.x_pos * @active_battler.zoom if @active_battler.x_pos != nil
@xcam_z_destination = 175
end
# ??’? 20 ƒtƒŒ?[ƒ€‘?‚?
@wait_count = 20
end
end
#--------------------------------------------------------------------------
# ?œ ƒtƒŒ?[ƒ€?X?V (ƒ?ƒCƒ“ƒtƒF?[ƒY ƒXƒeƒbƒv 3 : ?s“®‘?ƒAƒjƒ??[ƒVƒ‡ƒ“)
#--------------------------------------------------------------------------
alias xrxs_bp8_update_phase4_step3 update_phase4_step3
def update_phase4_step3
# –?‚·
xrxs_bp8_update_phase4_step3
if @target_battlers.size > 0 and
(@target_battlers[0].is_a?(Game_Enemy) or @target_battlers[0].actor_in_battlefield)
# ƒJƒ?ƒ‰?Fƒ^?[ƒQƒbƒg‚?‚?ƒY?[ƒ€ƒAƒbƒv‚?—–?
@xcam_x_destination = @target_battlers[0].x_pos * @target_battlers[0].zoom if @target_battlers[0] != nil
@xcam_z_destination = 185
# ‚?‚µ‘???ƒAƒjƒ?‚×?uˆ?’u?F‰?–??v‚?‚?‚?‚????‡
if @animation2_id > 0 and $data_animations[@animation2_id].position == 3
# ƒJƒ?ƒ‰‚?ƒZƒ“ƒ^ƒŠƒ“ƒO
@xcam_x_destination = 0
# ƒY?[ƒ€ƒAƒEƒg‚?‚?‚?‚?‚¿‚?‚?¥w¥
@xcam_z_destination = 222
end
end
# ??’? 20 ƒtƒŒ?[ƒ€‘?‚?
@wait_count = 20
end
#--------------------------------------------------------------------------
# ?œ ƒAƒtƒ^?[ƒoƒgƒ‹ƒtƒF?[ƒYŠJŽn
#--------------------------------------------------------------------------
alias xrxs_bp8_start_phase5 start_phase5
def start_phase5
@xcam_z_destination = 185
xrxs_bp8_start_phase5
end
end
#==============================================================================
# ?ž RPG::??’?‹`?u??“¬’†‚?"‰?–?"ƒAƒjƒ?‚?ˆ?’u?C?³?v
#==============================================================================
module RPG
class Sprite < ::Sprite
def animation_set_sprites(sprites, cell_data, position)
for i in 0..15
sprite = sprites[i]
pattern = cell_data[i, 0]
if sprite == nil or pattern == nil or pattern == -1
sprite.visible = false if sprite != nil
next
end
sprite.visible = true
sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
if position == 3
if self.viewport != nil
if $scene.is_a?(Scene_Battle)
sprite.x = self.viewport.rect.width / 2
sprite.y = 304
else
sprite.x = self.viewport.rect.width / 2
sprite.y = self.viewport.rect.height - 160
end
else
sprite.x = 320
sprite.y = 240
end
else
sprite.x = self.x - self.ox + self.src_rect.width / 2
sprite.y = self.y - self.oy + self.src_rect.height / 2
sprite.y -= self.src_rect.height / 4 if position == 0
sprite.y += self.src_rect.height / 4 if position == 2
end
sprite.x += cell_data[i, 1]
sprite.y += cell_data[i, 2]
sprite.z = 2000
sprite.ox = 96
sprite.oy = 96
sprite.zoom_x = cell_data[i, 3] / 100.0
sprite.zoom_y = cell_data[i, 3] / 100.0
sprite.angle = cell_data[i, 4]
sprite.mirror = (cell_data[i, 5] == 1)
sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
sprite.blend_type = cell_data[i, 7]
end
end
end
end