Okay i have this script the Minkoff with overdrive... I wanted to know how to make it more like the ff7 Limit Break script.. How Do I make it so that when I get hit I gain limit and when its full it makes a sound? Please can someone help me.. I REALLY need this in my project The Reapers Legacy! Please!! Ill give cred to who over fixes it. I promise.
Code:
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/  ◆オーãƒãƒ¼ãƒ‰ãƒ©ã‚¤ãƒ– ï¼ KGC_OverDriveâ—†
#_/----------------------------------------------------------------------------
#_/ 専用ã®ã‚²ãƒ¼ã‚¸ãŒMAXã«ãªã£ãŸã¨ãã®ã¿ä½¿ç”¨å¯èƒ½ã«ãªã‚‹ã‚¹ã‚ルを作æˆã—ã¾ã™ã€‚
#_/============================================================================
#_/ ≪SPæ¶ˆè²»æ”¹é€ [SPCostAlter]≫より下
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#==============================================================================
# ★ ã‚«ã‚¹ã‚¿ãƒžã‚¤ã‚ºé …ç›® - Customize ★
#==============================================================================
module KGC
# ◆OverDriveゲージ最大値
# (通常ã¯ã“ã®ã¾ã¾ã§OK。ã©ã†ã—ã¦ã‚‚ãƒãƒ©ãƒ³ã‚¹ãŒãŠã‹ã—ããªã‚‹å ´åˆã®ã¿å¤‰æ›´)
### Overdrive gauge maximum.
OD_GAUGE_MAX = 1000
# â—†OverDriveã‚²ãƒ¼ã‚¸å¢—åŠ çŽ‡
# é †ç•ª(INDEX)ãŠã‚ˆã³æ¡ä»¶ã¯ä»¥ä¸‹ã®é€šã‚Šã€‚
# ã€0..攻撃 1..被ダメージ 2..å‹åˆ© 3..逃走 4..å¤ç‹¬ 5..行動 6..瀕æ»ã€‘
# ↑ã“れらã®INDEXã¯ã€ã‚¢ã‚¯ã‚¿ãƒ¼ã®ãƒ‰ãƒ©ã‚¤ãƒ–タイプã¨å¯¾å¿œã€‚
# 0,1 ã¯ã€ãƒ€ãƒ¡ãƒ¼ã‚¸é‡ã«å¿œã˜ã¦å¢—åŠ é‡ãŒå¤‰å‹•ã€‚
# å¢—åŠ çŽ‡ãŒé«˜ã„ã»ã©ã‚²ãƒ¼ã‚¸ãŒæºœã¾ã‚Šã‚„ã™ã„。
### Overdrive gauge gain rate.
# Order(index) and conditions are as follows:
# << 0..Attack 1..Damage 2..Victory 3..Escape 4..Alone
# 5..Action 6..Fatal >>
# The accumulation speed of '0' and '1' changes by amount of damage.
# The higher rate is, the faster overdrive gauge accumulates.
OD_GAIN_RATE = [10, 30, 200, 100, 160, 40, 160]
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
$imported = {} if $imported == nil
$imported["OverDrive"] = true
if $game_special_elements == nil
$game_special_elements = {}
$data_system = load_data("Data/System.rxdata")
end
# OverDrive属性
$game_special_elements["overdrive"] = $data_system.elements.index("OverDrive")
#==============================================================================
# ■Game_Battler (分割定義 3)
#==============================================================================
class Game_Battler
attr_accessor :base_damage
#--------------------------------------------------------------------------
# â— Edited - 通常攻撃ã®åŠ¹æžœé©ç”¨
#--------------------------------------------------------------------------
alias attack_effect_KGC_OverDrive attack_effect
def attack_effect(attacker)
@base_damage = nil
# å…ƒã®å‡¦ç†ã‚’実行
result = attack_effect_KGC_OverDrive(attacker)
if @base_damage == nil
# 基本ダメージ値をä¿å˜
@base_damage = [attacker.atk - self.pdef / 2, 0].max *
(20 + attacker.str) / 20
end
# ダメージをå—ã‘ãŸå ´åˆ
if result && self.damage[attacker].is_a?(Numeric)
# æ”»æ’ƒæ™‚å¢—åŠ åˆ¤å®š
if attacker.is_a?(Game_Actor) && self.is_a?(Game_Enemy) &&
attacker.overdrive_type == 0 && self.base_damage > 0
# ODã‚²ãƒ¼ã‚¸å¢—åŠ é‡è¨ˆç®—
od_up = [[self.damage[attacker] * KGC::OD_GAIN_RATE[0] * 10 / self.base_damage,
1].max, 160].min
# ODゲージ増åŠ
attacker.overdrive += od_up
# è¢«ãƒ€ãƒ¡ãƒ¼ã‚¸æ™‚å¢—åŠ åˆ¤å®š
elsif attacker.is_a?(Game_Enemy) && self.is_a?(Game_Actor) &&
self.overdrive_type == 1 && self.base_damage > 0
od_up = [self.damage[attacker] * KGC::OD_GAIN_RATE[1] * 10 / self.maxhp, 1].max
self.overdrive += od_up
end
end
return result
end
#--------------------------------------------------------------------------
# â— Edited - スã‚ルã®åŠ¹æžœé©ç”¨
#--------------------------------------------------------------------------
alias skill_effect_KGC_OverDrive skill_effect
def skill_effect(user, skill)
@base_damage = nil
# å…ƒã®å‡¦ç†ã‚’実行
result = skill_effect_KGC_OverDrive(user, skill)
if @base_damage == nil
# å¨åŠ›ã‚’計算
power = skill.power + user.atk * skill.atk_f / 100
if power > 0
power -= self.pdef * skill.pdef_f / 200
power -= self.mdef * skill.mdef_f / 200
power = [power, 0].max
end
# å€çŽ‡ã‚’計算
rate = 20
rate += (user.str * skill.str_f / 100)
rate += (user.dex * skill.dex_f / 100)
rate += (user.agi * skill.agi_f / 100)
rate += (user.int * skill.int_f / 100)
# 基本ダメージをä¿å˜
@base_damage = power * rate / 20
end
# ダメージをå—ã‘ãŸå ´åˆ
if result && self.damage[user].is_a?(Numeric)
# æ”»æ’ƒæ™‚å¢—åŠ åˆ¤å®š
if user.is_a?(Game_Actor) && self.is_a?(Game_Enemy) &&
user.overdrive_type == 0 && self.base_damage > 0
# ODã‚²ãƒ¼ã‚¸å¢—åŠ é‡è¨ˆç®—
od_up = [[self.damage[user] * KGC::OD_GAIN_RATE[0] * 10 / self.base_damage,
1].max, 160].min
# ODゲージ増åŠ
user.overdrive += od_up
# è¢«ãƒ€ãƒ¡ãƒ¼ã‚¸æ™‚å¢—åŠ åˆ¤å®š
elsif user.is_a?(Game_Enemy) && self.is_a?(Game_Actor) &&
self.overdrive_type == 1 && self.base_damage > 0
od_up = [self.damage[user] * KGC::OD_GAIN_RATE[1] * 10 / self.maxhp, 1].max
self.overdrive += od_up
end
end
# オーãƒãƒ¼ãƒ‰ãƒ©ã‚¤ãƒ–スã‚ルを使用ã—ãŸå ´åˆ
if user.is_a?(Game_Actor) &&
skill.element_set.include?($game_special_elements["overdrive"])
user.overdrive = 0
end
return result
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# â– Game_Actor
#==============================================================================
KGC_Game_Actor_first = "OverDrive" unless defined?(KGC_Game_Actor)
module KGC_Game_Actor
#--------------------------------------------------------------------------
# ◠スã‚ルã®ä½¿ç”¨å¯èƒ½åˆ¤å®š
#--------------------------------------------------------------------------
if defined?(skill_can_use?) && !@_skill_can_use_overdrive
alias skill_can_use_KGC_OverDrive skill_can_use?
else
@_skill_can_use_overdrive = true
end
def skill_can_use?(skill_id)
result = true
skill = $data_skills[skill_id]
if skill != nil &&
skill.element_set.include?($game_special_elements["overdrive"])
result = self.overdrive == KGC::OD_GAUGE_MAX
end
if defined?(skill_can_use_KGC_OverDrive)
return result & skill_can_use_KGC_OverDrive(skill_id)
else
return result & super
end
end
module_function :skill_can_use?
public :skill_can_use?
end
class Game_Actor < Game_Battler
include KGC_Game_Actor
attr_writer :overdrive_type
#--------------------------------------------------------------------------
# ◠セットアップ
#--------------------------------------------------------------------------
alias setup_KGC_OverDrive setup
def setup(actor_id)
# å…ƒã®å‡¦ç†ã‚’実行
setup_KGC_OverDrive(actor_id)
@overdrive, @overdrive_type = 0, 0
end
#--------------------------------------------------------------------------
# â— OverDriveゲージã®å–å¾—
#--------------------------------------------------------------------------
def overdrive
@overdrive = 0 if @overdrive == nil
return @overdrive
end
#--------------------------------------------------------------------------
# â— OverDriveゲージã®æ“作
#--------------------------------------------------------------------------
def overdrive=(value)
@overdrive = [[value, 0].max, KGC::OD_GAUGE_MAX].min
end
#--------------------------------------------------------------------------
# â— OverDriveタイプã®å–å¾—
#--------------------------------------------------------------------------
def overdrive_type
@overdrive_type = 0 if @overdrive_type == nil
return @overdrive_type
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■Scene_Battle (分割定義 1)
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# â— ãƒãƒˆãƒ«çµ‚了
# result : çµæžœ (0:å‹åˆ© 1:逃走 2:敗北)
#--------------------------------------------------------------------------
alias battle_end_KGC_OverDrive battle_end
def battle_end(result)
case result
when 0 # å‹åˆ©
$game_party.actors.each { |actor|
next unless actor.exist?
# ドライブタイプãŒã€Œå‹åˆ©ã€ã®å ´åˆã¯åŠ ç®—
if actor.overdrive_type == 2
actor.overdrive += KGC::OD_GAIN_RATE[2]
end
}
when 1 # 逃走
$game_party.actors.each { |actor|
next unless actor.exist?
# ドライブタイプãŒã€Œé€ƒèµ°ã€ã®å ´åˆã¯åŠ ç®—
if actor.overdrive_type == 3
actor.overdrive += KGC::OD_GAIN_RATE[3]
end
}
end
# å…ƒã®å‡¦ç†ã‚’実行
battle_end_KGC_OverDrive(result)
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■Scene_Battle (分割定義 4)
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ◠Edited - フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
#--------------------------------------------------------------------------
alias update_phase4_step2_KGC_OverDrive update_phase4_step2
def update_phase4_step2(battler)
if battler.is_a?(Game_Actor)
# ã‚²ãƒ¼ã‚¸å¢—åŠ åˆ¤å®š
case battler.overdrive_type
when 4 # å¤ç‹¬æˆ¦é—˜
alone = true
$game_party.actors.each { |actor|
next if actor == battler
# 生å˜è€…ãŒã„ã‚‹å ´åˆã¯å¤ç‹¬ã§ã¯ãªã„
if actor.exist?
alone = false
break
end
}
od_up = alone ? KGC::OD_GAIN_RATE[4] : 0
when 5 # 行動時
od_up = KGC::OD_GAIN_RATE[5]
when 6 # 瀕æ»
od_up = (battler.hp <= battler.maxhp / 4) ?
KGC::OD_GAIN_RATE[6] : 0
else
od_up = 0
end
battler.overdrive += od_up
end
# å…ƒã®å‡¦ç†ã‚’実行
update_phase4_step2_KGC_OverDrive(battler)
end
#--------------------------------------------------------------------------
# â— Refresh Meter After Attack
#--------------------------------------------------------------------------
alias update_phase4_step4_KGC_OverDrive update_phase4_step4
def update_phase4_step4(battler)
@status_window.refresh
update_phase4_step4_KGC_OverDrive(battler)
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# â– Window_BattleStatus
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# â— Add Overdrive Meters
#--------------------------------------------------------------------------
alias refresh_KGC_OverDrive refresh
def refresh(number = 0)
if self.contents == nil
self.contents = Bitmap.new(width - 32, height - 32)
end
if number == 0
for i in 0...$game_party.actors.size
draw_actor_od($game_party.actors[i], i * 160 + 4, 0, 120)
end
else
if $game_party.actors[number].is_a?(Game_Actor)
draw_actor_od($game_party.actors[number], number * 160 + 4, 0, 120)
end
end
refresh_KGC_OverDrive(number)
end
#--------------------------------------------------------------------------
# â— Opacity Fix
#--------------------------------------------------------------------------
alias update_KGC_OverDrive update
def update
if $game_temp.battle_main_phase
self.contents_opacity -= 4 if self.contents_opacity > 191
else
self.contents_opacity += 4 if self.contents_opacity < 255
end
end
#--------------------------------------------------------------------------
# â— Draw Overdrive Meter
#--------------------------------------------------------------------------
def draw_actor_od(actor, x, y, width = 144)
rate = actor.overdrive.to_f / KGC::OD_GAUGE_MAX
plus_x = 0
rate_x = 0
plus_y = 25
plus_width = 0
rate_width = 100
height = 10
align1 = 1
align2 = 2
align3 = 0
grade1 = 1
grade2 = 0
color1 = Color.new(0, 0, 0, 192)
color2 = Color.new(255, 255, 192, 192)
color3 = Color.new(0, 0, 0, 192)
color4 = Color.new(64, 0, 0, 192)
color5 = Color.new(80 - 24 * rate, 80 * rate, 14 * rate, 192)
color6 = Color.new(240 - 72 * rate, 240 * rate, 62 * rate, 192)
od = (width + plus_width) * actor.overdrive * rate_width / 100 / KGC::OD_GAUGE_MAX
gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
width, plus_width + width * rate_width / 100,
height, od, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
end
end