When you have the Time & Mood:
#==============================================================================
# Soul Rage System + Soul Limit System by Blizzard
# Version: 4.2b
# Date: 08.09.2006
# Date v4.2: 3.11.2006
#
#
# Compatibility:
#
# 99% chance of full compatibility with SDK, not tested altough. WILL corrupt
# your old savegames. Can cause incompatibilty issues with following scripts
# and/or systems:
# - exotic CBS-es
# - Limit Break systems
# - Custom Equipment systems (i.e. 2 accessories) (can be EASILY merged)
# - needs the 4.0b version of the Scene_SoulRage add-on if you use one
#
# Complexity:
# - average to high
#
# Special knowledge REQUIRED:
# - reading long and boring instructions
#
# Special knowledge RECOMMENED:
# - using the "Call script" event command
#
#
# Features:
#
# - configure your database easily
# - optional gradient bar drawing with 2 different styles
# - contains universal font fix, never ever "I can´t see the letters"
# - use multiple skills per equipment part
# - new Soul Limit add-on (you can configure it or not use it at all)
# - configure Soul Limit for each character
#
# v4.2:
#
# - 5 new barstyles
# - option to disable Soul Rage
#
# Advantages compared to older versions:
#
# - shorter code
# - maximized compatibilty
# - configurable gradient script
# - moving Soul Rage command in defineable color and a faster animated cursor
# - moving Soul Limit command in defineable color and a faster animated cursor
# - defineable gradient style
# - extremly simple gradient script, also possible to use it to display other
# stats like HP, SP, EXP, etc.
# - cycle through Soul Rage skills with LEFT/RGIHT
# - Soul Limit now configurable for each character
#
#
# Instructions:
#
#
# ...::: Soul Rage :::...
#
# - Explanation:
# This script allows the player equipment to have built-in skills. If enemies
# attack a character a value (the Soul Rage or SR) will be increased. With
# a certain ammount of SR it is possible to perform special skills, that are
# implemented into equipment. Sould Rage is also known as "Ikari skill" from
# "Lufia 2 - Rise of the Sinistrals" for the SNES.
#
# - NEW in v3.0:
# Additional to ordinary SR skills, it is now possible to bound more than only
# one skill to an equipment part with overall.
#
# - NEW in v4.0:
# No $sr_element anymore. Also now there is a possibility of using a super
# skill (Soul Limit skill) if certain conditions are met. You can configure
# what conditions needs to be met for each character and what stats are going
# to be consumed
#
#
# - Configuration:
# Press CRTL+SHIFT+F and type into the window: SR DATABASE
# You can jump now to the database directly. There are more instructions.
# Also please configure the following global variable found below:
#
# ALLOW_RAGE - set this value to false to disable Rage (if you do so you
# don´t need to configure ANYTHING connected to Soul Rage)
# (Side-Note: It's pointless to disable both)
# SRS_rate - set the filling rate of the SR, 1000 is standard, 500 is 2
# times slower and 2000 would be 2 times faster
# RAGE_COLOR - set the values in the () to numbers between 0-255, also note
# that they determine the color ammount in the color like this
# example: (RED, GREEN, BLUE, ALPHA) - note: alpha = opacity
#
# DRAW_BAR - set this value to false if you don´t want an SR bar at all
# $bar_style - set it from 0 to 6 to use one out of seven bar styles
# $bar_opaccity - set it from 0 to 255 to define the bar's opacity
# BAR_STYLES - set this value to false to use another bar script;
# DO NOT SET THIS VALUE TO FALSE IF DRAW_BAR IS TRUE AND YOU DON'T
# HAVE A SEPARATE BAR SCRIPT!
#
# Additional info:
#
# If you want to change the value of the SR bar ingame use the "Call script"
# event command and use this syntax:
#
# $game_actors[X].sr = Y
#
# - X is the ID of the hero in the database
# - Y is the new value of the SR
#
# You can also use another syntax:
#
# $game_party.actors[X].sr = Y
#
# - X is the position of the hero in the party
# - Y is the new value of the SR
#
# Note that X starts from 0 and NOT 1. The ammount is shown as 100,0%, this is
# 1000 SR. i.e. 59,1% would be 591 SR.
# If you are upgrading your script from version 2.0 or lower, be sure to apply
# the new SR skill database format.
#
# Also if you want to use my gradient script, it is the class called "Bitmap"
#
#
# ...::: Soul Limit :::...
#
# Soul Limit is a special attack an actor can use if he has either low HP, high
# SR, etc. You can compare Soul Limit to a sort of Limit Break / Overdrive,
# but connected to the Soul Rage. Configure the Limit part below like in this
# template:
#
# ALLOW_LIMIT - set this value to false to disable Limit (if you do so you
# don´t need to configure ANYTHING connected to Soul Limit)
# LIMIT_COLOR - set the values in the () to numbers between 0-255, also
# note that they determine the color ammount in the color
# like this example: (RED, GREEN, BLUE, ALPHA)
# note: alpha = opacity
#
# @limit_name - the name of the command that will be displayed as Soul Limit
# regardless of the Soul Limit skill name
# @limit_id - the Soul Limit skill ID in the normal database
# @min_sr_rate - how much SR (in %) is minimal needed for Limit to be available
# (set to 0 to disable this condition)
# @max_hp_rate - how much HP (in %) is maximal needed for Limit to be available
# (set to 100 to disable this condition)
# @max_sp_rat - how much SP(%) is maximal needed for Limit to be available
# (set to 100 to disable this condition)
# @sr_consume - how much SR(%) will be consumed if Limit is used
# (set to 0 to disable the consuming of this stat)
# @hp_consume - how much HP(%) will be consumed if Limit is used
# (set to 0 to disable the consuming of this stat)
# @sp_consume - how much SP(%) will be consumed if Limit is used
# (set to 0 to disable the consuming of this stat)
# @allow_suicide - set this value to false if you don´t want that a character
# can die when using Limit, because of decreasing the HP
#
# The database can be found by pressing CTRL+F and typing Limit Database.
#
# Additional info:
#
# Soul Limit is more superior than Limit Break as you can involve HP, SR and
# even SP conditions as well as consuming. You can create a game where a
# character can use his Limit skill as long as his HP are under 20% without
# consuming any stats. (i.e. Final Fantasy VIII) or create a game where the
# using of a Limit skill requires suicide just by setting the character´s
# @hp_consume value to 100.
# If you want to change the Soul Limit skill ID and/or command ingame use the
# "Call script" event command and use this syntax:
#
# $game_actors[X].set_new_limit("STRING", ID)
#
# - X is the ID of the hero in the database and Y the ammount
# - STRING is the new name for the SL command
# - ID is the ID of the new SL skill in the database
#
# You can also use another syntax:
#
# $game_party.actors[X].set_new_limit("STRING", ID)
#
# X is the postion of the hero in the party. Note that X starts from 0 (NOT 1)!
#
# Note:
# Using Soul Rage skills as normal skills is not recommened, because of the
# SP/SR cost. It is better you create a different skill if you want to use it
# as Soul Rage. But then again, you don´t have to... In the other hand Soul
# Limit skills can be used as normal skills without any problems.
#
#
# If you find any bugs, please report them here:
# http://www.chaosproject.co.nr/index.php?showtopic=54
# or send me an e-mail:
# boris_blizzard@yahoo.de
#
#==============================================================================
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Soul Rage Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
ALLOW_RAGE = true # set to false to disable Soul Rage
SRS_rate = 1000 # SR bar fill rate
RAGE_COLOR = Color.new(240, 0, 0, 255) # Color of the SR command (R, G, B, A)
DRAW_BAR = true # set to "true" if you want a bar else set it to "false"
$bar_style = 5 # SR bar drawing style (from 0 to 6)
$bar_opacity = 255 # SR bar opacity (from 0 to 255)
BAR_STYLES = false # set to "false" if you want to use another bar script
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Soul Rage Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Soul Limit Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
ALLOW_LIMIT = true # set to false to disable Soul Limit
LIMIT_COLOR = Color.new(0, 240, 0, 255) # Color of the SL command (R, G, B, A)
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Soul Limit Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
#==============================================================================
# Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
attr_reader :sr
attr_reader :limit_name
attr_reader :limit_id
alias setup_srs_later setup
def setup(actor_id)
setup_srs_later(actor_id)
get_limits(actor_id) if ALLOW_LIMIT
@sr = 0
end
def sr=(sr)
@sr = sr
@sr = 1000 if @sr > 1000
@sr = 0 if @sr < 0
end
def can_use_sr?(id)
return ($data_skills[id].sp_cost <= self.sr / 10)
end
if ALLOW_LIMIT
def get_limits(id)
case id
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
#
# START Soul Limit Database
#
# This is your Soul Limit Database. Below you can configure the Special attack
# and the command name of the Soul Limit.
# Use following syntax to setup the Soul Limit for each character:
#
# when ACTOR_ID
# @limit_name = "STRING"
# @limit_id = SKILL_ID
# @sr_rate, @hp_rate, @sp_rate = VAL1, VAL2, VAL3
# @sr_consume, @hp_consume, @sp_consume = VAL4, VAL5, VAL6
# @allow_suicide = EXPR
#
# ACTOR_ID - the ID of the character in the normal database
# STRING - the name the command should have
# SKILL_ID - the ID of the Soul Limit skill in the normal database
# VAL1 - minimum SR (in %) needed to make the Soul Limit skill available
# VAL2 - maximum HP (in %) needed to make the Soul Limit skill available
# VAL3 - maximum SP (in %) needed to make the Soul Limit skill available
# VAL4 - SR (in %) cunsumed if Soul Limit is used
# VAL5 - HP (in %) cunsumed if Soul Limit is used
# VAL6 - SP (in %) cunsumed if Soul Limit is used
# EXPR - true or false
#
# Example:
#
# when 2
# @limit_name = "Saturn Cannon"
# @limit_id = 101
# @sr_rate, @hp_rate, @sp_rate = 80, 50, 100
# @sr_consume, @hp_consume, @sp_consume = -10, 10, 50
# @allow_suicide = false
#
# (let´s say skill number 101 is called "Last Judgement")
#
# Character number 2 needs minimum 80% SR, his HP must be less than or equal to
# 50% and his SP must be less than or equal to 100% (in other words, SP don´t
# affect the availability of the SL skill of character number 2). If he uses
# the Soul Limit command displayed as "Saturn Cannon", he will use the skill
# "Last Judgement" (ID number 101). He will gain 10% of his maximum SR, lose
# 10% of his maximum HP and lose 50% of his maximum SP. If his HP are less than
# or equal to 10% he will not die, but his HP will only decrease to 1.
#
# Side-notes:
# The VAL values can be from 0 to 100 (since it is in %). Every value over 100
# is automatically limited to 100. Negative values will cause stat gaining
# instead of losing. (You can create skills, that heal the user AND attack the
# enemies without a common event call). If you set the values VAL1, VAL2 and/or
# VAL3 to a negative number, this character will have no Soul Limit.
#
# Notes:
# - you have the possibility to i.e. set a command to "Bahamut", but the actual
# skill name that will be displayed during its animation will be "Mega Flare"
# - to change a Soul Limit skill during the game read the instructions at the
# beginning of the script
#
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
when 1
@limit_name = "Final Judgment"
@limit_id = 81
@sr_rate, @hp_rate, @sp_rate = 100, 100, 100
@sr_consume, @hp_consume, @sp_consume = 100, 0, 0
@allow_suicide = true
when 2
@limit_name = "Absolute-Zero"
@limit_id = 82
@sr_rate, @hp_rate, @sp_rate = 100, 100, 100
@sr_consume, @hp_consume, @sp_consume = 20, 100, 0
@allow_suicide = true
when 3
@limit_name = "Torrential Tribute"
@limit_id = 83
@sr_rate, @hp_rate, @sp_rate = 80, 80, 50
@sr_consume, @hp_consume, @sp_consume = 20, 100, 50
@allow_suicide = false
when 4
@limit_name = "Unlimited Blade's Work"
@limit_id = 84
@sr_rate, @hp_rate, @sp_rate = 100, 100, 80
@sr_consume, @hp_consume, @sp_consume = 50, 0, -50
@allow_suicide = true
when 5
@limit_name = "Holy Explosion"
@limit_id = 85
@sr_rate, @hp_rate, @sp_rate = 100, 100, 100
@sr_consume, @hp_consume, @sp_consume = -20, 20, -20
@allow_suicide = true
when 6
@limit_name = "Terra Blaster"
@limit_id = 86
@sr_rate, @hp_rate, @sp_rate = 100, 100, 100
@sr_consume, @hp_consume, @sp_consume = 100, 0, 0
@allow_suicide = true
when 7
@limit_name = "Swords of Light"
@limit_id = 87
@sr_rate, @hp_rate, @sp_rate = 100, 100, 100
@sr_consume, @hp_consume, @sp_consume = 100, 0, 0
@allow_suicide = true
when 8
@limit_name = "None"
@limit_id = 88
@sr_rate, @hp_rate, @sp_rate = 100, 100, 100
@sr_consume, @hp_consume, @sp_consume = 100, 0, 0
@allow_suicide = true
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Soul Limit Database
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
else
@limit_name = ""
@limit_id = 1
@sr_rate, @hp_rate, @sp_rate = -1, -1, -1
@sr_consume, @hp_consume, @sp_consume = 0, 0, 0
@allow_suicide = true
end
end
def can_use_limit?
return (self.sr / 10 >= @sr_rate and
100 * self.hp / self.maxhp <= @hp_rate and
100 * self.sp / self.maxsp <= @sp_rate)
end
def use_limit
self.sr -= @sr_consume * 10
self.hp -= @hp_consume * self.maxhp / 100
self.hp = 1 if self.hp == 0 and not @allow_suicide
self.sp -= @sp_consume * self.maxsp / 100
end
def set_new_limit(name, id)
@limit_name = name
@limit_id = id
end
end
end
#==============================================================================
# Game_Battler
#==============================================================================
class Game_Battler
alias attack_effect_srs_later attack_effect
def attack_effect(attacker)
last_hp = self.hp
save = attack_effect_srs_later(attacker)
if self.damage.is_a?(Numeric) and self.damage > 0 and
self.is_a?(Game_Actor) and self.hp != 0
self.sr += self.damage * SRS_rate / last_hp
end
self.sr = 0 if self.is_a?(Game_Actor) and self.dead?
return save
end
alias skill_effect_srs_later skill_effect
def skill_effect(user, skill)
last_hp = self.hp
save = skill_effect_srs_later(user, skill)
if self.damage.is_a?(Numeric) and self.damage > 0 and
self.is_a?(Game_Actor) and self.hp != 0
self.sr += self.damage * SRS_rate / last_hp
end
self.sr = 0 if self.is_a?(Game_Actor) and self.dead?
return save
end
end
#==============================================================================
# Bitmap
#==============================================================================
#==============================================================================
# Window_Base
#==============================================================================
class Window_Base < Window
def draw_actor_sr_no_bar(actor, x, y, width = 144)
self.contents.font.color = normal_color
width = 120 unless $scene.is_a?(Scene_Menu)
sr_text = (actor.sr/10).to_s + "," + (actor.sr%10).to_s + "%"
self.contents.draw_text(x, y, width, 32, sr_text, 2)
self.contents.font.color = system_color
self.contents.draw_text(x, y-16, width, 64, "SR", 0)
end
def draw_actor_sr(actor, x, y, w = 148)
w -= 12
rate = actor.sr.to_f / 1000
color1 = Color.new(80, 0, 0, 192)
color2 = Color.new(240, 0, 0, 192)
color3 = Color.new(80, 0, 0, 192)
self.contents.gradient_bar(x, y, w, color1, color2, color3, rate)
if $scene.is_a?(Scene_Battle)
draw_actor_sr_no_bar(actor, x, y, w)
else
draw_actor_sr_no_bar(actor, x, y)
end
end
def draw_item_name2(item, x, y, color)
return if item == nil
opacity = self.contents.font.color == normal_color ? 255 : 128
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.font.color = color
self.contents.draw_text(x + 28, y, 288, 32, item.name)
end
end
#==============================================================================
# Window_SoulRage
#==============================================================================
class Window_SoulRage < Window_Selectable
attr_accessor :index
attr_accessor :index0
attr_accessor :index1
attr_accessor :index2
attr_accessor :index3
attr_accessor :index4
def initialize(actor)
super(0, 128, 640, 384)
x = 0
y = 0
@skill_ids = [[0], [0], [0], [0], [0]]
@column_max = 1
@actor = actor
@index = 0
@alt_index = [0, 0, 0, 0, 0]
refresh
@index = 0
if $game_temp.in_battle
self.y = 64
self.height = 256
self.back_opacity = 160
end
end
def update_actor(actor)
@actor = actor
refresh
end
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
if @actor != nil
@item_max = 5
self.contents = Bitmap.new(width - 42, row_max * 42)
if $fontface != nil
self.contents.font.name = $fontface
elsif $defaultfonttype != nil
self.contents.font.name = $defaultfonttype
end
self.contents.font.size = 24
for i in 0...5
draw_item(i)
end
end
end
def draw_item(index)
y = index * 42
case index
when 0
equip = $data_weapons[@actor.weapon_id]
@skill_ids[0] = database(@actor.weapon_id, true)
when 1
equip = $data_armors[@actor.armor1_id]
@skill_ids[1] = database(@actor.armor1_id)
when 2
equip = $data_armors[@actor.armor2_id]
@skill_ids[2] = database(@actor.armor2_id)
when 3
equip = $data_armors[@actor.armor3_id]
@skill_ids[3] = database(@actor.armor3_id)
when 4
equip = $data_armors[@actor.armor4_id]
@skill_ids[4] = database(@actor.armor4_id)
end
id = @skill_ids[index][@alt_index[index]]
skill = $data_skills[id] if id != 0
if skill != nil
if @actor.can_use_sr?(skill.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
rect = Rect.new(x, y, self.width / @column_max - 42, 42)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(skill.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x+300, y+8, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x+300 + 28, y, 204, 42, skill.name, 0)
unless skill.sp_cost == 0
self.contents.draw_text(x+300 + 216, y, 64, 42, skill.sp_cost.to_s + "%", 2)
end
if @skill_ids[index].size > 1
self.contents.draw_text(x+300 - 16, y, 32, 42, "«")
self.contents.draw_text(x+300 + 264, y, 32, 42, "»", 2)
end
else
self.contents.font.color = disabled_color
self.contents.draw_text(x+300 + 28, y, 204, 42, "not available", 0)
end
if id == 0
color = disabled_color
else
color = disabled_color
color = normal_color if @actor.can_use_sr?(id)
end
if @actor.equippable?(equip)
draw_item_name2(equip, x+4, y+4, color)
else
self.contents.font.color = disabled_color
self.contents.draw_text(x, y, 288, 42, "Nothing equipped")
end
end
alias upd_srs_later update
def update
upd_srs_later
size = @skill_ids[@index].size
if Input.trigger?(Input::RIGHT)
old_index = @alt_index[@index]
@alt_index[@index] = (@alt_index[@index] + 1) % size
if old_index != @alt_index[@index]
$game_system.se_play($data_system.cursor_se)
end
refresh
return
end
if Input.trigger?(Input::LEFT)
old_index = @alt_index[@index]
@alt_index[@index] = (@alt_index[@index] + size - 1) % size
if old_index != @alt_index[@index]
$game_system.se_play($data_system.cursor_se)
end
refresh
return
end
end
def top_row
return self.oy / 42
end
def top_row=(row)
row = 0 if row < 0
row = row_max - 1 if row > row_max - 1
self.oy = row * 42
end
def page_row_max
return (self.height - 42) / 42
end
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
return
end
row = @index / @column_max
self.top_row = row if row < self.top_row
if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end
cursor_width = self.width / @column_max - 42
x = @index % @column_max * (cursor_width + 42)
y = @index / @column_max * 42 - self.oy
self.cursor_rect.set(x, y, cursor_width, 42)
end
def update_help
@help_window.set_text(self.skill == nil ? "" : self.skill.description)
end
def skill
id = @skill_ids[@index][@alt_index[@index]]
return $data_skills[id] if id != 0
end
def database(equip_id, weapon = false)
skill_ids = []
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
#
# START SR Database
#
# This is your equipment Soul Rage database. To add a new Soul Rage skill to a
# weapon is very simple. Add another "when"-branch in the script snipplet below
# (they have comments next to it). Configure it like this template:
#
# when WEAPON_ID
# skill_ids.push(SOULRAGE_SKILL_ID)
# skill_ids.push(SOULRAGE_SKILL_ID)
#
# The same works for armors:
#
# when ARMOR_ID
# skill_ids.push(SOULRAGE_SKILL_ID)
# skill_ids.push(SOULRAGE_SKILL_ID)
#
# The lines are commented below so you should have no problems with the script.
#
# To determine the percentage of Soul Rage consumed to use a skill, set the SP
# to the percentage. e.g. 33SP would mean 33% of the Soul Rage bar.
#
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
if weapon
case equip_id # weapon IDs
when 1
skill_ids.push(89)
skill_ids.push(7)
when 10
skill_ids.push(8)
end
else
case equip_id # armor IDs
when 6
skill_ids.push(1)
when 18
skill_ids.push(25)
end
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END SR Database
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
end
return skill_ids if skill_ids.size > 0
return [0]
end
end
#==============================================================================
# Window_BattleStatus
#==============================================================================
class Window_BattleStatus < Window_Base
def refresh
self.contents.clear
if $fontface != nil
self.contents.font.name = $fontface
elsif $defaultfonttype != nil
self.contents.font.name = $defaultfonttype
end
self.contents.font.size = 24
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
actor_x = i * 160 + 4
draw_actor_name(actor, actor_x, -8)
draw_actor_hp(actor, actor_x, 14, 120)
draw_actor_sp(actor, actor_x, 44, 120)
draw_actor_sr(actor, actor_x, 74, 120) if DRAW_BAR == true
draw_actor_sr_no_bar(actor, actor_x, 74, 120) if DRAW_BAR == false
if @level_up_flags[i]
self.contents.font.color = normal_color
self.contents.draw_text(actor_x, 100, 120, 32, "LEVEL UP!")
else
draw_actor_state(actor, actor_x, 100)
end
end
end
end
#==============================================================================
# Window_Command
#==============================================================================
class Window_Command < Window_Selectable
attr_accessor :commands
attr_accessor :actor
alias initialize_srs_later initialize
def initialize(width, commands)
initialize_srs_later(width, commands)
@SRcommand = "Soul Rage"
end
def set_player_command
@Limitcommand = @actor.limit_name if @commands[0] != @actor.limit_name
refresh
end
def swap_commands
temp = @commands[1]
@commands[1] = @SRcommand
@SRcommand = temp
refresh
end
def swap_commands_2
if @commands[0] == @actor.limit_name or @Limitcommand == @actor.limit_name
temp = @commands[0]
@commands[0] = @Limitcommand
@Limitcommand = temp
refresh
end
end
alias refresh_srs_later refresh
def refresh
if $fontface != nil
self.contents.font.name = $fontface
elsif $defaultfonttype != nil
self.contents.font.name = $defaultfonttype
end
self.contents.font.size = 24
if @actor != nil and ALLOW_LIMIT and @commands[0] == @actor.limit_name
for j in 0...6
self.contents.clear
self.contents.font.color = LIMIT_COLOR
rect = Rect.new(164 - j * 32, 0, self.contents.width - 8, 32)
self.contents.draw_text(rect, @commands[0])
self.contents.font.color = normal_color
for i in 0...@item_max
unless @commands[i] == @actor.limit_name
draw_item(i, normal_color)
end
end
if $scene.is_a?(Scene_Battle) and ALLOW_RAGE
self.contents.font.size += 4
self.contents.font.color = normal_color
self.contents.draw_text(0, 31, width - 32, 32, "›› ", 2)
self.contents.font.size -= 4
end
Graphics.update
end
elsif ALLOW_RAGE and @commands[1] == "Soul Rage"
for j in 0...6
self.contents.clear
self.contents.font.color = RAGE_COLOR
rect = Rect.new(164 - j * 32, 32, self.contents.width - 8, 32)
self.contents.draw_text(rect, @commands[1])
self.contents.font.color = normal_color
for i in 0...@item_max
unless @commands[i] == "Soul Rage"
draw_item(i, normal_color)
end
end
if ALLOW_LIMIT and $scene.is_a?(Scene_Battle) and @actor != nil and
@actor.can_use_limit?
self.contents.font.size += 4
self.contents.font.color = normal_color
self.contents.draw_text(0, -1, width - 32, 32, "›› ", 2)
self.contents.font.size -= 4
end
Graphics.update
end
else
refresh_srs_later
if $scene.is_a?(Scene_Battle)
if ALLOW_RAGE
self.contents.font.size += 4
self.contents.font.color = normal_color
self.contents.draw_text(0, 31, width - 32, 32, "›› ", 2)
self.contents.font.size -= 4
end
if ALLOW_LIMIT and @actor != nil and @actor.can_use_limit?
self.contents.font.size += 4
self.contents.font.color = normal_color
self.contents.draw_text(0, -1, width - 32, 32, "›› ", 2)
self.contents.font.size -= 4
end
end
end
end
def test_limit
return (@actor != nil and @actor.can_use_limit? and @index == 0)
end
end
#==============================================================================
# Scene_Battle
#==============================================================================
class Scene_Battle
alias main_srs_later main
def main
main_srs_later
@rage_window.dispose if @rage_window != nil
end
alias phase3_setup_command_window_srs_later phase3_setup_command_window
def phase3_setup_command_window
phase3_setup_command_window_srs_later
@actor_command_window.actor = @active_battler
@actor_command_window.set_player_command
end
alias update_phase3_srs_later update_phase3
def update_phase3
if @rage_window != nil and @rage_window.visible
@rage_window.update
update_phase3_rage_select
return
end
update_phase3_srs_later
end
alias update_phase3_enemy_select_srs_later update_phase3_enemy_select
def update_phase3_enemy_select
if Input.trigger?(Input::B)
end_rage_select_plus
end
update_phase3_enemy_select_srs_later
end
alias update_phase3_actor_select_srs_later update_phase3_actor_select
def update_phase3_actor_select
if Input.trigger?(Input::B)
end_rage_select_plus
end
update_phase3_actor_select_srs_later
end
alias phase3_next_actor_srs_later phase3_next_actor
def phase3_next_actor
end_rage_select if @rage_window != nil
phase3_next_actor_srs_later
end
def update_phase3_rage_select
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
end_rage_select if @rage_window.visible
return
end
if Input.trigger?(Input::C)
@skill = @rage_window.skill
if @skill == nil or not @active_battler.can_use_sr?(@skill.id)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
@active_battler.current_action.skill_id = @skill.id
@rage_window.visible = false
if @skill.scope == 1
start_enemy_select
elsif @skill.scope == 3 or @skill.scope == 5
start_actor_select
else
phase3_next_actor
end
return
end
end
def start_rage_select
@rage_window = Window_SoulRage.new(@active_battler)
@rage_window.help_window = @help_window
@actor_command_window.active = false
@actor_command_window.visible = false
end
def end_rage_select
end_rage_select_plus
@actor_command_window.swap_commands
@rage_window.dispose
@rage_window = nil
@help_window.visible = false
end
def end_rage_select_plus
if @rage_window != nil
if @rage_window.visible
@actor_command_window.active = true
@actor_command_window.visible = true
@help_window.visible = false
else
@rage_window.active = true
@rage_window.visible = true
end
end
end
alias update_phase4_step2_srs_later update_phase4_step2
def update_phase4_step2
update_phase4_step2_srs_later
make_rage_action_result if @active_battler.current_action.kind == 3
make_sl_action_result if @active_battler.current_action.kind == 9
end
def make_rage_action_result
@skill = $data_skills[@active_battler.current_action.skill_id]
unless @active_battler.current_action.forcing
unless @active_battler.can_use_sr?(@skill.id)
$game_temp.forcing_battler = nil
@phase4_step = 1
return
end
end
@active_battler.sr -= @skill.sp_cost * 10
@status_window.refresh
@help_window.set_text(@skill.name, 1)
@animation1_id = @skill.animation1_id
@animation2_id = @skill.animation2_id
@common_event_id = @skill.common_event_id
set_target_battlers(@skill.scope)
for target in @target_battlers
target.skill_effect(@active_battler, @skill)
end
end
def make_sl_action_result
@skill = $data_skills[@active_battler.current_action.skill_id]
@active_battler.use_limit
@status_window.refresh
@help_window.set_text(@skill.name, 1)
@animation1_id = @skill.animation1_id
@animation2_id = @skill.animation2_id
@common_event_id = @skill.common_event_id
set_target_battlers(@skill.scope)
for target in @target_battlers
target.skill_effect(@active_battler, @skill)
end
end
alias update_phase3_basic_command_srs_later update_phase3_basic_command
def update_phase3_basic_command
if ALLOW_LIMIT
if @actor_command_window.test_limit and Input.press?(Input::RIGHT)
if @actor_command_window.commands[0] !=
@actor_command_window.actor.limit_name
$game_system.se_play($data_system.decision_se)
skill = $data_skills[@actor_command_window.actor.limit_id]
@help_window.set_text(skill.description, 1)
@actor_command_window.swap_commands_2
end
if not Input.trigger?(Input::UP) and not Input.trigger?(Input::DOWN)
@actor_command_window.update
end
else
if @actor_command_window.commands[0] ==
@actor_command_window.actor.limit_name
$game_system.se_play($data_system.cancel_se)
@actor_command_window.swap_commands_2
@help_window.set_text("", 1)
@help_window.visible = false
end
end
if @actor_command_window.commands[0] ==
@actor_command_window.actor.limit_name and Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
@active_battler.current_action.kind = 9
@active_battler.current_action.skill_id = @actor_command_window.actor.limit_id
@skill = $data_skills[@active_battler.current_action.skill_id]
@help_window.visible = false
if @skill.scope == 1
start_enemy_select
@actor_command_window.swap_commands_2
elsif @skill.scope == 3 or @skill.scope == 5
start_actor_select
@actor_command_window.swap_commands_2
else
@actor_command_window.swap_commands_2
phase3_next_actor
end
return
end
end
if ALLOW_RAGE
if @actor_command_window.index == 1 and Input.press?(Input::RIGHT)
if @actor_command_window.commands[1] != "Soul Rage"
$game_system.se_play($data_system.decision_se)
@actor_command_window.swap_commands
end
if not Input.trigger?(Input::UP) and not Input.trigger?(Input::DOWN)
@actor_command_window.update
end
else
if @actor_command_window.commands[1] == "Soul Rage"
$game_system.se_play($data_system.cancel_se)
@actor_command_window.swap_commands
end
end
if @actor_command_window.commands[1] == "Soul Rage" and
Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
@active_battler.current_action.kind = 3
start_rage_select
return
end
end
update_phase3_basic_command_srs_later
end
end
or some Scripter sees this, hope he can see the problem.