Good morning / afternoon / evening, everyone.
I am in need of your assistance once again.
This script makes it so when a skill hits all enemies it will register the damage to all of them at the same time except one at a time like in the default battle system.
However
It seems to have a little hiccup in which, normally before the first turn, wether it's the enemy or the actors, there should be a slight pause. And after using this script the first turn is so instantaneous it looks a bit jaaring.
Is there a way to fix it so that we can return the small pause before the first turn like in the default battle system?
I am in need of your assistance once again.
Ruby:
#==============================================================================|
# ** You need not edit this part as it's about how this snippet works |
#------------------------------------------------------------------------------|
#------------------------------------------------------------------------------|
# * Edit class: Window_BattleLog |
#------------------------------------------------------------------------------|
class Window_BattleLog < Window_Selectable
#----------------------------------------------------------------------------|
# New public instance variable |
#----------------------------------------------------------------------------|
attr_writer :last_line_number
#----------------------------------------------------------------------------|
# Alias method: wait |
#----------------------------------------------------------------------------|
alias wait_log_window_display wait
def wait
# Rewritten to wait only when asked by this snippet
wait_log_window_display if @wait
#
end # wait
#----------------------------------------------------------------------------|
# Alias method: wait_for_effect |
#----------------------------------------------------------------------------|
alias wait_for_effect_log_window_display wait
def wait_for_effect
# Rewritten to wait for effect only when asked by this snippet
wait_for_effect_log_window_display if @wait
#
end # wait_for_effect
#----------------------------------------------------------------------------|
# Rewrite method: display_counter |
#----------------------------------------------------------------------------|
def display_counter(target, item)
# Rewritten to show all logs until the max line number's reached
@last_line_number ||= line_number
Sound.play_evasion
add_text(sprintf(Vocab::CounterAttack, target.name))
process_max_line_number_breach(item) if line_number >= max_line_number
#
end # display_counter
#----------------------------------------------------------------------------|
# Rewrite method: display_reflection |
#----------------------------------------------------------------------------|
def display_reflection(target, item)
# Rewritten to show all logs until the max line number's reached
@last_line_number ||= line_number
Sound.play_reflection
add_text(sprintf(Vocab::MagicReflection, target.name))
process_max_line_number_breach(item) if line_number >= max_line_number
#
end # display_reflection
#----------------------------------------------------------------------------|
# Rewrite method: display_substitute |
#----------------------------------------------------------------------------|
def display_substitute(substitute, target)
# Rewritten to show all logs until the max line number's reached
@last_line_number ||= line_number
add_text(sprintf(Vocab::Substitute, substitute.name, target.name))
process_max_line_number_breach(item) if line_number >= max_line_number
#
end # display_substitute
#----------------------------------------------------------------------------|
# Rewrite method: display_action_results |
#----------------------------------------------------------------------------|
def display_action_results(target, item)
# Rewritten to show all logs until the max line number's reached
@last_line_number ||= line_number
@wait = !item.for_all?
if target.result.used
[:display_critical, :display_damage, :display_affected_status,
:display_failure].each{ |method|
send(method, target,item)
process_max_line_number_breach(item) if line_number >= max_line_number
}
end
@wait = true
#
end # display_action_results
#----------------------------------------------------------------------------|
# New method: process_max_line_number_breach |
#----------------------------------------------------------------------------|
def process_max_line_number_breach(item)
@wait = true
wait
@wait = !item.for_all?
back_to(@last_line_number)
@last_line_number = line_number
end # process_max_line_number_breach
end # Window_BattleLog
#------------------------------------------------------------------------------|
# * Edit class: Scene_Battle |
#------------------------------------------------------------------------------|
class Scene_Battle < Scene_Base
#----------------------------------------------------------------------------|
# Alias method: use_item |
#----------------------------------------------------------------------------|
alias use_item_log_window_display use_item
def use_item
# Added to clear the battle log window last line number data
@log_window.last_line_number = nil
#
use_item_log_window_display
end # use_item
#----------------------------------------------------------------------------|
# Rewrite method: apply_item_effects |
#----------------------------------------------------------------------------|
def apply_item_effects(target, item)
target.item_apply(@subject, item)
# Rewritten to refresh the target only instead of the whole status window
@status_window.draw_item(target.index) if target.actor? && target.index >= 0
#
@log_window.display_action_results(target, item)
end # apply_item_effects
#----------------------------------------------------------------------------|
# Rewrite method: invoke_counter_attack |
#----------------------------------------------------------------------------|
def invoke_counter_attack(target, item)
@log_window.display_counter(target, item)
attack_skill = $data_skills[target.attack_skill_id]
@subject.item_apply(target, attack_skill)
# Rewritten to refresh the target only instead of the whole status window
if @subject.actor? && @subject.index >= 0
@status_window.draw_item(@subject.index)
end
#
@log_window.display_action_results(@subject, attack_skill)
end # invoke_counter_attack
end # Scene_Battle
#==============================================================================|
This script makes it so when a skill hits all enemies it will register the damage to all of them at the same time except one at a time like in the default battle system.
However
It seems to have a little hiccup in which, normally before the first turn, wether it's the enemy or the actors, there should be a slight pause. And after using this script the first turn is so instantaneous it looks a bit jaaring.
Is there a way to fix it so that we can return the small pause before the first turn like in the default battle system?