Здравствуйте, товарищи!
Для RPG Maker XP есть замечательный скрипт, чтобы два раза не бегать, процитирую его сразу:
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Charging Skill by Blizzard
# Version: 1.0b
# Type: Enhanced Skill
# Date: 7.12.2007
# Date v1.0b: 10.12.2007
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# new in v1.0b:
# - fixed bugs
# - now possible to create a charging skill that executes a different one
# - now beta
#
#
# Compatibility:
#
# 99% compatible with SDK v1.x. 80% compatible with SDK v2.x. Can cause
# problems with exotic CBS-es. Compatible with Soul Rage System and Soul
# Limit System. Not compatible with Chaos Drive System (cannot charge a Chaos
# Drive transforming skill).
#
#
# Explanation:
#
# This add-on allows you to create skills that need to charge first upon use.
# The battler will count backwards until he can use the skill.
#
#
# Configuration:
#
# CHARGE_ID - Set this value to the ID of the status effect to be inflicted
# when charging up a skill. In this case let the status effect
# disappear after the battle is over. Set it to 0 to disable it.
# This feature is optional.
#
#
# Important Notes:
#
# Keep in mind that the skill requirement needs to be met all the time. If
# the battler loses SP for some reason, gets killed or something similar, the
# countdown will stopped and the battler returned to a normal action state.
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#==============================================================================
# module BlizzCFG
#==============================================================================
module BlizzCFG
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
CHARGE_ID = 58
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
def self.charge_skill(id)
case id
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Charging Skill Database
#
# Set up the database below using following template:
#
# 1) when TRIGGER_ID then return [TURNS]
# 2) when TRIGGER_ID then return [TURNS, EXECUTE_ID]
#
# TRIGGER_ID - the triggering skill ID in the database
# EXECUTE_ID - the execution skill ID in the database
# TURNS - the number of turns the skill needs to charge up
#
# If you define only the number of turns for a skill, it will trigger itself
# instead of the other skill. Use the first syntax in this case.
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
when 1 then return [2, 1]
when 7 then return [1, 7]
when 10 then return [1, 10]
when 13 then return [1, 13]
when 170 then return [1, 170]
when 171 then return [1, 171]
when 172 then return [1, 172]
when 173 then return [1, 173]
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Charging Skill Database
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
end
return [0]
end
end
#==============================================================================
# Game_Battler
#==============================================================================
class Game_Battler
attr_accessor :charging
attr_accessor :current_action
alias restriction_charge_skill_later restriction
def restriction
return (@charging != nil ? 4 : restriction_charge_skill_later)
end
end
#==============================================================================
# Scene_Battle
#==============================================================================
class Scene_Battle
alias main_charge_skill_later main
def main
main_charge_skill_later
$game_party.actors.each {|actor| actor.charging = nil}
end
alias update_phase4_step2_charge_skill_later update_phase4_step2
def update_phase4_step2(battler = nil)
if $game_system.CHARGE_SKILL
b = (battler == nil ? @active_battler : battler)
if b.restriction > 1
if b.charging != nil && b.charging[0] > 0
b.charging[0] -= 1
make_charge_action_result(b)
if b.charging == nil && b.is_a?(Game_Actor) &&
!b.skills.include?(b.current_action.skill_id)
b.learn_skill(b.current_action.skill_id)
skill_id = b.current_action.skill_id
end
end
elsif ($crls ? [1, 3, 9] : [1]).include?(b.current_action.kind)
turns = BlizzCFG.charge_skill(b.current_action.skill_id)
if turns[0] > 0
b.charging = [turns[0], b.current_action.clone]
b.add_state(BlizzCFG::CHARGE_ID) if BlizzCFG::CHARGE_ID > 0
make_charge_action_result(b, turns[1])
end
end
end
if battler == nil
update_phase4_step2_charge_skill_later
else
update_phase4_step2_charge_skill_later(battler)
end
b.forget_skill(skill_id) if skill_id != nil
end
def make_charge_action_result(battler, trigger = nil)
if battler.charging != nil && battler.charging[0] == 0
battler.current_action, battler.charging = battler.charging[1], nil
battler.remove_state(BlizzCFG::CHARGE_ID) if BlizzCFG::CHARGE_ID > 0
return
end
@wait_count, battler.white_flash = 30, true
@status_window.refresh
if trigger
@help_window.set_text($data_skills[battler.charging[1].skill_id].name, 1)
battler.charging[1].skill_id = trigger
else
@help_window.set_text(battler.charging[0].to_s, 1)
end
@phase4_step = 3 if @phase4_step == 2
end
end
Всё бы ничего, но у него есть серьезный недостаток - эффект/state ожидания (который CHARGE_ID = 58) там всего один, а этого мало, для полного счастья мне нужно минимум два, чтоб, скажем, для заклинаний один, а для маневров - другой.
Недолго думая, я попытался просто клонировать этот скрипт, поменяв клону идентификаторы (или как оно по программистки правильно называется), чтобы они работали параллельно, каждый со своими спеллами, но, как вы уже по моему слогу догадались, не преуспел.
Буду рад даже подсказке, выполнимо ли оно вообще - хотя и от готового решения не откажусь.