10-07-2016, 04:05 AM
I applaud you for the attempt. And I appreciate that the name for the switch is in keeping with the naming structure.
An easier way to look at the two methods would simply be:
By using themeans that the method is never run if the switch is turned off. You won't be able to press the trigger or anything.
Oh, and the 'aura_cancel' method runs through all the events in the area over and over and over... which causes lag. I only use it when the effect is being turned off, so it is reduced. Your version would have it run constantly. Better to have the system disabled and exit than having it run the cancel method instead.
An easier way to look at the two methods would simply be:
Code:
#--------------------------------------------------------------------------
# * Aura System Mode One : Single keypress that draws the aura for X frames
#--------------------------------------------------------------------------
def aura_mode_one
# Disable the system if the switch isn't activated
return if $game_switches[Aura::AURA_SWITCH] == true
# Do test if key triggered
aura_test if Input.trigger?(Aura::AURA_KEY)
# Update timer
aura_delay_update
end
#--------------------------------------------------------------------------
# * Aura System Mode Two : Constatn keypress the shows aura until released
#--------------------------------------------------------------------------
def aura_mode_two
# Disable the system if the switch isn't activated
return if $game_switches[Aura::AURA_SWITCH] == true
# Player cannot be moving
return aura_cancel if $game_player.moving?
# Obtain keypress as local variable (works better as set variable)
test = aura_toggle_key
# If the current aura_key state doesn't match the keypress, we toggled
if @current != test
# Turn on or off the effect based on the new toggle state
(test == true) ? aura_test : aura_cancel
# And reset the toggle aura key toggle state
@current = test
end
end
By using the
Code:
return if blah blah blah...
Oh, and the 'aura_cancel' method runs through all the events in the area over and over and over... which causes lag. I only use it when the effect is being turned off, so it is reduced. Your version would have it run constantly. Better to have the system disabled and exit than having it run the cancel method instead.