remove empty groups from wild encounter fields json objects

This commit is contained in:
garak 2019-10-14 12:57:42 -04:00 committed by huderlem
parent 4a79081197
commit 9b9b14ad0a
2 changed files with 4 additions and 7 deletions

View File

@ -8,22 +8,19 @@
"type": "land_mons",
"encounter_rates": [
20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1
],
"groups": {}
]
},
{
"type": "water_mons",
"encounter_rates": [
60, 30, 5, 4, 1
],
"groups": {}
]
},
{
"type": "rock_smash_mons",
"encounter_rates": [
60, 30, 5, 4, 1
],
"groups": {}
]
},
{
"type": "fishing_mons",

View File

@ -3,7 +3,7 @@
## for wild_encounter_group in wild_encounter_groups
{% if wild_encounter_group.for_maps %}
## for wild_encounter_field in wild_encounter_group.fields
{% if isEmpty(wild_encounter_field.groups) %}
{% if not existsIn(wild_encounter_field, "groups") %}
## for encounter_rate in wild_encounter_field.encounter_rates
{% if loop.index == 0 %}
#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) }}