Merge pull request #735 from garakmon/encounter_json

Add Different Field Info to Wild Encounters JSON
This commit is contained in:
PikalaxALT
2019-09-04 16:50:39 -04:00
committed by GitHub
4 changed files with 98 additions and 33 deletions
+26
View File
@@ -3,6 +3,32 @@
{
"label": "gWildMonHeaders",
"for_maps": true,
"fields": [
{
"type": "land_mons",
"encounter_rates": [
20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1
]
},
{
"type": "water_mons",
"encounter_rates": [
60, 30, 5, 4, 1
]
},
{
"type": "rock_smash_mons",
"encounter_rates": [
60, 30, 5, 4, 1
]
},
{
"type": "fishing_mons",
"encounter_rates": [
70, 30, 60, 20, 20, 40, 40, 15, 4, 1
]
}
],
"encounters": [
{
"map": "MAP_ROUTE101",
+11
View File
@@ -1,5 +1,16 @@
{{ doNotModifyHeader }}
## for wild_encounter_group in wild_encounter_groups
{% if wild_encounter_group.for_maps %}
## for wild_encounter_field in wild_encounter_group.fields
## for encounter_rate in wild_encounter_field.encounter_rates
{% if trackVar(encounter_rate, 100) %}
#define ENCOUNTER_CHANCE_{{ upper(wild_encounter_field.type) }}_SLOT_{{ loop.index }} {{ encounter_rate }} {% else %}#define ENCOUNTER_CHANCE_{{ upper(wild_encounter_field.type) }}_SLOT_{{ loop.index }} ENCOUNTER_CHANCE_{{ upper(wild_encounter_field.type) }}_SLOT_{{ subtract(loop.index, 1) }} + {{ encounter_rate }}{% endif %} {{ setVarInt(wild_encounter_field.type, loop.index) }}
## endfor
#define ENCOUNTER_CHANCE_{{ upper(wild_encounter_field.type) }}_TOTAL (ENCOUNTER_CHANCE_{{ upper(wild_encounter_field.type) }}_SLOT_{{ getVar(wild_encounter_field.type) }})
## endfor
{% endif %}
## for encounter in wild_encounter_group.encounters
{% if existsIn(encounter, "land_mons") %}
const struct WildPokemon {{ encounter.base_label }}_LandMons[] =