summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Prompt-for-reusing-Repels.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/Prompt-for-reusing-Repels.md b/Prompt-for-reusing-Repels.md
index 8dff99f..d851915 100644
--- a/Prompt-for-reusing-Repels.md
+++ b/Prompt-for-reusing-Repels.md
@@ -34,7 +34,7 @@ Next, we need to write to the variable when a repel is used. Edit [src/item_use.
```
There is one last issue. We also need a value to write to `VAR_REPEL_STEP_COUNT`. From a script, we cannot get this from the item ID alone. While we could use another unused variable, there is a way to avoid having to do this. `callnative` in scripts lets you call any function from a script. So, we can define a new function and use it with `callnative`. `callnative` is not the only way to use C code in scripts. You can also define specials and save some (but not much space), but it is largely unneeded.
-In [src/item.c](../blob/master/src/item.c), we will declare and define a new function:
+In [src/item.c](../blob/master/src/item.c), we will declare and define a new function (note: declare the function in include/item.h):
```c
void ItemId_GetHoldEffectParam_Script();
```
@@ -49,7 +49,7 @@ Next, we will modify the script to ask the player if they want to use another re
## 2. Ask the player
Now, we have everything we need. Edit [data/scripts/repel.inc](../blob/master/data/scripts/repel.inc):
```diff
- EventScript_RepelWoreOff:: @ 82A4B2A
+ EventScript_RepelWoreOff::
+ lockall
+ checkitem VAR_REPEL_LAST_USED, 1
+ compare VAR_RESULT, FALSE
@@ -74,7 +74,7 @@ Now, we have everything we need. Edit [data/scripts/repel.inc](../blob/master/da
+ releaseall
end
- Text_RepelWoreOff: @ 82A4B33
+ Text_RepelWoreOff:
.string "REPEL's effect wore off…$"
+Text_RepelWoreOff_UseAnother: