Item effects, post-battle, and decoration flags

This commit is contained in:
PikalaxALT 2015-12-29 16:44:37 -05:00
parent 9bbb65166e
commit 2a263629a4
7 changed files with 136 additions and 126 deletions

View File

@ -8701,19 +8701,19 @@ Function3f662: ; 3f662
ExitBattle: ; 3f69e ExitBattle: ; 3f69e
call Function3f6a5 call .HandleEndOfBattle
call CleanUpBattleRAM call CleanUpBattleRAM
ret ret
; 3f6a5 ; 3f6a5
Function3f6a5: ; 3f6a5 .HandleEndOfBattle: ; 3f6a5
ld a, [wLinkMode] ld a, [wLinkMode]
and a and a
jr z, .not_linked jr z, .not_linked
call ShowLinkBattleParticipantsAfterEnd call ShowLinkBattleParticipantsAfterEnd
ld c, 150 ld c, 150
call DelayFrames call DelayFrames
call Function3f77c call DetermineMobileBattleResult
ret ret
.not_linked .not_linked
@ -8724,12 +8724,12 @@ Function3f6a5: ; 3f6a5
xor a xor a
ld [wForceEvolution], a ld [wForceEvolution], a
predef EvolveAfterBattle predef EvolveAfterBattle
callba Function2ed44 callba GivePokerusAndConvertBerries
ret ret
; 3f6d0 ; 3f6d0
CleanUpBattleRAM: ; 3f6d0 CleanUpBattleRAM: ; 3f6d0
call Function3f998 call BattleEnd_HandleRoamMons
xor a xor a
ld [Danger], a ld [Danger], a
ld [wBattleMode], a ld [wBattleMode], a
@ -8810,7 +8810,7 @@ ShowLinkBattleParticipantsAfterEnd: ; 3f759
ret ret
; 3f77c ; 3f77c
Function3f77c: ; 3f77c DetermineMobileBattleResult: ; 3f77c
callba CheckMobileBattleError callba CheckMobileBattleError
jp c, .Mobile_InvalidBattle jp c, .Mobile_InvalidBattle
call IsMobileBattle2 call IsMobileBattle2
@ -9058,19 +9058,19 @@ Function3f85f: ; 3f85f
; 3f998 ; 3f998
Function3f998: ; 3f998 BattleEnd_HandleRoamMons: ; 3f998
ld a, [BattleType] ld a, [BattleType]
cp BATTLETYPE_ROAMING cp BATTLETYPE_ROAMING
jr nz, .asm_3f9c4 jr nz, .not_roaming
ld a, [wBattleResult] ld a, [wBattleResult]
and $f and $f
jr z, .asm_3f9af jr z, .caught_or_defeated_roam_mon
call GetRoamMonHP call GetRoamMonHP
ld a, [EnemyMonHP + 1] ld a, [EnemyMonHP + 1]
ld [hl], a ld [hl], a
jr .asm_3f9ca jr .update_roam_mons
.asm_3f9af .caught_or_defeated_roam_mon
call GetRoamMonHP call GetRoamMonHP
ld [hl], $0 ld [hl], $0
call GetRoamMonMapGroup call GetRoamMonMapGroup
@ -9081,12 +9081,12 @@ Function3f998: ; 3f998
ld [hl], $0 ld [hl], $0
ret ret
.asm_3f9c4 .not_roaming
call BattleRandom call BattleRandom
and $f and $f
ret nz ret nz
.asm_3f9ca .update_roam_mons
callab UpdateRoamMons callab UpdateRoamMons
ret ret
; 3f9d1 ; 3f9d1

View File

@ -51,59 +51,71 @@ const_value = 1
const SET_UP_ORNAMENT const SET_UP_ORNAMENT
const PUT_AWAY_ORNAMENT const PUT_AWAY_ORNAMENT
deco: MACRO
const DECO_\1
enum DECOFLAG_\1
endm
const_value = 1 const_value = 1
const DECO_BEDS __enum__ = 0
const DECO_FEATHERY_BED ; 2 const BEDS
const DECO_PINK_BED ; 3 deco FEATHERY_BED ; 2 (0)
const DECO_POLKADOT_BED ; 4 deco PINK_BED ; 3 (1)
const DECO_PIKACHU_BED ; 5 deco POLKADOT_BED ; 4 (2)
const DECO_CARPETS deco PIKACHU_BED ; 5 (3)
const DECO_RED_CARPET ; 7
const DECO_BLUE_CARPET ; 8 const CARPETS
const DECO_YELLOW_CARPET ; 9 deco RED_CARPET ; 7 (4)
const DECO_GREEN_CARPET ; a deco BLUE_CARPET ; 8 (5)
const DECO_0B deco YELLOW_CARPET ; 9 (6)
const DECO_MAGNAPLANT ; c deco GREEN_CARPET ; a (7)
const DECO_TROPICPLANT ; d
const DECO_JUMBOPLANT ; e const PLANTS
const DECO_POSTERS deco MAGNAPLANT ; c (8)
const DECO_TOWN_MAP ; 10 deco TROPICPLANT ; d (9)
const DECO_PIKACHU_POSTER ; 11 deco JUMBOPLANT ; e (a)
const DECO_CLEFAIRY_POSTER ; 12
const DECO_JIGGLYPUFF_POSTER ; 13 const POSTERS
const DECO_CONSOLES deco TOWN_MAP ; 10 (b)
const DECO_FAMICOM ; 15 deco PIKACHU_POSTER ; 11 (c)
const DECO_SNES ; 16 deco CLEFAIRY_POSTER ; 12 (d)
const DECO_N64 ; 17 deco JIGGLYPUFF_POSTER ; 13(e)
const DECO_VIRTUAL_BOY ; 18
const DECO_BIG_DOLLS const CONSOLES
const DECO_BIG_SNORLAX_DOLL ; 1a deco FAMICOM ; 15 (f)
const DECO_BIG_ONIX_DOLL ; 1b deco SNES ; 16 (10)
const DECO_BIG_LAPRAS_DOLL ; 1c deco N64 ; 17 (11)
const DECO_DOLLS deco VIRTUAL_BOY ; 18 (12)
const DECO_PIKACHU_DOLL ; 1e
const DECO_SURF_PIKACHU_DOLL ; 1f const BIG_DOLLS
const DECO_CLEFAIRY_DOLL ; 20 deco BIG_SNORLAX_DOLL ; 1a (13)
const DECO_JIGGLYPUFF_DOLL ; 21 deco BIG_ONIX_DOLL ; 1b (14)
const DECO_BULBASAUR_DOLL ; 22 deco BIG_LAPRAS_DOLL ; 1c (15)
const DECO_CHARMANDER_DOLL ; 23
const DECO_SQUIRTLE_DOLL ; 24 const DOLLS
const DECO_POLIWAG_DOLL ; 25 deco PIKACHU_DOLL ; 1e (16)
const DECO_DIGLETT_DOLL ; 26 deco SURF_PIKACHU_DOLL ; 1f (17)
const DECO_STARMIE_DOLL ; 27 deco CLEFAIRY_DOLL ; 20 (18)
const DECO_MAGIKARP_DOLL ; 28 deco JIGGLYPUFF_DOLL ; 21 (19)
const DECO_ODDISH_DOLL ; 29 deco BULBASAUR_DOLL ; 22 (1a)
const DECO_GENGAR_DOLL ; 2a deco CHARMANDER_DOLL ; 23 (1b)
const DECO_SHELLDER_DOLL ; 2b deco SQUIRTLE_DOLL ; 24 (1c)
const DECO_GRIMER_DOLL ; 2c deco POLIWAG_DOLL ; 25 (1d)
const DECO_VOLTORB_DOLL ; 2d deco DIGLETT_DOLL ; 26 (1e)
const DECO_WEEDLE_DOLL ; 2e deco STARMIE_DOLL ; 27 (1f)
const DECO_UNOWN_DOLL ; 2f deco MAGIKARP_DOLL ; 28 (20)
const DECO_GEODUDE_DOLL ; 30 deco ODDISH_DOLL ; 29 (21)
const DECO_MACHOP_DOLL ; 31 deco GENGAR_DOLL ; 2a (22)
const DECO_TENTACOOL_DOLL ; 32 deco SHELLDER_DOLL ; 2b (23)
const DECO_GOLD_TROPHY_DOLL ; 33 deco GRIMER_DOLL ; 2c (24)
const DECO_SILVER_TROPHY_DOLL ; 34 deco VOLTORB_DOLL ; 2d (25)
deco WEEDLE_DOLL ; 2e (26)
deco UNOWN_DOLL ; 2f (27)
deco GEODUDE_DOLL ; 30 (28)
deco MACHOP_DOLL ; 31 (29)
deco TENTACOOL_DOLL ; 32 (2a)
deco GOLD_TROPHY_DOLL ; 33 (2b)
deco SILVER_TROPHY_DOLL ; 34 (2c)
NUM_NON_TROPHY_DECOS EQU $2b NUM_NON_TROPHY_DECOS EQU $2b
NUM_DECOS EQU $2d NUM_DECOS EQU $2d

View File

@ -207,7 +207,7 @@ DecoBedMenu: ; 268b5
FindOwnedBeds: ; 268bd FindOwnedBeds: ; 268bd
ld hl, .beds ld hl, .beds
ld c, DECO_BEDS ld c, BEDS
jp FindOwnedDecosInCategory jp FindOwnedDecosInCategory
; 268c5 ; 268c5
@ -228,7 +228,7 @@ DecoCarpetMenu: ; 268ca
FindOwnedCarpets: ; 268d2 FindOwnedCarpets: ; 268d2
ld hl, .carpets ld hl, .carpets
ld c, DECO_CARPETS ld c, CARPETS
jp FindOwnedDecosInCategory jp FindOwnedDecosInCategory
; 268da ; 268da
@ -249,7 +249,7 @@ DecoPlantMenu: ; 268df
FindOwnedPlants: ; 268e7 FindOwnedPlants: ; 268e7
ld hl, .plants ld hl, .plants
ld c, DECO_0B ld c, PLANTS
jp FindOwnedDecosInCategory jp FindOwnedDecosInCategory
; 268ef ; 268ef
@ -269,7 +269,7 @@ DecoPosterMenu: ; 268f3
FindOwnedPosters: ; 268fb FindOwnedPosters: ; 268fb
ld hl, .posters ld hl, .posters
ld c, DECO_POSTERS ld c, POSTERS
jp FindOwnedDecosInCategory jp FindOwnedDecosInCategory
; 26903 ; 26903
@ -290,7 +290,7 @@ DecoConsoleMenu: ; 26908
FindOwnedConsoles: ; 26910 FindOwnedConsoles: ; 26910
ld hl, .consoles ld hl, .consoles
ld c, DECO_CONSOLES ld c, CONSOLES
jp FindOwnedDecosInCategory jp FindOwnedDecosInCategory
; 26918 ; 26918
@ -311,7 +311,7 @@ DecoOrnamentMenu: ; 2691d
FindOwnedOrnaments: ; 26925 FindOwnedOrnaments: ; 26925
ld hl, .ornaments ld hl, .ornaments
ld c, DECO_DOLLS ld c, DOLLS
jp FindOwnedDecosInCategory jp FindOwnedDecosInCategory
; 2692d ; 2692d
@ -351,7 +351,7 @@ DecoBigDollMenu: ; 26945
FindOwnedBigDolls: ; 2694d FindOwnedBigDolls: ; 2694d
ld hl, .big_dolls ld hl, .big_dolls
ld c, DECO_BIG_DOLLS ld c, BIG_DOLLS
jp FindOwnedDecosInCategory jp FindOwnedDecosInCategory
; 26955 ; 26955

View File

@ -187,41 +187,41 @@ MysteryGiftItems: ; 2c725
; 2c74a ; 2c74a
MysteryGiftDecos: ; 2c74a MysteryGiftDecos: ; 2c74a
db DECO_SNES db DECOFLAG_PIKACHU_DOLL
db DECO_BIG_SNORLAX_DOLL db DECOFLAG_BULBASAUR_DOLL
db DECO_BIG_ONIX_DOLL db DECOFLAG_CHARMANDER_DOLL
db DECO_BIG_LAPRAS_DOLL db DECOFLAG_SQUIRTLE_DOLL
db DECO_DOLLS db DECOFLAG_POLIWAG_DOLL
db DECO_PIKACHU_DOLL db DECOFLAG_DIGLETT_DOLL
db DECO_SURF_PIKACHU_DOLL db DECOFLAG_STARMIE_DOLL
db DECO_CLEFAIRY_DOLL db DECOFLAG_MAGIKARP_DOLL
db DECO_JIGGLYPUFF_DOLL db DECOFLAG_ODDISH_DOLL
db DECO_BULBASAUR_DOLL db DECOFLAG_GENGAR_DOLL
db DECO_TROPICPLANT db DECOFLAG_CLEFAIRY_POSTER
db DECO_JUMBOPLANT db DECOFLAG_JIGGLYPUFF_POSTER
db DECO_TOWN_MAP db DECOFLAG_SNES
db DECO_CHARMANDER_DOLL db DECOFLAG_SHELLDER_DOLL
db DECO_POLIWAG_DOLL db DECOFLAG_VOLTORB_DOLL
db DECO_DIGLETT_DOLL db DECOFLAG_WEEDLE_DOLL
db DECO_BLUE_CARPET db DECOFLAG_MAGNAPLANT
db DECO_YELLOW_CARPET db DECOFLAG_TROPICPLANT
db DECO_POSTERS db DECOFLAG_FAMICOM
db DECO_PIKACHU_POSTER db DECOFLAG_N64
db DECO_N64 db DECOFLAG_SURF_PIKACHU_DOLL
db DECO_BIG_DOLLS db DECOFLAG_JIGGLYPUFF_DOLL
db DECO_BEDS db DECOFLAG_PINK_BED
db DECO_FEATHERY_BED db DECOFLAG_POLKADOT_BED
db DECO_POLKADOT_BED db DECOFLAG_RED_CARPET
db DECO_PIKACHU_BED db DECOFLAG_BLUE_CARPET
db DECO_CARPETS db DECOFLAG_YELLOW_CARPET
db DECO_RED_CARPET db DECOFLAG_GREEN_CARPET
db DECO_GREEN_CARPET db DECOFLAG_JUMBOPLANT
db DECO_CLEFAIRY_POSTER db DECOFLAG_VIRTUAL_BOY
db DECO_ODDISH_DOLL db DECOFLAG_MACHOP_DOLL
db DECO_MAGNAPLANT db DECOFLAG_PIKACHU_POSTER
db DECO_GENGAR_DOLL db DECOFLAG_TENTACOOL_DOLL
db DECO_CONSOLES db DECOFLAG_BIG_ONIX_DOLL
db DECO_PINK_BED db DECOFLAG_PIKACHU_BED
db DECO_SQUIRTLE_DOLL db DECOFLAG_GRIMER_DOLL
db DECO_STARMIE_DOLL db DECOFLAG_UNOWN_DOLL
; 2c76f ; 2c76f

View File

@ -2811,29 +2811,27 @@ SacredAsh: ; f753
NormalBox: ; f763 NormalBox: ; f763
ld c, $2c ld c, DECOFLAG_SILVER_TROPHY_DOLL
jr Function_0xf769 jr OpenBox
; f767 ; f767
GorgeousBox: ; f767 GorgeousBox: ; f767
ld c, $2b ld c, DECOFLAG_GOLD_TROPHY_DOLL
; f769 OpenBox: ; f769
Function_0xf769: ; f769
callba SetSpecificDecorationFlag callba SetSpecificDecorationFlag
ld hl, UnknownText_0xf778 ld hl, .text
call PrintText call PrintText
jp UseDisposableItem jp UseDisposableItem
; f778 ; f778
UnknownText_0xf778: ; 0xf778 .text: ; 0xf778
; There was a trophy inside!
text_jump UnknownText_0x1c5d03 text_jump UnknownText_0x1c5d03
db "@" db "@"
; 0xf77d ; 0xf77d
Brightpowder: Brightpowder:
Item19: Item19:
LuckyPunch: LuckyPunch:
@ -2923,7 +2921,8 @@ ItemAB:
UpGrade: UpGrade:
ItemB0: ItemB0:
RainbowWing: RainbowWing:
ItemB3: ; f77d ItemB3:
TeruSama: ; f77d
jp IsntTheTimeMessage jp IsntTheTimeMessage
; f780 ; f780

View File

@ -6743,7 +6743,7 @@ MoveDescriptions:: ; 2cb52
INCLUDE "battle/moves/move_descriptions.asm" INCLUDE "battle/moves/move_descriptions.asm"
; 2ed44 ; 2ed44
Function2ed44: ; 2ed44 GivePokerusAndConvertBerries: ; 2ed44
call ConvertBerriesToBerryJuice call ConvertBerriesToBerryJuice
ld hl, PartyMon1PokerusStatus ld hl, PartyMon1PokerusStatus
ld a, [PartyCount] ld a, [PartyCount]
@ -6784,12 +6784,11 @@ Function2ed44: ; 2ed44
jr z, .randomPokerusLoop jr z, .randomPokerusLoop
ld b, a ld b, a
and $f0 and $f0
jr z, .asm_2ed91 jr z, .load_pkrs
ld a, b ld a, b
and $7 and $7
inc a inc a
.load_pkrs
.asm_2ed91
ld b, a ld b, a
swap b swap b
and $3 and $3
@ -6800,10 +6799,10 @@ Function2ed44: ; 2ed44
.monHasActivePokerus .monHasActivePokerus
call Random call Random
cp $55 cp 1 + 33 percent
ret nc ; 1/3 chance ret nc ; 1/3 chance
ld a, [PartyCount] ld a, [PartyCount]
cp $1 cp 1
ret z ; only one mon, nothing to do ret z ; only one mon, nothing to do
ld c, [hl] ld c, [hl]
ld a, b ld a, b

View File

@ -4077,7 +4077,7 @@ Function101a21: ; 101a21
Function101a4f: ; 101a4f Function101a4f: ; 101a4f
ld a, $1 ld a, $1
ld [wc2d7], a ld [wc2d7], a
callba Function3f77c callba DetermineMobileBattleResult
xor a xor a
ld [wc2d7], a ld [wc2d7], a
callba CleanUpBattleRAM callba CleanUpBattleRAM