Voilà un script pour faire des Overdrive: auteur: KGC
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] #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
# ◆ 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
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
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
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 #------------------------#
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
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?
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
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
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 #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
Mais ça bug:
Invité
Invité
Sujet: Re: Overdrive Lun 1 Sep 2008 - 10:43
Message beaucoups trop long ^^
La barre est trop lente => pas assez rapide pour obtenir l'overdrive => attente trop longtemps:
La ben le nom bug:
Et en plus le script et en anglais
et je sais meme pas si il faut crée une compètence et comment on peut faire pour il mettre plusieurs sorte
merci d'avance
Blockade
Ex-Admin Cruelle
Age : 32 Inscrit le : 03/07/2008 Messages : 2441
Sujet: Re: Overdrive Lun 1 Sep 2008 - 15:14
J'ai un autre script de ce genre ça t'intéresserait ou tu veux absolument garder celui la ?
Altair19
Voyageur Lv.10
Age : 31 Inscrit le : 16/08/2008 Messages : 467
Sujet: Re: Overdrive Lun 1 Sep 2008 - 15:22
Moi je veut bien que tu me montre le tiens Blockade . S.T.P !
Invité
Invité
Sujet: Re: Overdrive Lun 1 Sep 2008 - 15:24
Oui moi aussi
(si tu pouvez mettre une screen pour voir^^)
Blockade
Ex-Admin Cruelle
Age : 32 Inscrit le : 03/07/2008 Messages : 2441
Sujet: Re: Overdrive Lun 1 Sep 2008 - 16:19
C'est a peu près le même que le tien, en mieux et plus manœuvrable. Faut que je le traduise, mais la j'ai pas le temps, je te donne la démo : je finirais de traduire dans la semaine ^^ http://www.megaupload.com/fr/?d=30IL0O4H