Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- # * Fantastic Pearl ABS Patch
- #
- # This patch is designed to work with Pearl ABS Liquid V2 script, it add some
- # great features to the main engine, enchant the game play, apply some bug fix
- # and much more.
- #
- #------------------------------------------------------------------------------
- # * Features
- #
- # - User and Projectiles iconset graphic enabled
- # - User graphic has 3 different animation types to chose from
- # - Projectile graphics has 2 animation types
- # - All battle members dead fix
- # - Repeated shield bug fix
- # - Self switch note tag bug fix (now able to use the Dead enemy self witch tag)
- # - Now able to erase an enemy forever when dead (if tagged with self switch)
- # - Game play enchanted
- #-----------------------------------------------------------------------------
- #
- # * Installation
- #
- # Paste this script BELOW Pearl ABS Liquid V2 scripts
- #-----------------------------------------------------------------------------
- #
- # * User and projectiles iconset graphic instructions
- #
- # Tag any weapon, armor, item or skill with the followings note tags
- #
- # User Iconset = animated - You have 3 options available:
- # animated, static, shielding. animated plays
- # 3 patterns swing effect. static plays only one
- # and shielding for shield usage effect
- #
- # Projectile Iconset = animated - you have 2 options available
- # animated and static.
- # animated play a zoom in and zoom out effect
- # static plays no effect
- #-------------------------------------------------------------------------------
- # * License
- #
- # This script adopt the same terms of use of Pearl ABS
- #-----------------------------------------------------------------------------
- #==============================================================================
- # * User and prjectiles icon sprites feature
- #==============================================================================
- ($imported ||= {})[:Fantastic_Pearl_ABS_Patch] = 1.0
- class Game_CharacterBase
- attr_accessor :user_iconset, :pro_iconset
- end
- class Sprite_Character < Sprite_Base
- def iconset_graphic?
- !@character.user_iconset.nil? || !@character.pro_iconset.nil?
- end
- alias falcao_fantastic_bit update_bitmap
- def update_bitmap
- if iconset_graphic?
- if @apply_iconset.nil?
- icon = @character.user_iconset[0] if !@character.user_iconset.nil? and
- @character.is_a?(Anime_Obj)
- icon = @character.pro_iconset[0] if !@character.pro_iconset.nil? and
- @character.is_a?(Projectile)
- set_iconsetbitmap(icon)
- @apply_iconset = true
- end
- apply_breath_effect2(@character) if !@character.pro_iconset.nil? and
- @character.is_a?(Projectile) and @character.pro_iconset[1] == :animated
- @enable_angle = @character.user_iconset[1] if
- !@character.user_iconset.nil? and @character.is_a?(Anime_Obj)
- return
- end
- falcao_fantastic_bit
- end
- alias falcao_fantastic_update_position update_position
- def update_position
- falcao_fantastic_update_position
- set_angle_changes(@enable_angle) if @enable_angle != nil
- end
- def apply_angle_pattern(x_plus, y_plus, angle)
- self.x = @character.user.screen_x + x_plus
- self.y = @character.user.screen_y + y_plus
- self.angle = angle
- end
- def set_angle_changes(type)
- ani= @character.user.anime_speed.to_f/@character.original_speed.to_f * 100.0
- case ani
- when 80..100
- perform_animated(0) if type == :animated
- when 60..80
- perform_animated(1) if type == :animated
- when 0..60
- perform_animated(2) if type == :animated
- end
- if type != :animated
- perform_static if type == :static
- perform_shielding if type == :shielding
- end
- end
- # animated
- def perform_animated(pattern)
- case pattern
- when 0
- apply_angle_pattern(10, -12, -166) if @character.user.direction == 2
- if @character.user.direction == 4 || @character.user.direction == 6
- apply_angle_pattern(-8, -26, -46)
- self.z = @character.user.screen_z - 1
- end
- apply_angle_pattern(-22, -10, 0) if @character.user.direction == 8
- when 1
- apply_angle_pattern(0, 0, -266) if @character.user.direction == 2
- apply_angle_pattern(-20, -10, 12) if @character.user.direction == 4
- apply_angle_pattern(7, -20, -78) if @character.user.direction == 6
- if @character.user.direction == 8
- apply_angle_pattern(-8, -26, -46)
- self.z = @character.user.screen_z - 1
- end
- when 2
- apply_angle_pattern(8, -5, -210) if @character.user.direction == 2
- apply_angle_pattern(-10, 2, 52) if @character.user.direction == 4
- apply_angle_pattern(8, -15, -126) if @character.user.direction == 6
- apply_angle_pattern(10, -16, - 100) if @character.user.direction == 8
- end
- end
- # static
- def perform_static
- apply_angle_pattern(8, -5, -210) if @character.user.direction == 2
- apply_angle_pattern(-10, 2, 52) if @character.user.direction == 4
- apply_angle_pattern(8, -15, -126) if @character.user.direction == 6
- if @character.user.direction == 8
- apply_angle_pattern(-8, -26, -46)
- self.z = @character.user.screen_z - 1
- end
- end
- # shielding
- def perform_shielding
- apply_angle_pattern(2, 4, 0) if @character.user.direction == 2
- apply_angle_pattern(-10, 0, 0) if @character.user.direction == 4
- if @character.user.direction == 6
- apply_angle_pattern(10, 0, 0)
- self.z = @character.user.screen_z - 1
- elsif @character.user.direction == 8
- apply_angle_pattern(11, -9, 0)
- self.z = @character.user.screen_z - 1
- end
- end
- def apply_breath_effect2(char)
- char.zoomfx_x -= 0.03 if !char.zfx_bol
- char.zoomfx_y -= 0.03 if !char.zfx_bol
- char.zoomfx_x += 0.03 if char.zfx_bol
- char.zoomfx_y += 0.03 if char.zfx_bol
- char.zfx_bol = true if char.zoomfx_x <= 0.84
- char.zfx_bol = false if char.zoomfx_x >= 1.0
- end
- alias falcao_fantastic_src update_src_rect
- def update_src_rect
- return if iconset_graphic?
- falcao_fantastic_src
- end
- def set_iconsetbitmap(icon_index, enabled = true)
- self.bitmap = Bitmap.new(24, 24)
- bit = Cache.system("Iconset")
- rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
- self.bitmap.blt(0, 0, bit, rect, enabled ? 255 : 150)
- @cw = self.ox = 12
- @ch = self.oy = 24
- end
- end
- module PearlKernel
- def self.check_iconset(item, tag, object)
- data = item.tool_data(tag, false)
- return if data.nil?
- v = [item.icon_index, data.to_sym] if data == "animated" ||
- data == "static" || data == "shielding"
- object.is_a?(Projectile) ? object.pro_iconset = v : object.user_iconset = v
- end
- end
- class Projectile < Game_Character
- alias falcao_fantastic_load load_item_data
- def load_item_data
- PearlKernel.check_iconset(@item, "Projectile Iconset = ", self)
- falcao_fantastic_load
- @character_name = "" if @pro_iconset != nil
- end
- end
- class Anime_Obj < Game_Character
- alias falcao_fantastic_animeini initialize
- def initialize(user, item)
- falcao_fantastic_animeini(user, item)
- PearlKernel.check_iconset(@item, "User Iconset = ", self)
- @character_name = "" if @user_iconset != nil
- end
- end
- #==============================================================================
- # all battle members dead issue fix
- #==============================================================================
- class Game_CharacterBase
- alias falcao_fantastic_collapse update_battler_collapse
- def update_battler_collapse
- falcao_fantastic_collapse
- check_for_dead_four if @colapse_time == 0
- end
- def check_for_dead_four
- return if $game_party.members.size <= 4
- SceneManager.goto(Scene_Gameover) if all_fourdead?
- end
- def all_fourdead?
- m = $game_party.battle_members
- return true if m[0].dead? && m[1].dead? && m[2].dead? && m[3].dead?
- return false
- end
- alias falcao_fantastic_anim create_anime_sprite_object
- def create_anime_sprite_object(item)
- falcao_fantastic_anim(item)
- if PearlKernel.user_graphic == "nil" and
- !item.tool_data("User Iconset = ", false).nil?
- return if PearlKernel.user_graphic.nil?
- $game_player.anime_action.push(Anime_Obj.new(self, item))
- end
- end
- end
- #==============================================================================
- # Hardcoding projectiles, repeated shield bug issue
- #==============================================================================
- class Spriteset_Map
- def update_projectile_sprites
- @projectile_sprites.each {|sprite| sprite.update if !sprite.disposed?}
- $game_player.projectiles.each do |projectile|
- unless projectile.draw_it
- @projectile_sprites.push(Sprite_Character.new(@viewport1, projectile))
- projectile.draw_it = true
- end
- if projectile.destroy_it
- @projectile_sprites.each {|i|
- if i.character.is_a?(Projectile) and i.character.destroy_it
- i.dispose
- @projectile_sprites.delete(i)
- end
- }
- if projectile.user.making_spiral
- projectile.user.making_spiral = false
- end
- if projectile.user.battler_guarding[0]
- projectile.user.battler_guarding = [false, nil]
- projectile.user.battler.remove_state(9)
- end
- $game_player.projectiles.delete(projectile)
- end
- end
- end
- end
- #==============================================================================
- # Self switch note tag bug issue fix
- # now enemies can be erased forever when note ntagged with a self switch
- #==============================================================================
- class Game_CharacterBase
- alias falcaopearl_fx update_state_effects
- def update_state_effects
- return if battler.nil?
- falcaopearl_fx
- end
- end
- class Sprite_LifeBars < Sprite
- alias falcaopearl_fx_up update
- def update
- if battler.nil?
- dispose
- return
- end
- falcaopearl_fx_up
- end
- end
- class Game_System
- attr_accessor :remain_killed
- alias falcao_fantastic_store_ini initialize
- def initialize
- falcao_fantastic_store_ini
- @remain_killed = {}
- end
- end
- class Game_Event < Game_Character
- alias falcao_fantastic_register register_enemy
- def register_enemy(event)
- if !$game_system.remain_killed[$game_map.map_id].nil? and
- $game_system.remain_killed[$game_map.map_id].include?(self.id)
- return
- end
- falcao_fantastic_register(event)
- end
- def run_assigned_commands
- transform = @enemy.enemy.tool_data("Enemy Die Transform = ")
- switch = @enemy.enemy.tool_data("Enemy Die Switch = ")
- $game_switches[switch] = true if switch != nil
- variable = @enemy.enemy.tool_data("Enemy Die Variable = ")
- $game_variables[variable] += 1 if variable != nil
- self_sw = @enemy.enemy.tool_data("Enemy Die Self Switch = ", false)
- $game_map.event_enemies.delete(self) if @enemy.object
- $game_map.enemies.delete(@enemy) if @enemy.object
- if self_sw.is_a?(String)
- $game_self_switches[[$game_map.map_id, self.id, self_sw]] = true
- apply_respawn
- $game_map.event_enemies.delete(self)
- $game_map.enemies.delete(@enemy)
- unless $game_system.remain_killed.has_key?($game_map.map_id)
- $game_system.remain_killed[$game_map.map_id] = []
- end
- $game_system.remain_killed[$game_map.map_id].push(self.id) unless
- $game_system.remain_killed[$game_map.map_id].include?(self.id)
- @enemy = nil
- else
- erase unless @deadposee
- end
- if transform != nil
- @enemy = Game_Enemy.new(0, transform)
- apply_respawn
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement