mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Makes Magikarp contest easier the first time
This commit is contained in:
@@ -221,6 +221,7 @@ VAR_NB_ROCKET_MISSIONS = 286
|
|||||||
|
|
||||||
VAR_BOUTIQUE_OUTFIT=290
|
VAR_BOUTIQUE_OUTFIT=290
|
||||||
VAR_FISHING_CONTEST_RECORD=294
|
VAR_FISHING_CONTEST_RECORD=294
|
||||||
|
VAR_FISHING_CONTEST_NERF=333
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1398,7 +1398,7 @@ def get_mart_exclusive_items(city)
|
|||||||
return items_list
|
return items_list
|
||||||
end
|
end
|
||||||
|
|
||||||
def calculate_pokemon_weight(pokemon)
|
def calculate_pokemon_weight(pokemon,nerf=0)
|
||||||
|
|
||||||
base_weight = pokemon.weight
|
base_weight = pokemon.weight
|
||||||
ivs = []
|
ivs = []
|
||||||
@@ -1426,18 +1426,20 @@ def calculate_pokemon_weight(pokemon)
|
|||||||
|
|
||||||
# Cap the weight between min and max values
|
# Cap the weight between min and max values
|
||||||
weight = [[weight, min_weight].max, max_weight].min
|
weight = [[weight, min_weight].max, max_weight].min
|
||||||
|
weight -= nerf if nerf > nerf
|
||||||
return weight.round(2) # Round to 2 decimal places
|
return weight.round(2) # Round to 2 decimal places
|
||||||
end
|
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"
|
#echoln "Generating Pokemon"
|
||||||
pokemon1 = pbGenerateWildPokemon(species, level) #Pokemon.new(species,level)
|
pokemon1 = pbGenerateWildPokemon(species, level) #Pokemon.new(species,level)
|
||||||
pokemon2 = pbGenerateWildPokemon(species, level) #Pokemon.new(species,level)
|
pokemon2 = pbGenerateWildPokemon(species, level) #Pokemon.new(species,level)
|
||||||
new_weights = []
|
new_weights = []
|
||||||
new_weights << calculate_pokemon_weight(pokemon1)
|
new_weights << calculate_pokemon_weight(pokemon1,nerf)
|
||||||
new_weights << calculate_pokemon_weight(pokemon2)
|
new_weights << calculate_pokemon_weight(pokemon2,nerf)
|
||||||
echoln new_weights
|
echoln new_weights
|
||||||
|
echoln "(nerfed by -#{nerf})"
|
||||||
pbSet(resultsVariable, new_weights.max)
|
pbSet(resultsVariable, new_weights.max)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user