summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2018-07-23 22:25:23 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2018-07-23 22:25:23 -0400
commit993fdb391e78bbdac3390cead6096da7e3742406 (patch)
treecca21ff3e54363d989ad66f44d8e4f99d423a76d
parenta90aa870f112e6aba586c85859c9fda32a502dd8 (diff)
Show more code
-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]