mirror of
https://github.com/thornAvery/jep-hack.git
synced 2026-02-07 16:45:24 +13:00
First Commit
Upload literally everything from the pokecrystal16 expand-move-ID branch
This commit is contained in:
commit
2f8a41f833
4618 changed files with 480386 additions and 0 deletions
117
engine/events/fruit_trees.asm
Normal file
117
engine/events/fruit_trees.asm
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
FruitTreeScript::
|
||||
callasm GetCurTreeFruit
|
||||
opentext
|
||||
readmem wCurFruit
|
||||
getitemname STRING_BUFFER_3, USE_SCRIPT_VAR
|
||||
writetext FruitBearingTreeText
|
||||
promptbutton
|
||||
callasm TryResetFruitTrees
|
||||
callasm CheckFruitTree
|
||||
iffalse .fruit
|
||||
writetext NothingHereText
|
||||
waitbutton
|
||||
sjump .end
|
||||
|
||||
.fruit
|
||||
writetext HeyItsFruitText
|
||||
readmem wCurFruit
|
||||
giveitem ITEM_FROM_MEM
|
||||
iffalse .packisfull
|
||||
promptbutton
|
||||
writetext ObtainedFruitText
|
||||
callasm PickedFruitTree
|
||||
specialsound
|
||||
itemnotify
|
||||
sjump .end
|
||||
|
||||
.packisfull
|
||||
promptbutton
|
||||
writetext FruitPackIsFullText
|
||||
waitbutton
|
||||
|
||||
.end
|
||||
closetext
|
||||
end
|
||||
|
||||
GetCurTreeFruit:
|
||||
ld a, [wCurFruitTree]
|
||||
dec a
|
||||
call GetFruitTreeItem
|
||||
ld [wCurFruit], a
|
||||
ret
|
||||
|
||||
TryResetFruitTrees:
|
||||
ld hl, wDailyFlags1
|
||||
bit DAILYFLAGS1_ALL_FRUIT_TREES_F, [hl]
|
||||
ret nz
|
||||
jp ResetFruitTrees
|
||||
|
||||
CheckFruitTree:
|
||||
ld b, 2
|
||||
call GetFruitTreeFlag
|
||||
ld a, c
|
||||
ld [wScriptVar], a
|
||||
ret
|
||||
|
||||
PickedFruitTree:
|
||||
farcall StubbedTrainerRankings_FruitPicked
|
||||
ld b, 1
|
||||
jp GetFruitTreeFlag
|
||||
|
||||
ResetFruitTrees:
|
||||
xor a
|
||||
ld hl, wFruitTreeFlags
|
||||
rept (NUM_FRUIT_TREES + 7) / 8 - 1
|
||||
ld [hli], a
|
||||
endr
|
||||
ld [hl], a
|
||||
ld hl, wDailyFlags1
|
||||
set DAILYFLAGS1_ALL_FRUIT_TREES_F, [hl]
|
||||
ret
|
||||
|
||||
GetFruitTreeFlag:
|
||||
push hl
|
||||
push de
|
||||
ld a, [wCurFruitTree]
|
||||
dec a
|
||||
ld e, a
|
||||
ld d, 0
|
||||
ld hl, wFruitTreeFlags
|
||||
call FlagAction
|
||||
pop de
|
||||
pop hl
|
||||
ret
|
||||
|
||||
GetFruitTreeItem:
|
||||
push hl
|
||||
push de
|
||||
ld e, a
|
||||
ld d, 0
|
||||
ld hl, FruitTreeItems
|
||||
add hl, de
|
||||
ld a, [hl]
|
||||
pop de
|
||||
pop hl
|
||||
ret
|
||||
|
||||
INCLUDE "data/items/fruit_trees.asm"
|
||||
|
||||
FruitBearingTreeText:
|
||||
text_far _FruitBearingTreeText
|
||||
text_end
|
||||
|
||||
HeyItsFruitText:
|
||||
text_far _HeyItsFruitText
|
||||
text_end
|
||||
|
||||
ObtainedFruitText:
|
||||
text_far _ObtainedFruitText
|
||||
text_end
|
||||
|
||||
FruitPackIsFullText:
|
||||
text_far _FruitPackIsFullText
|
||||
text_end
|
||||
|
||||
NothingHereText:
|
||||
text_far _NothingHereText
|
||||
text_end
|
||||
Loading…
Add table
Add a link
Reference in a new issue