#==============================================================================
# ** Fade Warp (Fondu téléport)
#------------------------------------------------------------------------------
# Trebor777
# 2.0
# 18/05/2006
#------------------------------------------------------------------------------
# Génère automatiquement un fondu sur écran noir, pour les téléportations vers
# une map différente de l'actuelle.
# Automatically Create a Black Screen's fade, for player transfer to a different
# map from the current one.
#==============================================================================
#==============================================================================
# ** Interpreter (part 2)
#------------------------------------------------------------------------------
# This interpreter runs event commands. This class is used within the
# Game_System class and the Game_Event class.
#==============================================================================
class Interpreter
#--------------------------------------------------------------------------
# * Event Command Execution
#--------------------------------------------------------------------------
$fade_wait = 10 #if =0, désactivate the effect.
#--------------------------------------------------------------------------
alias fade_warp_execute_command execute_command
def execute_command
# If last to arrive for list of event commands
if @index >= @list.size - 1
# End event
@a_fait = nil
command_end
# Continue
return true
end
parameters = @list[@index].parameters
id=$game_map.map_id #id of the current map
# if the command is "transfer player"
if @list[@index].code==201 and @a_fait==nil
# if destination's ID, is different from the current map's one, :
if (parameters[0]==0 and parameters[1]!=id) or (parameters[0]!=0 and $game_variables[parameters[1]]!=id)
# Change screen tone to black
black_tone=RPG::EventCommand.new(223,0,[Tone.new(-255,-255,-255,0),$fade_wait])
# Wait
wait=RPG::EventCommand.new(106,0,[$fade_wait])
# Change screen tone to Normal
no_tone=RPG::EventCommand.new(223,0,[Tone.new(0,0,0,0),$fade_wait])
# insert of the 2 first commands before the transfer player one
if $fade_wait>0
@list.insert(0,black_tone,wait)
# insert of the last after the transfer player one
@list.insert(@list.size - 1,no_tone)
# flag in order to mark the execution
end
@a_fait = true
end
end
fade_warp_execute_command
end
end
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------