mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Fixed previous commit always causing recompiling if shadow_pokemon.dat doesn't exist, also rubocopping
This commit is contained in:
@@ -5,25 +5,20 @@
|
||||
# Refer to "$game_switches" for the instance of this class.
|
||||
#===============================================================================
|
||||
class Game_Switches
|
||||
#-----------------------------------------------------------------------------
|
||||
# * Object Initialization
|
||||
#-----------------------------------------------------------------------------
|
||||
def initialize
|
||||
@data = []
|
||||
end
|
||||
#-----------------------------------------------------------------------------
|
||||
# * Get Switch
|
||||
|
||||
# Get Switch
|
||||
# switch_id : switch ID
|
||||
#-----------------------------------------------------------------------------
|
||||
def [](switch_id)
|
||||
return @data[switch_id] if switch_id <= 5000 && @data[switch_id]
|
||||
return false
|
||||
end
|
||||
#-----------------------------------------------------------------------------
|
||||
# * Set Switch
|
||||
|
||||
# Set Switch
|
||||
# switch_id : switch ID
|
||||
# value : ON (true) / OFF (false)
|
||||
#-----------------------------------------------------------------------------
|
||||
def []=(switch_id, value)
|
||||
@data[switch_id] = value if switch_id <= 5000
|
||||
end
|
||||
|
||||
@@ -5,25 +5,20 @@
|
||||
# Refer to "$game_variables" for the instance of this class.
|
||||
#===============================================================================
|
||||
class Game_Variables
|
||||
#-----------------------------------------------------------------------------
|
||||
# * Object Initialization
|
||||
#-----------------------------------------------------------------------------
|
||||
def initialize
|
||||
@data = []
|
||||
end
|
||||
#-----------------------------------------------------------------------------
|
||||
# * Get Variable
|
||||
|
||||
# Get Variable
|
||||
# variable_id : variable ID
|
||||
#-----------------------------------------------------------------------------
|
||||
def [](variable_id)
|
||||
return @data[variable_id] if variable_id <= 5000 && !@data[variable_id].nil?
|
||||
return 0
|
||||
end
|
||||
#-----------------------------------------------------------------------------
|
||||
# * Set Variable
|
||||
|
||||
# Set Variable
|
||||
# variable_id : variable ID
|
||||
# value : the variable's value
|
||||
#-----------------------------------------------------------------------------
|
||||
def []=(variable_id, value)
|
||||
@data[variable_id] = value if variable_id <= 5000
|
||||
end
|
||||
|
||||
@@ -5,24 +5,19 @@
|
||||
# "Hash." Refer to "$game_self_switches" for the instance of this class.
|
||||
#===============================================================================
|
||||
class Game_SelfSwitches
|
||||
#-----------------------------------------------------------------------------
|
||||
# * Object Initialization
|
||||
#-----------------------------------------------------------------------------
|
||||
def initialize
|
||||
@data = {}
|
||||
end
|
||||
#-----------------------------------------------------------------------------
|
||||
# * Get Self Switch
|
||||
|
||||
# Get Self Switch
|
||||
# key : key
|
||||
#-----------------------------------------------------------------------------
|
||||
def [](key)
|
||||
return @data[key] == true
|
||||
end
|
||||
#-----------------------------------------------------------------------------
|
||||
# * Set Self Switch
|
||||
|
||||
# Set Self Switch
|
||||
# key : key
|
||||
# value : ON (true) / OFF (false)
|
||||
#-----------------------------------------------------------------------------
|
||||
def []=(key, value)
|
||||
@data[key] = value
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user