From adb0a444577b59eb02788c782a3d04bc285be0ba Mon Sep 17 00:00:00 2001 From: garak Date: Sun, 30 Jun 2019 12:05:45 -0400 Subject: add field info to wild pokemon json --- src/data/wild_encounters.json | 26 ++++++++++++++++++++++++++ src/data/wild_encounters.json.txt | 11 +++++++++++ 2 files changed, 37 insertions(+) (limited to 'src/data') diff --git a/src/data/wild_encounters.json b/src/data/wild_encounters.json index 6dd24bfed..ea555bd32 100755 --- a/src/data/wild_encounters.json +++ b/src/data/wild_encounters.json @@ -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", diff --git a/src/data/wild_encounters.json.txt b/src/data/wild_encounters.json.txt index 8f88cc587..3fb42c404 100755 --- a/src/data/wild_encounters.json.txt +++ b/src/data/wild_encounters.json.txt @@ -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) }}_INDEX_{{ loop.index }} {{ encounter_rate }} {% else %}#define ENCOUNTER_CHANCE_{{ upper(wild_encounter_field.type) }}_INDEX_{{ loop.index }} ENCOUNTER_CHANCE_{{ upper(wild_encounter_field.type) }}_INDEX_{{ subtract(loop.index, 1) }} + {{ encounter_rate }}{% endif %} +## endfor + +## endfor +{% endif %} + ## for encounter in wild_encounter_group.encounters {% if existsIn(encounter, "land_mons") %} const struct WildPokemon {{ encounter.base_label }}_LandMons[] = -- cgit v1.2.3 From 4594c955b4f2145891d6728b84e33489ee352a3a Mon Sep 17 00:00:00 2001 From: garak Date: Mon, 1 Jul 2019 23:47:45 -0400 Subject: create defines to support encounter index ratios --- src/data/wild_encounters.json.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/data') diff --git a/src/data/wild_encounters.json.txt b/src/data/wild_encounters.json.txt index 3fb42c404..30b05360c 100755 --- a/src/data/wild_encounters.json.txt +++ b/src/data/wild_encounters.json.txt @@ -5,9 +5,9 @@ ## 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) }}_INDEX_{{ loop.index }} {{ encounter_rate }} {% else %}#define ENCOUNTER_CHANCE_{{ upper(wild_encounter_field.type) }}_INDEX_{{ loop.index }} ENCOUNTER_CHANCE_{{ upper(wild_encounter_field.type) }}_INDEX_{{ subtract(loop.index, 1) }} + {{ encounter_rate }}{% endif %} +#define ENCOUNTER_CHANCE_{{ upper(wild_encounter_field.type) }}_INDEX_{{ loop.index }} {{ encounter_rate }} {% else %}#define ENCOUNTER_CHANCE_{{ upper(wild_encounter_field.type) }}_INDEX_{{ loop.index }} ENCOUNTER_CHANCE_{{ upper(wild_encounter_field.type) }}_INDEX_{{ 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) }}_INDEX_{{ getVar(wild_encounter_field.type) }}) ## endfor {% endif %} -- cgit v1.2.3 From 2580693ea5331c13496d6e22803deea21eb5e423 Mon Sep 17 00:00:00 2001 From: garak Date: Mon, 29 Jul 2019 13:12:20 -0400 Subject: INDEX to SLOT in encounter inja template --- src/data/wild_encounters.json.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/data') diff --git a/src/data/wild_encounters.json.txt b/src/data/wild_encounters.json.txt index 30b05360c..85755ddec 100755 --- a/src/data/wild_encounters.json.txt +++ b/src/data/wild_encounters.json.txt @@ -5,9 +5,9 @@ ## 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) }}_INDEX_{{ loop.index }} {{ encounter_rate }} {% else %}#define ENCOUNTER_CHANCE_{{ upper(wild_encounter_field.type) }}_INDEX_{{ loop.index }} ENCOUNTER_CHANCE_{{ upper(wild_encounter_field.type) }}_INDEX_{{ subtract(loop.index, 1) }} + {{ encounter_rate }}{% endif %} {{ setVarInt(wild_encounter_field.type, loop.index) }} +#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) }}_INDEX_{{ getVar(wild_encounter_field.type) }}) +#define ENCOUNTER_CHANCE_{{ upper(wild_encounter_field.type) }}_TOTAL (ENCOUNTER_CHANCE_{{ upper(wild_encounter_field.type) }}_SLOT_{{ getVar(wild_encounter_field.type) }}) ## endfor {% endif %} -- cgit v1.2.3