mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 14:14:59 +00:00
Fixed Poké Radar rustling grass not always causing a wild encounter when stepping in it, other tweaks to Poké Radar
This commit is contained in:
@@ -109,6 +109,9 @@ class PokemonEncounters
|
||||
# Check if enc_type has a defined step chance/encounter table
|
||||
return false if !@step_chances[enc_type] || @step_chances[enc_type] == 0
|
||||
return false if !has_encounter_type?(enc_type)
|
||||
# Poké Radar encounters always happen, ignoring the minimum step period and
|
||||
# trigger probabilities
|
||||
return true if pbPokeRadarOnShakingGrass
|
||||
# Get base encounter chance and minimum steps grace period
|
||||
encounter_chance = @step_chances[enc_type].to_f
|
||||
min_steps_needed = (8 - encounter_chance / 10).clamp(0, 8).to_f
|
||||
@@ -176,8 +179,9 @@ class PokemonEncounters
|
||||
# taking into account Repels and ability effects.
|
||||
def allow_encounter?(enc_data, repel_active = false)
|
||||
return false if !enc_data
|
||||
return true if pbPokeRadarOnShakingGrass
|
||||
# Repel
|
||||
if repel_active && !pbPokeRadarOnShakingGrass
|
||||
if repel_active
|
||||
first_pkmn = (Settings::REPEL_COUNTS_FAINTED_POKEMON) ? $Trainer.first_pokemon : $Trainer.first_able_pokemon
|
||||
if first_pkmn && enc_data[1] < first_pkmn.level
|
||||
@chance_accumulator = 0
|
||||
|
||||
Reference in New Issue
Block a user