Show Slip Damage
Version: 1.3a
Author: cozziekuns
Date: June 23, 2011
Version History
- <Version 1.3a> 07.22.2011 - Updated with Mr. G&W's bugfix.
- <Version 1.3> 07.14.2011 - Updated because of a (relatively) small bugfix.
- <Version 1.2> 06.23.2010 - Wow its really been a whole year. Updated because I saw how flimsy my code was in a script request topic.
- <Version 1.1> 07.13.2010 -After 1 whole month, updated with an error that Modern Algebra came across.l
- <Version 1.0> 06.13.2010 - Original Release
Planned Future Versions
Description
A system designed to show the amount of slip damage dealt to both actors and enemies. Originally found in my Tales of Icarus Script Package.
ScreenshotsSorry kids, the battle system doesn't come with the script.
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.
Script
#===============================================================================
#
# Cozziekuns Show Slip Damage
# Last Date Updated: 7/22/2011
#
# A system designed to show the amount of slip damage dealt to both actors and
# enemies.
#
#===============================================================================
# Updates
# -----------------------------------------------------------------------------
# o 06/13/10 - Created Script.
# o 07/13/10 - After 1 whole month, updated with an error that Modern Algebra
# came across.
# o 06/23/11 - Wow its really been a whole year. Updated because I saw how flimsy
# my code was in a script request topic.
# o 07/22/11 - Updated with Mr G&W's Bugfix.
#===============================================================================
# What's to come?
# -----------------------------------------------------------------------------
# o Compatibility with most popup scripts and other battle systems. (Though it's
# usually already built into those type of scripts.)
#===============================================================================
# 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.
#===============================================================================
$imported = {} if $imported == nil
$imported["CozShowSlipDamage"] = true
module COZZIEKUNS
module SHOW_SLIP_DAMAGE
SLIP_DAMAGE_STRING = " damage due to" # Text you want after "Actor took xxxx".
WAIT = 90 # How many frames you want the slip damage message to stay on the screen.
end
end
#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
# This class deals with battlers. It's used as a superclass of the Game_Actor
# and Game_Enemy classes.
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :slip_damage_message
#--------------------------------------------------------------------------
# * Application of Slip Damage Effects
#--------------------------------------------------------------------------
alias coz_sd_gb_slip_damage_effect slip_damage_effect
def slip_damage_effect
coz_sd_gb_slip_damage_effect
array = " "
if slip_damage? and @hp > 0
for state in states
array += " and " if (array != " " and state.slip_damage)
array += state.name if state.slip_damage
end
@slip_damage_message = "#{self.name} took #{self.hp_damage}" +
COZZIEKUNS::SHOW_SLIP_DAMAGE::SLIP_DAMAGE_STRING + array + "."
end
end
end
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# This class performs battle screen processing.
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# * End Turn
#--------------------------------------------------------------------------
def turn_end
$game_troop.turn_ending = true
$game_party.slip_damage_effect
for i in 0...$game_party.members.size
for state in $game_party.members[i].states
if state.slip_damage
unless $game_party.members[i].dead?
$game_troop.screen.start_shake(5, 5, 10)
@message_window.replace_instant_text($game_party.members[i].slip_damage_message)
Sound.play_actor_damage
wait(COZZIEKUNS::SHOW_SLIP_DAMAGE::WAIT)
break
end
end
end
end
$game_troop.slip_damage_effect
for i in 0...$game_troop.members.size
for state in $game_troop.members[i].states
if state.slip_damage
unless $game_troop.members[i].dead?
$game_troop.members[i].blink = true
@message_window.replace_instant_text($game_troop.members[i].slip_damage_message)
Sound.play_enemy_damage
wait(COZZIEKUNS::SHOW_SLIP_DAMAGE::WAIT)
$game_troop.members[i].slip_damage_message = nil
break
end
end
end
end
$game_party.do_auto_recovery
$game_troop.preemptive = false
$game_troop.surprise = false
process_battle_event
$game_troop.turn_ending = false
start_party_command_selection
end
end
Credit
- cozziekuns
- Mr. G&W, for a bugfix.
Thanks
- Pacman, for reminding me this script existed.
- Modern Algebra, for pointing out and helping me fix a bug.
- Mr. G&W, for finding a bug.
Support
Just post down below.
Known Compatibility Issues
Probably won't work with any custom battle systems, but most have this built in anyways.