05-12-2016, 04:47 AM
*sigh* More specifically, it happens when a target who used a skill is attacked by a melee attack. My system that grabs the SP points for comparison is done within the scopes method.... unfortunately a method used only by items and skills. It didn't erase the values when the player is stuck by a melee attack, and I had to force a calculation re-do.
Code:
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# DerVV's Enemy/Actor HP / SP Bars Fix v 1.3
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# By: DerVVulfman (a fix for El Conducter's script v 4.0)
# Written May 11, 2016
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Put below his script and it should allow SP healing and damage now!!!
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# This class performs battle screen processing.
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# * Frame Update (main phase step 2 : start action)
#--------------------------------------------------------------------------
alias elconducter_set_sp_fix1 set_target_battlers
alias elconducter_set_sp_fix2 update_phase4_step3
#--------------------------------------------------------------------------
# * Set Targeted Battler for Skill or Item
# scope : effect scope for skill or item
#--------------------------------------------------------------------------
def set_target_battlers(scope)
# The original call to get the scopes
scopers = elconducter_set_sp_fix1(scope)
# Now creat an empty area to store SP values
@battler_sp_dmg = []
# And cycle through all the determined battlers to get 'em
for target in @target_battlers
@battler_sp_dmg.push(target.sp)
end
return scopers
end
#--------------------------------------------------------------------------
# * Frame Update (main phase step 3 : animation for action performer)
#--------------------------------------------------------------------------
def update_phase4_step3
@battler_sp_dmg = []
for target in @target_battlers
@battler_sp_dmg.push(target.sp)
target.magic_casting = false
end
elconducter_set_sp_fix2
end
#--------------------------------------------------------------------------
# * Frame Update (main phase step 5 : damage display)
#--------------------------------------------------------------------------
def update_phase4_step5
# Hide help window
@help_window.visible = false
# Refresh status window
@status_window.refresh
# Display damage
for target in @target_battlers
if target.damage != nil
target.damage_pop = true
end
end
counter = 0
# Display damage
for target in @target_battlers
target.magic_casting = false
next if @battler_sp_dmg.nil?
old_sp = @battler_sp_dmg[counter]
if old_sp != target.sp
target.sp_used = old_sp - target.sp
target.magic_casting = true
end
counter += 1
end
# Shift to step 6
@phase4_step = 6
end
end