summaryrefslogtreecommitdiff
path: root/engine/events/bug_contest/caught_mon.asm
diff options
context:
space:
mode:
authorentrpntr <entrpntr@gmail.com>2020-03-17 16:20:00 -0400
committerentrpntr <entrpntr@gmail.com>2020-03-17 16:20:00 -0400
commite67786a7a26ae7531301e928870b204043fb8a6a (patch)
tree579c9e876fa2cd46c13ecceed0e8f0358e347131 /engine/events/bug_contest/caught_mon.asm
parentc248b30aa7487b51a9182a833b1db29f14a7267c (diff)
Cleanup of files for banks $02 and $03 for main.asm.
Diffstat (limited to 'engine/events/bug_contest/caught_mon.asm')
-rw-r--r--engine/events/bug_contest/caught_mon.asm37
1 files changed, 37 insertions, 0 deletions
diff --git a/engine/events/bug_contest/caught_mon.asm b/engine/events/bug_contest/caught_mon.asm
new file mode 100644
index 00000000..b2cc044a
--- /dev/null
+++ b/engine/events/bug_contest/caught_mon.asm
@@ -0,0 +1,37 @@
+BugContest_SetCaughtContestMon:
+ ld a, [wContestMon]
+ and a
+ jr z, .firstcatch
+ ld [wNamedObjectIndexBuffer], a
+ farcall DisplayAlreadyCaughtText
+ farcall DisplayCaughtContestMonStats
+ lb bc, 14, 7
+ call PlaceYesNoBox
+ ret c
+
+.firstcatch
+ call .generatestats
+ ld a, [wTempEnemyMonSpecies]
+ ld [wNamedObjectIndexBuffer], a
+ call GetPokemonName
+ ld hl, .ContestCaughtMonText
+ call PrintText
+ ret
+
+.generatestats
+ ld a, [wTempEnemyMonSpecies]
+ ld [wCurSpecies], a
+ ld [wCurPartySpecies], a
+ call GetBaseData
+ xor a
+ ld bc, PARTYMON_STRUCT_LENGTH
+ ld hl, wContestMon
+ call ByteFill
+ xor a
+ ld [wMonType], a
+ ld hl, wContestMon
+ jp GeneratePartyMonStats
+
+.ContestCaughtMonText:
+ text_far _ContestCaughtMonText
+ text_end