diff options
Diffstat (limited to 'engine')
-rwxr-xr-x | engine/events/bug_contest/contest.asm | 41 | ||||
-rwxr-xr-x | engine/events/misc_scripts.asm | 44 | ||||
-rwxr-xr-x | engine/events/misc_scripts_2.asm | 48 | ||||
-rwxr-xr-x | engine/events/std_collision.asm | 29 |
4 files changed, 139 insertions, 23 deletions
diff --git a/engine/events/bug_contest/contest.asm b/engine/events/bug_contest/contest.asm new file mode 100755 index 00000000..56dca000 --- /dev/null +++ b/engine/events/bug_contest/contest.asm @@ -0,0 +1,41 @@ +GiveParkBalls: + xor a + ld [wContestMon], a + ld a, 20 + ld [wParkBalls], a + farcall StartBugContestTimer + ret + +BugCatchingContestBattleScript:: + writecode VAR_BATTLETYPE, BATTLETYPE_CONTEST + randomwildmon + startbattle + reloadmapafterbattle + copybytetovar wParkBalls + iffalse $79C5 + end + +BugCatchingContestOverScript:: + playsound SFX_ELEVATOR_END + opentext + writetext $79D1 + waitbutton + jump $79CD + +BugCatchingContestOutOfBallsScript: + playsound SFX_ELEVATOR_END + opentext + writetext $79D6 + waitbutton + +BugCatchingContestReturnToGateScript: + closetext + jumpstd bugcontestresultswarp + +BugCatchingContestTimeUpText: + text_jump _BugCatchingContestTimeUpText + db "@" + +BugCatchingContestIsOverText: + text_jump _BugCatchingContestIsOverText + db "@"
\ No newline at end of file diff --git a/engine/events/misc_scripts.asm b/engine/events/misc_scripts.asm index 6ac81da9..0a742812 100755 --- a/engine/events/misc_scripts.asm +++ b/engine/events/misc_scripts.asm @@ -11,7 +11,7 @@ FindItemInBallScript:: iffalse .no_room disappear LAST_TALKED opentext - writetext .text_found + writetext .FoundItemText playsound SFX_ITEM pause 60 itemnotify @@ -20,38 +20,36 @@ FindItemInBallScript:: .no_room opentext - writetext .text_found + writetext .FoundItemText waitbutton - writetext .text_bag_full + writetext .CantCarryItemText waitbutton closetext end -.text_found - ; found @ ! - text_jump UnknownText_0x1c0a1c +.FoundItemText: + text_jump _FoundItemText db "@" -.text_bag_full - ; But can't carry any more items. - text_jump UnknownText_0x1c0a2c +.CantCarryItemText: + text_jump _CantCarryItemText 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 + 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/misc_scripts_2.asm b/engine/events/misc_scripts_2.asm new file mode 100755 index 00000000..65d28b0a --- /dev/null +++ b/engine/events/misc_scripts_2.asm @@ -0,0 +1,48 @@ +RepelWoreOffScript:: + opentext + writetext .RepelWoreOffText + waitbutton + closetext + end + +.RepelWoreOffText: + text_jump _RepelWoreOffText + db "@" + +HiddenItemScript:: + opentext + copybytetovar $CF2B + itemtotext MEM_BUFFER_0, USE_SCRIPT_VAR + writetext .PlayerFoundItemText + giveitem ITEM_FROM_MEM + iffalse .bag_full + callasm SetMemEvent + specialsound + itemnotify + jump .finish + +.bag_full + buttonsound + writetext .ButNoSpaceText + waitbutton + +.finish + closetext + end + +.PlayerFoundItemText: + text_jump _PlayerFoundItemText + db "@" + +.ButNoSpaceText: + text_jump _ButNoSpaceText + db "@" + +SetMemEvent: + ld hl, wcf29 + ld a, [hli] + ld d, [hl] + ld e, a + ld b, SET_FLAG + call EventFlagAction + ret
\ No newline at end of file diff --git a/engine/events/std_collision.asm b/engine/events/std_collision.asm new file mode 100755 index 00000000..932f4db8 --- /dev/null +++ b/engine/events/std_collision.asm @@ -0,0 +1,29 @@ +CheckFacingTileForStdScript:: +; Checks to see if the tile you're facing has a std script associated with it. If so, executes the script and returns carry. + ld a, c + ld de, 3 + ld hl, TileCollisionStdScripts + call IsInArray + jr nc, .notintable + + ld a, jumpstd_command + ld [wcf2a], a + inc hl + ld a, [hli] + ld [wcf2b], a + ld a, [hli] + ld [wTempTrainerHeader], a + ld a, BANK(Script_JumpStdFromRAM) + ld hl, Script_JumpStdFromRAM + call CallScript + scf + ret + +.notintable + xor a + ret + +INCLUDE "data/events/collision_stdscripts.asm" + +Script_JumpStdFromRAM: + jump wcf2a
\ No newline at end of file |