shithub: pokecrystal

Download patch

ref: 68d4a534836c5ddcccc4e5b61e8e755ac13388c4
parent: 84b6a084cb3fcbf99797fbd0d60720c4b306123d
author: Rangi <[email protected]>
date: Thu Jan 24 16:15:30 EST 2019

Use more constants

--- a/constants/script_constants.asm
+++ b/constants/script_constants.asm
@@ -163,7 +163,7 @@
 	const EMOTE_ROD ; 9
 	const EMOTE_BOULDER_DUST ; 10
 	const EMOTE_GRASS_RUSTLE ; 11
-EMOTE_MEM EQU -1
+EMOTE_FROM_MEM EQU -1
 
 ; fruittree arguments
 ; FruitTreeItems indexes (see data/items/fruit_trees.asm)
--- a/engine/overworld/scripting.asm
+++ b/engine/overworld/scripting.asm
@@ -511,7 +511,7 @@
 	call Script_giveitem
 	call CurItemName
 	ld de, wStringBuffer1
-	ld a, 1
+	ld a, MEM_BUFFER_1
 	call CopyConvertedText
 	ld b, BANK(GiveItemScript)
 	ld de, GiveItemScript
@@ -544,7 +544,7 @@
 ; parameters: item, var
 
 	call GetScriptByte
-	cp -1
+	cp ITEM_FROM_MEM
 	jr nz, .ok
 	ld a, [wScriptVar]
 .ok
@@ -562,7 +562,7 @@
 	ld [wScriptVar], a
 	call CurItemName
 	ld de, wStringBuffer1
-	ld a, 1
+	ld a, MEM_BUFFER_1
 	call CopyConvertedText
 	ld b, BANK(GiveItemScript)
 	ld de, GiveItemScript
@@ -1222,7 +1222,7 @@
 ; parameters: bubble
 
 	call GetScriptByte
-	cp -1
+	cp EMOTE_FROM_MEM
 	jr nz, .not_var_emote
 	ld a, [wScriptVar]
 .not_var_emote
@@ -1249,7 +1249,7 @@
 	jp ScriptCall
 
 ShowEmoteScript:
-	loademote EMOTE_MEM
+	loademote EMOTE_FROM_MEM
 	applymovement2 .Show
 	pause 0
 	applymovement2 .Hide
@@ -2520,7 +2520,7 @@
 Script_dontrestartmapmusic:
 ; script command 0x83
 
-	ld a, 1
+	ld a, TRUE
 	ld [wDontPlayMapMusicOnReload], a
 	ret
 
@@ -2547,7 +2547,7 @@
 	ld b, a
 	farcall DelCmdQueue ; no need to farcall
 	ret c
-	ld a, 1
+	ld a, TRUE
 	ld [wScriptVar], a
 	ret