taroxd 发表于 2014-6-30 10:10
本来就不同啊……
taroxd 发表于 2014-6-30 11:01
有个思路,技能1造成100点伤害,并且强制战斗指令触发技能2,技能2造成300点伤害……
只是思路而已,没有 ...
神秘影子 发表于 2014-7-2 00:24
你的多段是用数据库还是脚本?如果是数据库可以尝试添加公共事件实现循环哦
如以下伤害公式:
a.atk*4 -b.d ...
#==============================================================================
#
# ▼ Yanfly Engine Ace - Active Chain Skills v1.01
# -- Last Updated: 2011.12.22
# -- Level: Hard
# -- Requires: n/a
#
#==============================================================================
$imported = {} if $imported.nil?
$imported["YEA-ActiveChainSkills"] = true
#==============================================================================
# ▼ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2011.12.22 - Better updating speed for window.
# 2011.12.18 - Started Script and Finished.
#
#==============================================================================
# ▼ Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 這腳本實現了主動連技的可能性,當帶有連技屬性的技能發動時,畫面左下方會出現
# 可以連甚麼技的訊息列表,透過簡單QTE,能立刻發動下一招連技。理論上,只要有足夠
# 的資源(MP, TP) 和連技屬性的設定,是可以無限連技的。
#==============================================================================
# ▼ Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
#
# -----------------------------------------------------------------------------
# 以下是要放進[技能][註]的東東
# -----------------------------------------------------------------------------
# <chain skill L: x>
# <chain skill R: x>
# <chain skill X: x>
# <chain skill Y: x>
# <chain skill Z: x>
# 這個是給予可連技屬性的東東,X 是技能的編號, 013,102 之類的。放了進去就是代表
# 此技能能連去編號XXX 的技能。當沒有設定時,如只設定了Skill X,Y,Z ,L和R 是不
# 會在連技訊息列表中出現。而不夠資源如MP,TP 時,連技訊息列表中該技能就會黑掉。
# <chain only>
# 這個東東是令該技能在正常技能表中不能選擇,只能透過連技去發動。
#==============================================================================
# ▼ Compatibility
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
# it will run with RPG Maker VX without adjusting.
#
# While this script doesn't interfere with Input Combo Skills, it will most
# likely be unable to used in conjunction with Input Combo Skills. I will not
# provide support for any errors that may occur from this, nor will I be
# responsible for any damage doing this may cause your game.
#
#==============================================================================
module YEA
module ACTIVE_CHAIN
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Chain Skill Settings -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# Adjust general settings here. These settings adjust the sound effect
# played when an active skill is selected and what the minimum time window
# is for an active chain skill.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# 下面是連技成功時的音效,可改。
ACTIVE_SKILL_SOUND = RPG::SE.new("Skill2", 80, 100)
# 下面是設定連技訊息列表出現的時間長度,也就是QTE 的限時。
MINIMUM_TIME = 120
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Chain Skill Text -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# 這裡是設定連技訊息列表內容的地方,除了Title 外,都可用text codes.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
CHAIN_TITLE = "Active Chain Skills"
TITLE_SIZE = 20
L_SKILL_ON = "\eC[17]Q\eC[0]Chain: "
L_SKILL_OFF = "\eC[7]QChain: "
L_SKILL_ACT = "\eC[17]QChain: "
R_SKILL_ON = "\eC[17]W\eC[0]Chain: "
R_SKILL_OFF = "\eC[7]WChain: "
R_SKILL_ACT = "\eC[17]WChain: "
X_SKILL_ON = "\eC[17]A\eC[0]ttack: "
X_SKILL_OFF = "\eC[7]Attack: "
X_SKILL_ACT = "\eC[17]Attack: "
Y_SKILL_ON = "\eC[17]S\eC[0]trike: "
Y_SKILL_OFF = "\eC[7]Strike: "
Y_SKILL_ACT = "\eC[17]Strike: "
Z_SKILL_ON = "\eC[17]D\eC[0]efend: "
Z_SKILL_OFF = "\eC[7]Defend: "
Z_SKILL_ACT = "\eC[17]Defend: "
end # ACTIVE_CHAIN
end # YEA
#==============================================================================
# ▼ Editting anything past this point may potentially result in causing
# computer damage, incontinence, explosion of user's head, coma, death, and/or
# halitosis so edit at your own risk.
#==============================================================================
module YEA
module REGEXP
module SKILL
CHAIN_ONLY = /<(?:CHAIN_ONLY|chain only)>/i
CHAIN_SKILL = /<(?:CHAIN_SKILL|chain skill)[ ]([LRXYZ]):[ ](\d+)>/i
end # SKILL
end # REGEXP
end # YEA
#==============================================================================
# ■ DataManager
#==============================================================================
module DataManager
#--------------------------------------------------------------------------
# alias method: load_database
#--------------------------------------------------------------------------
class <<self; alias load_database_acs load_database; end
def self.load_database
load_database_acs
load_notetags_acs
end
#--------------------------------------------------------------------------
# new method: load_notetags_acs
#--------------------------------------------------------------------------
def self.load_notetags_acs
for skill in $data_skills
next if skill.nil?
skill.load_notetags_acs
end
end
end # DataManager
#==============================================================================
# ■ RPG::Skill
#==============================================================================
class RPG::Skill < RPG::UsableItem
#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_accessor :chain_only
attr_accessor :chain_skill
#--------------------------------------------------------------------------
# common cache: load_notetags_acs
#--------------------------------------------------------------------------
def load_notetags_acs
@chain_only = false
@chain_skill = {}
#---
self.note.split(/[\r\n]+/).each { |line|
case line
#---
when YEA::REGEXP::SKILL::CHAIN_ONLY
@chain_only = true
when YEA::REGEXP::SKILL::CHAIN_SKILL
case $1.upcase
when "L"; @chain_skill[:L] = $2.to_i
when "R"; @chain_skill[:R] = $2.to_i
when "X"; @chain_skill[:X] = $2.to_i
when "Y"; @chain_skill[:Y] = $2.to_i
when "Z"; @chain_skill[:Z] = $2.to_i
else; next
end
#---
end
} # self.note.split
#---
end
end # RPG::UsableItem
#==============================================================================
# ■ Game_Action
#==============================================================================
class Game_Action
#--------------------------------------------------------------------------
# new method: set_active_chain_skill
#--------------------------------------------------------------------------
def set_active_chain_skill(skill_id)
set_skill(skill_id)
@target_index = subject.current_action.target_index
@active_chain_skill = true
end
#--------------------------------------------------------------------------
# alias method: valid?
#--------------------------------------------------------------------------
alias game_action_valid_acs valid?
def valid?
subject.enable_active_chain(true) if @active_chain_skill
result = game_action_valid_acs
subject.enable_active_chain(false) if @active_chain_skill
return result
end
end # Game_Action
#==============================================================================
# ■ Game_BattlerBase
#==============================================================================
class Game_BattlerBase
#--------------------------------------------------------------------------
# alias method: skill_conditions_met?
#--------------------------------------------------------------------------
alias game_battlerbase_skill_conditions_met_acs skill_conditions_met?
def skill_conditions_met?(skill)
return false if chain_skill_restriction?(skill)
return game_battlerbase_skill_conditions_met_acs(skill)
end
#--------------------------------------------------------------------------
# new method: chain_skill_restriction?
#--------------------------------------------------------------------------
def chain_skill_restriction?(skill)
return false unless actor?
return false unless $game_party.in_battle
return false unless skill.chain_only
return !@active_chain_enabled
end
#--------------------------------------------------------------------------
# alias method: hp=
#--------------------------------------------------------------------------
alias game_battlerbase_hpequals_acs hp=
def hp=(value)
game_battlerbase_hpequals_acs(value)
return unless SceneManager.scene_is?(Scene_Battle)
return unless actor?
return if value == 0
SceneManager.scene.refresh_active_chain_skill_window(self)
end
#--------------------------------------------------------------------------
# alias method: mp=
#--------------------------------------------------------------------------
alias game_battlerbase_mpequals_acs mp=
def mp=(value)
game_battlerbase_mpequals_acs(value)
return unless SceneManager.scene_is?(Scene_Battle)
return unless actor?
return if value == 0
SceneManager.scene.refresh_active_chain_skill_window(self)
end
#--------------------------------------------------------------------------
# alias method: tp=
#--------------------------------------------------------------------------
alias game_battlerbase_tpequals_acs tp=
def tp=(value)
game_battlerbase_tpequals_acs(value)
return unless SceneManager.scene_is?(Scene_Battle)
return unless actor?
return if value == 0
SceneManager.scene.refresh_active_chain_skill_window(self)
end
end # Game_BattlerBase
#==============================================================================
# ■ Game_Battler
#==============================================================================
class Game_Battler < Game_BattlerBase
#--------------------------------------------------------------------------
# alias method: on_battle_start
#--------------------------------------------------------------------------
alias game_battler_on_battle_start_acs on_battle_start
def on_battle_start
game_battler_on_battle_start_acs
@active_chain_enabled = false
end
#--------------------------------------------------------------------------
# alias method: on_battle_end
#--------------------------------------------------------------------------
alias game_battler_on_battle_end_acs on_battle_end
def on_battle_end
game_battler_on_battle_end_acs
@active_chain_enabled = false
end
#--------------------------------------------------------------------------
# new method: enable_active_chain
#--------------------------------------------------------------------------
def enable_active_chain(active)
return unless actor?
@active_chain_enabled = active
end
#--------------------------------------------------------------------------
# new method: add_active_skill_chain
#--------------------------------------------------------------------------
def add_active_skill_chain(skill_id)
chain_skill = Game_Action.new(self)
chain_skill.set_active_chain_skill(skill_id)
@actions.insert(1, chain_skill)
end
end # Game_Battler
#==============================================================================
# ■ Window_ChainSkillList
#==============================================================================
class Window_ChainSkillList < Window_Base
#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize
dw = [Graphics.width/2, 320].max
super(-standard_padding, 0, dw, fitting_height(6))
self.z = 200
self.opacity = 0
hide
end
#--------------------------------------------------------------------------
# reveal
#--------------------------------------------------------------------------
def reveal(battler, skill)
@battler = battler
@skill = skill
@chain_skills = []
for key in skill.chain_skill
next if key[1].nil?
next if $data_skills[key[1]].nil?
next unless @battler.skills.include?($data_skills[key[1]])
@chain_skills.push($data_skills[key[1]])
end
return if @chain_skills == []
self.y = Graphics.height - fitting_height(4)
self.y -= fitting_height(@chain_skills.size + 1)
show
activate
@enabled = true
refresh
end
#--------------------------------------------------------------------------
# button=
#--------------------------------------------------------------------------
def button=(button)
@Button = button
@enabled = false
refresh unless @button.nil?
end
#--------------------------------------------------------------------------
# refresh_check
#--------------------------------------------------------------------------
def refresh_check(battler)
return if @battler != battler
refresh
end
#--------------------------------------------------------------------------
# refresh
#--------------------------------------------------------------------------
def refresh
@button = nil if @enabled
contents.clear
draw_background_colour
draw_horz_line(0)
draw_combo_title
draw_chain_skills
end
#--------------------------------------------------------------------------
# draw_background_colour
#--------------------------------------------------------------------------
def draw_background_colour
dh = line_height * (@chain_skills.size + 1)
rect = Rect.new(0, 0, contents.width, dh)
back_colour1 = Color.new(0, 0, 0, 192)
back_colour2 = Color.new(0, 0, 0, 0)
contents.gradient_fill_rect(rect, back_colour1, back_colour2)
end
#--------------------------------------------------------------------------
# draw_horz_line
#--------------------------------------------------------------------------
def draw_horz_line(dy)
line_y = dy + line_height - 2
line_colour = normal_color
line_colour.alpha = 48
contents.fill_rect(0, line_y, contents.width, 2, line_colour)
end
#--------------------------------------------------------------------------
# draw_combo_title
#--------------------------------------------------------------------------
def draw_combo_title
reset_font_settings
text = YEA::ACTIVE_CHAIN::CHAIN_TITLE
contents.font.size = YEA::ACTIVE_CHAIN::TITLE_SIZE
contents.font.bold = true
contents.font.italic = true
draw_text(12, 0, contents.width - 12, line_height, text)
reset_font_settings
end
#--------------------------------------------------------------------------
# draw_chain_skills
#--------------------------------------------------------------------------
def draw_chain_skills
button_array = [:L, :R, :X, :Y, :Z]
dx = 24
dy = line_height
for button in button_array
next if @skill.chain_skill[button].nil?
chain_skill = $data_skills[@skill.chain_skill[button]]
next unless @battler.skills.include?(chain_skill)
text = text_setting(button, chain_skill)
text += sprintf("\eI[%d]", chain_skill.icon_index)
text += chain_skill.name
draw_text_ex(dx, dy, text)
dy += line_height
end
end
#--------------------------------------------------------------------------
# text_setting
#--------------------------------------------------------------------------
def text_setting(button, skill)
active = button == @button
text = ""
case button
when :L
if @enabled && @battler.usable?(skill)
text = YEA::ACTIVE_CHAIN::L_SKILL_ON
elsif !@enabled && active
text = YEA::ACTIVE_CHAIN::L_SKILL_ACT
else
text = YEA::ACTIVE_CHAIN::L_SKILL_OFF
end
when :R
if @enabled && @battler.usable?(skill)
text = YEA::ACTIVE_CHAIN::R_SKILL_ON
elsif !@enabled && active
text = YEA::ACTIVE_CHAIN::R_SKILL_ACT
else
text = YEA::ACTIVE_CHAIN::R_SKILL_OFF
end
when :X
if @enabled && @battler.usable?(skill)
text = YEA::ACTIVE_CHAIN::X_SKILL_ON
elsif !@enabled && active
text = YEA::ACTIVE_CHAIN::X_SKILL_ACT
else
text = YEA::ACTIVE_CHAIN::X_SKILL_OFF
end
when :Y
if @enabled && @battler.usable?(skill)
text = YEA::ACTIVE_CHAIN::Y_SKILL_ON
elsif !@enabled && active
text = YEA::ACTIVE_CHAIN::Y_SKILL_ACT
else
text = YEA::ACTIVE_CHAIN::Y_SKILL_OFF
end
when :Z
if @enabled && @battler.usable?(skill)
text = YEA::ACTIVE_CHAIN::Z_SKILL_ON
elsif !@enabled && active
text = YEA::ACTIVE_CHAIN::Z_SKILL_ACT
else
text = YEA::ACTIVE_CHAIN::Z_SKILL_OFF
end
end
return text
end
end # Window_ChainSkillList
#==============================================================================
# ■ Scene_Battle
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# alias method: create_all_windows
#--------------------------------------------------------------------------
alias scene_battle_create_all_windows_acs create_all_windows
def create_all_windows
scene_battle_create_all_windows_acs
create_chain_skill_window
end
#--------------------------------------------------------------------------
# new method: create_chain_skill_window
#--------------------------------------------------------------------------
def create_chain_skill_window
@active_chain_skill_window = Window_ChainSkillList.new
@active_chain_skill_counter = 0
end
#--------------------------------------------------------------------------
# alias method: use_item
#--------------------------------------------------------------------------
alias scene_battle_use_item_acs use_item
def use_item
@subject.enable_active_chain(true)
item = @subject.current_action.item
chain_skill_list_appear(true, item)
start_active_skill_counter(item)
scene_battle_use_item_acs
wait_active_skill_counter
chain_skill_list_appear(false, item)
@subject.enable_active_chain(false)
end
#--------------------------------------------------------------------------
# new method: chain_skill_list_appear
#--------------------------------------------------------------------------
def chain_skill_list_appear(visible, skill)
return if @subject.nil?
return unless @subject.actor?
return unless skill.is_a?(RPG::Skill)
@active_chain_skill = 0
@current_chain_skill = skill
@active_chain_skill_window.reveal(@subject, skill) if visible
@active_chain_skill_window.hide unless visible
end
#--------------------------------------------------------------------------
# new method: refresh_active_chain_skill_window
#--------------------------------------------------------------------------
def refresh_active_chain_skill_window(battler)
return unless @active_chain_skill_window.visible
@active_chain_skill_window.refresh_check(battler)
end
#--------------------------------------------------------------------------
# new method: start_active_skill_counter
#--------------------------------------------------------------------------
def start_active_skill_counter(skill)
return unless @active_chain_skill_window.visible
@active_chain_skill_counter = YEA::ACTIVE_CHAIN::MINIMUM_TIME
end
#--------------------------------------------------------------------------
# new method: wait_active_skill_counter
#--------------------------------------------------------------------------
def wait_active_skill_counter
return unless @active_chain_skill_window.visible
wait(@active_chain_skill_counter)
end
#--------------------------------------------------------------------------
# new method: update_active_chain_skill_counter
#--------------------------------------------------------------------------
def update_active_chain_skill_counter
return if @active_chain_skill_counter == 0
@active_chain_skill_counter -= 1
end
#--------------------------------------------------------------------------
# alias method: update_basic
#--------------------------------------------------------------------------
alias scene_battle_update_basic_acs update_basic
def update_basic
scene_battle_update_basic_acs
update_active_chain_skill_counter
update_active_chain_skill_select
end
#--------------------------------------------------------------------------
# new method: update_active_chain_skill_select
#--------------------------------------------------------------------------
def update_active_chain_skill_select
return unless @active_chain_skill_window.visible
return if @active_chain_skill > 0
if Input.press?(:L)
check_active_chain_skill(:L)
elsif Input.press?(:R)
check_active_chain_skill(:R)
elsif Input.press?(:X)
check_active_chain_skill(:X)
elsif Input.press?(:Y)
check_active_chain_skill(:Y)
elsif Input.press?(:Z)
check_active_chain_skill(:Z)
end
end
#--------------------------------------------------------------------------
# new method: check_active_chain_skill
#--------------------------------------------------------------------------
def check_active_chain_skill(button)
skill_id = @current_chain_skill.chain_skill[button]
return if skill_id.nil?
return if $data_skills[skill_id].nil?
chain_skill = $data_skills[skill_id]
return unless @subject.usable?(chain_skill)
return unless @subject.skills.include?(chain_skill)
@active_chain_skill_counter = 12
@active_chain_skill = skill_id
@active_chain_skill_window.button = button
YEA::ACTIVE_CHAIN::ACTIVE_SKILL_SOUND.play
@subject.add_active_skill_chain(skill_id)
end
end # Scene_Battle
#==============================================================================
#
# ▼ End of File
#
#==============================================================================
#============================================================================== # +++ MOG - Combo Count (v1.2) +++ #============================================================================== # By Moghunter # [url]http://www.atelier-rgss.com/[/url] #============================================================================== # Apresenta a quantidade de acertos no alvo e o dano maximo. #============================================================================== # É necessário ter os arquivos imagens na pasta Graphics/Systems. # Combo_Damage.png # Combo_Hud.png # Combo_Number.png #============================================================================== #============================================================================== # ● Histórico (Version History) #============================================================================== # v 1.2 - Corrigido o erro de crash randômico. (relativo a dispose de imagem.) # v 1.1 - Opção de definir a prioridade da Hud. #============================================================================== module MOG_COMBO_COUNT #Ativar tempo para fazer combo. TIME_COUNT = true # Tempo para fazer um combo. (60 = 1s) COMBO_TIME = 120 # Cancelar a contagem de Combo caso o inimigo acertar o herói. ENEMY_CANCEL_COMBO = true # Posição geral das imagens. X Y COMBO_POSITION = [10,90] # Posição do número de HITS. X Y HIT_POSITION = [55,20] # Posição do número de dano. X Y TOTAL_POSITION = [100,-20] # Prioridade da HUD HUD_Z = 1 end #=============================================================================== # ■ Game_Temp #=============================================================================== class Game_Temp attr_accessor :combo_hit attr_accessor :max_damage attr_accessor :combo_time #-------------------------------------------------------------------------- # ● initialize #-------------------------------------------------------------------------- alias mog_combo_display_initialize initialize def initialize @combo_hit = 0 @max_damage = 0 @combo_time = 0 mog_combo_display_initialize end end #=============================================================================== # ■ Game_Battler #=============================================================================== class Game_Battler #-------------------------------------------------------------------------- # ● Item Apply #-------------------------------------------------------------------------- alias mog_combo_display_item_apply item_apply def item_apply(user, item) mog_combo_display_item_apply(user, item) unless @result.hit? $game_temp.combo_time = 0 end end #-------------------------------------------------------------------------- # ● execute_damage #-------------------------------------------------------------------------- alias mog_combo_display_execute_damage execute_damage def execute_damage(user) mog_combo_display_execute_damage(user) if @result.hp_damage > 0 if user.is_a?(Game_Actor) $game_temp.combo_hit += 1 $game_temp.max_damage += @result.hp_damage $game_temp.combo_time = MOG_COMBO_COUNT::COMBO_TIME else $game_temp.combo_time = 0 if MOG_COMBO_COUNT::ENEMY_CANCEL_COMBO == true end end end end #=============================================================================== # Scene_Battle #=============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # ● start #-------------------------------------------------------------------------- alias mog_combo_start start def start create_cb_sprite mog_combo_start end #-------------------------------------------------------------------------- # ● create_cb_sprite #-------------------------------------------------------------------------- def create_cb_sprite @combo_sprite = Combo_Sprite_Hud.new end #-------------------------------------------------------------------------- # ● Terminate #-------------------------------------------------------------------------- alias mog_combo_terminate terminate def terminate mog_combo_terminate @combo_sprite.dispose end #-------------------------------------------------------------------------- # ● update_basic #-------------------------------------------------------------------------- alias mog_combo_update_basic update_basic def update_basic mog_combo_update_basic update_combo_hit end #-------------------------------------------------------------------------- # ● Update Combo Hit #-------------------------------------------------------------------------- def update_combo_hit @combo_sprite.update if (@spriteset.animation? or @spriteset.effect?) @combo_sprite.combo_wait = true else @combo_sprite.combo_wait = false end end end #=============================================================================== # ■ Combo_Sprite_Hud #=============================================================================== class Combo_Sprite_Hud attr_accessor :combo_wait include MOG_COMBO_COUNT #-------------------------------------------------------------------------- # ● Initialize #-------------------------------------------------------------------------- def initialize dispose @combo_wait = false $game_temp.combo_time = 0 $game_temp.combo_hit = 0 $game_temp.max_damage = 0 @combo_hit_old = 0 @animation_speed = 0 @pos_x = COMBO_POSITION[0] @pos_x_fix = 0 @pos_y = COMBO_POSITION[1] create_combo_sprite create_total_damage_sprite create_hud_sprite end #-------------------------------------------------------------------------- # ● create_hud_sprite #-------------------------------------------------------------------------- def create_hud_sprite @hud = Sprite.new @hud.bitmap = Cache.system("Combo_HUD") @hud.z = HUD_Z @hud.x = COMBO_POSITION[0] @hud.y = COMBO_POSITION[1] @hud.opacity = 250 @hud.visible = false end #-------------------------------------------------------------------------- # ● create_total_damage_sprite #-------------------------------------------------------------------------- def create_total_damage_sprite @total_image = Cache.system("Combo_damage") @total = Sprite.new @total.bitmap = Bitmap.new(@combo_image.width,@combo_image.height) @total_im_cw = @total_image.width / 10 @total_im_ch = @total_image.height @total.z = HUD_Z + 1 @total_orig_x = COMBO_POSITION[0] + TOTAL_POSITION[0] @total_orig_y = COMBO_POSITION[1] + TOTAL_POSITION[1] @total.x = @total_orig_x @total.y = @total_orig_y @total.zoom_x = 1.00 @total.zoom_y = 1.00 @total.opacity = 250 @total.visible = false end #-------------------------------------------------------------------------- # ● create_combo_number #-------------------------------------------------------------------------- def create_combo_sprite @combo_image = Cache.system("Combo_Number") @combo = Sprite.new @combo.bitmap = Bitmap.new(@combo_image.width,@combo_image.height) @combo_im_cw = @combo_image.width / 10 @combo_im_ch = @combo_image.height @combo.z = HUD_Z + 2 @combo_orig_x = COMBO_POSITION[0] + HIT_POSITION[0] @combo_orig_y = COMBO_POSITION[1] + HIT_POSITION[1] @combo.zoom_x = 1.00 @combo.zoom_y = 1.00 @combo.opacity = 250 @combo.visible = false end #-------------------------------------------------------------------------- # ● Dispose #-------------------------------------------------------------------------- def dispose return if @hud == nil @hud.bitmap.dispose @hud.dispose @hud = nil @combo_image.dispose @combo.bitmap.dispose @combo.dispose @total_image.dispose @total.bitmap.dispose @total.dispose end #-------------------------------------------------------------------------- # ● Refresh #-------------------------------------------------------------------------- def refresh @combo_hit_old = $game_temp.combo_hit @combo.bitmap.clear @total.bitmap.clear @combo_number_text = $game_temp.combo_hit.abs.to_s.split(//) for r in [email]0..@combo_number_text.size[/email] - 1 @combo_number_abs = @combo_number_text[r].to_i @combo_src_rect = Rect.new(@combo_im_cw * @combo_number_abs, 0, @combo_im_cw, @combo_im_ch) @combo.bitmap.blt(@combo_im_cw * r, 0, @combo_image, @combo_src_rect) end @total_number_text = $game_temp.max_damage.abs.to_s.split(//) for r in [email]0..@total_number_text.size[/email] - 1 @total_number_abs = @total_number_text[r].to_i @total_src_rect = Rect.new(@total_im_cw * @total_number_abs, 0, @total_im_cw, @total_im_ch) @total.bitmap.blt(@total_im_cw * r, 20, @total_image, @total_src_rect) end #Combo Position @pos_x_fix = (@combo_im_cw / 2 * @combo_number_text.size) @combo.x = @combo_orig_x - @pos_x_fix @combo.y = @combo_orig_y @combo.zoom_x = 2 @combo.zoom_y = 2 @combo.opacity = 70 @combo.visible = true #Total Position @total.x = @total_orig_x + 20 @total.y = @total_orig_y @total.opacity = 100 @total.visible = true #Hud Position @hud.x = COMBO_POSITION[0] @hud.y = COMBO_POSITION[1] @hud.opacity = 255 @hud.visible = true end #-------------------------------------------------------------------------- # ● Slide Update #-------------------------------------------------------------------------- def slide_update return if !@combo.visible if $game_temp.combo_time > 0 and @combo_wait == false $game_temp.combo_time -= 1 if TIME_COUNT == true end if $game_temp.combo_time > 0 and $game_temp.combo_hit > 0 #Total Damage if @total.x > @total_orig_x @total.x -= 1 @total.opacity += 8 else @total.x = @total_orig_x @total.opacity = 255 end #Combo if @combo.zoom_x > 1.00 @combo.zoom_x -= 0.05 @combo.zoom_y -= 0.05 @combo.opacity += 8 else @combo.zoom_x = 1 @combo.zoom_y = 1 @combo.opacity = 255 @combo.x = @combo_orig_x - @pos_x_fix @combo.y = @combo_orig_y end elsif $game_temp.combo_time == 0 and @combo.visible @combo.x -= 5 @combo.opacity -= 10 @total.x -= 3 @total.opacity -= 10 @hud.x += 5 @hud.opacity -= 10 $game_temp.combo_hit = 0 @combo_hit_old = $game_temp.combo_hit $game_temp.max_damage = 0 if @combo.opacity <= 0 @combo.visible = false @total.visible = false @hud.visible = false end end end #-------------------------------------------------------------------------- # ● Cancel #-------------------------------------------------------------------------- def cancel $game_temp.combo_hit = 0 $game_temp.max_damage = 0 $game_temp.combo_time = 0 @combo_hit_old = $game_temp.combo_hit end #-------------------------------------------------------------------------- # ● Clear #-------------------------------------------------------------------------- def clear $game_temp.combo_time = 0 end #-------------------------------------------------------------------------- # ● Update #-------------------------------------------------------------------------- def update return if @hud == nil refresh if $game_temp.combo_hit != @combo_hit_old slide_update end end $mog_rgss3_combo_count = true
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |