overdrive 자체는 적용 및 메뉴화면에서는 적용이 되는데
전투내에서 게이지바가 뜨지 않네요. 뭐 호환이 어려운건 알고 있었습니다만, 그래도 써먹고 싶어서 말이죠(..)
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ ◆オ?バ?ドライブ - KGC_OverDrive◆
#_/----------------------------------------------------------------------------
#_/ ?用のゲ?ジがMAXになったときのみ使用可能になるスキルを作成します。
#_/============================================================================
#_/ ≪SP消費改造[SPCostAlter]≫より下
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#==============================================================================
# ★ カスタマイズ項目 - Customize ★
#==============================================================================
module KGC
# ◆OverDriveゲ?ジ最大値
# (通常はこのままでOK。どうしてもバランスがおかしくなる場合のみ?更)
OD_GAUGE_MAX = 1000
# ◆OverDriveゲ?ジ?加率
# 順番(INDEX)および?件は以下の通り。
# 0,1 は、ダメ?ジ量に?じて?加量が?動。
# ?加率が高いほどゲ?ジが溜まりやすい。
#오버드라이브 게이지 상승 조건 (값이 클수록 차는 속도가 빠름)
#0.공격 상대에게 데미지를 주면 증가.
# 데미지가 큰 만큼 증가량이 상승.(상한 있어)
# 효과가 있는 것은 「통상 공격」 「스킬」마셔.
#1.피데미지 데미지를 받으면 증가.
# 데미지가 큰 만큼 증가량이 상승.(상한 없음)
# 효과가 있는 것은 「통상 공격」 「스킬」마셔.
#2.승리 전투 멤버에게 있는 상태로, 전투후에 생존하고 있으면 증가.
#3.도주 전투 멤버에게 있는 상태로, 도주시에 생존하고 있으면 증가.
#4.고독 전투 가능자가 자신만의 풀어에 행동하면 증가.
#(멤버가 1명, 또는 자신 이외가 전투 불능)
#5 행동 행동하면 증가. (행동의 종류는 묻지 않는다)
#6 빈사 빈사 상태(HP가 최대치의1/4이하)로 행동하면 증가.
OD_GAIN_RATE = [20, 50, 200, 100, 160, 40, 300]
# ◆OverDriveゲ?ジを表示しないアクタ?
# ゲ?ジを?すアクタ?のIDを配列に格納。
OD_GAUGE_HIDE_ACTOR = [] #오버 드라이브를 안쓰는 액터 id 입력
# ◆OverDriveゲ?ジを斜めにする
OD_GAUGE_SLANT = true #게이지바 기울기 반영
# ◆비전투시 OverDrive 게이지 위치 [x, y]
# 大きいほど名前から離れた位置に描?。
OD_GAUGE_OFF = [0, 30] #메인메뉴 스테이터스창에서의 게이지바
# ◆전투시 OverDrive 게이지 위치 [x, y]
OD_GAUGE_OFF_BATTLE = [-250, -100] #[0, 26] 전투화면 내에서의 게이지바
# ◆비전투시 게이지 표시여부
OD_GAUGE_HIDE_NOT_IN_BATTLE = false
end
class Window_Base < Window
# ◆OverDriveゲ?ジ?像
@@_od_gauge = RPG::Cache.picture("od_gauge.png")
end
#### OD_GAUGE_MAX
### Overdrive gauge maximum.
####OD_GAIN_RATE
### 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_GAUGE_HIDE_ACTOR
### Actor who hide own overdrive gauge.
# Puts actor's IDs whose gauge are hidden in the array.
#### OD_GAUGE_SLANT
### Draws overdrive gauge diagonally.
#### OD_GAUGE_OFF
### Overdrive gauge position. [x, y] (not in battle)
#### OD_GAUGE_OFF_BATTLE
### Overdrive gauge position in battle. [x, y]
#### OD_GAUGE_HIDE_NOT_IN_BATTLE
### Hides overdrive gauge. (not in battle)
#### @@_od_gauge
### Image of overdrive gauge.
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
$imported = {} if $imported == nil
$imported["OverDrive"] = true
if $game_special_elements == nil
$game_special_elements = {}
$data_system = load_data("Data/System.rxdata")
end
# OverDrive?性 - Element of OverDrive.
$game_special_elements["overdrive"] =
$data_system.elements.index("overdrive")
if $game_special_elements["overdrive"] == nil
$game_special_elements["overdrive"] = $data_system.elements.index("OverDrive")
end
#==============================================================================
# ■ Game_Battler (분할 정의 3)
#==============================================================================
class Game_Battler
attr_accessor :base_damage
#--------------------------------------------------------------------------
# ● 通常攻?の?果適用
#--------------------------------------------------------------------------
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.is_a?(Numeric)
overdrive_increase(attacker)
end
return result
end
#--------------------------------------------------------------------------
# ● ODゲ?ジ?加?理
#--------------------------------------------------------------------------
def overdrive_increase(attacker)
# 공격을 한 경우
if attacker.is_a?(Game_Actor) && self.is_a?(Game_Enemy) &&
attacker.overdrive_type == 0 && self.base_damage > 0
od_up = self.damage * KGC::OD_GAIN_RATE[0] * 10 / self.base_damage
attacker.overdrive += [[od_up, 1].max, 160].min
# 데미지를 입은 경우
elsif attacker.is_a?(Game_Enemy) && self.is_a?(Game_Actor) &&
self.overdrive_type == 1 && self.base_damage > 0
od_up = self.damage * KGC::OD_GAIN_RATE[1] * 10 / self.maxhp
self.overdrive += [od_up, 1].max
end
end
#--------------------------------------------------------------------------
# ● 스킬의 효과적용
#--------------------------------------------------------------------------
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.is_a?(Numeric)
overdrive_increase(user)
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 = 0
@overdrive_type = 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
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# ● 오브젝트 초기화
#--------------------------------------------------------------------------
alias initialize_KGC_OverDrive_Base initialize
def initialize(x, y, width, height)
@od_gauge = @@_od_gauge
@od_g_width = @od_gauge.width / 3
@od_g_height = (@od_gauge.height - 2) / 3
# 元の?理を?行
initialize_KGC_OverDrive_Base(x, y, width, height)
end
#--------------------------------------------------------------------------
# ● 게이지상(마스터?)(을)를 취득
#--------------------------------------------------------------------------
def _od_gauge
return @@_od_gauge
end
#--------------------------------------------------------------------------
# ● ゲ?ジ?像(マスタ?)を설정
#--------------------------------------------------------------------------
def _od_gauge=(new_bitmap)
@@_od_gauge.dispose
@@_od_gauge = new_bitmap
end
#--------------------------------------------------------------------------
# ● ゲ?ジ?像を취득
#--------------------------------------------------------------------------
def od_gauge
return @od_gauge
end
#--------------------------------------------------------------------------
# ● ゲ?ジ?像を설정
#--------------------------------------------------------------------------
def od_gauge=(new_bitmap)
@od_gauge = new_bitmap
end
#--------------------------------------------------------------------------
# ● 이름의 묘사
#--------------------------------------------------------------------------
alias draw_actor_name_KGC_OverDrive draw_actor_name
def draw_actor_name(actor, x, y) #(actor, x, y)
unless $game_temp.in_battle || KGC::OD_GAUGE_HIDE_NOT_IN_BATTLE
draw_actor_od_gauge(actor, x, y, 240) #(actor, x, y, 120)
end
# 元の?理を?行
draw_actor_name_KGC_OverDrive(actor, x, y)
end
#--------------------------------------------------------------------------
# ● OverDrive 게이지의 묘사
#--------------------------------------------------------------------------
def draw_actor_od_gauge(actor, x, y, width)
return if KGC::OD_GAUGE_HIDE_ACTOR.include?(actor.id)
# 게이지 폭 계산
dx = dy = gw = 0
maximum = false
if $game_temp.in_battle && self.is_a?(Window_BattleStatus)
@gs_od[actor.index] = actor.overdrive if @gs_od[actor.index] == nil
begin
dx = actor.battle_status_x
rescue
dx = actor.screen_x
end
dx += -@od_g_width + -52 #52
dy = y
dx -= 16 if $imported["HPSPAlter"] && !KGC::HPSP_DRAW_NAME_LUMP #16
gw = @gs_od[actor.index] * @od_g_width / KGC::OD_GAUGE_MAX
maximum = (@gs_od[actor.index] == KGC::OD_GAUGE_MAX)
else
@gauge_x = 0 #0
dx = x + width - @od_g_width - 13 #수정금지(메인메뉴 안)
dy = y
gw = actor.overdrive * @od_g_width / KGC::OD_GAUGE_MAX
maximum = (actor.overdrive == KGC::OD_GAUGE_MAX)
end
dx += ($game_temp.in_battle ? KGC::OD_GAUGE_OFF_BATTLE[0] :
KGC::OD_GAUGE_OFF[0])
dy += ($game_temp.in_battle ? KGC::OD_GAUGE_OFF_BATTLE[1] :
KGC::OD_GAUGE_OFF[1])
# 기울기 묘사
if KGC::OD_GAUGE_SLANT
self.contents.fill_rect(dx, dy, @od_g_width + 7, 6, Color.new(0, 0, 0, 0))
# ?描?
gy = @od_g_height + 1
(@od_g_height + 2).times { |i|
self.contents.blt(dx + i, dy + gy - i, @od_gauge,
Rect.new(0, gy - i, @od_g_width + 2, 1))
}
# 本?描?
gy -= 1
gy2 = @od_g_height * (maximum ? 3 : 2) + 1
@od_g_height.times { |i|
self.contents.blt(dx + i + 2, dy + gy - i, @od_gauge,
Rect.new(@gauge_x, gy2 - i, gw, 1))
}
# 통상묘사
else
self.contents.fill_rect(dx, dy, @od_g_width + 2, @od_g_height + 2,
Color.new(0, 0, 0, 0))
self.contents.blt(dx, dy, @od_gauge, Rect.new(0, 0, @od_g_width + 2,
@od_g_height + 2))
gy2 = @od_g_height * (maximum ? 2 : 1) + 2
self.contents.blt(dx + 1, dy + 1, @od_gauge,
Rect.new(@gauge_x, gy2, gw, @od_g_height))
end
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Window_BattleStatus
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# ● 오브젝트 초기화
#--------------------------------------------------------------------------
alias initialize_KGC_OverDrive initialize
def initialize
@gauge_x, @gs_od = 0, []
@od_g_width = @@_od_gauge.width / 3
@od_g_height = (@@_od_gauge.height - 2) / 3
# 元の?理を?行
initialize_KGC_OverDrive
end
#--------------------------------------------------------------------------
# ● 리프레쉬
#--------------------------------------------------------------------------
alias refresh_KGC_OverDrive refresh
def refresh
# 元の?理を?行
refresh_KGC_OverDrive
$game_party.actors.each_with_index { |actor, i|
@gs_od[i] = actor.overdrive
draw_actor_od_gauge(actor, 0, 0, 120)
}
end
#--------------------------------------------------------------------------
# ● 프레임 갱신
#--------------------------------------------------------------------------
alias update_KGC_OverDrive update
def update
# 元の?理を?行
update_KGC_OverDrive
# ゲ?ジ?像を流す
unless $imported["HPSPAlter"] #["HPSPAlter"]
@gauge_x -= [@od_g_width / 20, 1].max
@gauge_x = @od_g_width * 2 if @gauge_x < 0
end
$game_party.actors.each { |actor|
draw_actor_od_gauge(actor, 0, 0, 120)
}
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|
# 드라이브 타입이 「승리」의 경우는 가산
if actor.exist? && actor.overdrive_type == 2
actor.overdrive += KGC::OD_GAIN_RATE[2]
end
}
when 1 # 도주
$game_party.actors.each { |actor|
# 드라이브 타입이 「도주」의 경우는 가산
if actor.exist? && 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
#--------------------------------------------------------------------------
# ● 프레임 갱신 (메인페이즈 스텝2 : 액션개시)
#--------------------------------------------------------------------------
alias update_phase4_step2_KGC_OverDrive update_phase4_step2
def update_phase4_step2
if @active_battler.is_a?(Game_Actor)
overdrive_increase(@active_battler, $game_party.actors)
end
# 元の?理を?行
update_phase4_step2_KGC_OverDrive
end
#--------------------------------------------------------------------------
# ● ODゲ?ジ?加?理
#--------------------------------------------------------------------------
def overdrive_increase(battler, battler_list)
# 게이지 가한정
case battler.overdrive_type
when 4 # 단독
alone = true
battler_list.each { |b|
# 생존자가 있는 경우는 혼자가 아니다
if !b.equal?(battler) && b.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 >> 2) ?
KGC::OD_GAIN_RATE[6] : 0
else
od_up = 0
end
battler.overdrive += od_up
end
end