Help - Search - Members - Calendar
Full Version: [SSS] Fancy Deaths
RPG RPG Revolution Forums > Scripting > Script Submissions > RGSS2-Submissions
Shanghai
Shanghai Simple Script - Fancy Deaths
made by Shanghai

Since people have been doubting my abilities, here's something small.



Link/Script
Click here

Introduction
This makes enemies explode, melt, turn to stone, etc. when they die. Good for boss deaths.

How to Use
CODE
<fancy death: string>


Put this in the notebox of an enemy. Then replace "string" with one of the following items:

CODE
fire
ice
elec
water
stone
wind
holy
dark


These deaths use the default animation IDs. If you're planning on using different animations and would like to change up the IDs, change the module settings to fit the right animations to the right deaths.

Compatibility
Works with
- Default Battle System
- Battle Engine Melody
Make sure this script goes below your other battle scripts.

For more Shanghai Simple Scripts
Visit Here.
Guyver's Bane
I thinks this will shut them up. Great work. On a side note, I think this is the first time you've posted a script here. But I'm probably wrong!
SojaBird
I just love the way you described this topic!! ^^
<3

Seems to be a awsome script! smile.gif
I hope to see more of you in the future.


Greatzz,
SojaBird.
archeart
Wow this is awesome!

thanks will definitely use this for one of mah games :3
Kread-EX
Sometimes I envy RMVX note boxes...
QUOTE
Because everything needs to explode when they die.

That's true, and you did it well. Your code is clean and the script doesn't lag at all. You proved (if needed) that you're skilled enough to critique scripters. Good job.
Shanghai
QUOTE (Guyver's Bane @ May 6 2010, 09:00 PM) *
I thinks this will shut them up. Great work. On a side note, I think this is the first time you've posted a script here. But I'm probably wrong!

No, I've posted one other before, and it was a YERD/Tankentai compatibility patch which was frankly ignored because people who used Tankentai avoid Yanfly Engine scripts like the plague for some reason.

QUOTE (Kread-EX @ May 7 2010, 07:12 AM) *
Sometimes I envy RMVX note boxes...
QUOTE
Because everything needs to explode when they die.

That's true, and you did it well. Your code is clean and the script doesn't lag at all. You proved (if needed) that you're skilled enough to critique scripters. Good job.

I'm honestly surprised you don't use RMVX or thought about converting since you're kind of limiting yourself by sticking with RMXP. Any particular reason?
AdamWired
haha wow! cool. i think the best way is through the pearly gates backwards in flaming Swedish hyper car though, but unfortunately i don't think that will be possible, even for the best :/ i reckon yours comes a very close second though wink.gif
Legacy
not bad, deffiently be of some use to VX users, makes me wnt to make one for XP haha. I might just do that happy.gif

Either way lovely script.
ZeroManArmy
I have been looking for something like this for the default Battle System
Kread-EX
QUOTE (Shanghai @ May 7 2010, 06:05 PM) *
QUOTE (Kread-EX @ May 7 2010, 07:12 AM) *
Sometimes I envy RMVX note boxes...
QUOTE
Because everything needs to explode when they die.

That's true, and you did it well. Your code is clean and the script doesn't lag at all. You proved (if needed) that you're skilled enough to critique scripters. Good job.

I'm honestly surprised you don't use RMVX or thought about converting since you're kind of limiting yourself by sticking with RMXP. Any particular reason?

I just like XP better that is all. Scripting is less convenient but I'm not limited since I resort to C++ marriage when I have to.
Guyver's Bane
QUOTE (Shanghai @ May 7 2010, 09:05 AM) *
QUOTE (Guyver's Bane @ May 6 2010, 09:00 PM) *
I thinks this will shut them up. Great work. On a side note, I think this is the first time you've posted a script here. But I'm probably wrong!

No, I've posted one other before, and it was a YERD/Tankentai compatibility patch which was frankly ignored because people who used Tankentai avoid Yanfly Engine scripts like the plague for some reason.


Yeah I noticed that too! I don't know why. Yanfly's script are among, if not, the best. Oh well it's their loss.
ZeroManArmy
How do I add other types of deaths? Like Plastic death or lead death or something?
dezz123
This looks great, Shanghai.
Shanghai
Update. Added two more deaths. Holy and Dark.
Guyver's Bane
Why do i get the feeling someones going to request more deaths?
Locke
Awesome script there and thanks smile.gif
SuperMega
Nice script Shanghai. Like how user friendly it is, and everything seems to be working out perfectly as of now.
ZeroManArmy
How do you add your own deaths to it?
Pharonix
Yes, i'm necroing again.

is there a way to change the death depending on type used.

If i use fire, and kill an enemy i might want it to.. you know, die in flames.
Kread-EX
Currently no. Deaths are associated to a type of enemy, not to the skill used.
Sharisk
VERY nice script! I could actually use this. It would be a great addition to any RPG creators game.
yarow12
I can't stand how the animations look for the Wind death (only one I've tried). it actually shows a particular attack before doing the "death animation" (or am I wrong?). Am I the only one who feels this way? For the most part, I'd use it if it weren't for this.
Sanctuary12
QUOTE (Shanghai @ May 7 2010, 08:05 AM) *
QUOTE (Guyver's Bane @ May 6 2010, 09:00 PM) *
I thinks this will shut them up. Great work. On a side note, I think this is the first time you've posted a script here. But I'm probably wrong!

No, I've posted one other before, and it was a YERD/Tankentai compatibility patch which was frankly ignored because people who used Tankentai avoid Yanfly Engine scripts like the plague for some reason.


CAN I PLEASE GET THAT PATCH, I'm BEGGING YOU
Kread-EX
Don't post in caps, it's rude. She was mentioning this: http://www.rpgrevolution.com/forums/index....showtopic=32752.
nohmaan
I was wondering if it was possible to add a new death option. If you've played with the Tankentai Battle engine, it has a cool feature called 'Epic Boss Deaths'. The animation freeze the action, then flashes the screen a few times before having the bad guy slowly turn red and fade out with a wave effect on it.

I think this is the actual code:
CODE
def boss_collapse1
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 # 3.4a removed battler reset out
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
if @effect_duration == 0 # 3.4a
reset
end
end


I think this is also important as well.

CODE
def collapse_action
@non_repeat = true
@effect_type = COLLAPSE
@collapse_type = @battler.collapse_type unless @battler.actor?
@battler_visible = false unless @battler.actor?
@effect_duration = N01::COLLAPSE_WAIT + 48 if @collapse_type == 2
@effect_duration = 401 if @collapse_type == 3
end


But, it was a super cool effect and would be nice to see the epic boss deaths in the YEM.
Sanctuary12
QUOTE (Kread-EX @ Feb 28 2011, 12:30 PM) *
Don't post in caps, it's rude. She was mentioning this: http://www.rpgrevolution.com/forums/index....showtopic=32752.

I'm desperately sorry about that. I meant to use it for emphasis of my need for it. And THNXX
Sanctuary12
Sorry to become a bother but is very difficult to add all this due to the fact that i'm garbage with scripting.

Anybody mind helping me with installing this... I'll send the demo to you
Arwin
@Sanctuary

You don't need to do any scripting to add the following code... Just go to the first page and follow the instructions 'Shangai' posted.
Here is a advice, if you don't take your time to learn how to insert scripts how do you expect people to even consider your game?

By the way, hopefully you will be able to add it ;]
Sabertoothfang
Your links seem to be dead
Kread-EX
Clicky
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.
#===============================================================================
# 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.
#===============================================================================

$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
        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
        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
      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 100
      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

#==============================================================================
# ** 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
#
#===============================================================================
SaturnJohn
hey, shanghai, that script link is blocked by my firewall for having malicious software. do you know about this at all? or am i being a wimp?

QUOTE (SaturnJohn @ Jun 12 2011, 01:42 PM) *
hey, shanghai, that script link is blocked by my firewall for having malicious software. do you know about this at all? or am i being a wimp?

nevermind. ignore the noob.
asforever
to bad its not working with tenkentai sad.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.