#◆◇◆◇◆ ☆ 自動反転アニメ ver 1.00 ◇◆◇◆◇ # ☆ マスタースクリプト ver 2.00 以降専用 # サポート掲示板 http://www2.ezbbs.net/21/minto-aaa/ # by みんと =begin セクション指定上下関係 A・C・A・システム ↓ このスクリプト 説明 敵が特定のアニメを使ってきた場合、 そのアニメのX座標、回転度、左右反転を自動反転させます。 設定には敵が使うことで反転させたいアニメの名前に 反転 の文字を入れてください。 アニメが自動反転されます。 サイドビュー等で使用するとちょうどいいかもしれません。 また、指定スイッチがオンになっている場合も 無条件で自動反転が実行されます。 マップやフロントビューの二刀流などで活用してください。 密かにアニメの更新処理も軽量化してます。 =end #============================================================================== # ☆ MINTO #------------------------------------------------------------------------------ # 様々なフラグを扱うメインモジュールです。 #============================================================================== module MINTO # 自動反転アニメを有効化 ( true で有効 / false で無効 ) RGSS["自動反転アニメ"] = true end #============================================================================== # ☆ カスタマイズ #------------------------------------------------------------------------------ # 機能のカスタマイズを行うモジュールです。 #============================================================================== module MINTO # オンの時に自動反転するゲームスイッチのID Auto_mirror_id =1 end if MINTO::RGSS["自動反転アニメ"] #============================================================================= # ■ RPG::Sprite #----------------------------------------------------------------------------- # ゲーム中のスプライトを扱うクラスです。 #============================================================================= module RPG class Sprite < ::Sprite #----------------------------------------------------------------------- # ● 自動反転フラグの取得 #----------------------------------------------------------------------- def auto_mirror_anime? # 現在戦闘中の場合 if $game_temp.in_battle # アクティブバトラーが存在し、且つエネミーの場合 if $scene.active_battler != nil and $scene.active_battler.is_a?(Game_Enemy) # 現在表示中のアニメに「反転」の文字が含まれている場合 if Data_Animations.data[@_animation.id].name.include?("反転") # フラグを返す return true end end end # 指定ゲームスイッチがオンの場合 if $game_switches[MINTO::Auto_mirror_id] == true # フラグを返す return true end # メソッドを返す return false end #----------------------------------------------------------------------- # ● アニメーション・セットスプライト # sprites : アニメのスプライト # cell_data : アニメセルのデータ # position : アニメの位置 #----------------------------------------------------------------------- def animation_set_sprites(sprites, cell_data, position) # 各アニメをセット animation_set(sprites, cell_data, position, 0) animation_set(sprites, cell_data, position, 1) animation_set(sprites, cell_data, position, 2) animation_set(sprites, cell_data, position, 3) animation_set(sprites, cell_data, position, 4) animation_set(sprites, cell_data, position, 5) animation_set(sprites, cell_data, position, 6) animation_set(sprites, cell_data, position, 7) animation_set(sprites, cell_data, position, 8) animation_set(sprites, cell_data, position, 9) animation_set(sprites, cell_data, position, 10) animation_set(sprites, cell_data, position, 11) animation_set(sprites, cell_data, position, 12) animation_set(sprites, cell_data, position, 13) animation_set(sprites, cell_data, position, 14) animation_set(sprites, cell_data, position, 15) end #----------------------------------------------------------------------- # ● アニメーション・セット # sprites : アニメのスプライト # cell_data : アニメセルのデータ # position : アニメの位置 #----------------------------------------------------------------------- def animation_set(sprites, cell_data, position, i) # スプライトを取得 sprite = sprites[i] # アニメの「位置」を取得 pattern = cell_data[i, 0] # スプライトか位置のどちらかが存在しない場合 if sprite == nil or pattern == nil or pattern == -1 # スプライトが存在する場合 if sprite != nil # スプライトを不可視状態にする sprite.visible = false end # 以降の処理を終了 return end # スプライトを可視状態にする sprite.visible = true # スプライトの色調を代入 sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192) # アニメの「位置」が「画面」の場合 if position == 3 # ビューボードが存在する場合 if self.viewport != nil sprite.x = self.viewport.rect.width / 2 if $game_temp.in_battle and self.battler.is_a?(Game_Actor) sprite.y = self.viewport.rect.height - 160 else sprite.y = self.viewport.rect.height - 300 end else sprite.x = 320 sprite.y = 240 end else if self.is_a?(Sprite_Character) sprite.x = @character.screen_x - self.ox + self.src_rect.width / 2 sprite.y = @character.screen_y - self.oy + self.src_rect.height / 2 else sprite.x = @battler.screen_x - self.ox + self.src_rect.width / 2 sprite.y = @battler.screen_y - self.oy + self.src_rect.height / 2 end if position == 0 sprite.y -= self.src_rect.height / 4 elsif position == 2 sprite.y += self.src_rect.height / 4 end end sprite.y += cell_data[i, 2] if cell_data[i, 4] == 1 sprite.z = 20 else sprite.z = 2000 end sprite.ox = 96 sprite.oy = 96 sprite.zoom_x = cell_data[i, 3] / 100.0 sprite.zoom_y = cell_data[i, 3] / 100.0 # 自動反転アニメの場合 if auto_mirror_anime? # X座標を反転加算 sprite.x -= cell_data[i, 1] # 左右反転情報を反転させる sprite.mirror = (cell_data[i, 5] == 0) # アニメの回転度が1以上の場合 if cell_data[i, 4] >= 1 # 回転度を反転 sprite.angle = 360 - cell_data[i, 4] end # それ以外の場合 else sprite.x += cell_data[i, 1] sprite.mirror = (cell_data[i, 5] == 1) sprite.angle = cell_data[i, 4] end sprite.opacity = cell_data[i, 6] * self.opacity / 255.0 sprite.blend_type = cell_data[i, 7] end end end #============================================================================== # ■ Scene_Battle (分割定義 1) #------------------------------------------------------------------------------ #  バトル画面の処理を行うクラスです。 #============================================================================== class Scene_Battle #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_accessor :active_battler # 現在のバトラー end end