- OlfavrelMembre
- Nombre de messages : 7
Distinction : aucune
Date d'inscription : 16/01/2014
Script Overdrive VX
Mar 3 Juin 2014 - 21:34
Bonjour à tous, à toutes,
J’espère ne pas me tromper de lieu en postant ici ma requête.
J'ai quelques problème avec des scripts d'Overdrive :
https://rpgmakervx.1fr1.net/t8842-script-kgc
Celui que j'ai récupéré ici ne fonctionne pas avec mon script d'invocation.
https://rpgmakervx.1fr1.net/t2819-overdrive?highlight=overdrive
Et celui-ci, en le testant avec aucun autres scripts, m'affiche :
J'ai bien mis le bon nom sur l'image et même testé avec d'autres images mais j'ai toujours le même message.
J'en appelle donc aux Grands Dieux qui vivent ici pour me venir en aide.
Si vous avez d'autres script pouvant les remplacer, ou bien même m'aider a régler le problème, je vous en remercie.
J’espère ne pas me tromper de lieu en postant ici ma requête.
J'ai quelques problème avec des scripts d'Overdrive :
https://rpgmakervx.1fr1.net/t8842-script-kgc
Celui que j'ai récupéré ici ne fonctionne pas avec mon script d'invocation.
- Spoiler:
- #=====================================
# [VX] Invocations à la FF X
# Fait le 16/11/2008
# Par Blockade // Version : 1.0
# http://rpg-maker-vx.bbactif.com/
#=====================================
#==Utilisation===================
# Pour invoquer, créer une compétence qui appelle un événement commun
# Dans cet événement appelez un script : Invocation.new(Id_de_l'invocation)
# En remplaçant Id_de_l'invocation par l'ID de créature que vous voulez invoquer
# L'invocation, doit se trouver dans la Partie ou vous définissez les héros dans la Base de Données.
#==Remarques=============
# - L'invocation en prend pas d'expérience, elle se met au même niveau que l'invoqueur définit par
# Invoqueur =1 dans le module de configuration
# - Si vous utilisez le SBS pensez à modifier Deduction_numduration pour que les dégâts de restent pas affichés
#=============================================================
# Début de la configuration #
module CONFIG_INVOC
Invoqueur = 9 # ID de l'invoqueur
#====================== Attention !=======================
# Id_invoc et Id_sort_Invoc doivent être de la même taille !
# Si par exemple avec les sort qui ont respectivement pour ID 1 et 5
# vous invoquez les créatures qui on respectivement pour ID 2,18 :
# Id_invoc = [1,5]
# Id_sort_invoc = [2,18]
#====================== Attention !=======================
Id_invoc = [13,14,15,16] # Les ID des invocations
Id_sort_invoc = [83,84,85,86] # Les compétences qui invoquent les créatures
UTIL_SBS = false # Si vous utilisez le SBS mettez true, sinon false
# A configurer que si vous utilisez le SBS
Deduction_numduration = 8 # Si les dégâts restent affiché après la mort de l'invocation augmentez ce chiffre
end
# Fin de la configuration #
#=============================================================
#=====================================
# Retire les héros et ajoute l'invocation
#=====================================
class Invocation < Game_Party
def initialize(invoc)
$if_invoc = true
$invoc = invoc
$membre_equipe = $game_party.members
for actor in $game_party.members
if actor.id == CONFIG_INVOC::Invoqueur
invoqueur_level = actor.level
end
$game_party.remove_actor(actor.id)
end
$game_party.add_actor(invoc)
for actor in $game_party.members
actor.change_level(invoqueur_level,false)
actor.recover_all
end
end
end
#=====================================
# Réecriture du processus de Victoire
#=====================================
class Scene_Battle < Scene_Base
def process_victory
@info_viewport.visible = false
@message_window.visible = true
RPG::BGM.stop
$game_system.battle_end_me.play
unless $BTEST
$game_temp.map_bgm.play
$game_temp.map_bgs.play
end
if $if_invoc == true
$game_party.remove_actor($invoc)
for actor in $membre_equipe
$game_party.add_actor(actor.id)
end
$if_invoc = false
end
for i in 0 ... CONFIG_INVOC::Id_invoc.size
$game_actors[CONFIG_INVOC::Id_invoc[i]].recover_all
end
display_exp_and_gold
display_drop_items
display_level_up
battle_end(0)
end
#=====================================
# Réecriture du processus de Fuite
#=====================================
def process_escape
@info_viewport.visible = false
@message_window.visible = true
text = sprintf(Vocab::EscapeStart, $game_party.name)
$game_message.texts.push(text)
if $game_troop.preemptive
success = true
else
success = (rand(100) < @escape_ratio)
end
Sound.play_escape
if success
wait_for_message
if $if_invoc == true
$game_party.remove_actor($invoc)
for actor in $membre_equipe
$game_party.add_actor(actor.id)
end
$if_invoc = false
process_action
end
for i in 0 ... CONFIG_INVOC::Id_invoc.size
$game_actors[CONFIG_INVOC::Id_invoc[i]].recover_all
end
battle_end(1)
else
@escape_ratio += 10
$game_message.texts.push('\.' + Vocab::EscapeFailure)
wait_for_message
$game_party.clear_actions
start_main
end
end
#=====================================
# Réecriture du processus de Défaite
#=====================================
def process_defeat
if $if_invoc == true
$game_party.remove_actor($invoc)
for actor in $membre_equipe
$game_party.add_actor(actor.id)
end
$if_invoc = false
else
@info_viewport.visible = false
@message_window.visible = true
text = sprintf(Vocab::Defeat, $game_party.name)
$game_message.texts.push(text)
wait_for_message
battle_end(2)
end
end
end
#==============================
# Utilisation du SBS ?
#==============================
if CONFIG_INVOC::UTIL_SBS == false
class Sprite_Battler < Sprite_Base
def necessary
nece1 = @active_action[3]
nece2 = @active_action[4]
# ターゲットチェック
case @active_action[1]
# 0自身 1ターゲット 2敵全体 3味方全体
when 0
if @battler.guarding? and $if_invoc == true
target = $game_troop.members
else
target = [$game_party.members[@battler.index]] if @battler.is_a?(Game_Actor)
target = [$game_troop.members[@battler.index]] if @battler.is_a?(Game_Enemy)
end
when 1
target = @target_battler
when 2
target = $game_troop.members
when 3
target = $game_party.members
end
# ターゲットが空の場合は失敗とみなす
return start_action(@battler.recover_action) if target.size == 0
# 内容チェック
case @active_action[2]
# ステートID指定だった場合
when 0
# 補足が正で「ステートにかかっている」、負は「かかっていない」が条件に
state_on = true if nece2 > 0
# 条件人数を出す
state_member = nece2.abs
# 0は仲間数を出す
if nece2 == 0
state_member = $game_party.members.size if @battler.is_a?(Game_Actor)
state_member = $game_troop.members.size if @battler.is_a?(Game_Enemy)
end
# ターゲットのステートチェックし人数をカウント
for member in target
state_member -= 1 if member.state?(nece1)
end
# 条件が満たされていればアクション続行
if state_member == 0 && state_on
return
elsif state_member == nece2.abs
return if state_on == nil
end
# パラメータ指定だった場合
when 1
# 補足が正で「数値以上」、負は「数値以下」が条件に
num_over = true if nece2 > 0
# 参照数値
num = 0
# ターゲットのパラメータチェック
for member in target
# 参照パラメータで分岐
case nece1
when 0 # 現HP
num += member.hp
when 1 # 現MP
num += member.mp
when 2 # 攻撃力
num += member.atk
when 3 # 防御力
num += member.def
when 4 # 精神力
num += member.spi
when 5 # 敏捷性
num += member.agi
end
end
# 平均を出す
num = num / target.size
# 条件が満たされていればアクション続行
if num > nece2.abs && num_over
return
elsif num < nece2.abs
return if num_over == nil
end
# スイッチ指定だった場合
when 2
# 条件が満たされていればアクション続行
if $game_switches[nece1]
# 補足がtrueで「スイッチON」、falseは「スイッチOFF」が条件に
return if nece2
# スイッチがOFFの場合はON時とは逆に
else
return unless nece2
end
# 変数指定だった場合
when 3
# 補足が正で「数値以上」、負は「数値以下」が条件に
if nece2 > 0
return if $game_variables[nece1] > nece2
else
return unless $game_variables[nece1] > nece2.abs
end
# 習得スキル指定だった場合
when 4
# スキル条件人数を出す
skill_member = nece2.abs
for member in target
skill_member -= 1 if member.skill_learn?(nece1)
# 条件確認
return if skill_member == 0
end
end
# 条件を満たせなければ以降のアクションを中断
return @action = ["End"] if @non_repeat
# 防御中は不自然に見えないように座標復帰させない
action = @battler.recover_action
action = @battler.defence if @battler.guarding?
return start_action(action)
end
end
class Sprite_Damage < Sprite_Base
def damage_pop(num = nil)
reset
damage = battler.hp_damage
# ステートの変化を抜き出す
states = battler.added_states
text = ""
# MPダメージ用テキスト(HPMP両方同時ダメージは除く)
if !@battler.double_damage && @battler.mp_damage != 0
text = N01::POP_MP_DAM if battler.mp_damage > 0
text = N01::POP_MP_REC if battler.mp_damage < 0
damage = battler.mp_damage
end
# SLIPDAMAGEはMPダメージ以外文字を表示させない
if num == nil
text = N01::POP_DAMAGE0 if damage == 0 && states == [] && !battler.revival
text = N01::POP_MISS if battler.missed && states == []
text = N01::POP_EVA if battler.evaded
text = N01::POP_CRI if battler.critical
for state in states
# POPなし設定のステートは表示させない
unless state.extension.include?("NOPOP")
text += " " if text != ""
text += state.name
end
end
else
damage = num
end
# ダメージと回復を分ける
@minus = false
@minus = true if damage < 0
damage = damage.abs
# POP位置微調整
adjust = -16
adjust = 16 if $back_attack
adjust = 0 if damage == 0
@x = battler.position_x + adjust
@y = battler.position_y
window(text) if text != ""
@pop_time = N01::NUM_DURATION
if $if_invoc == true
@pop_time = N01::NUM_DURATION - CONFIG_INVOC::Deduction_numduration
end
# ダメージがなければ数字のPOPをさせない
return @duration = @pop_time if damage == 0
@num_time = -1
damage_file(@num1, damage % 10, @pop_time - 7) if damage >= 0
damage_file(@num2, (damage % 100)/10, @pop_time - 5) if damage >= 10
damage_file(@num3, (damage % 1000)/100, @pop_time - 3) if damage >= 100
damage_file(@num4, (damage % 10000)/1000, @pop_time - 1) if damage >= 1000
damage_file(@num5, (damage % 100000)/10000, @pop_time + 1) if damage >= 10000
end
end
end
#================================================
# Si les HP de l'invocs tombent à 0 désactiver la compétence
#================================================
class Game_Battler
def skill_can_use?(skill)
return false unless skill.is_a?(RPG::Skill)
return false unless movable?
for i in 0 ... CONFIG_INVOC::Id_invoc.size
return false if $game_actors[CONFIG_INVOC::Id_invoc[i]].hp == 0 and CONFIG_INVOC::Id_sort_invoc[i] == skill.id
end
return false if silent? and skill.spi_f > 0
return false if calc_mp_cost(skill) > mp
if $game_temp.in_battle
return skill.battle_ok?
else
return skill.menu_ok?
end
end
end
https://rpgmakervx.1fr1.net/t2819-overdrive?highlight=overdrive
Et celui-ci, en le testant avec aucun autres scripts, m'affiche :
J'ai bien mis le bon nom sur l'image et même testé avec d'autres images mais j'ai toujours le même message.
J'en appelle donc aux Grands Dieux qui vivent ici pour me venir en aide.
Si vous avez d'autres script pouvant les remplacer, ou bien même m'aider a régler le problème, je vous en remercie.
Re: Script Overdrive VX
Mar 3 Juin 2014 - 22:37
Tu a bien copier les deux partie l'une après l'autre?
Est a-tu bien placer l'image dans le dossier "System"?
Qui doit avoir comme nom: od-gauge.png
Si tu veux changer le nom, essai de trouve cette ligne:
Sinon essai de tester juste le script OverDrive, dans un projet vierge (sans script, etc...)
Est a-tu bien placer l'image dans le dossier "System"?
Qui doit avoir comme nom: od-gauge.png
Si tu veux changer le nom, essai de trouve cette ligne:
- Code:
@@_od_jauge = RPG::Cache.picture("od_gauge.png")
Sinon essai de tester juste le script OverDrive, dans un projet vierge (sans script, etc...)
- OlfavrelMembre
- Nombre de messages : 7
Distinction : aucune
Date d'inscription : 16/01/2014
Re: Script Overdrive VX
Mar 3 Juin 2014 - 22:57
J'ai déjà fait tout ça mais ça ne change rien du tout.
Les deux parties sont bien copiées et j'ai essayé de changer le nom dans cette ligne mais ça ne fonctionne pas non plus.
Et que ce soit dans un projet vierge ou un projet avec plusieurs script, c'est la même chose.
Les deux parties sont bien copiées et j'ai essayé de changer le nom dans cette ligne mais ça ne fonctionne pas non plus.
Et que ce soit dans un projet vierge ou un projet avec plusieurs script, c'est la même chose.
Re: Script Overdrive VX
Mar 3 Juin 2014 - 23:06
Apparemment, t'est pas le seul a avoir un problème!
- Code:
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
#_/ ◆ Overdrive System - KGC_OverDrive ◆ VX ◆
#_/ ◇ Last update : 2008/03/13 ◇
#_/ ◆ Translation by Touchfuzzy ◆
#_/ ◆ Additional polish by Mr. Anonymous ◆
#_/-----------------------------------------------------------------------------
#_/ ★ 2008/04/09 UPDATE [MRA] ★
#_/ The defend command may now increase the Overdrive guage. Also added an
#_/ option to have sound effects when the guage becomes full.
#_/-----------------------------------------------------------------------------
#_/ ★ 2008/03/13 UPDATE [KCG] ★
#_/ Several minor bugs fixed.
#_/-----------------------------------------------------------------------------
#_/ 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 <overdrive> into the "Notes"
#_/ text box. Also, you may desire some skills to increase the Overdrive Gauge
#_/ more than others.
#_/ To do so, enter <OD_GAIN n%> (where n = a number) into the desired skill's
#_/ "Notes" box. Example: <OD_GAIN 200%> would increase Overdrive Points
#_/ gained from Attack Gain Rate (80 by default) by 200 percent (x2).
#_/ The formula for this is [attackgainrate * n / 100]
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
#===============================================================================
# ★ 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 = 150
# ◆ Default OP Gain Rates ◆
# You may specify the amount of OP battlers will be rewarded for specific
# actions performed.
GAIN_RATE = [
1, # 0 Gained per attack.
75, # 1 Gained for taking damage.
# This is per 100% MHP of damage taken, so with 500 you would have
# to take 2 times your MHP to fill a 1000 GAUGE_MAX
5, # 2 Gained for defeating an enemy.
0, # 3 Gained each time you run away from a fight.
5, # 4 Gained for each round spent while fighting solo in battle, either
# being the only character or being the last one alive.
1, # 5 Gained for taking any action in a round
3, # 6 Gained for each round surviving with 25% or less HP remaining.
0, # 7 Gained for each round for guarding.
]
# ◆ Default Actor OD 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 OD 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]
# ◆ OD Gauge Colors ◆
# Allows you to change the color of the overdrive gauges.
# The color can also be determined by a numerical expression.
# Example: GAUGE_NORMAL_START_COLOR = Color.new(255, 0, 0) <- This is red.
# If you've worked with HTML or image editing software, this should be
# fairly familiar.
GAUGE_NORMAL_START_COLOR = 14
GAUGE_NORMAL_END_COLOR = 6
GAUGE_MAX_START_COLOR = 10
GAUGE_MAX_END_COLOR = 2
# ◆ 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 = true
# ◆ 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 = false
# ◆ 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
# ◆ Play sound on OD Max ◆
# Play sound on gauge max.(Filename, Pitch, Volume)
ODMAX_SOUND = RPG::SE.new("Flash2", 100, 150)
end
end
#------------------------------------------------------------------------------#
$imported = {} if $imported == nil
$imported["OverDrive"] = true
module KGC::OverDrive
module Type
ATTACK = 0
DAMAGE = 1
VICTORY = 2
ESCAPE = 3
ALONE = 4
ACTION = 5
FATAL = 6
GUARD = 7
end
module Regexp
module Skill
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * #
# Unless you know what you're doing, it's best not to alter anything beyond #
# this point, as this only affects the tags used for "Notes" in database. #
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * #
# Whatever word(s) are after the separator ( | ) in the following lines are
# what are used to determine what is searched for in the "Notes" section of a
# skill to see if it is an Overdrive skill.
# Default Overdrive tag is <overdrive>
# Default OD_GAIN_RATE is <OD_GAIN>
OVER_DRIVE = /<(?:OVER_DRIVE|overdrive)[ ]*(\d+)?>/i
OD_GAIN_RATE = /<(?:OD_GAIN_RATE|odgain)[ ]*(\d+)[%%]?>/i
end
end
end
# In events if you wish to use scripting to increase the OD Gauge for a
# character you just use this line "gain_actor_od_gauge(ID, IG)"
# ID = Actor ID Number,
# IG = number of points to increase gauge
# Inserting -1 in ID makes it affect all characters.
# In events if you wish to use scripting to increase the OD Gauge for an
# enemy you just use this line "gain_enemy_od_gauge(ID, IG)"
# ID = Enemy ID Number in group 0-7
# IG = number of points to increase gauge
# Inserting -1 in ID makes it affect all enemies.
# In events if you wish to use scripting to change what increases the OD gauge
# for a character use this line "set_actor_drive_type(ID, [ODT])"
# ID = Actor ID Number
# ODT = numbers of types of Overdrive adders to use
# If the [ODT] is omitted it goes back to the defaults
# In events if you wish to use scripting to change what increases the OD gauge
# for an us this line "set_enemy_drive_type(ID, [ODT])"
# ID = Enemy ID Number in group 0-7
# ODT = numbers of types of Overdrive adders to use
# If the [ODT] is omitted it goes back to the defaults
#==============================================================================
# □ KGC::Commands
#==============================================================================
module KGC::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
# A all living 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
# A all living enemies 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
#--------------------------------------------------------------------------
# ○ 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
# A drive type all members is changed.
$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
# A drive type all enemies is changed.
$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
#==============================================================================
# ■ 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
#--------------------------------------------------------------------------
# ● Open Global Variable
#--------------------------------------------------------------------------
attr_writer :drive_type # Drive Type
#--------------------------------------------------------------------------
# ○ Acquire amount of drive gauge
#--------------------------------------------------------------------------
def overdrive
@overdrive = 0 if @overdrive == nil
return @overdrive
end
#--------------------------------------------------------------------------
# ○ Drive gauge maximum amount acquisition
#--------------------------------------------------------------------------
def max_overdrive
return KGC::OverDrive::GAUGE_MAX
end
#--------------------------------------------------------------------------
# ○ ドライブゲージの操作
#--------------------------------------------------------------------------
def overdrive=(value)
@overdrive = [[value, max_overdrive].min, 0].max
end
#--------------------------------------------------------------------------
# ○ Sound played on gauge max
#--------------------------------------------------------------------------
def odmax_sound
return KGC::OverDrive::ODMAX_SOUND
end
#------------------------#
def odmax_sound_played?
return false
end
#------------------------#
#--------------------------------------------------------------------------
# ○ ドライブタイプの取得
#--------------------------------------------------------------------------
def drive_type
return []
end
#--------------------------------------------------------------------------
# ○ OverDrive スキル習得済み判定
#--------------------------------------------------------------------------
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
#--------------------------------------------------------------------------
# ○ Determine guard
#--------------------------------------------------------------------------
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 : スキルかアイテムの使用者
# 呼び出し前に @hp_damage、@mp_damage、@absorbed が設定されていること。
#--------------------------------------------------------------------------
alias execute_damage_KGC_OverDrive execute_damage
def execute_damage(user)
execute_damage_KGC_OverDrive(user)
increase_overdrive(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 if self.class == attacker.class # 攻撃側と防御側が同じ
return if hp_damage == 0 && mp_damage == 0 # ダメージなし
if can_gain_overdrive?
increase_attacker_overdrive(attacker)
increase_defender_overdrive(attacker)
end
reset_overdrive_on_dead if dead?
end
#--------------------------------------------------------------------------
# ○ Increase Attacker's Overdrive
# attacker : Attacker
#--------------------------------------------------------------------------
def increase_attacker_overdrive(attacker)
return unless attacker.drive_attack? # Drive type "Attack" none
od_gain = [KGC::OverDrive::GAIN_RATE[KGC::OverDrive::Type::ATTACK], 1].max
if attacker.action.kind == 1
rate = attacker.action.skill.od_gain_rate # Rate of the skill is applied.
od_gain = od_gain * rate / 100
end
attacker.overdrive += od_gain
# Added by Mr. Anonymous 4/9/08
# if attacker's overdrive = gauge_max
if attacker.overdrive == max_overdrive && odmax_sound_played? == false
odmax_sound.play
def odmax_sound_played?
return true
end
end
end
#--------------------------------------------------------------------------
# ○ Increase Defender's Overdrive
# attacker : Attacker
#--------------------------------------------------------------------------
def increase_defender_overdrive(attacker)
return unless self.drive_damage? # No Drive Type "Damage"
rate = KGC::OverDrive::GAIN_RATE[KGC::OverDrive::Type::DAMAGE]
od_gain = hp_damage * rate / maxhp
od_gain += mp_damage * rate / maxmp if maxmp > 0
self.overdrive += [od_gain, 1].max
# Added by Mr. Anonymous 4/9/08
# if actor recieves damage leading to overdrive = gauge_max
if self.overdrive == max_overdrive && odmax_sound_played? == false
odmax_sound.play
def odmax_sound_played?
return true
end
end
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
#--------------------------------------------------------------------------
# ● セットアップ
# actor_id : アクター ID
#--------------------------------------------------------------------------
alias setup_KGC_OverDrive setup
def setup(actor_id)
setup_KGC_OverDrive(actor_id)
@overdrive = 0
@drive_type = nil
end
#--------------------------------------------------------------------------
# ○ OverDrive タイプの取得
#--------------------------------------------------------------------------
def drive_type
unless @drive_type.is_a?(Array)
return KGC::OverDrive::DEFAULT_ACTOR_DRIVE_TYPE
end
return @drive_type
end
#--------------------------------------------------------------------------
# ○ OverDrive スキル習得済み判定
#--------------------------------------------------------------------------
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 if KGC::OverDrive::HIDE_GAUGE_ACTOR.include?(self.id)
end
if KGC::OverDrive::HIDE_GAUGE_NO_OD_SKILLS
# 未修得
return false unless overdrive_skill_learned?
end
return true
end
#--------------------------------------------------------------------------
# ○ ゲージ表示判定
#--------------------------------------------------------------------------
def od_gauge_visible?
# 戦闘中非表示
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 false unless can_gain_overdrive?
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
#--------------------------------------------------------------------------
# ○ OverDrive タイプの取得
#--------------------------------------------------------------------------
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?
gw = width * actor.overdrive / actor.max_overdrive
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 - 8, width, 6, gauge_back_color)
self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
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
return false unless skill.overdrive?
return (@actor.calc_od_cost(skill) <= @actor.overdrive)
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
#--------------------------------------------------------------------------
# ● 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
#--------------------------------------------------------------------------
# ● 戦闘終了
# 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:Victory 1:Escape 2:Defeat)
#--------------------------------------------------------------------------
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
#--------------------------------------------------------------------------
# ○ 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::OverDrive::Type::ALONE]
end
# Action
if battler.drive_action?
od_gain += KGC::OverDrive::GAIN_RATE[KGC::OverDrive::Type::ACTION]
end
# Fatal
if battler.drive_fatal? && battler.hp < battler.maxhp / 4
od_gain += KGC::OverDrive::GAIN_RATE[KGC::OverDrive::Type::FATAL]
end
# Guard
if battler.drive_guard?
od_gain += KGC::OverDrive::GAIN_RATE[KGC::OverDrive::Type::GUARD]
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
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
#_/ The original untranslated version of this script can be found here:
# http://f44.aaa.livedoor.jp/~ytomy/tkool/rp...tech=over_drive
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
- OlfavrelMembre
- Nombre de messages : 7
Distinction : aucune
Date d'inscription : 16/01/2014
Re: Script Overdrive VX
Mar 3 Juin 2014 - 23:39
Re: Script Overdrive VX
Mer 4 Juin 2014 - 10:12
Fait moi une capture d'image de t'est script!
Est-ce que le script d'invoc, est placer au dessous du script d'OverDrive? (ou l'inverse, a essayer)
EDIT: http://rpg-maker-vx.bbactif.com/t12200-script-sbs-invocation-résolu#150963
ou
http://rpg-maker-vx.bbactif.com/t2647-vx-invocations-a-la-ff-x
Est-ce que le script d'invoc, est placer au dessous du script d'OverDrive? (ou l'inverse, a essayer)
EDIT: http://rpg-maker-vx.bbactif.com/t12200-script-sbs-invocation-résolu#150963
ou
http://rpg-maker-vx.bbactif.com/t2647-vx-invocations-a-la-ff-x
- OlfavrelMembre
- Nombre de messages : 7
Distinction : aucune
Date d'inscription : 16/01/2014
Re: Script Overdrive VX
Mer 4 Juin 2014 - 11:16
Re: Script Overdrive VX
Jeu 5 Juin 2014 - 10:17
Essaye de mettre au dessous de material!
Car j'ai ue aussi des erreur de script sur VX et aufait fallait mettre au dessous de material!
Car j'ai ue aussi des erreur de script sur VX et aufait fallait mettre au dessous de material!
- OlfavrelMembre
- Nombre de messages : 7
Distinction : aucune
Date d'inscription : 16/01/2014
Re: Script Overdrive VX
Jeu 5 Juin 2014 - 21:32
Bon, ça ne fonctionne pas non plus... J'ai clairement un problème de compatibilité, me faudrait un script d'invocation qui soit compatible a mon avis...
Re: Script Overdrive VX
Jeu 5 Juin 2014 - 21:38
Demande a Biwy, elle est doué dans le rgss2!
Tu l'envoie un MP, et si elle a réussi, n'oublie pas de mettre résolu dans ce topic!
Tu l'envoie un MP, et si elle a réussi, n'oublie pas de mettre résolu dans ce topic!
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum
|
|