Skip to content

Commit

Permalink
Add Mystery Dungeon moves
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinvanrijn committed Jan 10, 2025
1 parent e753ebd commit 6273aea
Show file tree
Hide file tree
Showing 9 changed files with 161 additions and 3 deletions.
35 changes: 35 additions & 0 deletions data/battle_anim_scripts.s
Original file line number Diff line number Diff line change
Expand Up @@ -28989,6 +28989,41 @@ gBattleAnimSpecial_CriticalCaptureBallThrow::
jumpreteq -1, BallThrowTrainerBlock
goto BallThrowEnd

@@@@@@@@@@ MYSTERY DUNGEON MOVES @@@@@@@@@@
gBattleAnimMove_WideSlash::
loadspritegfx ANIM_TAG_CUT
delay 0
monbg ANIM_DEF_PARTNER
setalpha 12, 8
delay 0
playsewithpan SE_M_CUT, SOUND_PAN_TARGET
createsprite gAirCutterSliceSpriteTemplate, ANIM_ATTACKER, 2, 40, -32, 0, 2
delay 5
createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 8, 1
createvisualtask AnimTask_ShakeMon2, 2, ANIM_DEF_PARTNER, 2, 0, 8, 1
waitforvisualfinish
blendoff
clearmonbg ANIM_DEF_PARTNER
delay 0
end

gBattleAnimMove_VacuumCut::
loadspritegfx ANIM_TAG_AIR_WAVE
delay 0
monbg ANIM_DEF_PARTNER
setalpha 12, 8
delay 0
createvisualtask AnimTask_AirCutterProjectile, 2, 32, -24, 6 * 256, 2, 128 @ 6 * 256 == Q_8_8(6)
delay 29
playsewithpan SE_M_CUT, SOUND_PAN_TARGET
createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 8, 1
createvisualtask AnimTask_ShakeMon2, 2, ANIM_DEF_PARTNER, 2, 0, 8, 1
waitforvisualfinish
blendoff
clearmonbg ANIM_DEF_PARTNER
delay 0
end

@@@@@@@@@@ Z MOVES @@@@@@@@@@
gBattleAnimMove_BreakneckBlitz::
loadspritegfx ANIM_TAG_HOLLOW_ORB
Expand Down
4 changes: 4 additions & 0 deletions include/battle_anim_scripts.h
Original file line number Diff line number Diff line change
Expand Up @@ -1004,6 +1004,10 @@ extern const u8 gBattleAnimGeneral_TeraCharge[];
extern const u8 gBattleAnimGeneral_TeraActivate[];
extern const u8 gBattleAnimGeneral_SimpleHeal[];

// Mystery Dungeon Moves
extern const u8 gBattleAnimMove_WideSlash[];
extern const u8 gBattleAnimMove_VacuumCut[];

// special animations
extern const u8 gBattleAnimSpecial_LevelUp[];
extern const u8 gBattleAnimSpecial_SwitchOutPlayerMon[];
Expand Down
4 changes: 3 additions & 1 deletion include/constants/items.h
Original file line number Diff line number Diff line change
Expand Up @@ -948,8 +948,10 @@
#define ITEM_TM228 (LAST_BERRY_INDEX + 228)
#define ITEM_TM229 (LAST_BERRY_INDEX + 229)
#define ITEM_TM230 (LAST_BERRY_INDEX + 230)
#define ITEM_TM231 (LAST_BERRY_INDEX + 231)
#define ITEM_TM232 (LAST_BERRY_INDEX + 232)

#define LAST_TECHNICAL_MACHINE_INDEX ITEM_TM230
#define LAST_TECHNICAL_MACHINE_INDEX ITEM_TM232
#define NUM_TECHNICAL_MACHINES (LAST_TECHNICAL_MACHINE_INDEX - ITEM_TM01 + 1)

#define ITEM_HM01 (LAST_TECHNICAL_MACHINE_INDEX + 1)
Expand Down
6 changes: 5 additions & 1 deletion include/constants/moves.h
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,11 @@

#define MOVES_COUNT_GEN9 848

#define MOVES_COUNT MOVES_COUNT_GEN9
// Mystery Dungeon Moves
#define MOVE_WIDE_SLASH (MOVES_COUNT_GEN9 + 0)
#define MOVE_VACUUM_CUT (MOVES_COUNT_GEN9 + 1)

#define MOVES_COUNT (MOVES_COUNT_GEN9 + 2)

// Z Moves
#define MOVE_BREAKNECK_BLITZ (MOVES_COUNT + 0)
Expand Down
4 changes: 3 additions & 1 deletion include/constants/tms_hms.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,9 @@
F(ALLURING_VOICE) \
F(PSYCHIC_NOISE) \
F(UPPER_HAND) \
F(HAIL)
F(HAIL) \
F(WIDE_SLASH) \
F(VACUUM_CUT)

#define FOREACH_HM(F) \
F(CUT) \
Expand Down
30 changes: 30 additions & 0 deletions src/data/items.h
Original file line number Diff line number Diff line change
Expand Up @@ -13168,6 +13168,36 @@ const struct Item gItemsInfo[] =
.secondaryId = MOVE_HAIL,
},

[ITEM_TM_WIDE_SLASH] =
{
.name = _("TM231"),
.price = 3000,
.description = COMPOUND_STRING(
"Slashes with\n"
"claws, etc. Deals\n"
"typeless damage."),
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
.secondaryId = MOVE_WIDE_SLASH,
},

[ITEM_TM_VACUUM_CUT] =
{
.name = _("TM232"),
.price = 3000,
.description = COMPOUND_STRING(
"Attack that always\n"
"inflicts 35 HP\n"
"typeless damage."),
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
.secondaryId = MOVE_VACUUM_CUT,
},

[ITEM_HM_CUT] =
{
.name = _("HM01"),
Expand Down
45 changes: 45 additions & 0 deletions src/data/moves_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -20724,6 +20724,51 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] =
.battleAnimScript = gBattleAnimMove_MalignantChain,
},

// Mystery Dungeon Moves
[MOVE_WIDE_SLASH] =
{
.name = COMPOUND_STRING("Wide Slash"),
.description = COMPOUND_STRING(
"Slashes with claws, etc.\n"
"Deals typeless damage."),
.effect = EFFECT_HIT,
.power = 100,
.type = TYPE_MYSTERY,
.accuracy = 85,
.pp = 10,
.target = MOVE_TARGET_BOTH,
.priority = 0,
.category = DAMAGE_CATEGORY_PHYSICAL,
.makesContact = TRUE,
.slicingMove = TRUE,
.contestEffect = CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL,
.contestCategory = CONTEST_CATEGORY_COOL,
.contestComboStarterId = 0,
.contestComboMoves = {0},
.battleAnimScript = gBattleAnimMove_WideSlash,
},
[MOVE_VACUUM_CUT] =
{
.name = COMPOUND_STRING("Vacuum-Cut"),
.description = COMPOUND_STRING(
"Attack that always inflicts\n"
"35 HP typeless damage."),
.effect = EFFECT_FIXED_DAMAGE_ARG,
.power = 1,
.type = TYPE_MYSTERY,
.accuracy = 100,
.pp = 10,
.target = MOVE_TARGET_BOTH,
.priority = 0,
.category = DAMAGE_CATEGORY_SPECIAL,
.argument = 35,
.contestEffect = CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL,
.contestCategory = CONTEST_CATEGORY_COOL,
.contestComboStarterId = 0,
.contestComboMoves = {0},
.battleAnimScript = gBattleAnimMove_VacuumCut,
},

// Z-Moves
[MOVE_BREAKNECK_BLITZ] =
{
Expand Down
16 changes: 16 additions & 0 deletions src/pokemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -5509,6 +5509,8 @@ static const u16 sUniversalMoves[] =
MOVE_SECRET_POWER,
MOVE_SUBSTITUTE,
MOVE_TERA_BLAST,
MOVE_WIDE_SLASH,
MOVE_VACUUM_CUT,
};

u8 CanLearnTeachableMove(u16 species, u16 move)
Expand Down Expand Up @@ -5559,6 +5561,20 @@ u8 CanLearnTeachableMove(u16 species, u16 move)
}
else
{
switch (species)
{
case SPECIES_MAGIKARP:
case SPECIES_DITTO:
case SPECIES_SMEARGLE:
case SPECIES_WURMPLE:
case SPECIES_SILCOON:
case SPECIES_CASCOON:
case SPECIES_KRICKETOT:
if(move == MOVE_WIDE_SLASH || move == MOVE_VACUUM_CUT)
return TRUE;
// Fallthrough
}

const struct LevelUpMove *learnset = GetSpeciesLevelUpLearnset(species);

if (P_TM_LITERACY < GEN_6)
Expand Down
20 changes: 20 additions & 0 deletions test/battle/move_effect/fixed_damage_arg.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
ASSUMPTIONS
{
ASSUME(gMovesInfo[MOVE_SONIC_BOOM].effect == EFFECT_FIXED_DAMAGE_ARG);
ASSUME(gMovesInfo[MOVE_VACUUM_CUT].effect == EFFECT_FIXED_DAMAGE_ARG);
ASSUME(gMovesInfo[MOVE_VACUUM_CUT].type == TYPE_MYSTERY);
ASSUME(gMovesInfo[MOVE_VACUUM_CUT].target == MOVE_TARGET_BOTH);
}

SINGLE_BATTLE_TEST("Sonic Boom deals fixed damage", s16 damage)
Expand Down Expand Up @@ -39,3 +42,20 @@ SINGLE_BATTLE_TEST("Sonic Boom doesn't affect ghost types")
MESSAGE("It doesn't affect the opposing Gastly…");
}
}

DOUBLE_BATTLE_TEST("Vacuum-Cut bypasses Wonder Guard")
{
GIVEN {
PLAYER(SPECIES_SHEDINJA) { Ability(ABILITY_WONDER_GUARD); }
PLAYER(SPECIES_SHEDINJA) { Ability(ABILITY_WONDER_GUARD); }
OPPONENT(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponentLeft, MOVE_VACUUM_CUT); }
} SCENE {
HP_BAR(playerLeft);
MESSAGE("Shedinja fainted!");
HP_BAR(playerRight);
MESSAGE("Shedinja fainted!");
}
}

0 comments on commit 6273aea

Please sign in to comment.