summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/constants/duel_constants.asm11
-rw-r--r--src/data/effect_commands.asm2
-rw-r--r--src/engine/bank01.asm52
-rw-r--r--src/engine/bank03.asm59
-rw-r--r--src/engine/bank06.asm8
-rw-r--r--src/engine/effect_functions.asm33
-rw-r--r--src/wram.asm8
7 files changed, 160 insertions, 13 deletions
diff --git a/src/constants/duel_constants.asm b/src/constants/duel_constants.asm
index 344cff1..28199e5 100644
--- a/src/constants/duel_constants.asm
+++ b/src/constants/duel_constants.asm
@@ -118,8 +118,15 @@ PARALYZED EQU $03
POISONED EQU $80
DOUBLE_POISONED EQU $c0
-CNF_SLP_PRZ EQU $0f ; confused, asleep or paralyzed
-PSN_DBLPSN EQU $f0 ; poisoned or double poisoned
+
+DOUBLE_POISONED_F EQU 6
+POISONED_F EQU 7
+
+
+CNF_SLP_PRZ EQU $0f ; confused, asleep or paralyzed
+PSN_DBLPSN EQU $f0 ; poisoned or double poisoned
+PSN_DAMAGE EQU 10
+DBLPSN_DAMAGE EQU 20
; substatus conditions (DUELVARS_ARENA_CARD_SUBSTATUS*)
diff --git a/src/data/effect_commands.asm b/src/data/effect_commands.asm
index 171c241..7360aff 100644
--- a/src/data/effect_commands.asm
+++ b/src/data/effect_commands.asm
@@ -1491,7 +1491,7 @@ FullHealEffectCommands:
db $00
ImposterProfessorOakEffectCommands:
- dbw EFFECTCMDTYPE_BEFORE_DAMAGE, $74e1
+ dbw EFFECTCMDTYPE_BEFORE_DAMAGE, ImposterProfessorOakEffect
db $00
ComputerSearchEffectCommands:
diff --git a/src/engine/bank01.asm b/src/engine/bank01.asm
index 090ecf0..1c003e2 100644
--- a/src/engine/bank01.asm
+++ b/src/engine/bank01.asm
@@ -6973,7 +6973,7 @@ HandleBetweenTurnsEvents: ; 6baf (1:6baf)
ld a, [hl]
or a
jr z, .asm_6c1a
- call $6d3f
+ call Func_6d3f
jr c, .asm_6c1a
call Func_6cfa
ld a, [hl]
@@ -7001,7 +7001,7 @@ HandleBetweenTurnsEvents: ; 6baf (1:6baf)
ld a, [hl]
or a
jr z, .asm_6c3a
- call $6d3f
+ call Func_6d3f
jr c, .asm_6c3a
call Func_6cfa
.asm_6c3a
@@ -7172,7 +7172,45 @@ Func_6cfa: ; 6cfa (1:6cfa)
ret
; 0x6d3f
- INCROM $6d3f, $6d84
+Func_6d3f: ; 6d3f (1:6d3f)
+ or a
+ bit POISONED_F , [hl]
+ ret z
+ push hl
+ bit DOUBLE_POISONED_F, [hl]
+ ld a, PSN_DAMAGE
+ ldtx hl, Received10DamageDueToPoisonText
+ jr z, .not_double_poisoned
+ ld a, DBLPSN_DAMAGE
+ ldtx hl, Received20DamageDueToPoisonText
+.not_double_poisoned
+ push af
+ ld [wd4b1], a
+ xor a
+ ld [wd4b2], a
+ push hl
+ call Func_6c7e
+ pop hl
+ call Func_6ce4
+ ld a, $05
+ call Func_6cab
+ pop af
+ ld e, a
+ ld d, $00
+ ld a, DUELVARS_ARENA_CARD_HP
+ call GetTurnDuelistVariable
+ call SubstractHP
+ push hl
+ ld a, $8c
+ call Func_6cab
+ pop hl
+ call PrintKnockedOutIfHLZero
+ push af
+ call WaitForWideTextBoxInput
+ pop af
+ pop hl
+ ret
+; 0x6d84
; given the deck index of a turn holder's card in register a,
; and a pointer in hl to the wLoadedCard* buffer where the card data is loaded,
@@ -8254,7 +8292,9 @@ PlayMoveAnimation: ; 7494 (1:7494)
INCROM $74dc, $7571
Func_7571: ; 7571 (1:7571)
- INCROM $7571, $7576
+ farcall Func_19c20
+ ret
+; 0x7576
Func_7576: ; 7576 (1:7576)
farcall Func_1991f
@@ -8264,7 +8304,9 @@ Func_7576: ; 7576 (1:7576)
INCROM $757b, $758f
Func_758f: ; 758f (1:758f)
- INCROM $758f, $7594
+ farcall Func_1a4cf
+ ret
+; 0x7594
Func_7594: ; 7594 (1:7594)
farcall Func_1a61f
diff --git a/src/engine/bank03.asm b/src/engine/bank03.asm
index c2af707..4925b76 100644
--- a/src/engine/bank03.asm
+++ b/src/engine/bank03.asm
@@ -3416,7 +3416,50 @@ Script_d827: ; d827 (3:5827)
run_command ScriptCommand_QuitScriptFully
; 0xd82d
- INCROM $d82d, $d880
+ INCROM $d82d, $d834
+
+AfterTutorialBattleScript: ; d834 (3:5834)
+ start_script
+ run_command ScriptCommand_PrintTextString
+ tx Text05eb
+ run_command ScriptCommand_PrintTextString
+ tx Text05ef
+ run_command ScriptCommand_CloseTextBox
+ run_command ScriptCommand_MoveActiveNPC
+ dw NPCMovement_d896
+ run_command ScriptCommand_SetPlayerDirection
+ db NORTH
+ run_command ScriptCommand_MovePlayer
+ db NORTH
+ db $01
+ run_command ScriptCommand_MovePlayer
+ db NORTH
+ db $01
+ run_command ScriptCommand_MovePlayer
+ db NORTH
+ db $01
+ run_command ScriptCommand_SetPlayerDirection
+ db EAST
+ run_command ScriptCommand_MovePlayer
+ db EAST
+ db $01
+ run_command ScriptCommand_MovePlayer
+ db EAST
+ db $01
+ run_command ScriptCommand_SetPlayerDirection
+ db NORTH
+ run_command ScriptCommand_PrintTextString
+ tx Text05f0
+ run_command ScriptCommand_CloseTextBox
+ run_command Func_ccdc
+ tx Text05f1
+ run_command ScriptCommand_CloseTextBox
+ run_command ScriptCommand_PrintTextString
+ tx Text05f2
+ run_command Func_d271
+; 0xd860
+
+ INCROM $d860, $d880
NPCMovement_d880: ; d880 (3:5880)
db EAST
@@ -3447,8 +3490,20 @@ NPCMovement_d88b: ; d88b (3:588b)
NPCMovement_d894: ; d894 (4:5894)
db SOUTH | NO_MOVE
db $ff
+
+NPCMovement_d896: ; d896 (3:5896)
+ db NORTH
+ db NORTH
+ db NORTH
+ db EAST
+ db EAST
+ db EAST
+ db EAST
+ db SOUTH | NO_MOVE
+ db $ff
+; 0xd89f
- INCROM $d896, $d932
+ INCROM $d89f, $d932
Script_d932: ; d932 (3:5932)
start_script
diff --git a/src/engine/bank06.asm b/src/engine/bank06.asm
index 19f5e1f..d3aa46a 100644
--- a/src/engine/bank06.asm
+++ b/src/engine/bank06.asm
@@ -1523,7 +1523,13 @@ Func_19a12: ; 19a12 (6:5a12)
ret
; 0x19a1f
- INCROM $19a1f, $1a61f
+ INCROM $19a1f, $19c20
+
+Func_19c20: ; 19c20 (6:5c20)
+ INCROM $19c20, $1a4cf
+
+Func_1a4cf: ; 1a4cf (6:64cf)
+ INCROM $1a4cf, $1a61f
Func_1a61f: ; 1a61f (6:661f)
push af
diff --git a/src/engine/effect_functions.asm b/src/engine/effect_functions.asm
index 75b0f76..dae33a0 100644
--- a/src/engine/effect_functions.asm
+++ b/src/engine/effect_functions.asm
@@ -763,4 +763,35 @@ Func_2cbfb: ; 2cbfb (b:4bfb)
ret
; 0x2cc0a
- INCROM $2cc0a, $30000
+ INCROM $2cc0a, $2f4e1
+
+ImposterProfessorOakEffect: ; 2f4e1 (b:74e1)
+ call SwapTurn
+ call CreateHandCardList
+ call SortCardsInDuelTempListByID
+ ld hl, wDuelTempList
+.return_hand_to_deck_loop
+ ld a, [hli]
+ cp $ff
+ jr z, .shuffle
+ call RemoveCardFromHand
+ call ReturnCardToDeck
+ jr .return_hand_to_deck_loop
+.shuffle
+ call Func_2c0bd
+ ld a, $07
+ bank1call $4935
+ ld c, $07
+.draw_loop
+ call DrawCardFromDeck
+ jr c, .revert_turn_to_user
+ call AddCardToHand
+ dec c
+ jr nz, .draw_loop
+.revert_turn_to_user
+ call SwapTurn
+ ret
+; 0x2f513
+
+
+ INCROM $2f513, $30000
diff --git a/src/wram.asm b/src/wram.asm
index ba61151..15a6e1a 100644
--- a/src/wram.asm
+++ b/src/wram.asm
@@ -2319,7 +2319,13 @@ wd4af:: ; d4af
wd4b0:: ; d4b0
ds $1
- ds $d
+wd4b1:: ; d4b1
+ ds $1
+
+wd4b2:: ; d4b2
+ ds $1
+
+ ds $b
wd4be:: ; d4be
ds $1