Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Psyblade and Hydro Steam #2834

Merged
merged 1 commit into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions data/battle_anim_scripts.s
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,8 @@ gBattleAnims_Moves::
.4byte Move_NOXIOUS_TORQUE
.4byte Move_COMBAT_TORQUE
.4byte Move_MAGICAL_TORQUE
.4byte Move_PSYBLADE
.4byte Move_HYDRO_STEAM
@@@@ Z MOVES
.4byte Move_BREAKNECK_BLITZ
.4byte Move_ALL_OUT_PUMMELING
Expand Down Expand Up @@ -14464,6 +14466,8 @@ Move_WICKED_TORQUE::
Move_NOXIOUS_TORQUE::
Move_COMBAT_TORQUE::
Move_MAGICAL_TORQUE::
Move_PSYBLADE::
Move_HYDRO_STEAM::
end @to do

@@@@@@@@@@@@@@@@@@@@@@@ GEN 1-3 @@@@@@@@@@@@@@@@@@@@@@@
Expand Down
4 changes: 3 additions & 1 deletion data/battle_scripts_1.s
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,9 @@ gBattleScriptsForMoveEffects::
.4byte BattleScript_EffectVictoryDance @ EFFECT_VICTORY_DANCE
.4byte BattleScript_EffectTeatime @ EFFECT_TEATIME
.4byte BattleScript_EffectAttackUpUserAlly @ EFFECT_ATTACK_UP_USER_ALLY
.4byte BattleScript_EffectShellTrap @ EFFECT_SHELL_TRAP
.4byte BattleScript_EffectShellTrap @ EFFECT_SHELL_TRAP
.4byte BattleScript_EffectHit @ EFFECT_PSYBLADE
.4byte BattleScript_EffectHit @ EFFECT_HYDRO_STEAM

BattleScript_EffectAttackUpUserAlly:
jumpifnoally BS_ATTACKER, BattleScript_EffectAttackUp
Expand Down
4 changes: 3 additions & 1 deletion include/constants/battle_move_effects.h
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,9 @@
#define EFFECT_TEATIME 393
#define EFFECT_ATTACK_UP_USER_ALLY 394 // Howl 8th Gen
#define EFFECT_SHELL_TRAP 395
#define EFFECT_PSYBLADE 396
#define EFFECT_HYDRO_STEAM 397

#define NUM_BATTLE_MOVE_EFFECTS 396
#define NUM_BATTLE_MOVE_EFFECTS 398

#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H
4 changes: 3 additions & 1 deletion include/constants/moves.h
Original file line number Diff line number Diff line change
Expand Up @@ -858,8 +858,10 @@
#define MOVE_NOXIOUS_TORQUE 824
#define MOVE_COMBAT_TORQUE 825
#define MOVE_MAGICAL_TORQUE 826
#define MOVE_PSYBLADE 827
#define MOVE_HYDRO_STEAM 828

#define MOVES_COUNT_GEN9 827
#define MOVES_COUNT_GEN9 829

#define MOVES_COUNT MOVES_COUNT_GEN9

Expand Down
6 changes: 5 additions & 1 deletion src/battle_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -8769,6 +8769,10 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef)
basePower = CalcBeatUpPower();
#endif
break;
case EFFECT_PSYBLADE:
if (IsBattlerTerrainAffected(gBattlerAttacker, STATUS_FIELD_ELECTRIC_TERRAIN))
MulModifier(&basePower, UQ_4_12(1.5));
break;
}

// Move-specific base power changes
Expand Down Expand Up @@ -9586,7 +9590,7 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move
}
else if (IsBattlerWeatherAffected(battlerAtk, B_WEATHER_SUN))
{
if (moveType == TYPE_FIRE)
if (moveType == TYPE_FIRE || gBattleMoves[move].effect == EFFECT_HYDRO_STEAM)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check for Utility Umbrella is still missing. If the mon using Hydro Steam is holding one, then Hydro Steam's damage is halved, not doubled (see this post).
Most likely this was overlooked because two lines above the code is incorrect. It should be (IsBattlerWeatherAffected(battlerDef, B_WEATHER_SUN)), not (IsBattlerWeatherAffected(battlerAtk, B_WEATHER_SUN)).

Copy link
Collaborator

@AsparagusEduardo AsparagusEduardo Mar 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check for the Utility Umbrella is in IsBattlerWeatherAffected. However, when the Utility Umbrella was implemented in the expansion, we all assumed that the defender's Umbrella didn't affect the attacker's damage multiplier, which Anubis states it does. As discussed in the Discord server, we'll add a new function specific for weather damage multipliers.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in #2835

dmg = ApplyModifier(UQ_4_12(1.5), dmg);
else if (moveType == TYPE_WATER)
dmg = ApplyModifier(UQ_4_12(0.5), dmg);
Expand Down
30 changes: 30 additions & 0 deletions src/data/battle_moves.h
Original file line number Diff line number Diff line change
Expand Up @@ -13593,6 +13593,36 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
.zMoveEffect = Z_EFFECT_NONE
},

[MOVE_PSYBLADE] =
{
.effect = EFFECT_PSYBLADE,
.power = 80,
.type = TYPE_PSYCHIC,
.accuracy = 100,
.pp = 15,
.secondaryEffectChance = 0,
.target = MOVE_TARGET_SELECTED,
.priority = 0,
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SLICING_MOVE,
.split = SPLIT_PHYSICAL,
.zMoveEffect = Z_EFFECT_NONE,
},

[MOVE_HYDRO_STEAM] =
{
.effect = EFFECT_HYDRO_STEAM,
.power = 80,
.type = TYPE_WATER,
.accuracy = 100,
.pp = 15,
.secondaryEffectChance = 0,
.target = MOVE_TARGET_SELECTED,
.priority = 0,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED,
.split = SPLIT_SPECIAL,
.zMoveEffect = Z_EFFECT_NONE,
},

// Z-Moves
[MOVE_BREAKNECK_BLITZ] =
{
Expand Down
4 changes: 4 additions & 0 deletions src/data/contest_moves.h
Original file line number Diff line number Diff line change
Expand Up @@ -6062,6 +6062,10 @@ const struct ContestMove gContestMoves[MOVES_COUNT] =
[MOVE_COMBAT_TORQUE] = {0}, // TODO

[MOVE_MAGICAL_TORQUE] = {0}, // TODO

[MOVE_PSYBLADE] = {0}, // TODO

[MOVE_HYDRO_STEAM] = {0}, // TODO
};

const struct ContestEffect gContestEffects[] =
Expand Down
10 changes: 10 additions & 0 deletions src/data/text/move_descriptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -3236,6 +3236,14 @@ static const u8 sCombatTorqueDescription[] = _(
static const u8 sMagicalTorqueDescription[] = _(
"---");

static const u8 sPsybladeDescription[] = _(
"This move's power increases\n"
"when on Electric Terrain.");

static const u8 sHydroSteamDescription[] = _(
"This move's power increases\n"
"under harsh sunlight.");

const u8 gNotDoneYetDescription[] = _(
"This move can't be used. Its\n"
"effect is in development.");
Expand Down Expand Up @@ -4073,4 +4081,6 @@ const u8 *const gMoveDescriptionPointers[MOVES_COUNT - 1] =
[MOVE_NOXIOUS_TORQUE - 1] = sNoxiousTorqueDescription,
[MOVE_COMBAT_TORQUE - 1] = sCombatTorqueDescription,
[MOVE_MAGICAL_TORQUE - 1] = sMagicalTorqueDescription,
[MOVE_PSYBLADE - 1] = sPsybladeDescription,
[MOVE_HYDRO_STEAM - 1] = sHydroSteamDescription,
};
4 changes: 4 additions & 0 deletions src/data/text/move_names.h
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,8 @@ const u8 gMoveNames[MOVES_COUNT][MOVE_NAME_LENGTH + 1] =
[MOVE_NOXIOUS_TORQUE] = _("Noxious Torque"),
[MOVE_COMBAT_TORQUE] = _("Combat Torque"),
[MOVE_MAGICAL_TORQUE] = _("Magical Torque"),
[MOVE_PSYBLADE] = _("Psyblade"),
[MOVE_HYDRO_STEAM] = _("Hydro Steam"),
};
#else
// 12 letters
Expand Down Expand Up @@ -1661,6 +1663,8 @@ const u8 gMoveNames[MOVES_COUNT][MOVE_NAME_LENGTH + 1] =
[MOVE_NOXIOUS_TORQUE] = _("NoxiusTorque"),
[MOVE_COMBAT_TORQUE] = _("CombatTorque"),
[MOVE_MAGICAL_TORQUE] = _("MagiclTorque"),
[MOVE_PSYBLADE] = _("Psyblade"),
[MOVE_HYDRO_STEAM] = _("Hydro Steam"),
};
#endif

Expand Down