Updated Wring Out effects to match Eruption effects (#5549)
This commit is contained in:
parent
85197eda5e
commit
59e617b16d
9 changed files with 83 additions and 22 deletions
|
@ -157,7 +157,7 @@ enum {
|
|||
EFFECT_YAWN,
|
||||
EFFECT_KNOCK_OFF,
|
||||
EFFECT_ENDEAVOR,
|
||||
EFFECT_ERUPTION,
|
||||
EFFECT_POWER_BASED_ON_USER_HP,
|
||||
EFFECT_SKILL_SWAP,
|
||||
EFFECT_IMPRISON,
|
||||
EFFECT_REFRESH,
|
||||
|
@ -177,7 +177,7 @@ enum {
|
|||
EFFECT_PLEDGE,
|
||||
EFFECT_FLING,
|
||||
EFFECT_NATURAL_GIFT,
|
||||
EFFECT_VARY_POWER_BASED_ON_HP,
|
||||
EFFECT_POWER_BASED_ON_TARGET_HP,
|
||||
EFFECT_ASSURANCE,
|
||||
EFFECT_TRUMP_CARD,
|
||||
EFFECT_ACROBATICS,
|
||||
|
|
|
@ -2518,7 +2518,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
|
|||
else
|
||||
ADJUST_SCORE(-10);
|
||||
break;
|
||||
case EFFECT_ERUPTION:
|
||||
case EFFECT_POWER_BASED_ON_USER_HP:
|
||||
if (effectiveness <= AI_EFFECTIVENESS_x0_5)
|
||||
ADJUST_SCORE(-1);
|
||||
if (aiData->hpPercents[battlerDef] < 50)
|
||||
|
|
|
@ -415,7 +415,7 @@ static u8 GetMaxPowerTier(u32 move)
|
|||
case EFFECT_GYRO_BALL:
|
||||
return MAX_POWER_TIER_5;
|
||||
case EFFECT_MAGNITUDE:
|
||||
case EFFECT_VARY_POWER_BASED_ON_HP:
|
||||
case EFFECT_POWER_BASED_ON_TARGET_HP:
|
||||
return MAX_POWER_TIER_6;
|
||||
case EFFECT_FLAIL:
|
||||
case EFFECT_LOW_KICK:
|
||||
|
|
|
@ -8892,7 +8892,7 @@ static inline u32 CalcMoveBasePower(u32 move, u32 battlerAtk, u32 battlerDef, u3
|
|||
case EFFECT_FLING:
|
||||
basePower = GetFlingPowerFromItemId(gBattleMons[battlerAtk].item);
|
||||
break;
|
||||
case EFFECT_ERUPTION:
|
||||
case EFFECT_POWER_BASED_ON_USER_HP:
|
||||
basePower = gBattleMons[battlerAtk].hp * basePower / gBattleMons[battlerAtk].maxHP;
|
||||
break;
|
||||
case EFFECT_FLAIL:
|
||||
|
@ -8954,8 +8954,8 @@ static inline u32 CalcMoveBasePower(u32 move, u32 battlerAtk, u32 battlerDef, u3
|
|||
basePower *= 2;
|
||||
}
|
||||
break;
|
||||
case EFFECT_VARY_POWER_BASED_ON_HP:
|
||||
basePower = gMovesInfo[move].argument * gBattleMons[battlerDef].hp / gBattleMons[battlerDef].maxHP;
|
||||
case EFFECT_POWER_BASED_ON_TARGET_HP:
|
||||
basePower = gBattleMons[battlerDef].hp * basePower / gBattleMons[battlerDef].maxHP;
|
||||
break;
|
||||
case EFFECT_ASSURANCE:
|
||||
if (gProtectStructs[battlerDef].physicalDmg != 0 || gProtectStructs[battlerDef].specialDmg != 0 || gProtectStructs[battlerDef].confusionSelfDmg)
|
||||
|
|
|
@ -1011,7 +1011,7 @@ const struct BattleMoveEffect gBattleMoveEffects[NUM_BATTLE_MOVE_EFFECTS] =
|
|||
.battleTvScore = 1,
|
||||
},
|
||||
|
||||
[EFFECT_ERUPTION] =
|
||||
[EFFECT_POWER_BASED_ON_USER_HP] =
|
||||
{
|
||||
.battleScript = BattleScript_EffectHit,
|
||||
.battleTvScore = 1,
|
||||
|
@ -1144,7 +1144,7 @@ const struct BattleMoveEffect gBattleMoveEffects[NUM_BATTLE_MOVE_EFFECTS] =
|
|||
.encourageEncore = TRUE,
|
||||
},
|
||||
|
||||
[EFFECT_VARY_POWER_BASED_ON_HP] =
|
||||
[EFFECT_POWER_BASED_ON_TARGET_HP] =
|
||||
{
|
||||
.battleScript = BattleScript_EffectHit,
|
||||
.battleTvScore = 0, // TODO: Assign points
|
||||
|
|
|
@ -7201,7 +7201,7 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] =
|
|||
.description = COMPOUND_STRING(
|
||||
"The higher the user's HP,\n"
|
||||
"the more damage caused."),
|
||||
.effect = EFFECT_ERUPTION,
|
||||
.effect = EFFECT_POWER_BASED_ON_USER_HP,
|
||||
.power = 150,
|
||||
.type = TYPE_FIRE,
|
||||
.accuracy = 100,
|
||||
|
@ -8178,7 +8178,7 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] =
|
|||
.description = COMPOUND_STRING(
|
||||
"Inflicts more damage if the\n"
|
||||
"user's HP is high."),
|
||||
.effect = EFFECT_ERUPTION,
|
||||
.effect = EFFECT_POWER_BASED_ON_USER_HP,
|
||||
.power = 150,
|
||||
.type = TYPE_WATER,
|
||||
.accuracy = 100,
|
||||
|
@ -9498,15 +9498,14 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] =
|
|||
{
|
||||
.name = COMPOUND_STRING("Wring Out"),
|
||||
.description = sWringOutDescription,
|
||||
.effect = EFFECT_VARY_POWER_BASED_ON_HP,
|
||||
.power = 1,
|
||||
.effect = EFFECT_POWER_BASED_ON_TARGET_HP,
|
||||
.power = 120,
|
||||
.type = TYPE_NORMAL,
|
||||
.accuracy = 100,
|
||||
.pp = 5,
|
||||
.target = MOVE_TARGET_SELECTED,
|
||||
.priority = 0,
|
||||
.category = DAMAGE_CATEGORY_SPECIAL,
|
||||
.argument = 120,
|
||||
.makesContact = TRUE,
|
||||
.contestEffect = CONTEST_EFFECT_STARTLE_PREV_MON,
|
||||
.contestCategory = CONTEST_CATEGORY_SMART,
|
||||
|
@ -11564,15 +11563,14 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] =
|
|||
{
|
||||
.name = COMPOUND_STRING("Crush Grip"),
|
||||
.description = sWringOutDescription,
|
||||
.effect = EFFECT_VARY_POWER_BASED_ON_HP,
|
||||
.power = 1,
|
||||
.effect = EFFECT_POWER_BASED_ON_TARGET_HP,
|
||||
.power = 120,
|
||||
.type = TYPE_NORMAL,
|
||||
.accuracy = 100,
|
||||
.pp = 5,
|
||||
.target = MOVE_TARGET_SELECTED,
|
||||
.priority = 0,
|
||||
.category = DAMAGE_CATEGORY_PHYSICAL,
|
||||
.argument = 120,
|
||||
.makesContact = TRUE,
|
||||
.contestEffect = CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON,
|
||||
.contestCategory = CONTEST_CATEGORY_TOUGH,
|
||||
|
@ -18528,7 +18526,7 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] =
|
|||
.description = COMPOUND_STRING(
|
||||
"The higher the user's HP\n"
|
||||
"the more damage caused."),
|
||||
.effect = EFFECT_ERUPTION,
|
||||
.effect = EFFECT_POWER_BASED_ON_USER_HP,
|
||||
.power = 150,
|
||||
.type = TYPE_DRAGON,
|
||||
.accuracy = 100,
|
||||
|
@ -20516,15 +20514,14 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] =
|
|||
{
|
||||
.name = COMPOUND_STRING("Hard Press"),
|
||||
.description = sWringOutDescription,
|
||||
.effect = EFFECT_VARY_POWER_BASED_ON_HP,
|
||||
.power = 1,
|
||||
.effect = EFFECT_POWER_BASED_ON_TARGET_HP,
|
||||
.power = 100,
|
||||
.type = TYPE_STEEL,
|
||||
.accuracy = 100,
|
||||
.pp = 10,
|
||||
.target = MOVE_TARGET_SELECTED,
|
||||
.priority = 0,
|
||||
.category = DAMAGE_CATEGORY_PHYSICAL,
|
||||
.argument = 100,
|
||||
.makesContact = TRUE,
|
||||
.battleAnimScript = gBattleAnimMove_HardPress,
|
||||
},
|
||||
|
|
|
@ -88,7 +88,7 @@ DOUBLE_BATTLE_TEST("Turn order is determined randomly if priority and Speed tie
|
|||
GIVEN {
|
||||
ASSUME(gMovesInfo[MOVE_ENDEAVOR].effect == EFFECT_ENDEAVOR);
|
||||
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);
|
||||
PLAYER(SPECIES_WOBBUFFET) { MaxHP(480); HP(360); Defense(100); Speed(1); }
|
||||
PLAYER(SPECIES_WYNAUT) { Speed(1); }
|
||||
|
|
32
test/battle/move_effect/power_based_on_target_hp.c
Normal file
32
test/battle/move_effect/power_based_on_target_hp.c
Normal 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);
|
||||
}
|
||||
}
|
32
test/battle/move_effect/power_based_on_user_hp.c
Normal file
32
test/battle/move_effect/power_based_on_user_hp.c
Normal 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);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue