Skip to content

Commit

Permalink
Implemented Unaware. Also, Unburden is NOT a placeholder.
Browse files Browse the repository at this point in the history
  • Loading branch information
LOuroboros committed May 26, 2019
1 parent 0319f5f commit d2c02d4
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 8 deletions.
6 changes: 3 additions & 3 deletions data/text/ability_descriptions.inc
Expand Up @@ -367,8 +367,8 @@ gAbilityDescription_Technician:
gAbilityDescription_TintedLens:
.string "Ups “not very effective“.$"

gAbilityDescription_Unaware: @ Placeholder
.string "Placeholder text.$"
gAbilityDescription_Unaware:
.string "Ignores some stat changes.$"

gAbilityDescription_Unburden:
.string "Lack of hold item ups SPD.$"
Expand Down Expand Up @@ -498,5 +498,5 @@ gAbilityDescriptions:: @ 81FA110
.4byte gAbilityDescription_TangledFeet
.4byte gAbilityDescription_Technician
.4byte gAbilityDescription_TintedLens
.4byte gAbilityDescription_Unaware @ Placeholder
.4byte gAbilityDescription_Unaware
.4byte gAbilityDescription_Unburden
4 changes: 2 additions & 2 deletions data/text/ability_names.inc
Expand Up @@ -122,5 +122,5 @@ gAbilityNames:: @ 81FA248
.string "TANGLED FEET$", 13
.string "TECHNICIAN$", 13
.string "TINTED LENS$", 13
.string "UNAWARE$", 13 @ Placeholder
.string "UNBURDEN$", 13 @ Placeholder
.string "UNAWARE$", 13
.string "UNBURDEN$", 13
4 changes: 2 additions & 2 deletions include/constants/abilities.h
Expand Up @@ -99,7 +99,7 @@
#define ABILITY_ICE_BODY 93
#define ABILITY_IRON_FIST 94
#define ABILITY_KLUTZ 95 // Placeholder
#define ABILITY_LEAF_GUARD 96 // Placeholder
#define ABILITY_LEAF_GUARD 96 // Placeholder. This ability will be ignored for now. Pokeruby still relies on ASM for certain functions in battle_4.c
#define ABILITY_MAGIC_GUARD 97 // Placeholder
#define ABILITY_MOLD_BREAKER 98 // Placeholder
#define ABILITY_MOTOR_DRIVE 99
Expand All @@ -126,7 +126,7 @@
#define ABILITY_TANGLED_FEET 120
#define ABILITY_TECHNICIAN 121
#define ABILITY_TINTED_LENS 122
#define ABILITY_UNAWARE 123 // Placeholder
#define ABILITY_UNAWARE 123
#define ABILITY_UNBURDEN 124

#endif // GUARD_CONSTANTS_ABILITIES_H
9 changes: 8 additions & 1 deletion src/battle/battle_4.c
Expand Up @@ -1564,7 +1564,7 @@ static void atk01_accuracycheck(void)
}
else
{
u8 type, moveAcc, holdEffect, quality;
u8 type, moveAcc, holdEffect, quality, newAccuracy, newEvasion;
s8 buff;
u16 calc;

Expand Down Expand Up @@ -1594,6 +1594,13 @@ static void atk01_accuracycheck(void)
if (buff > 0xC)
buff = 0xC;

newAccuracy = gBattleMons[gBankAttacker].statStages[STAT_STAGE_ACC];
newEvasion = gBattleMons[gBankTarget].statStages[STAT_STAGE_EVASION];
if (gBattleMons[gBankAttacker].ability == ABILITY_UNAWARE)
newEvasion = 6;
if (gBattleMons[gBankTarget].ability == ABILITY_UNAWARE)
newAccuracy = 6;

moveAcc = gBattleMoves[move].accuracy;
// check Thunder on sunny weather
if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY && gBattleMoves[move].effect == EFFECT_THUNDER)
Expand Down
8 changes: 8 additions & 0 deletions src/battle/calculate_base_damage.c
Expand Up @@ -228,6 +228,14 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de
if (attacker->ability == ABILITY_SLOW_START && gDisableStructs[bankAtk].slowStartTimer <= 4)
attack /= 2;

// Unaware
if (attacker->ability == ABILITY_UNAWARE)
defender->statStages[STAT_STAGE_DEF] = 6;
defender->statStages[STAT_STAGE_SPDEF] = 6;
if (defender->ability == ABILITY_UNAWARE)
attacker->statStages[STAT_STAGE_ATK] = 6;
attacker->statStages[STAT_STAGE_SPATK] = 6;

// Rivalry
if (GetGenderFromSpeciesAndPersonality(attacker->species, attacker->personality) != MON_GENDERLESS
&& GetGenderFromSpeciesAndPersonality(defender->species, defender->personality) != MON_GENDERLESS
Expand Down

0 comments on commit d2c02d4

Please sign in to comment.