mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
integrated modern mode
This commit is contained in:
@@ -83,6 +83,7 @@ Events.onStepTaken += proc {
|
||||
Events.onStepTakenTransferPossible += proc { |_sender, e|
|
||||
handled = e[0]
|
||||
next if handled[0]
|
||||
next if $game_switches[SWITCH_GAME_DIFFICULTY_EASY]
|
||||
if $PokemonGlobal.stepcount % 4 == 0 && Settings::POISON_IN_FIELD
|
||||
flashed = false
|
||||
for i in $Trainer.able_party
|
||||
|
||||
@@ -14,13 +14,24 @@ class PokemonEncounters
|
||||
@step_count = 0
|
||||
@step_chances = {}
|
||||
@encounter_tables = {}
|
||||
encounter_data = GameData::Encounter.get(map_ID, $PokemonGlobal.encounter_version)
|
||||
encounter_data = getEncounterMode().get(map_ID, $PokemonGlobal.encounter_version)
|
||||
if encounter_data
|
||||
encounter_data.step_chances.each { |type, value| @step_chances[type] = value }
|
||||
@encounter_tables = Marshal.load(Marshal.dump(encounter_data.types))
|
||||
end
|
||||
end
|
||||
|
||||
def getEncounterMode()
|
||||
mode = GameData::Encounter
|
||||
if $game_switches && $game_switches[SWITCH_MODERN_MODE]
|
||||
mode = GameData::EncounterModern
|
||||
end
|
||||
if $game_switches && $game_switches[SWITCH_RANDOM_WILD] && $game_switches[SWITCH_RANDOM_WILD_AREA]
|
||||
mode= GameData::EncounterRandom
|
||||
end
|
||||
return mode
|
||||
end
|
||||
|
||||
def reset_step_count
|
||||
@step_count = 0
|
||||
@chance_accumulator = 0
|
||||
@@ -41,7 +52,7 @@ class PokemonEncounters
|
||||
# contestants.
|
||||
def map_has_encounter_type?(map_ID, enc_type)
|
||||
return false if !enc_type
|
||||
encounter_data = GameData::Encounter.get(map_ID, $PokemonGlobal.encounter_version)
|
||||
encounter_data = getEncounterMode().get(map_ID, $PokemonGlobal.encounter_version)
|
||||
return false if !encounter_data
|
||||
return encounter_data.types[enc_type] && encounter_data.types[enc_type].length > 0
|
||||
end
|
||||
@@ -337,7 +348,7 @@ class PokemonEncounters
|
||||
raise ArgumentError.new(_INTL("Encounter type {1} does not exist", enc_type))
|
||||
end
|
||||
# Get the encounter table
|
||||
encounter_data = GameData::Encounter.get(map_ID, $PokemonGlobal.encounter_version)
|
||||
encounter_data = getEncounterMode().get(map_ID, $PokemonGlobal.encounter_version)
|
||||
return nil if !encounter_data
|
||||
enc_list = encounter_data.types[enc_type]
|
||||
return nil if !enc_list || enc_list.length == 0
|
||||
|
||||
Reference in New Issue
Block a user