Updated Wring Out effects to match Eruption effects (#5549)

This commit is contained in:
Eduardo Quezada 2024-10-20 16:44:28 -03:00 committed by GitHub
parent 85197eda5e
commit 59e617b16d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 83 additions and 22 deletions

View file

@ -157,7 +157,7 @@ enum {
EFFECT_YAWN, EFFECT_YAWN,
EFFECT_KNOCK_OFF, EFFECT_KNOCK_OFF,
EFFECT_ENDEAVOR, EFFECT_ENDEAVOR,
EFFECT_ERUPTION, EFFECT_POWER_BASED_ON_USER_HP,
EFFECT_SKILL_SWAP, EFFECT_SKILL_SWAP,
EFFECT_IMPRISON, EFFECT_IMPRISON,
EFFECT_REFRESH, EFFECT_REFRESH,
@ -177,7 +177,7 @@ enum {
EFFECT_PLEDGE, EFFECT_PLEDGE,
EFFECT_FLING, EFFECT_FLING,
EFFECT_NATURAL_GIFT, EFFECT_NATURAL_GIFT,
EFFECT_VARY_POWER_BASED_ON_HP, EFFECT_POWER_BASED_ON_TARGET_HP,
EFFECT_ASSURANCE, EFFECT_ASSURANCE,
EFFECT_TRUMP_CARD, EFFECT_TRUMP_CARD,
EFFECT_ACROBATICS, EFFECT_ACROBATICS,

View file

@ -2518,7 +2518,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
else else
ADJUST_SCORE(-10); ADJUST_SCORE(-10);
break; break;
case EFFECT_ERUPTION: case EFFECT_POWER_BASED_ON_USER_HP:
if (effectiveness <= AI_EFFECTIVENESS_x0_5) if (effectiveness <= AI_EFFECTIVENESS_x0_5)
ADJUST_SCORE(-1); ADJUST_SCORE(-1);
if (aiData->hpPercents[battlerDef] < 50) if (aiData->hpPercents[battlerDef] < 50)

View file

@ -415,7 +415,7 @@ static u8 GetMaxPowerTier(u32 move)
case EFFECT_GYRO_BALL: case EFFECT_GYRO_BALL:
return MAX_POWER_TIER_5; return MAX_POWER_TIER_5;
case EFFECT_MAGNITUDE: case EFFECT_MAGNITUDE:
case EFFECT_VARY_POWER_BASED_ON_HP: case EFFECT_POWER_BASED_ON_TARGET_HP:
return MAX_POWER_TIER_6; return MAX_POWER_TIER_6;
case EFFECT_FLAIL: case EFFECT_FLAIL:
case EFFECT_LOW_KICK: case EFFECT_LOW_KICK:

View file

@ -8892,7 +8892,7 @@ static inline u32 CalcMoveBasePower(u32 move, u32 battlerAtk, u32 battlerDef, u3
case EFFECT_FLING: case EFFECT_FLING:
basePower = GetFlingPowerFromItemId(gBattleMons[battlerAtk].item); basePower = GetFlingPowerFromItemId(gBattleMons[battlerAtk].item);
break; break;
case EFFECT_ERUPTION: case EFFECT_POWER_BASED_ON_USER_HP:
basePower = gBattleMons[battlerAtk].hp * basePower / gBattleMons[battlerAtk].maxHP; basePower = gBattleMons[battlerAtk].hp * basePower / gBattleMons[battlerAtk].maxHP;
break; break;
case EFFECT_FLAIL: case EFFECT_FLAIL:
@ -8954,8 +8954,8 @@ static inline u32 CalcMoveBasePower(u32 move, u32 battlerAtk, u32 battlerDef, u3
basePower *= 2; basePower *= 2;
} }
break; break;
case EFFECT_VARY_POWER_BASED_ON_HP: case EFFECT_POWER_BASED_ON_TARGET_HP:
basePower = gMovesInfo[move].argument * gBattleMons[battlerDef].hp / gBattleMons[battlerDef].maxHP; basePower = gBattleMons[battlerDef].hp * basePower / gBattleMons[battlerDef].maxHP;
break; break;
case EFFECT_ASSURANCE: case EFFECT_ASSURANCE:
if (gProtectStructs[battlerDef].physicalDmg != 0 || gProtectStructs[battlerDef].specialDmg != 0 || gProtectStructs[battlerDef].confusionSelfDmg) if (gProtectStructs[battlerDef].physicalDmg != 0 || gProtectStructs[battlerDef].specialDmg != 0 || gProtectStructs[battlerDef].confusionSelfDmg)

View file

@ -1011,7 +1011,7 @@ const struct BattleMoveEffect gBattleMoveEffects[NUM_BATTLE_MOVE_EFFECTS] =
.battleTvScore = 1, .battleTvScore = 1,
}, },
[EFFECT_ERUPTION] = [EFFECT_POWER_BASED_ON_USER_HP] =
{ {
.battleScript = BattleScript_EffectHit, .battleScript = BattleScript_EffectHit,
.battleTvScore = 1, .battleTvScore = 1,
@ -1144,7 +1144,7 @@ const struct BattleMoveEffect gBattleMoveEffects[NUM_BATTLE_MOVE_EFFECTS] =
.encourageEncore = TRUE, .encourageEncore = TRUE,
}, },
[EFFECT_VARY_POWER_BASED_ON_HP] = [EFFECT_POWER_BASED_ON_TARGET_HP] =
{ {
.battleScript = BattleScript_EffectHit, .battleScript = BattleScript_EffectHit,
.battleTvScore = 0, // TODO: Assign points .battleTvScore = 0, // TODO: Assign points

View file

@ -7201,7 +7201,7 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] =
.description = COMPOUND_STRING( .description = COMPOUND_STRING(
"The higher the user's HP,\n" "The higher the user's HP,\n"
"the more damage caused."), "the more damage caused."),
.effect = EFFECT_ERUPTION, .effect = EFFECT_POWER_BASED_ON_USER_HP,
.power = 150, .power = 150,
.type = TYPE_FIRE, .type = TYPE_FIRE,
.accuracy = 100, .accuracy = 100,
@ -8178,7 +8178,7 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] =
.description = COMPOUND_STRING( .description = COMPOUND_STRING(
"Inflicts more damage if the\n" "Inflicts more damage if the\n"
"user's HP is high."), "user's HP is high."),
.effect = EFFECT_ERUPTION, .effect = EFFECT_POWER_BASED_ON_USER_HP,
.power = 150, .power = 150,
.type = TYPE_WATER, .type = TYPE_WATER,
.accuracy = 100, .accuracy = 100,
@ -9498,15 +9498,14 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] =
{ {
.name = COMPOUND_STRING("Wring Out"), .name = COMPOUND_STRING("Wring Out"),
.description = sWringOutDescription, .description = sWringOutDescription,
.effect = EFFECT_VARY_POWER_BASED_ON_HP, .effect = EFFECT_POWER_BASED_ON_TARGET_HP,
.power = 1, .power = 120,
.type = TYPE_NORMAL, .type = TYPE_NORMAL,
.accuracy = 100, .accuracy = 100,
.pp = 5, .pp = 5,
.target = MOVE_TARGET_SELECTED, .target = MOVE_TARGET_SELECTED,
.priority = 0, .priority = 0,
.category = DAMAGE_CATEGORY_SPECIAL, .category = DAMAGE_CATEGORY_SPECIAL,
.argument = 120,
.makesContact = TRUE, .makesContact = TRUE,
.contestEffect = CONTEST_EFFECT_STARTLE_PREV_MON, .contestEffect = CONTEST_EFFECT_STARTLE_PREV_MON,
.contestCategory = CONTEST_CATEGORY_SMART, .contestCategory = CONTEST_CATEGORY_SMART,
@ -11564,15 +11563,14 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] =
{ {
.name = COMPOUND_STRING("Crush Grip"), .name = COMPOUND_STRING("Crush Grip"),
.description = sWringOutDescription, .description = sWringOutDescription,
.effect = EFFECT_VARY_POWER_BASED_ON_HP, .effect = EFFECT_POWER_BASED_ON_TARGET_HP,
.power = 1, .power = 120,
.type = TYPE_NORMAL, .type = TYPE_NORMAL,
.accuracy = 100, .accuracy = 100,
.pp = 5, .pp = 5,
.target = MOVE_TARGET_SELECTED, .target = MOVE_TARGET_SELECTED,
.priority = 0, .priority = 0,
.category = DAMAGE_CATEGORY_PHYSICAL, .category = DAMAGE_CATEGORY_PHYSICAL,
.argument = 120,
.makesContact = TRUE, .makesContact = TRUE,
.contestEffect = CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON, .contestEffect = CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON,
.contestCategory = CONTEST_CATEGORY_TOUGH, .contestCategory = CONTEST_CATEGORY_TOUGH,
@ -18528,7 +18526,7 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] =
.description = COMPOUND_STRING( .description = COMPOUND_STRING(
"The higher the user's HP\n" "The higher the user's HP\n"
"the more damage caused."), "the more damage caused."),
.effect = EFFECT_ERUPTION, .effect = EFFECT_POWER_BASED_ON_USER_HP,
.power = 150, .power = 150,
.type = TYPE_DRAGON, .type = TYPE_DRAGON,
.accuracy = 100, .accuracy = 100,
@ -20516,15 +20514,14 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] =
{ {
.name = COMPOUND_STRING("Hard Press"), .name = COMPOUND_STRING("Hard Press"),
.description = sWringOutDescription, .description = sWringOutDescription,
.effect = EFFECT_VARY_POWER_BASED_ON_HP, .effect = EFFECT_POWER_BASED_ON_TARGET_HP,
.power = 1, .power = 100,
.type = TYPE_STEEL, .type = TYPE_STEEL,
.accuracy = 100, .accuracy = 100,
.pp = 10, .pp = 10,
.target = MOVE_TARGET_SELECTED, .target = MOVE_TARGET_SELECTED,
.priority = 0, .priority = 0,
.category = DAMAGE_CATEGORY_PHYSICAL, .category = DAMAGE_CATEGORY_PHYSICAL,
.argument = 100,
.makesContact = TRUE, .makesContact = TRUE,
.battleAnimScript = gBattleAnimMove_HardPress, .battleAnimScript = gBattleAnimMove_HardPress,
}, },

View file

@ -88,7 +88,7 @@ DOUBLE_BATTLE_TEST("Turn order is determined randomly if priority and Speed tie
GIVEN { GIVEN {
ASSUME(gMovesInfo[MOVE_ENDEAVOR].effect == EFFECT_ENDEAVOR); ASSUME(gMovesInfo[MOVE_ENDEAVOR].effect == EFFECT_ENDEAVOR);
ASSUME(gMovesInfo[MOVE_LIFE_DEW].effect == EFFECT_JUNGLE_HEALING); ASSUME(gMovesInfo[MOVE_LIFE_DEW].effect == EFFECT_JUNGLE_HEALING);
ASSUME(gMovesInfo[MOVE_CRUSH_GRIP].effect == EFFECT_VARY_POWER_BASED_ON_HP); ASSUME(gMovesInfo[MOVE_CRUSH_GRIP].effect == EFFECT_POWER_BASED_ON_TARGET_HP);
ASSUME(gMovesInfo[MOVE_SUPER_FANG].effect == EFFECT_SUPER_FANG); ASSUME(gMovesInfo[MOVE_SUPER_FANG].effect == EFFECT_SUPER_FANG);
PLAYER(SPECIES_WOBBUFFET) { MaxHP(480); HP(360); Defense(100); Speed(1); } PLAYER(SPECIES_WOBBUFFET) { MaxHP(480); HP(360); Defense(100); Speed(1); }
PLAYER(SPECIES_WYNAUT) { Speed(1); } PLAYER(SPECIES_WYNAUT) { Speed(1); }

View file

@ -0,0 +1,32 @@
#include "global.h"
#include "test/battle.h"
ASSUMPTIONS
{
ASSUME(gMovesInfo[MOVE_CRUSH_GRIP].effect == EFFECT_POWER_BASED_ON_TARGET_HP);
}
SINGLE_BATTLE_TEST("Crush Grip's damage is affected by the target's current HP", s16 damage)
{
s16 hp, maxHp = 256;
PARAMETRIZE { hp = maxHp; }
PARAMETRIZE { hp = maxHp / 2; }
PARAMETRIZE { hp = maxHp / 8; }
PARAMETRIZE { hp = 1; }
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET) { HP(hp); MaxHP(maxHp); }
} WHEN {
TURN { MOVE(player, MOVE_CRUSH_GRIP); }
} SCENE {
MESSAGE("Wobbuffet used Crush Grip!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_CRUSH_GRIP, player);
HP_BAR(opponent, captureDamage: &results[i].damage);
} FINALLY {
EXPECT_MUL_EQ(results[0].damage, Q_4_12(0.5), results[1].damage);
EXPECT_MUL_EQ(results[0].damage, Q_4_12(0.125), results[2].damage);
EXPECT_EQ(results[3].damage, 1);
}
}

View file

@ -0,0 +1,32 @@
#include "global.h"
#include "test/battle.h"
ASSUMPTIONS
{
ASSUME(gMovesInfo[MOVE_ERUPTION].effect == EFFECT_POWER_BASED_ON_USER_HP);
}
SINGLE_BATTLE_TEST("Eruption's damage is affected by the user's current HP", s16 damage)
{
s16 hp, maxHp = 256;
PARAMETRIZE { hp = maxHp; }
PARAMETRIZE { hp = maxHp / 2; }
PARAMETRIZE { hp = maxHp / 8; }
PARAMETRIZE { hp = 1; }
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { HP(hp); MaxHP(maxHp); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_ERUPTION); }
} SCENE {
MESSAGE("Wobbuffet used Eruption!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_ERUPTION, player);
HP_BAR(opponent, captureDamage: &results[i].damage);
} FINALLY {
EXPECT_MUL_EQ(results[0].damage, Q_4_12(0.5), results[1].damage);
EXPECT_MUL_EQ(results[0].damage, Q_4_12(0.125), results[2].damage);
EXPECT_EQ(results[3].damage, 1);
}
}