mirror of
https://github.com/thornAvery/kep-hack.git
synced 2026-02-06 23:55:24 +13:00
Merge branch 'master' of https://github.com/pret/pokered
This commit is contained in:
commit
3f691fcb21
970 changed files with 15106 additions and 11361 deletions
|
|
@ -120,7 +120,7 @@ ItemUseBall:
|
|||
ld a, [wPartyCount] ; is party full?
|
||||
cp PARTY_LENGTH
|
||||
jr nz, .canUseBall
|
||||
ld a, [wNumInBox] ; is box full?
|
||||
ld a, [wBoxCount] ; is box full?
|
||||
cp MONS_PER_BOX
|
||||
jp z, BoxFullCannotThrowBall
|
||||
|
||||
|
|
@ -225,7 +225,7 @@ ItemUseBall:
|
|||
ld a, [wEnemyMonStatus]
|
||||
and a
|
||||
jr z, .skipAilmentValueSubtraction ; no ailments
|
||||
and 1 << FRZ | SLP
|
||||
and (1 << FRZ) | SLP_MASK
|
||||
ld c, 12
|
||||
jr z, .notFrozenOrAsleep
|
||||
ld c, 25
|
||||
|
|
@ -380,7 +380,7 @@ ItemUseBall:
|
|||
ld a, [wEnemyMonStatus]
|
||||
and a
|
||||
jr z, .skip5
|
||||
and 1 << FRZ | SLP
|
||||
and (1 << FRZ) | SLP_MASK
|
||||
ld b, 5
|
||||
jr z, .addAilmentValue
|
||||
ld b, 10
|
||||
|
|
@ -878,7 +878,7 @@ ItemUseMedicine:
|
|||
lb bc, ICE_HEAL_MSG, 1 << FRZ
|
||||
cp ICE_HEAL
|
||||
jr z, .checkMonStatus
|
||||
lb bc, AWAKENING_MSG, SLP
|
||||
lb bc, AWAKENING_MSG, SLP_MASK
|
||||
cp AWAKENING
|
||||
jr z, .checkMonStatus
|
||||
lb bc, PARALYZ_HEAL_MSG, 1 << PAR
|
||||
|
|
@ -991,7 +991,7 @@ ItemUseMedicine:
|
|||
.notFullHP ; if the pokemon's current HP doesn't equal its max HP
|
||||
xor a
|
||||
ld [wLowHealthAlarm], a ;disable low health alarm
|
||||
; ld [wChannelSoundIDs + Ch5], a
|
||||
; ld [wChannelSoundIDs + CHAN5], a
|
||||
push hl
|
||||
push de
|
||||
ld bc, wPartyMon1MaxHP - (wPartyMon1HP + 1)
|
||||
|
|
@ -1175,7 +1175,7 @@ ItemUseMedicine:
|
|||
xor a
|
||||
ld [wBattleMonStatus], a ; remove the status ailment in the in-battle pokemon data
|
||||
.calculateHPBarCoords
|
||||
ld hl, wOAMBuffer + $90
|
||||
ld hl, wShadowOAMSprite36
|
||||
ld bc, 2 * SCREEN_WIDTH
|
||||
inc d
|
||||
.calculateHPBarCoordsLoop
|
||||
|
|
@ -1307,9 +1307,9 @@ ItemUseMedicine:
|
|||
jr nz, .statNameInnerLoop
|
||||
jr .statNameLoop
|
||||
.gotStatName
|
||||
ld de, wcf4b
|
||||
ld de, wStringBuffer
|
||||
ld bc, 10
|
||||
call CopyData ; copy the stat's name to wcf4b
|
||||
call CopyData ; copy the stat's name to wStringBuffer
|
||||
ld a, SFX_HEAL_AILMENT
|
||||
call PlaySound
|
||||
ld hl, VitaminStatRoseText
|
||||
|
|
@ -1700,7 +1700,7 @@ ItemUsePokeflute:
|
|||
.inBattle
|
||||
xor a
|
||||
ld [wWereAnyMonsAsleep], a
|
||||
ld b, ~SLP & $ff
|
||||
ld b, ~SLP_MASK
|
||||
ld hl, wPartyMon1Status
|
||||
call WakeUpEntireParty
|
||||
ld a, [wIsInBattle]
|
||||
|
|
@ -1736,7 +1736,7 @@ ItemUsePokeflute:
|
|||
call WaitForSoundToFinish
|
||||
; farcall Music_PokeFluteInBattle ; play in-battle pokeflute music
|
||||
;.musicWaitLoop ; wait for music to finish playing
|
||||
; ld a, [wChannelSoundIDs + Ch7]
|
||||
; ld a, [wChannelSoundIDs + CHAN7]
|
||||
; and a ; music off?
|
||||
; jr nz, .musicWaitLoop
|
||||
|
||||
|
|
@ -1757,7 +1757,7 @@ WakeUpEntireParty:
|
|||
.loop
|
||||
ld a, [hl]
|
||||
push af
|
||||
and SLP ; is pokemon asleep?
|
||||
and SLP_MASK
|
||||
jr z, .notAsleep
|
||||
ld a, 1
|
||||
ld [wWereAnyMonsAsleep], a ; indicate that a pokemon had to be woken up
|
||||
|
|
@ -1804,7 +1804,7 @@ PlayedFluteHadEffectText:
|
|||
ld c, 0 ; BANK(SFX_Pokeflute)
|
||||
call PlaySound
|
||||
;.musicWaitLoop ; wait for music to finish playing
|
||||
; ld a, [wChannelSoundIDs + Ch3]
|
||||
; ld a, [wChannelSoundIDs + CHAN3]
|
||||
; cp SFX_POKEFLUTE
|
||||
; jr z, .musicWaitLoop
|
||||
call PlayDefaultMusic ; start playing normal music again
|
||||
|
|
@ -1989,7 +1989,7 @@ ItemUsePPRestore:
|
|||
ld a, [hl]
|
||||
ld [wd11e], a
|
||||
call GetMoveName
|
||||
call CopyStringToCF4B ; copy name to wcf4b
|
||||
call CopyToStringBuffer
|
||||
pop hl
|
||||
ld a, [wPPRestoreItem]
|
||||
cp ETHER
|
||||
|
|
@ -2166,7 +2166,7 @@ ItemUseTMHM:
|
|||
ld a, [wd11e]
|
||||
ld [wMoveNum], a
|
||||
call GetMoveName
|
||||
call CopyStringToCF4B ; copy name to wcf4b
|
||||
call CopyToStringBuffer
|
||||
pop af
|
||||
ld hl, BootedUpTMText
|
||||
jr nc, .printBootedUpMachineText
|
||||
|
|
@ -2192,7 +2192,7 @@ ItemUseTMHM:
|
|||
ld a, [wcf91]
|
||||
push af
|
||||
.chooseMon
|
||||
ld hl, wcf4b
|
||||
ld hl, wStringBuffer
|
||||
ld de, wTempMoveNameBuffer
|
||||
ld bc, 14
|
||||
call CopyData ; save the move name because DisplayPartyMenu will overwrite it
|
||||
|
|
@ -2203,7 +2203,7 @@ ItemUseTMHM:
|
|||
call DisplayPartyMenu
|
||||
push af
|
||||
ld hl, wTempMoveNameBuffer
|
||||
ld de, wcf4b
|
||||
ld de, wStringBuffer
|
||||
ld bc, 14
|
||||
call CopyData
|
||||
pop af
|
||||
|
|
@ -2558,7 +2558,7 @@ TossItem_::
|
|||
ld a, [wcf91]
|
||||
ld [wd11e], a
|
||||
call GetItemName
|
||||
call CopyStringToCF4B ; copy name to wcf4b
|
||||
call CopyToStringBuffer
|
||||
ld hl, IsItOKToTossItemText
|
||||
call PrintText
|
||||
hlcoord 14, 7
|
||||
|
|
@ -2578,7 +2578,7 @@ TossItem_::
|
|||
ld a, [wcf91]
|
||||
ld [wd11e], a
|
||||
call GetItemName
|
||||
call CopyStringToCF4B ; copy name to wcf4b
|
||||
call CopyToStringBuffer
|
||||
ld hl, ThrewAwayItemText
|
||||
call PrintText
|
||||
pop hl
|
||||
|
|
@ -2619,9 +2619,10 @@ IsKeyItem_::
|
|||
jr nc, .checkIfItemIsHM
|
||||
; if the item is not an HM or TM
|
||||
push af
|
||||
ld hl, KeyItemBitfield
|
||||
ld hl, KeyItemFlags
|
||||
ld de, wBuffer
|
||||
ld bc, 15 ; only 11 bytes are actually used
|
||||
ASSERT 15 >= (NUM_ITEMS + 7) / 8
|
||||
call CopyData
|
||||
pop af
|
||||
dec a
|
||||
|
|
@ -2643,14 +2644,14 @@ IsKeyItem_::
|
|||
INCLUDE "data/items/key_items.asm"
|
||||
|
||||
SendNewMonToBox:
|
||||
ld de, wNumInBox
|
||||
ld de, wBoxCount
|
||||
ld a, [de]
|
||||
inc a
|
||||
ld [de], a
|
||||
ld a, [wcf91]
|
||||
ld [wd0b5], a
|
||||
ld c, a
|
||||
.asm_e7b1
|
||||
.loop
|
||||
inc de
|
||||
ld a, [de]
|
||||
ld b, a
|
||||
|
|
@ -2658,13 +2659,13 @@ SendNewMonToBox:
|
|||
ld c, b
|
||||
ld [de], a
|
||||
cp $ff
|
||||
jr nz, .asm_e7b1
|
||||
jr nz, .loop
|
||||
call GetMonHeader
|
||||
ld hl, wBoxMonOT
|
||||
ld bc, NAME_LENGTH
|
||||
ld a, [wNumInBox]
|
||||
ld a, [wBoxCount]
|
||||
dec a
|
||||
jr z, .asm_e7ee
|
||||
jr z, .skip
|
||||
dec a
|
||||
call AddNTimes
|
||||
push hl
|
||||
|
|
@ -2673,10 +2674,10 @@ SendNewMonToBox:
|
|||
ld d, h
|
||||
ld e, l
|
||||
pop hl
|
||||
ld a, [wNumInBox]
|
||||
ld a, [wBoxCount]
|
||||
dec a
|
||||
ld b, a
|
||||
.asm_e7db
|
||||
.loop2
|
||||
push bc
|
||||
push hl
|
||||
ld bc, NAME_LENGTH
|
||||
|
|
@ -2688,15 +2689,15 @@ SendNewMonToBox:
|
|||
add hl, bc
|
||||
pop bc
|
||||
dec b
|
||||
jr nz, .asm_e7db
|
||||
.asm_e7ee
|
||||
jr nz, .loop2
|
||||
.skip
|
||||
ld hl, wPlayerName
|
||||
ld de, wBoxMonOT
|
||||
ld bc, NAME_LENGTH
|
||||
call CopyData
|
||||
ld a, [wNumInBox]
|
||||
ld a, [wBoxCount]
|
||||
dec a
|
||||
jr z, .asm_e82a
|
||||
jr z, .skip2
|
||||
ld hl, wBoxMonNicks
|
||||
ld bc, NAME_LENGTH
|
||||
dec a
|
||||
|
|
@ -2707,10 +2708,10 @@ SendNewMonToBox:
|
|||
ld d, h
|
||||
ld e, l
|
||||
pop hl
|
||||
ld a, [wNumInBox]
|
||||
ld a, [wBoxCount]
|
||||
dec a
|
||||
ld b, a
|
||||
.asm_e817
|
||||
.loop3
|
||||
push bc
|
||||
push hl
|
||||
ld bc, NAME_LENGTH
|
||||
|
|
@ -2722,15 +2723,15 @@ SendNewMonToBox:
|
|||
add hl, bc
|
||||
pop bc
|
||||
dec b
|
||||
jr nz, .asm_e817
|
||||
.asm_e82a
|
||||
jr nz, .loop3
|
||||
.skip2
|
||||
ld hl, wBoxMonNicks
|
||||
ld a, NAME_MON_SCREEN
|
||||
ld [wNamingScreenType], a
|
||||
predef AskName
|
||||
ld a, [wNumInBox]
|
||||
ld a, [wBoxCount]
|
||||
dec a
|
||||
jr z, .asm_e867
|
||||
jr z, .skip3
|
||||
ld hl, wBoxMons
|
||||
ld bc, wBoxMon2 - wBoxMon1
|
||||
dec a
|
||||
|
|
@ -2741,10 +2742,10 @@ SendNewMonToBox:
|
|||
ld d, h
|
||||
ld e, l
|
||||
pop hl
|
||||
ld a, [wNumInBox]
|
||||
ld a, [wBoxCount]
|
||||
dec a
|
||||
ld b, a
|
||||
.asm_e854
|
||||
.loop4
|
||||
push bc
|
||||
push hl
|
||||
ld bc, wBoxMon2 - wBoxMon1
|
||||
|
|
@ -2756,8 +2757,8 @@ SendNewMonToBox:
|
|||
add hl, bc
|
||||
pop bc
|
||||
dec b
|
||||
jr nz, .asm_e854
|
||||
.asm_e867
|
||||
jr nz, .loop4
|
||||
.skip3
|
||||
ld a, [wEnemyMonLevel]
|
||||
ld [wEnemyMonBoxLevel], a
|
||||
ld hl, wEnemyMon
|
||||
|
|
@ -2787,11 +2788,11 @@ SendNewMonToBox:
|
|||
inc de
|
||||
xor a
|
||||
ld b, NUM_STATS * 2
|
||||
.asm_e89f
|
||||
.loop5
|
||||
ld [de], a
|
||||
inc de
|
||||
dec b
|
||||
jr nz, .asm_e89f
|
||||
jr nz, .loop5
|
||||
ld hl, wEnemyMonDVs
|
||||
ld a, [hli]
|
||||
ld [de], a
|
||||
|
|
@ -2800,12 +2801,12 @@ SendNewMonToBox:
|
|||
ld [de], a
|
||||
ld hl, wEnemyMonPP
|
||||
ld b, NUM_MOVES
|
||||
.asm_e8b1
|
||||
.loop6
|
||||
ld a, [hli]
|
||||
inc de
|
||||
ld [de], a
|
||||
dec b
|
||||
jr nz, .asm_e8b1
|
||||
jr nz, .loop6
|
||||
ret
|
||||
|
||||
; checks if the tile in front of the player is a shore or water tile
|
||||
|
|
@ -2923,7 +2924,7 @@ FindWildLocationsOfMon:
|
|||
|
||||
CheckMapForMon:
|
||||
inc hl
|
||||
ld b, $a
|
||||
ld b, NUM_WILDMONS
|
||||
.loop
|
||||
ld a, [wd11e]
|
||||
cp [hl]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
NOT_VISITED EQU $fe
|
||||
DEF NOT_VISITED EQU $fe
|
||||
|
||||
DisplayTownMap:
|
||||
call LoadTownMap
|
||||
|
|
@ -16,7 +16,7 @@ DisplayTownMap:
|
|||
hlcoord 1, 0
|
||||
ld de, wcd6d
|
||||
call PlaceString
|
||||
ld hl, wOAMBuffer
|
||||
ld hl, wShadowOAM
|
||||
ld de, wTileMapBackup
|
||||
ld bc, $10
|
||||
call CopyData
|
||||
|
|
@ -47,7 +47,7 @@ DisplayTownMap:
|
|||
call TownMapCoordsToOAMCoords
|
||||
ld a, $4
|
||||
ld [wOAMBaseTile], a
|
||||
ld hl, wOAMBuffer + $10
|
||||
ld hl, wShadowOAMSprite04
|
||||
call WriteTownMapSpriteOAM ; town map cursor sprite
|
||||
pop hl
|
||||
ld de, wcd6d
|
||||
|
|
@ -60,7 +60,7 @@ DisplayTownMap:
|
|||
hlcoord 1, 0
|
||||
ld de, wcd6d
|
||||
call PlaceString
|
||||
ld hl, wOAMBuffer + $10
|
||||
ld hl, wShadowOAMSprite04
|
||||
ld de, wTileMapBackup + 16
|
||||
ld bc, $10
|
||||
call CopyData
|
||||
|
|
@ -249,7 +249,7 @@ ToText:
|
|||
db "To@"
|
||||
|
||||
BuildFlyLocationsList:
|
||||
ld hl, wFlyLocationsList - 1
|
||||
ld hl, wFlyAnimUsingCoordList
|
||||
ld [hl], $ff
|
||||
inc hl
|
||||
ld a, [wTownVisitedFlag]
|
||||
|
|
@ -362,7 +362,7 @@ DrawPlayerOrBirdSprite:
|
|||
inc de
|
||||
cp "@"
|
||||
jr nz, .loop
|
||||
ld hl, wOAMBuffer
|
||||
ld hl, wShadowOAM
|
||||
ld de, wTileMapBackup
|
||||
ld bc, $a0
|
||||
jp CopyData
|
||||
|
|
@ -370,7 +370,7 @@ DrawPlayerOrBirdSprite:
|
|||
DisplayWildLocations:
|
||||
farcall FindWildLocationsOfMon
|
||||
call ZeroOutDuplicatesInList
|
||||
ld hl, wOAMBuffer
|
||||
ld hl, wShadowOAM
|
||||
ld de, wTownMapCoords
|
||||
.loop
|
||||
ld a, [de]
|
||||
|
|
@ -410,7 +410,7 @@ DisplayWildLocations:
|
|||
ld b, $0
|
||||
call DrawPlayerOrBirdSprite
|
||||
.done
|
||||
ld hl, wOAMBuffer
|
||||
ld hl, wShadowOAM
|
||||
ld de, wTileMapBackup
|
||||
ld bc, $a0
|
||||
jp CopyData
|
||||
|
|
@ -439,9 +439,9 @@ TownMapCoordsToOAMCoords:
|
|||
WritePlayerOrBirdSpriteOAM:
|
||||
ld a, [wOAMBaseTile]
|
||||
and a
|
||||
ld hl, wOAMBuffer + $90 ; for player sprite
|
||||
ld hl, wShadowOAMSprite36 ; for player sprite
|
||||
jr z, WriteTownMapSpriteOAM
|
||||
ld hl, wOAMBuffer + $80 ; for bird sprite
|
||||
ld hl, wShadowOAMSprite32 ; for bird sprite
|
||||
|
||||
WriteTownMapSpriteOAM:
|
||||
push hl
|
||||
|
|
@ -600,13 +600,13 @@ TownMapSpriteBlinkingAnimation::
|
|||
jr nz, .done
|
||||
; show sprites when the counter reaches 50
|
||||
ld hl, wTileMapBackup
|
||||
ld de, wOAMBuffer
|
||||
ld de, wShadowOAM
|
||||
ld bc, $90
|
||||
call CopyData
|
||||
xor a
|
||||
jr .done
|
||||
.hideSprites
|
||||
ld hl, wOAMBuffer
|
||||
ld hl, wShadowOAM
|
||||
ld b, $24
|
||||
ld de, $4
|
||||
.hideSpritesLoop
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue