Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # ** Scene_Map
- #------------------------------------------------------------------------------
- # This class performs the map screen processing.
- #==============================================================================
- class Scene_Map < Scene_Base
- #--------------------------------------------------------------------------
- # * Constants
- #--------------------------------------------------------------------------
- TROOP_ONETIME = {
- #--------------------------------------------------------------------------
- # Format : ID Troop => [ID Pengganti, ID Pengganti, ....],
- #--------------------------------------------------------------------------
- 1 => [2,3], # Bakalan dieksekusi secara random
- 49 => [50],
- #--------------------------------------------------------------------------
- # * Alias Listing
- #--------------------------------------------------------------------------
- }; alias troop_onetime update_encounter
- #--------------------------------------------------------------------------
- # * Encounter Processing
- #--------------------------------------------------------------------------
- def update_encounter
- return if $game_player.encounter_count > 0 # Check steps
- return if $game_map.interpreter.running? # Event being executed?
- return if $game_system.encounter_disabled # Encounters forbidden?
- troop_onetime # Run Old Method
- id = $game_player.make_encounter_troop_id # Determine troop
- return if $data_troops[id] == nil or TROOP_ONETIME[id] == nil
- if $game_self_switches[['One Time Encounter',id]] # Troop is invalid?
- $game_troop.setup(TROOP_ONETIME[id][rand(TROOP_ONETIME[id].size)])
- $game_troop.can_escape = true
- preemptive_or_surprise
- end
- $game_self_switches[['One Time Encounter',id]] = true
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement