summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/data/effect_commands.asm8
-rw-r--r--src/engine/effect_functions.asm40
-rw-r--r--src/text/text1.asm2
-rw-r--r--src/text/text_offsets.asm2
4 files changed, 45 insertions, 7 deletions
diff --git a/src/data/effect_commands.asm b/src/data/effect_commands.asm
index 60d2004..952e895 100644
--- a/src/data/effect_commands.asm
+++ b/src/data/effect_commands.asm
@@ -161,10 +161,10 @@ OddishSproutEffectCommands:
db $00
ExeggutorTeleportEffectCommands:
- dbw EFFECTCMDTYPE_INITIAL_EFFECT_1, $48ec
- dbw EFFECTCMDTYPE_AFTER_DAMAGE, $491a
- dbw EFFECTCMDTYPE_REQUIRE_SELECTION, $48f7
- dbw EFFECTCMDTYPE_UNKNOWN_08, $490f
+ dbw EFFECTCMDTYPE_INITIAL_EFFECT_1, TeleportEffect_CheckBench
+ dbw EFFECTCMDTYPE_AFTER_DAMAGE, TeleportEffect_SwitchEffect
+ dbw EFFECTCMDTYPE_REQUIRE_SELECTION, TeleportEffect_PlayerSelect
+ dbw EFFECTCMDTYPE_UNKNOWN_08, TeleportEffect_AISelect
db $00
ExeggutorBigEggsplosionEffectCommands:
diff --git a/src/engine/effect_functions.asm b/src/engine/effect_functions.asm
index 839c814..5426f29 100644
--- a/src/engine/effect_functions.asm
+++ b/src/engine/effect_functions.asm
@@ -1056,7 +1056,45 @@ SproutEffect_PutInPlayArea: ; 2c8cc (b:48cc)
ret
; 0x2c8ec
- INCROM $2c8ec, $2c925
+; returns carry if no Pokemon on Bench
+TeleportEffect_CheckBench: ; 2c8ec (b:48ec)
+ ld a, DUELVARS_NUMBER_OF_POKEMON_IN_PLAY_AREA
+ call GetTurnDuelistVariable
+ ldtx hl, ThereAreNoPokemonOnBenchText
+ cp 2
+ ret
+; 0x2c8f7
+
+TeleportEffect_PlayerSelect: ; 2c8f7 (b:48f7)
+ ldtx hl, SelectPkmnOnBenchToSwitchWithActiveText
+ call DrawWideTextBox_WaitForInput
+ bank1call HasAlivePokemonInBench
+ ld a, $01
+ ld [wcbd4], a
+.loop
+ bank1call OpenPlayAreaScreenForSelection
+ jr c, .loop
+ ldh a, [hTempPlayAreaLocation_ff9d]
+ ldh [hTemp_ffa0], a
+ ret
+; 0x2c90f
+
+TeleportEffect_AISelect: ; 2c90f (b:490f)
+ ld a, DUELVARS_NUMBER_OF_POKEMON_IN_PLAY_AREA
+ call GetTurnDuelistVariable
+ call Random
+ ldh [hTemp_ffa0], a
+ ret
+; 0x2c91a
+
+TeleportEffect_SwitchEffect: ; 2c91a (b:491a)
+ ldh a, [hTemp_ffa0]
+ ld e, a
+ call SwapArenaWithBenchPokemon
+ xor a
+ ld [wDuelDisplayedScreen], a
+ ret
+; 0x2c925
BigEggsplosion_AIEffect: ; 2c925 (b:4925)
ldh a, [hTempPlayAreaLocation_ff9d]
diff --git a/src/text/text1.asm b/src/text/text1.asm
index 46bb72d..ff07f9d 100644
--- a/src/text/text1.asm
+++ b/src/text/text1.asm
@@ -981,7 +981,7 @@ Text00d1: ; 379ae (d:79ae)
text "Can only be used on the Bench."
done
-Text00d2: ; 379ce (d:79ce)
+ThereAreNoPokemonOnBenchText: ; 379ce (d:79ce)
text "There are no Pokémon on the Bench."
done
diff --git a/src/text/text_offsets.asm b/src/text/text_offsets.asm
index 941f9ae..bc9d545 100644
--- a/src/text/text_offsets.asm
+++ b/src/text/text_offsets.asm
@@ -211,7 +211,7 @@ TextOffsets:: ; 34000 (d:4000)
textpointer Text00cf ; 0x00cf
textpointer Text00d0 ; 0x00d0
textpointer Text00d1 ; 0x00d1
- textpointer Text00d2 ; 0x00d2
+ textpointer ThereAreNoPokemonOnBenchText ; 0x00d2
textpointer Text00d3 ; 0x00d3
textpointer UnableDueToToxicGasText ; 0x00d4
textpointer Text00d5 ; 0x00d5