117 lines
No EOL
5.7 KiB
Ruby
117 lines
No EOL
5.7 KiB
Ruby
#==============================================================================
|
||
# ■ アニメーションの上書き (VX Ace用)
|
||
#------------------------------------------------------------------------------
|
||
# 製作者 : CanariAlternate
|
||
# サイト名 : カルトの鳥篭
|
||
# サイトURL : http://canarialt.blog.fc2.com
|
||
#------------------------------------------------------------------------------
|
||
# ■ 概要 : キャラクターのアニメーションの表示で上書きされるように仕様を変更する。
|
||
#
|
||
# ■ 必須 : なし
|
||
#
|
||
# ■ 位置 : 「Sprite_Character」より下、再定義が多めなので出来る限り上に配置
|
||
#------------------------------------------------------------------------------
|
||
# 更新履歴 : 2013/02/19 Ver1.00 スクリプトを作成した。
|
||
# 2013/05/10 Ver1.01 無効なアニメーションを指定した際にウェイトが解除されない問題を修正した。
|
||
#==============================================================================
|
||
|
||
$imported ||= {}
|
||
$imported[:CanariAlternate_AnimationOverwrite] = true
|
||
|
||
#==============================================================================
|
||
# ■ Game_CharacterBase
|
||
#------------------------------------------------------------------------------
|
||
# キャラクターを扱う基本のクラスです。全てのキャラクターに共通する、座標やグ
|
||
# ラフィックなどの基本的な情報を保持します。
|
||
#==============================================================================
|
||
class Game_CharacterBase
|
||
#--------------------------------------------------------------------------
|
||
# ● 公開インスタンス変数
|
||
#--------------------------------------------------------------------------
|
||
attr_accessor :animation_wait_id # アニメーションの表示終了までウェイトの識別 ID
|
||
attr_accessor :balloon_wait_id # フキダシアイコンの表示終了までウェイトの識別 ID
|
||
#--------------------------------------------------------------------------
|
||
# ● 公開メンバ変数の初期化 [追加]
|
||
#--------------------------------------------------------------------------
|
||
alias init_public_members_AnimationOverwrite init_public_members
|
||
def init_public_members
|
||
init_public_members_AnimationOverwrite
|
||
@animation_wait_id = nil
|
||
@balloon_wait_id = nil
|
||
end
|
||
end
|
||
|
||
#==============================================================================
|
||
# ■ Game_Interpreter
|
||
#------------------------------------------------------------------------------
|
||
# イベントコマンドを実行するインタプリタです。このクラスは Game_Map クラス、
|
||
# Game_Troop クラス、Game_Event クラスの内部で使用されます。
|
||
#==============================================================================
|
||
class Game_Interpreter
|
||
#--------------------------------------------------------------------------
|
||
# ● アニメーションの表示 [◆再定義]
|
||
#--------------------------------------------------------------------------
|
||
def command_212
|
||
character = get_character(@params[0])
|
||
if character
|
||
character.animation_id = @params[1]
|
||
character.animation_wait_id = self.object_id
|
||
Fiber.yield while character.animation_wait_id == self.object_id if @params[2]
|
||
end
|
||
end
|
||
#--------------------------------------------------------------------------
|
||
# ● フキダシアイコンの表示 [◆再定義]
|
||
#--------------------------------------------------------------------------
|
||
def command_213
|
||
character = get_character(@params[0])
|
||
if character
|
||
character.balloon_id = @params[1]
|
||
character.balloon_wait_id = self.object_id
|
||
Fiber.yield while character.balloon_wait_id == self.object_id if @params[2]
|
||
end
|
||
end
|
||
end
|
||
|
||
#==============================================================================
|
||
# ■ Sprite_Character
|
||
#------------------------------------------------------------------------------
|
||
# キャラクター表示用のスプライトです。Game_Character クラスのインスタンスを
|
||
# 監視し、スプライトの状態を自動的に変化させます。
|
||
#==============================================================================
|
||
class Sprite_Character < Sprite_Base
|
||
#--------------------------------------------------------------------------
|
||
# ● 新しいエフェクトの設定 [◆再定義]
|
||
#--------------------------------------------------------------------------
|
||
def setup_new_effect
|
||
if @character.animation_id > 0
|
||
dispose_animation if animation?
|
||
animation = $data_animations[@character.animation_id]
|
||
start_animation(animation)
|
||
@character.animation_id = 0
|
||
elsif !animation? && @character.animation_wait_id
|
||
@character.animation_wait_id = nil
|
||
end
|
||
if @character.balloon_id > 0
|
||
dispose_balloon if @balloon_sprite
|
||
@balloon_id = @character.balloon_id
|
||
start_balloon
|
||
@character.balloon_id = 0
|
||
elsif !@balloon_sprite && @character.balloon_wait_id
|
||
@character.balloon_wait_id = nil
|
||
end
|
||
end
|
||
#--------------------------------------------------------------------------
|
||
# ● アニメーションの終了 [◆再定義]
|
||
#--------------------------------------------------------------------------
|
||
def end_animation
|
||
super
|
||
@character.animation_wait_id = nil
|
||
end
|
||
#--------------------------------------------------------------------------
|
||
# ● フキダシアイコンの終了 [◆再定義]
|
||
#--------------------------------------------------------------------------
|
||
def end_balloon
|
||
dispose_balloon
|
||
@character.balloon_wait_id = nil
|
||
end
|
||
end |