Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Shanghai's Fancy Deaths+, Shanghai's script with an added Boss Death feature.
nohmaan
post Mar 3 2011, 05:21 PM
Post #1


Level 5
Group Icon

Group: Member
Posts: 68
Type: Developer
RM Skill: Skilled




Fancy Boss Deaths
This script uses Shanghai's fancy death script (located here Fancy Deaths). It requires changing a few things around in a couple different places, so to make it easiest to use I'll just add a copy of the whole script.

This script brings back the functionality of the Epic Boss Deaths which were super cool in the tankentai battle system, by Enu. By using <fancy death: boss> in the note section- when the enemy dies, the screen will flash twice and the enemy will slowly fade into the ground. It should be compatible with anything fancy deaths is compatible with.

CODE
#======================================================================
=========
#
# Shanghai Simple Script - Fancy Deaths
# Last Date Updated: 2010.05.09
# Level: Normal
#
# This makes certain enemies die a fancy way if they have the fancy death tags
# inside of their notebox. These were made for the default animations. If you
# are using different animations, you can change the IDs these fancy deaths use.
# Works for default battle system, Battle Engine Melody, and Tankentai.
#
# Boss collapse code written by Enu ( http://rpgex.sakura.ne.jp/home/ ) and
# added by Nohmaan (but just give credit to Shanghai and Enu).
#===============================================================================
# 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.
#
# <fancy death: string>
# Replace string with one of the ones below:
# fire - Makes the enemy die in a fancy fiery death.
# ice - Makes the enemy freeze and die.
# elec - Makes the enemy spark and die.
# water - Makes the enemy melt and die.
# stone - Makes the enemy change to stone.
# wind - Makes the enemy vanish with the wind.
# holy - Makes the enemy disappear into light.
# dark - Makes the enemy disappear into darkness.
# boss - Mimics the Epic Boss collapse from the Tankentai Battle System
#===============================================================================

$imported = {} if $imported == nil
$imported["FancyDeaths"] = true

module SSS
# Fiery death animation IDs.
FIERY_DEATH_ANI1 = 2
FIERY_DEATH_ANI2 = 79
# Icy death animation IDs.
ICY_DEATH_ANI1 = 62
ICY_DEATH_ANI2 = 3
# Electric death animation IDs.
ELECTRIC_DEATH_ANI1 = 18
ELECTRIC_DEATH_ANI2 = 4
# Watery death animation ID.
WATERY_DEATH_ANI = 69
# Stone death animation ID.
STONE_DEATH_ANI = 40
# Wind death animation ID.
WINDY_DEATH_ANI1 = 73
WINDY_DEATH_ANI2 = 31
# Holy death animation ID.
HOLY_DEATH_ANI1 = 42
HOLY_DEATH_ANI2 = 75
# Dark death animation ID.
DARK_DEATH_ANI1 = 77
DARK_DEATH_ANI2 = 51
end

#==============================================================================
# RPG::Enemy
#==============================================================================

class RPG::Enemy
#--------------------------------------------------------------------------
# fancy death
#--------------------------------------------------------------------------
def fancy_death
return @fancy_death if @fancy_death != nil
@fancy_death = 0
self.note.split(/[\r\n]+/).each { |line|
case line
when /<(?:FANCY_DEATH|fancy death):[ ](.*)>/i
case $1.upcase
when "FIRE"
@fancy_death = 1
when "ICE"
@fancy_death = 2
when "ELEC"
@fancy_death = 3
when "WATER"
@fancy_death = 4
when "STONE"
@fancy_death = 5
when "WIND"
@fancy_death = 6
when "HOLY"
@fancy_death = 7
when "DARK"
@fancy_death = 8
when "BOSS"
@fancy_death = 9
end
end
}
return @fancy_death
end
end

#==============================================================================
# ** Sprite_Battler
#==============================================================================

class Sprite_Battler < Sprite_Base
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :effect_duration
#--------------------------------------------------------------------------
# * Set New Effect
#--------------------------------------------------------------------------
alias setup_new_effect_sss_fancy_deaths setup_new_effect unless $@
def setup_new_effect
if @battler.collapse and @battler.is_a?(Game_Enemy)
if @battler.enemy.fancy_death > 0
@battler.collapse = false
@battler_visible = false
case @battler.enemy.fancy_death
when 1 # Fiery Death
@effect_type = 574897410001
@effect_duration = 169
return
when 2 # Icy Death
@effect_type = 574897410002
@effect_duration = 125
return
when 3 # Electric Death
@effect_type = 574897410003
@effect_duration = 97
return
when 4 # Watery Death
@effect_type = 574897410004
@effect_duration = 101
return
when 5 # Stone Death
@effect_type = 574897410005
@effect_duration = 81
return
when 6 # Windy Death
@effect_type = 574897410006
@effect_duration = 91
return
when 7 # Holy Death
@effect_type = 574897410007
@effect_duration = 106
return
when 8 # Dark Death
@effect_type = 574897410008
@effect_duration = 91
return
when 9 # Boss Death
@effect_type = 574897410009
@effect_duration = 380
return
end
end
end
setup_new_effect_sss_fancy_deaths
end
#--------------------------------------------------------------------------
# * Update Effect
#--------------------------------------------------------------------------
alias update_effect_sss_fancy_deaths update_effect unless $@
def update_effect
if @effect_duration > 0
case @effect_type
when 574897410001
update_fiery_death
return
when 574897410002
update_icy_death
return
when 574897410003
update_electric_death
return
when 574897410004
update_watery_death
return
when 574897410005
update_stone_death
return
when 574897410006
update_windy_death
return
when 574897410007
update_holy_death
return
when 574897410008
update_dark_death
return
when 574897410009
update_boss_death
return
end
end
update_effect_sss_fancy_deaths
end
#--------------------------------------------------------------------------
# * Start Death Animation
#--------------------------------------------------------------------------
def start_death_animation(animation, mirror)
if $imported["BattleEngineMelody"]
start_sub_animation(animation, mirror)
else
start_animation(animation, mirror)
end
end
#--------------------------------------------------------------------------
# * Update Fiery Death
#--------------------------------------------------------------------------
def update_fiery_death
@effect_duration -= 1
self.blend_type = 1
case @effect_duration
when 168, 138, 108, 78
self.color.set(255, 128, 128, 128)
start_death_animation($data_animations[SSS::FIERY_DEATH_ANI1], false)
when 48
start_death_animation($data_animations[SSS::FIERY_DEATH_ANI2], false)
when 0..47
self.opacity = 256 - (48 - @effect_duration) * 6
end
end
#--------------------------------------------------------------------------
# * Update Icy Death
#--------------------------------------------------------------------------
def update_icy_death
@effect_duration -= 1
self.blend_type = 1
case @effect_duration
when 124
self.color.set(128, 128, 255, 128)
start_death_animation($data_animations[SSS::ICY_DEATH_ANI1], false)
when 48
start_death_animation($data_animations[SSS::ICY_DEATH_ANI2], false)
when 0..47
self.opacity = 256 - (48 - @effect_duration) * 6
end
end
#--------------------------------------------------------------------------
# * Update Electric Death
#--------------------------------------------------------------------------
def update_electric_death
@effect_duration -= 1
self.blend_type = 1
case @effect_duration
when 96
self.color.set(255, 255, 128, 128)
start_death_animation($data_animations[SSS::ELECTRIC_DEATH_ANI1], false)
when 48
start_death_animation($data_animations[SSS::ELECTRIC_DEATH_ANI2], false)
when 0..47
self.opacity = 256 - (48 - @effect_duration) * 6
end
end
#--------------------------------------------------------------------------
# * Update Watery Death
#--------------------------------------------------------------------------
def update_watery_death
@effect_duration -= 1
self.blend_type = 1
case @effect_duration
when 49
self.color.set(64, 64, 255, 128)
self.wave_amp = 10
self.wave_speed = 3600
when 61..99
self.wave_speed += 100
when 60
start_death_animation($data_animations[SSS::WATERY_DEATH_ANI], false)
when 0..47
self.opacity = 256 - (48 - @effect_duration) * 6
end
end
#--------------------------------------------------------------------------
# * Update Stone Death
#--------------------------------------------------------------------------
def update_stone_death
@effect_duration -= 1
case @effect_duration
when 80
start_death_animation($data_animations[SSS::STONE_DEATH_ANI], false)
when 0..79
opacity = [(80 - @effect_duration) * 4, 200].min
self.color.set(200, 200, 200, opacity)
end
end
#--------------------------------------------------------------------------
# * Update Windy Death
#--------------------------------------------------------------------------
def update_windy_death
@effect_duration -= 1
self.blend_type = 1
case @effect_duration
when 90
self.color.set(128, 255, 128, 128)
start_death_animation($data_animations[SSS::WINDY_DEATH_ANI1], false)
when 45
start_death_animation($data_animations[SSS::WINDY_DEATH_ANI2], false)
self.visible = false
when 0
self.opacity = 0
self.visible = true
end
end
#--------------------------------------------------------------------------
# * Update Holy Death
#--------------------------------------------------------------------------
def update_holy_death
@effect_duration -= 1
self.blend_type = 1
case @effect_duration
when 105
self.color.set(255, 255, 255, 128)
start_death_animation($data_animations[SSS::HOLY_DEATH_ANI1], false)
when 45
start_death_animation($data_animations[SSS::HOLY_DEATH_ANI2], false)
when 0..44
self.opacity = 256 - (48 - @effect_duration) * 6
end
end
#--------------------------------------------------------------------------
# * Update Dark Death
#--------------------------------------------------------------------------
def update_dark_death
@effect_duration -= 1
self.blend_type = 1
case @effect_duration
when 90
self.color.set(0, 0, 0, 128)
start_death_animation($data_animations[SSS::DARK_DEATH_ANI1], false)
when 60
self.visible = false
when 45
start_death_animation($data_animations[SSS::DARK_DEATH_ANI2], false)
when 0
self.opacity = 0
self.visible = true
end
end
#end
#---------------------------------------------------------------------------
# * Update Boss Death
#---------------------------------------------------------------------------
def update_boss_death
@effect_duration -= 1
if @effect_duration == 320
Audio.se_play("Audio/SE/Absorb1", 100, 80)
self.flash(Color.new(255, 255, 255), 60)
viewport.flash(Color.new(255, 255, 255), 20)
end
if @effect_duration == 280
Audio.se_play("Audio/SE/Absorb1", 100, 80)
self.flash(Color.new(255, 255, 255), 60)
viewport.flash(Color.new(255, 255, 255), 20)
end
if @effect_duration == 220
Audio.se_play("Audio/SE/Earth4", 100, 80)
self.blend_type = 1
self.color.set(255, 128, 128, 128)
self.wave_amp = 6
end
if @effect_duration < 220
self.src_rect.set(0, @effect_duration / 2 - 110, @width, @height)
self.x += 8 if @effect_duration % 4 == 0
self.x -= 8 if @effect_duration % 4 == 2
self.wave_amp += 1 if @effect_duration % 10 == 0
self.opacity = @effect_duration
return if @effect_duration < 50
Audio.se_play("Audio/SE/Earth4", 100, 50) if @effect_duration % 50 == 0
end
end
end
#==============================================================================
# ** Spriteset_Battle
#==============================================================================

class Spriteset_Battle
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :enemy_sprites
end

#==============================================================================
# ** Scene_Battle
#==============================================================================

class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# * wait_for_deaths
#--------------------------------------------------------------------------
def wait_for_deaths
update_basic
loop do
amount = 0
for sprite in @spriteset.enemy_sprites
amount += 1 if sprite.effect_duration <= 0
end
break if amount >= @spriteset.enemy_sprites.size
update_basic
end
end
#--------------------------------------------------------------------------
# * Process Victory
#--------------------------------------------------------------------------
alias process_victory_sss_fancy_deaths process_victory unless $@
def process_victory
if $imported["BattleEngineMelody"]
@judge_win_loss = true
pause_atb(true, true)
@enemy_gauge_window.dispose if @enemy_gauge_window != nil
@hide_battlecursor = true
@party_input_flag = true
@message_window.visible = true
end
wait_for_deaths
process_victory_sss_fancy_deaths
end
end

#===============================================================================
#
# END OF FILE
#
#===============================================================================


You can get the YEM that works with Fancy Deaths, along with Shanghai's scripts here.


__________________________
Go to the top of the page
 
+Quote Post
   
Neosky5k
post Aug 29 2011, 09:04 PM
Post #2


Level 2
Group Icon

Group: Member
Posts: 18
Type: None
RM Skill: Undisclosed




Sorry to necro, but it says Tankentai? Does this mean it works with it? Cause i havn't got it to work with it yet. Just wondering, this would be great to use I love it soooo much. SSS and Yanfly are the best~
Go to the top of the page
 
+Quote Post
   
nohmaan
post Aug 29 2011, 10:20 PM
Post #3


Level 5
Group Icon

Group: Member
Posts: 68
Type: Developer
RM Skill: Skilled




Negative, my version of the code will work ONLY with the Yanfly Battle Engine Melody. If you want it to work with RPG Tankentai, you'll need to use the original code by Kylock:

CODE
#==============================================================================
# ■ EPIC BATTLES 1.1 for RPG Tankentai Sideview Battle System
#     5.12.2008
#------------------------------------------------------------------------------
#  Script by: Kylock
#==============================================================================
#   This little script provides EPIC functionality to your battle system - The
# ability to easily define and create boss encounters.  Or any other noteworthy
# battle as you will see.  The first function is to define special collapses or
# death animations for special enemies.  Instead of the normal fade, they make
# some popping sounds as they fade, or something... The second function allows
# you to specify special battle BGM and victory ME for certain battles.  This
# is set up by using the Troops ID in your game database.  You can set up as
# many special battle BGM's as you can imagine.  Just add to the existing
# arrays.  It's not too hard, just look below for the example.
#==============================================================================
# ● Change Log
#------------------------------------------------------------------------------
#  1.0 - Original Release.
#  1.1 - Fixed a huge problem where the script would only work in random map
#        encounters.  It turns out theres no easy way (that I can find) to read
#        the troop id.  So instead, I hate doing this, but until I figure it
#        out, the boss fight needs to set a variable before the fight to tell
#        the script what music and me to use.  What's imporant though is that
#        this script is now useable and functional for practical use.
#==============================================================================
# ● Shameless Plug
#------------------------------------------------------------------------------
#   I STRONGLY suggest using my Fade Battle End ME script if you use custom
# fanfares.  It is distributed on a plethora of forums, or you can find it
# here: (http://rmvxpuniverse.com/forum/showthread.php?t=1434)
#==============================================================================

module K_EPIC_BATTLES
  ENEMY_ID = [2,6,7,8] # list of enemies that collapse like EPIC FOES!!!(ex. [1,24])
  EPIC_VARIABLE = 11 # Set this variable in your game databse in your event
                     # before starting the epic battle.  If the variable is set
                     # to 1, then the game will use EPIC_TUNE[1], etc...
  
  # create dynamic arrays
  EPIC_TUNE = Array.new
  EPIC_FANFARE = Array.new

  # EPIC_TUNE[x]    = The name of a truly EPIC TUNE(BGM) for your EPIC BATLE!!!
  # EPIC_FANFARE[x] = The name of truly EPIC VICTORY MUSIC(ME) for your battle.
  # You can add more for variety by making EPIC_TUNE[2],[3],etc...
  
  EPIC_TUNE[1]= "Battle10"
  EPIC_FANFARE[1] = "Fanfare1"

  EPIC_TUNE[2]= "Battle6"
  EPIC_FANFARE[2] = "Victory2"
end

#==============================================================================
# EPIC DEATHS!!!
#==============================================================================
class Game_Enemy < Game_Battler
  alias k_epic_battles_collapse_type collapse_type
  def collapse_type
    for x in K_EPIC_BATTLES::ENEMY_ID
      return 3 if @enemy_id == x
    end
    k_epic_battles_collapse_type
  end
end

#==============================================================================
# EPIC TUNES!!!
#==============================================================================
class Scene_Map < Scene_Base
  alias k_epic_battles_call_battle call_battle
  def call_battle
    $k_epic_battles_bgm = $data_system.battle_bgm.name
    $k_epic_battles_me = $data_system.battle_end_me.name
    if $game_variables[K_EPIC_BATTLES::EPIC_VARIABLE] != 0
      $data_system.battle_bgm.name = K_EPIC_BATTLES::EPIC_TUNE[$game_variables[K_EPIC_BATTLES::EPIC_VARIABLE]]
      $game_system.battle_end_me.name = K_EPIC_BATTLES::EPIC_FANFARE[$game_variables[K_EPIC_BATTLES::EPIC_VARIABLE]]
    end
    k_epic_battles_call_battle
  end
end

class Scene_Battle < Scene_Base
  alias k_epic_battles_battle_end battle_end
  def battle_end(result)
    k_epic_battles_battle_end(result)
    $game_variables[K_EPIC_BATTLES::EPIC_VARIABLE] = 0
    $data_system.battle_bgm.name = $k_epic_battles_bgm
    $game_system.battle_end_me.name = $k_epic_battles_me
  end
end


QUOTE (Neosky5k @ Aug 29 2011, 09:04 PM) *
Sorry to necro, but it says Tankentai? Does this mean it works with it? Cause i havn't got it to work with it yet. Just wondering, this would be great to use I love it soooo much. SSS and Yanfly are the best~



__________________________
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 25th May 2013 - 02:44 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker