mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-04-09 05:44:44 -07:00
Use maskbits some more
This commit is contained in:
parent
a436bbc23b
commit
94d6a32721
@ -408,7 +408,7 @@ UpdateChannels: ; e8125
|
||||
ret
|
||||
|
||||
.asm_e824d
|
||||
ld a, $3f
|
||||
ld a, $3f ; sound length
|
||||
ld [rNR31], a
|
||||
xor a
|
||||
ld [rNR30], a
|
||||
@ -1304,8 +1304,8 @@ ParseSFXOrRest: ; e8698
|
||||
ld [hl], a
|
||||
; are we on the last channel? (noise sampling)
|
||||
ld a, [CurChannel]
|
||||
and $3
|
||||
cp $3
|
||||
maskbits NUM_MUSIC_CHANS +- 1
|
||||
cp CHAN4
|
||||
ret z
|
||||
; update hi frequency from next param
|
||||
call GetMusicByte
|
||||
@ -1320,8 +1320,8 @@ GetNoiseSample: ; e86c5
|
||||
; load ptr to sample header in NoiseSampleAddress
|
||||
; are we on the last channel?
|
||||
ld a, [CurChannel]
|
||||
and $3
|
||||
cp $3
|
||||
and NUM_MUSIC_CHANS +- 1
|
||||
cp CHAN4
|
||||
; ret if not
|
||||
ret nz
|
||||
; update note duration
|
||||
@ -1668,7 +1668,7 @@ MusicEE; e883e
|
||||
; if ????, jump
|
||||
; get channel
|
||||
ld a, [CurChannel]
|
||||
and $3 ; ch0-3
|
||||
maskbits NUM_MUSIC_CHANS +- 1
|
||||
ld e, a
|
||||
ld d, 0
|
||||
; hl = Channel1JumpCondition + channel id
|
||||
@ -1966,8 +1966,8 @@ Music_NoteType: ; e8963
|
||||
add hl, bc
|
||||
ld [hl], a
|
||||
ld a, [CurChannel]
|
||||
and $3
|
||||
cp CHAN8 & $3
|
||||
maskbits NUM_MUSIC_CHANS +- 1
|
||||
cp CHAN4
|
||||
ret z
|
||||
; intensity
|
||||
call Music_Intensity
|
||||
@ -2414,7 +2414,7 @@ SetLRTracks: ; e8b1b
|
||||
push de
|
||||
; store current channel in de
|
||||
ld a, [CurChannel]
|
||||
and $3
|
||||
maskbits NUM_MUSIC_CHANS +- 1
|
||||
ld e, a
|
||||
ld d, 0
|
||||
; get this channel's lr tracks
|
||||
@ -2449,7 +2449,7 @@ _PlayMusic:: ; e8b30
|
||||
call LoadMusicByte ; store first byte of music header in a
|
||||
rlca
|
||||
rlca
|
||||
and $3 ; get number of channels
|
||||
maskbits NUM_MUSIC_CHANS +- 1
|
||||
inc a
|
||||
.loop
|
||||
; start playing channels
|
||||
@ -2505,7 +2505,7 @@ _PlayCryHeader:: ; e8b79
|
||||
; Top 2 bits contain the number of channels
|
||||
rlca
|
||||
rlca
|
||||
and 3
|
||||
maskbits NUM_MUSIC_CHANS +- 1
|
||||
|
||||
; For each channel:
|
||||
inc a
|
||||
@ -2530,8 +2530,8 @@ _PlayCryHeader:: ; e8b79
|
||||
|
||||
; No tempo for channel 4
|
||||
ld a, [CurChannel]
|
||||
and 3
|
||||
cp 3
|
||||
maskbits NUM_MUSIC_CHANS +- 1
|
||||
cp CHAN4
|
||||
jr nc, .start
|
||||
|
||||
; Tempo is effectively length
|
||||
@ -2669,7 +2669,7 @@ _PlaySFX:: ; e8c04
|
||||
call LoadMusicByte
|
||||
rlca ; top 2
|
||||
rlca ; bits
|
||||
and $3
|
||||
maskbits NUM_MUSIC_CHANS +- 1
|
||||
inc a ; # channels -> # loops
|
||||
.startchannels
|
||||
push af
|
||||
@ -2722,7 +2722,7 @@ PlayStereoSFX:: ; e8ca6
|
||||
call LoadMusicByte
|
||||
rlca
|
||||
rlca
|
||||
and 3 ; ch1-4
|
||||
maskbits NUM_MUSIC_CHANS +- 1
|
||||
inc a
|
||||
|
||||
.loop
|
||||
@ -2736,7 +2736,7 @@ PlayStereoSFX:: ; e8ca6
|
||||
push de
|
||||
; get tracks for this channel
|
||||
ld a, [CurChannel]
|
||||
and 3 ; ch1-4
|
||||
maskbits NUM_MUSIC_CHANS +- 1
|
||||
ld e, a
|
||||
ld d, 0
|
||||
call GetLRTracks
|
||||
|
@ -9,21 +9,15 @@
|
||||
const ITEMATTR_HELP
|
||||
ITEMATTR_STRUCT_LENGTH EQU const_value
|
||||
|
||||
|
||||
; pack pockets
|
||||
ITEM EQU 1
|
||||
KEY_ITEM EQU 2
|
||||
BALL EQU 3
|
||||
TM_HM EQU 4
|
||||
|
||||
; pack pocket sizes
|
||||
MAX_ITEMS EQU 20
|
||||
MAX_KEY_ITEMS EQU 25
|
||||
MAX_BALLS EQU 12
|
||||
MAX_PC_ITEMS EQU 50
|
||||
|
||||
; item types
|
||||
const_value set 1
|
||||
const ITEM ; 1
|
||||
const KEY_ITEM ; 2
|
||||
const BALL ; 3
|
||||
const TM_HM ; 4
|
||||
|
||||
; item menu types
|
||||
; UseItem.dw indexes (see engine/pack.asm)
|
||||
ITEMMENU_NOUSE EQU 0
|
||||
ITEMMENU_CURRENT EQU 4
|
||||
ITEMMENU_PARTY EQU 5
|
||||
@ -34,6 +28,20 @@ CANT_SELECT EQU 1 << 6
|
||||
CANT_TOSS EQU 1 << 7
|
||||
|
||||
|
||||
; pack pockets
|
||||
const_def
|
||||
const ITEM_POCKET ; 0
|
||||
const BALL_POCKET ; 1
|
||||
const KEY_ITEM_POCKET ; 2
|
||||
const TM_HM_POCKET ; 3
|
||||
NUM_POCKETS EQU const_value +- 1
|
||||
|
||||
MAX_ITEMS EQU 20
|
||||
MAX_BALLS EQU 12
|
||||
MAX_KEY_ITEMS EQU 25
|
||||
MAX_PC_ITEMS EQU 50
|
||||
|
||||
|
||||
; mail
|
||||
MAIL_MSG_LENGTH EQU $20
|
||||
MAILBOX_CAPACITY EQU 10
|
||||
|
@ -100,3 +100,13 @@ KANTO_LANDMARK EQU const_value
|
||||
const TOHJO_FALLS ; 5d
|
||||
const ROUTE_28 ; 5e
|
||||
const FAST_SHIP ; 5f
|
||||
|
||||
; used in CaughtData
|
||||
GIFT_LOCATION EQU $7e
|
||||
EVENT_LOCATION EQU $7f
|
||||
|
||||
|
||||
; Regions
|
||||
const_def
|
||||
const JOHTO_REGION ; 0
|
||||
const KANTO_REGION ; 1
|
||||
|
@ -86,3 +86,10 @@ const_value = 1
|
||||
|
||||
; day-care
|
||||
MAX_DAY_CARE_EXP EQU $500000
|
||||
|
||||
; bug-catching contest
|
||||
BUG_CONTEST_MINUTES EQU 20
|
||||
BUG_CONTEST_SECONDS EQU 0
|
||||
BUG_CONTEST_PLAYER EQU 1
|
||||
NUM_BUG_CONTESTANTS EQU 10 ; not counting the player
|
||||
BUG_CONTESTANT_SIZE EQU 4
|
||||
|
@ -111,6 +111,10 @@
|
||||
; GetMapHeaderMusic picks music for this value (see home/map.asm)
|
||||
MUSIC_MAHOGANY_MART EQU $64
|
||||
|
||||
; ExitPokegearRadio_HandleMusic uses these values
|
||||
RESTART_MAP_MUSIC EQU $fe
|
||||
ENTER_MAP_MUSIC EQU $ff
|
||||
|
||||
; GetMapHeaderMusic picks music for this bit flag
|
||||
RADIO_TOWER_MUSIC_F EQU 7
|
||||
RADIO_TOWER_MUSIC EQU 1 << RADIO_TOWER_MUSIC_F
|
||||
|
@ -19,3 +19,25 @@ TRADE_PADDING EQU 31
|
||||
const NPCTRADE_CHRIS ; 4
|
||||
const NPCTRADE_KIM ; 5
|
||||
const NPCTRADE_FOREST ; 6
|
||||
|
||||
; trade gender limits
|
||||
TRADE_EITHER_GENDER EQU 0
|
||||
TRADE_MALE_ONLY EQU 1
|
||||
TRADE_FEMALE_ONLY EQU 2
|
||||
|
||||
; TradeTexts indexes (see engine/npctrade.asm)
|
||||
|
||||
; trade dialogs
|
||||
const_def
|
||||
const TRADE_INTRO
|
||||
const TRADE_CANCEL
|
||||
const TRADE_WRONG
|
||||
const TRADE_COMPLETE
|
||||
const TRADE_AFTER
|
||||
|
||||
; trade dialog sets
|
||||
const_def
|
||||
const TRADE_DIALOG_COLLECTOR
|
||||
const TRADE_DIALOG_HAPPY
|
||||
const TRADE_DIALOG_NEWBIE
|
||||
const TRADE_DIALOG_GIRL
|
||||
|
@ -63,6 +63,10 @@ const_value set 1
|
||||
const NO_EGGS ; f
|
||||
|
||||
|
||||
; pokedex entries (see data/pokemon/dex_entries.asm)
|
||||
NUM_DEX_ENTRY_BANKS EQU 4
|
||||
|
||||
|
||||
; party_struct members (see macros/wram.asm)
|
||||
MON_SPECIES EQUS "(PartyMon1Species - PartyMon1)"
|
||||
MON_ITEM EQUS "(PartyMon1Item - PartyMon1)"
|
||||
@ -98,6 +102,21 @@ PARTYMON_STRUCT_LENGTH EQUS "(PartyMon1StatsEnd - PartyMon1)"
|
||||
REDMON_STRUCT_LENGTH EQU 44
|
||||
|
||||
|
||||
; caught data
|
||||
|
||||
CAUGHT_TIME_MASK EQU %11000000
|
||||
CAUGHT_LEVEL_MASK EQU %00111111
|
||||
|
||||
CAUGHT_GENDER_MASK EQU %10000000
|
||||
CAUGHT_LOCATION_MASK EQU %01111111
|
||||
|
||||
CAUGHT_BY_UNKNOWN EQU 0
|
||||
CAUGHT_BY_GIRL EQU 1
|
||||
CAUGHT_BY_BOY EQU 2
|
||||
|
||||
CAUGHT_EGG_LEVEL EQU 1
|
||||
|
||||
|
||||
; maximum number of party pokemon
|
||||
PARTY_LENGTH EQU 6
|
||||
|
||||
|
@ -52,6 +52,7 @@ const_value set -1
|
||||
const UP ; 1
|
||||
const LEFT ; 2
|
||||
const RIGHT ; 3
|
||||
NUM_DIRECTIONS EQU const_value
|
||||
|
||||
DOWN_MASK EQU 1 << DOWN
|
||||
UP_MASK EQU 1 << UP
|
||||
@ -71,6 +72,7 @@ FACE_RIGHT EQU 1
|
||||
const DAY_F ; 1
|
||||
const NITE_F ; 2
|
||||
const DARKNESS_F ; 3
|
||||
NUM_DAYTIMES EQU const_value
|
||||
|
||||
MORN EQU 1 << MORN_F
|
||||
DAY EQU 1 << DAY_F
|
||||
|
13
data/bug_contest_flags.asm
Normal file
13
data/bug_contest_flags.asm
Normal file
@ -0,0 +1,13 @@
|
||||
BugCatchingContestantEventFlagTable: ; 139fe
|
||||
; there are NUM_BUG_CONTESTANTS entries
|
||||
dw EVENT_BUG_CATCHING_CONTESTANT_1A
|
||||
dw EVENT_BUG_CATCHING_CONTESTANT_2A
|
||||
dw EVENT_BUG_CATCHING_CONTESTANT_3A
|
||||
dw EVENT_BUG_CATCHING_CONTESTANT_4A
|
||||
dw EVENT_BUG_CATCHING_CONTESTANT_5A
|
||||
dw EVENT_BUG_CATCHING_CONTESTANT_6A
|
||||
dw EVENT_BUG_CATCHING_CONTESTANT_7A
|
||||
dw EVENT_BUG_CATCHING_CONTESTANT_8A
|
||||
dw EVENT_BUG_CATCHING_CONTESTANT_9A
|
||||
dw EVENT_BUG_CATCHING_CONTESTANT_10A
|
||||
; 13a12
|
@ -1,5 +1,6 @@
|
||||
BugContestantPointers: ; 13783
|
||||
dw BugContestant_BugCatcherDon ; This reverts back to the player
|
||||
; there are NUM_BUG_CONTESTANTS + 1 entries
|
||||
dw BugContestant_BugCatcherDon ; this reverts back to the player
|
||||
dw BugContestant_BugCatcherDon
|
||||
dw BugContestant_BugCatcherEd
|
||||
dw BugContestant_CooltrainerMNick
|
||||
@ -12,6 +13,12 @@ BugContestantPointers: ; 13783
|
||||
dw BugContestant_SchoolboyKipp
|
||||
; 13799
|
||||
|
||||
; contestant format:
|
||||
; db class, id
|
||||
; dbw 1st-place mon, score
|
||||
; dbw 2nd-place mon, score
|
||||
; dbw 3rd-place mon, score
|
||||
|
||||
BugContestant_BugCatcherDon:
|
||||
db BUG_CATCHER, DON
|
||||
dbw KAKUNA, 300
|
||||
|
@ -1,7 +1,3 @@
|
||||
TRADE_EITHER_GENDER EQU 0
|
||||
TRADE_MALE_ONLY EQU 1
|
||||
TRADE_FEMALE_ONLY EQU 2
|
||||
|
||||
npctrade: MACRO
|
||||
; dialog set, requested mon, offered mon, nickname, dvs, item, OT ID, OT name, gender requested
|
||||
db \1, \2, \3, \4, \5, \6, \7
|
||||
@ -12,11 +8,11 @@ ENDM
|
||||
|
||||
NPCTrades: ; fce58
|
||||
; entries correspond to NPCTRADE_* constants
|
||||
npctrade 0, ABRA, MACHOP, "MUSCLE@@@@@", $37, $66, GOLD_BERRY, 37460, "MIKE@@@@@@@", TRADE_EITHER_GENDER
|
||||
npctrade 0, BELLSPROUT, ONIX, "ROCKY@@@@@@", $96, $66, BITTER_BERRY, 48926, "KYLE@@@@@@@", TRADE_EITHER_GENDER
|
||||
npctrade 1, KRABBY, VOLTORB, "VOLTY@@@@@@", $98, $88, PRZCUREBERRY, 29189, "TIM@@@@@@@@", TRADE_EITHER_GENDER
|
||||
npctrade 3, DRAGONAIR, DODRIO, "DORIS@@@@@@", $77, $66, SMOKE_BALL, 00283, "EMY@@@@@@@@", TRADE_FEMALE_ONLY
|
||||
npctrade 2, HAUNTER, XATU, "PAUL@@@@@@@", $96, $86, MYSTERYBERRY, 15616, "CHRIS@@@@@@", TRADE_EITHER_GENDER
|
||||
npctrade 3, CHANSEY, AERODACTYL, "AEROY@@@@@@", $96, $66, GOLD_BERRY, 26491, "KIM@@@@@@@@", TRADE_EITHER_GENDER
|
||||
npctrade 0, DUGTRIO, MAGNETON, "MAGGIE@@@@@", $96, $66, METAL_COAT, 50082, "FOREST@@@@@", TRADE_EITHER_GENDER
|
||||
npctrade TRADE_DIALOG_COLLECTOR, ABRA, MACHOP, "MUSCLE@@@@@", $37, $66, GOLD_BERRY, 37460, "MIKE@@@@@@@", TRADE_EITHER_GENDER
|
||||
npctrade TRADE_DIALOG_COLLECTOR, BELLSPROUT, ONIX, "ROCKY@@@@@@", $96, $66, BITTER_BERRY, 48926, "KYLE@@@@@@@", TRADE_EITHER_GENDER
|
||||
npctrade TRADE_DIALOG_HAPPY, KRABBY, VOLTORB, "VOLTY@@@@@@", $98, $88, PRZCUREBERRY, 29189, "TIM@@@@@@@@", TRADE_EITHER_GENDER
|
||||
npctrade TRADE_DIALOG_GIRL, DRAGONAIR, DODRIO, "DORIS@@@@@@", $77, $66, SMOKE_BALL, 00283, "EMY@@@@@@@@", TRADE_FEMALE_ONLY
|
||||
npctrade TRADE_DIALOG_NEWBIE, HAUNTER, XATU, "PAUL@@@@@@@", $96, $86, MYSTERYBERRY, 15616, "CHRIS@@@@@@", TRADE_EITHER_GENDER
|
||||
npctrade TRADE_DIALOG_GIRL, CHANSEY, AERODACTYL, "AEROY@@@@@@", $96, $66, GOLD_BERRY, 26491, "KIM@@@@@@@@", TRADE_EITHER_GENDER
|
||||
npctrade TRADE_DIALOG_COLLECTOR, DUGTRIO, MAGNETON, "MAGGIE@@@@@", $96, $66, METAL_COAT, 50082, "FOREST@@@@@", TRADE_EITHER_GENDER
|
||||
; fcf38
|
||||
|
@ -56,7 +56,7 @@ AIChooseMove: ; 440ce
|
||||
inc hl
|
||||
ld a, [de]
|
||||
inc de
|
||||
and $3f
|
||||
and PP_MASK
|
||||
jr nz, .CheckMovePP
|
||||
ld [hl], 80
|
||||
jr .CheckMovePP
|
||||
@ -186,7 +186,7 @@ AIChooseMove: ; 440ce
|
||||
.ChooseMove:
|
||||
ld hl, Buffer1
|
||||
call Random
|
||||
and 3
|
||||
maskbits NUM_MOVES +- 1
|
||||
ld c, a
|
||||
ld b, 0
|
||||
add hl, bc
|
||||
|
@ -640,8 +640,8 @@ StartTrainerBattle_LoadPokeBallGraphics: ; 8c5dc (23:45dc)
|
||||
.cgb
|
||||
ld hl, .daypals
|
||||
ld a, [TimeOfDayPal]
|
||||
and $3
|
||||
cp 3
|
||||
maskbits NUM_DAYTIMES +- 1
|
||||
cp DARKNESS_F
|
||||
jr nz, .daytime
|
||||
ld hl, .nightpals
|
||||
.daytime
|
||||
|
@ -730,7 +730,7 @@ HandleEncore: ; 3c4df
|
||||
ld b, 0
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
and $3f
|
||||
and PP_MASK
|
||||
ret nz
|
||||
|
||||
.end_player_encore
|
||||
@ -754,7 +754,7 @@ HandleEncore: ; 3c4df
|
||||
ld b, 0
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
and $3f
|
||||
and PP_MASK
|
||||
ret nz
|
||||
|
||||
.end_enemy_encore
|
||||
@ -1401,7 +1401,7 @@ HandleMysteryberry: ; 3c93c
|
||||
and a
|
||||
jr z, .quit
|
||||
ld a, [de]
|
||||
and $3f
|
||||
and PP_MASK
|
||||
jr z, .restore
|
||||
inc hl
|
||||
inc de
|
||||
@ -5650,7 +5650,7 @@ MoveSelectionScreen: ; 3e4bc
|
||||
ld b, 0
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
and $3f
|
||||
and PP_MASK
|
||||
jr z, .no_pp_left
|
||||
ld a, [PlayerDisableCount]
|
||||
swap a
|
||||
@ -5849,7 +5849,7 @@ MoveInfoBox: ; 3e6c8
|
||||
ld hl, BattleMonPP
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
and $3f
|
||||
and PP_MASK
|
||||
ld [StringBuffer1], a
|
||||
call .PrintPP
|
||||
|
||||
@ -5912,7 +5912,7 @@ CheckPlayerHasUsableMoves: ; 3e786
|
||||
or [hl]
|
||||
inc hl
|
||||
or [hl]
|
||||
and $3f
|
||||
and PP_MASK
|
||||
ret nz
|
||||
jr .force_struggle
|
||||
|
||||
@ -5934,8 +5934,7 @@ CheckPlayerHasUsableMoves: ; 3e786
|
||||
|
||||
.done
|
||||
; Bug: this will result in a move with PP Up confusing the game.
|
||||
; Replace with "and $3f" to fix.
|
||||
and a
|
||||
and a ; should be "and PP_MASK"
|
||||
ret nz
|
||||
|
||||
.force_struggle
|
||||
@ -6014,7 +6013,7 @@ ParseEnemyAction: ; 3e7c1
|
||||
cp [hl]
|
||||
jr z, .disabled
|
||||
ld a, [de]
|
||||
and $3f
|
||||
and PP_MASK
|
||||
jr nz, .enough_pp
|
||||
|
||||
.disabled
|
||||
@ -6032,7 +6031,7 @@ ParseEnemyAction: ; 3e7c1
|
||||
.loop2
|
||||
ld hl, EnemyMonMoves
|
||||
call BattleRandom
|
||||
and 3 ; TODO factor in NUM_MOVES
|
||||
maskbits NUM_MOVES +- 1
|
||||
ld c, a
|
||||
ld b, 0
|
||||
add hl, bc
|
||||
@ -6049,7 +6048,7 @@ ParseEnemyAction: ; 3e7c1
|
||||
add hl, bc
|
||||
ld b, a
|
||||
ld a, [hl]
|
||||
and $3f
|
||||
and PP_MASK
|
||||
jr z, .loop2
|
||||
ld a, c
|
||||
ld [CurEnemyMoveNum], a
|
||||
|
@ -846,19 +846,20 @@ BattleCommand_CheckObedience: ; 343db
|
||||
|
||||
|
||||
.DoNothing:
|
||||
; 4 random choices
|
||||
call BattleRandom
|
||||
and 3
|
||||
and %11
|
||||
|
||||
ld hl, LoafingAroundText
|
||||
and a
|
||||
and a ; 0
|
||||
jr z, .Print
|
||||
|
||||
ld hl, WontObeyText
|
||||
dec a
|
||||
dec a ; 1
|
||||
jr z, .Print
|
||||
|
||||
ld hl, TurnedAwayText
|
||||
dec a
|
||||
dec a ; 2
|
||||
jr z, .Print
|
||||
|
||||
ld hl, IgnoredOrdersText
|
||||
@ -888,7 +889,7 @@ BattleCommand_CheckObedience: ; 343db
|
||||
|
||||
.GetTotalPP:
|
||||
ld a, [hli]
|
||||
and $3f ; exclude pp up
|
||||
and PP_MASK
|
||||
add b
|
||||
ld b, a
|
||||
|
||||
@ -911,7 +912,7 @@ BattleCommand_CheckObedience: ; 343db
|
||||
|
||||
; Can't use another move if only one move has PP.
|
||||
ld a, [hl]
|
||||
and $3f
|
||||
and PP_MASK
|
||||
cp b
|
||||
jr z, .DoNothing
|
||||
|
||||
@ -931,7 +932,7 @@ BattleCommand_CheckObedience: ; 343db
|
||||
|
||||
.RandomMove:
|
||||
call BattleRandom
|
||||
and 3 ; TODO NUM_MOVES
|
||||
maskbits NUM_MOVES +- 1
|
||||
|
||||
cp b
|
||||
jr nc, .RandomMove
|
||||
@ -947,7 +948,7 @@ BattleCommand_CheckObedience: ; 343db
|
||||
ld d, 0
|
||||
add hl, de
|
||||
ld a, [hl]
|
||||
and $3f
|
||||
and PP_MASK
|
||||
jr z, .RandomMove
|
||||
|
||||
|
||||
@ -1118,7 +1119,7 @@ BattleCommand_DoTurn: ; 34555
|
||||
ld b, 0
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
and $3f
|
||||
and PP_MASK
|
||||
jr z, .out_of_pp
|
||||
dec [hl]
|
||||
ld b, 0
|
||||
@ -3906,7 +3907,7 @@ BattleCommand_Encore: ; 35864
|
||||
ld bc, BattleMonPP - BattleMonMoves - 1
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
and $3f
|
||||
and PP_MASK
|
||||
jp z, .failed
|
||||
ld a, [AttackMissed]
|
||||
and a
|
||||
@ -4386,7 +4387,7 @@ BattleCommand_SleepTalk: ; 35b33
|
||||
.sample_move
|
||||
push hl
|
||||
call BattleRandom
|
||||
and 3 ; TODO factor in NUM_MOVES
|
||||
maskbits NUM_MOVES +- 1
|
||||
ld c, a
|
||||
ld b, 0
|
||||
add hl, bc
|
||||
@ -4550,17 +4551,18 @@ BattleCommand_Spite: ; 35c0f
|
||||
add hl, bc
|
||||
pop bc
|
||||
ld a, [hl]
|
||||
and $3f
|
||||
and PP_MASK
|
||||
jr z, .failed
|
||||
push bc
|
||||
call GetMoveName
|
||||
; lose 2-5 PP
|
||||
call BattleRandom
|
||||
and 3
|
||||
and %11
|
||||
inc a
|
||||
inc a
|
||||
ld b, a
|
||||
ld a, [hl]
|
||||
and $3f
|
||||
and PP_MASK
|
||||
cp b
|
||||
jr nc, .deplete_pp
|
||||
ld b, a
|
||||
@ -6208,13 +6210,12 @@ BattleCommand_TriStatusChance: ; 3658f
|
||||
|
||||
call BattleCommand_EffectChance
|
||||
|
||||
; 1/3 chance of each status
|
||||
.loop
|
||||
; 1/3 chance of each status
|
||||
call BattleRandom
|
||||
swap a
|
||||
and 3
|
||||
and %11
|
||||
jr z, .loop
|
||||
; jump
|
||||
dec a
|
||||
ld hl, .ptrs
|
||||
rst JumpTable
|
||||
@ -7392,7 +7393,8 @@ BattleCommand_TrapTarget: ; 36c2d
|
||||
bit SUBSTATUS_SUBSTITUTE, a
|
||||
ret nz
|
||||
call BattleRandom
|
||||
and 3
|
||||
; trapped for 2-5 turns
|
||||
and %11
|
||||
inc a
|
||||
inc a
|
||||
inc a
|
||||
@ -7590,8 +7592,9 @@ BattleCommand_FinishConfusingTarget: ; 36d70
|
||||
|
||||
.got_confuse_count
|
||||
set SUBSTATUS_CONFUSED, [hl]
|
||||
; confused for 2-5 turns
|
||||
call BattleRandom
|
||||
and 3
|
||||
and %11
|
||||
inc a
|
||||
inc a
|
||||
ld [bc], a
|
||||
@ -8201,7 +8204,7 @@ BattleCommand_Conversion: ; 3707f
|
||||
.done
|
||||
.loop3
|
||||
call BattleRandom
|
||||
and 3 ; TODO factor in NUM_MOVES
|
||||
maskbits NUM_MOVES +- 1
|
||||
ld c, a
|
||||
ld b, 0
|
||||
ld hl, StringBuffer1
|
||||
|
@ -1207,7 +1207,7 @@ BattleAnimCmd_Sound: ; cc7cd (33:47cd)
|
||||
srl a
|
||||
ld [wSFXDuration], a
|
||||
call .GetCryTrack
|
||||
and 3
|
||||
maskbits NUM_NOISE_CHANS +- 1
|
||||
ld [CryTracks], a ; CryTracks
|
||||
|
||||
ld e, a
|
||||
@ -1244,7 +1244,7 @@ BattleAnimCmd_Sound: ; cc7cd (33:47cd)
|
||||
|
||||
BattleAnimCmd_Cry: ; cc807 (33:4807)
|
||||
call GetBattleAnimByte
|
||||
and 3
|
||||
maskbits NUM_NOISE_CHANS +- 1
|
||||
ld e, a
|
||||
ld d, 0
|
||||
ld hl, .CryData
|
||||
|
@ -136,7 +136,7 @@ _DepositPKMN: ; e2391 (38:6391)
|
||||
jp c, BillsPCDepositFuncCancel
|
||||
ld a, [wMenuCursorY]
|
||||
dec a
|
||||
and $3
|
||||
and %11
|
||||
ld e, a
|
||||
ld d, 0
|
||||
ld hl, BillsPCDepositJumptable
|
||||
@ -401,7 +401,7 @@ BillsPC_Withdraw: ; e2675 (38:6675)
|
||||
jp c, .cancel
|
||||
ld a, [wMenuCursorY]
|
||||
dec a
|
||||
and 3
|
||||
and %11
|
||||
ld e, a
|
||||
ld d, 0
|
||||
ld hl, .dw
|
||||
@ -663,7 +663,7 @@ _MovePKMNWithoutMail: ; e2759
|
||||
jp c, .Cancel
|
||||
ld a, [wMenuCursorY]
|
||||
dec a
|
||||
and 3
|
||||
and %11
|
||||
ld e, a
|
||||
ld d, 0
|
||||
ld hl, .Jumptable2
|
||||
|
@ -7,17 +7,17 @@ CheckPartyFullAfterContest: ; 4d9e5
|
||||
call GetBaseData
|
||||
ld hl, PartyCount
|
||||
ld a, [hl]
|
||||
cp 6
|
||||
cp PARTY_LENGTH
|
||||
jp nc, .TryAddToBox
|
||||
inc a
|
||||
ld [hl], a
|
||||
ld c, a
|
||||
ld b, $0
|
||||
ld b, 0
|
||||
add hl, bc
|
||||
ld a, [wContestMon]
|
||||
ld [hli], a
|
||||
ld [CurSpecies], a
|
||||
ld a, $ff
|
||||
ld a, -1
|
||||
ld [hl], a
|
||||
ld hl, PartyMon1Species
|
||||
ld a, [PartyCount]
|
||||
@ -75,8 +75,8 @@ CheckPartyFullAfterContest: ; 4d9e5
|
||||
ld hl, PartyMon1CaughtLocation
|
||||
call GetPartyLocation
|
||||
ld a, [hl]
|
||||
and $80
|
||||
ld b, $13
|
||||
and CAUGHT_GENDER_MASK
|
||||
ld b, NATIONAL_PARK
|
||||
or b
|
||||
ld [hl], a
|
||||
xor a
|
||||
@ -135,8 +135,8 @@ CheckPartyFullAfterContest: ; 4d9e5
|
||||
call GetSRAMBank
|
||||
ld hl, sBoxMon1CaughtLocation
|
||||
ld a, [hl]
|
||||
and $80
|
||||
ld b, $13
|
||||
and CAUGHT_GENDER_MASK
|
||||
ld b, NATIONAL_PARK
|
||||
or b
|
||||
ld [hl], a
|
||||
call CloseSRAM
|
||||
@ -227,7 +227,7 @@ SetGiftPartyMonCaughtData: ; 4dba3
|
||||
SetGiftMonCaughtData: ; 4dbaf
|
||||
xor a
|
||||
ld [hli], a
|
||||
ld a, $7e
|
||||
ld a, GIFT_LOCATION
|
||||
rrc b
|
||||
or b
|
||||
ld [hl], a
|
||||
@ -239,7 +239,7 @@ SetEggMonCaughtData: ; 4dbb8 (13:5bb8)
|
||||
call GetPartyLocation
|
||||
ld a, [CurPartyLevel]
|
||||
push af
|
||||
ld a, $1
|
||||
ld a, CAUGHT_EGG_LEVEL
|
||||
ld [CurPartyLevel], a
|
||||
call SetBoxmonOrEggmonCaughtData
|
||||
pop af
|
||||
|
@ -1240,7 +1240,7 @@ LoadMapPals:
|
||||
ld l, a
|
||||
; Futher refine by time of day
|
||||
ld a, [TimeOfDayPal]
|
||||
and 3
|
||||
maskbits NUM_DAYTIMES +- 1
|
||||
add a
|
||||
add a
|
||||
add a
|
||||
@ -1286,7 +1286,7 @@ LoadMapPals:
|
||||
|
||||
.got_pals
|
||||
ld a, [TimeOfDayPal]
|
||||
and 3
|
||||
maskbits NUM_DAYTIMES +- 1
|
||||
ld bc, 8 palettes
|
||||
ld hl, MapObjectPals
|
||||
call AddNTimes
|
||||
@ -1310,7 +1310,7 @@ LoadMapPals:
|
||||
ld de, RoofPals
|
||||
add hl, de
|
||||
ld a, [TimeOfDayPal]
|
||||
and 3
|
||||
maskbits NUM_DAYTIMES +- 1
|
||||
cp NITE_F
|
||||
jr c, .morn_day
|
||||
rept 4
|
||||
|
@ -504,7 +504,7 @@ GetCreditsPalette: ; 109b2c
|
||||
.GetPalAddress:
|
||||
; Each set of palette data is 24 bytes long.
|
||||
ld a, [wCreditsBorderMon] ; scene
|
||||
and 3
|
||||
and %11
|
||||
add a
|
||||
add a ; * 8
|
||||
add a
|
||||
@ -549,13 +549,13 @@ Credits_LoadBorderGFX: ; 109bca (42:5bca)
|
||||
cp $ff
|
||||
jr z, .init
|
||||
|
||||
and 3
|
||||
and %11
|
||||
ld e, a
|
||||
inc a
|
||||
and 3
|
||||
and %11
|
||||
ld [hl], a
|
||||
ld a, [wCreditsBorderMon]
|
||||
and 3
|
||||
and %11
|
||||
add a
|
||||
add a
|
||||
add e
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user