Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Eduardo Quezada D'Ottone <[email protected]>
  • Loading branch information
cfmnephrite and AsparagusEduardo authored Feb 26, 2024
1 parent b0d36b2 commit 170070b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/pokemon.h
Original file line number Diff line number Diff line change
Expand Up @@ -529,9 +529,9 @@ struct MoveInfo
#define ADDITIONAL_EFFECTS(...) ((min(ARRAY_COUNT(EFFECTS_ARR( __VA_ARGS__ )), 15)) << 28) + (uintptr_t)(EFFECTS_ARR( __VA_ARGS__ ))

// Retrieve a move's additional effects and the count thereof
#define GET_ADDITIONAL_EFFECTS_AND_COUNT(move, _count, _effects) u32 _count = GET_ADDITIONAL_EFFECTS_COUNT(move); const struct AdditionalEffect *_effects = GET_ADDITIONAL_EFFECTS(move)
#define GET_ADDITIONAL_EFFECTS(move) (void *)(gMovesInfo[move].additionalEffects & 0x8FFFFFF)
#define GET_ADDITIONAL_EFFECTS_COUNT(move) (gMovesInfo[move].additionalEffects >> 28)
#define GET_ADDITIONAL_EFFECTS_AND_COUNT(move, _count, _effects) u32 _count = GET_ADDITIONAL_EFFECTS_COUNT(move); const struct AdditionalEffect *_effects = GET_ADDITIONAL_EFFECTS(move)

// Just a hack to make a move boosted by Sheer Force despite having no secondary effects affected
#define SHEER_FORCE_HACK { .moveEffect = 0, .chance = 100, }
Expand Down
2 changes: 1 addition & 1 deletion src/battle_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -11084,7 +11084,7 @@ bool32 IsGen6ExpShareEnabled(void)

/* Quick way of checking if a move has move effects with match a few
comma-separated conditions. Each condition has to check a field of AdditionalEffect. */
#define RETURN_HAS_MOVE_ADDITIONAL_EFFECT(condition1, ...) \
#define RETURN_HAS_MOVE_ADDITIONAL_EFFECT(condition1, ...) \
u32 i; \
GET_ADDITIONAL_EFFECTS_AND_COUNT(move, count, effects); \
for (i = 0; i < count; i++) \
Expand Down
2 changes: 1 addition & 1 deletion test/battle/move.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ SINGLE_BATTLE_TEST("AdditionalEffect.chance controls the proportion of secondary
PARAMETRIZE { move = MOVE_THUNDER_SHOCK; chance = 10; }
PARAMETRIZE { move = MOVE_DISCHARGE; chance = 30; }
PARAMETRIZE { move = MOVE_NUZZLE; chance = 100; }
ASSUME(MoveHasAdditionalEffectWithChance(move, MOVE_EFFECT_PARALYSIS, chance) == TRUE);
ASSUME(MoveHasAdditionalEffect(move, MOVE_EFFECT_PARALYSIS) == TRUE);
PASSES_RANDOMLY(chance, 100, RNG_SECONDARY_EFFECT);
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
Expand Down

0 comments on commit 170070b

Please sign in to comment.