Merge pull request #1630 from BuffelSaft/disguise2

Fix many Disguise bugs
This commit is contained in:
DizzyEggg 2021-09-06 10:32:37 +02:00 committed by GitHub
commit cdec3077b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 8 deletions

View File

@ -2202,7 +2202,7 @@ BattleScript_EffectAbsorb::
waitmessage B_WAIT_TIME_LONG waitmessage B_WAIT_TIME_LONG
setdrainedhp setdrainedhp
manipulatedamage DMG_BIG_ROOT manipulatedamage DMG_BIG_ROOT
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_IGNORE_DISGUISE
jumpifability BS_TARGET, ABILITY_LIQUID_OOZE, BattleScript_AbsorbLiquidOoze jumpifability BS_TARGET, ABILITY_LIQUID_OOZE, BattleScript_AbsorbLiquidOoze
setbyte cMULTISTRING_CHOOSER, B_MSG_ABSORB setbyte cMULTISTRING_CHOOSER, B_MSG_ABSORB
goto BattleScript_AbsorbUpdateHp goto BattleScript_AbsorbUpdateHp
@ -2804,7 +2804,7 @@ BattleScript_MoveMissedDoDamage::
.else .else
bichalfword gMoveResultFlags, MOVE_RESULT_MISSED bichalfword gMoveResultFlags, MOVE_RESULT_MISSED
.endif .endif
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_IGNORE_DISGUISE
healthbarupdate BS_ATTACKER healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER datahpupdate BS_ATTACKER
tryfaintmon BS_ATTACKER, FALSE, NULL tryfaintmon BS_ATTACKER, FALSE, NULL
@ -6570,7 +6570,7 @@ BattleScript_MoveEffectRecoil::
jumpifmove MOVE_STRUGGLE, BattleScript_DoRecoil jumpifmove MOVE_STRUGGLE, BattleScript_DoRecoil
jumpifability BS_ATTACKER, ABILITY_ROCK_HEAD, BattleScript_RecoilEnd jumpifability BS_ATTACKER, ABILITY_ROCK_HEAD, BattleScript_RecoilEnd
BattleScript_DoRecoil:: BattleScript_DoRecoil::
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 | HITMARKER_IGNORE_DISGUISE
healthbarupdate BS_ATTACKER healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER datahpupdate BS_ATTACKER
printstring STRINGID_PKMNHITWITHRECOIL printstring STRINGID_PKMNHITWITHRECOIL
@ -7594,7 +7594,7 @@ BattleScript_AirBaloonMsgPop::
return return
BattleScript_ItemHurtRet:: BattleScript_ItemHurtRet::
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 | HITMARKER_IGNORE_DISGUISE
healthbarupdate BS_ATTACKER healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER datahpupdate BS_ATTACKER
printstring STRINGID_HURTBYITEM printstring STRINGID_HURTBYITEM
@ -7612,7 +7612,7 @@ BattleScript_ItemHealHP_Ret::
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL
printstring STRINGID_PKMNSITEMRESTOREDHPALITTLE printstring STRINGID_PKMNSITEMRESTOREDHPALITTLE
waitmessage B_WAIT_TIME_LONG waitmessage B_WAIT_TIME_LONG
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_IGNORE_DISGUISE
healthbarupdate BS_ATTACKER healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER datahpupdate BS_ATTACKER
return return

View File

@ -185,7 +185,8 @@
#define HITMARKER_IGNORE_SAFEGUARD (1 << 13) #define HITMARKER_IGNORE_SAFEGUARD (1 << 13)
#define HITMARKER_SYNCHRONISE_EFFECT (1 << 14) #define HITMARKER_SYNCHRONISE_EFFECT (1 << 14)
#define HITMARKER_RUN (1 << 15) #define HITMARKER_RUN (1 << 15)
// 3 free spots because of change in handling of UNDERGROUND/UNDERGWATER/ON AIR #define HITMARKER_IGNORE_DISGUISE (1 << 16)
// 3 free spots because of change in handling of UNDERGROUND/UNDERWATER/ON AIR
#define HITMARKER_UNABLE_TO_USE_MOVE (1 << 19) #define HITMARKER_UNABLE_TO_USE_MOVE (1 << 19)
#define HITMARKER_x100000 (1 << 20) #define HITMARKER_x100000 (1 << 20)
#define HITMARKER_x200000 (1 << 21) #define HITMARKER_x200000 (1 << 21)

View File

@ -11942,7 +11942,8 @@ bool32 DoesDisguiseBlockMove(u8 battlerAtk, u8 battlerDef, u32 move)
if (GetBattlerAbility(battlerDef) != ABILITY_DISGUISE if (GetBattlerAbility(battlerDef) != ABILITY_DISGUISE
|| gBattleMons[battlerDef].species != SPECIES_MIMIKYU || gBattleMons[battlerDef].species != SPECIES_MIMIKYU
|| gBattleMons[battlerDef].status2 & STATUS2_TRANSFORMED || gBattleMons[battlerDef].status2 & STATUS2_TRANSFORMED
|| gBattleMoves[move].power == 0) || gBattleMoves[move].power == 0
|| gHitMarker & HITMARKER_IGNORE_DISGUISE)
return FALSE; return FALSE;
else else
return TRUE; return TRUE;

View File

@ -859,7 +859,7 @@ void HandleAction_ActionFinished(void)
gHitMarker &= ~(HITMARKER_DESTINYBOND | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_ATTACKSTRING_PRINTED gHitMarker &= ~(HITMARKER_DESTINYBOND | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_ATTACKSTRING_PRINTED
| HITMARKER_NO_PPDEDUCT | HITMARKER_IGNORE_SAFEGUARD | HITMARKER_x100000 | HITMARKER_NO_PPDEDUCT | HITMARKER_IGNORE_SAFEGUARD | HITMARKER_x100000
| HITMARKER_OBEYS | HITMARKER_x10 | HITMARKER_SYNCHRONISE_EFFECT | HITMARKER_OBEYS | HITMARKER_x10 | HITMARKER_SYNCHRONISE_EFFECT
| HITMARKER_CHARGING | HITMARKER_x4000000); | HITMARKER_CHARGING | HITMARKER_x4000000 | HITMARKER_IGNORE_DISGUISE);
gCurrentMove = 0; gCurrentMove = 0;
gBattleMoveDamage = 0; gBattleMoveDamage = 0;