Vai al contenuto


Toggle Chat RM - Chat Apri la Chat in un popup

E' severamente vietato richiedere supporto su RPG Maker in chat!
@  Pech93 : (24 May 2012 - 01:55 PM) ho aggiunto delle composizioni originali!!! Chi le vuole ascoltare e dare qualche commento costruttivo?
@  MihaChan : (23 May 2012 - 09:19 PM) a parte i denti -che stanno decidendo di darmi noia in questi giorni-, tutto okay~
@  Melosx : (23 May 2012 - 09:18 PM) bene ^.^ ... Tu??
@  MihaChan : (23 May 2012 - 09:17 PM) come va? xD
@  MihaChan : (23 May 2012 - 09:16 PM) okay
@  MihaChan : (23 May 2012 - 09:16 PM) ah
@  Melosx : (23 May 2012 - 09:14 PM) ciao miha... ai dont spic inglisc
@  MihaChan : (23 May 2012 - 09:12 PM) how'sa goin'?
@  MihaChan : (23 May 2012 - 09:12 PM) ciao Mel!
@  Melosx : (23 May 2012 - 09:07 PM) ciao
@  MihaChan : (23 May 2012 - 09:06 PM) salve D:
@  Pech93 : (23 May 2012 - 08:05 PM) MIk?
@  Melosx : (23 May 2012 - 07:51 PM) VIENI SU MSN!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@  Melosx : (23 May 2012 - 07:51 PM) MIIIIIIIIIIIIIIIIIIIKKKKKKKKKKKK!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@  Melosx : (23 May 2012 - 07:46 PM) *iù
@  Melosx : (23 May 2012 - 07:38 PM) iu spin mi rai rau bebi rai rau laic a record bebi rau rau rau rau
@  Melosx : (23 May 2012 - 07:37 PM) lalalallalallalallallllllllllalalalallaaaaaaaaaaaaaaaaaaaaaa!!!!!!!!!!!!!!!!!!
@  Melosx : (23 May 2012 - 07:37 PM) lalalalala
@  Melosx : (23 May 2012 - 07:37 PM) naoinvaoèvpodlnvvrovnovnondpppppppppmvdgdvjomvmvpe
@  Melosx : (23 May 2012 - 07:36 PM) che coa che robaé

Overdrive Vx


  • Per cortesia connettiti per rispondere
2 risposte a questa discussione

#1 OFFLINE   alexse

alexse

    RM Utente

  • Utenti RM
  • StellettaStelletta
  • 25 Messaggi:
  • Progetto XP:
    Rpg Cronicles Red Destiny
  • Progetto VX:
    Blue Tempest
  • Tool:
    Rpg Maker VX\XP

Inviato 24 August 2011 - 12:36 PM

Ciao ragazi mi servirebbe l'overdrive per vx
mi dervirebbe lo script

grazie in anticipo :lol
Immagine inserita

#2 OFFLINE   Melosx

Melosx

    Maker di rpgmkr.net

  • RM-Dreamers
  • 895 Messaggi:
  • LocalitàAvola
  • Ruolo:
    Scripter
  • Progetto Ace:
    Menu Chora
  • Tool:
    RPG Maker VX/VX Ace

Inviato 24 August 2011 - 01:56 PM

Su google ne trovi a decine... Cmq cerca il kgc_overdrive...
Immagine inserita
Immagine inserita
Immagine inserita
Immagine inserita

Immagine inserita
Immagine inserita

Targhette vinte nei contest
Spoiler

from skype with love
Spoiler

#3 OFFLINE   Ally

Ally

    Fondatori

  • Amministratori
  • 5558 Messaggi:
  • Localitàrpgmkr
  • Ruolo:
    Scripter
  • Progetto VX:
    Essence
  • Tool:
    RM2k/2k3

Inviato 24 August 2011 - 03:11 PM

Controllate il database per verificare se quello che state cercando è presente:
topic1836.html

Se no c'è il KGC:
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
#_/ ◆ OverDrive System - KGC_OverDrive ◆ VX ◆
#_/ ◇ Last Update: 2008/08/28 ◇
#_/ ◆ Original Translation by Touchfuzzy ◆
#_/ ◆ Extended Translation and Updates by Mr. Anonymous ◆
#_/ ◆ KGC Site: ◆
#_/ ◆ http://f44.aaa.livedoor.jp/~ytomy/ ◆
#_/ ◆ Translator's Blog: ◆
#_/ ◆ http://mraprojects.wordpress.com ◆
#_/-----------------------------------------------------------------------------
#_/ This script allows the designer to create skills that are not usable in
#_/ battle until a character gains enough points from specified actions to use
#_/ them. To set up a skill as an "Overdrive" skill (which doesn't appear until
#_/ the Overdrive Gauge is full), go into the database, click the Skills tab,
#_/ locate the skill you desire, and then enter  into the "Notes"
#_/ text box. Also, you may desire some skills to increase the Overdrive Gauge
#_/ more than others.
#_/ To do so, enter  (where n = a number) into the desired skill's
#_/ "Notes" box. Example:  would increase Overdrive Points
#_/ gained from Attack Gain Rate (80 by default) by 200 percent (x2).
#_/ The formula for this is [attackgainrate * n / 100]
#_/=============================================================================
#_/ ◆ Script Commands ◆
#_/ These commands are used in "Script" function in the third page of event
#_/ commands under "Advanced".
#_/
#_/ Increase OverDrive for an actor:
#_/ * gain_actor_od_gauge(ActorID, Increase)
#_/
#_/ Increase OverDrive for an enemy:
#_/ * gain_enemy_od_gauge(EnemyID, Increase)
#_/
#_/ Modify an actor's drive types:
#_/ * set_actor_drive_type(ActorID, [DriveTypes])
#_/
#_/ Modify an enemy's drive types:
#_/ * set_enemy_drive_type(EnemyID, [DriveTypes])
#_/
#_/ [ Quick Key: ]
#_/ [ ActorID = The ID number of the selected Actor in the database. ]
#_/ [ Setting this to -1 will effect all actors. ]
#_/ [ ]
#_/ [ EnemyID = The ID number of the selected Enemy in the current troop. 0-7 ]
#_/ [ Setting this to -1 will effect all enemies. ]
#_/ [ ]
#_/ [ Increase = The amount of OverDrive points to increase. ]
#_/ [ ]
#_/ [ DriveTypes = The drive types as seen below in the customization block ]
#_/ [ "DEFAULT_ACTOR_DRIVE_TYPE". If this is omitted, it's reset to default. ]
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_

#=============================================================================#
# ★ Customization ★ #
#=============================================================================#

module KGC
module OverDrive
# ◆ Maximum Gauge Points ◆
# This affects the amount of OP (Overdrive Points) required to fill the
# Overdrive Gauge. Default: GAUGE_MAX = 1000
GAUGE_MAX = 1000

# ◆ Default OP Gain Rates ◆
# You may specify the amount of OverDrive Points that battlers will be given
# for specific actions performed.
GAIN_RATE = [
100, # 0 Gained per attack.
500, # 1 Gained for taking damage.
# This is per 100% MaxHP of damage taken, so with 500 you would
# have to take 2 times your MaxHP to fill a 1,000 point GAUGE_MAX.
200, # 2 Gained for defeating an enemy.
100, # 3 Gained each time you run away from a fight.
160, # 4 Gained for each round spent while fighting solo in battle, either
# being the only character or being the last one alive.
40, # 5 Gained for taking any action in a round
160, # 6 Gained for each round surviving with 25% or less HP remaining.
180, # 7 Gained for each round for guarding.
] # ← No not remove these lines. Alter to your heart's content, though.

# ◆ Amount of Gauges ◆
# This allows you to specify how many gauges the actor has. These gauges stack
# meaning when that after the first gauge is maxed, OverDrive points are
# allocated to the next gauge. This also means that after using an OverDrive
# skill, OverDrive points are given for that action if applicable.
# As a final note, these gauges are displayed as one whole gauge.
DEFAULT_GAUGE_NUMBER = 1

# ◆ Default Actor OverDrive Increase Options ◆
# Default Overdrive types that affect player-characters. The numbers in the
# brackets [] are chosen from the GAIN_RATE above, to the right of the #.
# It appears these numbers "stack" when setting up an individual character's
# Overdrive parameters.
DEFAULT_ACTOR_DRIVE_TYPE = [0, 1, 6, 7]

# ◆ Default Enemy OverDrive Increase Options ◆
# Default Overdrive types that affect enemies. The numbers in the brackets []
# are chosen from the GAIN_RATE above, to the right of the #.
DEFAULT_ENEMY_DRIVE_TYPE = [0, 1, 4, 5, 6]

# ◆ OverDrive Gauge Colors ◆
# Allows you to change the color of the overdrive gauges.
# The color can also be determined by a red, green, and blue values.
# Example: GAUGE_NORMAL_START_COLOR = Color.new(255, 0, 0) <- This is red.
# This method of color assignment is much like Tint Screen event command.
# Gauge Start Color
GAUGE_NORMAL_START_COLOR = 14
# Gauge End Color
GAUGE_NORMAL_END_COLOR = 6
# Max Gauge Start Color
GAUGE_MAX_START_COLOR = 10
# Max Gauge End Color
GAUGE_MAX_END_COLOR = 2

# ◆ Gauge Y Coordinate ◆
# This allows you to adjust the Y coordinate(depth) of the overdrive gauge.
# Setting to -8 places the OD gauge at the same depth as the HP/MP gauges.
GAUGE_OFFSET_Y = -8

# ◆ Numerical Display of OverDrive Gauge Style ◆
# This function allows you to display a numerical representation of the
# current amount of OverDrive points an actor has.
# 0: No numerical amount is displayed.
# 1: Default - Displays the current amount as a straight number.
# 2: Ratio 1 --> x%
# 3: Ratio 2 --> x.x%
# 4: Ratio 3 --> x.xx%
# 5: Maxing - Amount of times the gauge has maxed since the battle started.
GAUGE_VALUE_STYLE = 2

# ◆ Numerical Display Font Size ◆
# This allows you to change the font size of the numerical display of the
# OverDrive gauge, as defined above.
GAUGE_VALUE_FONT_SIZE = 14

# ◆ Empty OD Gauge Upon Death ◆
# This toggle affects wether the OP Gauge is reset to zero once an actor
# dies. true = Reset to 0. false = Gauge remains persistant.
EMPTY_ON_DEAD = true

# ◆ Hide Actor OD Gauge ◆
# Hide the gauge for individual characters. The number of the character in
# the Actors Database is inserted in the brackets.
# Example: HIDE_GAUGE_ACTOR = [2] would always hide the gauge for the second
# actor in the database. (Simple stuff.)
HIDE_GAUGE_ACTOR = []

# ◆ Hide OD Gauge in Menu ◆
# This toggle allows you to hide the Overdrive gauge from the command menu.
# true = Gauge is hidden.
# false = Gauge remains persistant even in menu.
HIDE_GAUGE_NOT_IN_BATTLE = false

# ◆ Hide OD Gauge When Actor Lacks OD Skills ◆
# This toggle allows you to hide the gauge if a character has no Overdrive
# skills in his/her arsenal.
# true = Gauge is hidden.
# false = Gauge is not hidden.
HIDE_GAUGE_NO_OD_SKILLS = true

# ◆ Prevent Actors Without OD Skills From Gaining OP ◆
# This toggle stops OP from being gained for characters that have no Overdrive
# skills when HIDE_GAUGE_NO_OD_SKILLS = true.
NOT_GAIN_GAUGE_HIDING = true

# ◆ Hide OD Skills When Actor Lacks Max OP ◆
# This toggle allows you to specify wether skills that do not yet meet the
# required OP are visible.
# true = Skills are hidden
# false = skills are not hidden.
HIDE_SKILL_LACK_OF_GAUGE = false

# ◆ Use Image as Gauge Toggle ◆
# If set to true, the old-style system-drawn gauges are replaced by user
# created images. Note that as of now, using this option hides the numerical
# gauge display function. This MAY be fixed by adjusting GAUGE_OFFSET_Y as
# seen above, but hasn't been tested.
USE_IMAGE_GAUGE = true
# ◆ Gauge Image Graphic ◆
# This setting allows you to define the image you want to use as the drive
# gauge bar. The image must be located in the "Graphics\System" folder.
GAUGE_IMAGE = "gauge_od2"

# ◆ Menu Gauge Image Position [x, y] ◆
# Actor names are relative to the coordinates in the menu defined below.
GAUGE_POSITION = [-32, -8]
# ◆ Menu Gauge Image Length ◆
# For a longer or shorter gauge, increase or decrease this number.
GAUGE_LENGTH = 52

# ◆ Battle Gauge Image Position [x, y] ◆
# Actor names are relative to the coordinates during battle defined below.
GAUGE_POSITION_BATTLE = [-32, -8]

# ◆ Battle Gauge Image Length ◆
# For a longer or shorter gauge, increase or decrease this number.
GAUGE_LENGTH_BATTLE = 52

# ◆ OverDrive Max Sound Play ◆
# Sound played on overdrive gauge max. (Filename, Pitch, Volume)
# Sounds are selected from the Audio\SE folder.
ODMAX_SOUND = RPG::SE.new("Flash2", 100, 150)
end
end

#=============================================================================#
# ★ End Customization ★ #
#=============================================================================#

#=================================================#
# IMPORT #
#=================================================#

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

#=================================================#

module KGC::OverDrive
# Drive Increase Type Module
module Type
ATTACK = 0 # Attack
DAMAGE = 1 # Damage
VICTORY = 2 # Victory
ESCAPE = 3 # Escape
ALONE = 4 # Alone
ACTION = 5 # Action
FATAL = 6 # Fatal
GUARD = 7 # Guard
end

#=================================================#

# Numerical Display of OverDrive Gauge
module ValueStyle
NONE = 0 # None
IMMEDIATE = 1 # Immediate
RATE = 2 # Ratio 1
RATE_DETAIL1 = 3 # Ratio 2
RATE_DETAIL2 = 4 # Ratio 3
NUMBER = 5 # Gauge Number
end

#==============================================================================
# □ KGC::SkillCPSystem::Regexp
#==============================================================================
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * #
# Note Field Tag Strings #
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * #
# Whatever word(s) are after the separator ( | ) in the following lines are
# what are used to determine what is searched for in the "Note" section of a
# skill.

# Regular Expressions Module
module Regexp
# Skill Module
module Skill
# OverDrive tag string
OVER_DRIVE = /<(?:OVER_DRIVE|overdrive)\s*(\d+)?>/i
# OverDrive Gain Rate tag string
OD_GAIN_RATE = /<(?:OD_GAIN_RATE|OD_gain)\s*(\d+)[%%]?>/i
end
end
end

#=================================================#

#==============================================================================
# □ KGC::Commands
#==============================================================================

module KGC
module Commands
module_function
#--------------------------------------------------------------------------
# ○ Actor Overdrive Gain Gauge
# actor_id : Actor ID (-1 : Entire Party)
# value : Increase Amount (Subtraction works as well)
#--------------------------------------------------------------------------
def gain_actor_od_gauge(actor_id, value)
if actor_id == -1
# All living party members gauge is operated.
$game_party.existing_members.each { |actor|
actor.overdrive += value
}
else
actor = $game_actors[actor_id]
actor.overdrive += value if actor != nil && actor.exist?
end
end
#--------------------------------------------------------------------------
# ○ Enemy Overdrive Gain Gauge
# enemy_index : Enemy index (-1 : All Enemies)
# value : Increase Amount (Subtraction works as well)
#--------------------------------------------------------------------------
def gain_enemy_od_gauge(enemy_index, value)
if enemy_index == -1
# All living enemies in troop's gauge is operated.
$game_troop.existing_members.each { |enemy|
enemy.overdrive += value
}
else
enemy = $game_troop.members[enemy_index]
enemy.overdrive += value if enemy != nil && enemy.exist?
end
end
#--------------------------------------------------------------------------
# ○ Get Actor OverDrive Gauge
# actor_id : Actor ID (-1 : Entire Party)
# variable_id : Variable ID
#--------------------------------------------------------------------------
def get_actor_od_gauge(actor_id, variable_id = 0)
actor = $game_actors[actor_id]
n = (actor != nil ? actor.overdrive : 0)
if variable_id > 0
$game_variables[variable_id] = n
end
return n
end
#--------------------------------------------------------------------------
# ○ Get Enemy OverDrive Gauge
# enemy_index : EnemyID (-1 : Entire Party)
# variable_id : Variable ID
#--------------------------------------------------------------------------
def get_enemy_od_gauge(enemy_index, variable_id = 0)
enemy = $game_troop.members[enemy_index]
n = (enemy != nil ? enemy.overdrive : 0)
if variable_id > 0
$game_variables[variable_id] = n
end
return n
end
#--------------------------------------------------------------------------
# ○ Set Actor Drive Number
# actor_id : Actor ID (-1 : Entire Party)
# number : Array of number type
#--------------------------------------------------------------------------
def set_actor_od_gauge_number(actor_id, number)
if actor_id == -1
# All living party members members gauge is operated.
$game_party.members.each { |actor|
actor.drive_gauge_number = number
}
else
actor = $game_actors[actor_id]
actor.drive_gauge_number = number if actor != nil
end
end
#--------------------------------------------------------------------------
# ○ Set Enemy Drive Number
# enemy_index : Enemy ID
# number : Array of number type
#--------------------------------------------------------------------------
def set_enemy_od_gauge_number(enemy_index, number)
if enemy_index == -1
# All living enemies in troop's gauge is operated.
$game_troop.members.each { |enemy|
enemy.drive_gauge_number = number
}
else
enemy = $game_troop.members[enemy_index]
enemy.drive_gauge_number = number if enemy != nil
end
end
#--------------------------------------------------------------------------
# ○ Determine Actor Drive Max
# actor_id : ActorID
#--------------------------------------------------------------------------
def actor_od_gauge_max?(actor_id)
actor = $game_actors[actor_id]
return false if actor == nil
return actor.overdrive == actor.max_overdrive
end
#--------------------------------------------------------------------------
# ○ Determine Enemy Drive Max
# enemy_index : Enemy Index
#--------------------------------------------------------------------------
def enemy_od_gauge_max?(enemy_index)
enemy = $game_troop.members[enemy_index]
return false if enemy == nil
return enemy.overdrive == enemy.max_overdrive
end
#--------------------------------------------------------------------------
# ○ Set Actor Drive Type
# actor_id : Actor ID (-1 : Entire Party)
# types : Array of drive type ( When omitted: Initialization. )
#--------------------------------------------------------------------------
def set_actor_drive_type(actor_id, types = nil)
if actor_id == -1
# Set all party members' drive types
$game_party.members.each { |actor|
actor.drive_type = types
}
else
actor = $game_actors[actor_id]
actor.drive_type = types if actor != nil
end
end
#--------------------------------------------------------------------------
# ○ Set Enemy Drive Type
# actor_id : Enemy ID (-1 : All Enemies)
# types : Array of drive type ( When omitted: Initialization. )
#--------------------------------------------------------------------------
def set_enemy_drive_type(enemy_index, types = nil)
if enemy_index == -1
# All enemies' gauge is operated.
$game_troop.members.each { |enemy|
enemy.drive_type = types
}
else
enemy = $game_troop.members[enemy_index]
enemy.drive_type = types if enemy != nil
end
end
end
end

#=================================================#

#==============================================================================
# ■ RPG::Skill
#==============================================================================

class RPG::Skill < RPG::UsableItem
#--------------------------------------------------------------------------
# ○ Overdrive cache generation
#--------------------------------------------------------------------------
def create_overdrive_cache
@__is_overdrive = false
@__od_cost = KGC::OverDrive::GAUGE_MAX
@__od_gain_rate = 100

self.note.split(/[\r\n]+/).each { |line|
case line
when KGC::OverDrive::Regexp::Skill::OVER_DRIVE
# Overdrive
@__is_overdrive = true
@__od_cost = $1.to_i if $1 != nil
when KGC::OverDrive::Regexp::Skill::OD_GAIN_RATE
# Gauge increase rate
@__od_gain_rate = $1.to_i
end
}

# Unless OverDrive doesn't consume gauge
unless @__is_overdrive
@__od_cost = 0
end
end
#--------------------------------------------------------------------------
# ○ OverDrive is a skill?
#--------------------------------------------------------------------------
def overdrive?
create_overdrive_cache if @__is_overdrive == nil
return @__is_overdrive
end
#--------------------------------------------------------------------------
# ○ Consumption of drive gauge
#--------------------------------------------------------------------------
def od_cost
create_overdrive_cache if @__od_cost == nil
return @__od_cost
end
#--------------------------------------------------------------------------
# ○ The drive gauge increase rate
#--------------------------------------------------------------------------
def od_gain_rate
create_overdrive_cache if @__od_gain_rate == nil
return @__od_gain_rate
end
end

#=================================================#

#==============================================================================
# ■ Game_Battler
#==============================================================================

class Game_Battler
#--------------------------------------------------------------------------
# ● Public Instance Variables
#--------------------------------------------------------------------------
attr_writer :drive_type # Drive Type
attr_writer :odmax_sound_played # OverDrive Max Sound Flag
#--------------------------------------------------------------------------
# ○ Acquire amount of drive gauge
#--------------------------------------------------------------------------
def overdrive
@overdrive = 0 if @overdrive == nil
return @overdrive
end
#--------------------------------------------------------------------------
# ○ Drive Gauge Max Acquisition
#--------------------------------------------------------------------------
def overdrive=(value)
@overdrive = [[value, max_overdrive].min, 0].max
end
#--------------------------------------------------------------------------
# ○ Obtain Max OverDrive
#--------------------------------------------------------------------------
def max_overdrive
return KGC::OverDrive::GAUGE_MAX * drive_gauge_number
end
#--------------------------------------------------------------------------
# ○ Numerical Drive Gauge Definition
#--------------------------------------------------------------------------
def drive_gauge_number
if @drive_gauge_number == nil
@drive_gauge_number = KGC::OverDrive::DEFAULT_GAUGE_NUMBER
end
return @drive_gauge_number
end
#--------------------------------------------------------------------------
# ○ Aquire Numerical Drive Value
#--------------------------------------------------------------------------
def drive_gauge_number=(value)
@drive_gauge_number = [value, 1].max
end
#--------------------------------------------------------------------------
# ○ Define Drive Type
#--------------------------------------------------------------------------
def drive_type
return []
end
#--------------------------------------------------------------------------
# ○ Determine OverDrive Skill Aquired
#--------------------------------------------------------------------------
def overdrive_skill_learned?
return true
end
#--------------------------------------------------------------------------
# ○ Determine True/False Gauge Display
#--------------------------------------------------------------------------
def od_gauge_visible?
return false
end
#--------------------------------------------------------------------------
# ○ Determine True/False Gauge Increase
#--------------------------------------------------------------------------
def can_gain_overdrive?
return true
end
#--------------------------------------------------------------------------
# ○ Defined Sound Played on Gauge Max - Added by Mr. Anonymous 8/19/08
#--------------------------------------------------------------------------
def odmax_sound
return KGC::OverDrive::ODMAX_SOUND
end
#--------------------------------------------------------------------------
# ○ Defined Sound Played on Gauge Max - Added by Mr. Anonymous 8/19/08
#--------------------------------------------------------------------------
def odmax_sound_played
# return true
end
#--------------------------------------------------------------------------
# ○ Determine OD Increase: Attack
#--------------------------------------------------------------------------
def drive_attack?
return drive_type.include?(KGC::OverDrive::Type::ATTACK)
end
#--------------------------------------------------------------------------
# ○ Determine OD Increase: Damage
#--------------------------------------------------------------------------
def drive_damage?
return drive_type.include?(KGC::OverDrive::Type::DAMAGE)
end
#--------------------------------------------------------------------------
# ○ Determine OD Increase: Victory
#--------------------------------------------------------------------------
def drive_victory?
return drive_type.include?(KGC::OverDrive::Type::VICTORY)
end
#--------------------------------------------------------------------------
# ○ Determine OD Increase: Escape
#--------------------------------------------------------------------------
def drive_escape?
return drive_type.include?(KGC::OverDrive::Type::ESCAPE)
end
#--------------------------------------------------------------------------
# ○ Determine OD Increase: Alone
#--------------------------------------------------------------------------
def drive_alone?
return drive_type.include?(KGC::OverDrive::Type::ALONE)
end
#--------------------------------------------------------------------------
# ○ Determine OD Increase: Action
#--------------------------------------------------------------------------
def drive_action?
return drive_type.include?(KGC::OverDrive::Type::ACTION)
end
#--------------------------------------------------------------------------
# ○ Determine OD Increase: Fatal
#--------------------------------------------------------------------------
def drive_fatal?
return drive_type.include?(KGC::OverDrive::Type::FATAL)
end
#--------------------------------------------------------------------------
# ○ Determine OD Increase: Guard
#--------------------------------------------------------------------------
def drive_guard?
return drive_type.include?(KGC::OverDrive::Type::GUARD)
end
#--------------------------------------------------------------------------
# ● State Addition
# state_id : State ID
#--------------------------------------------------------------------------
alias add_state_KGC_OverDrive add_state
def add_state(state_id)
add_state_KGC_OverDrive(state_id)

reset_overdrive_on_dead if dead?
end
#--------------------------------------------------------------------------
# ○ Calculate Skill Drive Gauge Consumption
# skill : Skill
#--------------------------------------------------------------------------
def calc_od_cost(skill)
return 0 unless skill.is_a?(RPG::Skill)

return skill.od_cost
end
#--------------------------------------------------------------------------
# ● Skill Use Determination
# skill : Skill
#--------------------------------------------------------------------------
alias skill_can_use_KGC_OverDrive? skill_can_use?
def skill_can_use?(skill)
return false unless skill_can_use_KGC_OverDrive?(skill)

return false if calc_od_cost(skill) > overdrive
return true
end
#--------------------------------------------------------------------------
# ● Execute Damage
# user : User of Skill or Item
# Before @hp_damage、@mp_damage、@absorbed is called, they must be set.
#--------------------------------------------------------------------------
alias execute_damage_KGC_OverDrive execute_damage
def execute_damage(user)
execute_damage_KGC_OverDrive(user)

increase_overdrive(user)
end
#--------------------------------------------------------------------------
# ○ Reset OverDrive on Death
#--------------------------------------------------------------------------
def reset_overdrive_on_dead
return unless KGC::OverDrive::EMPTY_ON_DEAD

self.overdrive = 0
end
#--------------------------------------------------------------------------
# ○ Increase Overdrive
# attacker : Attacker
#--------------------------------------------------------------------------
def increase_overdrive(attacker = nil)
return unless attacker.is_a?(Game_Battler) # Unless attacker is a battler
return if self.class == attacker.class # and attacker class is predefined
return if hp_damage == 0 && mp_damage == 0 # and they cannot attack,
# if they can gain overdrive...
if can_gain_overdrive?
# increase the overdrive.
increase_attacker_overdrive(attacker)
increase_defender_overdrive(attacker)
end
# If battler dies, reset overdrive.
reset_overdrive_on_dead if dead?
end
#--------------------------------------------------------------------------
# ○ Increase Attacker's Overdrive
# attacker : Attacker
#--------------------------------------------------------------------------
def increase_attacker_overdrive(attacker)
return unless attacker.drive_attack? # Unless attack has od attack type

od_gain = KGC::OverDrive::GAIN_RATE[KGC]
if attacker.action.kind == 1
rate = attacker.action.skill.od_gain_rate # obtain rate from od type
od_gain = od_gain * rate / 100
if rate > 0
od_gain = [od_gain, 1].max
elsif rate < 0
od_gain = [od_gain, -1].min
end
end
attacker.overdrive += od_gain
#----------------------------------------------------------------
# Determine OverDrive Max Sound's play state and play when maxed.
# Added by Mr. Anonymous 8/19/08
#----------------------------------------------------------------
# If Attacker's overdrive is greater than GAUGE_MAX...
if attacker.overdrive < KGC::OverDrive::GAUGE_MAX
# set attacker's overdrive max sound played flag to false.
attacker.odmax_sound_played = false
end
# If attacker's overdrive max sound played flag is set to false...
if attacker.odmax_sound_played == false
# and attacker's overdrive is equal to GAUGE_MAX...
if attacker.overdrive == KGC::OverDrive::GAUGE_MAX
# Play overdrive max sound...
odmax_sound.play
# set attacker's overdrive max sound played flag to true.
attacker.odmax_sound_played = true
end
end
#----------------------------------------------------------------
# End max OverDrive determination.
#----------------------------------------------------------------
end
#--------------------------------------------------------------------------
# ○ Increase Attacker's Overdrive
# attacker : Attacker
#--------------------------------------------------------------------------
def increase_defender_overdrive(attacker)
return unless self.drive_damage? # Unless attacker has od damage type

rate = KGC::OverDrive::GAIN_RATE[KGC]
od_gain = 0
od_gain += hp_damage * rate / maxhp if hp_damage > 0
od_gain += mp_damage * rate / maxmp if mp_damage > 0 && maxmp > 0
if rate > 0
od_gain = [od_gain, 1].max
elsif rate < 0
od_gain = [od_gain, -1].min
end
self.overdrive += od_gain
#----------------------------------------------------------------
# Determine OverDrive Max Sound's play state and play when maxed.
# Added by Mr. Anonymous 8/19/08
#----------------------------------------------------------------
# If defender's overdrive is greater than GAUGE_MAX...
if self.overdrive < KGC::OverDrive::GAUGE_MAX
# set defender's overdrive max sound played flag to false.
self.odmax_sound_played = false
end
# If defender's overdrive max sound played flag is set to false...
if self.odmax_sound_played == false
# and defender's overdrive is equal to GAUGE_MAX...
if self.overdrive == KGC::OverDrive::GAUGE_MAX
# Play overdrive max sound...
odmax_sound.play
# set defender's overdrive max sound played flag to true.
self.odmax_sound_played = true
end
end
#----------------------------------------------------------------
# End max OverDrive determination.
#----------------------------------------------------------------
end
#--------------------------------------------------------------------------
# ● Skill Effects
# user : User
# skill : Skill
#--------------------------------------------------------------------------
alias skill_effect_KGC_OverDrive skill_effect
def skill_effect(user, skill)
skill_effect_KGC_OverDrive(user, skill)

# If imported KGC_ReproduceFunctions & item used has execute skill tag...
if $imported["ReproduceFunctions"] && $game_temp.exec_skill_on_item
return
end
end
end

#=================================================#

#==============================================================================
# ■ Game_Actor
#==============================================================================

class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● Setup
# actor_id : ActorID
#--------------------------------------------------------------------------
alias setup_KGC_OverDrive setup
def setup(actor_id)
setup_KGC_OverDrive(actor_id)

@overdrive = 0
@drive_type = nil
end
#--------------------------------------------------------------------------
# ○ Aquire OverDrive Type
#--------------------------------------------------------------------------
def drive_type
unless @drive_type.is_a?(Array)
return KGC::OverDrive::DEFAULT_ACTOR_DRIVE_TYPE
end
return @drive_type
end
#--------------------------------------------------------------------------
# ○ Determine OverDrive Skill Aquired
#--------------------------------------------------------------------------
def overdrive_skill_learned?
result = false
# Temporarily Cancel Battle Flag
last_in_battle = $game_temp.in_battle
$game_temp.in_battle = false

self.skills.each { |skill|
if skill.overdrive?
result = true
break
end
}
$game_temp.in_battle = last_in_battle
return result
end
#--------------------------------------------------------------------------
# ○ Determine Gauge Increase
#--------------------------------------------------------------------------
def can_gain_overdrive?
if KGC::OverDrive::NOT_GAIN_GAUGE_HIDING
# Hide
return false if KGC::OverDrive::HIDE_GAUGE_ACTOR.include?(self.id)
end
if KGC::OverDrive::HIDE_GAUGE_NO_OD_SKILLS
# No learned
return false unless overdrive_skill_learned?
end

return true
end
#--------------------------------------------------------------------------
# ○ Determine Gauge Display
#--------------------------------------------------------------------------
def od_gauge_visible?
# Hide gauge in Battle
if KGC::OverDrive::HIDE_GAUGE_NOT_IN_BATTLE && !$game_temp.in_battle
return false
end
# Hide Gauge
return false if KGC::OverDrive::HIDE_GAUGE_ACTOR.include?(self.id)
# Gauge amount doesn't increase.
return false unless can_gain_overdrive?

return true
end
end

#=================================================#

#==============================================================================
# ■ Game_Enemy
#==============================================================================

class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# ● Object Initialization
# index : Index in enemy group
# enemy_id : EnemyID
#--------------------------------------------------------------------------
alias initialize_KGC_OverDrive initialize
def initialize(index, enemy_id)
initialize_KGC_OverDrive(index, enemy_id)

@overdrive = 0
@drive_type = nil
end
#--------------------------------------------------------------------------
# ○ Aquire OverDrive Type
#--------------------------------------------------------------------------
def drive_type
unless @drive_type.is_a?(Array)
return KGC::OverDrive::DEFAULT_ENEMY_DRIVE_TYPE
end
return @drive_type
end
end

#=================================================#

#==============================================================================
# ■ Window_Base
#==============================================================================

class Window_Base < Window
#----------------------------------------------------------------------
# Determine Gauge Image Type
# - Added by Mr. Anonymous 8/19/08
# If the user doesn't use gauge images, define system gauge properties.
#----------------------------------------------------------------------
if KGC::OverDrive::USE_IMAGE_GAUGE = false
#--------------------------------------------------------------------------
# ○ OD Gauge Normal Color 1
#--------------------------------------------------------------------------
def od_gauge_normal_color1
color = KGC::OverDrive::GAUGE_NORMAL_START_COLOR
return (color.is_a?(Integer) ? text_color(color) : color)
end
#--------------------------------------------------------------------------
# ○ OD Gauge Normal Color 2
#--------------------------------------------------------------------------
def od_gauge_normal_color2
color = KGC::OverDrive::GAUGE_NORMAL_END_COLOR
return (color.is_a?(Integer) ? text_color(color) : color)
end
#--------------------------------------------------------------------------
# ○ OD Gauge Max Color 1
#--------------------------------------------------------------------------
def od_gauge_max_color1
color = KGC::OverDrive::GAUGE_MAX_START_COLOR
return (color.is_a?(Integer) ? text_color(color) : color)
end
#--------------------------------------------------------------------------
# ○ OD Gauge Max Color 2
#--------------------------------------------------------------------------
def od_gauge_max_color2
color = KGC::OverDrive::GAUGE_MAX_END_COLOR
return (color.is_a?(Integer) ? text_color(color) : color)
end
end # <- if KGC::OverDrive::USE_IMAGE_GAUGE = false
#--------------------------------------------------------------------------
# ● Draw Actor Name
# actor : Actor
# x : Coordinates at X Axis
# y : Coordinates at Y Axis
#--------------------------------------------------------------------------
alias draw_actor_name_KGC_OverDrive draw_actor_name
def draw_actor_name(actor, x, y)
draw_actor_od_gauge(actor, x, y, 108)
draw_actor_name_KGC_OverDrive(actor, x, y)
end
#----------------------------------------------------------------------
# Determine Gauge Image Type
# - Added by Mr. Anonymous 8/19/08
# If the user doesn't use gauge images, draw system gauge.
#----------------------------------------------------------------------
if KGC::OverDrive::USE_IMAGE_GAUGE = false
#--------------------------------------------------------------------------
# ○ Draw Actor OverDrive Gauge
# actor : Actor
# x : Coordinates at X Axis
# y : Coordinates at Y Axis
# width : Width
#--------------------------------------------------------------------------
def draw_actor_od_gauge(actor, x, y, width = 120)
return unless actor.od_gauge_visible?

n = actor.overdrive % KGC::OverDrive::GAUGE_MAX
n = KGC::OverDrive::GAUGE_MAX if actor.overdrive == actor.max_overdrive
gw = width * n / KGC::OverDrive::GAUGE_MAX
gc1 = (gw == width ? od_gauge_max_color1 : od_gauge_normal_color1)
gc2 = (gw == width ? od_gauge_max_color2 : od_gauge_normal_color2)
self.contents.fill_rect(x, y + WLH + KGC::OverDrive::GAUGE_OFFSET_Y,
width, 6, gauge_back_color)
self.contents.gradient_fill_rect(
x, y + WLH + KGC::OverDrive::GAUGE_OFFSET_Y, gw, 6, gc1, gc2)

draw_actor_od_gauge_value(actor, x, y, width)
end
#----------------------------------------------------------------------
# Determine Gauge Image Type
# - Added by Mr. Anonymous 8/19/08
# Else, the user IS using gauge images...
#----------------------------------------------------------------------
else
#--------------------------------------------------------------------------
# ○ Draw Actor OverDrive Gauge
# actor : Actor
# x : Coordinates at X Axis
# y : Coordinates at Y Axis
# in_width : Inner Width
#--------------------------------------------------------------------------
def draw_actor_od_gauge(actor, x, y, in_width)
# Exit process if the OD Gauge isn't visible.
return unless actor.od_gauge_visible?

bitmap = self.contents
# Define the gauge image.
gauge = Bitmap.new("Graphics/System/" + KGC::OverDrive::GAUGE_IMAGE)
nx = x # X Coordinate
ny = y # Y Coordinate
nw = in_width # Inner image width
if $game_temp.in_battle # If inside a battle
# Pull customized battle values from the OverDrive module.
nx += KGC::OverDrive::GAUGE_POSITION_BATTLE[0]
ny += KGC::OverDrive::GAUGE_POSITION_BATTLE[1]
nw += KGC::OverDrive::GAUGE_LENGTH_BATTLE
else # when outside of battle
# Pull customized values from the OverDrive module.
nx += KGC::OverDrive::GAUGE_POSITION[0]
ny += KGC::OverDrive::GAUGE_POSITION[1]
nw += KGC::OverDrive::GAUGE_LENGTH
end
gauge_width = calc_od_gauge_width(actor, nw)
full = (gauge_width == nw - 64)
draw_od_gauge_back(bitmap, gauge, nx, ny, nw)
draw_od_gauge_inside(bitmap, gauge, nx, ny, nw, gauge_width, full)
draw_od_gauge_fore(bitmap, gauge, nx, ny, nw)
draw_actor_od_gauge_value(actor, x, y, width)
end
#--------------------------------------------------------------------------
# ○ Draw Gauge Background
# bitmap : Draw Image At...
# image : Gauge Image
# in_width : Internal Width of Gauge
#--------------------------------------------------------------------------
def draw_od_gauge_back(bitmap, image, x, y, in_width)
src_rect = Rect.new(0, 0, 32, 32)
bitmap.blt(x, y, image, src_rect)
src_rect.set(32, 0, 96, 32)
dest_rect = Rect.new(x + 32, y, in_width - 64, 32)
bitmap.stretch_blt(dest_rect, image, src_rect)
src_rect.set(128, 0, 32, 32)
bitmap.blt(x + in_width - 32, y, image, src_rect)
end
#--------------------------------------------------------------------------
# ○ Draw Inner Drive Gauge
# bitmap : Draw Image At...
# image : Gauge Image
# in_width : Internal Width of Gauge
# gauge_width : Gauge External Width
# full : Full Gauge
#--------------------------------------------------------------------------
def draw_od_gauge_inside(bitmap, image, x, y, in_width, gauge_width, full)
src_rect = Rect.new(0, (full ? 64 : 32), 0, 32)
src_rect.width = gauge_width * 96 / (in_width - 64)
dest_rect = Rect.new(x + 32, y, gauge_width, 32)
bitmap.stretch_blt(dest_rect, image, src_rect)
end
#--------------------------------------------------------------------------
# ○ Draw Gauge Foreground
# bitmap : Draw Image At...
# image : Gauge Image
# in_width : Internal Width of Gauge
#--------------------------------------------------------------------------
def draw_od_gauge_fore(bitmap, image, x, y, in_width)
src_rect = Rect.new(160, 0, 32, 32)
bitmap.blt(x, y, image, src_rect)
src_rect.set(192, 0, 96, 32)
dest_rect = Rect.new(x + 32, y, in_width - 64, 32)
bitmap.stretch_blt(dest_rect, image, src_rect)
src_rect.set(288, 0, 32, 32)
bitmap.blt(x + in_width - 32, y, image, src_rect)
end
#--------------------------------------------------------------------------
# ○ Calculate Gauge Width
#--------------------------------------------------------------------------
def calc_od_gauge_width(actor, in_width)
gw = actor.overdrive * (in_width - 64) / KGC::OverDrive::GAUGE_MAX
return [[gw, 0].max, in_width - 64].min
end
#----------------------------------------------------------------------
# End Gauge Image Type Determination
# end ( if KGC::OverDrive::USE_IMAGE_GAUGE )
#----------------------------------------------------------------------
end
#--------------------------------------------------------------------------
# ○ Draw Actor OverDrive Numerical Value
# actor : Actor
# x : Coordinates at X Axis
# y : Coordinates at Y Axis
# width : Width
#--------------------------------------------------------------------------
def draw_actor_od_gauge_value(actor, x, y, width = 120)
text = ""
value = actor.overdrive * 100.0 / KGC::OverDrive::GAUGE_MAX
case KGC::OverDrive::GAUGE_VALUE_STYLE
when KGC::OverDrive::ValueStyle::IMMEDIATE
text = actor.overdrive.to_s
when KGC::OverDrive::ValueStyle::RATE
text = sprintf("%d%%", actor.overdrive * 100 / KGC::OverDrive::GAUGE_MAX)
when KGC::OverDrive::ValueStyle::RATE_DETAIL1
text = sprintf("%0.1f%%", value)
when KGC::OverDrive::ValueStyle::RATE_DETAIL2
text = sprintf("%0.2f%%", value)
when KGC::OverDrive::ValueStyle::NUMBER
text = "#{actor.overdrive / KGC::OverDrive::GAUGE_MAX}"
else
return
end

last_font_size = self.contents.font.size
new_font_size = KGC::OverDrive::GAUGE_VALUE_FONT_SIZE
self.contents.font.size = new_font_size
self.contents.draw_text(
x, y + WLH + KGC::OverDrive::GAUGE_OFFSET_Y - new_font_size / 2,
width, new_font_size, text, 2)
self.contents.font.size = last_font_size
end
end

#=================================================#

#==============================================================================
# ■ Window_Skill
#==============================================================================

if KGC::OverDrive::HIDE_SKILL_LACK_OF_GAUGE

class Window_Skill < Window_Selectable
#--------------------------------------------------------------------------
# ○ Determine Skill in List
# skill : Skill
#--------------------------------------------------------------------------
unless $@
alias include_KGC_OverDrive? include? if method_defined?(:include?)
end
def include?(skill)
return false if skill == nil

if defined?(include_KGC_OverDrive?)
return false unless include_KGC_OverDrive?(skill)
end

if skill.overdrive?
return (@actor.calc_od_cost(skill) <= @actor.overdrive)
else
return true
end
end

if method_defined?(:include_KGC_OverDrive?)
#--------------------------------------------------------------------------
# ● Refresh
#--------------------------------------------------------------------------
def refresh
@data = []
for skill in @actor.skills
next unless include?(skill)
@data.push(skill)
if skill.id == @actor.last_skill_id
self.index = @data.size - 1
end
end
@item_max = @data.size
create_contents
for i in 0...@item_max
draw_item(i)
end # <-- for i in 0...@item_max
end # <-- refresh
end # <-- if method_defined?(:include_KGC_OverDrive?)
end # <-- class
end # <-- if KGC::OverDrive::HIDE_SKILL_LACK_OF_GAUGE

#=================================================#

#==============================================================================
# ■ Scene_Skill
#==============================================================================

class Scene_Skill < Scene_Base
#--------------------------------------------------------------------------
# ● Use Skill(The effects of use other than the ally object are applied.)
#--------------------------------------------------------------------------
alias use_skill_nontarget_KGC_OverDrive use_skill_nontarget
def use_skill_nontarget
consume_od_gauge

use_skill_nontarget_KGC_OverDrive
end
#--------------------------------------------------------------------------
# ○ Consume Drive gauge when skill is used
#--------------------------------------------------------------------------
def consume_od_gauge
@actor.overdrive -= @actor.calc_od_cost(@skill)
end
end

#=================================================#

#==============================================================================
# ■ Scene_Battle
#==============================================================================

class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# ● Battle End
# result : Result (0:Victory 1:Escape 2:Defeat)
#--------------------------------------------------------------------------
alias battle_end_KGC_OverDrive battle_end
def battle_end(result)
increase_overdrive_on_battle_end(result)

battle_end_KGC_OverDrive(result)
end
#--------------------------------------------------------------------------
# ○ Increase OverDrive on Battle End
# result : Result (0:Victory 1:Escape 2:Defeat)
#--------------------------------------------------------------------------
def increase_overdrive_on_battle_end(result)
case result
when 0 # Victory
od_gain = KGC::OverDrive::GAIN_RATE[KGC]
$game_party.existing_members.each { |actor|
actor.overdrive += od_gain if actor.drive_victory?
}
when 1 # Escape
od_gain = KGC::OverDrive::GAIN_RATE[KGC]
$game_party.existing_members.each { |actor|
actor.overdrive += od_gain if actor.drive_escape?
}
end
end
#--------------------------------------------------------------------------
# ● Execute Battle Action
#--------------------------------------------------------------------------
alias execute_action_KGC_OverDrive execute_action
def execute_action
increase_overdrive_on_action

execute_action_KGC_OverDrive
end
#--------------------------------------------------------------------------
# ○ Increase Gauge on Action
#--------------------------------------------------------------------------
def increase_overdrive_on_action
battler = @active_battler
od_gain = 0
unit = (battler.actor? ? $game_party : $game_troop)

# Alone
if battler.drive_alone? && unit.existing_members.size == 1
od_gain += KGC::OverDrive::GAIN_RATE[KGC]
end
# Action
if battler.drive_action?
od_gain += KGC::OverDrive::GAIN_RATE[KGC]
end
# Fatal
if battler.drive_fatal? && battler.hp < battler.maxhp / 4
od_gain += KGC::OverDrive::GAIN_RATE[KGC]
end
# Guard
if battler.drive_guard? && battler.action.kind == 0 &&
battler.action.basic == 1
od_gain += KGC::OverDrive::GAIN_RATE[KGC]
end
battler.overdrive += od_gain
end
#--------------------------------------------------------------------------
# ● Execution of battle action: Skill
#--------------------------------------------------------------------------
alias execute_action_skill_KGC_OverDrive execute_action_skill
def execute_action_skill
execute_action_skill_KGC_OverDrive

consume_od_gauge
end
#--------------------------------------------------------------------------
# ○ Drive gauge consumption when skill is used
#--------------------------------------------------------------------------
def consume_od_gauge
skill = @active_battler.action.skill
@active_battler.overdrive -= @active_battler.calc_od_cost(skill)
end
end
[/spoiler]

[spoiler="YERD_PartyDisplay 2.0"]#=========================================================================
======
#
# Yanfly Engine RD - Display Party Data 2.0
# Last Date Updated: 2009.05.30
# Level: Easy
#
# This pretty much changes the party information window in battles to show the
# party member names horizontally than vertically. When structured as such,
# you'll be able to see the party members' faces and/or sprites. With the new
# arrangement, the player can also see up to four status effects on each actor
# as opposed to the original two. A big difference.
#
# Version 2.0 gives options to change font size, show extra gauges (for rage and
# morale) and no longer hides the actor sprite behind the states.
#
#===============================================================================
# Instructions
#===============================================================================
#
# Just put this script under Materials and that's it. If you'd like to change
# other settings such as showing the face graphic or changing its opacity, just
# scroll down a bit and make adjustments as necessary.
#
#===============================================================================
# Updates:
# ----------------------------------------------------------------------------
# o 2009.05.30 - Fixed max states shown bug.
# - Greatly improved drawing efficiency.
# o 2009.05.16 - Started and finished version 2.0.
# o 2009.02.23 - Started script and finished.
#===============================================================================
#
# Compatibility
# - Alias: Window_BattleStatus, initialize
# - Overwrites: Window_BattleStatus, draw_item
#
#===============================================================================

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

module YE
module BATTLE
module DISPLAY

# This changes what will and will not be shown. If you choose to shown
# the actor's face graphic, you can choose its opacity. 255 means it's
# fully visible while 0 means it's completely transparent. For the
# number of states shown, do not exceed 4 unless you want the states to
# overlap into the next actor's data window.
SHOW_ALLY_FACE = false
ALLY_FACE_OPACITY = 100
SHOW_ALLY_SPRITE = true
MAX_STATES_SHOWN = 4

# This governs the sizes used for each of the items in the display.
NAME_FONT_SIZE = 18
STAT_FONT_SIZE = 18

# This governs how HP and MP are shown. Here is a type listing for each
# individual one.
# Type 1 = Current Type 4 = Current & Percentage
# Type 2 = Current/Maximum Type 5 = Current/Max & Percent
# Type 3 = Percentage
SHOWN_HP_TYPE = 2
SHOWN_MP_TYPE = 2

# For those using Custom Skill Effects and would like to show Rage for
# your bar, input the ID's of the classes you would Rage to appear for.
# The reason this is dependent on class rather than character is because
# if the character switches classes to one that no longer uses rage, the
# rage meter will be useless there.
RAGE_CLASSES = []

# This governs the type of display used for Rage. Here's a list of the
# various types of way you can choose to display Rage. If you don't want
# rage to be displayed at all, set it to 0.
# Type 1 - Rage icon and number value appears in lower left corner. MP
# bar is moved over to give room for Rage bar.
# Type 2 - Rage icon and number value appears in lower right corner. MP
# bar is on the left side instead.
RAGE_DISPLAY = 1

# This governs the text shown for rage and the gauge colours used.
RAGE_TEXT = "RG"
RAGE_GAUGE1 = 2
RAGE_GAUGE2 = 10

# For those who are using Battler Stat Morale, this script can place a
# morale gauge under your MP bar (after pushing it upward).
GAUGE_MORALE = true
MORALE_TEXT = "Morale"
MORALE_GAUGE1 = 28 # This is for positive morale.
MORALE_GAUGE2 = 29 # This is for positive morale.
MORALE_GAUGE3 = 30 # This is for positive morale.
MORALE_GAUGE4 = 31 # This is for positive morale.

# For those who don't want an extra gauge but would still like to show
# morale, there's an icon you can display for it instead. Morale icon
# will not appear if morale is equal to zero.
ICON_MORALE = false
ICON_MORALE_HIGH = 242 # Appears when morale is positive.
ICON_MORALE_LOW = 241 # Appears when morale is negative.
MORALE_DIVISOR = 100 # How much morale shown is divided by.
MORALE_FONT_SIZE = 18 # This is the font size used for morale icon.
MORALE_COL_HIGH = 0 # This is the text colour used for high morale.
MORALE_COL_LOW = 8 # This is the text colour used for low morale.

end # end module DISPLAY
end # end module BATTLE
end # end module YE

#===============================================================================
# Don't touch anything past here or else your computer will explode and you will
# be a very sad person.
#===============================================================================

#==============================================================================
# Window_BattleStatus
#==============================================================================

class Window_BattleStatus < Window_Selectable

#--------------------------------------------------------------------------
# Alias Object Initialization
#--------------------------------------------------------------------------
alias displaypartydata_initialize initialize unless $@
def initialize
displaypartydata_initialize
@column_max = $game_party.members.size
@spacing = 0
end

#--------------------------------------------------------------------------
# Draw Item
#--------------------------------------------------------------------------
def draw_item(index)
rect = Rect.new(0, 0, 0, 0)
rect.width = 96
rect.height = 96
rect.x = index * 96
rect.y = 0
self.contents.clear_rect(rect)
self.contents.font.color = normal_color
@actor = $game_party.members[index]
draw_party_face(index)
draw_party_state(index)
draw_party_name(index)
draw_party_graphic(index)
draw_party_hp(index)
draw_party_mp(index)
draw_party_morale(index)
end
#--------------------------------------------------------------------------
# Update Cursor
#--------------------------------------------------------------------------
def update_cursor
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(@index * 96, 0, 96, 96)
end
end

#--------------------------------------------------------------------------
# Draw Party Face
#--------------------------------------------------------------------------
def draw_party_face(index)
return unless YE::BATTLE::DISPLAY::SHOW_ALLY_FACE
opacity = YE::BATTLE::DISPLAY::ALLY_FACE_OPACITY
@actor = $game_party.members[index]
face_name = @actor.face_name
face_index = @actor.face_index
bitmap = Cache.face(face_name)
rect = Rect.new(0, 0, 0, 0)
rect.x = face_index % 4 * 96 + 4 / 2
rect.y = face_index / 4 * 96 + 4 / 2
rect.width = 92
rect.height = 92
self.contents.blt(index * 96 + 2, 2, bitmap, rect, opacity)
bitmap.dispose
end

#--------------------------------------------------------------------------
# Draw Party State
#--------------------------------------------------------------------------
def draw_party_state(index)
return unless YE::BATTLE::DISPLAY::MAX_STATES_SHOWN > 0
dx = index * 96
dy = WLH * 1
dw = YE::BATTLE::DISPLAY::MAX_STATES_SHOWN * 24
draw_actor_state(@actor, dx, dy, dw)
end

#--------------------------------------------------------------------------
# Draw Party Graphic
#--------------------------------------------------------------------------
def draw_party_graphic(index)
return unless YE::BATTLE::DISPLAY::SHOW_ALLY_SPRITE
@actor = $game_party.members[index]
dx = index * 96 + 48
dy = WLH * 3 - YE::BATTLE::DISPLAY::STAT_FONT_SIZE + 16 + 2
if $imported["BattlerStatMorale"] and YE::BATTLE::DISPLAY::GAUGE_MORALE
dy -= YE::BATTLE::DISPLAY::STAT_FONT_SIZE
end
draw_character(@actor.character_name, @actor.character_index, dx, dy)
end

#--------------------------------------------------------------------------
# Draw Party Name
#--------------------------------------------------------------------------
def draw_party_name(index)
self.contents.font.color = hp_color(@actor)
self.contents.font.size = YE::BATTLE::DISPLAY::NAME_FONT_SIZE
dx = 96 * index + 4
dy = 0
dw = 94
if $imported["BattlerStatMorale"] and YE::BATTLE::DISPLAY::ICON_MORALE
dw -= 24
end
self.contents.draw_text(dx, dy, dw, WLH, @actor.name)
end

#--------------------------------------------------------------------------
# Draw Party HP
#--------------------------------------------------------------------------
def draw_party_hp(index)
dx = index * 96 + 2
dy = WLH * 3 - YE::BATTLE::DISPLAY::STAT_FONT_SIZE + 2
if $imported["BattlerStatMorale"] and YE::BATTLE::DISPLAY::GAUGE_MORALE
dy -= YE::BATTLE::DISPLAY::STAT_FONT_SIZE
end
dw = 92
draw_actor_hp_gauge(@actor, dx, dy, dw)
self.contents.font.size = YE::BATTLE::DISPLAY::STAT_FONT_SIZE
self.contents.font.color = system_color
self.contents.draw_text(dx + 2, dy + 4, 28, WLH, Vocab::hp_a, 0)
self.contents.font.color = hp_color(@actor)
text = sprintf("%d/%d", @actor.hp, @actor.maxhp)
percent = @actor.hp * 100.0 / @actor.maxhp
case YE::BATTLE::DISPLAY::SHOWN_HP_TYPE
when 1; text = @actor.hp
when 2; text = sprintf("%d/%d", @actor.hp, @actor.maxhp)
when 3; text = sprintf("%d%%", percent)
when 4; text = sprintf("%d %d%%", @actor.hp, percent)
when 5; text = sprintf("%d/%d %d%%", @actor.hp, @actor.maxhp, percent)
end
self.contents.draw_text(dx + 30, dy + 4, dw - 32, WLH, text, 2)
end

#--------------------------------------------------------------------------
# Draw Party HP
#--------------------------------------------------------------------------
def draw_party_mp(index)
dx = index * 96 + 2
dy = WLH * 3
if $imported["BattlerStatMorale"] and YE::BATTLE::DISPLAY::GAUGE_MORALE
dy -= YE::BATTLE::DISPLAY::STAT_FONT_SIZE
end
dw = 92
#---
move_mp_bar = false
if $imported["CustomSkillEffects"]
if YE::BATTLE::DISPLAY::RAGE_CLASSES.include?(@actor.class.id)
move_mp_bar = true
end
if $imported["SubclassSelectionSystem"] and @actor.subclass != nil
if YE::BATTLE::DISPLAY::RAGE_CLASSES.include?(@actor.subclass.id)
move_mp_bar = true
end
end
end
if move_mp_bar and YE::BATTLE::DISPLAY::RAGE_DISPLAY == 1
dw /= 2
dx += dw
draw_party_rage(index)
elsif move_mp_bar and YE::BATTLE::DISPLAY::RAGE_DISPLAY == 1
dw /= 2
draw_party_rage(index)
end
#---
draw_actor_mp_gauge(@actor, dx, dy, dw)
self.contents.font.size = YE::BATTLE::DISPLAY::STAT_FONT_SIZE
self.contents.font.color = system_color
self.contents.draw_text(dx + 2, dy + 4, 28, WLH, Vocab::mp_a, 0)
self.contents.font.color = mp_color(@actor)
text = sprintf("%d/%d", @actor.mp, @actor.maxmp)
unless @actor.maxmp == 0
percent = @actor.mp * 100.0 / @actor.maxmp
else
percent = 0
end
case YE::BATTLE::DISPLAY::SHOWN_MP_TYPE
when 1; text = @actor.mp
when 2; text = sprintf("%d/%d", @actor.mp, @actor.maxmp)
when 3; text = sprintf("%d%%", percent)
when 4; text = sprintf("%d %d%%", @actor.mp, percent)
when 5; text = sprintf("%d/%d %d%%", @actor.mp, @actor.maxmp, percent)
end
self.contents.draw_text(dx + 30, dy + 4, dw - 32, WLH, text, 2)
end

#--------------------------------------------------------------------------
# Draw Party Rage
#--------------------------------------------------------------------------
def draw_party_rage(index)
return unless $imported["CustomSkillEffects"]
dx = 0
dy = WLH * 3
if $imported["BattlerStatMorale"] and YE::BATTLE::DISPLAY::GAUGE_MORALE
dy -= YE::BATTLE::DISPLAY::STAT_FONT_SIZE
end
dw = 92 / 2
if YE::BATTLE::DISPLAY::RAGE_DISPLAY == 1
dx = index * 96 + 2
elsif YE::BATTLE::DISPLAY::RAGE_DISPLAY == 2
dx = index * 96 + 2 + dw
end
draw_rage_gauge(@actor, dx, dy, dw)
self.contents.font.size = YE::BATTLE::DISPLAY::STAT_FONT_SIZE
self.contents.font.color = system_color
text = YE::BATTLE::DISPLAY::RAGE_TEXT
self.contents.draw_text(dx + 2, dy + 4, 28, WLH, text, 0)
self.contents.font.color = mp_color(@actor)
text = @actor.rage
self.contents.draw_text(dx + 30, dy + 4, dw - 32, WLH, text, 2)
end

#--------------------------------------------------------------------------
# Draw Rage Gauge
#--------------------------------------------------------------------------
def draw_rage_gauge(actor, x, y, width = 120)
return unless $imported["CustomSkillEffects"]
gc0 = gauge_back_color
gc1 = text_color(YE::BATTLE::DISPLAY::RAGE_GAUGE1)
gc2 = text_color(YE::BATTLE::DISPLAY::RAGE_GAUGE2)
gh = 6
gy = y + WLH - 8 - (gh - 6)
gb = width
self.contents.fill_rect(x, gy, gb, gh, gc0)
if actor.rage <= 0
gw = 0
else
gw = gb * actor.rage / YE::BATTLE::MAX_RAGE
end
self.contents.gradient_fill_rect(x, gy, gw, gh, gc1, gc2)
end

#--------------------------------------------------------------------------
# Draw Party Morale
#--------------------------------------------------------------------------
def draw_party_morale(index)
return unless $imported["BattlerStatMorale"]
draw_morale_icon(index)
return unless YE::BATTLE::DISPLAY::GAUGE_MORALE
dx = index * 96 + 2
dy = WLH * 3
dw = 92
draw_morale_gauge(@actor, dx, dy, dw)
self.contents.font.size = YE::BATTLE::DISPLAY::STAT_FONT_SIZE
self.contents.font.color = system_color
text = YE::BATTLE::DISPLAY::MORALE_TEXT
self.contents.draw_text(dx + 2, dy + 4, 44, WLH, text, 0)
self.contents.font.color = normal_color
text = sprintf("%+d", @actor.morale)
self.contents.draw_text(dx + 46, dy + 4, 44, WLH, text, 2)
end

#--------------------------------------------------------------------------
# Draw Morale Gauge
#--------------------------------------------------------------------------
def draw_morale_gauge(actor, x, y, width = 120)
return unless $imported["BattlerStatMorale"]
gc0 = gauge_back_color
gc1 = text_color(YE::BATTLE::DISPLAY::MORALE_GAUGE1)
gc2 = text_color(YE::BATTLE::DISPLAY::MORALE_GAUGE2)
gc3 = text_color(YE::BATTLE::DISPLAY::MORALE_GAUGE3)
gc4 = text_color(YE::BATTLE::DISPLAY::MORALE_GAUGE4)
gh = 6
gy = y + WLH - 8 - (gh - 6)
gb = width
self.contents.fill_rect(x, gy, gb, gh, gc0)
if actor.morale == 0
gw = 0
elsif actor.morale > 0
gw = gb * actor.morale / actor.max_morale
self.contents.gradient_fill_rect(x, gy, gw, gh, gc1, gc2)
else
gw = gb * actor.morale / actor.min_morale
x += gb - gw
self.contents.gradient_fill_rect(x, gy, gw, gh, gc3, gc4)
end
end

#--------------------------------------------------------------------------
# Draw Morale Icon
#--------------------------------------------------------------------------
def draw_morale_icon(index)
return unless YE::BATTLE::DISPLAY::ICON_MORALE
morale = @actor.morale / YE::BATTLE::DISPLAY::MORALE_DIVISOR
return if morale == 0
dx = index * 96 + 72
dy = 0
if morale > 0
icon = YE::BATTLE::DISPLAY::ICON_MORALE_HIGH
colour = YE::BATTLE::DISPLAY::MORALE_COL_HIGH
else
icon = YE::BATTLE::DISPLAY::ICON_MORALE_LOW
colour = YE::BATTLE::DISPLAY::MORALE_COL_LOW
end
draw_icon(icon, dx, dy)
self.contents.font.size = YE::BATTLE::DISPLAY::MORALE_FONT_SIZE
self.contents.font.color = text_color(colour)
text = sprintf("%+d%%", morale)
self.contents.draw_text(dx + 2, dy + 2, 20, 20, text, 1)
end

end # end Window_BattleStatus

#===============================================================================
#
# END OF FILE
#
#===============================================================================

Immagine inserita
Spoiler




1 utente(i) stanno leggendo questa discussione

0 utenti, 1 ospiti, 0 utenti anonimi