Hey guys need some help. I am trying to make it to where when i am in a battle and the enemy goes down to a specific % of health they transform into something else, without resetting the HP. How would I go about doing this?
Enemy transformation
RPG Maker VXAce SupportIn the troop database, you can create an event which triggers once per battle, using the enemy HP condition.
From there, just use the "Enemy Transform" command. HP and MP will be preserved by default.
From there, just use the "Enemy Transform" command. HP and MP will be preserved by default.
I did that, but when I do the enemy HP resets to full.
I think there is a script that helps with the hp reset thing.
Otherwise, just set the max hp for the new enemy to the % for when the first enemy was supposed to change at.
Otherwise, just set the max hp for the new enemy to the % for when the first enemy was supposed to change at.
I can't seem to find script that does what I need.
yea, I'm having trouble finding it. I was pretty sure that there was one.
but this may be a way as well with a variable
forums.rpgmakerweb.com
I started working on making a script for this.
So far I've modified yanfly's enemy death transform script and it works, but there is no pizzazz.
The enemy changes in a split second. working on it.
If there are any scripters that can help with this. Thanks
So far the best I could do is play an animation. I was trying to get it to do a custom collapse using Custom Collapse Effects V1.6 script from ShadowMaster. But I can't see a way to call Game_Sprite collapse from Game_Enemy.
but this may be a way as well with a variable
Enemy transformation during battle?
I'm wondering if there's a script or some kind of common event trick that I can use to make an enemy's sprite change partway through battle without resetting its HP. For example, when fighting a masked boss the mask cracks when he's at 50% HP, and falls off when he's defeated. Is there any...
forums.rpgmakerweb.com
I started working on making a script for this.
So far I've modified yanfly's enemy death transform script and it works, but there is no pizzazz.
The enemy changes in a split second. working on it.
If there are any scripters that can help with this. Thanks
So far the best I could do is play an animation. I was trying to get it to do a custom collapse using Custom Collapse Effects V1.6 script from ShadowMaster. But I can't see a way to call Game_Sprite collapse from Game_Enemy.
Ruby:
#==============================================================================
#
# ▼ Roninator2 - Enemy Staged Transform v1.00
# -- Last Updated: 2020.05.08
# -- Level: Normal
# -- Requires: n/a
# -- Format copied from Yanfly Enemy Death Transform script
#==============================================================================
$imported = {} if $imported.nil?
$imported["R2-EnemyStagedTransform"] = true
#==============================================================================
# ▼ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2020.05.08 - Started Script and Finished.
#
#==============================================================================
# ▼ Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script allows enemies to transform into another monster when they reach
# a specified HP percentage remaining (or lower)
#
#==============================================================================
# ▼ Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
#
# -----------------------------------------------------------------------------
# Enemy Notetags - These notetags go in the enemy notebox in the database.
# -----------------------------------------------------------------------------
# <staged transform: x>
# Sets the current enemy type to transform into enemy x upon reaching hp%.
#
# <staged transform hp percent: x%>
# Sets the transform rate for the current enemy to be x%. If the previous tag
# is not used, then this notetag has no effect.
#
# <staged transform anim: x>
# Sets the animation to play on the enemy upon transforming.
#
#==============================================================================
# ▼ Compatibility
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
# it will run with RPG Maker VX without adjusting.
#
#==============================================================================
# ▼ Editting anything past this point may potentially result in causing
# computer damage, incontinence, explosion of user's head, coma, death, and/or
# halitosis so edit at your own risk.
#==============================================================================
module R2
module REGEXP
module ENEMY
STAGED_TRANSFORM = /<(?:STAGED_TRANSFORM|staged transform):[ ](\d+)>/i
STAGED_TRANSFORM_HP_PERCENT =
/<(?:STAGED_TRANSFORM_HP_PERCENT|staged transform hp percent):[ ](\d+)([%%])>/i
STAGED_TRANSFORM_ANIM = /<(?:STAGED_TRANSFORM_ANIM|staged transform anim):[ ](\d+)>/i
end # ENEMY
end # REGEXP
end # R2
#==============================================================================
# ■ DataManager
#==============================================================================
module DataManager
#--------------------------------------------------------------------------
# alias method: load_database
#--------------------------------------------------------------------------
class <<self; alias load_database_edtr2 load_database; end
def self.load_database
load_database_edtr2
load_notetags_edtr2
end
#--------------------------------------------------------------------------
# new method: load_notetags_edt
#--------------------------------------------------------------------------
def self.load_notetags_edtr2
for obj in $data_enemies
next if obj.nil?
obj.load_notetags_edt
end
end
end # DataManager
#==============================================================================
# ■ RPG::Enemy
#==============================================================================
class RPG::Enemy < RPG::BaseItem
#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_accessor :staged_transform
attr_accessor :staged_transform_anim
attr_accessor :staged_transform_hp_percent
#--------------------------------------------------------------------------
# common cache: load_notetags_edt
#--------------------------------------------------------------------------
def load_notetags_edt
@staged_transform = 0
@staged_transform_hp_percent = 1.0
@staged_transform_anim = 0
#---
self.note.split(/[\r\n]+/).each { |line|
case line
#---
when R2::REGEXP::ENEMY::STAGED_TRANSFORM
@staged_transform = $1.to_i
when R2::REGEXP::ENEMY::STAGED_TRANSFORM_HP_PERCENT
@staged_transform_hp_percent = $1.to_f
when R2::REGEXP::ENEMY::STAGED_TRANSFORM_ANIM
@staged_transform_anim = $1.to_i
end
} # self.note.split
#---
end
end # RPG::Enemy
#==============================================================================
# ■ Game_Battler
#==============================================================================
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# alias method: execute damage
#--------------------------------------------------------------------------
alias game_battler_damage_edt execute_damage
def execute_damage(user)
game_battler_damage_edt(user)
return staged_transform if meet_staged_transform_requirements?
end
#--------------------------------------------------------------------------
# new method: meet_death_transform_requirements?
#--------------------------------------------------------------------------
def meet_staged_transform_requirements?
return false unless enemy?
return false unless enemy.staged_transform > 0
return false if enemy.staged_transform.nil?
return false if enemy.staged_transform_hp_percent.nil?
hp = self.hp.to_f
mhp = enemy.params[0].to_f
rate = (hp / mhp).to_f * 100
compare = enemy.staged_transform_hp_percent
return rate < compare
end
#--------------------------------------------------------------------------
# new method: death_transform
#--------------------------------------------------------------------------
def staged_transform
self.animation_id = enemy.staged_transform_anim
transform(enemy.staged_transform)
end
end # Game_Battler
#==============================================================================
#
# ▼ End of File
#
#==============================================================================
Ruby:
# ===============================================================================
# Custom Collapse Effects V1.6 (01/8/2015)
# -------------------------------------------------------------------------------
# Created By: Shadowmaster/Shadowmaster9000/Shadowpasta(www.crimson-castle.co.uk)
# ===============================================================================
# Information
# -------------------------------------------------------------------------------
# This script allows you to customise collapse effects for both enemies and even
# actors (collapse effects for actors will only work if using an actor battler
# sprite script like Yami's Battle Engine Symphony).
# Collapse effect customisationis done through notetagging and you can find the
# notetags below.
# ===============================================================================
# How to Use
# -------------------------------------------------------------------------------
# Place this script under Materials. It's also best to put this script under
# any other scripts that overwrite the perform_collapse_effect methods in either
# the Game_Actor or Game_Enemy classes.
# ===============================================================================
# Note Tags
# -------------------------------------------------------------------------------
# Place any of these note tags within an actor or enemy in the database.
# --------------------Actor/Enemy Notetags--------------------
# <custom collapse: n>
# Sets up the duration of the custom collapse, where n is the number of frames
# you want the custom collapse to last (60 frames per second).
# <collapse shake x: n>
# Shakes the battler horizontally, where n is at what frame the shake will start.
# The effect will last until the end of the duration of the collapse effect.
# <collapse shake y: n>
# Shakes the battler vertically, where n is at what frame the shake will start.
# The effect will last until the end of the duration of the collapse effect.
# <collapse fade: n>
# The battler starts fading to nothing, where n is at what frame the fading will
# start. The effect will last until the end of the duration of the collapse effect.
# <collapse fade color: n1 n2 n3>
# Sets the fade color for the battler when using the collapse fade effect. This
# uses the RGB system, with the numbers ranging between 0-255. Red is n1, Green
# is n2 and Blue is n3.
# <collapse sink: n1 n2>
# The battler begins moving downwards, where n1 is at what frame the battler
# will start sinking, and n2 is the speed that the battler will sink
# (you can even use decimal values for n2).
# You do not have to use n2. At default, theeffect will last until the end of
# the duration of the collapse effect whilenot using n2.
# <collapse wave: n>
# The battler's image begins to distort in a wavey like pattern, where n is at
# what frame the wave effect will begin. The effect will last until the end of
# the duration of the collapse effect.
# <collapse sound: "string" n1 n2 n3>
# A sound effect will start constantly playing, where "string" is the name of the
# file in the Audio/SE folder, and n1 is at what frame the sound effects will start
# playing. Variables n2 and n3 change the volume and pitch respectively. Variables
# n2 and n3 do not need to be used. When they are not used, the value 100 is use
# dat default. The effect will last until the end of the duration of the collapse
# effect.
# <fade sound>
# Makes the sound set from the collapse sound effect fade out relative to the
# duration of the collapse effect. This will not effect sound effects played
# from animations used with the collapse animation notetag.
# <collapse animation: n>
# A battle animation will play at the beginning of the battler's collapse, where
# n is the id of the battle animation you want to use. The battle animation
# will run along the rest of the custom collapse effects you have set up for
# the battler.
# <no wait for collapse animation>
# By default the battle system will wait for a battle animation to finish before
# proceeding with the battle, even if the custom collapse itself ended long
# before. Using this notetag will allow the battle to continue when a battle
# animation from a battler's custom collapse effect is still going on.
# ===============================================================================
# Example
# -------------------------------------------------------------------------------
# To help give you a better understanding of how to manipulate these effects
# to achieve various results, below is an example of a custom collapse effect.
# <custom collapse: 230>
# The collapse will last for 230 frames.
# <collapse shake x: 80>
# The battler will begin to shake once 80 frames have gone past.
# <collapse sound: "Collapse4" 80>
# The Collapse4 sound effect will start playing continuously once 80 frames
# have gone past.
# <collapse fade: 110>
# <collapse fade color: 255 0 0>
# The battler will begin to fade in a red color once 110 frames have gone past.
# <collapse sink: 110>
# <collapse wave: 110>
# The battler will begin to sink with a wavey distortion once 110 frames have
# gone past.
# <collapse animation: 111>
# Animation no.111 (which I like to call the Thunder Death animation) will
# start playing.This is what I have set up for the Thunder Death animation:
# #007 Thunder10 Screen (255,255,255,200), @5
# #020 Thunder10 Screen (255,255,255,200), @5
# The Thunder10 sound effect will be played at frames 7 and 20 (word of warning,
# battle animation frames are 15 frames per second and not 60 so the timing will
# be different), along with the screen flashing white, with the flash lasting for
# 5 frames.
# I highly recommend using battle animations for your custom collapse animations
# as it allows for a far larger variety of effects that would otherwise not be
# achievable without them.
# ===============================================================================
# Required-------------------------------------------------------------------------------
# Nothing.
# ===============================================================================
# Compatibility Issues
# -------------------------------------------------------------------------------
# Below are a list of scripts that this script is currently incompatible with.
# A future update may fix these issues but I can't guarantee anything.Yanfly Visual Battlers
# ----------------------
# They've been set up differently to how enemy sprites are loaded up and they
# haven't been set up to load collapse effects when an actor dies. This script
# will still work with enemies while using Visual Battlers, but it won't work
# with actors.
# ===============================================================================
# Change log
# -------------------------------------------------------------------------------
# v1.6: Added the option to fade out sounds using a new notetag.
# (01/8/2015)v1.5: Fixed a bug that didn't rest various graphical effects when an actor
# or enemy with a custom collapse animation is revived.
# (25/5/2015)v1.4: Updated the sound notetag to allow control of the sound's volume and
# pitch. (12/10/2013)v1.3: Fixed the sinking function so the effect will now last for the duration
# of the collapse effect. You can now also set a speed for the battler to sink.
# (27/8/2013)v1.2: Fixed a bug where the battle would continue before finishing a collapse
# animation containing a battle animation that extended to longer than the
# collapse animation's duration. Also allowing users to skip this bug fix with
# a notetag.
# (25/10/2013)v1.1: Fixed a bug where using a battle animation as a custom collapse effect
# would delay the battle log until the battle animation finished. Unfortunately
# the battle animations can no longer be used in conjunction with the default
# collapse animations. (23/10/2013)v1.0: First release. (23/10/2013)
# ===============================================================================
# Terms of Use
# -------------------------------------------------------------------------------
# * Free to use for both commercial and non-commerical projects.
# * Credit me if used.
# * Do not claim this as your own.
# * You're free to post this on other websites, but please credit me and keepthe header intact.
# * If you want to release any modifications/add-ons for this script, theadd-on script must use
# the same Terms of Use as this script uses. (But youcan also require any users of your add-on
# script to credit you in their gameif they use your add-on script.)
# * If you're making any compatibility patches or scripts to help this scriptwork with other
# scripts, the Terms of Use for the compatibility patch doesnot matter so long as the
# compatibility patch still requires this script torun.
# * If you want to use your own seperate Terms of Use for your version oradd-ons of this script,
# you must contact me at http://www.rpgmakervxace.netor www.crimson-castle.co.uk
# ================================================================================
#
$imported = {} if $imported.nil?
$imported["Shadowmaster_Custom_Collapses"] = true
#==============================================================================
# ** DataManager
#------------------------------------------------------------------------------
# This module manages the database and game objects. Almost all of the
# global variables used by the game are initialized by this module.
#==============================================================================
module DataManager
#--------------------------------------------------------------------------
# * Load Database
#--------------------------------------------------------------------------
class <<self; alias load_database_custom_collapse load_database; end
def self.load_database
load_database_custom_collapse
load_notetags_custom_collapse
end
#--------------------------------------------------------------------------
# * Load Notetags for Custom Collapse
#--------------------------------------------------------------------------
def self.load_notetags_custom_collapse
groups = [$data_actors, $data_enemies]
for group in groups
for obj in group
next if obj.nil?
obj.load_notetags_custom_collapse
end
end
end
end
class RPG::BaseItem
#--------------------------------------------------------------------------
# Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :custom_collapse
attr_accessor :collapse_duration
attr_accessor :collapse_shake
attr_accessor :shake_x_start
attr_accessor :shake_y_start
attr_accessor :collapse_fade
attr_accessor :fade_start
attr_accessor :fade_colors
attr_accessor :fade_red
attr_accessor :fade_green
attr_accessor :fade_blue
attr_accessor :wave_start
attr_accessor :sink_start
attr_accessor :sink_speed
attr_accessor :collapse_sound
attr_accessor :sound_start
attr_accessor :sound_volume
attr_accessor :sound_pitch
attr_accessor :sound_fade
attr_accessor :collapse_animation
attr_accessor :no_wait_for_animation
#--------------------------------------------------------------------------
# Defining Attributes
#--------------------------------------------------------------------------
def load_notetags_custom_collapse
@custom_collapse = false
@collapse_duration = 0
@shake_x_start = nil
@shake_y_start = nil
@fade_start = nil
@fade_colors = false
@wave_start = nil
@sink_start = nil
@sink_speed = nil
@collapse_sound = nil
@sound_start = nil
@sound_volume = 100
@sound_pitch = 100
@sound_fade = false
@collapse_animation = nil
@no_wait_for_animation = nil
if @note =~ /<custom collapse: (.*)>/i
@custom_collapse = true
@collapse_duration = $1.to_i
end
if @note =~ /<collapse shake x: (.*)>/i
@shake_x_start = $1.to_i
end
if @note =~ /<collapse shake y: (.*)>/i
@shake_y_start = $1.to_i
end
if @note =~ /<collapse fade: (.*)>/i
@fade_start = $1.to_i
end
if @note =~ /<collapse fade color: (.*) (.*) (.*)>/i
@fade_colors = true
@fade_red = $1.to_i
@fade_green = $2.to_i
@fade_blue = $3.to_i
end
if @note =~ /<collapse wave: (.*)>/i
@wave_start = $1.to_i
end
if @note =~ /<collapse sink: (.*) (.*)>/i
@sink_start = $1.to_i
@sink_speed = $2.to_f
end
if @note =~ /<collapse sound: "(.+?)\" (.*)>/i
@collapse_sound = $1.to_s
@sound_start = $2.to_i
end
if @note =~ /<collapse sound: "(.+?)\" (.*) (.*)>/i
@collapse_sound = $1.to_s
@sound_start = $2.to_i
@sound_volume = $3.to_i
end
if @note =~ /<collapse sound: "(.+?)\" (.*) (.*) (.*)>/i
@collapse_sound = $1.to_s
@sound_start = $2.to_i
@sound_volume = $3.to_i
@sound_pitch = $4.to_i
end
if @note =~ /<fade sound>/i
@sound_fade = true
end
if @note =~ /<collapse animation: (.*)>/i
@collapse_animation = $1.to_i
end
if @note =~ /<no wait for collapse animation>/i
@no_wait_for_animation = true
end
end
end
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# This class handles actors. It is used within the Game_Actors class
# ($game_actors) and is also referenced from the Game_Party class ($game_party).
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :collapse_duration
attr_reader :shake_x_start
attr_reader :shake_y_start
attr_reader :fade_start
attr_reader :fade_colors
attr_reader :fade_red
attr_reader :fade_green
attr_reader :fade_blue
attr_reader :wave_start
attr_reader :sink_start
attr_reader :sink_speed
attr_reader :collapse_sound
attr_reader :sound_start
attr_reader :kovolume
attr_reader :kopitch
attr_reader :sound_fade
attr_reader :collapse_animation
attr_reader :no_wait_for_animation
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias shadowmaster_setup_collapse setup
def setup(actor_id)shadowmaster_setup_collapse(actor_id)
@collapse_duration = actor.collapse_duration
@shake_x_start = actor.shake_x_start
@shake_y_start = actor.shake_y_start
@fade_start = actor.fade_start
@fade_colors = actor.fade_colors
@fade_red = actor.fade_red
@fade_green = actor.fade_green
@fade_blue = actor.fade_blue
@wave_start = actor.wave_start
@sink_start = actor.sink_start
@sink_speed = actor.sink_speed
@collapse_sound = actor.collapse_sound
@sound_start = actor.sound_start
@kovolume = actor.sound_volume
@kopitch = actor.sound_pitch
@sound_fade = actor.sound_fade
@collapse_animation = actor.collapse_animation
@no_wait_for_animation = actor.no_wait_for_animation
end
#--------------------------------------------------------------------------
# * Execute Collapse Effect
#--------------------------------------------------------------------------
alias shadowmaster_perform_collapse_effect perform_collapse_effect
def perform_collapse_effect
if actor.custom_collapse == true
@sprite_effect_type = :shadowmaster_custom_collapse
else
shadowmaster_perform_collapse_effect
end
end
end
#==============================================================================
# ** Game_Enemy
#------------------------------------------------------------------------------
# This class handles enemies. It used within the Game_Troop class
# ($game_troop).
#==============================================================================
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :collapse_duration
attr_reader :shake_x_start
attr_reader :shake_y_start
attr_reader :fade_start
attr_reader :fade_colors
attr_reader :fade_red
attr_reader :fade_green
attr_reader :fade_blue
attr_reader :wave_start
attr_reader :sink_start
attr_reader :sink_speed
attr_reader :collapse_sound
attr_reader :sound_start
attr_reader :kovolume
attr_reader :kopitch
attr_reader :sound_fade
attr_reader :collapse_animation
attr_reader :no_wait_for_animation
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias shadowmaster_initialize_collapse initialize
def initialize(index, enemy_id)
shadowmaster_initialize_collapse(index, enemy_id)
@collapse_duration = enemy.collapse_duration
@shake_x_start = enemy.shake_x_start
@shake_y_start = enemy.shake_y_start
@fade_start = enemy.fade_start
@fade_colors = enemy.fade_colors
@fade_red = enemy.fade_red
@fade_green = enemy.fade_green
@fade_blue = enemy.fade_blue
@wave_start = enemy.wave_start
@sink_start = enemy.sink_start
@sink_speed = enemy.sink_speed
@collapse_sound = enemy.collapse_sound
@sound_start = enemy.sound_start
@kovolume = enemy.sound_volume
@kopitch = enemy.sound_pitch
@sound_fade = enemy.sound_fade
@collapse_animation = enemy.collapse_animation
@no_wait_for_animation = enemy.no_wait_for_animation
end
#--------------------------------------------------------------------------
# * Execute Collapse Effect
#--------------------------------------------------------------------------
alias shadowmaster_perform_collapse_effect perform_collapse_effect
def perform_collapse_effect
if enemy.custom_collapse == true
@sprite_effect_type = :shadowmaster_custom_collapse
else
shadowmaster_perform_collapse_effect
end
end
end
#==============================================================================
# ** Sprite_Battler
#------------------------------------------------------------------------------
# This sprite is used to display battlers. It observes an instance of the
# Game_Battler class and automatically changes sprite states.
#==============================================================================
class Sprite_Battler < Sprite_Base
#--------------------------------------------------------------------------
# * Start Effect
#--------------------------------------------------------------------------
alias shadowmaster_start_effect start_effect
def start_effect(effect_type)
shadowmaster_start_effect(effect_type)
case @effect_type
when :shadowmaster_custom_collapse
@effect_duration = @battler.collapse_duration
@orig_eff_duration = @effect_duration
@shake_x_start = @effect_duration - @battler.shake_x_start if @battler.shake_x_start != nil
@shake_y_start = @effect_duration - @battler.shake_y_start if @battler.shake_y_start != nil
@fade_start = @effect_duration - @battler.fade_start if @battler.fade_start != nil
@wave_start = @effect_duration - @battler.wave_start if @battler.wave_start != nil
@sink_start = @effect_duration - @battler.sink_start if @battler.sink_start != nil
@sink_speed = @battler.sink_speed if @battler.sink_speed != nil
@sound = @battler.collapse_sound if @battler.collapse_sound != nil
@sound_start = @effect_duration - @battler.sound_start if @battler.sound_start != nil
@volume = @battler.kovolume
@pitch = @battler.kopitch
self.wave_amp = 0
@full_sink = 0
@round_sink = 1
@battler_visible = false
if @battler.collapse_animation != nil
animation = $data_animations[@battler.collapse_animation]
start_animation(animation)
SceneManager.scene.wait_for_animation if @battler.no_wait_for_animation == nil
end
end
end
#--------------------------------------------------------------------------
# * Revert to Normal Settings
#--------------------------------------------------------------------------
alias shadowmaster_revert_to_normal revert_to_normal
def revert_to_normal
shadowmaster_revert_to_normal
self.oy = bitmap.height if bitmap
self.wave_amp = 0
end
#--------------------------------------------------------------------------
# * Update Effect
#--------------------------------------------------------------------------
alias shadowmaster_update_effect update_effect
def update_effect
if @effect_type == :shadowmaster_custom_collapse && @effect_duration > 0
shadowmaster_update_custom_collapse
end
shadowmaster_update_effect
end
#--------------------------------------------------------------------------
# * Update Custom Collapse Effect
#--------------------------------------------------------------------------
def shadowmaster_update_custom_collapse
if @fade_start != nil && @fade_start >= @effect_duration
alpha = @effect_duration.to_f / @fade_start.to_f
if @battler.fade_colors == true
@fade_red = @battler.fade_red
@fade_green = @battler.fade_green
@fade_blue = @battler.fade_blue
self.color.set(@fade_red, @fade_green, @fade_blue, 255 * alpha)
else
self.color.set(255, 255, 255, 255 * alpha)
end
self.opacity = 128 * alpha
self.blend_type = 1
end
if @shake_x_start != nil && @shake_x_start >= @effect_duration
self.ox += ((rand(2) + 1) * 5) - ((rand(2) + 1) * 5)
end
if @shake_y_start != nil && @shake_y_start >= @effect_duration
self.oy += ((rand(2) + 1) * 5) - ((rand(2) + 1) * 5)
end
if @sink_start != nil && @sink_start >= @effect_duration
@full_sink += @sink_speed if @sink_speed != nil
@full_sink += (bitmap.height.to_f / @sink_start.to_f) if @sink_speed == nil
while @full_sink >= @round_sink
self.src_rect.y -= 1
@round_sink += 1
end
end
if @wave_start != nil && @wave_start >= @effect_duration && self.wave_amp == 0
self.wave_amp = 8
elsif @wave_start != nil && @wave_start >= @effect_duration && self.wave_amp > 0
self.wave_amp += 2 if @effect_duration % 20 == 0
else
self.wave_amp = 0
end
if @sound != nil && @sound_start != nil && @sound_start >= @effect_duration
if @battler.sound_fade
@volume_mult = @effect_duration.to_f / @sound_start.to_f
else
@volume_mult = 1
end
sound = RPG::SE.new(@sound, @volume * @volume_mult, @pitch)
sound.play if @effect_duration % 20 == 19
end
end
end
# Edited 22 Dec 2015 by Nirwanda
Well, the event is working so far. I will try to mess more with it to see what else I can do.
Try it again. I found a bug. It was working but not really. It has been fixed now. Grab the code again.
Unless someone can advise me on how to do the collapse part, this is a finished script.
was not using the script as I am not looking for a death transformation. The event HP variable thing is working.
Original thread: https://forums.rpgmakerweb.com/threads/enemy-transformation.121149/