Makes Magikarp contest easier the first time

This commit is contained in:
infinitefusion
2025-01-13 21:50:39 -05:00
parent 4730228557
commit 33ab16c3c6
2 changed files with 8 additions and 5 deletions

View File

@@ -221,6 +221,7 @@ VAR_NB_ROCKET_MISSIONS = 286
VAR_BOUTIQUE_OUTFIT=290
VAR_FISHING_CONTEST_RECORD=294
VAR_FISHING_CONTEST_NERF=333

View File

@@ -1398,7 +1398,7 @@ def get_mart_exclusive_items(city)
return items_list
end
def calculate_pokemon_weight(pokemon)
def calculate_pokemon_weight(pokemon,nerf=0)
base_weight = pokemon.weight
ivs = []
@@ -1426,18 +1426,20 @@ def calculate_pokemon_weight(pokemon)
# Cap the weight between min and max values
weight = [[weight, min_weight].max, max_weight].min
weight -= nerf if nerf > nerf
return weight.round(2) # Round to 2 decimal places
end
def generate_weight_contest_entries(species, level, resultsVariable)
#nerf: remove x kg from each generated pokemon
def generate_weight_contest_entries(species, level, resultsVariable,nerf=0)
#echoln "Generating Pokemon"
pokemon1 = pbGenerateWildPokemon(species, level) #Pokemon.new(species,level)
pokemon2 = pbGenerateWildPokemon(species, level) #Pokemon.new(species,level)
new_weights = []
new_weights << calculate_pokemon_weight(pokemon1)
new_weights << calculate_pokemon_weight(pokemon2)
new_weights << calculate_pokemon_weight(pokemon1,nerf)
new_weights << calculate_pokemon_weight(pokemon2,nerf)
echoln new_weights
echoln "(nerfed by -#{nerf})"
pbSet(resultsVariable, new_weights.max)
end