mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-08 05:34:58 +00:00
Fixed previous commit always causing recompiling if shadow_pokemon.dat doesn't exist, also rubocopping
This commit is contained in:
@@ -5,42 +5,28 @@
|
||||
# event. This class is used within the Game_Map class ($game_map).
|
||||
#===============================================================================
|
||||
class Game_CommonEvent
|
||||
#-----------------------------------------------------------------------------
|
||||
# * Object Initialization
|
||||
# common_event_id : common event ID
|
||||
#-----------------------------------------------------------------------------
|
||||
def initialize(common_event_id)
|
||||
@common_event_id = common_event_id
|
||||
@interpreter = nil
|
||||
refresh
|
||||
end
|
||||
#-----------------------------------------------------------------------------
|
||||
# * Get Name
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
def name
|
||||
return $data_common_events[@common_event_id].name
|
||||
end
|
||||
#-----------------------------------------------------------------------------
|
||||
# * Get Trigger
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
def trigger
|
||||
return $data_common_events[@common_event_id].trigger
|
||||
end
|
||||
#-----------------------------------------------------------------------------
|
||||
# * Get Condition Switch ID
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
def switch_id
|
||||
return $data_common_events[@common_event_id].switch_id
|
||||
end
|
||||
#-----------------------------------------------------------------------------
|
||||
# * Get List of Event Commands
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
def list
|
||||
return $data_common_events[@common_event_id].list
|
||||
end
|
||||
#-----------------------------------------------------------------------------
|
||||
# * Checks if switch is on
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
def switchIsOn?(id)
|
||||
switchName = $data_system.switches[id]
|
||||
return false if !switchName
|
||||
@@ -50,9 +36,7 @@ class Game_CommonEvent
|
||||
return $game_switches[id]
|
||||
end
|
||||
end
|
||||
#-----------------------------------------------------------------------------
|
||||
# * Refresh
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
def refresh
|
||||
# Create an interpreter for parallel process if necessary
|
||||
if self.trigger == 2 && switchIsOn?(self.switch_id)
|
||||
@@ -63,9 +47,7 @@ class Game_CommonEvent
|
||||
@interpreter = nil
|
||||
end
|
||||
end
|
||||
#-----------------------------------------------------------------------------
|
||||
# * Frame Update
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
def update
|
||||
return if !@interpreter
|
||||
# Set up event if interpreter is not running
|
||||
|
||||
Reference in New Issue
Block a user