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

File diff suppressed because it is too large Load Diff

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