index to slot in c file
This commit is contained in:
+24
-24
@@ -145,27 +145,27 @@ static u8 ChooseWildMonIndex_Land(void)
|
|||||||
{
|
{
|
||||||
u8 rand = Random() % ENCOUNTER_CHANCE_LAND_MONS_TOTAL;
|
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;
|
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;
|
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;
|
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;
|
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;
|
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;
|
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;
|
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;
|
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;
|
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;
|
return 9;
|
||||||
else if (rand == ENCOUNTER_CHANCE_LAND_MONS_INDEX_9)
|
else if (rand == ENCOUNTER_CHANCE_LAND_MONS_SLOT_9)
|
||||||
return 10;
|
return 10;
|
||||||
else
|
else
|
||||||
return 11;
|
return 11;
|
||||||
@@ -175,13 +175,13 @@ static u8 ChooseWildMonIndex_WaterRock(void)
|
|||||||
{
|
{
|
||||||
u8 rand = Random() % ENCOUNTER_CHANCE_WATER_MONS_TOTAL;
|
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;
|
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;
|
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;
|
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;
|
return 3;
|
||||||
else
|
else
|
||||||
return 4;
|
return 4;
|
||||||
@@ -202,29 +202,29 @@ static u8 ChooseWildMonIndex_Fishing(u8 rod)
|
|||||||
switch (rod)
|
switch (rod)
|
||||||
{
|
{
|
||||||
case OLD_ROD:
|
case OLD_ROD:
|
||||||
if (rand < ENCOUNTER_CHANCE_FISHING_MONS_INDEX_0)
|
if (rand < ENCOUNTER_CHANCE_FISHING_MONS_SLOT_0)
|
||||||
wildMonIndex = 0;
|
wildMonIndex = 0;
|
||||||
else
|
else
|
||||||
wildMonIndex = 1;
|
wildMonIndex = 1;
|
||||||
break;
|
break;
|
||||||
case GOOD_ROD:
|
case GOOD_ROD:
|
||||||
if (rand < ENCOUNTER_CHANCE_FISHING_MONS_INDEX_2)
|
if (rand < ENCOUNTER_CHANCE_FISHING_MONS_SLOT_2)
|
||||||
wildMonIndex = 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;
|
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;
|
wildMonIndex = 4;
|
||||||
break;
|
break;
|
||||||
case SUPER_ROD:
|
case SUPER_ROD:
|
||||||
if (rand < ENCOUNTER_CHANCE_FISHING_MONS_INDEX_5)
|
if (rand < ENCOUNTER_CHANCE_FISHING_MONS_SLOT_5)
|
||||||
wildMonIndex = 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;
|
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;
|
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;
|
wildMonIndex = 8;
|
||||||
if (rand == ENCOUNTER_CHANCE_FISHING_MONS_INDEX_8)
|
if (rand == ENCOUNTER_CHANCE_FISHING_MONS_SLOT_8)
|
||||||
wildMonIndex = 9;
|
wildMonIndex = 9;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user