mirror of
https://github.com/thornAvery/kep-hack.git
synced 2025-09-17 02:40:50 +12:00
Talk to Use Cut. Strength and Surf
This commit is contained in:
parent
141e7c2de8
commit
fe4dc821fd
|
@ -109,3 +109,4 @@ PredefPointers::
|
|||
add_predef DrawHP2
|
||||
add_predef DisplayElevatorFloorMenu
|
||||
add_predef OaksAideScript
|
||||
add_predef TryFieldMove
|
||||
|
|
|
@ -1788,3 +1788,19 @@ _TextIDErrorText::
|
|||
_ContCharText::
|
||||
text "<_CONT>@"
|
||||
text_end
|
||||
|
||||
_PromptToSurfText::
|
||||
text "The water is calm."
|
||||
line "Would you like to"
|
||||
cont "SURF?"
|
||||
done
|
||||
|
||||
_ExplainCutText::
|
||||
text "This tree can be"
|
||||
line "CUT!"
|
||||
done
|
||||
|
||||
_PromptToCutText::
|
||||
text "Would you like to"
|
||||
line "use CUT?"
|
||||
done
|
|
@ -9,7 +9,7 @@ HiddenItems:
|
|||
predef FlagActionPredef
|
||||
ld a, c
|
||||
and a
|
||||
ret nz
|
||||
jr nz, .nope
|
||||
call EnableAutoTextBoxDrawing
|
||||
ld a, 1
|
||||
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
|
||||
|
@ -17,6 +17,9 @@ HiddenItems:
|
|||
ld [wd11e], a
|
||||
call GetItemName
|
||||
tx_pre_jump FoundHiddenItemText
|
||||
.nope
|
||||
predef TryFieldMove
|
||||
ret
|
||||
|
||||
INCLUDE "data/events/hidden_item_coords.asm"
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ UsedCut:
|
|||
call GBPalWhiteOutWithDelay3
|
||||
call ClearSprites
|
||||
call RestoreScreenTilesAndReloadTilePatterns
|
||||
call ReloadMapData
|
||||
ld a, SCREEN_HEIGHT_PX
|
||||
ldh [hWY], a
|
||||
call Delay3
|
||||
|
@ -46,6 +47,9 @@ UsedCut:
|
|||
call Delay3
|
||||
xor a
|
||||
ldh [hWY], a
|
||||
; fall through
|
||||
|
||||
Cut2::
|
||||
ld hl, UsedCutText
|
||||
call PrintText
|
||||
call LoadScreenTilesFromBuffer2
|
||||
|
|
171
engine/overworld/field_moves.asm
Normal file
171
engine/overworld/field_moves.asm
Normal file
|
@ -0,0 +1,171 @@
|
|||
TryFieldMove:: ; predef
|
||||
call GetPredefRegisters
|
||||
call TrySurf
|
||||
ret z
|
||||
call TryCut
|
||||
ret
|
||||
|
||||
TrySurf:
|
||||
ld a, [wWalkBikeSurfState]
|
||||
cp 2 ; is the player already surfing?
|
||||
jr z, .no
|
||||
callfar IsNextTileShoreOrWater
|
||||
jr c, .no
|
||||
ld hl, TilePairCollisionsWater
|
||||
call CheckForTilePairCollisions2
|
||||
jr c, .no
|
||||
ld d, SURF
|
||||
call HasPartyMove
|
||||
jr nz, .no
|
||||
ld a, [wObtainedBadges]
|
||||
bit 4, a ; SOUL BADGE
|
||||
jr z, .no
|
||||
callfar IsSurfingAllowed
|
||||
ld hl, wd728
|
||||
bit 1, [hl]
|
||||
res 1, [hl]
|
||||
jr z, .no
|
||||
call InitializeFieldMoveTextBox
|
||||
ld hl, PromptToSurfText
|
||||
call PrintText
|
||||
call YesNoChoice
|
||||
ld a, [wCurrentMenuItem]
|
||||
and a
|
||||
jr nz, .no2
|
||||
call GetPartyMonName2
|
||||
ld a, SURFBOARD
|
||||
ld [wcf91], a
|
||||
ld [wPseudoItemID], a
|
||||
call UseItem
|
||||
.yes2
|
||||
call CloseFieldMoveTextBox
|
||||
.yes
|
||||
xor a
|
||||
ret
|
||||
.no2
|
||||
call CloseFieldMoveTextBox
|
||||
.no
|
||||
ld a, 1
|
||||
and a
|
||||
ret
|
||||
|
||||
TryCut:
|
||||
call IsCutTile
|
||||
jr nc, TrySurf.no
|
||||
call InitializeFieldMoveTextBox
|
||||
ld hl, ExplainCutText
|
||||
call PrintText
|
||||
call ManualTextScroll
|
||||
ld d, CUT
|
||||
call HasPartyMove
|
||||
jr nz, TrySurf.no2
|
||||
ld a, [wObtainedBadges]
|
||||
bit 1, a ; CASCADE BADGE
|
||||
jr z, TrySurf.no2
|
||||
ld hl, PromptToCutText
|
||||
call PrintText
|
||||
call YesNoChoice
|
||||
ld a, [wCurrentMenuItem]
|
||||
and a
|
||||
jr nz, TrySurf.no2
|
||||
call GetPartyMonName2
|
||||
callfar Cut2
|
||||
call CloseFieldMoveTextBox
|
||||
jr TrySurf.yes2
|
||||
|
||||
IsCutTile:
|
||||
; partial copy from UsedCut
|
||||
ld a, [wCurMapTileset]
|
||||
and a ; OVERWORLD
|
||||
jr z, .overworld
|
||||
cp GYM
|
||||
jr nz, .no
|
||||
ld a, [wTileInFrontOfPlayer]
|
||||
cp $50 ; gym cut tree
|
||||
jr nz, .no
|
||||
jr .yes
|
||||
.overworld
|
||||
ld a, [wTileInFrontOfPlayer]
|
||||
cp $3d ; cut tree
|
||||
jr nz, .no
|
||||
.yes
|
||||
scf
|
||||
ret
|
||||
.no
|
||||
and a
|
||||
ret
|
||||
|
||||
HasPartyMove::
|
||||
; Return z (optional: in wWhichTrade) if a PartyMon has move d.
|
||||
; Updates wWhichPokemon.
|
||||
push bc
|
||||
push de
|
||||
push hl
|
||||
|
||||
ld a, [wPartyCount]
|
||||
and a
|
||||
jr z, .no
|
||||
ld b, a
|
||||
ld c, 0
|
||||
ld hl, wPartyMons + (wPartyMon1Moves - wPartyMon1)
|
||||
.loop
|
||||
ld e, NUM_MOVES
|
||||
.check_move
|
||||
ld a, [hli]
|
||||
cp d
|
||||
jr z, .yes
|
||||
dec e
|
||||
jr nz, .check_move
|
||||
|
||||
ld a, wPartyMon2 - wPartyMon1 - NUM_MOVES
|
||||
add l
|
||||
ld l, a
|
||||
adc h
|
||||
sub l
|
||||
ld h, a
|
||||
|
||||
inc c
|
||||
ld a, c
|
||||
cp b
|
||||
jr c, .loop
|
||||
jr .no
|
||||
|
||||
.yes
|
||||
ld a, c
|
||||
ld [wWhichPokemon], a
|
||||
xor a ; probably redundant
|
||||
ld [wWhichTrade], a
|
||||
jr .done
|
||||
.no
|
||||
ld a, 1
|
||||
and a
|
||||
ld [wWhichTrade], a
|
||||
.done
|
||||
pop hl
|
||||
pop de
|
||||
pop bc
|
||||
ret
|
||||
|
||||
InitializeFieldMoveTextBox:
|
||||
call EnableAutoTextBoxDrawing
|
||||
ld a, 1 ; not 0
|
||||
ld [hSpriteIndexOrTextID], a
|
||||
callfar DisplayTextIDInit
|
||||
ret
|
||||
|
||||
CloseFieldMoveTextBox:
|
||||
ld a,[hLoadedROMBank]
|
||||
push af
|
||||
jp CloseTextDisplay
|
||||
|
||||
PromptToSurfText:
|
||||
text_far _PromptToSurfText
|
||||
text_end
|
||||
|
||||
ExplainCutText:
|
||||
text_far _ExplainCutText
|
||||
text_end
|
||||
|
||||
PromptToCutText:
|
||||
text_far _PromptToCutText
|
||||
text_end
|
|
@ -94,7 +94,9 @@ OverworldLoopLessDelay::
|
|||
call IsSpriteOrSignInFrontOfPlayer
|
||||
ldh a, [hSpriteIndexOrTextID]
|
||||
and a
|
||||
jp z, OverworldLoop
|
||||
jr nz, .displayDialogue
|
||||
predef TryFieldMove
|
||||
jp OverworldLoop
|
||||
.displayDialogue
|
||||
predef GetTileAndCoordsInFrontOfPlayer
|
||||
call UpdateSprites
|
||||
|
|
|
@ -15,7 +15,24 @@ GroundRoseText::
|
|||
|
||||
BoulderText::
|
||||
text_far _BoulderText
|
||||
text_end
|
||||
text_asm
|
||||
ld a, [wObtainedBadges]
|
||||
bit 3, a ; RAINBOW BADGE
|
||||
jr z, .done
|
||||
ld d, STRENGTH
|
||||
callfar HasPartyMove
|
||||
ld a, [wWhichTrade]
|
||||
and a
|
||||
jr nz, .done
|
||||
ld a, [wWhichPokemon]
|
||||
push af
|
||||
call ManualTextScroll
|
||||
pop af
|
||||
ld [wWhichPokemon], a
|
||||
call GetPartyMonName2
|
||||
predef PrintStrengthTxt
|
||||
.done
|
||||
jp TextScriptEnd
|
||||
|
||||
MartSignText::
|
||||
text_far _MartSignText
|
||||
|
|
|
@ -83,16 +83,6 @@ DrawHPBar::
|
|||
LoadMonData::
|
||||
jpfar LoadMonData_
|
||||
|
||||
OverwritewMoves::
|
||||
; Write c to [wMoves + b]. Unused.
|
||||
ld hl, wMoves
|
||||
ld e, b
|
||||
ld d, 0
|
||||
add hl, de
|
||||
ld a, c
|
||||
ld [hl], a
|
||||
ret
|
||||
|
||||
LoadFlippedFrontSpriteByMonIndex::
|
||||
ld a, 1
|
||||
ld [wSpriteFlipped], a
|
||||
|
@ -360,15 +350,6 @@ PrintLevelCommon::
|
|||
ld b, LEFT_ALIGN | 1 ; 1 byte
|
||||
jp PrintNumber
|
||||
|
||||
GetwMoves::
|
||||
; Unused. Returns the move at index a from wMoves in a
|
||||
ld hl, wMoves
|
||||
ld c, a
|
||||
ld b, 0
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
ret
|
||||
|
||||
; copies the base stat data of a pokemon to wMonHeader
|
||||
; INPUT:
|
||||
; [wd0b5] = pokemon ID
|
||||
|
|
5
main.asm
5
main.asm
|
@ -325,6 +325,7 @@ INCLUDE "engine/gfx/mon_icons.asm"
|
|||
INCLUDE "engine/events/in_game_trades.asm"
|
||||
INCLUDE "engine/gfx/palettes.asm"
|
||||
INCLUDE "engine/menus/save.asm"
|
||||
INCLUDE "engine/overworld/field_moves.asm"
|
||||
|
||||
|
||||
SECTION "Itemfinder 1", ROMX
|
||||
|
@ -350,10 +351,10 @@ SECTION "bank1E", ROMX
|
|||
INCLUDE "engine/battle/animations.asm"
|
||||
INCLUDE "engine/overworld/cut2.asm"
|
||||
INCLUDE "engine/overworld/dust_smoke.asm"
|
||||
INCLUDE "gfx/fishing.asm"
|
||||
INCLUDE "data/moves/animations.asm"
|
||||
INCLUDE "data/battle_anims/subanimations.asm"
|
||||
INCLUDE "data/battle_anims/frame_blocks.asm"
|
||||
INCLUDE "engine/movie/evolution.asm"
|
||||
INCLUDE "engine/overworld/elevator.asm"
|
||||
INCLUDE "engine/items/tm_prices.asm"
|
||||
INCLUDE "engine/overworld/elevator.asm"
|
||||
INCLUDE "gfx/fishing.asm"
|
||||
|
|
Loading…
Reference in a new issue