#◆◇◆◇◆ ☆ バトラーバックアニメ ver 1.01 ◇◆◇◆◇ # ☆ マスタースクリプト ver 2.00 以降専用 # サポート掲示板 http://www2.ezbbs.net/21/minto-aaa/ # by みんと =begin 更新履歴 ver 1.01 アクター側のZ座標を修正。 セクション指定上下関係 A・C・A・システム ↓ 自動反転アニメ ↓ このスクリプト 説明 デフォルトでは、 全てのアニメはバトラーの上に重なって表示されますが、 セルの回転度が 1 の場合、 バトラーの背後にそのセルのアニメを表示します。 1でない場合は通常通りの処理を実行します。 その際、アニメーションエディタ上では、 1度回転が実行されていますが、 ゲーム上での実際の処理では、 1度回転は無視され、回転無しとして扱われます。 魔法陣や、ビーム攻撃などに向いているかもしれません。 =end #============================================================================== # ☆ MINTO #------------------------------------------------------------------------------ # 様々なフラグを扱うメインモジュールです。 #============================================================================== module MINTO # バトラーバックアニメを有効化 ( true で有効 / false で無効 ) RGSS["バトラーバックアニメ"] = true end if MINTO::RGSS["バトラーバックアニメ"] #============================================================================= # ■ RPG::Sprite #----------------------------------------------------------------------------- # ゲーム中のスプライトを扱うクラスです。 #============================================================================= module RPG class Sprite < ::Sprite #----------------------------------------------------------------------- # ● アニメーション・セットスプライト # 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] # セルの回転度が 1 の場合 if cell_data[i, 4] == 1 sprite.z = 0 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 MINTO::RGSS["自動反転アニメ"] and auto_mirror_anime? # X座標を反転加算 sprite.x -= cell_data[i, 1] # 左右反転情報を反転させる sprite.mirror = (cell_data[i, 5] == 0) # アニメの回転度が2以上の場合 if cell_data[i, 4] >= 2 # 回転度を反転 sprite.angle = 360 - cell_data[i, 4] else sprite.angle = 0 end # それ以外の場合 else sprite.x += cell_data[i, 1] sprite.mirror = (cell_data[i, 5] == 1) # アニメの回転度が2以上の場合 if cell_data[i, 4] >= 2 sprite.angle = cell_data[i, 4] else sprite.angle = 0 end end sprite.opacity = cell_data[i, 6] * self.opacity / 255.0 sprite.blend_type = cell_data[i, 7] end end end end