Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Limit Break help...

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
 
Not to be rude, but you have got to be more patient. Waiting 2 hours for a response is next to nothing, try waiting at least 24 hours, then just bump your topic and leave, come back another day to check for replies and repeat.

Being nasty and/or getting mad is not going to make anyone want to help you. Other people have lives too and don't just scour the forums waiting for help topics. Especially script finding/editing requests which take a while to do/find.
 
I know im sorry.. I was mad because I cant get the script to work the way I want it to no matter how much I tried to edit it :( Well Thanks for the advice and sorry to everyone for being rude...
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top