180 lines
No EOL
9.1 KiB
Ruby
180 lines
No EOL
9.1 KiB
Ruby
|
|
#==============================================================================
|
|
# ■ SideViewアクション設定 Ver100
|
|
#------------------------------------------------------------------------------
|
|
# サイドビューバトル全般のセッティングやアクションを作成します
|
|
#==============================================================================
|
|
module N03
|
|
|
|
#元画像が"porin"だった場合、"_2"を付け加えて"porin_2"に変更する
|
|
ACTION["被ダメージ画像変更"] = ["change_ex", "_2"]
|
|
|
|
# 「SideViewアクション設定」の834、835行目を書き換えたものです
|
|
# "被ダメージ画像変更"を入れることによってバトラー画像を変更させます
|
|
|
|
FULLACTION["被ダメージ"] = ["被ダメージ画像変更","ダメージのけぞり","20","座標リセット左向き"]
|
|
FULLACTION["被ダメージ大"] = ["被ダメージ画像変更","シェイク中","ダメージのけぞり大","20","座標リセット左向き"]
|
|
|
|
end
|
|
|
|
#==============================================================================
|
|
# ■ Scene_Battle
|
|
#==============================================================================
|
|
class Scene_Battle < Scene_Base
|
|
#--------------------------------------------------------------------------
|
|
# ● サイドビュー ダメージ戦闘アニメ処理
|
|
#--------------------------------------------------------------------------
|
|
def damage_anime(targets, target, item)
|
|
@log_window.back_to(1) if @log_window.line_number == 5
|
|
return if item.scope != 9 && item.scope != 10 && target.dead?
|
|
@miss = false
|
|
invoke_item(target,item)
|
|
if target.result.missed
|
|
target.sv.miss_action(@subject, item)
|
|
return @miss = true
|
|
elsif target.result.evaded or target.sv.counter_id != 0
|
|
target.sv.evasion_action(@subject, item)
|
|
return @miss = true
|
|
elsif target.sv.reflection_id != 0
|
|
N03.set_damage_anime_data(targets, target, [target.sv.reflection_id, false, false, true])
|
|
target.sv.reflection_id = 0
|
|
@reflection_data = [] if @reflection_data == nil
|
|
return @reflection_data.push([N03.get_attack_anime_id(-3, @subject), false, false, true])
|
|
end
|
|
N03.set_damage_anime_data(targets, target, @subject.sv.damage_anime_data) if @subject.sv.damage_anime_data != [] ###
|
|
target.sv.damage_action(@subject, item)
|
|
BattleVoice.play(:damage, target) if target.result.hp_damage > 0 ###
|
|
N03.set_damage(@subject, -target.result.hp_drain, -target.result.mp_drain) if target != @subject
|
|
@spriteset.set_damage_pop(target)
|
|
@spriteset.set_damage_pop(@subject) if target != @subject && (@subject.result.hp_damage != 0 or @subject.result.mp_damage != 0)
|
|
target.sv.graphics_change_ex_original ### "change_ex"による画像変更を元に戻す
|
|
#攻撃アニメ表示→被ダメージアクション→ボイス→ダメージ値表示→画像を戻す
|
|
end
|
|
end
|
|
|
|
#==============================================================================
|
|
# ■ Sideview Ver100
|
|
#------------------------------------------------------------------------------
|
|
# サイドビューバトラーを管理するクラスです。
|
|
#==============================================================================
|
|
class SideView
|
|
#--------------------------------------------------------------------------
|
|
# ● アクション実行
|
|
#--------------------------------------------------------------------------
|
|
alias :change_ex_action_play :action_play
|
|
def action_play
|
|
return if @action_data == nil
|
|
return graphics_change_ex if @action_data[0] == "change_ex"
|
|
return graphics_change_ex_original if @action_data[0] == "change_ex_original"
|
|
change_ex_action_play
|
|
end
|
|
#--------------------------------------------------------------------------
|
|
# ● "change_ex"によるバトラー画像変更
|
|
#--------------------------------------------------------------------------
|
|
def graphics_change_ex
|
|
return if !@battler.is_a?(Game_Enemy)
|
|
# 変更直前の画像名を保存
|
|
@battler.pre_change_ex_data = @battler.battler_name if @battler.pre_change_ex_data == nil
|
|
@battler.graphics_change(@battler.pre_change_ex_data + @action_data[1])
|
|
end
|
|
#--------------------------------------------------------------------------
|
|
# ● "change_ex"によるバトラー画像変更を元に戻す
|
|
#--------------------------------------------------------------------------
|
|
def graphics_change_ex_original
|
|
return if @battler.pre_change_ex_data == nil
|
|
@battler.graphics_change(@battler.pre_change_ex_data)
|
|
@battler.pre_change_ex_data = nil
|
|
end
|
|
end
|
|
|
|
#==============================================================================
|
|
# ■ Sprite_Battler
|
|
#==============================================================================
|
|
class Sprite_Battler < Sprite_Base
|
|
#--------------------------------------------------------------------------
|
|
# ● 画像の名前を作成
|
|
#--------------------------------------------------------------------------
|
|
def battler_motion_file_name
|
|
if @battler.pre_change_ex_data != nil or @battler_graphic_file_index == ""
|
|
# "change_ex"による画像変更中(=被ダメージによる表情変化中)なら
|
|
# "motion"による画像変更(ピンチ状態)は行わない
|
|
return @battler_name
|
|
else
|
|
# "change_ex"が適用されていないなら"motion"の画像変更を受け付ける
|
|
return @battler_name + @battler_graphic_file_index
|
|
end
|
|
end
|
|
#--------------------------------------------------------------------------
|
|
# ● 転送元ビットマップ:エネミー
|
|
#--------------------------------------------------------------------------
|
|
def update_bitmap_enemy
|
|
if @battler.battler_name != @battler_name or @battler.battler_hue != @battler_hue
|
|
@battler_name = @battler.battler_name
|
|
@battler_hue = @battler.battler_hue
|
|
@battler_graphic_file_index = @battler.sv.graphic_file_index
|
|
@graphic_mirror_flag = @battler.sv.graphic_mirror_flag
|
|
self.bitmap = Cache.battler(battler_motion_file_name, @battler_hue)
|
|
@battler.sv.setup(self.bitmap.width, self.bitmap.height, @battler_id != @battler.id)
|
|
create_shadow
|
|
init_visibility
|
|
@battler_id = @battler.id
|
|
end
|
|
end
|
|
#--------------------------------------------------------------------------
|
|
# ● 転送元ビットマップ:アクター
|
|
#--------------------------------------------------------------------------
|
|
def update_bitmap_actor
|
|
if @battler.character_name != @battler_name or @battler.character_index != @battler_index
|
|
@battler_name = @battler.character_name
|
|
@battler_index = @battler.character_index
|
|
@battler_graphic_file_index = @battler.sv.graphic_file_index
|
|
@graphic_mirror_flag = @battler.sv.graphic_mirror_flag
|
|
self.bitmap = Cache.character(battler_motion_file_name)
|
|
@battler.sv.setup(self.bitmap.width, self.bitmap.height, @battler_id != @battler.id)
|
|
create_shadow
|
|
init_visibility
|
|
@battler_id = @battler.id
|
|
end
|
|
end
|
|
#--------------------------------------------------------------------------
|
|
# ● 転送元矩形の更新
|
|
#--------------------------------------------------------------------------
|
|
def update_src_rect
|
|
return if @battler.sv.collapse
|
|
if @battler_graphic_file_index != @battler.sv.graphic_file_index
|
|
@battler_graphic_file_index = @battler.sv.graphic_file_index
|
|
self.bitmap = Cache.character(battler_motion_file_name) if @battler.actor?
|
|
self.bitmap = Cache.battler(battler_motion_file_name, @battler_hue) if !@battler.actor?
|
|
@battler.sv.set_graphics(self.bitmap.width, self.bitmap.height)
|
|
end
|
|
anime_off if @battler.sv.anime_off
|
|
self.src_rect.set(@battler.sv.sx, @battler.sv.sy, @battler.sv.cw, @battler.sv.ch)
|
|
self.opacity = @battler.sv.opacity if @battler_visible
|
|
set_process_timing(@battler.sv.timing) if @battler && @battler.sv.timing != []
|
|
end
|
|
end
|
|
|
|
class Game_Actor < Game_Battler
|
|
#--------------------------------------------------------------------------
|
|
# ● 公開インスタンス変数
|
|
#--------------------------------------------------------------------------
|
|
attr_accessor :pre_change_ex_data
|
|
#--------------------------------------------------------------------------
|
|
# ● バトルボイス ダメージ効果の実行
|
|
#--------------------------------------------------------------------------
|
|
def perform_damage_effect
|
|
perform_damage_effect_voice_plus
|
|
end
|
|
end
|
|
class Game_Enemy < Game_Battler
|
|
#--------------------------------------------------------------------------
|
|
# ● 公開インスタンス変数
|
|
#--------------------------------------------------------------------------
|
|
attr_accessor :pre_change_ex_data
|
|
#--------------------------------------------------------------------------
|
|
# ● バトルボイス ダメージ効果の実行
|
|
#--------------------------------------------------------------------------
|
|
def perform_damage_effect
|
|
perform_damage_effect_voice_plus
|
|
end
|
|
end |