Rpg²S Forum uses cookies. Read the Privacy Policy for more info. To remove this message, please click the button to the right:    I accept the use of cookies

Vai al contenuto

Rpg²S Forum uses cookies. Read the Privacy Policy for more info. To remove this message, please click the button to the right:    I accept the use of cookies

Screen Contest #90

Kamikun






  • Si prega di effettuare il log in prima di rispondere
Addon per Overdrive

    Bartowski
  • Nuovo Arrivato

  • Utenti
  • Rens: 8
  • 0
  • Stelletta
  • 28 messaggi
  • Sesso:Maschio
  • Provenienza:Burbank

#1 Inviato 08 April 2012 - 18:30 PM

Salve,
vorrei se possibile un add-on per Kgc Overdrive che vi allego qua sotto.
Praticamente quando la barra overdrive arriva al 100% a destra tra i comandi Attacca,magia,difesa,oggetti spuntasse fuori un comando overdrive dove se ci clicchi puoi scegliere la mossa "finale" da fare;un po come il limit break di ff7.(uso il tanketai la prima versione)
Grazie in anticipo

#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
#_/ ◆ OverDrive System - KGC_OverDrive ◆ VX ◆
#_/ ◇ Last Update: 2009/11/01 ◇
#_/ ◆ Original Translation by Touchfuzzy ◆
#_/ ◆ Updates by Mr. Anonymous & Mr. Bubble ◆
#_/ ◆ KGC Site: ◆
#_/ ◆ http://ytomy.sakura.ne.jp/
#_/-----------------------------------------------------------------------------
#_/ This script allows you to create skills that are not usable in
#_/ battle until a character gains enough points from specified actions to use
#_/ them.
#_/-----------------------------------------------------------------------------
#_/ ++ Creating Overdrive Skills (Basic) ++
#_/ To set up a skill as an "Overdrive" skill (which cannot be used until
#_/ the Overdrive Gauge is full), go into the database, click the Skills tab,
#_/ locate the skill you desire, and then enter <overdrive> into the "Notes"
#_/ text box.
#_/-----------------------------------------------------------------------------
#_/ ++ Creating Overdrive Skills (Advanced Options) ++
#_/ You can specify how many points an Overdrive skill consumes in order to
#_/ be used. The tag for this is <overdrive n> (where n = OD points)
#_/
#_/ EXAMPLE: <overdrive 1500> would require that user has at least 1500
#_/ Overdrive points before being able to use the skill.
#_/-- --
#_/ You can also make skills that increase in power the more extra Overdrive
#_/ points the user has. Use the tag <overdrive n+> (where n = OD points).
#_/
#_/ EXAMPLE: <overdrive 1000+> would consume all of the user's Overdrive
#_/ points. If the user has any extra Overdrive points over 1000, the excess
#_/ points will be used to calculate the extra power the skill receives.
#_/ The extra power formula is:
#_/ damage = original_damage * ( user's_total_OD_points / n )
#_/-----------------------------------------------------------------------------
#_/ ++ Adjusting Overdrive Gain Rate by Skills ++
#_/ Also, you have the option to have skills increase the Overdrive Gauge more
#_/ or less than normal. To do so, enter <od_gain_rate n%>
#_/ (where n = a number) into the skill's "Notes" box.
#_/
#_/ EXAMPLE: <od_gain_rate 200%> would increase Overdrive Points
#_/ gained from using this skill by 200% (x2).
#_/-----------------------------------------------------------------------------
#_/ ++ Creating Overdrive Increasing Items & Skills ++
#_/ To create items and skills that increase, decrease or drain Overdrive
#_/ gauge points, go into the database, click on the Items tab, locate the
#_/ item/skill you desire, and then enter <od_add n> (where n = a number)
#_/ into the "Notes" text box. Do not include a percent sign (%) with this
#_/ tag.
#_/
#_/ Example #1: <od_add +250> would directly increase the target's Overdrive
#_/ by 250 points.
#_/ Example #2: <od_add -100> would decrease the target's Overdrive by
#_/ 100 points.
#_/=============================================================================
#_/ ++ Script Commands ++
#_/ These commands are used in "Script" function in the third page of event
#_/ commands under "Advanced". Do not include the asterisk (*).
#_/
#_/ Increase OverDrive for an actor:
#_/ * gain_actor_od_gauge(ActorID, Increase)
#_/
#_/ Increase OverDrive for an enemy:
#_/ * gain_enemy_od_gauge(enemy_index, Increase)
#_/
#_/ Copy an actor's current overdrive points into a game variable:
#_/ * get_actor_od_gauge(ActorID, VariableID)
#_/
#_/ Copy an enemy's current overdrive points into a game variable:
#_/ * get_enemy_od_gauge(enemy_index, VariableID)
#_/
#_/ Change an actor's maximum number of overdrive gauges:
#_/ * set_actor_od_gauge_number(ActorID, number)
#_/
#_/ Change an enemy's maximum number of overdrive gauges:
#_/ * set_enemy_od_gauge_number(enemy_index, number)
#_/
#_/ Returns true if the actor has a full Overdrive gauge:
#_/ * actor_od_gauge_max?(ActorID)
#_/
#_/ Returns true if the enemy has a full Overdrive gauge:
#_/ * enemy_od_gauge_max?(enemy_index)
#_/
#_/ Modify an actor's drive types:
#_/ * set_actor_drive_type(ActorID, [DriveTypes])
#_/
#_/ Modify an enemy's drive types:
#_/ * set_enemy_drive_type(enemy_index, [DriveTypes])
#_/
#_/ [ Quick Key: ]
#_/ [ ActorID = The ID number of the selected Actor in the database. ]
#_/ [ Setting this to -1 will effect all actors. ]
#_/ [ ]
#_/ [ enemy_index = The index number of the Enemy in the current troop ]
#_/ [ where 0 is the first enemy and 7 is the last enemy (0-7). ]
#_/ [ Setting this to -1 will effect all enemies in battle. ]
#_/ [ ]
#_/ [ Increase = The amount of Overdrive points to increase or decrease. ]
#_/ [ ]
#_/ [ DriveTypes = The drive types as seen below in the customization block ]
#_/ [ "DEFAULT_ACTOR_DRIVE_TYPE". If this is omitted, it's reset to default. ]
#_/ [ ]
#_/ [ VariableID = The ID number of a game variable in the database. ]
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
#=============================================================================#
# ★ 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 ◆
# Allows you to specify how many gauges a battler can have. 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

# ◆ KGC_GenericGauge Settings
# These gauge settings only apply when KGC_GenericGauge is installed
# true : Use GenericGauge image
# false : Do not use generic gauge image
ENABLE_GENERIC_GAUGE = true
# ◆ Overdrive Gauge Image Settings
# Images must be placed in the Graphics/System folder in your project.
GAUGE_IMAGE = "GaugeOD" # Normal Gauge Image
GAUGE_MAX_IMAGE = "GaugeODMax" # Maximum Gauge Image
GAUGE_OFFSET = [-23, -2] # Position Offset[x, y]
GAUGE_LENGTH = -4 # Length Correction
GAUGE_SLOPE = 30 # Gauge slant in degrees (-89 ~ 89)
# ◆ 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: OD Points - Displays the current amount as a straight number.
# 2: Ratio 1 --> x%
# 3: Ratio 2 --> x.x%
# 4: Ratio 3 --> x.xx%
# 5: Full Gauges - Displays total number of full gauges
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 = false
# ◆ 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

# ◆ In-Battle Overdrive Gauge Message Name
# The name for "Overdrive" when using items that affect Overdrive.
GAUGE_NAME = "Overdrive"
# ◆ In-battle Overdrive Messages
# These messages are shown when using items that affect Overdrive.
# First %s : battler's Name
# Second %s : String as defined for GAUGE_NAME above.
OD_GAIN_MESSAGE = {
:drain_a => "%s's %s was drained!", # Absorbtion : Actor
:drain_e => "%s's %s was drained!", # Absorbtion : Enemy
:loss_a => "%s's %s decreased!", # Decrease : Actor
:loss_e => "%s's %s decreased!", # Decrease : Enemy
:recover_a => "%s's %s increased!", # Increase : Actor
:recover_e => "%s's %s increased!", # Increase : Enemy
} # <- Do not delete.
end
end
#==============================================================================
# ☆ Customize END ☆
#==============================================================================
$imported = {} if $imported == nil
$imported["OverDrive"] = true
module KGC::OverDrive
# ドライブタイプ
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
# 蓄積量表記
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
module Regexp
module UsableItem
# Overdrive gain; first regexp was changed from original JP
OD_GAIN = /<(?:OD_INCREASE|od_add)\s*([\+\-]?\d+)>/i
end
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_id : アクター ID (-1 : パーティ全体)
# value : 増加量 (マイナスも可)
#--------------------------------------------------------------------------
def gain_actor_od_gauge(actor_id, value)
if actor_id == -1
# 生存メンバー全員のゲージを操作
$game_party.existing_members.each { |actor|
next unless actor.can_gain_overdrive?
actor.overdrive += value
}
else
actor = $game_actors[actor_id]
actor.overdrive += value if actor != nil && actor.exist?
end
end
#--------------------------------------------------------------------------
# ○ エネミーのドライブゲージの増減
# enemy_index : エネミー index (-1 : 全体)
# value : 増加量 (マイナスも可)
#--------------------------------------------------------------------------
def gain_enemy_od_gauge(enemy_index, value)
if enemy_index == -1
# 生存エネミー全員のゲージを操作
$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
#--------------------------------------------------------------------------
# ○ アクターのドライブゲージの取得
# actor_id : アクター ID
# variable_id : 戻り値を格納する変数 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
#--------------------------------------------------------------------------
# ○ エネミーのドライブゲージの取得
# enemy_index : エネミー index
# variable_id : 戻り値を格納する変数 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
#--------------------------------------------------------------------------
# ○ アクターのドライブゲージの本数を設定
# actor_id : アクター ID (-1 : パーティ全体)
# number : ゲージ本数
#--------------------------------------------------------------------------
def set_actor_od_gauge_number(actor_id, number)
if actor_id == -1
# メンバー全員の本数を設定
$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
#--------------------------------------------------------------------------
# ○ エネミーのドライブゲージの本数を設定
# enemy_index : エネミー index (-1 : 全体)
# number : ゲージ本数
#--------------------------------------------------------------------------
def set_enemy_od_gauge_number(enemy_index, number)
if enemy_index == -1
# 生存エネミー全員の本数を設定
$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
#--------------------------------------------------------------------------
# ○ アクターのドライブゲージが最大か判定
# actor_id : アクター ID
#--------------------------------------------------------------------------
def actor_od_gauge_max?(actor_id)
actor = $game_actors[actor_id]
return false if actor == nil
return actor.overdrive == actor.max_overdrive
end
#--------------------------------------------------------------------------
# ○ エネミーのドライブゲージが最大か判定
# enemy_index : エネミー 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
#--------------------------------------------------------------------------
# ○ アクターのドライブタイプの変更
# actor_id : アクター ID (-1 : パーティ全体)
# types : ドライブタイプの配列 (省略時 : 初期化)
#--------------------------------------------------------------------------
def set_actor_drive_type(actor_id, types = nil)
if actor_id == -1
# メンバー全員のドライブタイプを変更
$game_party.members.each { |actor|
actor.drive_type = types
}
else
actor = $game_actors[actor_id]
actor.drive_type = types if actor != nil
end
end
#--------------------------------------------------------------------------
# ○ エネミーのドライブタイプの変更
# enemy_index : エネミー index (-1 : 全体)
# types : ドライブタイプの配列 (省略時 : 初期化)
#--------------------------------------------------------------------------
def set_enemy_drive_type(enemy_index, types = nil)
if enemy_index == -1
# エネミー全員のドライブタイプを変更
$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
class Game_Interpreter
include KGC::Commands
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ RPG::UsableItem
#==============================================================================
class RPG::UsableItem < RPG::BaseItem
#--------------------------------------------------------------------------
# ○ オーバードライブのキャッシュ生成
#--------------------------------------------------------------------------
def create_overdrive_cache
@__od_gain = 0
self.note.each_line { |line|
case line
when KGC::OverDrive::Regexp::UsableItem::OD_GAIN
# ドライブゲージ増加
@__od_gain = $1.to_i
end
}
end
#--------------------------------------------------------------------------
# ○ ドライブゲージ増加量
#--------------------------------------------------------------------------
def od_gain
create_overdrive_cache if @__od_gain == nil
return @__od_gain
end
#--------------------------------------------------------------------------
# ○ ドライブスキルであるか
#--------------------------------------------------------------------------
def overdrive
return false
end
alias overdrive? overdrive
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ RPG::Skill
#==============================================================================
class RPG::Skill < RPG::UsableItem
#--------------------------------------------------------------------------
# ○ オーバードライブのキャッシュ生成
#--------------------------------------------------------------------------
def create_overdrive_cache
super
@__is_overdrive = false
@__od_cost = KGC::OverDrive::GAUGE_MAX
@__od_consume_all = false
@__od_gain_rate = 100
self.note.each_line { |line|
case line
when KGC::OverDrive::Regexp::Skill::OVER_DRIVE
# オーバードライブ
@__is_overdrive = true
@__od_cost = $1.to_i if $1 != nil
@__od_consume_all = ($2 != nil)
when KGC::OverDrive::Regexp::Skill::OD_GAIN_RATE
# ゲージ増加率
@__od_gain_rate = $1.to_i
end
}
# ドライブスキルでなければ、ゲージ消費量 0
unless @__is_overdrive
@__od_cost = 0
end
end
#--------------------------------------------------------------------------
# ○ ドライブスキルであるか
#--------------------------------------------------------------------------
def overdrive
create_overdrive_cache if @__is_overdrive == nil
return @__is_overdrive
end
alias overdrive? overdrive
#--------------------------------------------------------------------------
# ○ ドライブゲージ消費量
#--------------------------------------------------------------------------
def od_cost
create_overdrive_cache if @__od_cost == nil
return @__od_cost
end
#--------------------------------------------------------------------------
# ○ ドライブゲージ全消費か
#--------------------------------------------------------------------------
def od_consume_all
create_overdrive_cache if @__od_consume_all == nil
return @__od_consume_all
end
alias od_consume_all? od_consume_all
#--------------------------------------------------------------------------
# ○ ドライブゲージ増加率
#--------------------------------------------------------------------------
def od_gain_rate
create_overdrive_cache if @__od_gain_rate == nil
return @__od_gain_rate
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Vocab
#==============================================================================
module Vocab
# ドライブゲージ名
def self.overdrive
return KGC::OverDrive::GAUGE_NAME
end
# アクター側メッセージ
ActorODDrain = KGC::OverDrive::OD_GAIN_MESSAGE[:drain_a]
ActorODLoss = KGC::OverDrive::OD_GAIN_MESSAGE[:loss_a]
ActorODRecovery = KGC::OverDrive::OD_GAIN_MESSAGE[:recover_a]
# 敵側メッセージ
EnemyODDrain = KGC::OverDrive::OD_GAIN_MESSAGE[:drain_e]
EnemyODLoss = KGC::OverDrive::OD_GAIN_MESSAGE[:loss_e]
EnemyODRecovery = KGC::OverDrive::OD_GAIN_MESSAGE[:recover_e]
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Game_Battler
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_writer :drive_type # ドライブタイプ
attr_reader :od_damage # 行動結果: ドライブダメージ
#--------------------------------------------------------------------------
# ● 行動効果の保持用変数をクリア
#--------------------------------------------------------------------------
alias clear_action_results_KGC_OverDrive clear_action_results
def clear_action_results
clear_action_results_KGC_OverDrive
@od_damage = 0
end
#--------------------------------------------------------------------------
# ○ ドライブゲージ量取得
#--------------------------------------------------------------------------
def overdrive
@overdrive = 0 if @overdrive == nil
return @overdrive
end
#--------------------------------------------------------------------------
# ○ ドライブゲージの操作
#--------------------------------------------------------------------------
def overdrive=(value)
@overdrive = [[value, max_overdrive].min, 0].max
end
#--------------------------------------------------------------------------
# ○ ドライブゲージ最大量取得
#--------------------------------------------------------------------------
def max_overdrive
return KGC::OverDrive::GAUGE_MAX * drive_gauge_number
end
#--------------------------------------------------------------------------
# ○ ゲージ Max 判定
#--------------------------------------------------------------------------
def overdrive_max?
return (overdrive == max_overdrive)
end
#--------------------------------------------------------------------------
# ○ ドライブゲージ本数取得
#--------------------------------------------------------------------------
def drive_gauge_number
if @drive_gauge_number == nil
@drive_gauge_number = KGC::OverDrive::DEFAULT_GAUGE_NUMBER
end
return @drive_gauge_number
end
#--------------------------------------------------------------------------
# ○ ドライブゲージ本数の操作
#--------------------------------------------------------------------------
def drive_gauge_number=(value)
@drive_gauge_number = [value, 1].max
end
#--------------------------------------------------------------------------
# ○ ドライブタイプの取得
#--------------------------------------------------------------------------
def drive_type
return []
end
#--------------------------------------------------------------------------
# ○ ドライブスキル習得済み判定
#--------------------------------------------------------------------------
def overdrive_skill_learned?
return true
end
#--------------------------------------------------------------------------
# ○ ゲージ表示判定
#--------------------------------------------------------------------------
def od_gauge_visible?
return false
end
#--------------------------------------------------------------------------
# ○ ゲージ増加可否判定
#--------------------------------------------------------------------------
def can_gain_overdrive?
return true
end
#--------------------------------------------------------------------------
# ○ 攻撃時増加判定
#--------------------------------------------------------------------------
def drive_attack?
return drive_type.include?(KGC::OverDrive::Type::ATTACK)
end
#--------------------------------------------------------------------------
# ○ 被ダメージ時増加判定
#--------------------------------------------------------------------------
def drive_damage?
return drive_type.include?(KGC::OverDrive::Type::DAMAGE)
end
#--------------------------------------------------------------------------
# ○ 勝利時増加判定
#--------------------------------------------------------------------------
def drive_victory?
return drive_type.include?(KGC::OverDrive::Type::VICTORY)
end
#--------------------------------------------------------------------------
# ○ 逃走時増加判定
#--------------------------------------------------------------------------
def drive_escape?
return drive_type.include?(KGC::OverDrive::Type::ESCAPE)
end
#--------------------------------------------------------------------------
# ○ 孤独時増加判定
#--------------------------------------------------------------------------
def drive_alone?
return drive_type.include?(KGC::OverDrive::Type::ALONE)
end
#--------------------------------------------------------------------------
# ○ 行動時増加判定
#--------------------------------------------------------------------------
def drive_action?
return drive_type.include?(KGC::OverDrive::Type::ACTION)
end
#--------------------------------------------------------------------------
# ○ 瀕死時増加判定
#--------------------------------------------------------------------------
def drive_fatal?
return drive_type.include?(KGC::OverDrive::Type::FATAL)
end
#--------------------------------------------------------------------------
# ○ 防御時増加判定
#--------------------------------------------------------------------------
def drive_guard?
return drive_type.include?(KGC::OverDrive::Type::GUARD)
end
#--------------------------------------------------------------------------
# ● ステートの付加
# state_id : ステート 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
#--------------------------------------------------------------------------
# ○ スキルの消費ドライブゲージ計算
# skill : スキル
#--------------------------------------------------------------------------
def calc_od_cost(skill)
return 0 unless skill.is_a?(RPG::Skill)
return skill.od_cost
end
#--------------------------------------------------------------------------
# ● スキルの使用可能判定
# 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
#--------------------------------------------------------------------------
# ● スキルまたはアイテムによるダメージ計算
# user : スキルまたはアイテムの使用者
# obj : スキルまたはアイテム
# 結果は @hp_damage または @mp_damage に代入する。
#--------------------------------------------------------------------------
alias make_obj_damage_value_KGC_OverDrive make_obj_damage_value
def make_obj_damage_value(user, obj)
make_obj_damage_value_KGC_OverDrive(user, obj)
apply_od_consume_all_for_damage(user, obj)
end
#--------------------------------------------------------------------------
# ○ ゲージ全消費時の効果の適用
# user : スキルまたはアイテムの使用者
# obj : スキルまたはアイテム
# 結果は @hp_damage または @mp_damage に代入する。
#--------------------------------------------------------------------------
def apply_od_consume_all_for_damage(user, obj)
return unless obj.is_a?(RPG::Skill)
return unless obj.overdrive? && obj.od_consume_all?
# 余剰消費量に応じて強化 (例: 最低消費量 1000 でゲージが 1200 なら 1.2 倍)
rate = [user.overdrive * 1000 / obj.od_cost, 1000].max
@hp_damage = @hp_damage * rate / 1000
@mp_damage = @mp_damage * rate / 1000
end
#--------------------------------------------------------------------------
# ● ダメージの反映
# user : スキルかアイテムの使用者
# 呼び出し前に @hp_damage、@mp_damage、@absorbed が設定されていること。
#--------------------------------------------------------------------------
alias execute_damage_KGC_OverDrive execute_damage
def execute_damage(user)
execute_damage_KGC_OverDrive(user)
increase_overdrive(user)
increase_overdrive_by_item(user)
end
#--------------------------------------------------------------------------
# ○ 死亡時ドライブゲージ初期化処理
#--------------------------------------------------------------------------
def reset_overdrive_on_dead
return unless KGC::OverDrive::EMPTY_ON_DEAD
self.overdrive = 0
end
#--------------------------------------------------------------------------
# ○ ドライブゲージ増加処理
# attacker : 攻撃者
#--------------------------------------------------------------------------
def increase_overdrive(attacker = nil)
return unless attacker.is_a?(Game_Battler) # 攻撃者がバトラーでない
return unless actor? ^ attacker.actor? # 攻撃側と防御側が同じ
return if hp_damage == 0 && mp_damage == 0 # ダメージなし
increase_attacker_overdrive(attacker)
increase_defender_overdrive(attacker)
reset_overdrive_on_dead if dead?
end
#--------------------------------------------------------------------------
# ○ 攻撃側のドライブゲージ増加処理
# attacker : 攻撃者
#--------------------------------------------------------------------------
def increase_attacker_overdrive(attacker)
return unless can_gain_overdrive?
return unless attacker.drive_attack? # ドライブタイプ「攻撃」なし
od_gain = KGC::OverDrive::GAIN_RATE[KGC::OverDrive::Type::ATTACK]
if attacker.action.kind == 1
rate = attacker.action.skill.od_gain_rate # スキルの倍率を適用
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
end
#--------------------------------------------------------------------------
# ○ 防御側のドライブゲージ増加処理
# attacker : 攻撃者
#--------------------------------------------------------------------------
def increase_defender_overdrive(attacker)
return unless can_gain_overdrive?
return unless self.drive_damage? # ドライブタイプ「ダメージ」なし
rate = KGC::OverDrive::GAIN_RATE[KGC::OverDrive::Type::DAMAGE]
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
end
#--------------------------------------------------------------------------
# ○ アイテムによるドライブゲージ増加処理
# user : 使用者
#--------------------------------------------------------------------------
def increase_overdrive_by_item(user = nil)
return unless user.is_a?(Game_Battler)
return unless can_gain_overdrive?
if user.action.skill?
obj = user.action.skill
elsif user.action.item?
obj = user.action.item
else
return
end
@od_damage = -obj.od_gain
self.overdrive -= @od_damage
end
#--------------------------------------------------------------------------
# ● スキルの効果適用
# user : スキルの使用者
# skill : スキル
#--------------------------------------------------------------------------
alias skill_effect_KGC_OverDrive skill_effect
def skill_effect(user, skill)
skill_effect_KGC_OverDrive(user, skill)
# アイテムでスキルを発動した場合はゲージ消費判定を無視
if $imported["ReproduceFunctions"] && $game_temp.exec_skill_on_item
return
end
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● セットアップ
# actor_id : アクター ID
#--------------------------------------------------------------------------
alias setup_KGC_OverDrive setup
def setup(actor_id)
setup_KGC_OverDrive(actor_id)
@overdrive = 0
@drive_type = nil
end
#--------------------------------------------------------------------------
# ○ ドライブタイプの取得
#--------------------------------------------------------------------------
def drive_type
unless @drive_type.is_a?(Array)
return KGC::OverDrive::DEFAULT_ACTOR_DRIVE_TYPE
end
return @drive_type
end
#--------------------------------------------------------------------------
# ○ ドライブスキル習得済み判定
#--------------------------------------------------------------------------
def overdrive_skill_learned?
result = false
# 一時的に戦闘中フラグを解除
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
#--------------------------------------------------------------------------
# ○ ゲージ増加可否判定
#--------------------------------------------------------------------------
def can_gain_overdrive?
if KGC::OverDrive::NOT_GAIN_GAUGE_HIDING
# 非表示
return false unless od_gauge_visible_l?
end
if KGC::OverDrive::HIDE_GAUGE_NO_OD_SKILLS
# 未修得
return false unless overdrive_skill_learned?
end
return true
end
#--------------------------------------------------------------------------
# ○ ゲージ表示判定
#--------------------------------------------------------------------------
def od_gauge_visible?
return false unless od_gauge_visible_l?
return false unless can_gain_overdrive?
return true
end
#--------------------------------------------------------------------------
# ○ ゲージ表示判定 (簡易版)
#--------------------------------------------------------------------------
def od_gauge_visible_l?
# 戦闘中非表示
if KGC::OverDrive::HIDE_GAUGE_NOT_IN_BATTLE && !$game_temp.in_battle
return false
end
# 非表示
return false if KGC::OverDrive::HIDE_GAUGE_ACTOR.include?(self.id)
return true
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Game_Enemy
#==============================================================================
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# index : 敵グループ内インデックス
# enemy_id : 敵キャラ ID
#--------------------------------------------------------------------------
alias initialize_KGC_OverDrive initialize
def initialize(index, enemy_id)
initialize_KGC_OverDrive(index, enemy_id)
@overdrive = 0
@drive_type = nil
end
#--------------------------------------------------------------------------
# ○ ドライブタイプの取得
#--------------------------------------------------------------------------
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
#--------------------------------------------------------------------------
# ○ ドライブゲージの通常時の色 1 の取得
#--------------------------------------------------------------------------
def od_gauge_normal_color1
color = KGC::OverDrive::GAUGE_NORMAL_START_COLOR
return (color.is_a?(Integer) ? text_color(color) : color)
end
#--------------------------------------------------------------------------
# ○ ドライブゲージの通常時の色 2 の取得
#--------------------------------------------------------------------------
def od_gauge_normal_color2
color = KGC::OverDrive::GAUGE_NORMAL_END_COLOR
return (color.is_a?(Integer) ? text_color(color) : color)
end
#--------------------------------------------------------------------------
# ○ ドライブゲージの最大時の色 1 の取得
#--------------------------------------------------------------------------
def od_gauge_max_color1
color = KGC::OverDrive::GAUGE_MAX_START_COLOR
return (color.is_a?(Integer) ? text_color(color) : color)
end
#--------------------------------------------------------------------------
# ○ ドライブゲージの最大時の色 2 の取得
#--------------------------------------------------------------------------
def od_gauge_max_color2
color = KGC::OverDrive::GAUGE_MAX_END_COLOR
return (color.is_a?(Integer) ? text_color(color) : color)
end
#--------------------------------------------------------------------------
# ● 名前の描画
# actor : アクター
# x : 描画先 X 座標
# y : 描画先 Y 座標
#--------------------------------------------------------------------------
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
#--------------------------------------------------------------------------
# ○ ドライブゲージの描画
# actor : アクター
# x : 描画先 X 座標
# y : 描画先 Y 座標
# 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_max?
if KGC::OverDrive::ENABLE_GENERIC_GAUGE && $imported["GenericGauge"]
# 汎用ゲージ
file = (actor.overdrive_max? ?
KGC::OverDrive::GAUGE_MAX_IMAGE : KGC::OverDrive::GAUGE_IMAGE)
draw_gauge(file,
x, y, width, n, KGC::OverDrive::GAUGE_MAX,
KGC::OverDrive::GAUGE_OFFSET,
KGC::OverDrive::GAUGE_LENGTH,
KGC::OverDrive::GAUGE_SLOPE)
else
# デフォルトゲージ
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)
end
draw_actor_od_gauge_value(actor, x, y, width)
end
#--------------------------------------------------------------------------
# ○ ドライブゲージ蓄積量の描画
# actor : アクター
# x : 描画先 X 座標
# y : 描画先 Y 座標
# 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
#--------------------------------------------------------------------------
# ○ スキルをリストに含めるかどうか
# 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?)
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
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
end
end
end # <-- class
end # <-- if KGC::OverDrive::HIDE_SKILL_LACK_OF_GAUGE
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Scene_Skill
#==============================================================================
class Scene_Skill < Scene_Base
#--------------------------------------------------------------------------
# ● スキルの使用 (味方対象以外の使用効果を適用)
#--------------------------------------------------------------------------
alias use_skill_nontarget_KGC_OverDrive use_skill_nontarget
def use_skill_nontarget
consume_od_gauge
use_skill_nontarget_KGC_OverDrive
end
#--------------------------------------------------------------------------
# ○ スキル使用時のドライブゲージ消費
#--------------------------------------------------------------------------
def consume_od_gauge
if @skill.od_consume_all?
@actor.overdrive = 0
else
@actor.overdrive -= @actor.calc_od_cost(@skill)
end
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Scene_Battle
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# ● 戦闘終了
# result : 結果 (0:勝利 1:逃走 2:敗北)
#--------------------------------------------------------------------------
alias battle_end_KGC_OverDrive battle_end
def battle_end(result)
increase_overdrive_on_battle_end(result)
battle_end_KGC_OverDrive(result)
end
#--------------------------------------------------------------------------
# ○ 戦闘終了時のドライブゲージ増加処理
# result : 結果 (0:勝利 1:逃走 2:敗北)
#--------------------------------------------------------------------------
def increase_overdrive_on_battle_end(result)
case result
when 0 # 勝利
od_gain = KGC::OverDrive::GAIN_RATE[KGC::OverDrive::Type::VICTORY]
$game_party.existing_members.each { |actor|
actor.overdrive += od_gain if actor.drive_victory?
}
when 1 # 逃走
od_gain = KGC::OverDrive::GAIN_RATE[KGC::OverDrive::Type::ESCAPE]
$game_party.existing_members.each { |actor|
actor.overdrive += od_gain if actor.drive_escape?
}
end
end
#--------------------------------------------------------------------------
# ● 戦闘行動の実行
#--------------------------------------------------------------------------
alias execute_action_KGC_OverDrive execute_action
def execute_action
increase_overdrive_on_action
execute_action_KGC_OverDrive
end
#--------------------------------------------------------------------------
# ○ 行動時のドライブゲージ増加処理
#--------------------------------------------------------------------------
def increase_overdrive_on_action
battler = @active_battler
od_gain = 0
unit = (battler.actor? ? $game_party : $game_troop)
# 孤独戦闘
if battler.drive_alone? && unit.existing_members.size == 1
od_gain += KGC::OverDrive::GAIN_RATE[KGC::OverDrive::Type::ALONE]
end
# 行動
if battler.drive_action?
od_gain += KGC::OverDrive::GAIN_RATE[KGC::OverDrive::Type::ACTION]
end
# 瀕死
if battler.drive_fatal? && battler.hp < battler.maxhp / 4
od_gain += KGC::OverDrive::GAIN_RATE[KGC::OverDrive::Type::FATAL]
end
# 防御
if battler.drive_guard? && battler.action.kind == 0 &&
battler.action.basic == 1
od_gain += KGC::OverDrive::GAIN_RATE[KGC::OverDrive::Type::GUARD]
end
battler.overdrive += od_gain
end
#--------------------------------------------------------------------------
# ● 戦闘行動の実行 : スキル
#--------------------------------------------------------------------------
alias execute_action_skill_KGC_OverDrive execute_action_skill
def execute_action_skill
execute_action_skill_KGC_OverDrive
consume_od_gauge
end
#--------------------------------------------------------------------------
# ○ スキル使用時のドライブゲージ消費
#--------------------------------------------------------------------------
def consume_od_gauge
return unless @active_battler.action.skill?
skill = @active_battler.action.skill
if skill.od_consume_all?
@active_battler.overdrive = 0
else
@active_battler.overdrive -= @active_battler.calc_od_cost(skill)
end
end
#--------------------------------------------------------------------------
# ● ダメージの表示
# target : 対象者
# obj : スキルまたはアイテム
#--------------------------------------------------------------------------
alias display_damage_KGC_OverDrive display_damage
def display_damage(target, obj = nil)
display_damage_KGC_OverDrive(target, obj)
return if target.missed || target.evaded
display_od_damage(target, obj)
end
#--------------------------------------------------------------------------
# ○ ドライブダメージ表示
# target : 対象者
# obj : スキルまたはアイテム
#--------------------------------------------------------------------------
def display_od_damage(target, obj = nil)
return if target.dead?
return if target.od_damage == 0
if target.absorbed # 吸収
fmt = target.actor? ? Vocab::ActorODDrain : Vocab::EnemyODDrain
text = sprintf(fmt, target.name, Vocab::overdrive)
elsif target.od_damage > 0 # ダメージ
fmt = target.actor? ? Vocab::ActorODLoss : Vocab::EnemyODLoss
text = sprintf(fmt, target.name, Vocab::overdrive)
else # 回復
fmt = target.actor? ? Vocab::ActorODRecovery : Vocab::EnemyODRecovery
text = sprintf(fmt, target.name, Vocab::overdrive)
Sound.play_recovery
end
@message_window.add_instant_text(text)
wait(30)
end
end

Modificato da Bartowski, 08 April 2012 - 18:40 PM.


    Holy87
  • Prode Guerriero

  • Rpg²S Staff
  • Rens: 458
  • 6
  • StellettaStellettaStellettaStellettaStellettaStelletta
  • 7431 messaggi
  • Sesso:Maschio
  • Provenienza:San Giorgio a Cremano
  • Abilità:Maestro

#2 Inviato 08 April 2012 - 20:46 PM

Addon non ne conosco, ma non dovrebbe essere difficilissimo da programmare.

"Io non volevo solo partecipare alle discussioni. Volevo avere il potere di farle fallire" [cit.]

BannerOverdrive35.png
Cap3.png

578.png
 

Miei script per RPG Maker VX Ace:

Spoiler

 
I miei tutorial:
Spoiler

    Bartowski
  • Nuovo Arrivato

  • Utenti
  • Rens: 8
  • 0
  • Stelletta
  • 28 messaggi
  • Sesso:Maschio
  • Provenienza:Burbank

#3 Inviato 09 April 2012 - 16:46 PM

Per me si ^^




  • Feed RSS