summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlibjet <libj3t@gmail.com>2019-12-08 22:22:16 +0000
committerlibjet <libj3t@gmail.com>2019-12-08 22:22:16 +0000
commitcfe6e295746996e64198b2a4b0f0eba1420ca8eb (patch)
tree8ac8e767568930c576c18a4bd4f27f58c5d08bc3
parent3ed059f6505975133a9b7fca745dd6b2ec6ccf4c (diff)
Added misc_scripts from pokecrystal and removed 1 dr from main.asm
-rwxr-xr-xengine/events/misc_scripts.asm57
-rwxr-xr-xengine/events/overworld.asm6
-rw-r--r--main.asm4
3 files changed, 61 insertions, 6 deletions
diff --git a/engine/events/misc_scripts.asm b/engine/events/misc_scripts.asm
new file mode 100755
index 00000000..6ac81da9
--- /dev/null
+++ b/engine/events/misc_scripts.asm
@@ -0,0 +1,57 @@
+Script_AbortBugContest:
+ checkflag ENGINE_BUG_CONTEST_TIMER
+ iffalse .finish
+ setflag ENGINE_DAILY_BUG_CONTEST
+ special ContestReturnMons
+.finish
+ end
+
+FindItemInBallScript::
+ callasm .TryReceiveItem
+ iffalse .no_room
+ disappear LAST_TALKED
+ opentext
+ writetext .text_found
+ playsound SFX_ITEM
+ pause 60
+ itemnotify
+ closetext
+ end
+
+.no_room
+ opentext
+ writetext .text_found
+ waitbutton
+ writetext .text_bag_full
+ waitbutton
+ closetext
+ end
+
+.text_found
+ ; found @ !
+ text_jump UnknownText_0x1c0a1c
+ db "@"
+
+.text_bag_full
+ ; But can't carry any more items.
+ text_jump UnknownText_0x1c0a2c
+ db "@"
+
+.TryReceiveItem:
+ xor a
+ ld [wScriptVar], a
+ ld a, [wcf29]
+ ld [wDeciramBuffer], a
+ call GetItemName
+ ld hl, wStringBuffer3
+ call CopyName2
+ ld a, [wcf29]
+ ld [wd002], a
+ ld a, [wcf2a]
+ ld [wItemQuantityChangeBuffer], a
+ ld hl, wNumItems
+ call ReceiveItem
+ ret nc
+ ld a, $1
+ ld [wScriptVar], a
+ ret \ No newline at end of file
diff --git a/engine/events/overworld.asm b/engine/events/overworld.asm
index f12aad03..3bb3fd96 100755
--- a/engine/events/overworld.asm
+++ b/engine/events/overworld.asm
@@ -588,7 +588,7 @@ FlyScript:
callasm HideSprites
special UpdateTimePals
callasm FlyFromAnimation
- farscall AbortBugCatchingContest
+ farscall Script_AbortBugContest
special WarpToSpawnPoint
callasm DelayLoadingNewSprites ; 1560c
writecode VAR_MOVEMENT, PLAYER_NORMAL
@@ -817,7 +817,7 @@ ContinueDigEscapeRopeScript:
closetext
playsound SFX_WARP_TO
applymovement PLAYER, DigOutMovementData
- farscall AbortBugCatchingContest
+ farscall Script_AbortBugContest
special WarpToSpawnPoint
writecode VAR_MOVEMENT, PLAYER_NORMAL
newloadmap MAPSETUP_DOOR
@@ -903,7 +903,7 @@ TeleportScript: ; ccbe
closetext
playsound SFX_WARP_TO
applymovement PLAYER, TeleportFromMovementData
- farscall AbortBugCatchingContest
+ farscall Script_AbortBugContest
special WarpToSpawnPoint
writecode VAR_MOVEMENT, PLAYER_NORMAL
newloadmap MAPSETUP_TELEPORT
diff --git a/main.asm b/main.asm
index 83d9c1d9..9c4a0423 100644
--- a/main.asm
+++ b/main.asm
@@ -640,9 +640,7 @@ INCLUDE "engine/pack.asm"
INCLUDE "engine/overworld/time.asm"
INCLUDE "engine/learn_tm.asm"
INCLUDE "engine/namingscreen.asm"
-
-AbortBugCatchingContest::
- dr $1269a, $126fd
+INCLUDE "engine/events/misc_scripts.asm"
HealMachineAnim:
dr $126fd, $12947