From adb0a444577b59eb02788c782a3d04bc285be0ba Mon Sep 17 00:00:00 2001 From: garak Date: Sun, 30 Jun 2019 12:05:45 -0400 Subject: [PATCH 1/4] add field info to wild pokemon json --- src/data/wild_encounters.json | 26 ++++++++++++++ src/data/wild_encounters.json.txt | 11 ++++++ src/wild_encounter.c | 56 +++++++++++++++---------------- tools/jsonproc/jsonproc.cpp | 25 ++++++++++++-- 4 files changed, 88 insertions(+), 30 deletions(-) diff --git a/src/data/wild_encounters.json b/src/data/wild_encounters.json index 6dd24bfedf..ea555bd326 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 8f88cc587f..3fb42c4041 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[] = diff --git a/src/wild_encounter.c b/src/wild_encounter.c index 84275526e0..f8031c4517 100644 --- a/src/wild_encounter.c +++ b/src/wild_encounter.c @@ -105,7 +105,7 @@ static bool8 CheckFeebas(void) if (y >= gRoute119WaterTileData[3 * 2 + 0] && y <= gRoute119WaterTileData[3 * 2 + 1]) route119Section = 2; - if (Random() % 100 > 49) // 50% chance of encountering Feebas + if (Random() % 100 > 49) return FALSE; FeebasSeedRng(gSaveBlock1Ptr->easyChatPairs[0].unk2); @@ -145,29 +145,29 @@ static u8 ChooseWildMonIndex_Land(void) { u8 rand = Random() % 100; - if (rand < 20) // 20% chance + if (rand < ENCOUNTER_CHANCE_LAND_MONS_INDEX_0) return 0; - else if (rand >= 20 && rand < 40) // 20% chance + else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_INDEX_0 && rand < ENCOUNTER_CHANCE_LAND_MONS_INDEX_1) return 1; - else if (rand >= 40 && rand < 50) // 10% chance + else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_INDEX_1 && rand < ENCOUNTER_CHANCE_LAND_MONS_INDEX_2) return 2; - else if (rand >= 50 && rand < 60) // 10% chance + else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_INDEX_2 && rand < ENCOUNTER_CHANCE_LAND_MONS_INDEX_3) return 3; - else if (rand >= 60 && rand < 70) // 10% chance + else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_INDEX_3 && rand < ENCOUNTER_CHANCE_LAND_MONS_INDEX_4) return 4; - else if (rand >= 70 && rand < 80) // 10% chance + else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_INDEX_4 && rand < ENCOUNTER_CHANCE_LAND_MONS_INDEX_5) return 5; - else if (rand >= 80 && rand < 85) // 5% chance + else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_INDEX_5 && rand < ENCOUNTER_CHANCE_LAND_MONS_INDEX_6) return 6; - else if (rand >= 85 && rand < 90) // 5% chance + else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_INDEX_6 && rand < ENCOUNTER_CHANCE_LAND_MONS_INDEX_7) return 7; - else if (rand >= 90 && rand < 94) // 4% chance + else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_INDEX_7 && rand < ENCOUNTER_CHANCE_LAND_MONS_INDEX_8) return 8; - else if (rand >= 94 && rand < 98) // 4% chance + else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_INDEX_8 && rand < ENCOUNTER_CHANCE_LAND_MONS_INDEX_9) return 9; - else if (rand == 98) // 1% chance + else if (rand == ENCOUNTER_CHANCE_LAND_MONS_INDEX_9) return 10; - else // 1% chance + else return 11; } @@ -175,15 +175,15 @@ static u8 ChooseWildMonIndex_WaterRock(void) { u8 rand = Random() % 100; - if (rand < 60) // 60% chance + if (rand < ENCOUNTER_CHANCE_WATER_MONS_INDEX_0) return 0; - else if (rand >= 60 && rand < 90) // 30% chance + else if (rand >= ENCOUNTER_CHANCE_WATER_MONS_INDEX_0 && rand < ENCOUNTER_CHANCE_WATER_MONS_INDEX_1) return 1; - else if (rand >= 90 && rand < 95) // 5% chance + else if (rand >= ENCOUNTER_CHANCE_WATER_MONS_INDEX_1 && rand < ENCOUNTER_CHANCE_WATER_MONS_INDEX_2) return 2; - else if (rand >= 95 && rand < 99) // 4% chance + else if (rand >= ENCOUNTER_CHANCE_WATER_MONS_INDEX_2 && rand < ENCOUNTER_CHANCE_WATER_MONS_INDEX_3) return 3; - else // 1% chance + else return 4; } @@ -202,29 +202,29 @@ static u8 ChooseWildMonIndex_Fishing(u8 rod) switch (rod) { case OLD_ROD: - if (rand < 70) // 70% chance + if (rand < ENCOUNTER_CHANCE_FISHING_MONS_INDEX_0) wildMonIndex = 0; - else // 30% chance + else wildMonIndex = 1; break; case GOOD_ROD: - if (rand < 60) // 60% chance + if (rand < ENCOUNTER_CHANCE_FISHING_MONS_INDEX_2) wildMonIndex = 2; - if (rand >= 60 && rand < 80) // 20% chance + if (rand >= ENCOUNTER_CHANCE_FISHING_MONS_INDEX_2 && rand < ENCOUNTER_CHANCE_FISHING_MONS_INDEX_3) wildMonIndex = 3; - if (rand >= 80 && rand < 100) // 20% chance + if (rand >= ENCOUNTER_CHANCE_FISHING_MONS_INDEX_3 && rand < ENCOUNTER_CHANCE_FISHING_MONS_INDEX_4) wildMonIndex = 4; break; case SUPER_ROD: - if (rand < 40) // 40% chance + if (rand < ENCOUNTER_CHANCE_FISHING_MONS_INDEX_5) wildMonIndex = 5; - if (rand >= 40 && rand < 80) // 40% chance + if (rand >= ENCOUNTER_CHANCE_FISHING_MONS_INDEX_5 && rand < ENCOUNTER_CHANCE_FISHING_MONS_INDEX_6) wildMonIndex = 6; - if (rand >= 80 && rand < 95) // 15% chance + if (rand >= ENCOUNTER_CHANCE_FISHING_MONS_INDEX_6 && rand < ENCOUNTER_CHANCE_FISHING_MONS_INDEX_7) wildMonIndex = 7; - if (rand >= 95 && rand < 99) // 4% chance + if (rand >= ENCOUNTER_CHANCE_FISHING_MONS_INDEX_7 && rand < ENCOUNTER_CHANCE_FISHING_MONS_INDEX_8) wildMonIndex = 8; - if (rand == 99) // 1% chance + if (rand == ENCOUNTER_CHANCE_FISHING_MONS_INDEX_8) wildMonIndex = 9; break; } diff --git a/tools/jsonproc/jsonproc.cpp b/tools/jsonproc/jsonproc.cpp index efe48f39f5..c0d6e9434c 100755 --- a/tools/jsonproc/jsonproc.cpp +++ b/tools/jsonproc/jsonproc.cpp @@ -36,7 +36,14 @@ int main(int argc, char *argv[]) // Add custom command callbacks. env.add_callback("doNotModifyHeader", 0, [jsonfilepath, templateFilepath](Arguments& args) { - return "//\n// DO NOT MODIFY THIS FILE! IT IS AUTO-GENERATED FROM " + jsonfilepath +" and Inja template " + templateFilepath + "\n//\n"; + return "//\n// DO NOT MODIFY THIS FILE! It is auto-generated from " + jsonfilepath +" and Inja template " + templateFilepath + "\n//\n"; + }); + + env.add_callback("subtract", 2, [](Arguments& args) { + int minuend = args.at(0)->get(); + int subtrahend = args.at(1)->get(); + + return minuend - subtrahend; }); env.add_callback("setVar", 2, [=](Arguments& args) { @@ -51,6 +58,21 @@ int main(int argc, char *argv[]) return get_custom_var(key); }); + env.add_callback("trackVar", 2, [](Arguments& args) { + static int counter = 0; + + int addValue = args.at(0)->get(); + int checkValue = args.at(1)->get(); + + bool over = false; + + counter = (counter + addValue) % (checkValue + 1); + + if (counter <= addValue) over = true; + + return over; + }); + env.add_callback("concat", 2, [](Arguments& args) { string first = args.at(0)->get(); string second = args.at(1)->get(); @@ -67,7 +89,6 @@ int main(int argc, char *argv[]) return rawValue.erase(0, prefix.length()); }); - // Add custom command callbacks. env.add_callback("removeSuffix", 2, [](Arguments& args) { string rawValue = args.at(0)->get(); string suffix = args.at(1)->get(); From 4594c955b4f2145891d6728b84e33489ee352a3a Mon Sep 17 00:00:00 2001 From: garak Date: Mon, 1 Jul 2019 23:47:45 -0400 Subject: [PATCH 2/4] create defines to support encounter index ratios --- src/data/wild_encounters.json.txt | 4 ++-- src/wild_encounter.c | 8 ++++---- tools/jsonproc/jsonproc.cpp | 9 ++++++++- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/data/wild_encounters.json.txt b/src/data/wild_encounters.json.txt index 3fb42c4041..30b05360c9 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 %} diff --git a/src/wild_encounter.c b/src/wild_encounter.c index f8031c4517..5a11396d98 100644 --- a/src/wild_encounter.c +++ b/src/wild_encounter.c @@ -105,7 +105,7 @@ static bool8 CheckFeebas(void) if (y >= gRoute119WaterTileData[3 * 2 + 0] && y <= gRoute119WaterTileData[3 * 2 + 1]) route119Section = 2; - if (Random() % 100 > 49) + if (Random() % 100 > 49) // 50% chance of encountering Feebas return FALSE; FeebasSeedRng(gSaveBlock1Ptr->easyChatPairs[0].unk2); @@ -143,7 +143,7 @@ static void FeebasSeedRng(u16 seed) static u8 ChooseWildMonIndex_Land(void) { - u8 rand = Random() % 100; + u8 rand = Random() % ENCOUNTER_CHANCE_LAND_MONS_TOTAL; if (rand < ENCOUNTER_CHANCE_LAND_MONS_INDEX_0) return 0; @@ -173,7 +173,7 @@ static u8 ChooseWildMonIndex_Land(void) static u8 ChooseWildMonIndex_WaterRock(void) { - u8 rand = Random() % 100; + u8 rand = Random() % ENCOUNTER_CHANCE_WATER_MONS_TOTAL; if (rand < ENCOUNTER_CHANCE_WATER_MONS_INDEX_0) return 0; @@ -197,7 +197,7 @@ enum static u8 ChooseWildMonIndex_Fishing(u8 rod) { u8 wildMonIndex = 0; - u8 rand = Random() % 100; + u8 rand = Random() % ENCOUNTER_CHANCE_FISHING_MONS_TOTAL; switch (rod) { diff --git a/tools/jsonproc/jsonproc.cpp b/tools/jsonproc/jsonproc.cpp index c0d6e9434c..15eae9dcb3 100755 --- a/tools/jsonproc/jsonproc.cpp +++ b/tools/jsonproc/jsonproc.cpp @@ -5,7 +5,7 @@ #include #include -using std::string; +using std::string; using std::to_string; #include using namespace inja; @@ -53,6 +53,13 @@ int main(int argc, char *argv[]) return ""; }); + env.add_callback("setVarInt", 2, [=](Arguments& args) { + string key = args.at(0)->get(); + string value = to_string(args.at(1)->get()); + set_custom_var(key, value); + return ""; + }); + env.add_callback("getVar", 1, [=](Arguments& args) { string key = args.at(0)->get(); return get_custom_var(key); From 2580693ea5331c13496d6e22803deea21eb5e423 Mon Sep 17 00:00:00 2001 From: garak Date: Mon, 29 Jul 2019 13:12:20 -0400 Subject: [PATCH 3/4] INDEX to SLOT in encounter inja template --- src/data/wild_encounters.json.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/wild_encounters.json.txt b/src/data/wild_encounters.json.txt index 30b05360c9..85755ddec5 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 %} From 08a3ff77dd845a7b1d6debfeb7bd8408aacd12f4 Mon Sep 17 00:00:00 2001 From: garak Date: Mon, 29 Jul 2019 20:02:43 -0400 Subject: [PATCH 4/4] index to slot in c file --- src/wild_encounter.c | 48 ++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/wild_encounter.c b/src/wild_encounter.c index 5a11396d98..332bbfb992 100644 --- a/src/wild_encounter.c +++ b/src/wild_encounter.c @@ -145,27 +145,27 @@ static u8 ChooseWildMonIndex_Land(void) { u8 rand = Random() % ENCOUNTER_CHANCE_LAND_MONS_TOTAL; - if (rand < ENCOUNTER_CHANCE_LAND_MONS_INDEX_0) + if (rand < ENCOUNTER_CHANCE_LAND_MONS_SLOT_0) return 0; - else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_INDEX_0 && rand < ENCOUNTER_CHANCE_LAND_MONS_INDEX_1) + else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_SLOT_0 && rand < ENCOUNTER_CHANCE_LAND_MONS_SLOT_1) return 1; - else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_INDEX_1 && rand < ENCOUNTER_CHANCE_LAND_MONS_INDEX_2) + else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_SLOT_1 && rand < ENCOUNTER_CHANCE_LAND_MONS_SLOT_2) return 2; - else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_INDEX_2 && rand < ENCOUNTER_CHANCE_LAND_MONS_INDEX_3) + else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_SLOT_2 && rand < ENCOUNTER_CHANCE_LAND_MONS_SLOT_3) return 3; - else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_INDEX_3 && rand < ENCOUNTER_CHANCE_LAND_MONS_INDEX_4) + else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_SLOT_3 && rand < ENCOUNTER_CHANCE_LAND_MONS_SLOT_4) return 4; - else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_INDEX_4 && rand < ENCOUNTER_CHANCE_LAND_MONS_INDEX_5) + else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_SLOT_4 && rand < ENCOUNTER_CHANCE_LAND_MONS_SLOT_5) return 5; - else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_INDEX_5 && rand < ENCOUNTER_CHANCE_LAND_MONS_INDEX_6) + else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_SLOT_5 && rand < ENCOUNTER_CHANCE_LAND_MONS_SLOT_6) return 6; - else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_INDEX_6 && rand < ENCOUNTER_CHANCE_LAND_MONS_INDEX_7) + else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_SLOT_6 && rand < ENCOUNTER_CHANCE_LAND_MONS_SLOT_7) return 7; - else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_INDEX_7 && rand < ENCOUNTER_CHANCE_LAND_MONS_INDEX_8) + else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_SLOT_7 && rand < ENCOUNTER_CHANCE_LAND_MONS_SLOT_8) return 8; - else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_INDEX_8 && rand < ENCOUNTER_CHANCE_LAND_MONS_INDEX_9) + else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_SLOT_8 && rand < ENCOUNTER_CHANCE_LAND_MONS_SLOT_9) return 9; - else if (rand == ENCOUNTER_CHANCE_LAND_MONS_INDEX_9) + else if (rand == ENCOUNTER_CHANCE_LAND_MONS_SLOT_9) return 10; else return 11; @@ -175,13 +175,13 @@ static u8 ChooseWildMonIndex_WaterRock(void) { u8 rand = Random() % ENCOUNTER_CHANCE_WATER_MONS_TOTAL; - if (rand < ENCOUNTER_CHANCE_WATER_MONS_INDEX_0) + if (rand < ENCOUNTER_CHANCE_WATER_MONS_SLOT_0) return 0; - else if (rand >= ENCOUNTER_CHANCE_WATER_MONS_INDEX_0 && rand < ENCOUNTER_CHANCE_WATER_MONS_INDEX_1) + else if (rand >= ENCOUNTER_CHANCE_WATER_MONS_SLOT_0 && rand < ENCOUNTER_CHANCE_WATER_MONS_SLOT_1) return 1; - else if (rand >= ENCOUNTER_CHANCE_WATER_MONS_INDEX_1 && rand < ENCOUNTER_CHANCE_WATER_MONS_INDEX_2) + else if (rand >= ENCOUNTER_CHANCE_WATER_MONS_SLOT_1 && rand < ENCOUNTER_CHANCE_WATER_MONS_SLOT_2) return 2; - else if (rand >= ENCOUNTER_CHANCE_WATER_MONS_INDEX_2 && rand < ENCOUNTER_CHANCE_WATER_MONS_INDEX_3) + else if (rand >= ENCOUNTER_CHANCE_WATER_MONS_SLOT_2 && rand < ENCOUNTER_CHANCE_WATER_MONS_SLOT_3) return 3; else return 4; @@ -202,29 +202,29 @@ static u8 ChooseWildMonIndex_Fishing(u8 rod) switch (rod) { case OLD_ROD: - if (rand < ENCOUNTER_CHANCE_FISHING_MONS_INDEX_0) + if (rand < ENCOUNTER_CHANCE_FISHING_MONS_SLOT_0) wildMonIndex = 0; else wildMonIndex = 1; break; case GOOD_ROD: - if (rand < ENCOUNTER_CHANCE_FISHING_MONS_INDEX_2) + if (rand < ENCOUNTER_CHANCE_FISHING_MONS_SLOT_2) wildMonIndex = 2; - if (rand >= ENCOUNTER_CHANCE_FISHING_MONS_INDEX_2 && rand < ENCOUNTER_CHANCE_FISHING_MONS_INDEX_3) + if (rand >= ENCOUNTER_CHANCE_FISHING_MONS_SLOT_2 && rand < ENCOUNTER_CHANCE_FISHING_MONS_SLOT_3) wildMonIndex = 3; - if (rand >= ENCOUNTER_CHANCE_FISHING_MONS_INDEX_3 && rand < ENCOUNTER_CHANCE_FISHING_MONS_INDEX_4) + if (rand >= ENCOUNTER_CHANCE_FISHING_MONS_SLOT_3 && rand < ENCOUNTER_CHANCE_FISHING_MONS_SLOT_4) wildMonIndex = 4; break; case SUPER_ROD: - if (rand < ENCOUNTER_CHANCE_FISHING_MONS_INDEX_5) + if (rand < ENCOUNTER_CHANCE_FISHING_MONS_SLOT_5) wildMonIndex = 5; - if (rand >= ENCOUNTER_CHANCE_FISHING_MONS_INDEX_5 && rand < ENCOUNTER_CHANCE_FISHING_MONS_INDEX_6) + if (rand >= ENCOUNTER_CHANCE_FISHING_MONS_SLOT_5 && rand < ENCOUNTER_CHANCE_FISHING_MONS_SLOT_6) wildMonIndex = 6; - if (rand >= ENCOUNTER_CHANCE_FISHING_MONS_INDEX_6 && rand < ENCOUNTER_CHANCE_FISHING_MONS_INDEX_7) + if (rand >= ENCOUNTER_CHANCE_FISHING_MONS_SLOT_6 && rand < ENCOUNTER_CHANCE_FISHING_MONS_SLOT_7) wildMonIndex = 7; - if (rand >= ENCOUNTER_CHANCE_FISHING_MONS_INDEX_7 && rand < ENCOUNTER_CHANCE_FISHING_MONS_INDEX_8) + if (rand >= ENCOUNTER_CHANCE_FISHING_MONS_SLOT_7 && rand < ENCOUNTER_CHANCE_FISHING_MONS_SLOT_8) wildMonIndex = 8; - if (rand == ENCOUNTER_CHANCE_FISHING_MONS_INDEX_8) + if (rand == ENCOUNTER_CHANCE_FISHING_MONS_SLOT_8) wildMonIndex = 9; break; }