Fix Safety Googles

Fix typo and update gLastUsedItem before calling the safety goggles battle script.
This commit is contained in:
BuffelSaft 2021-10-09 15:05:01 +13:00
parent fbc4d7584e
commit 274e964d91
8 changed files with 18 additions and 17 deletions

View file

@ -6797,7 +6797,7 @@ BattleScript_PowderMoveNoEffect::
pause B_WAIT_TIME_SHORT
jumpiftype BS_TARGET, TYPE_GRASS, BattleScript_PowderMoveNoEffectPrint
jumpifability BS_TARGET, ABILITY_OVERCOAT, BattleScript_PowderMoveNoEffectOvercoat
printstring STRINGID_SAFETYGOOGLESPROTECTED
printstring STRINGID_SAFETYGOGGLESPROTECTED
goto BattleScript_PowderMoveNoEffectWaitMsg
BattleScript_PowderMoveNoEffectOvercoat:
call BattleScript_AbilityPopUp

View file

@ -523,7 +523,7 @@
#define STRINGID_GRASSYTERRAINHEALS 519
#define STRINGID_ELECTRICTERRAINPREVENTS 520
#define STRINGID_PSYCHICTERRAINPREVENTS 521
#define STRINGID_SAFETYGOOGLESPROTECTED 522
#define STRINGID_SAFETYGOGGLESPROTECTED 522
#define STRINGID_FLOWERVEILPROTECTED 523
#define STRINGID_SWEETVEILPROTECTED 524
#define STRINGID_AROMAVEILPROTECTED 525

View file

@ -130,7 +130,7 @@
// Gen6 hold effects
#define HOLD_EFFECT_FAIRY_POWER 139
#define HOLD_EFFECT_MEGA_STONE 140
#define HOLD_EFFECT_SAFETY_GOOGLES 141
#define HOLD_EFFECT_SAFETY_GOGGLES 141
#define HOLD_EFFECT_LUMINOUS_MOSS 142
#define HOLD_EFFECT_SNOWBALL 143
#define HOLD_EFFECT_WEAKNESS_POLICY 144

View file

@ -643,7 +643,7 @@ bool32 IsAffectedByPowder(u8 battler, u16 ability, u16 holdEffect)
{
if ((B_POWDER_GRASS >= GEN_6 && IS_BATTLER_OF_TYPE(battler, TYPE_GRASS))
|| ability == ABILITY_OVERCOAT
|| holdEffect == HOLD_EFFECT_SAFETY_GOOGLES)
|| holdEffect == HOLD_EFFECT_SAFETY_GOGGLES)
return FALSE;
return TRUE;
}
@ -1448,7 +1448,7 @@ bool32 ShouldSetSandstorm(u8 battler, u16 ability, u16 holdEffect)
|| ability == ABILITY_SAND_FORCE
|| ability == ABILITY_OVERCOAT
|| ability == ABILITY_MAGIC_GUARD
|| holdEffect == HOLD_EFFECT_SAFETY_GOOGLES
|| holdEffect == HOLD_EFFECT_SAFETY_GOGGLES
|| IS_BATTLER_OF_TYPE(battler, TYPE_ROCK)
|| IS_BATTLER_OF_TYPE(battler, TYPE_STEEL)
|| IS_BATTLER_OF_TYPE(battler, TYPE_GROUND)
@ -1473,7 +1473,7 @@ bool32 ShouldSetHail(u8 battler, u16 ability, u16 holdEffect)
|| ability == ABILITY_SLUSH_RUSH
|| ability == ABILITY_MAGIC_GUARD
|| ability == ABILITY_OVERCOAT
|| holdEffect == HOLD_EFFECT_SAFETY_GOOGLES
|| holdEffect == HOLD_EFFECT_SAFETY_GOGGLES
|| IS_BATTLER_OF_TYPE(battler, TYPE_ICE)
|| HasMove(battler, MOVE_BLIZZARD)
|| HasMoveEffect(battler, EFFECT_AURORA_VEIL)
@ -2273,7 +2273,7 @@ static u32 GetWeatherDamage(u8 battlerId)
{
if (BattlerAffectedBySandstorm(battlerId, ability)
&& !(gStatuses3[battlerId] & (STATUS3_UNDERGROUND | STATUS3_UNDERWATER))
&& holdEffect != HOLD_EFFECT_SAFETY_GOOGLES)
&& holdEffect != HOLD_EFFECT_SAFETY_GOGGLES)
{
damage = gBattleMons[battlerId].maxHP / 16;
if (damage == 0)
@ -2284,7 +2284,7 @@ static u32 GetWeatherDamage(u8 battlerId)
{
if (BattlerAffectedByHail(battlerId, ability)
&& !(gStatuses3[battlerId] & (STATUS3_UNDERGROUND | STATUS3_UNDERWATER))
&& holdEffect != HOLD_EFFECT_SAFETY_GOOGLES)
&& holdEffect != HOLD_EFFECT_SAFETY_GOGGLES)
{
damage = gBattleMons[battlerId].maxHP / 16;
if (damage == 0)

View file

@ -1951,7 +1951,7 @@ static const u8 sText_HoldEffectAbsorbBulb[] = _("Absorb Bulb");
static const u8 sText_HoldEffectCellBattery[] = _("Cell Battery");
static const u8 sText_HoldEffectFairyPower[] = _("Fairy Power");
static const u8 sText_HoldEffectMegaStone[] = _("Mega Stone");
static const u8 sText_HoldEffectSafetyGoogles[] = _("Safety Googles");
static const u8 sText_HoldEffectSafetyGoggles[] = _("Safety Goggles");
static const u8 sText_HoldEffectLuminousMoss[] = _("Luminous Moss");
static const u8 sText_HoldEffectSnowball[] = _("Snowball");
static const u8 sText_HoldEffectWeaknessPolicy[] = _("Weakness Policy");
@ -2091,7 +2091,7 @@ static const u8 *const sHoldEffectNames[] =
[HOLD_EFFECT_CELL_BATTERY] = sText_HoldEffectCellBattery,
[HOLD_EFFECT_FAIRY_POWER] = sText_HoldEffectFairyPower,
[HOLD_EFFECT_MEGA_STONE] = sText_HoldEffectMegaStone,
[HOLD_EFFECT_SAFETY_GOOGLES] = sText_HoldEffectSafetyGoogles,
[HOLD_EFFECT_SAFETY_GOGGLES] = sText_HoldEffectSafetyGoggles,
[HOLD_EFFECT_LUMINOUS_MOSS] = sText_HoldEffectLuminousMoss,
[HOLD_EFFECT_SNOWBALL] = sText_HoldEffectSnowball,
[HOLD_EFFECT_WEAKNESS_POLICY] = sText_HoldEffectWeaknessPolicy,

View file

@ -653,7 +653,7 @@ static const u8 sText_MistyTerrainPreventsStatus[] = _("{B_DEF_NAME_WITH_PREFIX}
static const u8 sText_GrassyTerrainHeals[] = _("{B_ATK_NAME_WITH_PREFIX} is healed\nby the grassy terrain!");
static const u8 sText_ElectricTerrainPreventsSleep[] = _("{B_DEF_NAME_WITH_PREFIX} surrounds itself\nwith electrified terrain!");
static const u8 sText_PsychicTerrainPreventsPriority[] = _("{B_DEF_NAME_WITH_PREFIX} surrounds itself\nwith psychic terrain!");
static const u8 sText_SafetyGooglesProtected[] = _("{B_DEF_NAME_WITH_PREFIX} is not affected\nthanks to its {B_LAST_ITEM}!");
static const u8 sText_SafetyGogglesProtected[] = _("{B_DEF_NAME_WITH_PREFIX} is not affected\nthanks to its {B_LAST_ITEM}!");
static const u8 sText_FlowerVeilProtected[] = _("{B_DEF_NAME_WITH_PREFIX} surrounded itself\nwith a veil of petals!");
static const u8 sText_SweetVeilProtected[] = _("{B_DEF_NAME_WITH_PREFIX} surrounded itself\nwith a veil of sweetness!");
static const u8 sText_AromaVeilProtected[] = _("{B_DEF_NAME_WITH_PREFIX} is protected\nby an aromatic veil!");
@ -780,7 +780,7 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
[STRINGID_AROMAVEILPROTECTED - 12] = sText_AromaVeilProtected,
[STRINGID_SWEETVEILPROTECTED - 12] = sText_SweetVeilProtected,
[STRINGID_FLOWERVEILPROTECTED - 12] = sText_FlowerVeilProtected,
[STRINGID_SAFETYGOOGLESPROTECTED - 12] = sText_SafetyGooglesProtected,
[STRINGID_SAFETYGOGGLESPROTECTED - 12] = sText_SafetyGogglesProtected,
[STRINGID_SPECTRALTHIEFSTEAL - 12] = sText_SpectralThiefSteal,
[STRINGID_BELCHCANTSELECT - 12] = sText_BelchCantUse,
[STRINGID_TRAINER1LOSETEXT - 12] = sText_Trainer1LoseText,

View file

@ -10129,7 +10129,7 @@ static void Cmd_weatherdamage(void)
&& ability != ABILITY_SAND_RUSH
&& ability != ABILITY_OVERCOAT
&& !(gStatuses3[gBattlerAttacker] & (STATUS3_UNDERGROUND | STATUS3_UNDERWATER))
&& GetBattlerHoldEffect(gBattlerAttacker, TRUE) != HOLD_EFFECT_SAFETY_GOOGLES)
&& GetBattlerHoldEffect(gBattlerAttacker, TRUE) != HOLD_EFFECT_SAFETY_GOGGLES)
{
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 16;
if (gBattleMoveDamage == 0)
@ -10154,7 +10154,7 @@ static void Cmd_weatherdamage(void)
&& ability != ABILITY_OVERCOAT
&& ability != ABILITY_ICE_BODY
&& !(gStatuses3[gBattlerAttacker] & (STATUS3_UNDERGROUND | STATUS3_UNDERWATER))
&& GetBattlerHoldEffect(gBattlerAttacker, TRUE) != HOLD_EFFECT_SAFETY_GOOGLES)
&& GetBattlerHoldEffect(gBattlerAttacker, TRUE) != HOLD_EFFECT_SAFETY_GOGGLES)
{
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 16;
if (gBattleMoveDamage == 0)

View file

@ -3386,9 +3386,10 @@ u8 AtkCanceller_UnableToUseMove(void)
gBattlerAbility = gBattlerTarget;
effect = 1;
}
else if (GetBattlerHoldEffect(gBattlerTarget, TRUE) == HOLD_EFFECT_SAFETY_GOOGLES)
else if (GetBattlerHoldEffect(gBattlerTarget, TRUE) == HOLD_EFFECT_SAFETY_GOGGLES)
{
RecordItemEffectBattle(gBattlerTarget, HOLD_EFFECT_SAFETY_GOOGLES);
RecordItemEffectBattle(gBattlerTarget, HOLD_EFFECT_SAFETY_GOGGLES);
gLastUsedItem = gBattleMons[gBattlerTarget].item;
effect = 1;
}
@ -4882,7 +4883,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
case ABILITY_EFFECT_SPORE:
if (!IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_GRASS)
&& GetBattlerAbility(gBattlerAttacker) != ABILITY_OVERCOAT
&& GetBattlerHoldEffect(gBattlerAttacker, TRUE) != HOLD_EFFECT_SAFETY_GOOGLES)
&& GetBattlerHoldEffect(gBattlerAttacker, TRUE) != HOLD_EFFECT_SAFETY_GOGGLES)
{
i = Random() % 3;
if (i == 0)