pokered/scripts/NameRatersHouse.asm

110 lines
2.3 KiB
NASM
Raw Permalink Normal View History

NameRatersHouse_Script:
2014-05-18 18:19:10 +00:00
jp EnableAutoTextBoxDrawing
NameRatersHouseYesNoScript:
2014-05-18 18:19:10 +00:00
call PrintText
call YesNoChoice
ld a, [wCurrentMenuItem]
2014-05-18 18:19:10 +00:00
and a
ret
NameRatersHouseCheckMonOTScript:
; return carry if mon's OT name or OT ID do not match the player's
ld hl, wPartyMonOT
ld bc, NAME_LENGTH
2014-05-18 18:19:10 +00:00
ld a, [wWhichPokemon]
call AddNTimes
ld de, wPlayerName
ld c, NAME_LENGTH
call .check_match_loop
jr c, .no_match
ld hl, wPartyMon1OTID
2015-08-10 04:56:20 +00:00
ld bc, wPartyMon2 - wPartyMon1
2014-05-18 18:19:10 +00:00
ld a, [wWhichPokemon]
call AddNTimes
ld de, wPlayerID
2014-05-18 18:19:10 +00:00
ld c, $2
.check_match_loop
2014-05-18 18:19:10 +00:00
ld a, [de]
cp [hl]
jr nz, .no_match
2014-05-18 18:19:10 +00:00
inc hl
inc de
dec c
jr nz, .check_match_loop
2014-05-18 18:19:10 +00:00
and a
ret
.no_match
2014-05-18 18:19:10 +00:00
scf
ret
NameRatersHouse_TextPointers:
def_text_pointers
dw_const NameRatersHouseNameRaterText, TEXT_NAMERATERSHOUSE_NAME_RATER
2014-05-18 18:19:10 +00:00
NameRatersHouseNameRaterText:
text_asm
2014-05-18 18:19:10 +00:00
call SaveScreenTilesToBuffer2
ld hl, .WantMeToRateText
call NameRatersHouseYesNoScript
jr nz, .did_not_rename
ld hl, .WhichPokemonText
2014-05-18 18:19:10 +00:00
call PrintText
xor a
ld [wPartyMenuTypeOrMessageID], a
2014-09-13 07:50:56 +00:00
ld [wUpdateSpritesEnabled], a
2014-08-09 05:39:13 +00:00
ld [wMenuItemToSwap], a
2014-05-18 18:19:10 +00:00
call DisplayPartyMenu
push af
call GBPalWhiteOutWithDelay3
call RestoreScreenTilesAndReloadTilePatterns
2014-05-18 18:19:10 +00:00
call LoadGBPal
pop af
jr c, .did_not_rename
2014-05-18 18:19:10 +00:00
call GetPartyMonName2
call NameRatersHouseCheckMonOTScript
ld hl, .ATrulyImpeccableNameText
jr c, .done
ld hl, .GiveItANiceNameText
call NameRatersHouseYesNoScript
jr nz, .did_not_rename
ld hl, .WhatShouldWeNameItText
2014-05-18 18:19:10 +00:00
call PrintText
farcall DisplayNameRaterScreen
jr c, .did_not_rename
ld hl, .PokemonHasBeenRenamedText
.done
2014-05-18 18:19:10 +00:00
call PrintText
jp TextScriptEnd
.did_not_rename
ld hl, .ComeAnyTimeYouLikeText
jr .done
2014-05-18 18:19:10 +00:00
.WantMeToRateText:
text_far _NameRatersHouseNameRaterWantMeToRateText
text_end
2014-05-18 18:19:10 +00:00
.WhichPokemonText:
text_far _NameRatersHouseNameRaterWhichPokemonText
text_end
2014-05-18 18:19:10 +00:00
.GiveItANiceNameText:
text_far _NameRatersHouseNameRaterGiveItANiceNameText
text_end
2014-05-18 18:19:10 +00:00
.WhatShouldWeNameItText:
text_far _NameRatersHouseNameRaterWhatShouldWeNameItText
text_end
2014-05-18 18:19:10 +00:00
.PokemonHasBeenRenamedText:
text_far _NameRatersHouseNameRaterPokemonHasBeenRenamedText
text_end
2014-05-18 18:19:10 +00:00
.ComeAnyTimeYouLikeText:
text_far _NameRatersHouseNameRaterComeAnyTimeYouLikeText
text_end
2014-05-18 18:19:10 +00:00
.ATrulyImpeccableNameText:
text_far _NameRatersHouseNameRaterATrulyImpeccableNameText
text_end