mirror of
https://github.com/thornAvery/jep-hack.git
synced 2026-02-06 16:15:24 +13:00
Honey Pot & Grandma
Ported from Pokemon October.8114fead911a6f3e4f03d00cd6fafdAlterations 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:
parent
02233c5429
commit
bcfafaaf83
21 changed files with 331 additions and 303 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
84
engine/events/sweet_honey.asm
Normal file
84
engine/events/sweet_honey.asm
Normal 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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ ItemEffects:
|
|||
dw NoEffect ; WHT_APRICORN
|
||||
dw NoEffect ; BLACKBELT_I
|
||||
dw NoEffect ; BLK_APRICORN
|
||||
dw NoEffect ; ITEM_64
|
||||
dw UseHoneyEffect ; HONEY_POT was ITEM_64
|
||||
dw NoEffect ; PNK_APRICORN
|
||||
dw NoEffect ; BLACKGLASSES
|
||||
dw EvoStoneEffect ; SLOWPOKETAIL
|
||||
|
|
@ -2838,6 +2838,10 @@ RestoreAllPP:
|
|||
jr nz, .loop
|
||||
ret
|
||||
|
||||
UseHoneyEffect:
|
||||
farcall _UseHoney
|
||||
ret
|
||||
|
||||
GetMaxPPOfMove:
|
||||
ld a, [wStringBuffer1 + 0]
|
||||
push af
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ _InitializeStartDay:
|
|||
ClearDailyTimers:
|
||||
xor a
|
||||
ld [wLuckyNumberDayTimer], a
|
||||
ld [wUnusedTwoDayTimer], a
|
||||
ld [wSweetHoneyTimer], a
|
||||
ld [wDailyResetTimer], a
|
||||
ret
|
||||
|
||||
|
|
@ -203,36 +203,23 @@ CheckPokerusTick::
|
|||
xor a
|
||||
ret
|
||||
|
||||
SetUnusedTwoDayTimer: ; unreferenced
|
||||
SetSweetHoneyTimer:
|
||||
ld a, 2
|
||||
ld hl, wUnusedTwoDayTimer
|
||||
ld hl, wSweetHoneyTimer
|
||||
ld [hl], a
|
||||
call UpdateTime
|
||||
ld hl, wUnusedTwoDayTimerStartDate
|
||||
ld hl, wSweetHoneyStartDate
|
||||
call CopyDayToHL
|
||||
ret
|
||||
|
||||
CheckUnusedTwoDayTimer:
|
||||
ld hl, wUnusedTwoDayTimerStartDate
|
||||
_CheckSweetHoneyTimer:
|
||||
ld hl, wSweetHoneyStartDate
|
||||
call CalcDaysSince
|
||||
call GetDaysSince
|
||||
ld hl, wUnusedTwoDayTimer
|
||||
ld hl, wSweetHoneyTimer
|
||||
call UpdateTimeRemaining
|
||||
ret
|
||||
|
||||
UnusedSetSwarmFlag: ; unreferenced
|
||||
ld hl, wDailyFlags1
|
||||
set DAILYFLAGS1_FISH_SWARM_F, [hl]
|
||||
ret
|
||||
|
||||
UnusedCheckSwarmFlag: ; unreferenced
|
||||
and a
|
||||
ld hl, wDailyFlags1
|
||||
bit DAILYFLAGS1_FISH_SWARM_F, [hl]
|
||||
ret nz
|
||||
scf
|
||||
ret
|
||||
|
||||
RestartLuckyNumberCountdown:
|
||||
call .GetDaysUntilNextFriday
|
||||
ld hl, wLuckyNumberDayTimer
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue