diff options
author | xCrystal <rgr.crystal@gmail.com> | 2016-09-18 12:27:17 +0200 |
---|---|---|
committer | xCrystal <rgr.crystal@gmail.com> | 2016-09-18 12:27:17 +0200 |
commit | 3f1c669c23c9160e086ce1165c5aa9bedb49c45b (patch) | |
tree | 827204b86b503cd25b4149a54ab4140cb4f646cc /src/engine | |
parent | 2163db9ef29abe6507a1da4c8e77fe8d3fd77df2 (diff) |
Foul Odor and Stiffen effects
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/effect_functions.asm | 61 | ||||
-rwxr-xr-x | src/engine/home.asm | 24 |
2 files changed, 71 insertions, 14 deletions
diff --git a/src/engine/effect_functions.asm b/src/engine/effect_functions.asm index a7d44d1..5034151 100644 --- a/src/engine/effect_functions.asm +++ b/src/engine/effect_functions.asm @@ -21,6 +21,8 @@ Confusion50PercentEffect: ; 2c01d (b:401d) text_de ConfusionCheckText call TossCoin_BankB ret nc + +ConfusionEffect: ; 2c024 (b:4024) lb bc, $f0, CONFUSED jr applyEffect @@ -94,9 +96,26 @@ Func_2c09c: ; 2c09c (b:409c) ret ; 0x2c0a2 -INCBIN "baserom.gbc",$2c0a2,$2c149 - $2c0a2 +Func_2c0a2: ; 2c0a2 (b:40a2) + ld a, $2 + ld [wcced], a + ret +; 0x2c0a8 + +INCBIN "baserom.gbc",$2c0a8,$2c140 - $2c0a8 + +; apply a status condition of type 1 identified by register a to the target +ApplySubstatus1ToDefendingCard: ; 2c140 (b:4140) + push af + ld a, DUELVARS_ARENA_CARD_SUBSTATUS1 + call GetTurnDuelistVariable + pop af + ld [hli], a + ret +; 0x2c149 -; apply a status condition identified by register a to the target if able +; apply a status condition of type 2 identified by register a to the target, +; unless prevented by wNoDamageOrEffect ApplySubstatus2ToDefendingCard: ; 2c149 (b:4149) push af call CheckNoDamageOrEffect @@ -143,4 +162,40 @@ AcidEffect: ; 2c77e (b:477e) ret ; 0x2c78b -INCBIN "baserom.gbc",$2c78b,$30000 - $2c78b +INCBIN "baserom.gbc",$2c78b,$2c793 - $2c78b + +; confuses both the target and the user +FoulOdorEffect: ; 2c793 (b:4793) + call ConfusionEffect + call SwapTurn + call ConfusionEffect + call SwapTurn + ret +; 0x2c7a0 + +KakunaStiffenEffect: ; 2c7a0 (b:47a0) + text_de IfHeadsNoDamageNextTurnText + call TossCoin_BankB + jp nc, Func_2c0a2 + ld a, $4f + ld [wLoadedMoveAnimation], a + ld a, SUBSTATUS1_NO_DAMAGE_STIFFEN + call ApplySubstatus1ToDefendingCard + ret +; 0x2c7b4 + +INCBIN "baserom.gbc",$2c7b4,$2c836 - $2c7b4 + +; an exact copy of KakunaStiffenEffect +MetapodStiffenEffect: ; 2c836 (b:4836) + text_de IfHeadsNoDamageNextTurnText + call TossCoin_BankB + jp nc, Func_2c0a2 + ld a, $4f + ld [wLoadedMoveAnimation], a + ld a, SUBSTATUS1_NO_DAMAGE_STIFFEN + call ApplySubstatus1ToDefendingCard + ret +; 0x2c84a + +INCBIN "baserom.gbc",$2c84a,$30000 - $2c84a diff --git a/src/engine/home.asm b/src/engine/home.asm index e4dfde8..5c687db 100755 --- a/src/engine/home.asm +++ b/src/engine/home.asm @@ -2339,7 +2339,7 @@ CreateHandCardBuffer: ; 123b (0:123b) .checkNextCardLoop ld a, [hld] push hl - ld l, a + ld l, a bit 6, [hl] pop hl jr nz, .skipCard @@ -3162,7 +3162,7 @@ ApplyAttachedDefender: ; 1a7e (0:1a7e) ; hl: address to substract HP from ; de: how much HP to substract (damage to deal) -; returns carry if the HP does not become 0 as a result +; returns carry if the HP does not become 0 as a result SubstractHP: ; 1a96 (0:1a96) push hl push de @@ -5726,9 +5726,11 @@ Func_2fcb: ; 2fcb (0:2fcb) call BankpopHome ret -; Checks if the command ID at a is one of the commands of the move or card effect currently in use, +; Checks if the command type at a is one of the commands of the move or card effect currently in use, ; and executes its associated function if so. -; input: a = move or trainer card effect command ID +; input: +; a = command type to check +; [wLoadedMoveEffectCommands] = pointer to list of commands of current move or trainer card TryExecuteEffectCommandFunction: ; 2fd9 (0:2fd9) push af ; grab pointer to command list from wLoadedMoveEffectCommands @@ -5739,7 +5741,7 @@ TryExecuteEffectCommandFunction: ; 2fd9 (0:2fd9) pop af call CheckMatchingCommand jr nc, .executeFunction -; return if input command ID wasn't found +; return if no matching command was found or a ret @@ -5761,9 +5763,9 @@ TryExecuteEffectCommandFunction: ; 2fd9 (0:2fd9) ret ; input: - ; a = command ID to check - ; hl = pointer to current move effect or trainer card effect command list -; return nc if command ID matching a is found, c otherwise + ; a = command type to check + ; hl = list of commands of current move or trainer card +; return nc if command type matching a is found, c otherwise CheckMatchingCommand: ; 2ffe (0:2ffe) ld c, a ld a, l @@ -6235,7 +6237,7 @@ HandleDamageReductionExceptSubstatus2: ; 3269 (0:3269) call GetTurnDuelistVariable or a jr z, .notAffectedBySubstatus1 - cp SUBSTATUS1_NO_DAMAGE_F + cp SUBSTATUS1_NO_DAMAGE_STIFFEN jr z, .noDamage cp SUBSTATUS1_NO_DAMAGE_10 jr z, .noDamage @@ -6448,7 +6450,7 @@ HandleNoDamageOrEffectSubstatus: ; 3432 (0:3432) jr .noDamageOrEffect ; if the Pokemon being attacked is Haunter1, and its Transparency is active, -; there is a 50% chance that any damage or effect is prevented +; there is a 50% chance that any damage or effect is prevented HandleTransparency: ; 348a (0:348a) ld a, [wTempNonTurnDuelistCardId] cp HAUNTER1 @@ -7295,7 +7297,7 @@ RunOverworldScript: ; 3aed (0:3aed) rlca ld c, a ld b, $0 - ld hl, OverworldScriptTable + ld hl, OverworldScriptTable add hl, bc ldh a, [hBankROM] push af |