summaryrefslogtreecommitdiff
path: root/engine/events/misc_scripts.asm
blob: 97372a57adeb7a8bcdc63218bdf02c7b44713f7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Script_AbortBugContest: ; 0x122c1
	checkflag ENGINE_BUG_CONTEST_TIMER
	iffalse .finish
	setflag ENGINE_DAILY_BUG_CONTEST
	special ContestReturnMons
.finish
	end

FindItemInBallScript:: ; 0x122ce
	callasm .TryReceiveItem
	iffalse .no_room
	disappear LAST_TALKED
	opentext
	writetext .text_found
	playsound SFX_ITEM
	pause 60
	itemnotify
	closetext
	end
; 0x122e3

.no_room ; 0x122e3
	opentext
	writetext .text_found
	waitbutton
	writetext .text_bag_full
	waitbutton
	closetext
	end
; 0x122ee

.text_found ; 0x122ee
	; found @ !
	text_jump UnknownText_0x1c0a1c
	db "@"
; 0x122f3

.text_bag_full ; 0x122f3
	; But   can't carry any more items.
	text_jump UnknownText_0x1c0a2c
	db "@"
; 0x122f8

.TryReceiveItem: ; 122f8
	xor a
	ld [ScriptVar], a
	ld a, [EngineBuffer1]
	ld [wNamedObjectIndexBuffer], a
	call GetItemName
	ld hl, StringBuffer3
	call CopyName2
	ld a, [EngineBuffer1]
	ld [CurItem], a
	ld a, [CurFruit]
	ld [wItemQuantityChangeBuffer], a
	ld hl, NumItems
	call ReceiveItem
	ret nc
	ld a, $1
	ld [ScriptVar], a
	ret
; 12324