Honey Pot & Grandma

Ported from Pokemon October.
8114fead91
1a6f3e4f03
d00cd6fafd

Alterations have been made in that the treemonset has been diversified a bit further, having Munchlax like in DPP. They're L60, intended to be used in Nihon.

I haven't placed the grandma in the region yet, intending for her to be in Old City.
This commit is contained in:
Llinos Evans 2024-07-21 23:00:43 +01:00
parent 02233c5429
commit bcfafaaf83
21 changed files with 331 additions and 303 deletions

View file

@ -1303,6 +1303,7 @@ TryHeadbuttOW::
AskHeadbuttScript:
opentext
callasm TrySweetHoneyOW
writetext AskHeadbuttText
yesorno
iftrue HeadbuttScript
@ -1313,6 +1314,85 @@ AskHeadbuttText:
text_far _AskHeadbuttText
text_end
TrySweetHoneyOW:
; is player at the right position?
call CheckSavedSweetHoneySpot
ret nz ; return if not
farcall _CheckSweetHoneyTimer
ld a, [wSweetHoneyTimer]
and a
; ret z
; - added day 2 check-
ld hl, .TwoDaysAgoText
jr z, .print_message
; - end add -
ld hl, .YesterdayText
cp 1 ; day left
jr z, .print_message
cp 2 ; days left
ret nz
ld hl, .TodayText
.print_message
; writetext
push hl
call SpeechTextbox
call SafeUpdateSprites
ld a, 1
ldh [hOAMUpdate], a
call ApplyTilemap
pop hl
call PrintTextboxText
xor a
ldh [hOAMUpdate], a
ret
.TodayText:
text "There's SWEET HONEY"
line "on the tree!"
para "It's still fresh."
prompt
.YesterdayText:
text "There's SWEET HONEY"
line "on the tree!"
para "It's about a day"
line "old."
prompt
.TwoDaysAgoText:
text "There's SWEET HONEY"
line "on the tree!"
para "Looks ripe!"
prompt
CheckSavedSweetHoneySpot:
; Z flag is set when player is in the exact spot
; where Sweet Honey is applied
; check map group
ld hl, wSweetHoneyMapGroup
ld a, [wMapGroup]
cp [hl]
ret nz
; map number
inc hl ; wSweetHoneyMapNumber
ld a, [wMapNumber]
cp [hl]
ret nz
; X and Y
call GetFacingTileCoord
ld a, [wSweetHoneyX]
cp d
ret nz
ld a, [wSweetHoneyY]
cp e
ret
RockSmashFunction:
call TryRockSmashFromMenu
and $7f

View file

@ -273,9 +273,9 @@ ScriptReturnCarry:
ld [wScriptVar], a
ret
UnusedCheckUnusedTwoDayTimer:
farcall CheckUnusedTwoDayTimer
ld a, [wUnusedTwoDayTimer]
CheckSweetHoneyTimer:
farcall _CheckSweetHoneyTimer
ld a, [wSweetHoneyTimer]
ld [wScriptVar], a
ret

View file

@ -0,0 +1,84 @@
; src - https://github.com/pokeachromicdevs/pokeoctober/commit/8114fead91828dd6d986fe120d6c5cd5e3c6cbf6
_UseHoney::
call .CheckHoney
and $7f
ld [wFieldMoveSucceeded], a
ret
.CheckHoney:
call GetFacingTileCoord
push de
call CheckHeadbuttTreeTile
pop de
jr nz, .NoTree
ld hl, wSweetHoneyEnabled
bit SWEET_HONEY_F, [hl]
jr z, .NoHoney
res SWEET_HONEY_F, [hl]
inc hl
inc hl
inc hl ; wSweetHoneyMapGroup
ld a, [wMapGroup]
ld [hli], a
ld a, [wMapNumber]
ld [hli], a
; X and Y
ld [hl], d
inc hl
ld [hl], e
farcall SetSweetHoneyTimer
ld hl, UseHoneyScript
call QueueScript
ld a, $81 ; success
ret
.NoTree:
ld a, $80 ; fail
ret
.NoHoney:
; TODO: this does not even run due to the "can't use!" text
ld hl, NoHoneyScript
call QueueScript
ld a, $80 ; fail
ret
UseHoneyScript:
reloadmappart
special UpdateTimePals
opentext
writetext .SpreadHoneyText
playsound SFX_DEX_FANFARE_50_79
waitsfx
waitbutton
closetext
end
.SpreadHoneyText:
text "<PLAYER> spread"
line "SWEET HONEY on the"
cont "tree!"
done
NoHoneyScript:
reloadmappart
special UpdateTimePals
opentext
writetext .NoHoneyText
playsound SFX_WRONG
waitsfx
waitbutton
closetext
end
.NoHoneyText:
text "You don't have"
line "SWEET HONEY!"
done

View file

@ -12,7 +12,7 @@ TreeMonEncounter:
call GetTreeMons
jr nc, .no_battle
call GetTreeMon
call ModifyTreeMonRates
jr nc, .no_battle
ld a, BATTLETYPE_TREE
@ -122,6 +122,22 @@ GetTreeMons:
INCLUDE "data/wild/treemons.asm"
ModifyTreeMonRates:
push hl
farcall CheckSavedSweetHoneySpot
pop hl
jr nz, GetTreeMon
push hl
farcall _CheckSweetHoneyTimer
pop hl
ld a, [wSweetHoneyTimer]
cp 2 ; was 1; jump if sweethoney was applied today
jr z, GetTreeMon
ld hl, TreeMonSet_Sweet_Honey
; fallthrough for sweet honey mons
GetTreeMon:
push hl
call GetTreeScore