summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Don't-gain-experience-at-level-100.md39
1 files changed, 38 insertions, 1 deletions
diff --git a/Don't-gain-experience-at-level-100.md b/Don't-gain-experience-at-level-100.md
index ff57841..fb0818f 100644
--- a/Don't-gain-experience-at-level-100.md
+++ b/Don't-gain-experience-at-level-100.md
@@ -8,8 +8,28 @@ Anyway, just edit one file, [engine/battle/core.asm](../blob/master/engine/battl
GiveExperiencePoints:
; Give experience.
; Don't give experience if linked or in the Battle Tower.
- ...
+ ld a, [wLinkMode]
+ and a
+ ret nz
+
+ ld a, [wInBattleTowerBattle]
+ bit 0, a
+ ret nz
+
+ call .EvenlyDivideExpAmongParticipants
+ xor a
+ ld [wCurPartyMon], a
+ ld bc, wPartyMon1Species
+
+ .loop
+ ld hl, MON_HP
+ add hl, bc
+ ld a, [hli]
+ or [hl]
+ jp z, .skip_stats ; fainted
+ ...
+
.skip
inc de
inc de
@@ -37,6 +57,23 @@ Anyway, just edit one file, [engine/battle/core.asm](../blob/master/engine/battl
...
+ .skip_stats
+ ld a, [wPartyCount]
+ ld b, a
+ ld a, [wCurPartyMon]
+ inc a
+ cp b
+ jr z, .done
+ ld [wCurPartyMon], a
+ ld a, MON_SPECIES
+ call GetPartyParamLocation
+ ld b, h
+ ld c, l
+ jp .loop
+
+ .done
+ jp ResetBattleParticipants
+
.EvenlyDivideExpAmongParticipants:
; count number of battle participants
ld a, [wBattleParticipantsNotFainted]