Acid effect and CheckNoDamageOrEffect

This commit is contained in:
xCrystal
2016-09-17 22:20:34 +02:00
parent 3d80668e91
commit 2163db9ef2
6 changed files with 89 additions and 17 deletions
+10 -9
View File
@@ -71,15 +71,16 @@ SUBSTATUS1_NO_DAMAGE_17 EQU $17
SUBSTATUS1_NEXT_TURN_DOUBLE_DAMAGE EQU $19
SUBSTATUS1_REDUCE_BY_10 EQU $1e
SUBSTATUS2_SMOKESCREEN EQU $01
SUBSTATUS2_SAND_ATTACK EQU $02
SUBSTATUS2_REDUCE_BY_20 EQU $03
SUBSTATUS2_AMNESIA EQU $04
SUBSTATUS2_TAIL_WAG EQU $05
SUBSTATUS2_LEER EQU $06
SUBSTATUS2_POUNCE EQU $07
SUBSTATUS2_BONE_ATTACK EQU $0b
SUBSTATUS2_GROWL EQU $12
SUBSTATUS2_SMOKESCREEN EQU $01
SUBSTATUS2_SAND_ATTACK EQU $02
SUBSTATUS2_REDUCE_BY_20 EQU $03
SUBSTATUS2_AMNESIA EQU $04
SUBSTATUS2_TAIL_WAG EQU $05
SUBSTATUS2_LEER EQU $06
SUBSTATUS2_POUNCE EQU $07
SUBSTATUS2_UNABLE_RETREAT EQU $09
SUBSTATUS2_BONE_ATTACK EQU $0b
SUBSTATUS2_GROWL EQU $12
SUBSTATUS5_THIS_TURN_DOUBLE_DAMAGE EQU 0
+1 -1
View File
@@ -47,7 +47,7 @@ VictreebelLureEffectCommands:
db $00
VictreebelAcidEffectCommands:
dbw $03, $477e
dbw $03, AcidEffect
db $00
PinsirIronGripEffectCommands:
+39 -2
View File
@@ -94,7 +94,33 @@ Func_2c09c: ; 2c09c (b:409c)
ret
; 0x2c0a2
INCBIN "baserom.gbc",$2c0a2,$2c6f8 - $2c0a2
INCBIN "baserom.gbc",$2c0a2,$2c149 - $2c0a2
; apply a status condition identified by register a to the target if able
ApplySubstatus2ToDefendingCard: ; 2c149 (b:4149)
push af
call CheckNoDamageOrEffect
jr c, .noDamageOrEffect
ld a, DUELVARS_ARENA_CARD_SUBSTATUS2
call GetNonTurnDuelistVariable
pop af
ld [hl], a
ld l, $f6
ld [hl], a
ret
.noDamageOrEffect
pop af
push hl
bank1call $4f9d
pop hl
ld a, l
or h
call nz, DrawWideTextBox_PrintText
ret
; 0x2c166
INCBIN "baserom.gbc",$2c166,$2c6f8 - $2c166
SpitPoison_Poison50PercentEffect: ; 2c6f8 (b:46f8)
text_de PoisonCheckText
@@ -106,4 +132,15 @@ SpitPoison_Poison50PercentEffect: ; 2c6f8 (b:46f8)
ret
; 0x2c70a
INCBIN "baserom.gbc",$2c70a,$30000 - $2c70a
INCBIN "baserom.gbc",$2c70a,$2c77e - $2c70a
AcidEffect: ; 2c77e (b:477e)
text_de AcidCheckText
call TossCoin_BankB
ret nc
ld a, SUBSTATUS2_UNABLE_RETREAT
call ApplySubstatus2ToDefendingCard
ret
; 0x2c78b
INCBIN "baserom.gbc",$2c78b,$30000 - $2c78b
+37 -3
View File
@@ -3160,10 +3160,10 @@ ApplyAttachedDefender: ; 1a7e (0:1a7e)
ld d, a
ret
SubstractHP: ; 1a96 (0:1a96)
; 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
ld a, [hl]
@@ -6475,7 +6475,41 @@ HandleTransparency: ; 348a (0:348a)
ret
; 0x34b7
INCBIN "baserom.gbc",$34b7,$34e2 - $34b7
; return carry and return the appropriate text pointer in hl if the target has an
; special status or power that prevents any damage or effect done to it this turn
CheckNoDamageOrEffect: ; 34b7 (0:34b7)
ld a, [wNoDamageOrEffect]
or a
ret z
bit 7, a
jr nz, .dontPrintText ; already been here so don't repeat the text
ld hl, wNoDamageOrEffect
set 7, [hl]
dec a
add a
ld e, a
ld d, $0
ld hl, NoDamageOrEffectTextPointerTable
add hl, de
ld a, [hli]
ld h, [hl]
ld l, a
scf
ret
.dontPrintText
ld hl, $0000
scf
ret
; 0x34d8
NoDamageOrEffectTextPointerTable: ; 34d8 (0:34d8)
tx NoDamageOrEffectDueToAgilityText ; NO_DAMAGE_OR_EFFECT_AGILITY
tx NoDamageOrEffectDueToBarrierText ; NO_DAMAGE_OR_EFFECT_BARRIER
tx NoDamageOrEffectDueToFlyText ; NO_DAMAGE_OR_EFFECT_FLY
tx NoDamageOrEffectDueToTransparencyText ; NO_DAMAGE_OR_EFFECT_TRANSPARENCY
tx NoDamageOrEffectDueToNShieldText ; NO_DAMAGE_OR_EFFECT_NSHIELD
; 0x34e2
Func_34e2: ; 34e2 (0:34e2)
ld a, $27
+1 -1
View File
@@ -1,4 +1,4 @@
Text00f5: ; 38000 (e:4000)
AcidCheckText: ; 38000 (e:4000)
text "Acid check! If Heads,"
line "unable to Retreat during next turn."
done
+1 -1
View File
@@ -247,7 +247,7 @@ TextOffsets:: ; 34000 (d:4000)
textpointer Text00f2
textpointer Text00f3
textpointer Text00f4
textpointer Text00f5
textpointer AcidCheckText
textpointer Text00f6
textpointer Text00f7
textpointer Text00f8