#--------------------------------------------------------------------------
# ● 敵方攻擊顯示動畫
#--------------------------------------------------------------------------
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● 是否使用精灵
#--------------------------------------------------------------------------
def use_sprite?
return true
end
#--------------------------------------------------------------------------
# ● 获取战斗画面 X 坐标
#--------------------------------------------------------------------------
def screen_x
return 480
end
#--------------------------------------------------------------------------
# ● 获取战斗画面 Y 坐标
#--------------------------------------------------------------------------
def screen_y
return 208
end
#--------------------------------------------------------------------------
# ● 获取战斗画面 Z 坐标
#--------------------------------------------------------------------------
def screen_z
return 100
end
end
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# ● 获取战斗画面 Z 坐标
#--------------------------------------------------------------------------
def screen_z
return 10
end
#--------------------------------------------------------------------------
# ● 获取普通攻击的动画 ID
#--------------------------------------------------------------------------
def atk_animation_id1
return 1
end
#--------------------------------------------------------------------------
# ● 获取普通攻击的动画 ID (双持武器:武器2)
#--------------------------------------------------------------------------
def atk_animation_id2
return 0
end
end
class Spriteset_Battle
#--------------------------------------------------------------------------
# ● 更新图片精灵
#--------------------------------------------------------------------------
def update_pictures
$game_troop.screen.pictures.each do |pic|
@picture_sprites[pic.number] ||= Sprite_Picture.new(@viewport1, pic)
@picture_sprites[pic.number].update
end
end
end
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# ● 显示动画
# targets : 目标的数组
# animation_id : 动画 ID(-1: 与普通攻击一样)
#--------------------------------------------------------------------------
def show_animation(targets, animation_id)
if animation_id < 0
show_attack_animation(targets)
else
show_normal_animation(targets, animation_id)
end
@log_window.wait
wait_for_animation
end
#--------------------------------------------------------------------------
# ● 显示攻击动画
# targets : 目标的数组
# 是角色的时候考虑双持武器的效果(反转动画显示左手武器)。
# 是敌人的时候,在那一瞬间,播放“敌人普通攻击”的声效。
#--------------------------------------------------------------------------
def show_attack_animation(targets)
if @subject.actor?
show_normal_animation(targets, @subject.atk_animation_id1, false)
show_normal_animation(targets, @subject.atk_animation_id2, true)
else
show_normal_animation(targets, @subject.atk_animation_id1, true)
show_normal_animation(targets, @subject.atk_animation_id2, false)
end
end
#--------------------------------------------------------------------------
# ● 显示普通动画
# targets : 目标的数组
# animation_id : 动画ID
# mirror : 左右反转
#--------------------------------------------------------------------------
def show_normal_animation(targets, animation_id, mirror = false)
animation = $data_animations[animation_id]
if animation
targets.each do |target|
target.animation_id = animation_id
target.animation_mirror = mirror
abs_wait_short unless animation.to_screen?
end
abs_wait_short if animation.to_screen?
end
end
end