pokecrystal/engine/events/misc_scripts.asm

56 lines
895 B
NASM
Raw Normal View History

Script_AbortBugContest:
checkflag ENGINE_BUG_CONTEST_TIMER
iffalse .finish
setflag ENGINE_DAILY_BUG_CONTEST
special ContestReturnMons
.finish
end
FindItemInBallScript::
2015-11-11 21:11:08 +00:00
callasm .TryReceiveItem
iffalse .no_room
disappear LAST_TALKED
2015-12-09 23:25:44 +00:00
opentext
writetext .FoundItemText
2015-11-11 21:11:08 +00:00
playsound SFX_ITEM
pause 60
itemnotify
2015-11-25 15:16:29 +00:00
closetext
2015-11-11 21:11:08 +00:00
end
.no_room
2015-12-09 23:25:44 +00:00
opentext
writetext .FoundItemText
2015-11-25 15:16:29 +00:00
waitbutton
writetext .CantCarryItemText
2015-11-25 15:16:29 +00:00
waitbutton
2015-11-11 21:11:08 +00:00
closetext
end
.FoundItemText:
text_far _FoundItemText
text_end
2015-11-11 21:11:08 +00:00
.CantCarryItemText:
text_far _CantCarryItemText
text_end
2015-11-11 21:11:08 +00:00
2018-06-24 14:09:41 +00:00
.TryReceiveItem:
2015-11-11 21:11:08 +00:00
xor a
2018-01-23 22:39:09 +00:00
ld [wScriptVar], a
ld a, [wItemBallItemID]
ld [wNamedObjectIndex], a
2015-11-11 21:11:08 +00:00
call GetItemName
2018-01-23 22:39:09 +00:00
ld hl, wStringBuffer3
2015-11-11 21:11:08 +00:00
call CopyName2
ld a, [wItemBallItemID]
2018-01-23 22:39:09 +00:00
ld [wCurItem], a
ld a, [wItemBallQuantity]
ld [wItemQuantityChange], a
2018-01-23 22:39:09 +00:00
ld hl, wNumItems
2015-11-11 21:11:08 +00:00
call ReceiveItem
ret nc
ld a, $1
2018-01-23 22:39:09 +00:00
ld [wScriptVar], a
2015-11-11 21:11:08 +00:00
ret