Version: 1.0
By: Dargor
Introduction
I made this script 2 years ago and always wanted to post it. I didn't because it was requested by another member who didn't wanted it to be public at first
but now he doesn't use the script anymore.
What is the Rupture System?
The battlers start with a new gauge that drops each time this battler is attacked.
When an actors loses all his Rupture Points he fells in the Rupture State.
When in Rupture State, all attacks are automatically critical hits and if the battler is the victim of a "Rupture Skill", then the damage taken is multiplied by a customizable value. The battler is unable to act for 2 turns and once these 2 turns are over, he recovers 50% of his Rupture Points and the state is lifted.
Features
- Both Actors and Enemies have Rupture Points and can fall in Rupture State.
- Can specify a "Rupture Skill" by flagging it with a customizable Element
- Customizable Gauge Color
- Customizable Damage Multiplier
- Customizable RP Increase formula for actors.
Script
Code:
#==============================================================================
# ** Rupture System
#------------------------------------------------------------------------------
# © Dargor, 2008
# 16/10/08
# Version 1.0
# Requested by Çauzfhie
#------------------------------------------------------------------------------
# VERSION HISTORY:
# - 1.0 (16/10/08), Initial release
#------------------------------------------------------------------------------
# INSTRUCTIONS:
# - Paste this above main
# - Edit the constants in the Rupture module
#==============================================================================
# Vocabulary
Vocab::RP = 'RP'
Vocab::RP_a = 'R'
Vocab::RPActorDamage = "%s loses %s #{Vocab::RP}!"
Vocab::RPEnemyDamage = "%s loses %s #{Vocab::RP}!"
#==============================================================================
# ** Rupture Configuration Module
#==============================================================================
module Rupture
# Actors MAXRP Formula
RP_Max_Formula = "(self.maxhp + self.maxmp) / 2"
# Enemies RP
Enemy_RP = {
1 => 1000
}
# Default Enemy RP
Enemy_RP.default = 100
# Element needed for the multiplier to take effect
Element = 17
# State inflicted when RP drops to 0
State = 18
# Damage multiplier when in Rupture state
Multiplier = 7.0
# Rupture bar colors
Gauge_Color1 = 10
Gauge_Color2 = 2
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_reader :rp_damage
#--------------------------------------------------------------------------
# * Alias Listing
#--------------------------------------------------------------------------
alias dargor_vx_rupture_battler_initialize initialize
alias dargor_vx_rupture_battler_remove_state remove_state
alias dargor_vx_rupture_battler_execute_damage execute_damage
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# The Usual
dargor_vx_rupture_battler_initialize
@rp = 0
@rp_damage = 0
end
#--------------------------------------------------------------------------
# * RP
#--------------------------------------------------------------------------
def rp
return @rp
end
#--------------------------------------------------------------------------
# * Set RP
#--------------------------------------------------------------------------
def rp=(new_rp)
@rp = [[new_rp, maxrp].min, 0].max
if @rp == 0 and not state?(Rupture::State)
add_state(Rupture::State) # Add incapacitated (state #1)
@added_states.push(Rupture::State)
elsif @rp > 0 and state?(Rupture::State)
remove_state(Rupture::State) # Remove incapacitated (state #1)
@removed_states.push(Rupture::State)
end
end
#--------------------------------------------------------------------------
# * MAXRP
#--------------------------------------------------------------------------
def maxrp
return 0
end
#--------------------------------------------------------------------------
# * Remove State
#--------------------------------------------------------------------------
def remove_state(state_id)
if state_id == Rupture::State
@rp = self.maxrp / 2
end
# The Usual
dargor_vx_rupture_battler_remove_state(state_id)
end
#--------------------------------------------------------------------------
# * Damage Reflection
# user : User of skill or item
# @hp_damage, @mp_damage, or @absorbed must be calculated before this
# method is called.
#--------------------------------------------------------------------------
def execute_damage(user)
if !@critical && state?(Rupture::State) && !prevent_critical
@critical = true
@hp_damage *= 3
end
# The Usual
dargor_vx_rupture_battler_execute_damage(user)
# Calculate RP damage
if user.element_set.include?(Rupture::Element)
@rp_damage = @hp_damage * Rupture::Multiplier
else
@rp_damage = ((@hp_damage.to_f / 100.0) * Rupture::Multiplier).ceil
end
self.rp -= @rp_damage
end
end
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# This class handles actors. It's used within the Game_Actors class
# ($game_actors) and referenced by the Game_Party class ($game_party).
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Alias Listing
#--------------------------------------------------------------------------
alias dargor_vx_rupture_actor_initialize initialize
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(actor_id)
dargor_vx_rupture_actor_initialize(actor_id)
@rp = maxrp
end
#--------------------------------------------------------------------------
# * MAXRP
#--------------------------------------------------------------------------
def maxrp
return eval(Rupture::RP_Max_Formula)
end
end
#==============================================================================
# ** Game_Enemy
#------------------------------------------------------------------------------
# This class handles enemy characters. It's used within the Game_Troop class
# ($game_troop).
#==============================================================================
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# * Alias Listing
#--------------------------------------------------------------------------
alias dargor_vx_rupture_enemy_initialize initialize
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(index, enemy_id)
dargor_vx_rupture_enemy_initialize(index, enemy_id)
@rp = maxrp
end
#--------------------------------------------------------------------------
# * MAXRP
#--------------------------------------------------------------------------
def maxrp
if Rupture::Enemy_RP[@enemy_id] != nil
return Rupture::Enemy_RP[@enemy_id]
else
return Rupture::Enemy_RP.default
end
end
end
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
# This is a superclass of all windows in the game.
#==============================================================================
class Window_Base
#--------------------------------------------------------------------------
# * Alias Listing
#--------------------------------------------------------------------------
alias dargor_vx_rupture_window_base_draw_actor_name draw_actor_name
#--------------------------------------------------------------------------
# * Draw Actor RP
#--------------------------------------------------------------------------
def draw_actor_rp(actor, x, y)
draw_actor_rp_gauge(actor, x, y)
self.contents.font.color = system_color
self.contents.draw_text(x,y,120,WLH,Vocab::RP_a)
self.contents.font.color = normal_color
self.contents.draw_text(x,y,120,WLH,"#{actor.rp}/#{actor.maxrp}",2)
end
#--------------------------------------------------------------------------
# * Draw Name
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_actor_name(actor, x, y)
draw_actor_rp_gauge(actor, x, y, 112) if !$scene.is_a?(Scene_Status)
dargor_vx_rupture_window_base_draw_actor_name(actor, x, y)
end
#--------------------------------------------------------------------------
# * Draw RP gauge
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : Width
#--------------------------------------------------------------------------
def draw_actor_rp_gauge(actor, x, y, width = 120)
gw = width * actor.rp / actor.maxrp
gc1 = text_color(Rupture::Gauge_Color1)
gc2 = text_color(Rupture::Gauge_Color2)
self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
end
end
#==============================================================================
# ** Window_Status
#------------------------------------------------------------------------------
# This window displays full status specs on the status screen.
#==============================================================================
class Window_Status < Window_Base
#--------------------------------------------------------------------------
# * Draw Basic Information
# x : Draw spot X coordinate
# y : Draw spot Y coordinate
#--------------------------------------------------------------------------
def draw_basic_info(x, y)
draw_actor_level(@actor, x, y + WLH * 0)
draw_actor_state(@actor, x, y + WLH * 1)
draw_actor_hp(@actor, x, y + WLH * 2)
draw_actor_mp(@actor, x, y + WLH * 3)
draw_actor_rp(@actor, x, y + WLH * 4)
end
end
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# This class performs battle screen processing.
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias dargor_vx_rupture_battle_end battle_end
alias dargor_vx_rupture_display_damage display_damage
#--------------------------------------------------------------------------
# * End Battle
# result : Results (0: win, 1: escape, 2:lose)
#--------------------------------------------------------------------------
def battle_end(result)
for member in $game_party.members
member.rp = member.maxrp
end
dargor_vx_rupture_battle_end(result)
end
#--------------------------------------------------------------------------
# * Show Damage
# target : Target
# obj : Skill or item
#--------------------------------------------------------------------------
def display_damage(target, obj = nil)
dargor_vx_rupture_display_damage(target)
if !target.missed && !target.evaded
display_rp_damage(target)
end
end
#--------------------------------------------------------------------------
# * Show HP Damage
# target : Target
# obj : Skill or item
#--------------------------------------------------------------------------
def display_rp_damage(target)
if target.rp_damage > 0 # Damage
if target.actor?
text = sprintf(Vocab::RPActorDamage, target.name, target.rp_damage)
Sound.play_actor_damage
$game_troop.screen.start_shake(5, 5, 10)
else
text = sprintf(Vocab::RPEnemyDamage, target.name, target.rp_damage)
Sound.play_enemy_damage
target.blink = true
end
else # Recovery
fmt = target.actor? ? Vocab::ActorRecovery : Vocab::EnemyRecovery
text = sprintf(fmt, target.name, Vocab::RP, -target.rp_damage)
Sound.play_recovery
end
@message_window.add_instant_text(text)
wait(30)
end
end
Instructions
Place this script above Main and edit the constants in the Rupture module.
Compatibility
Should be compatible with everything.
Credits and Thanks
Parts of the credit goes to Çauzfhie who originally requested the script.
Terms and Conditions
As usual, don't forget to give me credits!