From ac1ecfb57984725b1ea49f694f00666e80e906bf Mon Sep 17 00:00:00 2001 From: redsquidz <117706036+redsquidz@users.noreply.github.com> Date: Mon, 10 Apr 2023 11:20:19 -0700 Subject: [PATCH] Updated Prompt for reusing Repels (markdown) --- Prompt-for-reusing-Repels.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Prompt-for-reusing-Repels.md b/Prompt-for-reusing-Repels.md index e28b90b..330dd0a 100644 --- a/Prompt-for-reusing-Repels.md +++ b/Prompt-for-reusing-Repels.md @@ -134,7 +134,7 @@ Since we walked through it above, let's do the same here. Remember, this functio First we make an array with all the repel item IDs and declare an increment variable `i`. Next, we loop through the repels one by one and check if they exist in the bag - note that since `ITEM_REPEL` is listed first (in the 0th array index), it will look for this first in the loop. If none are found (`VAR_RESULT` still shows as `FALSE`) it'll look for super repels, then finally max repels. In this way all the smaller items are used first and the player's bag can clear them out. Finally, if no other repels are found, we want to stop the loop at `i > 2` and `return` to the script empty-handed, which is better than spiralling away to infinity in misery. -NOTE: If you want to just grab the smallest repel type after the first one gets depleted (rather than waiting for all repels of its kind to run out), just change the `while` to a `For (i = 0, i = 3, i++)` loop and get rid of the `if (i > 2)` stopper. +NOTE: If you want to just grab the smallest repel type after the first one gets depleted (rather than waiting for all repels of its kind to run out), just change the `while` to a `For (i = 0, i = 3, i++)` loop, add a `Return;` to the 'if TRUE' statement, and get rid of the `if (i > 2)` stopper. Sweet! Now, throw in a `callnative` in the assembly script and we're there. Over in [data/scripts/repel.inc](../blob/master/data/scripts/repel.inc): ```diff