Some time ago I wrote the algorithm for a script and Charly Lee helped me with the rgss syntax. It disallows reusing a skill for X turns after it is used.
It works like a charm with the DBS, but does not work with SBS Tankentai XP. (
http://www.hbgames.org/forums/viewtopic.php?f=11&t=60521 )
I know it is highly improbable to get help on this one, since Atoa already refused. The script itself is pretty simple, but the battle system is not, so I can't figure out this myself. From what I CAN figure out, the problem is in Scene_Battle (no rocket science here).
This script adds great functionality, and I'd really appreciate some help.
Thanks anyway
#SKILL REUSE BY CHARLY LEE & RAVENITH
SKILL_REUSE_DELAY={
1 => 10,
2 => 3
} # {skill_id => delay}
class Game_Actor
attr_accessor :skill_reuse_delays
alias srd_setup setup
def setup(actor_id)
srd_setup(actor_id)
@skill_reuse_delays={}
end
# To be called at the beginning of a battle
def reset_delays
@skill_reuse_delays={}
end
def delay?(skill_id)
if @skill_reuse_delays[skill_id]!=nil
return @skill_reuse_delays[skill_id]
end
return 0
end
alias srd_skill_can_use? skill_can_use?
def skill_can_use?(skill_id)
if delay?(skill_id) > 0
return false
end
return srd_skill_can_use?(skill_id)
end
def decrease_delays
for k in @skill_reuse_delays.keys
@skill_reuse_delays[k]=[@skill_reuse_delays[k]-1,0].max
end
end
def skill_used(skill_id)
return if SKILL_REUSE_DELAY[skill_id]==nil
@skill_reuse_delays[skill_id]=SKILL_REUSE_DELAY[skill_id]
end
end
class Scene_Battle
alias srd_start_phase1 start_phase1
def start_phase1
srd_start_phase1
for actor in $game_party.actors
actor.reset_delays
end
end
alias srd_start_phase4 start_phase4
def start_phase4
srd_start_phase4
for actor in $game_party.actors
actor.decrease_delays
end
end
alias srd_make_skill_action_result make_skill_action_result
def make_skill_action_result
# Memorize current SP
active_battler_sp = @active_battler.sp unless @active_battler.is_a?(Game_Enemy)
srd_make_skill_action_result
return if @active_battler.is_a?(Game_Enemy)
if active_battler_sp != @active_battler.sp
@active_battler.skill_used(@active_battler.current_action.skill_id)
end
end
end