[XP] Developing Plug-In for Chaos Rage Limit System

Started by candi.horror, November 19, 2012, 04:36:05 pm

Previous topic - Next topic

candi.horror

November 19, 2012, 04:36:05 pm Last Edit: November 19, 2012, 06:14:25 pm by candi.horror
First of all this isn't a request for someone to make this script for me (if it was, I'd be posting in the wrong section ;) ). This is simply a request for how hard this would be. I'm a novice scripter, so I'm probably over-thinking this/not thinking about it correctly xD

What I was wish to do a write a plug-in for Blizzard's Chaos Rage Limit System that affects how SR is gained. Specially I want to add differnet 'fill modes as found in the Super Arts add-on for Charlie Fleed's  Side-View/ATB CBS. Basically this works by setting a 'rate type' to each actor. The different 'rate types' are as follows:

Quote from: Charlie Fleed
Rage: gain Superart points by inflicting damage.

Pain: gain Superart points by suffering damage.

Emphaty: gain Superart points by damage inflicted to allies.

Category: gain Superart points when skills of determined categories are used.

Critical: gain Superart points when with low HP.

Damage: a mix between Rage and Pain.


The speed at which the bar will fill depends on adjustable rates, one for each fill mode. You can set the default values in the configuration:


TYPE_0_RATE=2
TYPE_1_RATE=0.75
TYPE_2_RATE=1
TYPE_3_RATE=0.25
TYPE_4_RATE=0.1
TYPE_5a_RATE=0.5
TYPE_5b_RATE=0.5


During the game, you will be able to change them by using a Call Script command with, for example, the code:
$game_system.type_0_rate = 3


So my question is; how difficult would it be to make CRLS like this? I think it should be *somewhat* easy, it seems to me just setting up an alias method for SR fill rate, then again I'm just a n00b so what do I know? xD


Here's the code that Charlie Fleed used in his CBS. All credit goes to him.

#==============================================================================
# ** Super Arts (Add-on for the Custom Battle System (CTB) by Charlie Fleed)
#
# Version:           1.9        
# Author:    Charlie Fleed
#==============================================================================

#==============================================================================
# ■                         *** CONFIGURATION ***                           ■ #
#==============================================================================


SUPER_ARTS_NAME = "Superart"
SUPER_ARTS_CATEGORY_NAME = "Superarts"
SUPER_ARTS_FILLING_CATEGORY_NAMES = ["Black Arts", "Techs"]

TYPE_0_RATE = 2
TYPE_1_RATE = 0.75
TYPE_2_RATE = 1
TYPE_3_RATE = 0.25
TYPE_4_RATE = 0.1
TYPE_5a_RATE = 0.5
TYPE_5b_RATE = 0.5

SUPER_ARTS_TYPE_DEFAULT = 0
# 0 - Earn SA points by suffered damage (SA=TYPE_0_RATE*SUPER_ARTS_MAX*damage/(MaxHp))
# 1 - Earn SA points by inflicted damage (SA=TYPE_1_RATE*SUPER_ARTS_MAX*damage/(AttackerMaxHP))
# 2 - Earn SA points by suffered damage by allies (SA=TYPE_2_RATE*SUPER_ARTS_MAX*damage/(AllyMaxHp))
# 3 - Earn SA points when skills belonging to given categories are used (SA=TYPE_3_RATE*SUPER_ARTS_MAX)
# 4 - Earn SA points when hp <= max_hp / 4 (SA=TYPE_4_RATE*SUPER_ARTS_MAX)
# 5 - A mix between 0 and 1

STATUS_WINDOW_SUPERARTS_BAR_HEIGHT_STYLE_1 = 6
STATUS_WINDOW_SUPERARTS_BAR_OFFSET_STYLE_1 = 9

SUPER_ARTS_MENU_PATCH_1 = true
SUPER_ARTS_MENU_PATCH_2 = true

#==============================================================================
# SUPER ARTS IDENTIFICATION
#==============================================================================

SUPER_ARTS_MAX = 200
SUPER_ARTS_TYPE_NAMES = ["Pain", "Rage", "Empathy", "Category", "Critical", "Damage"]


#==============================================================================
# **
#------------------------------------------------------------------------------
#==============================================================================

class Game_Temp
 #--------------------------------------------------------------------------
 # *
 #--------------------------------------------------------------------------
 attr_accessor :superarts_elem_id
 attr_accessor :filling_category_elem_ids

 #--------------------------------------------------------------------------
 # *
 #--------------------------------------------------------------------------
 alias initialize_superarts initialize
 def initialize
   # Perform the original call
   initialize_superarts
   @superarts_elem_id = $data_system.elements.index(SUPER_ARTS_NAME)
   @filling_category_elem_ids = []
   for i in 0 ... SUPER_ARTS_FILLING_CATEGORY_NAMES.size
     @filling_category_elem_ids[i] = $data_system.elements.index("CMD " +
     SUPER_ARTS_FILLING_CATEGORY_NAMES[i])
   end
 end
end


#==============================================================================
# **
#------------------------------------------------------------------------------
#==============================================================================

class Game_System
 #--------------------------------------------------------------------------
 # *
 #--------------------------------------------------------------------------
 attr_accessor :type_0_rate
 attr_accessor :type_1_rate
 attr_accessor :type_2_rate
 attr_accessor :type_3_rate
 attr_accessor :type_4_rate
 attr_accessor :type_5a_rate
 attr_accessor :type_5b_rate

 #--------------------------------------------------------------------------
 # *
 #--------------------------------------------------------------------------
 alias sa_initialize initialize
 def initialize
   sa_initialize
   @type_0_rate = TYPE_0_RATE
   @type_1_rate = TYPE_1_RATE
   @type_2_rate = TYPE_2_RATE
   @type_3_rate = TYPE_3_RATE
   @type_4_rate = TYPE_4_RATE
   @type_5a_rate = TYPE_5a_RATE
   @type_5b_rate = TYPE_5b_RATE
 end
end

module RPG
 class Skill
   #------------------------------------------------------------------------
   # *
   #------------------------------------------------------------------------
   def is_superart
     return self.element_set.include?($game_temp.superarts_elem_id)
   end
 end
end

#==============================================================================
#                               GAME_ACTOR                                    #
#==============================================================================
#==============================================================================
# SUPER ARTS POINTS
#==============================================================================
class Game_Actor < Game_Battler
 #--------------------------------------------------------------------------
 # *
 #--------------------------------------------------------------------------
 attr_accessor :super_arts_points
 attr_accessor :super_arts_type

 #--------------------------------------------------------------------------
 # *
 #--------------------------------------------------------------------------
 alias setup_super_arts setup
 def setup(actor_id)
   # Perform the original call
   setup_super_arts(actor_id)
   #INITIALIZE SUPER ARTS POINTS
   @super_arts_points = 0
   #INITIALIZE SUPER ARTS TYPE
   @super_arts_type = SUPER_ARTS_TYPE_DEFAULT
 end

 #--------------------------------------------------------------------------
 # * Determine if Skill can be Used
 #     skill_id : skill ID
 #--------------------------------------------------------------------------
 alias sa_skill_can_use? skill_can_use?
 def skill_can_use?(skill_id)
   if $data_skills[skill_id].is_superart
     if self.super_arts_points < SUPER_ARTS_MAX
       return false
     end
   end
   # Perform the original call
   return sa_skill_can_use?(skill_id)
 end
 
 #--------------------------------------------------------------------------
 # *
 #--------------------------------------------------------------------------
 def toggle_superart_type
   @super_arts_type = (@super_arts_type + 1) % (SUPER_ARTS_TYPE_NAMES.size)
 end
 
 #--------------------------------------------------------------------------
 # *
 #--------------------------------------------------------------------------
 def superart_type_s
   return SUPER_ARTS_TYPE_NAMES[@super_arts_type]
 end

 #--------------------------------------------------------------------------
 # *
 #--------------------------------------------------------------------------
 alias sa_refresh_commands refresh_commands
 def refresh_commands
   sa_refresh_commands
   if $game_temp.in_battle
     @individual_commands.delete(SUPER_ARTS_CATEGORY_NAME)
   end
 end
end

#==============================================================================
# SHOW THE GAUGE BAR
#==============================================================================
class Window_BattleStatus
 #--------------------------------------------------------------------------
 # *
 #--------------------------------------------------------------------------
 alias sa_draw_actor_data draw_actor_data
 def draw_actor_data(actor, actor_x, actor_y, i = -1)
   if actor.has_superarts?
     if STATUS_WINDOW_STYLE == 1
       super_art_bar = Bar.new(actor_x + 370,
         actor_y + STATUS_WINDOW_SUPERARTS_BAR_OFFSET_STYLE_1,
         60, STATUS_WINDOW_SUPERARTS_BAR_HEIGHT_STYLE_1, self.contents)
     elsif STATUS_WINDOW_STYLE == 2
       super_art_bar = Bar.new(actor_x, actor_y + 1, 80, 3, self.contents)
     elsif STATUS_WINDOW_STYLE == 3
       super_art_bar = Bar.new(actor_x + 2, actor_y + 68, 120, 6, self.contents)
     end
     super_art_bar.bar_complete = "bar complete - superarts.png"
     super_art_bar.bar = "bar - superarts.png"
     super_art_bar.bar_background = "bar background - superarts.png"
     super_art_bar.highlight_complete = true
     super_art_bar.back_opacity = 220
     super_art_bar.refresh(actor.super_arts_points, SUPER_ARTS_MAX)
     if STATUS_WINDOW_STYLE == 3
       current_font_size = self.contents.font.size
       current_color = self.contents.font.color
       current_bold = self.contents.font.bold
       self.contents.font.color = normal_color
       self.contents.font.size = 13
       self.contents.font.bold = true
       self.contents.draw_text_bordered_2(actor_x + 4, actor_y + 62, 40,
         self.contents.font.size, "Overdrive", 0)
       self.contents.font.size = current_font_size
       self.contents.font.color = current_color
       self.contents.font.bold = current_bold
     end
     if(actor.super_arts_points == SUPER_ARTS_MAX)
       current_font_size = self.contents.font.size
       self.contents.font.size = 12
       self.contents.font.color = Color.new(255, 180, 50, 255)
       if STATUS_WINDOW_STYLE == 1
         self.contents.draw_text_shadowed_2(actor_x + 400, actor_y, 24,
           self.contents.font.size - 2, "SA", 2)
       elsif STATUS_WINDOW_STYLE == 2
         self.contents.draw_text_shadowed_2(actor_x + 56, actor_y, 24,
           self.contents.font.size, "SA", 2)
       elsif STATUS_WINDOW_STYLE == 3
         self.contents.draw_text_shadowed_2(actor_x + 94, actor_y + 64, 24,
           self.contents.font.size, "SA", 2)
       end
       self.contents.font.size = current_font_size
     end
   end
   sa_draw_actor_data(actor, actor_x, actor_y, i)
 end
end

#==============================================================================
# SUPERARTS POINTS ACCUMULATION
#==============================================================================
class Game_Battler
 #--------------------------------------------------------------------------
 # *
 #--------------------------------------------------------------------------
 alias superart_attack_effect attack_effect
 def attack_effect(attacker)
   # Perform the original call
   result = superart_attack_effect(attacker)
   if self.is_a? Game_Actor and self.has_superarts?
     if self.super_arts_type == 0
       if(self.damage.is_a? Integer and self.damage > 0)
         self.super_arts_points = [SUPER_ARTS_MAX,
           self.super_arts_points + $game_system.type_0_rate * SUPER_ARTS_MAX *
           self.damage / (self.maxhp)].min
       end
     end
     if self.super_arts_type == 5
       if(self.damage.is_a? Integer and self.damage > 0)
         self.super_arts_points = [SUPER_ARTS_MAX,
           self.super_arts_points + $game_system.type_5a_rate * SUPER_ARTS_MAX *
           self.damage / (self.maxhp)].min
       end
     end
   end
   if attacker.is_a? Game_Actor and attacker.has_superarts?
     if attacker.super_arts_type == 1
       if(self.damage.is_a? Integer and self.damage > 0)
         attacker.super_arts_points = [SUPER_ARTS_MAX,
           attacker.super_arts_points + $game_system.type_1_rate *
           SUPER_ARTS_MAX * self.damage / attacker.maxhp].min
       end
     end
     if attacker.super_arts_type == 5
       if(self.damage.is_a? Integer and self.damage > 0)
         attacker.super_arts_points = [SUPER_ARTS_MAX,
           attacker.super_arts_points + $game_system.type_5b_rate *
           SUPER_ARTS_MAX * self.damage / attacker.maxhp].min
       end
     end
   end
   if(self.is_a? Game_Actor and self.damage.is_a? Integer and self.damage > 0)
     sa_points_for_type_2 =
       $game_system.type_2_rate * SUPER_ARTS_MAX * self.damage / (self.maxhp)
     for actor in $game_party.actors
       next if actor == self or actor.dead?
       actor.get_sa_points(sa_points_for_type_2, 2)
     end
   end
   return result
 end
 
 #--------------------------------------------------------------------------
 # *
 #--------------------------------------------------------------------------
 alias superart_skill_effect skill_effect
 def skill_effect(user, skill)
   # Perform the original call
   result = superart_skill_effect(user, skill)
   if self.is_a? Game_Actor and self.has_superarts?
     if self.super_arts_type == 0
       if(self.damage.is_a? Integer and self.damage > 0)
         self.super_arts_points = [SUPER_ARTS_MAX,
           self.super_arts_points +
           $game_system.type_0_rate * SUPER_ARTS_MAX * self.damage / (self.maxhp)].min
       end
     end
     if self.super_arts_type == 5
       if(self.damage.is_a? Integer and self.damage > 0)
         self.super_arts_points = [SUPER_ARTS_MAX,
           self.super_arts_points +
           $game_system.type_5a_rate * SUPER_ARTS_MAX * self.damage / (self.maxhp)].min
       end
     end
   end
   if user.is_a? Game_Actor and user.has_superarts?
     if user.super_arts_type == 1
       if(self.damage.is_a? Integer and self.damage > 0)
         user.super_arts_points = [SUPER_ARTS_MAX, user.super_arts_points +
           $game_system.type_1_rate * SUPER_ARTS_MAX * self.damage / user.maxhp].min
       end
     end
     if user.super_arts_type == 5
       if(self.damage.is_a? Integer and self.damage > 0)
         user.super_arts_points = [SUPER_ARTS_MAX, user.super_arts_points +
           $game_system.type_5b_rate * SUPER_ARTS_MAX * self.damage / user.maxhp].min
       end
     end
   end
   if(self.is_a? Game_Actor and self.damage.is_a? Integer and self.damage > 0)
     sa_points_for_type_2 =
       $game_system.type_2_rate * SUPER_ARTS_MAX * self.damage / (self.maxhp)
     for actor in $game_party.actors
       next if actor == self or actor.dead?
       actor.get_sa_points(sa_points_for_type_2, 2)
     end
   end

   return result
 end

 #--------------------------------------------------------------------------
 # *
 #--------------------------------------------------------------------------
 alias superart_item_effect item_effect
 def item_effect(item)
   # Perform the original call
   result = superart_item_effect(item)
   if self.is_a? Game_Actor
     if self.has_superarts?
       if self.super_arts_type == 0
         if(self.damage.is_a? Integer and self.damage > 0)
           self.super_arts_points = [SUPER_ARTS_MAX,
             self.super_arts_points +
             $game_system.type_0_rate * SUPER_ARTS_MAX * self.damage / (self.maxhp)].min
         end
       end
       if self.super_arts_type == 5
         if(self.damage.is_a? Integer and self.damage > 0)
           self.super_arts_points = [SUPER_ARTS_MAX,
             self.super_arts_points +
             $game_system.type_5a_rate * SUPER_ARTS_MAX * self.damage / (self.maxhp)].min
         end
       end
     end
   else # item used on enemy, it happens only during a battle
     user = $scene.active_battler
     if user.is_a? Game_Actor and user.has_superarts? and
       user.super_arts_type == 1
       if(self.damage.is_a? Integer and self.damage > 0)
         user.super_arts_points = [SUPER_ARTS_MAX, user.super_arts_points +
           $game_system.type_1_rate * SUPER_ARTS_MAX * self.damage / user.maxhp].min
       end
     end
     if user.is_a? Game_Actor and user.has_superarts? and
       user.super_arts_type == 5
       if(self.damage.is_a? Integer and self.damage > 0)
         user.super_arts_points = [SUPER_ARTS_MAX, user.super_arts_points +
           $game_system.type_5b_rate * SUPER_ARTS_MAX * self.damage / user.maxhp].min
       end
     end
   end
   if(self.is_a? Game_Actor and self.damage.is_a? Integer and self.damage > 0)
     sa_points_for_type_2 =
       $game_system.type_2_rate * SUPER_ARTS_MAX * self.damage / (self.maxhp)
     for actor in $game_party.actors
       next if actor == self or actor.dead?
       actor.get_sa_points(sa_points_for_type_2, 2)
     end
   end

   return result
 end
 
 #--------------------------------------------------------------------------
 # *
 #--------------------------------------------------------------------------
 def get_sa_points(points, type_required)
   if has_superarts? and @super_arts_type == type_required
     self.super_arts_points = [SUPER_ARTS_MAX, self.super_arts_points + points].min
   end
 end
 
 #--------------------------------------------------------------------------
 # *
 #--------------------------------------------------------------------------
 alias sa_action_executed action_executed
 def action_executed(b_time)
   sa_action_executed(b_time)
   action = self.current_action
   if action.kind == 1
     skill = $data_skills[action.skill_id]
     if self.is_a? Game_Actor and self.has_superarts?
       if self.super_arts_type == 3
         for i in 0 ... SUPER_ARTS_FILLING_CATEGORY_NAMES.size
           if skill.element_set.include?($game_temp.filling_category_elem_ids[i])
             @super_arts_points = [SUPER_ARTS_MAX, @super_arts_points +
             $game_system.type_3_rate * SUPER_ARTS_MAX].min
             break
           end
         end
       end
     end
   end
 end
 
end

#==============================================================================
# SUPERARTS POINTS CONSUMPTION
#==============================================================================
class Scene_Battle
 
 #--------------------------------------------------------------------------
 # *
 #--------------------------------------------------------------------------
 alias sa_main main
 def main
   @overdrive_window = Window_Overdrive.new
   sa_main
   @overdrive_window.dispose
 end

 #--------------------------------------------------------------------------
 # *
 #--------------------------------------------------------------------------
 alias sa_start_skill_select start_skill_select
 def start_skill_select
   sa_start_skill_select
   # Disable overdrive window
   @overdrive_window.active = false
 end
 
 #--------------------------------------------------------------------------
 # *
 #--------------------------------------------------------------------------
 alias sa_end_skill_select end_skill_select
 def end_skill_select
   temp1=@actor_command_window.active
   temp2=@actor_command_window.visible
   sa_end_skill_select
   if @overdrive_window.visible
     # go back to the overdrive window
     @overdrive_window.active = true
     # Revert instructions executed in the original method
     @actor_command_window.active = temp1
     @actor_command_window.visible = temp2
   end
 end

 #--------------------------------------------------------------------------
 # *
 #--------------------------------------------------------------------------
 alias sa_end_enemy_select end_enemy_select
 def end_enemy_select
   temp1 = @actor_command_window.active
   temp2 = @actor_command_window.visible
   sa_end_enemy_select
   if @overdrive_window.visible
     # Revert instructions executed in the original method
     @actor_command_window.active = temp1
     @actor_command_window.visible = temp2
   end
 end

 #--------------------------------------------------------------------------
 # *
 #--------------------------------------------------------------------------
 alias sa_start_phase4 start_phase4
 def start_phase4
   sa_start_phase4
   # Disable overdrive window
   @overdrive_window.active = false
   @overdrive_window.visible = false
 end  

 #--------------------------------------------------------------------------
 # *
 #--------------------------------------------------------------------------
 alias sa_set_initial_action set_initial_action
 def set_initial_action
   case @actor_command_window.commands[@actor_command_window.index]
   # attack >>
   when $data_system.words.attack + " >>"
     @active_battler.current_action.kind = 0
     @active_battler.current_action.basic = 0
   end
   sa_set_initial_action
 end

 #--------------------------------------------------------------------------
 # * Determine if the Attack → command is available
 #--------------------------------------------------------------------------
 alias sa_phase3_setup_command_window2 phase3_setup_command_window2
 def phase3_setup_command_window2
   if @active_battler.super_arts_points == SUPER_ARTS_MAX and
   @active_battler.has_superarts?
     @individual_battle_commands.delete($data_system.words.attack)
     @individual_battle_commands.insert(0, $data_system.words.attack + " >>")
   end
   # original call
   sa_phase3_setup_command_window2
 end

 #--------------------------------------------------------------------------
 # * make_skill_action_result
 # # removes superarts points when a superart is used
 #--------------------------------------------------------------------------
 alias superart_make_skill_action_result make_skill_action_result
 def make_skill_action_result
   # Get skill and battler
   skill = $data_skills[@active_battler.current_action.skill_id]
   battler = @active_battler
   # Perform the original call
   superart_make_skill_action_result
   if skill.is_superart
     battler.super_arts_points = 0
   end
 end
 
 #--------------------------------------------------------------------------
 # *
 #--------------------------------------------------------------------------
 def active_battler
   return @active_battler
 end
 
 #--------------------------------------------------------------------------
 # *
 #--------------------------------------------------------------------------
 alias superart_update_phase3_basic_command update_phase3_basic_command
 def update_phase3_basic_command
   if Input.trigger?(Input::RIGHT)
     case @actor_command_window.commands[@actor_command_window.index]
     # attack >>
     when $data_system.words.attack + " >>"
       $game_system.se_play($data_system.decision_se)
       @overdrive_window.visible = true
       @overdrive_window.active = true
       @actor_command_window.active = false
       @active_battler.current_action.kind = 1
       @active_battler.action_selected(@active_battler.current_action)
       # Update the queue and the turn window
       update_battlers_queue
       @turn_window.set_new_battlers_and_animate(@battlers_queue)
       return
     end
   end
   if Input.trigger?(Input::C)
     case @actor_command_window.commands[@actor_command_window.index]
     # attack >>
     when $data_system.words.attack + " >>"
       $game_system.se_play($data_system.decision_se)
       @active_battler.current_action.kind = 0
       @active_battler.current_action.basic = 0
       start_enemy_select
     end
   end
   # An action has not been decided
   # update the battle_turn window if the selection has changed
   if (@actor_command_window.commands[@actor_command_window.index] != @prev_actor_command)
     case @actor_command_window.commands[@actor_command_window.index]
     # attack >>
     when $data_system.words.attack + " >>"
       @active_battler.current_action.kind = 0
       @active_battler.current_action.basic = 0
     end
   end
   superart_update_phase3_basic_command
 end
 
 #--------------------------------------------------------------------------
 # *
 #--------------------------------------------------------------------------
 alias superarts_update_phase3 update_phase3
 def update_phase3
   if @overdrive_window.active
     update_overdrive
     return
   end
   superarts_update_phase3
 end
 
 #--------------------------------------------------------------------------
 # *
 #--------------------------------------------------------------------------
 def update_overdrive
   if Input.trigger?(Input::C)
     $game_system.se_play($data_system.decision_se)
     @individual_battle_commands_skill_category=@overdrive_window.commands[0]
     start_skill_select
     # The action has been decided
     @active_battler.action_decided($game_temp.battle_time,
       @active_battler.current_action)
   end  
   if Input.trigger?(Input::B) or Input.trigger?(Input::LEFT)
     $game_system.se_play($data_system.cancel_se)
     @overdrive_window.visible = false
     @overdrive_window.active = false
     @actor_command_window.active = true
     @active_battler.current_action.kind = 0
     # Reset @active_battler.current_action.skill_id
     @active_battler.current_action.skill_id = 0
     @active_battler.action_selected(@active_battler.current_action)
     # Update the queue and the turn window
     update_battlers_queue
     @turn_window.set_new_battlers_and_animate(@battlers_queue)
   end
 end
 
 #--------------------------------------------------------------------------
 # *
 #--------------------------------------------------------------------------
 alias superart_end_regular_turn end_regular_turn
 def end_regular_turn
   superart_end_regular_turn
   # return if switch
   return if (@active_battler.current_action.kind == 1 and
     @active_battler.current_action.skill_id == $switch_skill_id)
   for actor in $game_party.actors
     if !actor.dead? and actor.hp <= actor.maxhp / 4
       if actor.has_superarts?
         if actor.super_arts_type == 4
           actor.super_arts_points = [SUPER_ARTS_MAX, actor.super_arts_points +
           $game_system.type_4_rate * SUPER_ARTS_MAX].min
         end
       end
     end
   end
 end

end

#==============================================================================
# CHANGE SUPERARTS TYPE IN SCENE STATUS
#==============================================================================
class Scene_Status
 #--------------------------------------------------------------------------
 # *
 #--------------------------------------------------------------------------
 alias sa_update update
 def update
   if Input.trigger?(Input::SHIFT)
     # Play SE
     $game_system.se_play($data_system.cursor_se)          
     @actor.toggle_superart_type
     @status_window.refresh
     return
   end
   sa_update
 end
end


#==============================================================================
# **
#------------------------------------------------------------------------------
#==============================================================================

class Window_Status
 #--------------------------------------------------------------------------
 # *
 #--------------------------------------------------------------------------
 alias sa_refresh refresh
 def refresh
   sa_refresh
   return unless SUPER_ARTS_MENU_PATCH_1
   # Superarts
   actor = @actor
   return if !actor.has_superarts?
   x = 300
   y = 0
     temp_fontsize = self.contents.font.size
     temp_fontbold = self.contents.font.bold
     self.contents.font.size = 12
     bar_sa = Bar.new(x, y + 16, 200, 4, self.contents)
     bar_sa.back_opacity = 200
     bar_sa.bar = "bar"
     bar_sa.bar_background = "bar_hp_bg"
     bar_sa.highlight_complete = true
     bar_sa.bar_complete = "bar complete - superarts"
     bar_sa.refresh(actor.super_arts_points, SUPER_ARTS_MAX)
     self.contents.draw_text(x, y, 200, 24, "SUPERARTS GAUGE")
     self.contents.draw_text(x, y + 16, 200, 24, "SUPERARTS TYPE: " +
       actor.superart_type_s)
     self.contents.blt(x + 140, y + 20, RPG::Cache.picture("shift"),
       Rect.new(0, 0, 28, 12))
     self.contents.draw_text(x + 170, y + 16, 60, 24, ": change")
     self.contents.font.size = temp_fontsize
     self.contents.font.bold = temp_fontbold
 end
end


#==============================================================================
# **
#------------------------------------------------------------------------------
#==============================================================================

class Window_MenuStatus < Window_Selectable
 #--------------------------------------------------------------------------
 # *
 #--------------------------------------------------------------------------
 alias sa_refresh refresh
 def refresh
   sa_refresh
   return unless SUPER_ARTS_MENU_PATCH_2
   # Superarts
   for i in 0 ... $game_party.actors.size
     actor = $game_party.actors[i]
     next if !actor.has_superarts?
     x = 64 + 236
     y = i * 116
     temp_fontsize = self.contents.font.size
     temp_fontbold = self.contents.font.bold
     self.contents.font.size = 12
     bar_sa=Bar.new(x, y + 16, 100, 4, self.contents)
     bar_sa.back_opacity = 200
     bar_sa.bar = "bar"
     bar_sa.bar_background = "bar_hp_bg"
     bar_sa.highlight_complete = true
     bar_sa.bar_complete = "bar complete - superarts"
     bar_sa.refresh(actor.super_arts_points, SUPER_ARTS_MAX)
     self.contents.draw_text(x, y, 200, 24, "SUPERARTS GAUGE")
     self.contents.draw_text(x, y + 16, 200, 24, "SUPERARTS TYPE: " +
       actor.superart_type_s)
     self.contents.font.size = temp_fontsize
     self.contents.font.bold = temp_fontbold
   end
 end
end


#==============================================================================
# **
#------------------------------------------------------------------------------
#==============================================================================

class Game_Actor < Game_Battler
 #--------------------------------------------------------------------------
 # *
 #--------------------------------------------------------------------------
 def has_superarts?
   for i in 0 ... @skills.size
     skill = $data_skills[@skills[i]]
     if skill != nil
       for elem_id in skill.element_set
         if $data_system.elements[elem_id] == "CMD " + SUPER_ARTS_CATEGORY_NAME
           return true
         end
       end
     end
   end
   return false
 end
end


#==============================================================================
# **
#------------------------------------------------------------------------------
#==============================================================================

class Window_Overdrive < Window_Command_Plus
 #--------------------------------------------------------------------------
 # *
 #--------------------------------------------------------------------------
 def initialize
   super(ACTOR_COMMAND_WINDOW_WIDTH, 20 + 32, [SUPER_ARTS_CATEGORY_NAME], 20)
   self.custom_normal_color = ACTOR_COMMAND_WINDOW_TEXT_COLOR
   self.custom_normal_b_color = ACTOR_COMMAND_WINDOW_TEXT_BG_COLOR
   self.refresh
   self.x = ACTOR_COMMAND_WINDOW_X
   self.y = 368
   self.z = 203
   self.visible = false
   self.active = false
 end  
end

$charlie_fleed_superarts = true

Blizzard

Maybe you should consider using a different script. CRLS was never really meant to be expanded in such a way that you can gain SR in different ways. FFX had that kind of feature for filling the Ecstase bar and using "fill on dealing damage to enemies" was the best option while the rest sucked. I remember that Trickster made a script like that way back. Maybe you can find it at HB Games.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

candi.horror

Oh well it was worth a shot. Its not a crucial feature of my game, I was just curious if CRLS could be modded to do this. As CRLS stands, its the best Overdrive-type system I've found, and I'd rather not switch scripts. Thanks for the prompt reply!

Blizzard

Of course it can be modded. I'm just kinda reluctant to see it being modded in such as way. >_>
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

candi.horror

D'oh, it seems I misunderstood @_@

Looking at thsi idea from a game balance perspective this might be hard to pull off. The way I was thinking of implementing it is that the SP fill type would be determined by class, ie a White Mage would gain SR based on 'Empathy', a Warrior gaining it via 'rage' etc. I suppose the balance would come into play wit the rates for each fill type though.

this is something I'll have to consider more. As I said, its not a crucial feature of my game, but it could in theory be made cool. I understand why you're loathe to see it modded this way though, if this feature isn't implemented well it just turns out lame (like in FFX).