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

View File

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

View File

@ -124,3 +124,25 @@ PRINTNUM_LEADINGZEROS_F EQU 7
PRINTNUM_MONEY EQU 1 << PRINTNUM_MONEY_F
PRINTNUM_RIGHTALIGN EQU 1 << PRINTNUM_RIGHTALIGN_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 Functionfb841
add_special SpecialSnorlaxAwake
add_special Function7413
add_special Function7418
add_special Function741d
add_special Special_YoungerHaircutBrother
add_special Special_OlderHaircutBrother
add_special Special_DaisyMassage
add_special Functionc472
add_special ProfOaksPCBoot
add_special SpecialGameboyCheck

View File

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

View File

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

View File

@ -149,3 +149,15 @@ bcd: MACRO
shift
endr
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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

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