RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[Request] Skill/Overdrive System

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 78
RMRK Junior
Overdrive System
10/3/2010



Summary
Well, I know that there are many overdrive script out there. But it seems that they don't provide a great performing of overdrive.(if you don't understand, look at the features for further information)

Features Desired
  • Overdrive bars, modes or types. Can adjust the actual ratios of each players. Look down at reply number 2 for further information.
  • Players can use their overdrive not only when the overdrive bar is fulfilled, but also when they are at low HP.
  • Trigger overdrive like Tidus in ff10, Squall in ff8.
  • Duel overdrive, that means press button and the character will perform skill like Zell in ff8
  • Shot overdrive, like Irvine in ff8
  • Overdrive that choose random skills in a preset list, like Rinoa's Angel Wings in ff8
  • Overdrive that the character input numbers of button to raise the skills power, like Auron in ff10.
  • Slot overdrive like Selphie in ff8
  • Slot overdrive (different from above) or say reel overdrive like Tifa in ff7, Wakka in ff10, Setzer in ff6.
  • A double and triple casting SKILL(not overdrive)
  • Can adjust overdrive bars by script, by items.
  • States which:
    Maxes the overdrive bar, like ff8 Aura.
    Stops the overdrive bar from going up, like ff10 Shield.
    Increases the speed of overdrive bar, like ff10 Boost.
    Prevents player from using overdrive but the overdrive gauge is still active, like ff8 curse status.
  • Set which skills to be overdrive by notes.
  • Notes for which skill decreases how much of the overdrive bar length, I mean user can freely determine how much will the filled overdrive bar length be reduced (i'm not so good at explaining so see reply number 10 for further information.
  • Compatible with YEM, and this is a link where you can get the demo: http://wiki.pockethouse.com/index.php?title=Category:Yanfly_Engine_Melody

Mockups
Yes, many script I've found. Like Crimson Seas overdrive, KGC Overdrive and Skill activation a la FFX,etc... But it doesn't match most of what I want, and does not compatible with YEM.

Games its been in
  • ff6
  • ff7
  • ff8
  • ff10



Did you search?
Yes

Where did you search?
  • rmrk.net
  • rpgmakervx.net
  • rpg revolution forum
  • Google

What did you search for?
  • Overdrive System
  • Skill System
  • many more keywords but I forgot, just those two are the most obvious, right?
« Last Edit: October 08, 2010, 01:19:23 PM by sacred »

**
Rep: +0/-0Level 78
RMRK Junior
Minor bump no.1

***
Rep:
Level 76
~Crazy Lazy Workaholic~
I kinda want to add onto this, since i'm an FF fan, and I've used the FFRPG system's Limit Optional Rules, and I think the request could use some more structure.

Features
  • Overdrive Hash to define Actor Overdrive Types. It would be nice if the actual ratios could be edited but for now I'll try to give reasonable sounding ones... Types marked with * are less necessary.
    • Stoic: Overdrive bar is increased by a percentage based on HP Damage taken. (As in, the % of HP damage Dealt is the % of bar increased. ex: Ralph has 466 HP and takes 46, so he gets 10% gauge)
    • Comrade: Overdrive bar is increased by a percentage based on HP Damage taken by allies. (Probably at a reduced rate... Though I think a nice math to use would be Total Ally HP damage dealt %, for example there are 3 party members, Ralph, Ulrika and Ylva. Ralph has Comrade Charge. Ulrika has a max of 600 HP and Ylva has a max of 400HP. All together that is 1000 HP. Ulrika takes 100 HP from one attack, so Ralph gains 10% gauge. Then a group attack is used and Ulrika and Ylva take a total of 250 damage, so Ralph gains 25% gauge.
    • Striker: Overdrive bar is gained by dealing damage to the enemy. This Percentage would be best determined by first calculating relative HP of the target to the character and then distributing a percent per hit based on that. If Ralph has 500HP and Hits a monster with 100HP he obtains 20% of the gauge he would if the monster had equal HP, for a minimum of 1%. It would also be nice to have the option to set a maximum % earnable and a base percent of maybe 5.
    • Healer: Overdrive bar is gained by assisting allies and recovering HP or adding/removing status effects to friends. Each act gives a flat percent gain of 5% per target affected. Skills/Items that affect this type may require a tag to add to the note box. And perhaps it may be possible to set individual ratings.
    • Tactician: Overdrive bar is gained by debuffing and adding status effects to enemies, a flat 5% per successful status added. Skills/Items that affect this type may require a tag to add to the note box. And perhaps it may be possible to set individual ratings.
    • *Slayer: Overdrive bar is gained by dealing the final blow on an enemy. Gives a flat (20)% rating each kill.
    • *Avenger: Overdrive bar is gained when an ally is incapacitated. Gain a flat (20%) rating for each death.
    • *Evader: Overdrive bar is gained by avoiding attacks. Each attack that results in a miss against the target grants the character a flat (10%) rating each time.
  • Items and states Note Tags that can affect Overdrive Gauge.
  • *Menu to adjust Overdrive style in-game and codes to grant additional overdrive styles during gameplay. Only One (maybe 2) Type can be active at once.
  • Different Overdrive skill types in order to activate the powers. Place Tag in skill Notebox to denote Overlimit and Activation Type.

If you think there's more to add, please feel free to elaborate. Elaboration and detail really help scripters to know what you want and make them able to think on how to do it.

~My Projects~

~ VocaloidVX ~ Second Life Project ~
~ RPG Maker Collective ~
To support this forum, it's the first place that will gets posted some updates of mine, check it out ^_~

**
Rep: +0/-0Level 78
RMRK Junior
Well, those are great but i'll update it in my request on saturday. I have no free time now. I'll think of more overdrive features. But the problem is that no one tells us that he/she is going to work on this.

**
Rep:
Level 75
RMRK Junior
I could, with a bit o help. Really, my major problem with scripts is that I can't understand the graphics system. If another scripter is going to take on the graphical part of this, I can do it. I could leave open the modules needed for the graphics and then pass it...

**
Rep: +0/-0Level 78
RMRK Junior
Well, just do at your best. When other members in the forum read this topic, they will know your problem and maybe someone will help you. Or i'll just wait for another scripter. Anyway, i really appreciated your help if you post your flawed script here. I'll asked for help if i can

pokeball TDSOffline
***
Rep:
Level 84
-T D S-
Silver - GIAW 11 (Hard)Silver - Game In A Week VII
But the problem is that no one tells us that he/she is going to work on this.

No. The problem would be around here...


Features Desired
  • Compatible with YEM

This is a very simple script and would probably take 2 or 3 hours tops to do, but due to the disturbing trend in script requests nowadays to just say "Compatible with X System" odds are your request will not be done.

And I say disturbing because people seem to forget that whoever is going to help them is usually a human being with a life and things to do.

Whenever someone just say "make it compatible with something", without providing a source which in this case it's just a demo filled with a lot of scripts which then said scripter would have to go through and dissect to see which classes he has to work with and then of course learn how whoever made it intended it to work.

A script request which should have taken 2 or 3 hours suddenly takes 2 or 5 days. And without any sort of pay or compensation.

But you could get lucky and find a scripter that already worked with said system in the past.

I hope that sheds some light on why some people might not be interested in helping, aside from lack of skill, time or just laziness.

**
Rep:
Level 75
RMRK Junior
Well, I did look into YEM, and while I'm just a beginner, it doesn't need that much work to figure out (Lunatic Mode is intended so). In fact, I think this script is EASIER to do with YEM than without. You just need to go through two or three paragraphs Yanfly wrote herself to understand how to modify her script...

pokeball TDSOffline
***
Rep:
Level 84
-T D S-
Silver - GIAW 11 (Hard)Silver - Game In A Week VII
I could, with a bit o help. Really, my major problem with scripts is that I can't understand the graphics system. If another scripter is going to take on the graphical part of this, I can do it. I could leave open the modules needed for the graphics and then pass it...

Well, I did look into YEM, and while I'm just a beginner, it doesn't need that much work to figure out (Lunatic Mode is intended so). In fact, I think this script is EASIER to do with YEM than without. You just need to go through two or three paragraphs Yanfly wrote herself to understand how to modify her script...

So, you can't understand how graphics works but you can learn how a whole new system of scripts can work.

I would like to see where this goes so.

http://www.creationasylum.net/forum/index.php?showtopic=23437
http://www.creationasylum.net/forum/index.php?showtopic=23438
http://www.creationasylum.net/forum/index.php?showtopic=23439
http://www.creationasylum.net/forum/index.php?showtopic=23831

That should help you to learn about graphics, and in theory allow you to fulfill the request by yourself since it's so easy to do with YEM.

**
Rep:
Level 75
RMRK Junior
I feel a bit teased, but the links will probably be useful. So, good for me!

***
Rep:
Level 76
~Crazy Lazy Workaholic~
Well maybe incorporating Shanghai's scripts for the special effects imaging would assist Mormegil as well. And I thought of something else that need be defined: The Overdrive Gauge itself.

There are a few ways to run it, and I think FF7's may be best. But having multiple options may also be nice for people to play with - and make it more interesting if different people have different limits... Like Some people would gain up limits and hold onto them while others would only have limits in certain situations...

  • The Overdrive gauge is defined by a % gain based on the character's overdrive type. Each overdrive skill takes a certain % amount to accomplish: A level 1 Overdrive takes (100%), A level 2 Overdrive takes (150%) or (200%) and so on. However you need to have a level 2 Overdrive in order to get the higher % amount so your highest level overdrive will always take a full overdrive bar, but you could start to use lower level overdrives multiple times. This limit type is stored and will carry from battle to battle until used. Perhaps adding an option for this to be reset if you use an inn or similar feature would also be feasible.
  • The Overdrive gauge is filled when an event happens in combat. Reaching Critical (25%) health, A Comrade dying, a status is inflicted, or the final blow is dealt to an enemy. Perhaps having the option to set if an overdrive takes effect immediately if the condition for activation is reached would be nice. These types of overdrives only occur within the battle and only under the specified condition. Having the option to "equip" overdrives would also be a nice feature with this...

~My Projects~

~ VocaloidVX ~ Second Life Project ~
~ RPG Maker Collective ~
To support this forum, it's the first place that will gets posted some updates of mine, check it out ^_~

**
Rep: +0/-0Level 78
RMRK Junior
Request updated. Is anyone working on this? I'm waiting. And The Mormegil, if you are working on it, do at your best, as I am expecting it.

**
Rep:
Level 75
RMRK Junior
I am working. I did a snippet for the multicasting skill, but I realized it wouldn't work with YEM that way, I will probably change it. It's a separate script altogether, so I will probably keep it separated.

For the main script, I'm at about 1200 lines of code and not yet at half, so either I'm not good scripting or this is a lot more work than it first appears. Probably the first one, but I hope this will be a good job nonetheless. Anyway, when I'm finished, could you help me test it? :)

@Terra-chan: I will probably make a second script to add on to the main one for the Overdrive Equip function/scene/window/whatever. For now, I will concentrate on finishing the main body.

***
Rep:
Level 76
~Crazy Lazy Workaholic~
No problem, I'm just offering suggestions to make this fully accessible for other people interested in using this script in different ways. I always think of other options of how something is done so that it can have higher utilization. It's why I like Melody so much.

~My Projects~

~ VocaloidVX ~ Second Life Project ~
~ RPG Maker Collective ~
To support this forum, it's the first place that will gets posted some updates of mine, check it out ^_~

**
Rep:
Level 75
RMRK Junior
Ok, I've finished most of this. Once I have figured out how to implement the Overdrive Bar - and I have an idea already - I will try and test it. And post it here so that you can test it too.

**
Rep: +0/-0Level 78
RMRK Junior
If you can, please include a demo along with your script, since it is not a plug and lplay script.

**
Rep: +0/-0Level 78
RMRK Junior
Have you finished it yet? The Mormegil.

**
Rep:
Level 75
RMRK Junior
Well, yeeesss...


Two problems: first, I've been ill for over half a week, so I can't assure you the last lines I wrote (which are the first ones in the code) aren't just some random rubbish. ;) hope not.
Second, more important problem: in order to use this script, you must install a couple (actually more like 10) images in your system folder. Images which I need to create before testing this... So, this is probably full of bugs, can't yet be tested and still has some issues that need to be resolved. So, yeah. I "finished" it.


...the script is too long for just one post? -.-

**
Rep:
Level 75
RMRK Junior
Code: [Select]
?#------------------------------------------------------------------
#------------------------------------------------------------------
#                 The Mormegil's Overdrive System
#                             v 1.0
#------------------------------------------------------------------
#------------------------------------------------------------------
# This script is intended as an add-on to Yanfly's Engine Melody Battle Engine.
# It creates an overdrive system with as much personalization as possible
# that you can set up mainly using notetags.
# For the expert users, there are some advanced options within the code itself.
#
# NOTETAGS:
# The Overdrive System requires intensive notetag use. Here is a compendium of
# the notetags' functions.
#
# <<overdrive>>
# This is the main notetag. It identifies the skill as an overdrive skill.

# + type: trigger
# + type: sequence
# + addon: consumable
# + type: press
# + type: random
# + type: slot effect
# + type: slot increase
# These are the notetags that determinate the Overdrive's type.
# Default is normal type. Normal type means the Overdrive is just a simple skill.
# Trigger type creates a bar. You need to input at the correct time the action button
# in order for the command to work at maximum power.
# Sequence type creates a button sequence. You need to input the button sequence
# in order for the overdrive skill to work.
# Consumable uses up an object to work. This overdrive type can be used as an "add-on" to another
# type (normal included), so that another overdrive skill has an extra requisite.
# Press displays a button that you must press quickly to increase the efficacy of the overdrive.
# Random chooses a random skill from a list of skills.
# Slot effect creates a slot machine. Depending on the results of the slot machine, you can
# have different effects.
# Slot increase creates a slot machine. Depending on the results of the slot machine, you can
# increase or decrease the efficacy of the overdrive skill.
#
# + trigger: back and forth
# + trigger: speed x
# + trigger: times x
# + trigger: nothing
# + trigger: half damage
# + trigger: percentage damage
# + trigger: no effects
# + trigger: percentage effects
# These are Trigger type specific notetags. Back and forth makes the cursor on the bar
# move back and forth until you either miss or hit all spots. If you activate this option hits can appear on the first
# half of the bar too.
# Speed sets the cursor's speed. X should be a number between 1 and 5: 1 means the cursor
# reaches the end of the gauge in 10 seconds, 2 means 8 seconds, 3 means 6, 4 means 4 and 5 means 2.
# Times sets the number of hits the player has on the bar. Hits are put in randomly generated spots on the
# second half of the bar. Do not place more than 3 or 4 hits, tops; up to about 6 or 7 hits with back and forth
# activated.
# Nothing, half damage, percentage damage, no effects and percentage effects are miss notetags:
# they affect how the skill works if the player misses the hit spots. Nothing means the skill fails,
# half damage means exactly that, percentage damage means you get a damage % depending on how many
# hits you have done right, no effects means you don't get to apply status effects and percentage effect
# means there's only a chance (again, depending on the number of correct hits) to do so.
#
# + sequence: n button
# + sequence: hide sequence
# + sequence: any of flag
# + sequence: timeout x
# + sequence: show correct
# These are Sequence specific notetags. The main notetag is n button: it creates the sequence.
# You must place numbers from 0 to whatever you like (suggested cap is at 9 max) and then the
# button you want the player to press, in order.
# Here is a list of buttons you could place: a, b, c, x, y, z, l, r, up, down, left, right, random.
# Hide sequence hides the sequence. You can use the Overdrive Equip script to display the information
# to the player outside of combat.
# Any of creates a group of skills that are identified by "flag". If you use this notetag, hide sequence
# is also suggested. This notetag means that the player can input any sequence from the "flag" group
# and the proper skill will be activated.
# Timeout places a timer. If the timer runs out, the overdrive won't work.
# Show correct means that if the player presses the proper button, the sequence will delete it and only
# the other buttons will remain.
#
# + consumable: item x
# + consumable: weapon x
# + consumable: armor x
# + consumable: quantity x
# + consumable: random x..y
# These are the consumable tags. Item x, armor x and weapon x fix the consumed item. Quantity fixes the quantity
# of the item to be deleted (default is 1). Random is the same, but the quantity will be a random number between
# x and y.
#
# + press: button
# + press: timeout x
# + press: max x
# + press: change x button
# + press: wrong cancels
# + press: wrong decreases
# These are press tags. Button fixes the button to use.
# Timeout x fixes the max timer. Max fixes the maximum amount of button presses counting.
# Change x button fixes a frame before the timeout (x) and from that frame you must press a different
# button (button). Wrong cancels means that a wrong input resets the count to 0. Wrong decrease means
# that a wrong input decreases the count by 1.
#
# + random: x
# + random: chance x, y
# + random: cost on
# + random: cast x
# These are random tags. X sets a skill; use it multiple times to create a list.
# Chance x, y adds a skill with a greater chance to be chosen (y times higher).
# Cost on means you must pay the cost of the skill. Cast x means using x random skills.
#
# + slot effect: n slots
# + slot effect: n chance
# + slot effect: base x
# + slot effect: req_chance req_number x
# These are slot effect tags. N slots fixes the number of slots (from 3 to 9)
# N chance fixes the number of different pictures appearing in the slot (from 2 to 10)
# Base x fixes the skill to use if no combination is reached.
# Req_chance is the required picture, req_number is the minimum number of times the picture must appear
# and x is the skill associated with that combination. The combinations are read in order from top to last,
# and only one combination is used.
#
# + slot increase: n slots
# + slot increase: lose chance x
# + slot increase: win chance x
# + slot increase: nothing
# + slot increase: percentage damage
# + slot increase: percentage effect
# + slot increase: percentage hit
# These are slot increase tags. N slots fixes the slots number (from 3 to 9).
# Lose chance is the number of "losing" chances; win chance is the number of "winning" chances.
# The rest fix the results if some slots are "losing". Nothing means the skill won't work.
# Percentage damage means the damage is reduce with every failure. Percentage effect means the status effects
# will be placed upon enemy only with a lower % rate, depending on failures. Percentage hit
# means the attack will have a reduce hit ratio.
#
# + overdrive reaction
# This notetag means the overdrive skill will be used immediately after the overdrive gauge is filled.
#
# + overdrive level x
# This notetag fixes the overdrive level. Default level is 1. Overdrive skills cost more the higher their level is.
# Your overdrive gauge's size depends on the highest level overdrive skill you have learned.
#
# <overdrive x%>     <no overdrive>      <overdrive!>
# These are status notetags. Overdrive x% means the overdrive gauge will be filled at x% speed rate when under this status.
# No overdrive means you won't be able to use overdrive skills, but the overdrive gauge is unaffected. Overdrive! means
# you will be able to use overdrive skills no matter what.
#
# <during effect: overdrive +x>   <during effect: overdrive -x>    <during effect: overdrive x%>
# This is an item notetag. It means the overdrive gauge of the target will be affected with an increase or decrease
# as chosen.
#
#------------------------------------------------------------------
#
#     $$$$$$$$$$$$$$$ CUSTOMIZATION OPTIONS $$$$$$$$$$$$$$$$$$$$
#
# This part of the script affects how actors gain overdrive gauges.
# Firstly, these are script commands that affect the overdrive gauge:
#
#           $game_actors[actor_ID].overdrive.gain(x)
#           $game_actors[actor_ID].overdrive.lose(x)
#           $game_actors[actor_ID].overdrive.percent(x)
#
# They work the same as the item notetags. I leave the rest to your imagination.
#
# This is the Limit Break Counter. Turn it to an integer > 0 if you want your characters to be able to use their
# overdrive if at low hp. If they are at low hp (less than x%, where x is the integer specified) they will
# bypass normal Overdrive rules, and use it without spending Overdrive

module TheMormegil    # DO NOT DELETE!
  module Overdrive_System    # DO NOT DELETE!

LIMIT_BREAK = 0

# If you want to entirely disable the overdrive counter, turn this to true. This means that if you turned on
# the Limit Break, your characters will use their overdrive when on low hp only.

NO_OVERDRIVE = false

#
# This is the Actor Hash. It links every actor to one or more "Overdrive Types".
# These Overdrive Types are described below the Hash. They affect how each hero gains
# or loses Overdrive.


         OVERDRIVE_ACTOR_HASH = {           # DO NOT DELETE!

                1 => ["stoic", "pacifist", "comrade", "healer", "animist"]
                2 => ["brutal", "berserker", "sadist", "slayer"]
                3 => ["evader", "coward", "afraid"]
                4 => ["avenger", "tactician", "striker", "weak"]

                           }      # DO NOT DELETE!

# To change the Overdrive Types for an actor mid-game, the code command is:
#
#          $game_actors[actor_ID].overdrive.type = ["type", "type", "type"]
#
# This is the description for every type. The first type in every pair is the
# positive one, while the second is the negative - lowering Overdrive instead of
# augmenting it.
# Stoic / Weak:
# This type depends on damage taken. Rate depends on maximum hp.
# Comrade / Afraid:
# This type depends on damage taken by allies. Rate depends on allies maximum hp.
# Striker / Pacifist:
# This type depends on damage inflicted. Rate depends on target's maximum hp compared to yours.
# Healer / Sadist:
# This type depends on healed damage. Rate depends on target's maximum hp.
# Tactician / Brutal:
# This type depends on imposed statuses. Rate is fixed.
# Slayer / Animist:
# This type depends on slayed enemies. Rate is fixed.
# Avenger / Coward:
# This type depends on fallen allies. Rate is fixed.
# Evader / Berserker:
# This type depends on evaded blows. Rate is fixed.
#
# You can change the individual rate of overdrive growth here. Every value is a percentage.
# You can modify both the actor hash and the general rate value. Beware! This will affect also
# overdrive lost...

OVERDRIVE_RATE = 100

OVERDRIVE_RATE_ACTOR_HASH = {
1 => 100
2 => 100
3 => 100
4 => 100
            }
#
  end               #DO NOT DELETE!
end                 #DO NOT DELETE!
#
#------------------------------------------------------------------
#------------------------------------------------------------------
#------------------------------------------------------------------

#                   STOP EDITING PAST THIS POINT!
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
#


$imported = {} if $imported == nil
$imported["TM_OverdriveSystem"] = true

class Window_ActorCommand < Window_Command
  alias in_ov_sy_tm initialize
  def initialize
    in_ov_sy_tm
    @overdrive_gauge = OverdriveGauge.new
  end

  alias di_ov_sy_tm dispose
  def dispose
    di_ov_sy_tm
    @overdrive_gauge.terminate
  end 

  alias set_ov_sy_tm setup
  def setup(actor)
    set_ov_sy_tm(actor)
    @overdrive_gauge.set(actor)
  end

  alias up_ov_sy_tm update
  def update
    up_ov_sy_tm
    return unless $scene.is_a?(Scene_Battle)
    return unless @actor == $scene.status_window.actor
    @overdrive_gauge.update
  end

  alias ref_ov_sy_tm refresh
  def refresh
    ref_ov_sy_tm
    @overdrive_gauge.set(@actor)
  end

end

class OverdriveGauge

  def initialize
    @viewport = Viewport.new(0, Graphics.height - 128, Graphics.width, 24)
    @sprite = Sprite.new(@viewport)
    @sprite.visible = false
    @bitmap = Cache.system("Overdrive_Gauge")
    @sprite.bitmap = @bitmap
    @level = 0 if @level.nil?
  end

  def set(actor)
    @actor = nil
    @actor = actor
    if @actor.no_overdrive?
      @actor = nil
      @sprite.visible = false
      return
    end
    @level = actor.overdrive.n
    level_update
  end

  def update
    actual_level = @actor.overdrive.n
    if @level != actual_level
      Audio.play_se("Chime2", 100, 150) unless @sound_done
      @sound_done = true
      if @level < actual_level
        @level = (@level+10, actual_level).min
      else
        @level = (@level-10, actual_level).max
      end
      level_update
    else
      @sound_done = false
    end
    return if @sprite.visible
    if $scene.actor_command_window.active    ### CHECK IF VISIBLE
      @sprite.visible = true unless @actor == nil
    end
  end

  def level_update
    bitmap = @bitmap
    width = ((@bitmap.width-4)/@actor.overdrive.max)*@level
    rect = Rect.new(2, 2, width, 20)
    yellow = Color.new(200, 200, 40, 255)
    red = Color.new(255, 40, 40, 255)
    bitmap.grandient_fill_rect(rect, yellow, red)
  end

  def terminate
    @sprite.dispose
    @sprite = nil
    @viewport = nil
    self = nil
  end
end

class Scene_Battle < Scene_Base

  attr_accessor    :overdrive_successes
  attr_accessor    :overdrive_failures
  attr_accessor    :overdrive_trigger_back_and_forth
  attr_accessor    :overdrive_trigger_bar
  attr_accessor    :overdrive_trigger_cursor
  attr_accessor    :overdrive_trigger_hits
  attr_reader      :overdrive_sequence_show_correct
  attr_reader      :overdrive_percent_damage
  attr_reader      :overdrive_percent_effects
  attr_reader      :overdrive_percent_hit
  attr_reader      :overdrive_nullify
  attr_reader      :overdrive_nullify_effects
  attr_reader      :overdrive_half

# Item notetags
  alias lunatic_obj_effects_overdrive_system lunatic_obj_effects
  def lunatic_obj_effects(type, obj = nil, target = @active_battler)
    obj.nil? ? effects = [] : effects = obj.lunatic_effects[:during]
    for effect in effects
      next if TheMormegil::Overdrive_System::NO_OVERDRIVE
      case effect.upcase
      when TheMormegil::Regexp::OVERDRIVE_ITEM_PLUS
        if target.actor?
          target.overdrive.gain($1.to_i)
        end
      when TheMormegil::Regexp::OVERDRIVE_ITEM_MINUS
        if target.actor?
          target.overdrive.lose($1.to_i)
        end
      when TheMormegil::Regexp::OVERDRIVE_ITEM_PERCENT
        if target.actor?
          target.overdrive.percent($1.to_i)
        end
      end
    end
    lunatic_obj_effects_overdrive_system(type, obj, target)
  end

# Use Overdrive Skill
  alias perform_normal_skill perform_skill
  def perform_skill(skill)
    if skill.overdrive?
      perform_overdrive(skill)
    else
      perform_normal_skill(skill)
    end
  end

  def perform_overdrive(skill)
    start_overdrive(skill)
    define_overdrive_scene(skill)
    pay_overdrive_cost(@active_battler, skill) unless actor.bypass_overdrive_cost?
    process_consumable_overdrive_cost(skill)
  end

  def start_overdrive(skill)
    @overdrive_trigger_back_and_forth = false
    @speed = 3
    @overdrive_trigger_hits_number = 1
    @overdrive_nullify = 0
    @overdrive_half = false
    @overdrive_percent_damage = false
    @overdrive_effect_nullify = false
    @overdrive_percent_effects = false
    @overdrive_sequence_hide = false
    @overdrive_sequence_group = "NONE"
    @overdrive_sequence_show_correct = false
    @overdrive_press_change_frames = []
    @overdrive_press_change_buttons = []
    @overdrive_press_max = 0
    @overdrive_press_wrong_cancels = false
    @overdrive_press_wrong_decreases = false
    @overdrive_random_skills = []
    @overdrive_random_cast = 1
    @overdrive_cost_on = false
    @overdrive_slots = 3
    @overdrive_slot_chances = 5
    @overdrive_slot_effect_requisites = []
    @overdrive_slot_increase_lose_chances = 0
    @overdrive_slot_increase_win_chances = 0
    @overdrive_percent_hit = false
    lines = skill.note.split(/[\r\n]+/)
    for line in lines
      case line
      when OVERDRIVE_TRIGGER_BACK_AND_FORTH
        @overdrive_trigger_back_and_forth = true
      when OVERDRIVE_TRIGGER_SPEED
        @speed = (($1.to_i, 1).max, 5).min
      when OVERDRIVE_TRIGGER_TIMES
        @overdrive_trigger_hits_number = $1.to_i
      when OVERDRIVE_TRIGGER_NOTHING
        @overdrive_nullify = true
      when OVERDRIVE_TRIGGER_HALF
        @overdrive_half = true
      when OVERDRIVE_TRIGGER_PERCENT_DAMAGE
        @overdrive_percent_damage = true
      when OVERDRIVE_TRIGGER_NO_EFFECTS
        @overdrive_effect_nullify = true
      when OVERDRIVE_TRIGGER_PERCENT_EFFECTS
        @overdrive_percent_effects = true
      when OVERDRIVE_SEQUENCE_HIDE
        @overdrive_sequence_hide = true
      when OVERDRIVE_SEQUENCE_ANY_OF
        @overdrive_sequence_group = $1.upcase
      when OVERDRIVE_SEQUENCE_SHOW_CORRECT
        @overdrive_sequence_show_correct = true
      when OVERDRIVE_PRESS_CHANGE_BUTTON
        @overdrive_press_change_frames.push($1.to_i)
        @overdrive_press_change_buttons.push($2.upcase)
      when OVERDRIVE_PRESS_MAX
        @overdrive_press_max = $1.to_i
      when OVERDRIVE_PRESS_WRONG_CANCELS
        @overdrive_press_wrong_cancels = true
      when OVERDRIVE_PRESS_WRONG_DECREASES
        @overdrive_press_wrong_decreases = true
      when OVERDRIVE_RANDOM_SKILL
        @overdrive_random_skills.push($data_skills[$1.to_i])
      when OVERDRIVE_RANDOM_CAST
        @overdrive_random_cast = $1.to_i
      when OVERDRIVE_RANDOM_CHANCE
        for i in 1..$2.to_i
          @overdrive_random_skills.push($data_skills[$1.to_i])
        end
      when OVERDRIVE_RANDOM_COST_ON
        @overdrive_cost_on = true
      when OVERDRIVE_SLOT_EFFECT_SLOTS
        @overdrive_slots = $1.to_i
      when OVERDRIVE_SLOT_EFFECT_CHANCE
        @overdrive_slot_chances = $1.to_i
      when OVERDRIVE_SLOT_EFFECT_BASE
        @overdrive_slot_effect_base_skill = $data_skills[$1.to_i]
      when OVERDRIVE_SLOT_EFFECT_REQUISITE
        @overdrive_slot_effect_requisites.push([$1.to_i, $2.to_i, $3.to_i])
      when OVERDRIVE_SLOT_INCREASE_SLOTS
        @overdrive_slots = $1.to_i
      when OVERDRIVE_SLOT_INCREASE_LOSE_CHANCE
        @overdrive_slot_increase_lose_chances = $1.to_i
      when OVERDRIVE_SLOT_INCREASE_WIN_CHANCE
        @overdrive_slot_increase_win_chances = $1.to_i
      when OVERDRIVE_SLOT_INCREASE_NOTHING
        @overdrive_nullify = true
      when OVERDRIVE_SLOT_INCREASE_PERCENT_DAMAGE
        @overdrive_percent_damage = true
      when OVERDRIVE_SLOT_INCREASE_PERCENT_HIT
        @overdrive_percent_hit = true
      when OVERDRIVE_SLOT_INCREASE_PERCENT_EFFECTS
        @overdrive_percent_effects = true
      end
  end

  def finish_overdrive(skill_a)
    @overdrive_skills_to_perform = [skill_a] if @overdrive_skills_to_perform.nil?
    if (@overdrive_scene == "RANDOM")
      random = true
      for i in 1..@overdrive_random_cast
        r = rand(@overdrive_random_skills.size)
        @overdrive_skills_to_perform.push($data_skills[r])
      end
    @overdrive_successes -= 1 if (@overdrive_scene == "SLOT INCREASE")
    for skill in @overdrive_skills_to_perform
      next if @overdrive_nullify
      perform_normal_skill(skill)
      if random
        @ignore_cost = true
        random = false
      end
    end
    @ignore_cost = false
    @overdrive_skills_to_perform = nil
    @overdrive_trigger_back_and_forth = nil
    @speed = nil
    @overdrive_trigger_hits_number = nil
    @overdrive_nullify = nil
    @overdrive_half = nil
    @overdrive_percent_damage = nil
    @overdrive_effect_nullify = nil
    @overdrive_percent_effects = nil
    @overdrive_sequence_hide = nil
    @overdrive_sequence_group = nil
    @overdrive_sequence_show_correct = nil
    @overdrive_press_change_frames = nil
    @overdrive_press_change_buttons = nil
    @overdrive_press_max = nil
    @overdrive_press_wrong_cancels = nil
    @overdrive_press_wrong_decreases = nil
    @overdrive_random_skills = nil
    @overdrive_random_cast = nil
    @overdrive_cost_on = nil
    @overdrive_slots = nil
    @overdrive_slot_chances = nil
    @overdrive_slot_effect_base_skill = nil
    @overdrive_slot_effect_requisites = nil
    @overdrive_slot_increase_lose_chances = nil
    @overdrive_slot_increase_win_chances = nil
    @overdrive_percent_hit = nil
  end

  def define_overdrive_scene(skill)
    skill.note.split(/[\r\n]+/).each {|line|
      if line =~ TheMormegil::Regexp::OVERDRIVE_TYPE
        @overdrive_scene = $1.upcase
        return
      end}
    @overdrive_scene = "NORMAL"
  end

  def update
    if @overdrive_scene != nil
      super
      return unless $scene.is_a?(Scene_Battle)
      update_basic(true)
      overdrive_scene_update
    else
      super
      return unless $scene.is_a?(Scene_Battle)
      update_basic(true)
      update_info_viewport
      @message_window.visible = true if $game_message.visible
      update_input_windows unless atb?
      update_scene_change
      for actor in @current_party
        next if actor.dead?
        next if actor.overdrive.reaction_flag.nil?
        perform_reaction_overdrive(actor)
      end
    end
  end

  def overdrive_scene_update
    update_basic(true)
    case @overdrive_scene.upcase
    when "NORMAL"
      unless overdrive_title_update
        finish_overdrive(@active_battler.action.skill)
        @overdrive_scene = nil
        @overdrive_title_done? = false
      end
    when "TRIGGER"
      unless overdrive_title_update
        unless overdrive_trigger_update
          finish_overdrive(@active_battler.action.skill)
          @overdrive_scene = nil
          @overdrive_title_done? = false
        end
      end
    when "SEQUENCE"
      unless overdrive_title_update
        unless overdrive_sequence_update
          finish_overdrive(@active_battler.action.skill)
          @overdrive_scene = nil
          @overdrive_title_done? = false
        end
      end
    when "PRESS"
      unless overdrive_title_update
        unless overdrive_press_update
          finish_overdrive(@active_battler.action.skill)
          @overdrive_scene = nil
          @overdrive_title_done? = false
        end
      end
    when "RANDOM"
      unless overdrive_title_update
        finish_overdrive(@active_battler.action.skill)
        @overdrive_scene = nil
        @overdrive_title_done? = false
      end
    when "SLOT INCREASE"
      unless overdrive_title_update
        unless overdrive_slot_increase_update
          finish_overdrive(@active_battler.action.skill)
          @overdrive_scene = nil
          @overdrive_title_done? = false
        end
      end
    when "SLOT EFFECT"
      unless overdrive_title_update
        unless overdrive_slot_effect_update
          finish_overdrive(@active_battler.action.skill)
          @overdrive_scene = nil
          @overdrive_title_done? = false
        end
      end
    else
      @overdrive_scene = nil
    end
  end

  def overdrive_title_update
    @overdrive_title_done = false if @overdrive_title_done.nil?
    if @overdrive_title_done?
      return false
    end
    if @ov_ti_viewport.nil?
      bitmap = Cache.system("Overdrive_Title")
      @ov_ti_viewport = Viewport.new((Graphics.width - bitmap.width) / 2, (Graphics.height - bitmap.height) / 2, bitmap.width, bitmap.height)
      @overdrive_title = Sprite.new(@ov_ti_viewport)
      @overdrive_title.bitmap = bitmap
      @overdrive_title.ox = Graphics.width
      @overdrive_title.z = 1000
    end
    @overdrive_title.update
    pos = Graphics.width - @overdrive_title.width
    if @overdrive_title.ox > pos
      @overdrive_title.ox -= (Graphics.width - pos) / 30
      @overdrive_title.ox = (@overdrive_title.ox, pos).max
    end
    if @overdrive_title.ox == pos
      @overdrive_title.z +=1
    end
    if @overdrive_title.z == 1120
      @overdrive_title.ox -= pos / 30
    end
    if @overdrive_title.ox <= -@overdrive_title.width
      @overdrive_title.dispose
      @overdrive_title = nil
      @ov_ti_viewport = nil
      @overdrive_title_done? = true
    end
    return true
  end

  def overdrive_trigger_update
    if (@overdrive_trigger_hits_number - @overdrive_successes) == 0
      return false
    end
    if @overdrive_failures > 0
      return false
    end
    if @overdrive_trigger_bar.nil?
      @overdrive_trigger_bar = Sprite.new
      bitmap = Cache.system("Overdrive_Trigger_Bar")
      @overdrive_trigger_bar.bitmap = bitmap
      @overdrive_trigger_bar.x = (Graphics.width - bitmap.width) / 2
      @overdrive_trigger_bar.y = (Graphics.height - bitmap.height)
      @overdrive_trigger_bar.z = 1000
    end
    if @overdrive_trigger_cursor.nil?
      @overdrive_trigger_cursor = Sprite.new
      bit_map = Cache.system("Overdrive_Trigger_Cursor")
      @overdrive_trigger_cursor.bitmap = bit_map
      @overdrive_trigger_cursor.x = @overdrive_trigger_bar.x + @overdrive_trigger_bar.width - bit_map.width
      @overdrive_trigger_cursor.y = @overdrive_trigger_bar.y - ( (@overdrive_trigger_bar.height - bit_map.height) / 2 )
      @overdrive_trigger_cursor.z = 1010
    end
    if @overdrive_trigger_hits.nil?
      @overdrive_trigger_hits = []
      for i in 1..@overdrive_trigger_hits_number
        @overdrive_trigger_hits.push(OverdriveHit.new(@overdrive_trigger_bar))
      end
    end
    overdrive_trigger_cursor_move
    if Input.press?(Input::C)
      $input_pause_tm = 20
      overdrive_trigger_hit_process
    end
    return true
  end

  def overdrive_trigger_cursor_move
    move = (@overdrive_trigger_bar.width - @overdrive_trigger_cursor.width) / (60 * (12 - @overdrive_trigger_speed*2))
    minimum = @overdrive_trigger_bar.x + @overdrive_trigger_bar.width - @overdrive_trigger_cursor.width
    maximum = @overdrive_trigger_bar.x
    if @overdrive_trigger_back_and_forth
      if @overdrive_trigger_back?
        @overdrive_trigger_cursor.x += move
        @overdrive_trigger_cursor.x = (@overdrive_trigger_cursor.x, minimum).min
        @overdrive_trigger_back? = false if (@overdrive_trigger_cursor.x == minimum)
      else
        @overdrive_trigger_cursor.x -= move
        @overdrive_trigger_cursor.x = (@overdrive_trigger_cursor.x, maximum).max
        @overdrive_trigger_back? = true if @overdrive_trigger_cursor.x == maximum
      end
    else
      @overdrive_trigger_cursor.x -= move
      @overdrive_trigger_cursor.x = (@overdrive_trigger_cursor.x, maximum).max
      @overdrive_failures += 1 if (@overdrive_trigger_cursor.x == maximum)
    end
  end

  def overdrive_trigger_hit_process
    for hit in @overdrive_trigger_hits
      if hit.in_range?(@overdrive_trigger_cursor.x)
        @overdrive_successes += 1
        hit.success
        return
      end
    end
    @overdrive_failures += 1
  end

  def overdrive_sequence_update
    if @overdrive_sequence_buttons.nil?
      @overdrive_sequence_buttons = @active_battler.action.skill.create_button_sequence
    end
    if @overdrive_successes == @overdrive_sequence_buttons.size
      return false
    end
    if @overdrive_failures > 0
      return false
    end
    if @overdrive_sequence_button_window.nil?
      @overdrive_sequence_button_window = Window_OverdriveSequence.new(@overdrive_sequence_buttons)
    end
    if @overdrive_timer.nil?
      @overdrive_timer = make_overdrive_timer
    end
    @overdrive_sequence_button_window.update
    @overdrive_failures += 1 unless (@overdrive_timer > 0)
    process_overdrive_sequence_input unless (@overdrive_sequence_group.size > 0)
    process_overdrive_sequence_group_input if (@overdrive_sequence_group.size > 0)
  end

  def process_overdrive_sequence_input
    correct = @overdrive_sequence_buttons[@overdrive_successes]
    all = [Input::A, Input::B, Input::C, Input::X, Input::Y, Input::Z, Input::L, Input::R, Input::LEFT, Input::RIGHT, Input::UP, Input::DOWN]
    wrong = all - correct
    for b_wrong in wrong
      if Input.press?(b_wrong)
        @overdrive_failures += 1
        $input_pause_tm = 20
      end
    end
    if Input.press?(correct)
      @overdrive_successes += 1
      $input_pause_tm = 20
    end
  end

  def process_overdrive_sequence_group_input
    all = [Input::A, Input::B, Input::C, Input::X, Input::Y, Input::Z, Input::L, Input::R, Input::LEFT, Input::RIGHT, Input::UP, Input::DOWN]
    for input in all
      if Input.press?(input)
        @overdrive_sequence_group_sequence_buttons.push(input)
        $input_pause_tm = 20
      end
    end
    for skill in @overdrive_sequence_group
      sequence = skill.create_overdrive_sequence
      if @overdrive_sequence_group_sequence_buttons == sequence
        @overdrive_successes = @overdrive_sequence_buttons.size
        @overdrive_skills_to_perform.push(skill)
      end
    end
  end

  def make_overdrive_timer
    skill = @active_battler.action.skill
    skill.note.split(/[\r\n]+).each{|l|
      if l =~ TheMormegil::Regexp::OVERDRIVE_SEQUENCE_TIMEOUT
        @overdrive_timer = $1.to_i
      elsif l =~ TheMormegil::Regexp::OVERDRIVE_PRESS_TIMEOUT
        @overdrive_timer = $1.to_i
      end}
    @overdrive_timer = 300 if @overdrive_timer.nil?
  end

  def overdrive_press_update
    make_overdrive_timer if @overdrive_timer.nil?
    return false if @overdrive_timer == 0
    if @overdrive_press_button.nil?
      @overdrive_press_button = "C"
    end
    if @overdrive_press_background.nil?
      bitmap = Cache.system("Overdrive_Press_Background")
      viewport = Viewport.new( (Graphics.width - bitmap.width) / 2, (Graphics.height - bitmap.height) / 2, bitmap.width, bitmap.height)
      @overdrive_press_background = Sprite.new(viewport)
      @overdrive_press_background.bitmap = bitmap
      @overdrive_press_background.z = 1000
    end
    if @overdrive_press_button_sprite.nil?
      name = "Button/"
      name << @overdrive_press_button
      bitmap = Cache.system(name)
      @overdrive_press_button_sprite = Sprite.new
      @overdrive_press_button_sprite.bitmap = bitmap
      @overdrive_press_button_sprite.z = 1010
      @overdrive_press_button_sprite.x = @overdrive_press_background.x + (@overdrive_press_background.width - @overdrive_press_button_sprite.width) / 2
      @overdrive_press_button_sprite.y = @overdrive_press_background.y + (@overdrive_press_background.height - @overdrive_press_button_sprite.height) / 2
    end
    process_overdrive_press_input
    process_overdrive_press_change_button
    @overdrive_timer -= 1
    return true
  end

  def process_overdrive_press_input
    correct = make_overdrive_press_correct_button
    all = [Input::A, Input::B, Input::C, Input::X, Input::Y, Input::Z, Input::L, Input::R, Input::LEFT, Input::RIGHT, Input::UP, Input::DOWN]
    wrong = all - correct
    for b_wrong in wrong
      if Input.trigger?(b_wrong)
        @overdrive_successes -= 1 if @overdrive_press_wrong_decreases
        @overdrive_successes = 0 if @overdrive_press_wrong_cancels
        Audio.se_play("Shot3", 100, 150)
      end
    end
    if Input.trigger?(correct)
      @overdrive_successes += 1 if @overdrive_successes < @overdrive_max_successes
      Audio.se_play("Shot2", 100, 150)
    end
  end

  def make_overdrive_press_correct_button
    case @overdrive_press_button.upcase
    when "A"
      return Input::A
    when "B"
      return Input::B
    when "C"
      return Input::C
    when "X"
      return Input::X
    when "Y"
      return Input::Y
    when "Z"
      return Input::Z
    when "L"
      return Input::L
    when "R"
      return Input::R
    when "LEFT"
      return Input::LEFT
    when "RIGHT"
      return Input::RIGHT
    when "UP"
      return Input::UP
    when "DOWN"
      return Input::DOWN
    else
      return Input::C
    end
  end

  def process_overdrive_press_change_button
    return unless @overdrive_press_change_frames.size > 0
    for i in 0..(@overdrive_press_change_frames.size - 1)
      if @overdrive_timer == @overdrive_press_change_frames[i]
        @overdrive_press_button = @overdrive_press_change_buttons[i]
      end
    end
  end

  def overdrive_slot_increase_update
    if (@overdrive_successes + @overdrive_failures) == @overdrive_slots + 1
      return false
    end
    if (@overdrive_successes + @overdrive_failures) == @overdrive_slots
      @overdrive_slot_machine.terminate
      @overdrive_slot_machine = nil
      @overdrive_successes += 1
      return false
    end
    if @overdrive_slot_machine.nil?
      @overdrive_slot_machine = Slot_Machine.new(@overdrive_slots, nil, @overdrive_slot_increase_win_chances, @overdrive_slot_increase_lose_chances)
    end
    @overdrive_slot_machine.update
    if Input.trigger?(Input::C)
      process_slot_increase_input
    end
    return true
  end

  def process_slot_increase_input
    n = @overdrive_successes + @overdrive_failures
    @overdrive_slot_machine.display(n)
    case @overdrive_slot_machine.result?(n)
    when 0
      @overdrive_successes += 1
    when 1
      @overdrive_failures += 1
    end
  end

  def overdrive_slot_effect_update
    if @overdrive_successes == @overdrive_slots + 1
      return false
    end
    if @overdrive_successes == @overdrive_slots
      determinate_overdrive_slot_effect_results
      @overdrive_slot_machine.terminate
      @overdrive_slot_machine = nil
      @overdrive_successes += 1
      return false
    end
    if @overdrive_slot_machine.nil?
      @overdrive_slot_machine = Slot_Machine.new(@overdrive_slots, @overdrive_slot_effect_chances, 0, 0)
    end
    @overdrive_slot_machine.update
    if Input.trigger?(Input::C)
      process_slot_effect_input
    end
  end

  def determinate_overdrive_slot_effect_results
   
  end

  def process_slot_effect_input(i)
    @overdrive_slot_machine.display(n)
    @overdrive_successes += 1
  end

    # Consume Overdrive

  def pay_overdrive_cost(user, skill)
    return unless user.actor?
    return unless skill.overdrive?
    cost = skill.overdrive_level * 100
    user.overdrive.lose(cost)
    @overdrive_gauge_window.update
  end

  def process_consumable_overdrive_cost(skill)
    lines = skill.note.split(/[\r\n]+/)
    for l in lines
      if l =~ TheMormegil::Regexp::OVERDRIVE_CONSUMABLE
        consumable = true
      elsif l =~ TheMormegil::Regexp::OVERDRIVE_CONSUMABLE_ITEM
        item = $data_items[$1.to_i]
      elsif l =~ TheMormegil::Regexp::OVERDRIVE_CONSUMABLE_ARMOR
        item = $data_armors[$1.to_i]
      elsif l =~ TheMormegil::Regexp::OVERDRIVE_CONSUMABLE_WEAPON
        item = $data_weapons[$1.to_i]
      elsif l =~ TheMormegil::Regexp::OVERDRIVE_CONSUMABLE_QUANTITY
        @overdrive_consume_q = $1.to_i if @overdrive_consume_q.nil?
      elsif l =~ TheMormegil::Regexp::OVERDRIVE_CONSUMABLE_RANDOM
        min = $1.to_i
        max = $1.to_i
        @overdrive_consume_q = rand(max-min) + min if @overdrive_consume_q.nil?
      end
    end
    return unless consumable
    return if item.nil?
    for i in 1..@overdrive_consume_q
      perform_consume_item(item)
    end
  end

  def check_consumable_cost(skill)
    lines = skill.note.split(/[\r\n]+/)
    for l in lines
      if l =~ TheMormegil::Regexp::OVERDRIVE_CONSUMABLE
        consumable = true
      elsif l =~ TheMormegil::Regexp::OVERDRIVE_CONSUMABLE_ITEM
        item = $data_items[$1.to_i]
      elsif l =~ TheMormegil::Regexp::OVERDRIVE_CONSUMABLE_ARMOR
        item = $data_armors[$1.to_i]
      elsif l =~ TheMormegil::Regexp::OVERDRIVE_CONSUMABLE_WEAPON
        item = $data_weapons[$1.to_i]
      elsif l =~ TheMormegil::Regexp::OVERDRIVE_CONSUMABLE_QUANTITY
        @overdrive_consume_q = $1.to_i
      elsif l =~ TheMormegil::Regexp::OVERDRIVE_CONSUMABLE_RANDOM
        min = $1.to_i
        max = $1.to_i
        @overdrive_consume_q = rand(max-min) + min
      end
    end
    return unless consumable
    return if item.nil?
    return ($game_party.item_number(item) >= @overdrive_consume_q)
  end
   
    # Use Reaction Overdrives

  def perform_reaction_overdrive(user)
    flag = user.overdrive.reaction_flag
    return if flag.nil?
    user.set_skill(flag)
    return if atb?
    last_active = @active_battler
    last_battler = @selected_battler
    @selected_battler = user
    @active_battler = user
    last_instant = skill.instant
    skill.instant = true
    perform_instant_action
    @selected_battler = last_battler
    @active_battler = last_active
    skill.instant = last_instant
    user.overdrive.reaction_flag = nil
  end

end


First part. Most of the main script here.

**
Rep:
Level 75
RMRK Junior
Code: [Select]
class OverdriveHit < Sprite

  def initialize(bar)
    rect = Rect.new(bar.x, bar.y, bar.width, bar.height)
    @view = Viewport.new(rect)
    super(@view)
    bitmap = Cache.system("Overdrive_Trigger_Hit")
    self.src_rect.set(0, 0, bitmap.width / 2, bitmap.height)
    self.bitmap = bitmap
    self.x = randomize_position
    self.y = bar.y
  end

  def randomize_position
    unless $scene.is_a?(Scene_Battle)
      return 0
    end
    if $scene.overdrive_trigger_back_and_forth
      finish = $scene.overdrive_trigger_bar.x + $scene.overdrive_trigger_bar.width - self.width
    else
      finish = $scene.overdrive_trigger_bar.x + ($scene.overdrive_trigger_bar.width / 2) - self.width
    end
    start = $scene.overdrive_trigger_bar.x
    while true do
      pos = rand(finish - start)
      break if check_other_successes(pos)
    end
    return pos
  end

  def check_other_successes(start)
    end = start + self.width
    for hit in $scene.overdrive_trigger_hits
      if hit.in_range?(start)
        return false
      elsif hit.in_range?(end)
        return false
      end
    end
    return true
  end 

  def in_range?(n)
    a = self.x
    b = a + self.width
    return (n > a && n < b))
  end

  def success
    self.src_rect.x = self.bitmap.width / 2
    play_success_animation
  end

  def play_success_animation
    Audio.se_play("Flash2", 100, 150)
    self.flash(Color.new(40, 40, 255, 255), 15)
  end

end

class Window_OverdriveSequence

  def initialize(buttons)
    @viewport = Viewport.new(0, (Graphics.height - back_bitmap.height) / 2, Graphics.width, back_bitmap.height)
    @background = Sprite.new(@viewport)
    back_bitmap = Cache.system("Overdrive_Sequence_Background")
    @background.bitmap = back_bitmap
    @background.z = 1000
    @button_sprites = []
    n = buttons.size
    for i in 0..(n-1)
      button = Sprite.new(@viewport)
      name = "Buttons/"
      name << buttons[i]
      button.bitmap = Cache.system(name)
      button.x = ( (Graphics.width - n*button.width) / (n + 5) ) * (i + 3) + (i*button.width)
      button.y = @background.y + (@background.height - button.height) / 2
      button.z = 1010
      @button_sprites.push(button)
    end
    @successes = 0
  end
  alias new initialize

  def update
    super
    return unless $scene.is_a?(Scene_Battle)
    if $scene.overdrive_sequence_show_correct
      return if @successes == $scene.overdrive_successes
      for i in 0..(@successes-1)
        @button_sprites[i].dispose unless @button_sprites[i].is_a?(Integer)
        @button_sprites[i] = 1
      end
      @viewport.flash(Color.new(255, 255, 255, 255), 20)
      Audio.se_play("Flash2", 100, 150)
      n = @button_sprites.size - @successes
      for i in @successes..(@button_sprites.size-1)
        w = @button_sprites[i].width
        @button_sprites[i].x = ( (Graphics.width - n*w) / (n + 5) ) * (i + 3) + (i*w)
      end
      @successes = $scene.overdrive_successes
    end
  end

end

class Slot_Machine

  def initialize(slots, chances, wins = 0, losses = 0)
    @slots = ((slots, 3).max, 9).min
    @wins = wins
    @losses = losses
    if chances.is_a?(Integer)
      @chances = ((chances, 3).max, 10).min
    else
      @chances = 2
    end
    start_slot_machine_structure
    update
  end
  alias new initialize

  def start_slot_machine_structure
    bitmap_base = create_base_bitmap
    viewport_base = Viewport.new( (Graphics.width - bitmap_base.width)/2, (Graphics.height - bitmap_base.height)/2, bitmap_base.width, bitmap_base.height)
    @sprite_base = Sprite.new(viewport_base)
    @sprite_base.bitmap = bitmap_base
    @sprite_base.z = 1000
    @bitmap_chances = create_bitmap_chances
    a = @bitmap_chances.height/(@chances+3) + @bitmap_chances.height/((@chances+3)*4)
    @indexes = []
    @stopped_slots = []
    @results = []
    for i in 1..@slots
      @indexes.push(a)
      @stopped_slots.push(false)
      @results.push(nil)
    end
    chance_rect = create_chance_rectangle(@indexes[0])
    case @slots
    when 3
      space_between = (@sprite_base.bitmap.width - (chance_rect.width*@slots) ) / 4
      space_before = space_between
    when 4
      space_between = (@sprite_base.bitmap.width - (chance_rect.width*@slots) ) / 7
      space_before = space_between + (chance_rect.width + space_between)*2/3
    when 5
      space_between = (@sprite_base.bitmap.width - (chance_rect.width*@slots) ) / 7
      space_before = space_between + (chance_rect.width + space_between)/3
    when 6
      space_between = (@sprite_base.bitmap.width - (chance_rect.width*@slots) ) / 7
      space_before = space_between
    when 7
      space_between = (@sprite_base.bitmap.width - (chance_rect.width*@slots) ) / 10
      space_before = space_between + (chance_rect.width + space_between)*2/3
    when 8
      space_between = (@sprite_base.bitmap.width - (chance_rect.width*@slots) ) / 10
      space_before = space_between + (chance_rect.width + space_between)/3
    when 9
      space_between = (@sprite_base.bitmap.width - (chance_rect.width*@slots) ) / 10
      space_before = space_between
    end
    h_ = (@sprite_base.bitmap.height-chance_rect.height)/2
    @sprite_slot_array = []
    for i in 1..@slots
      v = Viewport.new(space_before + (i-1)*(chance_rect.width+space_between), h_, chance_rect.width, chance_rect.height)
      s = Sprite.new(v)
      s.bitmap = @bitmap_chances
      s.src_rect = chance_rect
      s.z = 1010
      @sprite_slot_array.push(s.clone)
    end
    @speed = [4, 6, 8]
  end

  def create_base_bitmap
    case @slots
    when 3
      bit = Cache.system("Slot_Machine_Base_3")
    when 4..6
      bit = Cache.system("Slot_Machine_Base_4to6")
    when 7..9
      bit = Cache.system("Slot_Machine_Base_7to9")
    end
    return bit
  end

  def create_bitmap_chances
    bit = Cache.system("Slot_Machine_Chances")
    h = bit.height / 10
    if @chances == 2
      @chances = @wins + @losses
      bitmap = Bitmap.new(bit.width, (@chances+3) * h)
      arr = []
      temp_wins = @wins
      temp_losses = @losses
      for i in 1..@chances
        r = rand(2)
        if r == 0
          if temp_wins > 0
            arr.push(0)
            temp_wins -= 1
          else
            arr.push(1)
            temp_losses -= 1
          end
        else
          if temp_losses > 0
            arr.push(1)
            temp_losses -= 1
          else
            arr.push(0)
            temp_wins -= 1
          end
        end
      end
      for i in 0..(@chances-1)
        rect = Rect.new(0, arr[i]*h, bit.width, h)
        bitmap.blt(0, i*h, bit, rect)
      end
      rect2 = Rect.new(0, 0, bit.width, 3*h)
      bitmap.blt(0, @chances * h, bitmap.clone, rect2)
    else
      @wins = 0
      @losses = 0
      bitmap = Bitmap.new(bit.width, (@chances+3) * h)
      rect = Rect.new(0, 0, bit.width, @chances * h)
      bitmap.blt(0, 0, bit, rect)
      rect2 = Rect.new(0, 0, bit.width, 3 * h)
      bitmap.blt(0, @chances * h, bitmap.clone, rect2)
    end
    return bitmap
  end

  def create_chance_rectangle(index)
    h = @bitmap_chances.height/(@chances+3)
    rect = Rect.new(0, index, @bitmap_chances.width, h*5/2)
    return rect
  end

  def update
    update_indexes
    for i in 0..(@slots-1)
      @sprite_slot_array[i].update
      next if @stopped_slots[i]
      @sprite_slot_array[i].src_rect = create_chance_rectangle(@indexes[i])
      @sprite_slot_array[i].update
    end
    @sprite_base.update
  end

  def update_indexes
    for i in 0..(@slots-1)
      next if @stopped_slots[i]
      case i
      when 0..2
        @indexes[i] += @speed[0] + i
        @indexes[i] %= ((@bitmap_chances.height / (@chances+3)) * @chances)
      when 3..5
        @indexes[i] += @speed[1] + i
        @indexes[i] %= ((@bitmap_chances.height / (@chances+3)) * @chances)
      when 6..8
        @indexes[i] += @speed[2] + i
        @indexes[i] %= ((@bitmap_chances.height / (@chances+3)) * @chances)
    end
  end

  def display(number)
    n = number - 1
    @stopped_slots[n] = true
    index = @indexes[n]
    @sprite_slot_array[n].flash(Color.new(255, 255, 255, 255), 10)
    Audio.play_se("Chime2", 100, 120)
    h = @bitmap_chances.height / (@chances+3)
    result = index / h
    if (@wins + @losses) == @chances
      display____(result)
      return
    end
    @results.push(n, result)
    if result < 1
      @indexes[n] = @chances*h - h*3/4
    else
      @indexes[n] = result*h - h*3/4
    end
  end

  def display____(n, result)
    if result < @wins
      results.push(0)
      @indexes[n] = h/4
    else
      results.push(1)
      @indexes[n] = @wins*h - h*3/4
    end
  end

  def result?(n)
    return unless @stopped_slots[n]
    return @results(n)
  end

  def terminate
    @sprite_base.bitmap.dispose
    @sprite_base.dispose
    @sprite_base = nil
    @bitmap_chances.dispose
    @bitmap_chances = nil
    while (@sprite_slot_array.size > 0)
      sprite = @sprite_slot_array.pop
      sprite.bitmap.dispose
      sprite.dispose
      sprite = nil
    end
    @sprite_slot_array = nil
  end

end

class Game_Battler

  def overdrive_gain(actor, type, q)
    return if TheMormegil::Overdrive_System::NO_OVERDRIVE
    return unless actor.actor?
    actor_type = actor.overdrive.type
    for t in actor_type
      if t.upcase =~ type.upcase
        continue = true
      end
    end
    return unless continue
    case type.upcase
    when "STOIC"
      max = actor.maxhp
      total = (q / max) * (actor.overdrive.max)
      actor.overdrive.gain(total)
    when "WEAK"
      max = actor.maxhp
      total = (q / max) * (actor.overdrive.max)
      actor.overdrive.lose(total / 2)
    when "COMRADE"
      comrades = []
      for a in $game_party.members
        next if a == actor
        comrades.push(a)
      end
      max = 0
      for c in comrades
        max += c.maxhp
      end
      total = (q / max) * (actor.overdrive.max)
      actor.overdrive.gain(total)
    when "AFRAID"
      comrades = []
      for a in $game_party.members
        next if a == actor
        comrades.push(a)
      end
      max = 0
      for c in comrades
        max += c.maxhp
      end
      total = (q / max) * (actor.overdrive.max)
      actor.overdrive.lose(total / 2)
    when "STRIKER"
      targets = actor.action.make_targets
      rate = 0
      max = 0
      for t in targets
        rate = t.maxhp if (rate < t.maxhp)
        max += t.maxhp
      end
      rate /= actor.maxhp
      rate = 5 if (rate > 5)
      total = (q / max) * rate * (actor.overdrive.max)
      actor.overdrive.gain(total / 2)
    when "PACIFIST"
      targets = actor.action.make_targets
      rate = 0
      max = 0
      for t in targets
        rate = t.maxhp if (rate < t.maxhp)
        max += t.maxhp
      end
      rate /= actor.maxhp
      total = (q / max) * rate * (actor.overdrive.max)
      actor.overdrive.lose(total / 4)
    when "HEALER"
      targets = actor.action.make_targets
      max = 0
      for t in targets
        max += t.maxhp
      end
      total = (q / max) * (actor.overdrive.max)
      actor.overdrive.gain(total / 4)
    when "SADIST"
      targets = actor.action.make_targets
      max = 0
      for t in targets
        max += t.maxhp
      end
      total = (q / max) * (actor.overdrive.max)
      actor.overdrive.lose(total / 8)
    when "TACTICIAN"
      total = (q / 100) * (actor.overdrive.max) * 15
      actor.overdrive.gain(total)
    when "BRUTAL"
      total = (q / 100) * (actor.overdrive.max) * 15
      actor.overdrive.lose(total / 2)
    when "SLAYER"
      total = (q / 100) * (actor.overdrive.max) * 15
      actor.overdrive.gain(total)
    when "ANIMIST"
      total = (q / 100) * (actor.overdrive.max) * 15
      actor.overdrive.lose(total / 2)
    when "AVENGER"
      total = (q / 100) * (actor.overdrive.max) * 15
      actor.overdrive.gain(total)
    when "COWARD"
      total = (q / 100) * (actor.overdrive.max) * 15
      actor.overdrive.lose(total / 2)
    when "EVADER"
      total = (q / 100) * (actor.overdrive.max) * 15
      actor.overdrive.gain(total)
    when "BERSERKER"
      total = (q / 100) * (actor.overdrive.max) * 15
      actor.overdrive.lose(total / 2)
    end
  end

  alias add_st_pl_ov_gain added_states_plus
  def added_states_plus(id)
    last_added_states = @added_states
    add_st_pl_ov_gain(id)
    states_to_gain = @added_states - last_added_states
    return if !$scene.is_a?(Scene_Battle)
    overdrive_gain($scene.active_battler, "TACTICIAN", states_to_gain.size)
    overdrive_gain($scene.active_battler, "BRUTAL", states_to_gain.size)
  end

  alias add_state_overdrive add_state
  def add_state(id)
    if $scene.is_a?(Scene_Battle)
      return if $scene.overdrive_nullify_effects
      if $scene.overdrive_percent_effects
        r = rand(100)
        t = ($scene.overdrive_successes*100) / ($scene.overdrive_successes + $scene.overdrive_failures)
        return if r < t
      end
    end
    add_state_overdrive(id)
  end

  alias calc_overdrive_hit calc_hit
  def calc_hit(user, obj = nil)
    hit = calc_overdrive_hit(user, obj)
    if $scene.is_a?(Scene_Battle)
      if $scene.overdrive_percent_hit
        hit *= $scene.overdrive_successes
        hit /= ($scene.overdrive_successes + $scene.overdrive_failures)
      end
    end
    return hit
  end

  alias execute_overdrive_damage execute_damage
  def execute_damage(user)
    scene = $scene.is_a?(Scene_Battle)
    half = false
    percent = false
    half = $scene.overdrive_half if scene
    percent = $scene.overdrive_percent_damage if scene
    $game_temp.hp_damage_inflate = 100 if $game_temp.hp_damage_inflate == nil
    $game_temp.mp_damage_inflate = 100 if $game_temp.mp_damage_inflate == nil
    ### Half
    if half
      $game_temp.hp_damage_inflate /= 2
      $game_temp.mp_damage_inflate /= 2
    end
    ### Percent
    if percent
      rate = $scene.overdrive_successes / ($scene.overdrive_successes + $scene.overdrive_failures)
      $game_temp.hp_damage_inflate *= rate
      $game_temp.mp_damage_inflate *= rate
    end
    last_hp_damage = @hp_damage
    last_mp_damage = @mp_damage
    @hp_damage = @hp_damage * $game_temp.hp_damage_inflate / 100
    @mp_damage = @mp_damage * $game_temp.mp_damage_inflate / 100
    @hp_damage = apply_damage_wall(@hp_damage, :hp)
    @mp_damage = apply_damage_wall(@mp_damage, :mp)
    if $scene.is_a?(Scene_Battle)
      damage = @hp_damage + @mp_damage
      if damage > 0
        overdrive_gain($scene.active_battler, "STRIKER", damage)
        overdrive_gain($scene.active_battler, "PACIFIST", damage)
      else
        overdrive_gain($scene.active_battler, "HEALER", damage)
        overdrive_gain($scene.active_battler, "SADIST", damage)
      end
      if actor?
        overdrive_gain(self, "STOIC", damage)
        overdrive_gain(self, "WEAK", damage)
        other_members = $game_party.members - self
        for member in other_members
          overdrive_gain(member, "COMRADE", damage)
          overdrive_gain(member, "AFRAID", damage)
        end
      end
    end
    @hp_damage = last_hp_damage
    @mp_damage = last_mp_damage
    execute_overdrive_damage(user)
  end

  alias att_eff_ov_gain attack_effect
  alias ski_eff_ov_gain skill_effect
  alias ite_eff_ov_gain item_effect

  def attack_effect(attacker)
    att_eff_ov_gain(attacker)
    if @evaded == true && actor?
      overdrive_gain(self, "EVADER", 1)
      overdrive_gain(self, "BERSERKER", 1)
    end
  end

  def skill_effect(user, skill)
    ski_eff_ov_gain(user, skill)
    if @evaded == true && actor?
      overdrive_gain(self, "EVADER", 1)
      overdrive_gain(self, "BERSERKER", 1)
    end
  end

  def item_effect(user, item)
    ite_eff_ov_gain(user, item)
    if @evaded == true && actor?
      overdrive_gain(self, "EVADER", 1)
      overdrive_gain(self, "BERSERKER", 1)
    end
  end

  alias perform_collapse_ov_gain perform_collapse
  def perform_collapse
    perform_collapse_ov_gain
    if @collapse && $scene.is_a?(Scene_Battle)
      overdrive_gain($scene.active_battler, "SLAYER", 1) if $scene.active_battler.actor?
      overdrive_gain($scene.active_battler, "ANIMIST", 1) if $scene.active_battler.actor?
      if actor?
        for member in $game_party.members
          next if member.dead?
          overdrive_gain(member, "AVENGER", 1)
          overdrive_gain(member, "AFRAID", 1)
        end
      end
    end
  end

  def no_overdrive?
    return true
  end

end

class Game_Actor < Game_Battler

  attr_accessor    :overdrive

  alias overdrive_setup setup
  def setup(id)
    overdrive_setup(id)
    @overdrive = Overdrive.new(self.id)
  end

  alias level_up_with_overdrive level_up
  def level_up
    level_up_with_overdrive
    @overdrive.determinate_max
  end

  def bypass_overdrive_cost?
    return true if self.hp < TheMormegil::Overdrive_System::LIMIT_BREAK
    for state in self.states
      state.note.split(/[\r\n]+/).each{|l|
        if l =~ TheMormegil::Regexp::OVERDRIVE_STATUS_AURA
          return true
        end}
    end
    return false
  end

  alias skill_can_use_overdrive_system_alias skill_can_use?
  def skill_can_use?(skill)
    result = skill_can_use_overdrive_system_alias(skill)
    if skill.overdrive?
      unless @overdrive.maxed?
        unless bypass_overdrive_cost?
          result = false
        end
      end
      if $scene.is_a?(Scene_Battle)
        unless $scene.check_consumable_cost(skill)
          result = false
        end
      end
      for state in @states
        state.note.split(/[\r\n]+/).each{|l|
          if l =~ TheMormegil::Regexp::OVERDRIVE_STATUS_CURSE
            result = false
          end}
      end
    end
    return result
  end

  def no_overdrive?
    return false unless @overdrive == nil
    super
  end

end

class Overdrive

  attr_accessor    :type
  attr_reader      :n
  attr_reader      :max
  attr_reader      :reaction_flag

  def initialize(actor)
    @actor_id = actor
    @type = TheMormegil::Overdrive_System::OVERDRIVE_ACTOR_HASH[actor]
    @n = 0
    @max = 0
    @status = 100
    determinate_max
  end

  def determinate_max
    for skill in $game_actors[@actor_id].skills
      if skill.overdrive_level > @max / 100
        @max = skill.overdrive_level * 100
      end
    end
  end

  def gain(x)
    r = TheMormegil::Overdrive_System::OVERDRIVE_RATE
    r_ = TheMormegil::Overdrive_System::OVERDRIVE_RATE_ACTOR_HASH[@actor_id]
    x *= r / 100 unless r.nil?
    x *= r_ / 100 unless r.nil?
    status?
    x *= @status / 100
    @n += x
    if @n > @max
      @n = @max
    end
    if @n < 0
      @n = 0
    end
    if @n == @max
      reaction
    end
  end

  def lose(x)
    self.gain(-x)
  end

  def percent(x)
    @n *= x / 100
    if @n > @max
      @n = @max
    end
    if @n < 0
      @n = 0
    end
    if @n == @max
      reaction
    end
  end

  def reaction
    for skill in $game_actors[@actor_id].skills
      if skill.overdrive_reaction?
        @reaction_flag = skill.id
      end
    end
  end

  def status?
    @status = 100
    for status in $game_actors[@actor_id].states
      status.note.split(/[\r\n]+/).each{|line|
        if line =~ TheMormegil::Regexp::OVERDRIVE_STATUS
        @status *= $1.to_i / 100
        end}
    end
  end

  def maxed?
    return (@n == @max)
  end

end

module RPG
  class Skill
    def overdrive?
      self.note.split(/[\r\n]+/).each {|line|
        if line =~ TheMormegil::Regexp::OVERDRIVE
          return true
        end}
      return false
    end

    def overdrive_level
      unless self.overdrive?
        return 0
      end
      self.note.split(/[\r\n]+/).each {|line|
        if line =~ TheMormegil::Regexp::OVERDRIVE_LEVEL
          return $1.to_i
        end}
      return 1
    end

    def overdrive_type
      unless self.overdrive?
        return
      end
      self.note.split(/[\r\n]+/).each {|line|
        if line =~ TheMormegil::Regexp::OVERDRIVE_TYPE
          case $1.downcase
          when "trigger" or "sequence" or "consumable" or "press" or "random" or "slot effect" or "slot increase"
            return $1
          end
        end}
      return "normal"
    end

    def overdrive_reaction?
      self.note.split(/[\r\n]+/).each {|line|
        if line =~ TheMormegil::Regexp::OVERDRIVE_REACTION
          return true
        end}
      return false
    end

    def create_overdrive_sequence
      array = []
      self.note.split(/[\r\n]+/).each {|line|
        if line =~ TheMormegil::Regexp::OVERDRIVE_SEQUENCE_BUTTON
          case $1.upcase
          when "A"
            array.push(Input::A)
          when "B"
            array.push(Input::B)
          when "C"
            array.push(Input::C)
          when "X"
            array.push(Input::X)
          when "Y"
            array.push(Input::Y)
          when "Z"
            array.push(Input::Z)
          when "L"
            array.push(Input::L)
          when "R"
            array.push(Input::R)
          when "UP"
            array.push(Input::UP)
          when "DOWN"
            array.push(Input::DOWN)
          when "LEFT"
            array.push(Input::LEFT)
          when "RIGHT"
            array.push(Input::RIGHT)
          end
        end}
      return array
    end

  end
end

module TheMormegil
  module Regexp

OVERDRIVE = /<<overdrive>>/i

OVERDRIVE_TYPE = /\+\s*?type\:\s*?(\w*?|\w*?\s\w*?)/i

OVERDRIVE_TRIGGER_BACK_AND_FORTH = /\+\s*?trigger\:\s*?back\sand\sforth/i
OVERDRIVE_TRIGGER_SPEED = /\+\s*?trigger\:\s*?speed\s*?(\d+?)/i
OVERDRIVE_TRIGGER_TIMES = /\+\s*?trigger\:\s*?times\s*?(\d+?)/i
OVERDRIVE_TRIGGER_NOTHING = /\+\s*?trigger\:\s*?nothing/i
OVERDRIVE_TRIGGER_HALF = /\+\s*?trigger\:\s*?half\sdamage/i
OVERDRIVE_TRIGGER_PERCENT_DAMAGE = /\+\s*?trigger\:\s*?percentage\sdamage/i
OVERDRIVE_TRIGGER_NO_EFFECTS = /\+\s*?trigger\:\s*?no\seffects/i
OVERDRIVE_TRIGGER_PERCENT_EFFECTS = /\+\s*?trigger\:\s*?percentage\seffects/i

OVERDRIVE_SEQUENCE_BUTTON = /\+\s*?sequence\:\s*?(\w+?)\s*?button/i
OVERDRIVE_SEQUENCE_HIDE = /\+\s*?sequence\:\s*?hide\ssequence/i
OVERDRIVE_SEQUENCE_ANY_OF = /\+\s*?sequence\:\s*?any\sof\s*?(\w+?)/i
OVERDRIVE_SEQUENCE_TIMEOUT = /\+\s*?sequence\:\s*?timeout\s*?(\d+?)/i
OVERDRIVE_SEQUENCE_SHOW_CORRECT = /\+\s*?sequence\:\s*?show\scorrect/i

OVERDRIVE_CONSUMABLE = /\+\s*?addon\:\s*?consumable/i
OVERDRIVE_CONSUMABLE_ITEM = /\+\s*?consumable\:\s*?item\s*?(\d+?)/i
OVERDRIVE_CONSUMABLE_ARMOR = /\+\s*?consumable\:\s*?armor\s*?(\d+?)/i
OVERDRIVE_CONSUMABLE_WEAPON = /\+\s*?consumable\:\s*?weapon\s*?(\d+?)/i
OVERDRIVE_CONSUMABLE_QUANTITY = /\+\s*?consumable\:\s*?quantity\s*?(\d+?)/i
OVERDRIVE_CONSUMABLE_RANDOM = /\+\s*?consumable\:\s*?random\s*?(\d+?)/i

OVERDRIVE_PRESS_BUTTON = /\+\s*?press\:\s*?(\w+?)/i
OVERDRIVE_PRESS_TIMEOUT = /\+\s*?press\:\s*?timeout\s*?(\d+?)/i
OVERDRIVE_PRESS_CHANGE_BUTTON = /\+\s*?press\:\s*?change\s*?(\w+?)\s*?button/i
OVERDRIVE_PRESS_MAX = /\+\s*?press\:\s*?max\s*?(\d+?)/i
OVERDRIVE_PRESS_WRONG_CANCELS = /\+\s*?press\:\s*?wrong\scancels/i
OVERDRIVE_PRESS_WRONG_DECREASES = /\+\s*?press\:\s*?wrong\sdecreases/i

OVERDRIVE_RANDOM_SKILL = /\+\s*?random\:\s*?(d+?)/i
OVERDRIVE_RANDOM_CAST = /\+\s*?random\:\s*?cast\s*?(d+?)/i
OVERDRIVE_RANDOM_CHANCE = /\+\s*?random\:\s*?chance\s*?(\d+?),\s*?(\d+?)/i
OVERDRIVE_RANDOM_COST_ON = /\+\s*?random\:\s*?cost\son/i

OVERDRIVE_SLOT_EFFECT_SLOTS = /\+\s*?slot\seffect\:\s*?(\d+?)\s*?slots/i
OVERDRIVE_SLOT_EFFECT_CHANCE = /\+\s*?slot\seffect\:\s*?(\d+?)\s*?chance/i
OVERDRIVE_SLOT_EFFECT_BASE = /\+\s*?slot\seffect\:\s*?base\s*?(\d+?)/i
OVERDRIVE_SLOT_EFFECT_REQUISITE = /\+\s*?slot\seffect\:\s*?(\d+?)\s*?(\d+?)\s*?(\d+?)/i

OVERDRIVE_SLOT_INCREASE_SLOTS = /\+\s*?slot\sincrease\:\s*?(\d+?)\s*?slots/i
OVERDRIVE_SLOT_INCREASE_LOSE_CHANCE = /\+\s*?slot\sincrease\:\s*?lose\schance\s*?(\d+?)/i
OVERDRIVE_SLOT_INCREASE_WIN_CHANCE = /\+\s*?slot\sincrease\:\s*?win\schance\s*?(\d+?)/i
OVERDRIVE_SLOT_INCREASE_PERCENT_DAMAGE = /\+\s*?slot\sincrease\:\s*?precentage\sdamage/i
OVERDRIVE_SLOT_INCREASE_PERCENT_EFFECTS = /\+\s*?slot\sincrease\:\s*?percentage\seffects/i
OVERDRIVE_SLOT_INCREASE_PERCENT_HIT = /\+\s*?slot\sincrease\:\s*?percentage\shit/i
OVERDRIVE_SLOT_INCREASE_NOTHING = /\+\s*?slot\sincrease\:\s*?nothing/i

OVERDRIVE_REACTION = /\+\s*?overdrive\sreaction/i

OVERDRIVE_LEVEL = /\+\s*?overdrive\slevel\s*?(\d+?)/i

OVERDRIVE_STATUS = /<overdrive\s*?(\d+?)\%>/i
OVERDRIVE_STATUS_AURA = /<overdrive\!>/i
OVERDRIVE_STATUS_CURSE = /<no\soverdrive>/i

OVERDRIVE_ITEM_PLUS = /<overdrive\s*?\+(\d+?)>/i
OVERDRIVE_ITEM_MINUS = /<overdrive\s*?\-(\d+?)>/i
OVERDRIVE_ITEM_PERCENT = /<overdrive\s*?(\d+?)\%>/i

  end

  $input_pause_tm = 0
end

module Input

  alias update_with_tm_pause update
  alias trigger_with_tm_pause trigger?
  alias press_with_tm_pause press?
  alias repeat_with_tm_pause repeat?

  def trigger?(button)
    if $input_pause_tm
      return false
    else
      return trigger_with_tm_pause(button)
    end
  end

  def press?(button)
    if $input_pause_tm
      return false
    else
      return press_with_tm_pause(button)
    end
  end

  def repeat?(button)
    if $input_pause_tm
      return false
    else
      return repeat_with_tm_pause(button)
    end
  end

  def update
    if $input_pause_tm > 0
      $input_pause_tm -= 1
    end
    update_with_tm_pause
  end

end


Second part. Place right under the first part.

**
Rep: +0/-0Level 78
RMRK Junior
How about  a demo? I feel dizzy with the script only (sorry).  ;D

**
Rep:
Level 75
RMRK Junior
Yeah, I would make a demo, but without the proper images, the only thing you'll have would be an error message. So... have you got an artist working on your project?

***
Rep:
Level 76
~Crazy Lazy Workaholic~
What kind of images are needed? I know lots of people will be interested in this and if you need some basic HUD stuff, I can do that. I just need to know the kind of format you need for the images you request.

~My Projects~

~ VocaloidVX ~ Second Life Project ~
~ RPG Maker Collective ~
To support this forum, it's the first place that will gets posted some updates of mine, check it out ^_~

**
Rep:
Level 75
RMRK Junior
 ;D

Ok, so these are the images:

"Overdrive_Title"
A title. Width is Graphics width, height as you wish. It enters from the right and desappears from the left. Easy as that. Generic title, like "Overdrive!!!" or something.

"Overdrive_Trigger_Bar"
It's a bar. Width is Graphics width. Height as you wish (will be centered). Something like Squall's Limit bar.

"Overdrive_Trigger_Cursor"
The cursor that goes back and forth on the bar itself. Do it so that if you place it with the right border on the end of the screen, the pointer will be at the start of the bar itself, and same on the left end too (mirrored, of course).

"Overdrive_Trigger_Hit"
This is a target to be placed on the bar itself. Do it so that if I place it at the same height of the bar, the target will be on the bar itself. Can be as easy as a colored rectangle. In the same file, make two of these side by side, one darker (or else, you choose) for when you actually hit it.
Pathetic Mockup:
_____________  _____________
|                      ||                       |
|                      ||                       |
|                      ||                       |
|                      ||                       |
|____________||_____________|

"Overdrive_Press_Background"
A big image that will be centered, working as background, with a big blank space in the middle where you can place a button image (see below). On top of the button, something like "Press this button fast!"


"Overdrive_Sequence_Background"
Same as above, just with width equal to Graphics width and a different instruction ("Press these buttons!" or something)

"Slot_Machine_Chances"
Ten slot-machine-like images. Cherries, gold, "LUCKY!" and whatnot. The first must be positive, the second negative. The other as you wish. Must be in a vertical line, all equal to the others in size.
Pathetic Mockup 2:
 ____
|       |
|____|
|       |
|____|
|       |
|____|
|       |
|____|
|       |
|____|
|       |
|____|
|       |
|____|
|       |
|____|
|       |
|____|
|       |
|____|

"Slot_Machine_Base_3"
"Slot_Machine_Base_4to6"
"Slot_Machine_Base_7to9"

These images are a background, with space enough for, respectively, up to 3 6 and 9 of the above ("Slot_Machine_Chances"). For example, if the above have a width of 10, the first image should have, say, a width of 38 = 2(spacing) + 10(width) + 2(spacing) + 10(width) + 2(spacing) + 10(width) + 2(spacing)
The height should be enough to allow an image with height equal to 10/4 of the above images. 1 slot, plus twice 3/4 of a slot.
Pathetic Mockup 3:

_____________________________________
|         _____        ______      ______          |
|        |         |      |         |      |         |         |
|        |_____|      |_____|      |_____|         |         <= just with the above box and the below box
|        |         |      |         |      |         |         |               with 3/4 of the central box's height...
|        |_____|      |_____|      |_____|         |
|        |         |      |         |      |         |         |
|        |_____|      |_____|      |_____|         |
|___________________________________|

Clancky? Yeah, one of the parts of the script that probably won't work as I expect them to.

"Overdrive_Gauge"
A gauge, as per HP and MP ones, with a width equal to the Graphics width. 2 pixels of border, the rest will be colored with the fill_gradient_rect command (but need a background). Height of the bar is 24.
« Last Edit: October 18, 2010, 06:59:30 PM by The Mormegil »

**
Rep: +0/-0Level 78
RMRK Junior
I can't test it while the images are missing. So, i will wait for the images. And after that, you can make a full demo.