Happiness and Mystery Gift constants

This commit is contained in:
PikalaxALT
2015-10-12 12:33:24 -04:00
parent 327faac497
commit 0c39f6e273
12 changed files with 296 additions and 186 deletions

View File

@@ -2815,21 +2815,22 @@ Function3d1aa: ; 3d1aa
ld [hl], a ld [hl], a
ld [BattleMonStatus], a ld [BattleMonStatus], a
call UpdateBattleMonInParty call UpdateBattleMonInParty
ld c, $6 ld c, HAPPINESS_FAINTED
; If TheirLevel > (YourLevel + 30), use a different parameter
ld a, [BattleMonLevel] ld a, [BattleMonLevel]
add $1e add 30
ld b, a ld b, a
ld a, [EnemyMonLevel] ld a, [EnemyMonLevel]
cp b cp b
jr c, .asm_3d1dc jr c, .asm_3d1dc
ld c, $8 ld c, HAPPINESS_BEATENBYSTRONGFOE
.asm_3d1dc .asm_3d1dc
ld a, [CurBattleMon] ld a, [CurBattleMon]
ld [CurPartyMon], a ld [CurPartyMon], a
callab ChangeHappiness callab ChangeHappiness
ld a, [wd0ee] ld a, [wd0ee]
and $c0 and %11000000
add $1 add $1
ld [wd0ee], a ld [wd0ee], a
ld a, [wc6f7] ld a, [wc6f7]
@@ -8526,28 +8527,28 @@ Function3f594: ; 3f594
ld [IsInBattle], a ld [IsInBattle], a
call IsJohtoGymLeader call IsJohtoGymLeader
jr nc, .asm_3f606 jr nc, .done
xor a xor a
ld [CurPartyMon], a ld [CurPartyMon], a
ld a, [PartyCount] ld a, [PartyCount]
ld b, a ld b, a
.asm_3f5ea .partyloop
push bc push bc
ld a, PartyMon1HP - PartyMon1 ld a, PartyMon1HP - PartyMon1
call GetPartyParamLocation call GetPartyParamLocation
ld a, [hli] ld a, [hli]
or [hl] or [hl]
jr z, .asm_3f5fc jr z, .skipfaintedmon
ld c, $4 ld c, HAPPINESS_GYMBATTLE
callab ChangeHappiness callab ChangeHappiness
.asm_3f5fc .skipfaintedmon
pop bc pop bc
dec b dec b
jr z, .asm_3f606 jr z, .done
ld hl, CurPartyMon ld hl, CurPartyMon
inc [hl] inc [hl]
jr .asm_3f5ea jr .partyloop
.asm_3f606 .done
ret ret
; 3f607 ; 3f607

View File

@@ -51,35 +51,36 @@ const_value = 1
const SET_UP_ORNAMENT const SET_UP_ORNAMENT
const PUT_AWAY_ORNAMENT const PUT_AWAY_ORNAMENT
const_value = 2 const_value = 1
const DECO_01
const DECO_FEATHERY_BED ; 2 const DECO_FEATHERY_BED ; 2
const DECO_PINK_BED ; 3 const DECO_PINK_BED ; 3
const DECO_POLKADOT_BED ; 4 const DECO_POLKADOT_BED ; 4
const DECO_PIKACHU_BED ; 5 const DECO_PIKACHU_BED ; 5
const_value = const_value + 1 const DECO_06
const DECO_RED_CARPET ; 7 const DECO_RED_CARPET ; 7
const DECO_BLUE_CARPET ; 8 const DECO_BLUE_CARPET ; 8
const DECO_YELLOW_CARPET ; 9 const DECO_YELLOW_CARPET ; 9
const DECO_GREEN_CARPET ; a const DECO_GREEN_CARPET ; a
const_value = const_value + 1 const DECO_0B
const DECO_MAGNAPLANT ; c const DECO_MAGNAPLANT ; c
const DECO_TROPICPLANT ; d const DECO_TROPICPLANT ; d
const DECO_JUMBOPLANT ; e const DECO_JUMBOPLANT ; e
const_value = const_value + 1 const DECO_0F
const DECO_TOWN_MAP ; 10 const DECO_TOWN_MAP ; 10
const DECO_PIKACHU_POSTER ; 11 const DECO_PIKACHU_POSTER ; 11
const DECO_CLEFAIRY_POSTER ; 12 const DECO_CLEFAIRY_POSTER ; 12
const DECO_JIGGLYPUFF_POSTER ; 13 const DECO_JIGGLYPUFF_POSTER ; 13
const_value = const_value + 1 const DECO_14
const DECO_FAMICOM ; 15 const DECO_FAMICOM ; 15
const DECO_SNES ; 16 const DECO_SNES ; 16
const DECO_N64 ; 17 const DECO_N64 ; 17
const DECO_VIRTUAL_BOY ; 18 const DECO_VIRTUAL_BOY ; 18
const_value = const_value + 1 const DECO_19
const DECO_BIG_SNORLAX_DOLL ; 1a const DECO_BIG_SNORLAX_DOLL ; 1a
const DECO_BIG_ONIX_DOLL ; 1b const DECO_BIG_ONIX_DOLL ; 1b
const DECO_BIG_LAPRAS_DOLL ; 1c const DECO_BIG_LAPRAS_DOLL ; 1c
const_value = const_value + 1 const DECO_1D
const DECO_PIKACHU_DOLL ; 1e const DECO_PIKACHU_DOLL ; 1e
const DECO_SURF_PIKACHU_DOLL ; 1f const DECO_SURF_PIKACHU_DOLL ; 1f
const DECO_CLEFAIRY_DOLL ; 20 const DECO_CLEFAIRY_DOLL ; 20

View File

@@ -124,3 +124,25 @@ PRINTNUM_LEADINGZEROS_F EQU 7
PRINTNUM_MONEY EQU 1 << PRINTNUM_MONEY_F PRINTNUM_MONEY EQU 1 << PRINTNUM_MONEY_F
PRINTNUM_RIGHTALIGN EQU 1 << PRINTNUM_RIGHTALIGN_F PRINTNUM_RIGHTALIGN EQU 1 << PRINTNUM_RIGHTALIGN_F
PRINTNUM_LEADINGZEROS EQU 1 << PRINTNUM_LEADINGZEROS_F PRINTNUM_LEADINGZEROS EQU 1 << PRINTNUM_LEADINGZEROS_F
const_value = 1
const HAPPINESS_GAINLEVEL ; 01
const HAPPINESS_USEDITEM ; 02
const HAPPINESS_USEDXITEM ; 03
const HAPPINESS_GYMBATTLE ; 04
const HAPPINESS_LEARNMOVE ; 05
const HAPPINESS_FAINTED ; 06
const HAPPINESS_POISONFAINT ; 07
const HAPPINESS_BEATENBYSTRONGFOE ; 08
const HAPPINESS_YOUNGCUT1 ; 09
const HAPPINESS_YOUNGCUT2 ; 0a
const HAPPINESS_YOUNGCUT3 ; 0b
const HAPPINESS_OLDERCUT1 ; 0c
const HAPPINESS_OLDERCUT2 ; 0d
const HAPPINESS_OLDERCUT3 ; 0e
const HAPPINESS_BITTERPOWDER ; 0f
const HAPPINESS_ENERGYROOT ; 10
const HAPPINESS_REVIVALHERB ; 11
const HAPPINESS_MASSAGE ; 12
const HAPPINESS_GAINLEVELATHOME ; 13

View File

@@ -117,9 +117,9 @@ SpecialsPointers:: ; c029
add_special RunCallback_04 add_special RunCallback_04
add_special Functionfb841 add_special Functionfb841
add_special SpecialSnorlaxAwake add_special SpecialSnorlaxAwake
add_special Function7413 add_special Special_YoungerHaircutBrother
add_special Function7418 add_special Special_OlderHaircutBrother
add_special Function741d add_special Special_DaisyMassage
add_special Functionc472 add_special Functionc472
add_special ProfOaksPCBoot add_special ProfOaksPCBoot
add_special SpecialGameboyCheck add_special SpecialGameboyCheck

View File

@@ -1115,7 +1115,7 @@ IsHMMove:: ; 34e7
db FLASH db FLASH
db WATERFALL db WATERFALL
db WHIRLPOOL db WHIRLPOOL
db $ff db -1
; 34f8 ; 34f8
@@ -1125,7 +1125,7 @@ GetMoveName:: ; 34f8
ld a, MOVE_NAME ld a, MOVE_NAME
ld [wcf61], a ld [wcf61], a
ld a, [wd265] ; move id ld a, [wNamedObjectIndexBuffer] ; move id
ld [CurSpecies], a ld [CurSpecies], a
call GetName call GetName

View File

@@ -1259,7 +1259,7 @@ Calcium: ; ee3d
ld h, [hl] ld h, [hl]
ld l, a ld l, a
ld de, StringBuffer2 ld de, StringBuffer2
ld bc, $000d ld bc, ITEM_NAME_LENGTH
call CopyBytes call CopyBytes
call Functionf780 call Functionf780
@@ -1267,7 +1267,7 @@ Calcium: ; ee3d
ld hl, UnknownText_0xeea6 ld hl, UnknownText_0xeea6
call PrintText call PrintText
ld c, $2 ld c, HAPPINESS_USEDITEM
callba ChangeHappiness callba ChangeHappiness
jp Functionf795 jp Functionf795
@@ -1464,7 +1464,7 @@ HealPowder: ; efad
cp $0 cp $0
jr nz, .asm_efc9 jr nz, .asm_efc9
ld c, $f ld c, HAPPINESS_BITTERPOWDER
callba ChangeHappiness callba ChangeHappiness
call LooksBitterMessage call LooksBitterMessage
@@ -1632,7 +1632,7 @@ RevivalHerb: ; f0a9
cp 0 cp 0
jr nz, .asm_f0c5 jr nz, .asm_f0c5
ld c, $11 ld c, HAPPINESS_REVIVALHERB
callba ChangeHappiness callba ChangeHappiness
call LooksBitterMessage call LooksBitterMessage
ld a, 0 ld a, 0
@@ -1780,12 +1780,12 @@ GoldBerry: ; f186
Energypowder: ; f18c Energypowder: ; f18c
ld c, $f ld c, HAPPINESS_BITTERPOWDER
jr Functionf192 jr Functionf192
; f190 ; f190
EnergyRoot: ; f190 EnergyRoot: ; f190
ld c, $10 ld c, HAPPINESS_ENERGYROOT
; f192 ; f192
Functionf192: ; f192 Functionf192: ; f192
@@ -2348,7 +2348,7 @@ endr
ld a, [CurBattleMon] ld a, [CurBattleMon]
ld [CurPartyMon], a ld [CurPartyMon], a
ld c, $3 ld c, HAPPINESS_USEDXITEM
callba ChangeHappiness callba ChangeHappiness
ret ret
; f504 ; f504

View File

@@ -149,3 +149,15 @@ bcd: MACRO
shift shift
endr endr
ENDM ENDM
ln: MACRO
if _NARG == 5
lb \1, \2 << 4 + \3, \4 << 4 + \5
else
if _NARG == 3
ld \1, \2 << 4 + \3
else
fail "incorrect number of arguments for ln"
endc
endc
ENDM

361
main.asm
View File

@@ -2786,18 +2786,18 @@ endr
db +3, +2, +1 ; Battled a Gym Leader db +3, +2, +1 ; Battled a Gym Leader
db +1, +1, +0 ; Learned a move db +1, +1, +0 ; Learned a move
db -1, -1, -1 ; Lost to an enemy db -1, -1, -1 ; Lost to an enemy
db -5, -5, -10 db -5, -5, -10 ; Fainted due to poison
db -5, -5, -10 ; Lost to a much weaker enemy db -5, -5, -10 ; Lost to a much weaker enemy
db +1, +1, +1 db +1, +1, +1 ; Haircut?
db +3, +3, +1 db +3, +3, +1 ; Haircut?
db +5, +5, +2 db +5, +5, +2 ; Haircut?
db +1, +1, +1 db +1, +1, +1 ; Haircut?
db +3, +3, +1 db +3, +3, +1 ; Haircut?
db +10, +10, +4 db +10, +10, +4 ; Haircut?
db -5, -5, -10 ; Used Heal Powder or Energypowder (bitter) db -5, -5, -10 ; Used Heal Powder or Energypowder (bitter)
db -10, -10, -15 ; Used Energy Root (bitter) db -10, -10, -15 ; Used Energy Root (bitter)
db -15, -15, -20 ; Used Revival Herb (bitter) db -15, -15, -20 ; Used Revival Herb (bitter)
db +3, +3, +1 db +3, +3, +1 ; Massage?
db +10, +6, +4 ; Gained a level in the place where it was caught db +10, +6, +4 ; Gained a level in the place where it was caught
; 725a ; 725a
@@ -3081,18 +3081,18 @@ Function73f7: ; 73f7
ret ret
; 7413 ; 7413
Function7413: ; 7413 Special_YoungerHaircutBrother: ; 7413
ld hl, Data7459 ld hl, Data_YoungerHaircutBrother
jr Function7420 jr MassageOrHaircut
Function7418: ; 7418 Special_OlderHaircutBrother: ; 7418
ld hl, Data7462 ld hl, Data_OlderHaircutBrother
jr Function7420 jr MassageOrHaircut
Function741d: ; 741d Special_DaisyMassage: ; 741d
ld hl, Data746b ld hl, Data_DaisyMassage
Function7420: ; 7420 MassageOrHaircut: ; 7420
push hl push hl
callba SelectMonFromParty callba SelectMonFromParty
pop hl pop hl
@@ -3105,6 +3105,13 @@ Function7420: ; 7420
call CopyPokemonName_Buffer1_Buffer3 call CopyPokemonName_Buffer1_Buffer3
pop hl pop hl
call Random call Random
; Bug: Subtracting $ff from $ff fails to set c.
; This can result in overflow into the next data array.
; In the case of getting a massage from Daisy, we bleed
; into CopyPokemonName_Buffer1_Buffer3, which passes
; $d0 to ChangeHappiness and returns $73 to the script.
; The end result is that there is a 0.4% chance your
; Pokemon's happiness will not change at all.
.loop .loop
sub [hl] sub [hl]
jr c, .ok jr c, .ok
@@ -3127,23 +3134,23 @@ endr
ret ret
.egg .egg
ld a, $1 ld a, 1
ld [ScriptVar], a ld [ScriptVar], a
ret ret
; 7459 ; 7459
Data7459: ; 7459 Data_YoungerHaircutBrother: ; 7459
db $4c, $02, $09 db $4c, 2, HAPPINESS_YOUNGCUT1 ; 30% chance
db $80, $03, $0a db $80, 3, HAPPINESS_YOUNGCUT2 ; 20% chance
db $ff, $04, $0b db $ff, 4, HAPPINESS_YOUNGCUT3 ; 50% chance
Data7462: ; 7462 Data_OlderHaircutBrother: ; 7462
db $9a, $02, $0c db $9a, 2, HAPPINESS_OLDERCUT1 ; 60% chance
db $4c, $03, $0d db $4c, 3, HAPPINESS_OLDERCUT2 ; 10% chance
db $ff, $04, $0e db $ff, 4, HAPPINESS_OLDERCUT3 ; 30% chance
Data746b: ; 746b Data_DaisyMassage: ; 746b
db $ff, $02, $12 db $ff, 2, HAPPINESS_MASSAGE ; 99.6% chance
; 746e ; 746e
CopyPokemonName_Buffer1_Buffer3: ; 746e CopyPokemonName_Buffer1_Buffer3: ; 746e
@@ -27048,9 +27055,9 @@ LevelUpHappinessMod: ; 2709e
ld c, a ld c, a
call GetWorldMapLocation call GetWorldMapLocation
cp d cp d
ld c, 1 ld c, HAPPINESS_GAINLEVEL
jr nz, .ok jr nz, .ok
ld c, 19 ld c, HAPPINESS_GAINLEVELATHOME
.ok .ok
callab ChangeHappiness callab ChangeHappiness
@@ -33151,73 +33158,77 @@ Function2c642: ; 2c642 (b:4642)
call CloseSRAM call CloseSRAM
ld hl, OverworldMap ld hl, OverworldMap
ld de, wc950 ld de, wc950
ld bc, $14 ld bc, SCREEN_WIDTH
jp CopyBytes jp CopyBytes
Function2c6ac: ; 2c6ac (b:46ac) Function2c6ac: ; 2c6ac (b:46ac)
push de push de
call Random call Random
cp $19 cp $19 ; 10 percent
jr c, .asm_2c6cc jr c, .tenpercent
call Random call Random
and $7 and $7
ld d, a ld d, a
rl d rl d
ld e, $80 ld e, $80
.asm_2c6be .loop
rlc e rlc e
dec a dec a
jr nz, .asm_2c6be jr nz, .loop
ld a, e ld a, e
and c and c
jr z, .asm_2c6c9 jr z, .skip
ld a, $1 ld a, $1
.asm_2c6c9 .skip
add d add d
jr .asm_2c706 jr .done
.asm_2c6cc
.tenpercent
call Random call Random
cp $32 cp $32 ; 20 percent
jr c, .asm_2c6ed jr c, .twopercent
call Random call Random
and $3 and $3
ld d, a ld d, a
rl d rl d
ld e, $80 ld e, $80
.asm_2c6dd .loop2
rlc e rlc e
dec a dec a
jr nz, .asm_2c6dd jr nz, .loop2
ld a, e ld a, e
and b and b
jr z, .asm_2c6e8 jr z, .skip2
ld a, $1 ld a, $1
.asm_2c6e8 .skip2
add d add d
add $10 add $10
jr .asm_2c706 jr .done
.asm_2c6ed
.twopercent
call Random call Random
cp $32 cp $32 ; 50 ; 20 percent
jr c, .asm_2c6fd jr c, .pointfourpercent
ld a, b ld a, b
swap a swap a
and $7 and $7
add $18 add $18
jr .asm_2c706 jr .done
.asm_2c6fd
.pointfourpercent
ld a, b ld a, b
and $80 and $80
ld a, $20 ld a, $20
jr z, .asm_2c706 jr z, .done
ld a, $21 ld a, $21
.asm_2c706
.done
pop de pop de
ret ret
Function2c708: ; 2c708 (b:4708) MysteryGiftGetItem: ; 2c708 (b:4708)
ld a, c ld a, c
cp $25 cp $25 ; 37
jr nc, Function2c722 jr nc, Function2c722
ld hl, Unknown_2c725 ld hl, Unknown_2c725
ld b, 0 ld b, 0
@@ -33225,9 +33236,9 @@ Function2c708: ; 2c708 (b:4708)
ld c, [hl] ld c, [hl]
ret ret
Function2c715: ; 2c715 (b:4715) MysteryGiftGetDecoration: ; 2c715 (b:4715)
ld a, c ld a, c
cp $25 cp $25 ; 37
jr nc, Function2c722 jr nc, Function2c722
ld hl, Unknown_2c74a ld hl, Unknown_2c74a
ld b, 0 ld b, 0
@@ -33236,32 +33247,90 @@ Function2c715: ; 2c715 (b:4715)
ret ret
Function2c722: ; 2c722 (b:4722) Function2c722: ; 2c722 (b:4722)
ld c, $4 ld c, DECO_POLKADOT_BED ; GREAT_BALL
ret ret
; 2c725 (b:4725) ; 2c725 (b:4725)
Unknown_2c725: ; 2c725 Unknown_2c725: ; 2c725
; May or may not be items. ; May or may not be items.
db $ad, $4e, $54, $50, $4f db BERRY
db $4a, $29, $33, $31, $53 db PRZCUREBERRY
db $2c, $35, $21, $b9, $ba db MINT_BERRY
db $bc, $6d, $ae, $27, $04 db ICE_BERRY
db $2a, $2b, $41, $3f, $18 db BURNT_BERRY
db $16, $22, $17, $40, $15 db PSNCUREBERRY
db $28, $8c, $1a, $3e, $20 db GUARD_SPEC
db $bb, $bd db X_DEFEND
db X_ATTACK
db BITTER_BERRY
db DIRE_HIT
db X_SPECIAL
db X_ACCURACY
db EON_MAIL
db MORPH_MAIL
db MUSIC_MAIL
db MIRACLEBERRY
db GOLD_BERRY
db REVIVE
db GREAT_BALL
db SUPER_REPEL
db MAX_REPEL
db ELIXER
db ETHER
db WATER_STONE
db FIRE_STONE
db LEAF_STONE
db THUNDERSTONE
db MAX_ETHER
db MAX_ELIXER
db MAX_REVIVE
db SCOPE_LENS
db HP_UP
db PP_UP
db RARE_CANDY
db BLUESKY_MAIL
db MIRAGE_MAIL
; 2c74a ; 2c74a
Unknown_2c74a: ; 2c74a Unknown_2c74a: ; 2c74a
; May or may not be items. ; May or may not be items.
db $16, $1a, $1b, $1c, $1d db DECO_SNES
db $1e, $1f, $20, $21, $22 db DECO_BIG_SNORLAX_DOLL
db $0d, $0e, $10, $23, $25 db DECO_BIG_ONIX_DOLL
db $26, $08, $09, $0f, $11 db DECO_BIG_LAPRAS_DOLL
db $17, $19, $01, $02, $04 db DECO_1D
db $05, $06, $07, $0a, $12 db DECO_PIKACHU_DOLL
db $29, $0c, $2a, $14, $03 db DECO_SURF_PIKACHU_DOLL
db $24, $27 db DECO_CLEFAIRY_DOLL
db DECO_JIGGLYPUFF_DOLL
db DECO_BULBASAUR_DOLL
db DECO_TROPICPLANT
db DECO_JUMBOPLANT
db DECO_TOWN_MAP
db DECO_CHARMANDER_DOLL
db DECO_POLIWAG_DOLL
db DECO_DIGLETT_DOLL
db DECO_BLUE_CARPET
db DECO_YELLOW_CARPET
db DECO_0F
db DECO_PIKACHU_POSTER
db DECO_N64
db DECO_19
db DECO_01
db DECO_FEATHERY_BED
db DECO_POLKADOT_BED
db DECO_PIKACHU_BED
db DECO_06
db DECO_RED_CARPET
db DECO_GREEN_CARPET
db DECO_CLEFAIRY_POSTER
db DECO_ODDISH_DOLL
db DECO_MAGNAPLANT
db DECO_GENGAR_DOLL
db DECO_14
db DECO_PINK_BED
db DECO_SQUIRTLE_DOLL
db DECO_STARMIE_DOLL
; 2c76f ; 2c76f
Function2c76f: ; 2c76f (b:476f) Function2c76f: ; 2c76f (b:476f)
@@ -33294,16 +33363,16 @@ Function2c798: ; 2c798 (b:4798)
ld [CurItem], a ld [CurItem], a
ret ret
Function2c7a7: ; 2c7a7 (b:47a7) ConvertCurItemIntoCurTMHM: ; 2c7a7 (b:47a7)
ld a, [CurItem] ld a, [CurItem]
ld c, a ld c, a
callab GetTMHMNumber callab GetTMHMNumber
ld a, c ld a, c
ld [wd265], a ld [wCurTMHM], a
ret ret
GetTMHMItemMove: ; 2c7b6 (b:47b6) GetTMHMItemMove: ; 2c7b6 (b:47b6)
call Function2c7a7 call ConvertCurItemIntoCurTMHM
predef GetTMHMMove predef GetTMHMMove
ret ret
@@ -33314,23 +33383,23 @@ Function2c7bf: ; 2c7bf (b:47bf)
res 4, [hl] res 4, [hl]
ld a, [CurItem] ld a, [CurItem]
cp TM01 cp TM01
jr c, .asm_2c7f5 jr c, .NotTMHM
call GetTMHMItemMove call GetTMHMItemMove
ld a, [wd265] ld a, [wCurTMHM]
ld [wd262], a ld [wd262], a
call GetMoveName call GetMoveName
call CopyName1 call CopyName1
ld hl, UnknownText_0x2c8bf ld hl, UnknownText_0x2c8bf ; Booted up a TM
ld a, [CurItem] ld a, [CurItem]
cp HM01 cp HM01
jr c, .asm_2c7e9 jr c, .TM
ld hl, UnknownText_0x2c8c4 ld hl, UnknownText_0x2c8c4 ; Booted up an HM
.asm_2c7e9 .TM
call PrintText call PrintText
ld hl, UnknownText_0x2c8c9 ld hl, UnknownText_0x2c8c9
call PrintText call PrintText
call YesNoBox call YesNoBox
.asm_2c7f5 .NotTMHM
pop bc pop bc
ld a, b ld a, b
ld [Options], a ld [Options], a
@@ -33340,7 +33409,7 @@ Function2c7bf: ; 2c7bf (b:47bf)
Function2c7fb: ; 2c7fb Function2c7fb: ; 2c7fb
ld hl, StringBuffer2 ld hl, StringBuffer2
ld de, wd066 ld de, wd066
ld bc, $000c ld bc, $c
call CopyBytes call CopyBytes
call WhiteBGMap call WhiteBGMap
@@ -33350,7 +33419,7 @@ Function2c80a: ; 2c80a
callba Function503e0 callba Function503e0
ld a, $3 ld a, $3
ld [PartyMenuActionText], a ld [PartyMenuActionText], a
.asm_2c821 .loopback
callba WritePartyMenuTilemap callba WritePartyMenuTilemap
callba PrintPartyMenuText callba PrintPartyMenuText
call WaitBGMap call WaitBGMap
@@ -33360,17 +33429,17 @@ Function2c80a: ; 2c80a
push af push af
ld a, [CurPartySpecies] ld a, [CurPartySpecies]
cp EGG cp EGG
pop bc pop bc ; now contains the former contents of af
jr z, .asm_2c854 jr z, .egg
push bc push bc
ld hl, wd066 ld hl, wd066
ld de, StringBuffer2 ld de, StringBuffer2
ld bc, $000c ld bc, $c
call CopyBytes call CopyBytes
pop af pop af ; now contains the original contents of af
ret ret
.asm_2c854 .egg
push hl push hl
push de push de
push bc push bc
@@ -33382,7 +33451,7 @@ Function2c80a: ; 2c80a
pop bc pop bc
pop de pop de
pop hl pop hl
jr .asm_2c821 jr .loopback
; 2c867 ; 2c867
Function2c867: ; 2c867 Function2c867: ; 2c867
@@ -33396,35 +33465,35 @@ Function2c867: ; 2c867
ld a, c ld a, c
and a and a
jr nz, .asm_2c88b jr nz, .compatible
push de push de
ld de, SFX_WRONG ld de, SFX_WRONG
call PlaySFX call PlaySFX
pop de pop de
ld hl, UnknownText_0x2c8ce ld hl, UnknownText_0x2c8ce
call PrintText call PrintText
jr .asm_2c8b6 jr .nope
.asm_2c88b
.compatible
callab KnowsMove callab KnowsMove
jr c, .asm_2c8b6 jr c, .nope
predef LearnMove predef LearnMove
ld a, b ld a, b
and a and a
jr z, .asm_2c8b6 jr z, .nope
callba Function106049 callba Function106049
ld a, [CurItem] ld a, [CurItem]
call IsHM call IsHM
ret c ret c
ld c, $5 ld c, HAPPINESS_LEARNMOVE
callab ChangeHappiness callab ChangeHappiness
call Function2cb0c call Function2cb0c
jr .asm_2c8bd jr .asm_2c8bd
.asm_2c8b6 .nope
and a and a
ret ret
@@ -33584,7 +33653,7 @@ Function2c9af: ; 2c9af (b:49af)
Function2c9b1: ; 2c9b1 (b:49b1) Function2c9b1: ; 2c9b1 (b:49b1)
ld a, b ld a, b
bit 7, a bit 7, a
jr nz, .asm_2c9c5 jr nz, .skip
ld hl, wd0e2 ld hl, wd0e2
ld a, [hl] ld a, [hl]
and a and a
@@ -33592,19 +33661,20 @@ Function2c9b1: ; 2c9b1 (b:49b1)
dec [hl] dec [hl]
call Function2c9e2 call Function2c9e2
jp Function2c946 jp Function2c946
.asm_2c9c5
.skip
call Function2cab5 call Function2cab5
ld b, $5 ld b, $5
.asm_2c9ca .loop
inc c inc c
ld a, c ld a, c
cp $3a cp NUM_TMS + NUM_HMS + 1
jp nc, Function2c915 jp nc, Function2c915
ld a, [hli] ld a, [hli]
and a and a
jr z, .asm_2c9ca jr z, .loop
dec b dec b
jr nz, .asm_2c9ca jr nz, .loop
ld hl, wd0e2 ld hl, wd0e2
inc [hl] inc [hl]
call Function2c9e2 call Function2c9e2
@@ -33617,18 +33687,18 @@ Function2c9e2: ; 2c9e2 (b:49e2)
hlcoord 5, 2 hlcoord 5, 2
ld bc, $a0f ld bc, $a0f
ld a, $7f ld a, " "
call ClearBox call ClearBox
call Function2cab5 call Function2cab5
ld d, $5 ld d, $5
.asm_2c9fa .loop2
inc c inc c
ld a, c ld a, c
cp $3a cp NUM_TMS + NUM_HMS + 1
jr nc, .asm_2ca77 jr nc, .NotTMHM
ld a, [hli] ld a, [hli]
and a and a
jr z, .asm_2c9fa jr z, .loop2
ld b, a ld b, a
ld a, c ld a, c
ld [wd265], a ld [wd265], a
@@ -33638,24 +33708,25 @@ Function2c9e2: ; 2c9e2 (b:49e2)
call Function2ca86 call Function2ca86
push hl push hl
ld a, [wd265] ld a, [wd265]
cp $33 cp NUM_TMS + 1
jr nc, .asm_2ca22 jr nc, .HM
ld de, wd265 ld de, wd265
lb bc, PRINTNUM_LEADINGZEROS | 1, 2 lb bc, PRINTNUM_LEADINGZEROS | 1, 2
call PrintNum call PrintNum
jr .asm_2ca38 jr .okay
.asm_2ca22
.HM
push af push af
sub $32 sub NUM_TMS
ld [wd265], a ld [wd265], a
ld [hl], $87 ld [hl], "H"
inc hl inc hl
ld de, wd265 ld de, wd265
lb bc, PRINTNUM_RIGHTALIGN | 1, 2 lb bc, PRINTNUM_RIGHTALIGN | 1, 2
call PrintNum call PrintNum
pop af pop af
ld [wd265], a ld [wd265], a
.asm_2ca38 .okay
predef GetTMHMMove predef GetTMHMMove
ld a, [wd265] ld a, [wd265]
ld [wd262], a ld [wd262], a
@@ -33669,13 +33740,13 @@ Function2c9e2: ; 2c9e2 (b:49e2)
pop bc pop bc
ld a, c ld a, c
push bc push bc
cp $33 cp NUM_TMS + 1
jr nc, .asm_2ca6f jr nc, .hm2
ld bc, $1d ld bc, $1d
add hl, bc add hl, bc
ld [hl], $f1 ld [hl], $f1
inc hl inc hl
ld a, $f6 ld a, "0" ; why are we doing this?
pop bc pop bc
push bc push bc
ld a, b ld a, b
@@ -33683,14 +33754,15 @@ Function2c9e2: ; 2c9e2 (b:49e2)
ld de, wd265 ld de, wd265
lb bc, 1, 2 lb bc, 1, 2
call PrintNum call PrintNum
.asm_2ca6f .hm2
pop bc pop bc
pop de pop de
pop hl pop hl
dec d dec d
jr nz, .asm_2c9fa jr nz, .loop2
jr .asm_2ca85 jr .done
.asm_2ca77
.NotTMHM
call Function2ca86 call Function2ca86
rept 3 rept 3
inc hl inc hl
@@ -33699,25 +33771,25 @@ endr
ld de, String_2caae ld de, String_2caae
call PlaceString call PlaceString
pop de pop de
.asm_2ca85 .done
ret ret
Function2ca86: ; 2ca86 (b:4a86) Function2ca86: ; 2ca86 (b:4a86)
hlcoord 5, 0 hlcoord 5, 0
ld bc, $28 ld bc, $28
ld a, $6 ld a, 6
sub d sub d
ld e, a ld e, a
.asm_2ca90 .loop
add hl, bc add hl, bc
dec e dec e
jr nz, .asm_2ca90 jr nz, .loop
ret ret
; 2ca95 (b:4a95) ; 2ca95 (b:4a95)
Function2ca95: ; 2ca95 Function2ca95: ; 2ca95
pop hl pop hl
ld bc, $0003 ld bc, 3
add hl, bc add hl, bc
predef GetTMHMMove predef GetTMHMMove
ld a, [wd265] ld a, [wd265]
@@ -33738,14 +33810,14 @@ Function2cab5: ; 2cab5 (b:4ab5)
ld a, [wd0e2] ld a, [wd0e2]
ld b, a ld b, a
inc b inc b
ld c, $0 ld c, 0
.asm_2cabf .loop
inc c inc c
ld a, [hli] ld a, [hli]
and a and a
jr z, .asm_2cabf jr z, .loop
dec b dec b
jr nz, .asm_2cabf jr nz, .loop
dec hl dec hl
dec c dec c
ret ret
@@ -33767,7 +33839,7 @@ Function2cad6: ; 2cad6 (b:4ad6)
; 2cadf (b:4adf) ; 2cadf (b:4adf)
Function2cadf: ; 2cadf Function2cadf: ; 2cadf
call Function2c7a7 call ConvertCurItemIntoCurTMHM
call Function2cafa call Function2cafa
ld hl, UnknownText_0x2caf0 ld hl, UnknownText_0x2caf0
jr nc, .asm_2caed jr nc, .asm_2caed
@@ -33805,7 +33877,7 @@ Function2cafa: ; 2cafa
; 2cb0c ; 2cb0c
Function2cb0c: ; 2cb0c (b:4b0c) Function2cb0c: ; 2cb0c (b:4b0c)
call Function2c7a7 call ConvertCurItemIntoCurTMHM
ld a, [wd265] ld a, [wd265]
dec a dec a
ld hl, TMsHMs ld hl, TMsHMs
@@ -38704,7 +38776,7 @@ Function492b9: ; 492b9
and a and a
jr z, .didnt_learn jr z, .didnt_learn
ld c, $5 ld c, HAPPINESS_LEARNMOVE
callab ChangeHappiness callab ChangeHappiness
jr .learned jr .learned
@@ -47013,7 +47085,7 @@ Function5067b: ; 5067b
ld a, [de] ld a, [de]
and 2 and 2
jr z, .asm_5069c jr z, .asm_5069c
ld c, 7 ld c, HAPPINESS_POISONFAINT
callba ChangeHappiness callba ChangeHappiness
callba GetPartyNick callba GetPartyNick
ld hl, PoisonFaintText ld hl, PoisonFaintText
@@ -87561,30 +87633,31 @@ DoMysteryGift: ; 1048ba (41:48ba)
.asm_104963 .asm_104963
ld a, [wc90f] ld a, [wc90f]
and a and a
jr z, .asm_104990 jr z, .item
ld a, [wc911] ld a, [wc911]
ld c, a ld c, a
callba Function2c715 callba MysteryGiftGetDecoration
push bc push bc
call Function105069 call Function105069
pop bc pop bc
jr nz, .asm_104990 jr nz, .item
callab GetDecorationName_c callab GetDecorationName_c
ld h, d ld h, d
ld l, e ld l, e
ld de, StringBuffer1 ld de, StringBuffer1
ld bc, $d ld bc, ITEM_NAME_LENGTH
call CopyBytes call CopyBytes
ld hl, UnknownText_0x104a20 ld hl, UnknownText_0x104a20
jr Function1049c5 jr Function1049c5
.asm_104990
.item
call Function105106 call Function105106
ld a, [wc910] ld a, [wc910]
ld c, a ld c, a
callba Function2c708 callba MysteryGiftGetItem
ld a, c ld a, c
ld [s0_abe4], a ld [s0_abe4], a
ld [wd265], a ld [wNamedObjectIndexBuffer], a
call CloseSRAM call CloseSRAM
call GetItemName call GetItemName
ld hl, UnknownText_0x104a1b ld hl, UnknownText_0x104a1b

View File

@@ -23,7 +23,7 @@ UnknownScript_0x19b0de:
iffalse UnknownScript_0x19b124 iffalse UnknownScript_0x19b124
writetext UnknownText_0x19b244 writetext UnknownText_0x19b244
closetext closetext
special Function741d special Special_DaisyMassage
if_equal 0, UnknownScript_0x19b124 if_equal 0, UnknownScript_0x19b124
if_equal 1, UnknownScript_0x19b12a if_equal 1, UnknownScript_0x19b12a
setflag ENGINE_TEA_IN_BLUES_HOUSE setflag ENGINE_TEA_IN_BLUES_HOUSE

View File

@@ -7,9 +7,9 @@ UndergroundWarehouse_MapScriptHeader:
; callbacks ; callbacks
dbw 5, UnknownScript_0x7d950 dbw 5, .ResetSwitches
UnknownScript_0x7d950: .ResetSwitches:
clearevent EVENT_SWITCH_1 clearevent EVENT_SWITCH_1
clearevent EVENT_SWITCH_2 clearevent EVENT_SWITCH_2
clearevent EVENT_SWITCH_3 clearevent EVENT_SWITCH_3

View File

@@ -194,7 +194,7 @@ OlderHaircutBrotherScript:
if_equal $2, .NotEnoughMoney if_equal $2, .NotEnoughMoney
writetext UnknownText_0x7c69a writetext UnknownText_0x7c69a
keeptextopen keeptextopen
special Function7413 special Special_YoungerHaircutBrother
if_equal $0, .Refused if_equal $0, .Refused
if_equal $1, .Refused if_equal $1, .Refused
setflag ENGINE_GOLDENROD_UNDERGROUND_GOT_HAIRCUT setflag ENGINE_GOLDENROD_UNDERGROUND_GOT_HAIRCUT
@@ -277,7 +277,7 @@ YoungerHaircutBrotherScript:
if_equal $2, .NotEnoughMoney if_equal $2, .NotEnoughMoney
writetext UnknownText_0x7c7f1 writetext UnknownText_0x7c7f1
keeptextopen keeptextopen
special Function7418 special Special_OlderHaircutBrother
if_equal $0, .Refused if_equal $0, .Refused
if_equal $1, .Refused if_equal $1, .Refused
setflag ENGINE_GOLDENROD_UNDERGROUND_GOT_HAIRCUT setflag ENGINE_GOLDENROD_UNDERGROUND_GOT_HAIRCUT
@@ -342,21 +342,21 @@ YoungerHaircutBrotherScript:
end end
UnknownScript_0x7c2bb: UnknownScript_0x7c2bb:
writetext UnknownText_0x7c8bf writetext HaircutBrosText_SlightlyHappier
special Functionc472 special Functionc472
closetext closetext
loadmovesprites loadmovesprites
end end
UnknownScript_0x7c2c4: UnknownScript_0x7c2c4:
writetext UnknownText_0x7c8dc writetext HaircutBrosText_Happier
special Functionc472 special Functionc472
closetext closetext
loadmovesprites loadmovesprites
end end
UnknownScript_0x7c2cd: UnknownScript_0x7c2cd:
writetext UnknownText_0x7c8ee writetext HaircutBrosText_MuchHappier
special Functionc472 special Functionc472
closetext closetext
loadmovesprites loadmovesprites
@@ -615,19 +615,19 @@ UnknownText_0x7c87b:
line "done for today." line "done for today."
done done
UnknownText_0x7c8bf: HaircutBrosText_SlightlyHappier:
text_from_ram StringBuffer3 text_from_ram StringBuffer3
text " looks a" text " looks a"
line "little happier." line "little happier."
done done
UnknownText_0x7c8dc: HaircutBrosText_Happier:
text_from_ram StringBuffer3 text_from_ram StringBuffer3
text " looks" text " looks"
line "happy." line "happy."
done done
UnknownText_0x7c8ee: HaircutBrosText_MuchHappier:
text_from_ram StringBuffer3 text_from_ram StringBuffer3
text " looks" text " looks"
line "delighted!" line "delighted!"

View File

@@ -1854,6 +1854,7 @@ wd263:: ds 1
wd264:: ds 1 wd264:: ds 1
wFoundMatchingIDInParty:: wFoundMatchingIDInParty::
wNamedObjectIndexBuffer:: wNamedObjectIndexBuffer::
wCurTMHM::
wd265:: ds 1 wd265:: ds 1
wd266:: ds 1 wd266:: ds 1
wd267:: ds 1 wd267:: ds 1