Per 2016, RMID pindah ke RMID Discord (Invite link dihapus untuk mencegah spambot -Theo @ 2019). Posting sudah tidak bisa dilakukan lagi.
Mohon maaf atas ketidaknyamanannya dan mohon kerjasamanya.

Share | 
 

 CrimsonSeas Overdrive

Topik sebelumnya Topik selanjutnya Go down 
CrimsonSeas Overdrive Empty2009-12-15, 12:28
PostCrimsonSeas Overdrive
#1
CrimsonSeas 
Novice
Novice
CrimsonSeas

Level 5
Posts : 106
Thanked : 9
Engine : RMVX

CrimsonSeas Overdrive Vide
CrimsonSeas Overdrive
Versi: 1.0
Skill System<TIPE>


Pengenalan
Script yg gw bikin karena gw ga puas sama script2 Overdrive lain, jd gw coba bikin script Overdrive yg menggabungkan FF7 Limit Break sama FFX Overdrive


Fitur

  • Simple Overdrive Level; ide dari FF7 tapi gw bikin lebih simple, intinya kita cuma bisa pake overdrive yg levelnya sama ato dibawah overdrive level kita
  • 12 Overdrive mode, pilih sendiri apakah gauge bakal keisi waktu kena damage, waktu nyerang musuh, waktu ngeheal etc.
  • Dapet overdrive mode dengan melakukan action tertentu berkali2. Cth: Attack 100x buat dapet OD mode Attacker
  • Fury dan Sadness, state yg mempercepat/memperlambat pengisian gauge
  • Sangat Customizable. (sampe2 capek customizenya gr2 kepanjangan :P)
  • Overdrive Menu, atur OD level dan OD mode tiap character.



Screenshots
Contoh Overdrive selection di battle:
Spoiler:

Overdrive Menu:
Spoiler:

12 Overdrive modes:
Spoiler:




Demo
http://www.media*fire.com/?oyezdtv2md2

Script

Code:
=begin
================================================================================
CrimsonSeas Ultimate series; Overdrive System
by CrimsonSeas
================================================================================
Introduction:
This script wasn't originally made to be part of the Ultimate series, but after
I started making Ultimate series I decided to upgrade this to Ultimate series.

--------------------------------------------------------------------------------
Features:
This script introduces the following features:
From FF7:
+Overdrive levels,but I made it simpler so it will work like this: Any OD skill
lower or same level than the character's current OD level can be used. Any OD
skill higher than the character's current OD level can't. You can also set up
different increase rate for each OD level for each character, so you can make
that character's with higher level OD fills slower than lower OD level characters.

+Fury states, which will increase or decrease OD rate depending on how they are
configured. COnfigure this via the state's note field.

From FFX:
+Overdrive Modes, so each character can have their own conditions to fill the
OD gauge. This also incorporates the system in which after doing certain
conditions a number of times, the character will get additional OD Mode.
Ex: Attacking 120 times and you'll get Attacker OD Mode.

All this comes with a menu that enables you to choose OD level and OD Mode for each
character

This script is also highly customizable, to the point that I myself am confused
customizing this script for my project  (Config ends at line 525, wtf?)

List of customization possible:
+OD Mode Name

+Gauge increase rate that is unique to each character and each OD Mode. This also
come with a default so if you're tired setting this you can just use the default.

+Different number of actions that has to be taken to acquire new OD Mode for each
characters. This also comes with a default.

+Texts at the OD menu

+Fury and Sadness states

================================================================================
How to Use
================================================================================
--------------------------------------------------------------------------------
Note Tags
--------------------------------------------------------------------------------
<overdrive od_lv>   : Defines that a skill is an overdrive skill, and what is it's
                     level.
   
<fury value>        : For use in states, defines skills that has fury effect. Fury
                     increases/decreases OD gain rate depending on the value.
                     Write value in percent, value of 100 will double the rate
                     while value of -100 will stop OD gauge. And a value of
                     -200 will reverse the gauge rate :P. All states with fury
                     tags will be added together.
                     
<mode od_mode>      : Defines an enemy's drive gauge mode. Refer to the mode name
                     constant in the module below to determine what you should
                     write here. Remember that you should write it without the
                     quote marks.
                     
<od_increase val>   : Defines items or skills that will change overdrive value.
                     Negative value will decrease drive gauge.
                     
--------------------------------------------------------------------------------
Script Call
--------------------------------------------------------------------------------
Use these script calls to modify actor's overdrive gauge in the event editor

change_actor_od(id, set_value) => This will set actor's drive gauge
increase_actor_od(id, value_change) = This will increase/decrease actor's drive gauge
--------------------------------------------------------------------------------

Define other configs in the config section. I know it's long, but that's the price
for high customizability right?


================================================================================
Module Configuration
================================================================================
=end

module CSU
 module Overdrive

=begin
================================================================================
Modes Name
================================================================================
Use this part to set up names for each OD Mode:
STOIC => Increases by taking damage.
ATTACKER = > Increases by dealing damage. This excludes items and OD skills itself.
HEALER => Increase by healing ally other than self
SLAYER => Increase by killing an enemy
VICTORY => Increase by winning battle
COMRADE => Increase by getting another ally to be damaged.
COWARD => Increase by escaping battle.
ALLY => Increase by taking any action.
DAREDEVIL => Increase by taking any action at low HP.
SOLO=> Increase by taking any action while alone.
DANCER => Increase by evading enemy attack. (REMEMBER EVADE != MISS)
AVENGER => Increase by getting another ally to be KO'd.
=end

 STOIC_NAME = "Stoic"
 ATTACKER_NAME = "Attacker"
 HEALER_NAME = "Healer"
 SLAYER_NAME = "Slayer"
 VICTORY_NAME = "Victory"
 COMRADE_NAME = "Comrade"
 COWARD_NAME = "Coward"
 ALLY_NAME = "Ally"
 DAREDEVIL_NAME = "Daredevil"
 SOLO_NAME = "Solo"
 DANCER_NAME = "Dancer"
 AVENGER_NAME = "Avenger"
#Explanation for each OD type at the OD menu help window.
 STOIC_HELP = "Increases gauge when damaged."
 ATTACKER_HELP = "Increases gauge when damaging enemy."
 HEALER_HELP = "Increases gauge when you heal ally."
 SLAYER_HELP = "Increases gauge when you kill enemy."
 VICTORY_HELP = "Increases gauge when you win battle."
 COMRADE_HELP = "Increases gauge when ally is damaged."
 COWARD_HELP = "Increases gauge when you escape from battle."
 ALLY_HELP = "Increases gauge whenever you took an action."
 DAREDEVIL_HELP = "Increases gauge whenever you took an action in low health."
 SOLO_HELP = "Increases gauge whenever you took an action while being alone."
 DANCER_HELP = "Increases gauge whenever you evaded enemy attack."
 AVENGER_HELP = "Increases gauge when an ally is KO'd"
#Various texts for OD menu commands.
 LEVEL_SET_VCB = "Level Set"
 VIEW_OD_VCB = "View"
 MODE_VCB = "Drive Modes"
 LEVEL_VCB = "Level"
 LEVEL_CHANGED_VCB = "Changed to level "
 MODE_CHANGED_VCB = "Changed to mode "
#Various help text for OD menu commands
 LEVEL_SET_HELP = "Sets OD level (Resets gauge to zero.)"
 VIEW_OD_HELP = "View Overdrives."
 MODE_HELP = "Sets Drive mode."
#Sets the default OD Mode.
 DEFAULT_TYPE = "Stoic"
#Sets the max OD level
 MAX_OD_LEVEL = 3
#Sets the sound to be played when OD is full.
 OD_SOUND = "Chime2"
#Sets name for Overdrive. This will be shown if you use the default OD gauge
 OD_NAME = "Overdrive"
#Sets whether you want to use Overdrive exclusive battle command window. This
#constant must be set to false if you use any other custom battle command window
 USE_OD_CMD_WINDOW = true
#Inform the script whether you are using Tankentai SBS or not
 USE_TANKENTAI_ATB = true
#Inform the script whther you are using a custom HUD or not. If you are using
#Custom HUD, you have to make the OD gauge show on your HUD yourself
 USE_CUSTOM_HUD = false
#Inform the script whether you are using Custom Menu scripts or not. If you are
#using Custom menu scripts, you have to configure the custom menu script yourself
#to enable the Overdrive Menu.
 USE_CUSTOM_MENU_SCRIPT = false
end
end

class Game_Actor
=begin
================================================================================
Just FYI, actor's max od level are determined by the skill that has the highest
OD level. So if a character has a skill with OD level 3, his/her max OD level
would become 3 as well.
================================================================================
Sets rate for each OD mode. This rate is an array with size = max od level, with
the leftmost value being the rate for od level = 1
OD increase formulas:
Stoic: Rate * Damage taken / Max HP
Attacker: Rate
Healer: Rate * Healing value / Target's Max HP
Slayer: Rate
Victory: Rate
Coward: Rate
Comrade: Rate * Damage taken / Victim's Max HP
Ally: Rate
Solo: Rate
Daredevil: Rate
Avenger: Rate
Dancer:Rate
================================================================================
=end

 def stoic_rate
   case @actor_id
   when 1
     temp = [2000, 1050, 800] #Specific rate
   when 2
     temp = [2100, 1100, 850]
   end
   temp = [1600, 1000, 750] if temp == nil #Default Rate
   return temp[self.od_level-1]
 end
 
 def attacker_rate
   case @actor_id
   when 1
     temp = [100, 70, 60]
   when 2
     temp = [110, 85, 65]
   end
   temp = [100, 80, 60] if temp == nil
   return temp[self.od_level-1]
 end
 
 def healer_rate
   case @actor_id
   when 1
     temp = [200, 155, 80]
   when 2
     temp = [150, 110, 70]
   end
   temp = [180, 135, 90] if temp == nil
   return temp[self.od_level-1]
 end
 
 def slayer_rate
   case @actor_id
   when 1
     temp = [200, 140, 110]
   when 2
     temp = [220, 160, 125]
   end
   temp = [200, 160, 100] if temp == nil
   return temp[self.od_level-1]
 end
 
 def victory_rate
   case @actor_id
   when 1
     temp = [250, 160, 120]
   when 2
     temp = [250, 190, 150]
   end
   temp = [250, 180, 125] if temp == nil
   return temp[self.od_level-1]
 end
 
 def coward_rate
   case @actor_id
   when 1
     temp = [200, 120, 100]
   when 2
     temp = [200, 150, 110]
   end
   temp = [200, 160, 105] if temp == nil
   return temp[self.od_level-1]
 end
 
 def comrade_rate
   case @actor_id
   when 1
     temp = [1600, 800, 500]
   when 2
     temp = [1800, 875, 575]
   end
   temp = [1700, 825, 550] if temp == nil
   return temp[self.od_level-1]
 end
 
 def ally_rate
   case @actor_id
   when 1
     temp = [80, 60, 40]
   when 2
     temp = [95, 65, 45]
   end
   temp = [100, 70, 40] if temp == nil
   return temp[self.od_level-1]
 end
 
 def daredevil_rate
   case @actor_id
   when 1
     temp = [100, 70, 45]
   when 2
     temp = [105, 75, 55]
   end
   temp = [120, 80, 65] if temp == nil
   return temp[self.od_level-1]
 end
   
 def avenger_rate
   case @actor_id
   when 1
     temp = [200, 140, 100]
   when 2
     temp = [220, 170, 120]
   end
   temp = [225, 165, 115] if temp == nil
   return temp[self.od_level-1]
 end
 
 def dancer_rate
   case @actor_id
   when 1
     temp = [160, 125, 80]
   when 2
     temp = [150, 110, 70]
   end
   temp = [180, 135, 90] if temp == nil
   return temp[self.od_level-1]
 end
 
 def solo_rate
   case @actor_id
   when 1
     temp = [100, 70, 45]
   when 2
     temp = [105, 75, 55]
   end
   temp = [120, 80, 65] if temp == nil
   return temp[self.od_level-1]
 end
 
=begin
================================================================================
Set number of actions needed to acquire new OD Mode
If set to 0, that means the particular mode will be available from the start.
For the sake of the demo, I made it so Ralph already have all modes from the
start.
================================================================================
=end

 
 def stoic_count_needed
   case @actor_id
   when 1
     return 0 #for specific actor
   end
   return 0 #default
 end
 
 def attacker_count_needed
   case @actor_id
   when 1
     return 0
   end
   return 120
 end
 
 def healer_count_needed
   case @actor_id
   when 1
     return 0
   end
   return 80
 end
 
 def slayer_count_needed
   case @actor_id
   when 1
     return 0
   end
   return 100
 end
 
 def coward_count_needed
   case @actor_id
   when 1
     return 0
   end
   return 80
 end
 
 def victory_count_needed
   case @actor_id
   when 1
     return 0
   end
   return 90
 end
 
 def comrade_count_needed
   case @actor_id
   when 1
     return 0
   end
   return 120
 end
 
 def ally_count_needed
   case @actor_id
   when 1
     return 0
   end
   return 200
 end
 
 def daredevil_count_needed
   case @actor_id
   when 1
     return 0
   end
   return 60
 end
 
 def avenger_count_needed
   case @actor_id
   when 1
     return 0
   end
   return 80
 end
 
 def dancer_count_needed
   case @actor_id
   when 1
     return 0
   end
   return 50
 end
 
 def solo_count_needed
   case @actor_id
   when 1
     return 0
   end
   return 60
 end
 
end


=begin
================================================================================
Enemy OD Setup
================================================================================
Well this part is just like the actor's setup, except there's no setting for count
needed.
To define an enemy's OD Mode, write this into the enemy's note box:
   <type Mode name>
Ex: <type Stoic>
Name should be the one defined in the Config module above

Enemy OD level is automatically calculated depending on the highest OD level skill
that the enemy has. (just like the actor one)
Ex: If Slime has 2 skills, 1 with OD level 1 and 1 with OD level 3, then Slime's
OD level will be 3.
=end

class Game_Enemy
 def stoic_rate
   case @enemy_id
   when 1
     temp = [10000, 10000, 750] #This ridiculously large value is for testing only
   end
   temp = [1600, 1000, 750] if temp == nil
   return temp[self.od_level-1]
 end
 
 def attacker_rate
   case @enemy_id
   when 1
     temp = [100, 80, 60]
   end
   temp = [100, 80, 60] if temp == nil
   return temp[self.od_level-1]
 end
 
 def healer_rate
   case @enemy_id
   when 1
     temp = [180, 135, 90]
   end
   temp = [180, 135, 90] if temp == nil
   return temp[self.od_level-1]
 end
 
 def slayer_rate
   case @enemy_id
   when 1
     temp = [200, 160, 100]
   end
   temp = [200, 160, 100] if temp == nil
   return temp[self.od_level-1]
 end
 
 def victory_rate
   case @enemy_id
   when 1
     temp = [250, 180, 125]
   end
   temp = [250, 180, 125] if temp == nil
   return temp[self.od_level-1]
 end
 
 def coward_rate
   case @enemy_id
   when 1
     temp = [200, 160, 105]
   end
   temp = [200, 160, 105] if temp == nil
   return temp[self.od_level-1]
 end
 
 def comrade_rate
   case @enemy_id
   when 1
     temp = [1700, 825, 550]
   end
   temp = [1700, 825, 550] if temp == nil
   return temp[self.od_level-1]
 end
 
 def ally_rate
   case @enemy_id
   when 1
     temp = [100, 70, 40]
   end
   temp = [100, 70, 40] if temp == nil
   return temp[self.od_level-1]
 end
 
 def daredevil_rate
   case @enemy_id
   when 1
     temp = [120, 80, 65]
   end
   temp = [120, 80, 65] if temp == nil
   return temp[self.od_level-1]
 end
   
 def avenger_rate
   case @enemy_id
   when 1
     temp = [225, 165, 115]
   end
   temp = [225, 165, 115] if temp == nil
   return temp[self.od_level-1]
 end
 
 def dancer_rate
   case @enemy_id
   when 1
     temp = [180, 135, 90]
   end
   temp = [180, 135, 90] if temp == nil
   return temp[self.od_level-1]
 end
 
 def solo_rate
   case @enemy_id
   when 1
     temp = [120, 80, 65]
   end
   temp = [120, 80, 65] if temp == nil
   return temp[self.od_level-1]
 end
end
#===============================================================================
#END CONFIG
#I know you're tired after seeing this many lines, go take a break for a while
#===============================================================================

module CSU
 if defined?(SCRIPTLIST) == nil
   SCRIPTLIST = []
 end
 SCRIPTLIST.push("Ultimate Overdrive")
end

def change_actor_od(id, value)
 $game_actors[id].overdrive = value
end

def increase_actor_od(id, increase)
 $game_actors[id].overdrive += increase
end


module RPG
 class Skill
   def create_skill_cache_ultimate_overdrive
     if @od_level == nil
       temp = self.note[/<overdrive\s+[0-9]+>/]
       if temp != nil
         @od_level = [[temp[/[0-9]+/].to_i, 0].max, CSU::Overdrive::MAX_OD_LEVEL].min
       else
         @od_level = 0
       end
     end
   end
   
   def overdrive?
     return self.note[/<overdrive\s+[0-9]+>/] != nil
   end
   
   attr_accessor :od_level
 end  
 
 class UsableItem
   def create_usableitem_cache_ultimate_overdrive
     if @od_increase == nil
       temp = self.note[/<od_increase\s+[0-9-]+>/]
       if temp != nil
         @od_level = temp[/[0-9-]+/].to_i
       else
         @od_increase = 0
       end
     end
   end
   attr_accessor :od_increase
 end
 
 class Enemy
   def create_enemy_cache_ultimate_overdrive
     if @od_type == nil
       temp = self.note[/<mode\s+.+>/]
       if temp != nil
         temp.slice![/<mode\s+/]
         temp.slice![/>/]
         @od_type = temp
       else
         @od_type = CSU::Overdrive::DEFAULT_TYPE
       end
     end
   end
     
   attr_accessor :od_type
 end
 
 class State
   def create_state_cache_ultimate_overdrive
     if @fury == nil
       temp = self.note[/<fury\s+[0-9-]+>/]
       if temp != nil
         @fury = temp[/[0-9-]+/].to_i
       else
         @fury = 0
       end
     end
   end
   
   attr_accessor :fury
 end
end

class Game_Battler
 attr_accessor   :overdrive
 attr_accessor   :od_level
 attr_accessor   :od_type
 
 def od_increase(od_value, sound = true)
   return self.overdrive = 0 if self.hp == 0
   return if self.overdrive == self.max_overdrive
   fury = 0
   for state in self.states
     fury += state.fury
   end
   od_value *= (1 + fury/100.0)
   self.overdrive = (od_value + self.overdrive).to_i
   self.overdrive = self.max_overdrive if self.overdrive > self.max_overdrive
   if $game_temp.in_battle
   Audio.se_play("Audio/SE/" + CSU::Overdrive::OD_SOUND, 80,  100) if self.overdrive >= self.max_overdrive && sound
   end
 end
 
 def max_overdrive
   return 1000
 end
 
 alias od_execute_damage execute_damage unless $@
 def execute_damage(user)
   if user.action.skill != nil
     user.overdrive = 0 if user.action.skill.overdrive?
   end
   od_increase_healer(user)
   od_execute_damage(user)
   od_increase_stoic(user)
   od_increase_attacker(user)
   od_increase_slayer(user)
   od_increase_comrade_ko(user)
   if self.hp == 0
     self.overdrive = 0
   end
 end
 
#Calls OD increase if evaded an attack
 alias od_attack_effect attack_effect unless $@
 def attack_effect(attacker)
   if rand(100) <= calc_eva(attacker) && self.od_type == CSU::Overdrive::DANCER_NAME && self.od_level > 0
     if self.actor?
       self.dancer_count += 1 unless self.dancer_count >= 32767
     end
     return if self.overdrive < self.max_overdrive
     od_increase(self.dancer_rate)
   end
   od_attack_effect(attacker)
 end

#Calls OD increase if evaded a skill
 alias od_skill_effect skill_effect unless $@
 def skill_effect(user, skill)
 
  if rand(100) <= calc_eva(user, skill) && self.od_type ==
CSU::Overdrive::DANCER_NAME && self.od_level > 0
     if self.actor?
       self.dancer_count += 1 unless self.dancer_count >= 32767
     end
     return if self.overdrive < self.max_overdrive
     od_increase(self.dancer_rate)
   end
   od_skill_effect(user, skill)
   if skill.od_increase != 0
     self.overdrive += skill.od_increase
     self.overdrive = [[self.overdrive, 0].max, 1000].min
   end
 end

#Calls OD increase if Comrade or Avenger
 def od_increase_comrade_ko(user)
   return if user.actor? && self.actor?
   return if !user.actor? && !self.actor?
   belongs_to = self.actor? ? $game_party : $game_troop
   for battler in belongs_to.existing_members
     if battler.od_level > 0 && @hp_damage > 0
       next unless battler.od_type == CSU::Overdrive::COMRADE_NAME || battler.od_type == CSU::Overdrive::AVENGER_NAME
       next if battler == self
       if battler.actor?
         battler.comrade_count += 1 unless battler.comrade_count >= 32767
       end
       od_change = (@hp_damage.to_f/self.maxhp) * battler.comrade_rate if battler.od_type == CSU::Overdrive::COMRADE_NAME
       if self.hp == 0
         od_change = battler.avenger_rate if CSU::Overdrive::AVENGER_NAME == battler.od_type
         if battler.actor?
           battler.avenger_count += 1 unless battler.avenger_count >= 32767
         end
       end
       next if battler.overdrive >= battler.max_overdrive
       battler.od_increase(od_change)
     end
   end
 end

#Calls OD increase if Stoic
 def od_increase_stoic(user)
   return if user.actor? && self.actor?
   return if !user.actor? && !self.actor?
   if self.od_level > 0 && @hp_damage > 0
     if self.actor?
       self.stoic_count += 1 unless self.stoic_count >= 32767
     end
     return if self.overdrive >= self.max_overdrive
     return if self.od_type != CSU::Overdrive::STOIC_NAME
     od_change = (@hp_damage.to_f/self.maxhp) * self.stoic_rate
     od_increase(od_change)
   end
 end
 
#Calls OD increase if Attacker
 def od_increase_attacker(user)
   return if user.actor? && self.actor?
   return if !user.actor? && !self.actor?
   if user.od_level > 0 && @hp_damage > 0
     if user.action.kind == 1
       return if user.action.skill.overdrive?
     elsif user.action.kind == 2
       return
     end
     if user.actor?
       user.attack_count += 1  unless user.attack_count >= 32767
     end
     return if user.overdrive >= user.max_overdrive
     return if user.od_type != CSU::Overdrive::ATTACKER_NAME
     user.od_change(user.attacker_rate)
   end
 end
 
#Calls OD increase if Healer
 def od_increase_healer(user)
   if user.od_level > 0 && @hp_damage < 0 && user != self
     if user.actor?
       user.healer_count += 1 unless user.healer_count >= 32767
     end
     return if user.overdrive >= user.max_overdrive
     return if user.od_type != CSU::Overdrive::HEALER_NAME
     if (self.hp - @hp_damage) > self.maxhp
       heal_value = self.maxhp - self.hp
     else
       heal_value = @hp_damage * (-1)
     end
     od_change = user.healer_rate.to_f * heal_value/user.maxhp
     user.od_increase(od_change)
   end
 end

#Calls OD if Slayer
 def od_increase_slayer(user)
   return if user.actor? && self.actor?
   return if !user.actor? && !self.actor?
   if user.od_level > 0 && @hp_damage > 0 && self.hp == 0
     if user.actor?
       user.slayer_count += 1 unless user.slayer_count >= 32767
     end
     return if user.overdrive >= user.max_overdrive
     return if user.od_type != CSU::Overdrive::SLAYER_NAME
     user.od_increase(user.slayer_rate)
   end
 end
 
 def in_overdrive?
   return self.overdrive == self.max_overdrive
 end
 
 alias od_item_effect item_effect unless $@
 def item_effect(user, item)
   od_item_effect(user, item)
   if item.od_increase != 0
     self.overdrive += item.od_increase
     self.overdrive - [[self.overdrive, 0].max, 1000].min
   end
 end
end

class Game_Actor
 attr_accessor   :stoic_count
 attr_accessor   :attack_count
 attr_accessor   :healer_count
 attr_accessor   :slayer_count
 attr_accessor   :comrade_count
 attr_accessor   :victory_count
 attr_accessor   :ally_count
 attr_accessor   :daredevil_count
 attr_accessor   :solo_count
 attr_accessor   :coward_count
 attr_accessor   :dancer_count
 attr_accessor   :avenger_count
 attr_accessor   :od_level
 attr_accessor   :overdrive
 
 alias od_setup setup unless $@
 def setup(actor_id)
   od_setup(actor_id)
   @overdrive = 0
   @od_type = CSU::Overdrive::DEFAULT_TYPE
   @stoic_count = @attack_count = @healer_count = @slayer_count = @comrade_count = 0
   @victory_count = @ally_count = @daredevil_count = @solo_count = @coward_count = 0
   @dancer_count = @avenger_count = 0
   @od_level = max_od_level
 end
 
 def od_level
   if @od_level == 0 && max_od_level != 0
     @od_level = 1
   end
   return @od_level
 end
 
 def max_od_level
   @max_od_level = 0
   for skill in skills
     if skill.overdrive?
       if skill.od_level > @max_od_level
         @max_od_level = skill.od_level
       end
     end
   end
   return @max_od_level
 end
 
 def available_od_type
   types = []
   types.push(CSU::Overdrive::STOIC_NAME) if @stoic_count >= stoic_count_needed
   types.push(CSU::Overdrive::ATTACKER_NAME) if @attack_count >= attacker_count_needed
   types.push(CSU::Overdrive::HEALER_NAME) if @healer_count >= healer_count_needed
   types.push(CSU::Overdrive::SLAYER_NAME) if @slayer_count >= slayer_count_needed
   types.push(CSU::Overdrive::VICTORY_NAME) if @victory_count >= victory_count_needed
   types.push(CSU::Overdrive::COWARD_NAME) if @coward_count >= coward_count_needed
   types.push(CSU::Overdrive::COMRADE_NAME) if @comrade_count >= comrade_count_needed
   types.push(CSU::Overdrive::AVENGER_NAME) if @avenger_count >= avenger_count_needed
   types.push(CSU::Overdrive::ALLY_NAME) if @ally_count >= ally_count_needed
   types.push(CSU::Overdrive::SOLO_NAME) if @solo_count >= solo_count_needed
   types.push(CSU::Overdrive::DAREDEVIL_NAME) if @daredevil_count >= daredevil_count_needed
   types.push(CSU::Overdrive::DANCER_NAME) if @dancer_count >= dancer_count_needed
   return types
 end
end


 
class Game_Enemy
 attr_accessor   :od_level
 attr_accessor   :overdrive
 alias od_initialize initialize unless $@
 def initialize(index,enemy_id)
   od_initialize(index,enemy_id)
   @overdrive = 0
   set_od_level
 end
 
 def od_type
   return $data_enemies[@enemy_id].od_type
 end
 
 def set_od_level
   @od_level = 0
   for action in enemy.actions
     if action.kind == 1 && $data_skills[action.skill_id].overdrive?
       if @od_level < $data_skills[action.skill_id].od_level
         @od_level = $data_skills[action.skill_id].od_level
       end
     end
   end
 end
end

class Scene_Battle
 alias crmsn_battle_end battle_end unless $@
 def battle_end(result)
   od_increase_victory if result == 0
   od_increase_coward if result == 1
   crmsn_battle_end(result)
 end
 
 def od_increase_victory
   for actor in $game_party.existing_members
     actor.victory_count += 1 unless actor.victory_count >= 32767
     next unless actor.od_type == CSU::Overdrive::VICTORY_NAME
     next if actor.overdrive >= actor.max_overdrive || actor.od_level == 0
     actor.od_increase(actor.victory_rate, false)
   end
 end
 
 def od_increase_coward
   for actor in $game_party.existing_members
     actor.coward_count += 1 unless actor.coward_count >= 32767
     next unless actor.od_type == CSU::Overdrive::COWARD_NAME
     next if actor.overdrive >= actor.max_overdrive  || actor.od_level == 0
     actor.od_increase(actor.coward_rate, false)
   end
 end
 
 alias crmsn_set_next_active_battler set_next_active_battler unless $@
 def set_next_active_battler
   crmsn_set_next_active_battler
   od_increase_action unless CSU::Overdrive::USE_TANKENTAI_ATB
 end
 
 def od_increase_action
   od_change = 0
   return if @active_battler == nil
   battler = @active_battler
   belongs_to = battler.actor? ? $game_party : $game_troop
   if battler.actor?
     battler.ally_count += 1 unless battler.ally_count >= 32767
     battler.solo_count += 1 unless battler.solo_count >= 32767 && belongs_to.existing_members.size != 1
     battler.daredevil_count += 1 unless battler.daredevil_count >= 32767 && battler.hp >= battler.maxhp / 4
   end
   if battler.overdrive < battler.max_overdrive
     if battler.od_type == CSU::Overdrive::SOLO_NAME && belongs_to.existing_members.size == 1
       od_change += battler.solo_rate
     end
     if battler.od_type == CSU::Overdrive::DAREDEVIL_NAME && battler.hp >= battler.maxhp / 4
       od_change += battler.daredevil_rate
     end
     if battler.od_type == CSU::Overdrive::ALLY_NAME
       od_change += battler.ally_rate
     end
     battler.od_increase(od_change)
   end
 end  
end




class Window_ODLevel < Window_Base
 #--------------------------------------------------------------------------
 # * Object Initialization
 #     x : window X coordinate
 #     y : window Y coordinate
 #--------------------------------------------------------------------------
 def initialize(x, y,actor)
   super(x, y, 544, WLH + 32)
   @actor = actor
   self.z = 50
   @od_stat_window = true
   refresh
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
   self.contents.clear
   draw_actor_name(@actor, 4, 0)
   draw_actor_od_gauge(@actor, 120, 0, 120)
   self.contents.font.color = system_color
   self.contents.draw_text(256, 0, 120, WLH, @actor.od_type)
   self.contents.draw_text(384, 0, 96, WLH, "OD Level ")
   self.contents.font.color = normal_color
   self.contents.draw_text(472, 0, 48, WLH, @actor.od_level.to_s)
 end
end

class Window_ODCommand < Window_Command
 def initialize(width, commands, column, actor)
   super(width, commands, 3)
   @enabled = actor.od_level > 0
   refresh
   self.active = true
 end
 
 def refresh
   self.contents.clear
   for i in 0...@item_max
     draw_item(i, @enabled)
   end
 end
end


class Scene_Overdrive < Scene_Base
 #--------------------------------------------------------------------------
 # * Object Initialization
 #     actor_index : actor index
 #--------------------------------------------------------------------------
 def initialize(actor_index = 0)
   @actor_index = actor_index
 end
 #--------------------------------------------------------------------------
 # * Start processing
 #--------------------------------------------------------------------------
 def start
   super
   create_menu_background
   @actor = $game_party.members[@actor_index]
   @viewport = Viewport.new(0, 0, 544, 416)
   @help_window = Window_Help.new
   @help_window.viewport = @viewport
   @skill_window = Window_Skill.new(0, 168, 544, 248, @actor, true)
   @skill_window.viewport = @viewport
   @skill_window.help_window = @help_window
   @skill_window.index = -1
   command = []
   command.push(CSU::Overdrive::LEVEL_SET_VCB)
   command.push(CSU::Overdrive::VIEW_OD_VCB)
   command.push(CSU::Overdrive::MODE_VCB)
   @skill_window.active = false
   @command_window = Window_ODCommand.new(544, command, 3, @actor)
   @command_window.viewport = @viewport
   @command_window.y = 112
   @char_level_window = Window_ODLevel.new(0, 0, @actor)
   @char_level_window.viewport = @viewport
   command = []
   for i in 1..@actor.max_od_level
     command.push((CSU::Overdrive::LEVEL_VCB + i.to_s))
   end
   @level_window = Window_Command.new(544, command, 3)
   @level_window.viewport = @viewport
   @char_level_window.y = 56
   @level_window.y = 112
   @level_window.z = 1000
   @type_window = Window_Command.new(544, @actor.available_od_type, 3)
   @type_window.viewport = @viewport
   @type_window.y = 112
   @type_window.z = 1000
   @level_window.active = @type_window.active = false
   @level_window.visible = @type_window.visible = false
 end
 #--------------------------------------------------------------------------
 # * Termination Processing
 #--------------------------------------------------------------------------
 def terminate
   super
   dispose_menu_background
   @help_window.dispose
   @command_window.dispose
   @skill_window.dispose
   @level_window.dispose
   @char_level_window.dispose
 end
 #--------------------------------------------------------------------------
 # * Return to Original Screen
 #--------------------------------------------------------------------------
 def return_scene
   $scene = Scene_Menu.new(1)
 end
 #--------------------------------------------------------------------------
 # * Switch to Next Actor Screen
 #--------------------------------------------------------------------------
 def next_actor
   @actor_index += 1
   @actor_index %= $game_party.members.size
   $scene = Scene_Overdrive.new(@actor_index)
 end
 #--------------------------------------------------------------------------
 # * Switch to Previous Actor Screen
 #--------------------------------------------------------------------------
 def prev_actor
   @actor_index += $game_party.members.size - 1
   @actor_index %= $game_party.members.size
   $scene = Scene_Overdrive.new(@actor_index)
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
   super
   update_menu_background
   @help_window.update
   @command_window.update
   @char_level_window.update
   @level_window.update
   @type_window.update
   if @skill_window.active
     update_skill_selection
     @skill_window.update
   elsif @command_window.active
     update_command_selection
   elsif @level_window.active
     update_level_selection
   elsif @type_window.active
     update_type_selection
   end
 end
 #--------------------------------------------------------------------------
 # * Update Skill Selection
 #--------------------------------------------------------------------------
 def update_skill_selection
   if Input.trigger?(Input::B)
     Sound.play_cancel
     @skill_window.active =false
     @command_window.active = true
     @skill_window.index= -1
   end
 end
 
 def update_command_selection
   if @command_window.index == 0
     text = CSU::Overdrive::LEVEL_SET_HELP
   elsif @command_window.index ==1
     text = CSU::Overdrive::VIEW_OD_HELP
   elsif @command_window.index == 2
     text = CSU::Overdrive::MODE_HELP
   end
   @help_window.set_text(text)
   if Input.trigger?(Input::B)
     Sound.play_cancel
     return_scene
   elsif Input.trigger?(Input::C)
     if @actor.od_level == 0
       Sound.play_buzzer
       return
     end
     Sound.play_decision
     case @command_window.index
     when 0
       @level_window.active = true
       @level_window.visible = true
       @command_window.active = false
     when 1
       @skill_window.active =true
       @command_window.active = false
       @skill_window.index = 0
     when 2
       @type_window.active = @type_window.visible = true
       @command_window.active = false
     end
   elsif Input.trigger?(Input::R)
     Sound.play_cursor
     next_actor
   elsif Input.trigger?(Input::L)
     Sound.play_cursor
     prev_actor      
   end
 end
 
 def update_level_selection
   @help_window.set_text(CSU::Overdrive::LEVEL_SET_HELP)
   if Input.trigger?(Input::B)
     Sound.play_cancel
     @level_window.active = false
     @level_window.visible = false
     @command_window.active = true
   elsif Input.trigger?(Input::C)
     Sound.play_decision
     @actor.od_level = @level_window.index+1
     @actor.overdrive = 0
     @help_window.set_text(CSU::Overdrive::LEVEL_CHANGED_VCB + (@level_window.index+1).to_s)
     @skill_window.refresh
     @char_level_window.refresh
     for i in 1..60
       Graphics.update
     end
   end
 end
 
 def update_type_selection
   case @type_window.commands[@type_window.index]
   when CSU::Overdrive::STOIC_NAME
     text = CSU::Overdrive::STOIC_HELP
   when CSU::Overdrive::ATTACKER_NAME
     text = CSU::Overdrive::ATTACKER_HELP
   when CSU::Overdrive::HEALER_NAME
     text = CSU::Overdrive::HEALER_HELP
   when CSU::Overdrive::SLAYER_NAME
     text = CSU::Overdrive::SLAYER_HELP
   when CSU::Overdrive::COMRADE_NAME
     text = CSU::Overdrive::COMRADE_HELP
   when CSU::Overdrive::VICTORY_NAME
     text = CSU::Overdrive::VICTORY_HELP
   when CSU::Overdrive::COWARD_NAME
     text = CSU::Overdrive::COWARD_HELP
   when CSU::Overdrive::AVENGER_NAME
     text = CSU::Overdrive::AVENGER_HELP
   when CSU::Overdrive::ALLY_NAME
     text = CSU::Overdrive::ALLY_HELP
   when CSU::Overdrive::SOLO_NAME
     text = CSU::Overdrive::SOLO_HELP
   when CSU::Overdrive::DAREDEVIL_NAME
     text = CSU::Overdrive::DAREDEVIL_HELP
   when CSU::Overdrive::DANCER_NAME
     text = CSU::Overdrive::DANCER_HELP
   end
   @help_window.set_text(text)
   if Input.trigger?(Input::B)
     Sound.play_cancel
     @type_window.active = false
     @type_window.visible = false
     @command_window.active = true
   elsif Input.trigger?(Input::C)
     Sound.play_decision
     @actor.od_type = @type_window.commands[@type_window.index]
     @help_window.set_text(CSU::Overdrive::MODE_CHANGED_VCB + (@type_window.commands[@type_window.index]))
     for i in 1..60
       Graphics.update
     end
     @skill_window.refresh
     @char_level_window.refresh
   end
 end        
end

class Window_Base
 def draw_actor_od_gauge(actor, x, y, width = 120, use_name = true)
   gw = (width - 2) * actor.overdrive / [actor.max_overdrive, 1].max
   gc1 = Color.new(156, 96, 96)
   gc2 = Color.new(225, 176, 176)
   self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
   self.contents.gradient_fill_rect(x + 1, y + WLH - 7, gw, 4, gc1, gc2)
   self.contents.font.color = Color.new(176, 128, 128)
   self.contents.draw_text (x, y, width, WLH, CSU::Overdrive::OD_NAME) if use_name
   self.contents.font.color = normal_color
 end
end

if !CSU::Overdrive::USE_CUSTOM_HUD
class Window_BattleStatus
 def draw_item(index)
   rect = item_rect(index)
   rect.x += 4
   rect.width -= 8
   self.contents.clear_rect(rect)
   self.contents.font.color = normal_color
   actor = $game_party.members[index]
   draw_actor_od_gauge(actor, 4, WLH * index, 100, false) if actor.od_level > 0
   draw_actor_name(actor, 4, rect.y)
   draw_actor_state(actor, 114, rect.y, 48)
   draw_actor_hp(actor, 174, rect.y, 120)
   draw_actor_mp(actor, 310, rect.y, 70)
 end
end
end

if !CSU::Overdrive::USE_CUSTOM_MENU_SCRIPT
class Scene_Menu
 
 alias csu_overdrive_start_actor_selection start_actor_selection unless $@
 def start_actor_selection
   if @command_window.commands[@command_window.index] == Vocab::skill
     if @skill_od_window == nil
       @skill_od_window = Window_Command.new(160, [Vocab::skill, CSU::Overdrive::OD_NAME])
       @skill_od_window.y = @command_window.y + 16 + @command_window.index * 24
       @skill_od_window.x = @command_window.x
       @skill_od_window.openness = 0
     end
     @skill_od_window.open
     loop do
       Graphics.update
       Input.update
       @skill_od_window.update
       if Input.trigger?(Input::C)
         Sound.play_decision
         @skill_od_window.close
         loop do
           Graphics.update
           Input.update
           @skill_od_window.update
           break if @skill_od_window.openness == 0
         end
         @skill_od_window.visible = false
         break csu_overdrive_start_actor_selection
       elsif Input.trigger?(Input::B)
         Sound.play_decision
         @skill_od_window.close
         loop do
           Graphics.update
           Input.update
           @skill_od_window.update
           break if @skill_od_window.openness == 0
         end
         break @skill_od_window.visible = false
       end
     end
   else
     csu_overdrive_start_actor_selection
   end
 end
   
 def update_actor_selection
   if Input.trigger?(Input::B)
     Sound.play_cancel
     end_actor_selection
   elsif Input.trigger?(Input::C)
     $game_party.last_actor_index = @status_window.index
     Sound.play_decision
     case @command_window.index
     when 1  # skill
       if @skill_od_window.index == 0
         $scene = Scene_Skill.new(@status_window.index)
       else
         $scene = Scene_Overdrive.new(@status_window.index)
       end
     when 2  # equipment
       $scene = Scene_Equip.new(@status_window.index)
     when 3  # status
       $scene = Scene_Status.new(@status_window.index)
     end
   end
 end
 
 alias csu_overdrive_terminate terminate unless $@
 def terminate
   csu_overdrive_terminate
   @skill_od_window.dispose if @skill_od_window != nil
 end
end
end



Cara Pemasangan
Copy script dari demo. Kalo kamu ga pake script custom battle commands ato custom menu command lain, copy juga 2 script itu dari demo.



Credits


  • CrimsonSeas
  • SquareEnix untuk Game FF7 dan FFX


Terakhir diubah oleh richter_h tanggal 2013-11-18, 22:39, total 1 kali diubah (Reason for editing : nambahin skripnya soale link mokad. thanks to 81sby)
CrimsonSeas Overdrive Empty2009-12-15, 13:28
PostRe: CrimsonSeas Overdrive
#2
Fandrey 
Novice
Novice
Fandrey

Level 5
Posts : 110
Thanked : 3
Engine : RMVX

CrimsonSeas Overdrive Vide
Eh ini FF7/FFX?

Bukannya lebih mirip ke sistemnya Wild Arms yah IMO?
CrimsonSeas Overdrive Empty2009-12-15, 16:29
PostRe: CrimsonSeas Overdrive
#3
shikami 
Member 1000 Konsep
avatar

Level 5
Posts : 3744
Thanked : 31
Engine : Multi-Engine User
Skill : Beginner
Type : Developer
Awards:


CrimsonSeas Overdrive Vide
Mantebb bgt! 1 rep bwt anda!! O ya ni compatible bwt tankentai SBS jg gk? Ato cma default BS? Mohon penjelasannya..
CrimsonSeas Overdrive Empty2009-12-15, 17:44
PostRe: CrimsonSeas Overdrive
#4
CrimsonSeas 
Novice
Novice
CrimsonSeas

Level 5
Posts : 106
Thanked : 9
Engine : RMVX

CrimsonSeas Overdrive Vide
@Fandrey: Loh kok Wild Arms? Gw ga maen smua wild arms sih, tp klo wild arms kan ada yg namanya Force leve waktu battle. Nah kalo yg ini OD levelnya itu di set sebelom battle, kita bisa ngeset levelnya sesuka kita. Teorinya sih orang pasti pilih level paling tinggi, tapi OD level rendah jg ada keuntungannya, soalnya bisa diset biar OD gauge lebih cepet ngisi klo levelnya rendah.

@shikami: Compatible buat semua kok, sama Skill Activation script gw jg compatible
CrimsonSeas Overdrive Empty2009-12-15, 18:44
PostRe: CrimsonSeas Overdrive
#5
Tamu 
Tamu
Anonymous


CrimsonSeas Overdrive Vide
lho, ini kan ada di rmvx.net, jadi km ya yg buat ? wah hebat !, tp akan lebih bagus kalo di mix ama KGC overdrive
CrimsonSeas Overdrive Empty2009-12-15, 19:08
PostRe: CrimsonSeas Overdrive
#6
Fandrey 
Novice
Novice
Fandrey

Level 5
Posts : 110
Thanked : 3
Engine : RMVX

CrimsonSeas Overdrive Vide
Quote :
@Fandrey: Loh kok Wild Arms? Gw ga maen smua wild arms sih, tp klo wild arms kan ada yg namanya Force leve waktu battle. Nah kalo yg ini OD levelnya itu di set sebelom battle, kita bisa ngeset levelnya sesuka kita. Teorinya sih orang pasti pilih level paling tinggi, tapi OD level rendah jg ada keuntungannya, soalnya bisa diset biar OD gauge lebih cepet ngisi klo levelnya rendah.

Hoo.. Kepikiran gw sih kayak wild arms (kan ada force levelnya), tapi force nya bisa diset waktu ga battle haha...

Kaya element systemnya Chrono Cross berarti @_@ ada yang level tinggi ada yang level rendah
CrimsonSeas Overdrive Empty2009-12-15, 20:05
PostRe: CrimsonSeas Overdrive
#7
CrimsonSeas 
Novice
Novice
CrimsonSeas

Level 5
Posts : 106
Thanked : 9
Engine : RMVX

CrimsonSeas Overdrive Vide
@declaration: yup, user namenya jg sama kan :P Mxdnya di mix gimana ya, kan ini jg fungsinya sama kyk KGC Overdrive cuma ditambahin fitur2 tambahan aja jdnya.
CrimsonSeas Overdrive Empty2013-11-18, 20:56
PostHello membutuhkan bantuan
#8
LayfonTsuna 
Newbie
Newbie
LayfonTsuna

Level 5
Posts : 1
Thanked : 0
Engine : RMVX
Skill : Very Beginner
Type : Mapper

CrimsonSeas Overdrive Vide
Saya ingin memiliki demo skrip overdrive utama Anda, tetapi link mati Anda bisa memberi saya satu?
CrimsonSeas Overdrive Empty2013-11-18, 21:25
PostRe: CrimsonSeas Overdrive
#9
richter_h 
Salto Master
Hancip RMID
richter_h

Kosong
Posts : 1705
Thanked : 30
Engine : Other
Skill : Skilled
Type : Developer
Awards:

CrimsonSeas Overdrive Vide
@layfon,
kebetulan CrimsonSeas udah ngga aktip lagi beberapa tahun ini. kalo mau cari skripnya, coba google aja. seinget ane di situs luar (mungkin di rpgmakervx.net ada skripnya dan bisa diambil di sana, mengingatdia juga pernah jadi member di sana).

mohon maap atas ketidaknyamanan ini. :sembah:
CrimsonSeas Overdrive Empty2013-11-18, 22:29
PostRe: CrimsonSeas Overdrive
81sby 
Newbie
Newbie
avatar

Level 5
Posts : 74
Thanked : 1
Engine : Multi-Engine User
Skill : Skilled
Type : Event Designer
Awards:
CrimsonSeas Overdrive Vide
Ini Scriptnya. :v
Code:
=begin
================================================================================
CrimsonSeas Ultimate series; Overdrive System
by CrimsonSeas
================================================================================
Introduction:
This script wasn't originally made to be part of the Ultimate series, but after
I started making Ultimate series I decided to upgrade this to Ultimate series.

--------------------------------------------------------------------------------
Features:
This script introduces the following features:
From FF7:
+Overdrive levels,but I made it simpler so it will work like this: Any OD skill
lower or same level than the character's current OD level can be used. Any OD
skill higher than the character's current OD level can't. You can also set up
different increase rate for each OD level for each character, so you can make
that character's with higher level OD fills slower than lower OD level characters.

+Fury states, which will increase or decrease OD rate depending on how they are
configured. COnfigure this via the state's note field.

From FFX:
+Overdrive Modes, so each character can have their own conditions to fill the
OD gauge. This also incorporates the system in which after doing certain
conditions a number of times, the character will get additional OD Mode.
Ex: Attacking 120 times and you'll get Attacker OD Mode.

All this comes with a menu that enables you to choose OD level and OD Mode for each
character

This script is also highly customizable, to the point that I myself am confused
customizing this script for my project  (Config ends at line 525, wtf?)

List of customization possible:
+OD Mode Name

+Gauge increase rate that is unique to each character and each OD Mode. This also
come with a default so if you're tired setting this you can just use the default.

+Different number of actions that has to be taken to acquire new OD Mode for each
characters. This also comes with a default.

+Texts at the OD menu

+Fury and Sadness states

================================================================================
How to Use
================================================================================
--------------------------------------------------------------------------------
Note Tags
--------------------------------------------------------------------------------
<overdrive od_lv>   : Defines that a skill is an overdrive skill, and what is it's
                     level.
   
<fury value>        : For use in states, defines skills that has fury effect. Fury
                     increases/decreases OD gain rate depending on the value.
                     Write value in percent, value of 100 will double the rate
                     while value of -100 will stop OD gauge. And a value of
                     -200 will reverse the gauge rate :P. All states with fury
                     tags will be added together.
                     
<mode od_mode>      : Defines an enemy's drive gauge mode. Refer to the mode name
                     constant in the module below to determine what you should
                     write here. Remember that you should write it without the
                     quote marks.
                     
<od_increase val>   : Defines items or skills that will change overdrive value.
                     Negative value will decrease drive gauge.
                     
--------------------------------------------------------------------------------
Script Call
--------------------------------------------------------------------------------
Use these script calls to modify actor's overdrive gauge in the event editor

change_actor_od(id, set_value) => This will set actor's drive gauge
increase_actor_od(id, value_change) = This will increase/decrease actor's drive gauge
--------------------------------------------------------------------------------

Define other configs in the config section. I know it's long, but that's the price
for high customizability right?


================================================================================
Module Configuration
================================================================================
=end

module CSU
 module Overdrive

=begin
================================================================================
Modes Name
================================================================================
Use this part to set up names for each OD Mode:
STOIC => Increases by taking damage.
ATTACKER = > Increases by dealing damage. This excludes items and OD skills itself.
HEALER => Increase by healing ally other than self
SLAYER => Increase by killing an enemy
VICTORY => Increase by winning battle
COMRADE => Increase by getting another ally to be damaged.
COWARD => Increase by escaping battle.
ALLY => Increase by taking any action.
DAREDEVIL => Increase by taking any action at low HP.
SOLO=> Increase by taking any action while alone.
DANCER => Increase by evading enemy attack. (REMEMBER EVADE != MISS)
AVENGER => Increase by getting another ally to be KO'd.
=end

 STOIC_NAME = "Stoic"
 ATTACKER_NAME = "Attacker"
 HEALER_NAME = "Healer"
 SLAYER_NAME = "Slayer"
 VICTORY_NAME = "Victory"
 COMRADE_NAME = "Comrade"
 COWARD_NAME = "Coward"
 ALLY_NAME = "Ally"
 DAREDEVIL_NAME = "Daredevil"
 SOLO_NAME = "Solo"
 DANCER_NAME = "Dancer"
 AVENGER_NAME = "Avenger"
#Explanation for each OD type at the OD menu help window.
 STOIC_HELP = "Increases gauge when damaged."
 ATTACKER_HELP = "Increases gauge when damaging enemy."
 HEALER_HELP = "Increases gauge when you heal ally."
 SLAYER_HELP = "Increases gauge when you kill enemy."
 VICTORY_HELP = "Increases gauge when you win battle."
 COMRADE_HELP = "Increases gauge when ally is damaged."
 COWARD_HELP = "Increases gauge when you escape from battle."
 ALLY_HELP = "Increases gauge whenever you took an action."
 DAREDEVIL_HELP = "Increases gauge whenever you took an action in low health."
 SOLO_HELP = "Increases gauge whenever you took an action while being alone."
 DANCER_HELP = "Increases gauge whenever you evaded enemy attack."
 AVENGER_HELP = "Increases gauge when an ally is KO'd"
#Various texts for OD menu commands.
 LEVEL_SET_VCB = "Level Set"
 VIEW_OD_VCB = "View"
 MODE_VCB = "Drive Modes"
 LEVEL_VCB = "Level"
 LEVEL_CHANGED_VCB = "Changed to level "
 MODE_CHANGED_VCB = "Changed to mode "
#Various help text for OD menu commands
 LEVEL_SET_HELP = "Sets OD level (Resets gauge to zero.)"
 VIEW_OD_HELP = "View Overdrives."
 MODE_HELP = "Sets Drive mode."
#Sets the default OD Mode.
 DEFAULT_TYPE = "Stoic"
#Sets the max OD level
 MAX_OD_LEVEL = 3
#Sets the sound to be played when OD is full.
 OD_SOUND = "Chime2"
#Sets name for Overdrive. This will be shown if you use the default OD gauge
 OD_NAME = "Overdrive"
#Sets whether you want to use Overdrive exclusive battle command window. This
#constant must be set to false if you use any other custom battle command window
 USE_OD_CMD_WINDOW = true
#Inform the script whether you are using Tankentai SBS or not
 USE_TANKENTAI_ATB = true
#Inform the script whther you are using a custom HUD or not. If you are using
#Custom HUD, you have to make the OD gauge show on your HUD yourself
 USE_CUSTOM_HUD = false
#Inform the script whether you are using Custom Menu scripts or not. If you are
#using Custom menu scripts, you have to configure the custom menu script yourself
#to enable the Overdrive Menu.
 USE_CUSTOM_MENU_SCRIPT = false
end
end

class Game_Actor
=begin
================================================================================
Just FYI, actor's max od level are determined by the skill that has the highest
OD level. So if a character has a skill with OD level 3, his/her max OD level
would become 3 as well.
================================================================================
Sets rate for each OD mode. This rate is an array with size = max od level, with
the leftmost value being the rate for od level = 1
OD increase formulas:
Stoic: Rate * Damage taken / Max HP
Attacker: Rate
Healer: Rate * Healing value / Target's Max HP
Slayer: Rate
Victory: Rate
Coward: Rate
Comrade: Rate * Damage taken / Victim's Max HP
Ally: Rate
Solo: Rate
Daredevil: Rate
Avenger: Rate
Dancer:Rate
================================================================================
=end

 def stoic_rate
   case @actor_id
   when 1
     temp = [2000, 1050, 800] #Specific rate
   when 2
     temp = [2100, 1100, 850]
   end
   temp = [1600, 1000, 750] if temp == nil #Default Rate
   return temp[self.od_level-1]
 end
 
 def attacker_rate
   case @actor_id
   when 1
     temp = [100, 70, 60]
   when 2
     temp = [110, 85, 65]
   end
   temp = [100, 80, 60] if temp == nil
   return temp[self.od_level-1]
 end
 
 def healer_rate
   case @actor_id
   when 1
     temp = [200, 155, 80]
   when 2
     temp = [150, 110, 70]
   end
   temp = [180, 135, 90] if temp == nil
   return temp[self.od_level-1]
 end
 
 def slayer_rate
   case @actor_id
   when 1
     temp = [200, 140, 110]
   when 2
     temp = [220, 160, 125]
   end
   temp = [200, 160, 100] if temp == nil
   return temp[self.od_level-1]
 end
 
 def victory_rate
   case @actor_id
   when 1
     temp = [250, 160, 120]
   when 2
     temp = [250, 190, 150]
   end
   temp = [250, 180, 125] if temp == nil
   return temp[self.od_level-1]
 end
 
 def coward_rate
   case @actor_id
   when 1
     temp = [200, 120, 100]
   when 2
     temp = [200, 150, 110]
   end
   temp = [200, 160, 105] if temp == nil
   return temp[self.od_level-1]
 end
 
 def comrade_rate
   case @actor_id
   when 1
     temp = [1600, 800, 500]
   when 2
     temp = [1800, 875, 575]
   end
   temp = [1700, 825, 550] if temp == nil
   return temp[self.od_level-1]
 end
 
 def ally_rate
   case @actor_id
   when 1
     temp = [80, 60, 40]
   when 2
     temp = [95, 65, 45]
   end
   temp = [100, 70, 40] if temp == nil
   return temp[self.od_level-1]
 end
 
 def daredevil_rate
   case @actor_id
   when 1
     temp = [100, 70, 45]
   when 2
     temp = [105, 75, 55]
   end
   temp = [120, 80, 65] if temp == nil
   return temp[self.od_level-1]
 end
   
 def avenger_rate
   case @actor_id
   when 1
     temp = [200, 140, 100]
   when 2
     temp = [220, 170, 120]
   end
   temp = [225, 165, 115] if temp == nil
   return temp[self.od_level-1]
 end
 
 def dancer_rate
   case @actor_id
   when 1
     temp = [160, 125, 80]
   when 2
     temp = [150, 110, 70]
   end
   temp = [180, 135, 90] if temp == nil
   return temp[self.od_level-1]
 end
 
 def solo_rate
   case @actor_id
   when 1
     temp = [100, 70, 45]
   when 2
     temp = [105, 75, 55]
   end
   temp = [120, 80, 65] if temp == nil
   return temp[self.od_level-1]
 end
 
=begin
================================================================================
Set number of actions needed to acquire new OD Mode
If set to 0, that means the particular mode will be available from the start.
For the sake of the demo, I made it so Ralph already have all modes from the
start.
================================================================================
=end

 
 def stoic_count_needed
   case @actor_id
   when 1
     return 0 #for specific actor
   end
   return 0 #default
 end
 
 def attacker_count_needed
   case @actor_id
   when 1
     return 0
   end
   return 120
 end
 
 def healer_count_needed
   case @actor_id
   when 1
     return 0
   end
   return 80
 end
 
 def slayer_count_needed
   case @actor_id
   when 1
     return 0
   end
   return 100
 end
 
 def coward_count_needed
   case @actor_id
   when 1
     return 0
   end
   return 80
 end
 
 def victory_count_needed
   case @actor_id
   when 1
     return 0
   end
   return 90
 end
 
 def comrade_count_needed
   case @actor_id
   when 1
     return 0
   end
   return 120
 end
 
 def ally_count_needed
   case @actor_id
   when 1
     return 0
   end
   return 200
 end
 
 def daredevil_count_needed
   case @actor_id
   when 1
     return 0
   end
   return 60
 end
 
 def avenger_count_needed
   case @actor_id
   when 1
     return 0
   end
   return 80
 end
 
 def dancer_count_needed
   case @actor_id
   when 1
     return 0
   end
   return 50
 end
 
 def solo_count_needed
   case @actor_id
   when 1
     return 0
   end
   return 60
 end
 
end


=begin
================================================================================
Enemy OD Setup
================================================================================
Well this part is just like the actor's setup, except there's no setting for count
needed.
To define an enemy's OD Mode, write this into the enemy's note box:
   <type Mode name>
Ex: <type Stoic>
Name should be the one defined in the Config module above

Enemy OD level is automatically calculated depending on the highest OD level skill
that the enemy has. (just like the actor one)
Ex: If Slime has 2 skills, 1 with OD level 1 and 1 with OD level 3, then Slime's
OD level will be 3.
=end

class Game_Enemy
 def stoic_rate
   case @enemy_id
   when 1
     temp = [10000, 10000, 750] #This ridiculously large value is for testing only
   end
   temp = [1600, 1000, 750] if temp == nil
   return temp[self.od_level-1]
 end
 
 def attacker_rate
   case @enemy_id
   when 1
     temp = [100, 80, 60]
   end
   temp = [100, 80, 60] if temp == nil
   return temp[self.od_level-1]
 end
 
 def healer_rate
   case @enemy_id
   when 1
     temp = [180, 135, 90]
   end
   temp = [180, 135, 90] if temp == nil
   return temp[self.od_level-1]
 end
 
 def slayer_rate
   case @enemy_id
   when 1
     temp = [200, 160, 100]
   end
   temp = [200, 160, 100] if temp == nil
   return temp[self.od_level-1]
 end
 
 def victory_rate
   case @enemy_id
   when 1
     temp = [250, 180, 125]
   end
   temp = [250, 180, 125] if temp == nil
   return temp[self.od_level-1]
 end
 
 def coward_rate
   case @enemy_id
   when 1
     temp = [200, 160, 105]
   end
   temp = [200, 160, 105] if temp == nil
   return temp[self.od_level-1]
 end
 
 def comrade_rate
   case @enemy_id
   when 1
     temp = [1700, 825, 550]
   end
   temp = [1700, 825, 550] if temp == nil
   return temp[self.od_level-1]
 end
 
 def ally_rate
   case @enemy_id
   when 1
     temp = [100, 70, 40]
   end
   temp = [100, 70, 40] if temp == nil
   return temp[self.od_level-1]
 end
 
 def daredevil_rate
   case @enemy_id
   when 1
     temp = [120, 80, 65]
   end
   temp = [120, 80, 65] if temp == nil
   return temp[self.od_level-1]
 end
   
 def avenger_rate
   case @enemy_id
   when 1
     temp = [225, 165, 115]
   end
   temp = [225, 165, 115] if temp == nil
   return temp[self.od_level-1]
 end
 
 def dancer_rate
   case @enemy_id
   when 1
     temp = [180, 135, 90]
   end
   temp = [180, 135, 90] if temp == nil
   return temp[self.od_level-1]
 end
 
 def solo_rate
   case @enemy_id
   when 1
     temp = [120, 80, 65]
   end
   temp = [120, 80, 65] if temp == nil
   return temp[self.od_level-1]
 end
end
#===============================================================================
#END CONFIG
#I know you're tired after seeing this many lines, go take a break for a while
#===============================================================================

module CSU
 if defined?(SCRIPTLIST) == nil
   SCRIPTLIST = []
 end
 SCRIPTLIST.push("Ultimate Overdrive")
end

def change_actor_od(id, value)
 $game_actors[id].overdrive = value
end

def increase_actor_od(id, increase)
 $game_actors[id].overdrive += increase
end


module RPG
 class Skill
   def create_skill_cache_ultimate_overdrive
     if @od_level == nil
       temp = self.note[/<overdrive\s+[0-9]+>/]
       if temp != nil
         @od_level = [[temp[/[0-9]+/].to_i, 0].max, CSU::Overdrive::MAX_OD_LEVEL].min
       else
         @od_level = 0
       end
     end
   end
   
   def overdrive?
     return self.note[/<overdrive\s+[0-9]+>/] != nil
   end
   
   attr_accessor :od_level
 end  
 
 class UsableItem
   def create_usableitem_cache_ultimate_overdrive
     if @od_increase == nil
       temp = self.note[/<od_increase\s+[0-9-]+>/]
       if temp != nil
         @od_level = temp[/[0-9-]+/].to_i
       else
         @od_increase = 0
       end
     end
   end
   attr_accessor :od_increase
 end
 
 class Enemy
   def create_enemy_cache_ultimate_overdrive
     if @od_type == nil
       temp = self.note[/<mode\s+.+>/]
       if temp != nil
         temp.slice![/<mode\s+/]
         temp.slice![/>/]
         @od_type = temp
       else
         @od_type = CSU::Overdrive::DEFAULT_TYPE
       end
     end
   end
     
   attr_accessor :od_type
 end
 
 class State
   def create_state_cache_ultimate_overdrive
     if @fury == nil
       temp = self.note[/<fury\s+[0-9-]+>/]
       if temp != nil
         @fury = temp[/[0-9-]+/].to_i
       else
         @fury = 0
       end
     end
   end
   
   attr_accessor :fury
 end
end

class Game_Battler
 attr_accessor   :overdrive
 attr_accessor   :od_level
 attr_accessor   :od_type
 
 def od_increase(od_value, sound = true)
   return self.overdrive = 0 if self.hp == 0
   return if self.overdrive == self.max_overdrive
   fury = 0
   for state in self.states
     fury += state.fury
   end
   od_value *= (1 + fury/100.0)
   self.overdrive = (od_value + self.overdrive).to_i
   self.overdrive = self.max_overdrive if self.overdrive > self.max_overdrive
   if $game_temp.in_battle
   Audio.se_play("Audio/SE/" + CSU::Overdrive::OD_SOUND, 80,  100) if self.overdrive >= self.max_overdrive && sound
   end
 end
 
 def max_overdrive
   return 1000
 end
 
 alias od_execute_damage execute_damage unless $@
 def execute_damage(user)
   if user.action.skill != nil
     user.overdrive = 0 if user.action.skill.overdrive?
   end
   od_increase_healer(user)
   od_execute_damage(user)
   od_increase_stoic(user)
   od_increase_attacker(user)
   od_increase_slayer(user)
   od_increase_comrade_ko(user)
   if self.hp == 0
     self.overdrive = 0
   end
 end
 
#Calls OD increase if evaded an attack
 alias od_attack_effect attack_effect unless $@
 def attack_effect(attacker)
   if rand(100) <= calc_eva(attacker) && self.od_type == CSU::Overdrive::DANCER_NAME && self.od_level > 0
     if self.actor?
       self.dancer_count += 1 unless self.dancer_count >= 32767
     end
     return if self.overdrive < self.max_overdrive
     od_increase(self.dancer_rate)
   end
   od_attack_effect(attacker)
 end

#Calls OD increase if evaded a skill
 alias od_skill_effect skill_effect unless $@
 def skill_effect(user, skill)
   if rand(100) <= calc_eva(user, skill) && self.od_type == CSU::Overdrive::DANCER_NAME && self.od_level > 0
     if self.actor?
       self.dancer_count += 1 unless self.dancer_count >= 32767
     end
     return if self.overdrive < self.max_overdrive
     od_increase(self.dancer_rate)
   end
   od_skill_effect(user, skill)
   if skill.od_increase != 0
     self.overdrive += skill.od_increase
     self.overdrive = [[self.overdrive, 0].max, 1000].min
   end
 end

#Calls OD increase if Comrade or Avenger
 def od_increase_comrade_ko(user)
   return if user.actor? && self.actor?
   return if !user.actor? && !self.actor?
   belongs_to = self.actor? ? $game_party : $game_troop
   for battler in belongs_to.existing_members
     if battler.od_level > 0 && @hp_damage > 0
       next unless battler.od_type == CSU::Overdrive::COMRADE_NAME || battler.od_type == CSU::Overdrive::AVENGER_NAME
       next if battler == self
       if battler.actor?
         battler.comrade_count += 1 unless battler.comrade_count >= 32767
       end
       od_change = (@hp_damage.to_f/self.maxhp) * battler.comrade_rate if battler.od_type == CSU::Overdrive::COMRADE_NAME
       if self.hp == 0
         od_change = battler.avenger_rate if CSU::Overdrive::AVENGER_NAME == battler.od_type
         if battler.actor?
           battler.avenger_count += 1 unless battler.avenger_count >= 32767
         end
       end
       next if battler.overdrive >= battler.max_overdrive
       battler.od_increase(od_change)
     end
   end
 end

#Calls OD increase if Stoic
 def od_increase_stoic(user)
   return if user.actor? && self.actor?
   return if !user.actor? && !self.actor?
   if self.od_level > 0 && @hp_damage > 0
     if self.actor?
       self.stoic_count += 1 unless self.stoic_count >= 32767
     end
     return if self.overdrive >= self.max_overdrive
     return if self.od_type != CSU::Overdrive::STOIC_NAME
     od_change = (@hp_damage.to_f/self.maxhp) * self.stoic_rate
     od_increase(od_change)
   end
 end
 
#Calls OD increase if Attacker
 def od_increase_attacker(user)
   return if user.actor? && self.actor?
   return if !user.actor? && !self.actor?
   if user.od_level > 0 && @hp_damage > 0
     if user.action.kind == 1
       return if user.action.skill.overdrive?
     elsif user.action.kind == 2
       return
     end
     if user.actor?
       user.attack_count += 1  unless user.attack_count >= 32767
     end
     return if user.overdrive >= user.max_overdrive
     return if user.od_type != CSU::Overdrive::ATTACKER_NAME
     user.od_change(user.attacker_rate)
   end
 end
 
#Calls OD increase if Healer
 def od_increase_healer(user)
   if user.od_level > 0 && @hp_damage < 0 && user != self
     if user.actor?
       user.healer_count += 1 unless user.healer_count >= 32767
     end
     return if user.overdrive >= user.max_overdrive
     return if user.od_type != CSU::Overdrive::HEALER_NAME
     if (self.hp - @hp_damage) > self.maxhp
       heal_value = self.maxhp - self.hp
     else
       heal_value = @hp_damage * (-1)
     end
     od_change = user.healer_rate.to_f * heal_value/user.maxhp
     user.od_increase(od_change)
   end
 end

#Calls OD if Slayer
 def od_increase_slayer(user)
   return if user.actor? && self.actor?
   return if !user.actor? && !self.actor?
   if user.od_level > 0 && @hp_damage > 0 && self.hp == 0
     if user.actor?
       user.slayer_count += 1 unless user.slayer_count >= 32767
     end
     return if user.overdrive >= user.max_overdrive
     return if user.od_type != CSU::Overdrive::SLAYER_NAME
     user.od_increase(user.slayer_rate)
   end
 end
 
 def in_overdrive?
   return self.overdrive == self.max_overdrive
 end
 
 alias od_item_effect item_effect unless $@
 def item_effect(user, item)
   od_item_effect(user, item)
   if item.od_increase != 0
     self.overdrive += item.od_increase
     self.overdrive - [[self.overdrive, 0].max, 1000].min
   end
 end
end

class Game_Actor
 attr_accessor   :stoic_count
 attr_accessor   :attack_count
 attr_accessor   :healer_count
 attr_accessor   :slayer_count
 attr_accessor   :comrade_count
 attr_accessor   :victory_count
 attr_accessor   :ally_count
 attr_accessor   :daredevil_count
 attr_accessor   :solo_count
 attr_accessor   :coward_count
 attr_accessor   :dancer_count
 attr_accessor   :avenger_count
 attr_accessor   :od_level
 attr_accessor   :overdrive
 
 alias od_setup setup unless $@
 def setup(actor_id)
   od_setup(actor_id)
   @overdrive = 0
   @od_type = CSU::Overdrive::DEFAULT_TYPE
   @stoic_count = @attack_count = @healer_count = @slayer_count = @comrade_count = 0
   @victory_count = @ally_count = @daredevil_count = @solo_count = @coward_count = 0
   @dancer_count = @avenger_count = 0
   @od_level = max_od_level
 end
 
 def od_level
   if @od_level == 0 && max_od_level != 0
     @od_level = 1
   end
   return @od_level
 end
 
 def max_od_level
   @max_od_level = 0
   for skill in skills
     if skill.overdrive?
       if skill.od_level > @max_od_level
         @max_od_level = skill.od_level
       end
     end
   end
   return @max_od_level
 end
 
 def available_od_type
   types = []
   types.push(CSU::Overdrive::STOIC_NAME) if @stoic_count >= stoic_count_needed
   types.push(CSU::Overdrive::ATTACKER_NAME) if @attack_count >= attacker_count_needed
   types.push(CSU::Overdrive::HEALER_NAME) if @healer_count >= healer_count_needed
   types.push(CSU::Overdrive::SLAYER_NAME) if @slayer_count >= slayer_count_needed
   types.push(CSU::Overdrive::VICTORY_NAME) if @victory_count >= victory_count_needed
   types.push(CSU::Overdrive::COWARD_NAME) if @coward_count >= coward_count_needed
   types.push(CSU::Overdrive::COMRADE_NAME) if @comrade_count >= comrade_count_needed
   types.push(CSU::Overdrive::AVENGER_NAME) if @avenger_count >= avenger_count_needed
   types.push(CSU::Overdrive::ALLY_NAME) if @ally_count >= ally_count_needed
   types.push(CSU::Overdrive::SOLO_NAME) if @solo_count >= solo_count_needed
   types.push(CSU::Overdrive::DAREDEVIL_NAME) if @daredevil_count >= daredevil_count_needed
   types.push(CSU::Overdrive::DANCER_NAME) if @dancer_count >= dancer_count_needed
   return types
 end
end


 
class Game_Enemy
 attr_accessor   :od_level
 attr_accessor   :overdrive
 alias od_initialize initialize unless $@
 def initialize(index,enemy_id)
   od_initialize(index,enemy_id)
   @overdrive = 0
   set_od_level
 end
 
 def od_type
   return $data_enemies[@enemy_id].od_type
 end
 
 def set_od_level
   @od_level = 0
   for action in enemy.actions
     if action.kind == 1 && $data_skills[action.skill_id].overdrive?
       if @od_level < $data_skills[action.skill_id].od_level
         @od_level = $data_skills[action.skill_id].od_level
       end
     end
   end
 end
end

class Scene_Battle
 alias crmsn_battle_end battle_end unless $@
 def battle_end(result)
   od_increase_victory if result == 0
   od_increase_coward if result == 1
   crmsn_battle_end(result)
 end
 
 def od_increase_victory
   for actor in $game_party.existing_members
     actor.victory_count += 1 unless actor.victory_count >= 32767
     next unless actor.od_type == CSU::Overdrive::VICTORY_NAME
     next if actor.overdrive >= actor.max_overdrive || actor.od_level == 0
     actor.od_increase(actor.victory_rate, false)
   end
 end
 
 def od_increase_coward
   for actor in $game_party.existing_members
     actor.coward_count += 1 unless actor.coward_count >= 32767
     next unless actor.od_type == CSU::Overdrive::COWARD_NAME
     next if actor.overdrive >= actor.max_overdrive  || actor.od_level == 0
     actor.od_increase(actor.coward_rate, false)
   end
 end
 
 alias crmsn_set_next_active_battler set_next_active_battler unless $@
 def set_next_active_battler
   crmsn_set_next_active_battler
   od_increase_action unless CSU::Overdrive::USE_TANKENTAI_ATB
 end
 
 def od_increase_action
   od_change = 0
   return if @active_battler == nil
   battler = @active_battler
   belongs_to = battler.actor? ? $game_party : $game_troop
   if battler.actor?
     battler.ally_count += 1 unless battler.ally_count >= 32767
     battler.solo_count += 1 unless battler.solo_count >= 32767 && belongs_to.existing_members.size != 1
     battler.daredevil_count += 1 unless battler.daredevil_count >= 32767 && battler.hp >= battler.maxhp / 4
   end
   if battler.overdrive < battler.max_overdrive
     if battler.od_type == CSU::Overdrive::SOLO_NAME && belongs_to.existing_members.size == 1
       od_change += battler.solo_rate
     end
     if battler.od_type == CSU::Overdrive::DAREDEVIL_NAME && battler.hp >= battler.maxhp / 4
       od_change += battler.daredevil_rate
     end
     if battler.od_type == CSU::Overdrive::ALLY_NAME
       od_change += battler.ally_rate
     end
     battler.od_increase(od_change)
   end
 end  
end




class Window_ODLevel < Window_Base
 #--------------------------------------------------------------------------
 # * Object Initialization
 #     x : window X coordinate
 #     y : window Y coordinate
 #--------------------------------------------------------------------------
 def initialize(x, y,actor)
   super(x, y, 544, WLH + 32)
   @actor = actor
   self.z = 50
   @od_stat_window = true
   refresh
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
   self.contents.clear
   draw_actor_name(@actor, 4, 0)
   draw_actor_od_gauge(@actor, 120, 0, 120)
   self.contents.font.color = system_color
   self.contents.draw_text(256, 0, 120, WLH, @actor.od_type)
   self.contents.draw_text(384, 0, 96, WLH, "OD Level ")
   self.contents.font.color = normal_color
   self.contents.draw_text(472, 0, 48, WLH, @actor.od_level.to_s)
 end
end

class Window_ODCommand < Window_Command
 def initialize(width, commands, column, actor)
   super(width, commands, 3)
   @enabled = actor.od_level > 0
   refresh
   self.active = true
 end
 
 def refresh
   self.contents.clear
   for i in 0...@item_max
     draw_item(i, @enabled)
   end
 end
end


class Scene_Overdrive < Scene_Base
 #--------------------------------------------------------------------------
 # * Object Initialization
 #     actor_index : actor index
 #--------------------------------------------------------------------------
 def initialize(actor_index = 0)
   @actor_index = actor_index
 end
 #--------------------------------------------------------------------------
 # * Start processing
 #--------------------------------------------------------------------------
 def start
   super
   create_menu_background
   @actor = $game_party.members[@actor_index]
   @viewport = Viewport.new(0, 0, 544, 416)
   @help_window = Window_Help.new
   @help_window.viewport = @viewport
   @skill_window = Window_Skill.new(0, 168, 544, 248, @actor, true)
   @skill_window.viewport = @viewport
   @skill_window.help_window = @help_window
   @skill_window.index = -1
   command = []
   command.push(CSU::Overdrive::LEVEL_SET_VCB)
   command.push(CSU::Overdrive::VIEW_OD_VCB)
   command.push(CSU::Overdrive::MODE_VCB)
   @skill_window.active = false
   @command_window = Window_ODCommand.new(544, command, 3, @actor)
   @command_window.viewport = @viewport
   @command_window.y = 112
   @char_level_window = Window_ODLevel.new(0, 0, @actor)
   @char_level_window.viewport = @viewport
   command = []
   for i in 1..@actor.max_od_level
     command.push((CSU::Overdrive::LEVEL_VCB + i.to_s))
   end
   @level_window = Window_Command.new(544, command, 3)
   @level_window.viewport = @viewport
   @char_level_window.y = 56
   @level_window.y = 112
   @level_window.z = 1000
   @type_window = Window_Command.new(544, @actor.available_od_type, 3)
   @type_window.viewport = @viewport
   @type_window.y = 112
   @type_window.z = 1000
   @level_window.active = @type_window.active = false
   @level_window.visible = @type_window.visible = false
 end
 #--------------------------------------------------------------------------
 # * Termination Processing
 #--------------------------------------------------------------------------
 def terminate
   super
   dispose_menu_background
   @help_window.dispose
   @command_window.dispose
   @skill_window.dispose
   @level_window.dispose
   @char_level_window.dispose
 end
 #--------------------------------------------------------------------------
 # * Return to Original Screen
 #--------------------------------------------------------------------------
 def return_scene
   $scene = Scene_Menu.new(1)
 end
 #--------------------------------------------------------------------------
 # * Switch to Next Actor Screen
 #--------------------------------------------------------------------------
 def next_actor
   @actor_index += 1
   @actor_index %= $game_party.members.size
   $scene = Scene_Overdrive.new(@actor_index)
 end
 #--------------------------------------------------------------------------
 # * Switch to Previous Actor Screen
 #--------------------------------------------------------------------------
 def prev_actor
   @actor_index += $game_party.members.size - 1
   @actor_index %= $game_party.members.size
   $scene = Scene_Overdrive.new(@actor_index)
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
   super
   update_menu_background
   @help_window.update
   @command_window.update
   @char_level_window.update
   @level_window.update
   @type_window.update
   if @skill_window.active
     update_skill_selection
     @skill_window.update
   elsif @command_window.active
     update_command_selection
   elsif @level_window.active
     update_level_selection
   elsif @type_window.active
     update_type_selection
   end
 end
 #--------------------------------------------------------------------------
 # * Update Skill Selection
 #--------------------------------------------------------------------------
 def update_skill_selection
   if Input.trigger?(Input::B)
     Sound.play_cancel
     @skill_window.active =false
     @command_window.active = true
     @skill_window.index= -1
   end
 end
 
 def update_command_selection
   if @command_window.index == 0
     text = CSU::Overdrive::LEVEL_SET_HELP
   elsif @command_window.index ==1
     text = CSU::Overdrive::VIEW_OD_HELP
   elsif @command_window.index == 2
     text = CSU::Overdrive::MODE_HELP
   end
   @help_window.set_text(text)
   if Input.trigger?(Input::B)
     Sound.play_cancel
     return_scene
   elsif Input.trigger?(Input::C)
     if @actor.od_level == 0
       Sound.play_buzzer
       return
     end
     Sound.play_decision
     case @command_window.index
     when 0
       @level_window.active = true
       @level_window.visible = true
       @command_window.active = false
     when 1
       @skill_window.active =true
       @command_window.active = false
       @skill_window.index = 0
     when 2
       @type_window.active = @type_window.visible = true
       @command_window.active = false
     end
   elsif Input.trigger?(Input::R)
     Sound.play_cursor
     next_actor
   elsif Input.trigger?(Input::L)
     Sound.play_cursor
     prev_actor      
   end
 end
 
 def update_level_selection
   @help_window.set_text(CSU::Overdrive::LEVEL_SET_HELP)
   if Input.trigger?(Input::B)
     Sound.play_cancel
     @level_window.active = false
     @level_window.visible = false
     @command_window.active = true
   elsif Input.trigger?(Input::C)
     Sound.play_decision
     @actor.od_level = @level_window.index+1
     @actor.overdrive = 0
     @help_window.set_text(CSU::Overdrive::LEVEL_CHANGED_VCB + (@level_window.index+1).to_s)
     @skill_window.refresh
     @char_level_window.refresh
     for i in 1..60
       Graphics.update
     end
   end
 end
 
 def update_type_selection
   case @type_window.commands[@type_window.index]
   when CSU::Overdrive::STOIC_NAME
     text = CSU::Overdrive::STOIC_HELP
   when CSU::Overdrive::ATTACKER_NAME
     text = CSU::Overdrive::ATTACKER_HELP
   when CSU::Overdrive::HEALER_NAME
     text = CSU::Overdrive::HEALER_HELP
   when CSU::Overdrive::SLAYER_NAME
     text = CSU::Overdrive::SLAYER_HELP
   when CSU::Overdrive::COMRADE_NAME
     text = CSU::Overdrive::COMRADE_HELP
   when CSU::Overdrive::VICTORY_NAME
     text = CSU::Overdrive::VICTORY_HELP
   when CSU::Overdrive::COWARD_NAME
     text = CSU::Overdrive::COWARD_HELP
   when CSU::Overdrive::AVENGER_NAME
     text = CSU::Overdrive::AVENGER_HELP
   when CSU::Overdrive::ALLY_NAME
     text = CSU::Overdrive::ALLY_HELP
   when CSU::Overdrive::SOLO_NAME
     text = CSU::Overdrive::SOLO_HELP
   when CSU::Overdrive::DAREDEVIL_NAME
     text = CSU::Overdrive::DAREDEVIL_HELP
   when CSU::Overdrive::DANCER_NAME
     text = CSU::Overdrive::DANCER_HELP
   end
   @help_window.set_text(text)
   if Input.trigger?(Input::B)
     Sound.play_cancel
     @type_window.active = false
     @type_window.visible = false
     @command_window.active = true
   elsif Input.trigger?(Input::C)
     Sound.play_decision
     @actor.od_type = @type_window.commands[@type_window.index]
     @help_window.set_text(CSU::Overdrive::MODE_CHANGED_VCB + (@type_window.commands[@type_window.index]))
     for i in 1..60
       Graphics.update
     end
     @skill_window.refresh
     @char_level_window.refresh
   end
 end        
end

class Window_Base
 def draw_actor_od_gauge(actor, x, y, width = 120, use_name = true)
   gw = (width - 2) * actor.overdrive / [actor.max_overdrive, 1].max
   gc1 = Color.new(156, 96, 96)
   gc2 = Color.new(225, 176, 176)
   self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
   self.contents.gradient_fill_rect(x + 1, y + WLH - 7, gw, 4, gc1, gc2)
   self.contents.font.color = Color.new(176, 128, 128)
   self.contents.draw_text (x, y, width, WLH, CSU::Overdrive::OD_NAME) if use_name
   self.contents.font.color = normal_color
 end
end

if !CSU::Overdrive::USE_CUSTOM_HUD
class Window_BattleStatus
 def draw_item(index)
   rect = item_rect(index)
   rect.x += 4
   rect.width -= 8
   self.contents.clear_rect(rect)
   self.contents.font.color = normal_color
   actor = $game_party.members[index]
   draw_actor_od_gauge(actor, 4, WLH * index, 100, false) if actor.od_level > 0
   draw_actor_name(actor, 4, rect.y)
   draw_actor_state(actor, 114, rect.y, 48)
   draw_actor_hp(actor, 174, rect.y, 120)
   draw_actor_mp(actor, 310, rect.y, 70)
 end
end
end

if !CSU::Overdrive::USE_CUSTOM_MENU_SCRIPT
class Scene_Menu
 
 alias csu_overdrive_start_actor_selection start_actor_selection unless $@
 def start_actor_selection
   if @command_window.commands[@command_window.index] == Vocab::skill
     if @skill_od_window == nil
       @skill_od_window = Window_Command.new(160, [Vocab::skill, CSU::Overdrive::OD_NAME])
       @skill_od_window.y = @command_window.y + 16 + @command_window.index * 24
       @skill_od_window.x = @command_window.x
       @skill_od_window.openness = 0
     end
     @skill_od_window.open
     loop do
       Graphics.update
       Input.update
       @skill_od_window.update
       if Input.trigger?(Input::C)
         Sound.play_decision
         @skill_od_window.close
         loop do
           Graphics.update
           Input.update
           @skill_od_window.update
           break if @skill_od_window.openness == 0
         end
         @skill_od_window.visible = false
         break csu_overdrive_start_actor_selection
       elsif Input.trigger?(Input::B)
         Sound.play_decision
         @skill_od_window.close
         loop do
           Graphics.update
           Input.update
           @skill_od_window.update
           break if @skill_od_window.openness == 0
         end
         break @skill_od_window.visible = false
       end
     end
   else
     csu_overdrive_start_actor_selection
   end
 end
   
 def update_actor_selection
   if Input.trigger?(Input::B)
     Sound.play_cancel
     end_actor_selection
   elsif Input.trigger?(Input::C)
     $game_party.last_actor_index = @status_window.index
     Sound.play_decision
     case @command_window.index
     when 1  # skill
       if @skill_od_window.index == 0
         $scene = Scene_Skill.new(@status_window.index)
       else
         $scene = Scene_Overdrive.new(@status_window.index)
       end
     when 2  # equipment
       $scene = Scene_Equip.new(@status_window.index)
     when 3  # status
       $scene = Scene_Status.new(@status_window.index)
     end
   end
 end
 
 alias csu_overdrive_terminate terminate unless $@
 def terminate
   csu_overdrive_terminate
   @skill_od_window.dispose if @skill_od_window != nil
 end
end
end
Pindahin ke First Post dong. :kabur:
CrimsonSeas Overdrive Empty2013-11-18, 22:41
PostRe: CrimsonSeas Overdrive
richter_h 
Salto Master
Hancip RMID
richter_h

Kosong
Posts : 1705
Thanked : 30
Engine : Other
Skill : Skilled
Type : Developer
Awards:

CrimsonSeas Overdrive Vide
sip udha ane masukin ke first post.

sementara, ane gembok ni trid biar ngga ada necropost lagi. kalo ada apa2 seputar ni trid, PM ane aja ye :3

locked and loaded :gembok:
CrimsonSeas Overdrive Empty
PostRe: CrimsonSeas Overdrive
Sponsored content 




CrimsonSeas Overdrive Vide
 

CrimsonSeas Overdrive

Topik sebelumnya Topik selanjutnya Kembali Ke Atas 
Halaman 1 dari 1

Permissions in this forum:Anda tidak dapat menjawab topik
RPGMakerID :: Scripts & Event Systems :: RMVX Scripts-