diff options
| author | dannye <33dannye@gmail.com> | 2020-05-20 19:40:33 -0500 |
|---|---|---|
| committer | dannye <33dannye@gmail.com> | 2020-05-20 20:02:53 -0500 |
| commit | 10f9559eab8c93b94abb8ae8d1083704ad4e169a (patch) | |
| tree | 7dbe7b152dde8a6e9b56664b5b8cdfc0d6be1253 /engine/battle/read_trainer_party.asm | |
| parent | Merge pull request #39 from TiKevin83/master (diff) | |
| download | pokeyellow-10f9559eab8c93b94abb8ae8d1083704ad4e169a.tar.gz pokeyellow-10f9559eab8c93b94abb8ae8d1083704ad4e169a.tar.xz pokeyellow-10f9559eab8c93b94abb8ae8d1083704ad4e169a.zip | |
Sync with pokered
Diffstat (limited to 'engine/battle/read_trainer_party.asm')
| -rwxr-xr-x | engine/battle/read_trainer_party.asm | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/engine/battle/read_trainer_party.asm b/engine/battle/read_trainer_party.asm index 3f10a85d..b4ee46a0 100755 --- a/engine/battle/read_trainer_party.asm +++ b/engine/battle/read_trainer_party.asm @@ -1,43 +1,43 @@ ReadTrainer: ; don't change any moves in a link battle - ld a,[wLinkState] + ld a, [wLinkState] and a ret nz ; set [wEnemyPartyCount] to 0, [wEnemyPartyMons] to FF ; XXX first is total enemy pokemon? ; XXX second is species of first pokemon? - ld hl,wEnemyPartyCount + ld hl, wEnemyPartyCount xor a - ld [hli],a + ld [hli], a dec a - ld [hl],a + ld [hl], a ; get the pointer to trainer data for this class - ld a,[wTrainerClass] ; get trainer class + ld a, [wTrainerClass] ; get trainer class dec a add a - ld hl,TrainerDataPointers - ld c,a - ld b,0 - add hl,bc ; hl points to trainer class - ld a,[hli] - ld h,[hl] - ld l,a - ld a,[wTrainerNo] - ld b,a + ld hl, TrainerDataPointers + ld c, a + ld b, 0 + add hl, bc ; hl points to trainer class + ld a, [hli] + ld h, [hl] + ld l, a + ld a, [wTrainerNo] + ld b, a ; At this point b contains the trainer number, ; and hl points to the trainer class. ; Our next task is to iterate through the trainers, ; decrementing b each time, until we get to the right one. .outer dec b - jr z,.IterateTrainer + jr z, .IterateTrainer .inner - ld a,[hli] + ld a, [hli] and a - jr nz,.inner + jr nz, .inner jr .outer ; if the first byte of trainer data is FF, @@ -46,17 +46,17 @@ ReadTrainer: ; - if [wLoneAttackNo] != 0, one pokemon on the team has a special move ; else the first byte is the level of every pokemon on the team .IterateTrainer - ld a,[hli] + ld a, [hli] cp $FF ; is the trainer special? - jr z,.SpecialTrainer ; if so, check for special moves - ld [wCurEnemyLVL],a + jr z, .SpecialTrainer ; if so, check for special moves + ld [wCurEnemyLVL], a .LoopTrainerData - ld a,[hli] + ld a, [hli] and a ; have we reached the end of the trainer data? jp z, .AddAdditionalMoveData - ld [wcf91],a ; write species somewhere (XXX why?) - ld a,ENEMY_PARTY_DATA - ld [wMonDataLocation],a + ld [wcf91], a ; write species somewhere (XXX why?) + ld a, ENEMY_PARTY_DATA + ld [wMonDataLocation], a push hl call AddPartyMon pop hl @@ -66,14 +66,14 @@ ReadTrainer: ; - each pokemon has a specific level ; (as opposed to the whole team being of the same level) ; - if [wLoneAttackNo] != 0, one pokemon on the team has a special move - ld a,[hli] + ld a, [hli] and a ; have we reached the end of the trainer data? - jr z,.AddAdditionalMoveData - ld [wCurEnemyLVL],a - ld a,[hli] - ld [wcf91],a - ld a,ENEMY_PARTY_DATA - ld [wMonDataLocation],a + jr z, .AddAdditionalMoveData + ld [wCurEnemyLVL], a + ld a, [hli] + ld [wcf91], a + ld a, ENEMY_PARTY_DATA + ld [wMonDataLocation], a push hl call AddPartyMon pop hl @@ -123,23 +123,23 @@ ReadTrainer: .FinishUp ; clear wAmountMoneyWon addresses xor a - ld de,wAmountMoneyWon - ld [de],a + ld de, wAmountMoneyWon + ld [de], a inc de - ld [de],a + ld [de], a inc de - ld [de],a - ld a,[wCurEnemyLVL] - ld b,a + ld [de], a + ld a, [wCurEnemyLVL] + ld b, a .LastLoop ; update wAmountMoneyWon addresses (money to win) based on enemy's level - ld hl,wTrainerBaseMoney + 1 - ld c,2 ; wAmountMoneyWon is a 3-byte number + ld hl, wTrainerBaseMoney + 1 + ld c, 2 ; wAmountMoneyWon is a 3-byte number push bc predef AddBCDPredef pop bc inc de inc de dec b - jr nz,.LastLoop ; repeat wCurEnemyLVL times + jr nz, .LastLoop ; repeat wCurEnemyLVL times ret |
