summaryrefslogtreecommitdiff
path: root/Tips-and-tricks.md
diff options
context:
space:
mode:
Diffstat (limited to 'Tips-and-tricks.md')
-rw-r--r--Tips-and-tricks.md36
1 files changed, 16 insertions, 20 deletions
diff --git a/Tips-and-tricks.md b/Tips-and-tricks.md
index dd0f891..43cd764 100644
--- a/Tips-and-tricks.md
+++ b/Tips-and-tricks.md
@@ -83,28 +83,24 @@ Edit [gfx/overworld/npc_sprites.pal](../blob/master/gfx/overworld/npc_sprites.pa
## Enemy trainers have maximum happiness for a powerful Return
-Edit [engine/pokemon/move_mon.asm](../blob/master/engine/pokemon/move_mon.asm):
+Edit [engine/battle/core.asm](../blob/master/engine/battle/core.asm):
```diff
- TryAddMonToParty:
- ...
- GeneratePartyMonStats:
- ; wBattleMode specifies whether it's a wild mon or not.
- ; wMonType specifies whether it's an opposing mon or not.
- ; wCurPartySpecies/wCurPartyLevel specify the species and level.
- ; hl points to the wPartyMon struct to fill.
- ...
-
- ; Initialize happiness.
-+ ld a, [wMonType]
-+ and $f
- ld a, BASE_HAPPINESS
-+ jr z, .got_happiness
-+ ld a, $ff ; max happiness for enemy trainers
-+.got_happiness
- ld [de], a
- inc de
-
+ LoadEnemyMon:
+ ; Initialize enemy monster parameters
+ ; To do this we pull the species from wTempEnemyMonSpecies
+
+ ...
+
+ .Happiness:
+ ; Set happiness
++ ld a, [wBattleMode]
++ dec a
++ ld a, $ff
++ jr nz, .load_happiness ; If it's a Trainer battle, give enemy mon max happiness.
+ ld a, BASE_HAPPINESS
++.load_happiness
+ ld [wEnemyMonHappiness], a
...
```