Skip to content

Commit

Permalink
Changed Ivy Gudgel effect (rh-hideout#3721)
Browse files Browse the repository at this point in the history
* Change Ivy Gudgel effect

* test assumptions

---------

Co-authored-by: Bassoonian <[email protected]>
  • Loading branch information
AlexOn1ine and Bassoonian authored Dec 14, 2023
1 parent 02ca83c commit 38c6185
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 15 deletions.
3 changes: 1 addition & 2 deletions data/battle_scripts_1.s
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,6 @@ gBattleScriptsForMoveEffects::
.4byte BattleScript_EffectChillyReception @ EFFECT_CHILLY_RECEPTION
.4byte BattleScript_EffectMatchaGotcha @ EFFECT_MATCHA_GOTCHA
.4byte BattleScript_EffectSyrupBomb @ EFFECT_SYRUP_BOMB
.4byte BattleScript_EffectHit @ EFFECT_IVY_CUDGEL
.4byte BattleScript_EffectMaxMove @ EFFECT_MAX_MOVE
.4byte BattleScript_EffectGlaiveRush @ EFFECT_GLAIVE_RUSH
.4byte BattleScript_EffectBrickBreak @ EFFECT_RAGING_BULL
Expand Down Expand Up @@ -10813,7 +10812,7 @@ BattleScript_BerserkGeneRet_End:
BattleScript_EffectSnow::
attackcanceler
attackstring
ppreduce
ppreduce
call BattleScript_CheckPrimalWeather
setsnow
goto BattleScript_MoveWeatherChange
11 changes: 5 additions & 6 deletions include/constants/battle_move_effects.h
Original file line number Diff line number Diff line change
Expand Up @@ -416,12 +416,11 @@
#define EFFECT_CHILLY_RECEPTION 410
#define EFFECT_MATCHA_GOTCHA 411
#define EFFECT_SYRUP_BOMB 412
#define EFFECT_IVY_CUDGEL 413
#define EFFECT_MAX_MOVE 414
#define EFFECT_GLAIVE_RUSH 415
#define EFFECT_RAGING_BULL 416
#define EFFECT_RAGE_FIST 417
#define EFFECT_MAX_MOVE 413
#define EFFECT_GLAIVE_RUSH 414
#define EFFECT_RAGING_BULL 415
#define EFFECT_RAGE_FIST 416

#define NUM_BATTLE_MOVE_EFFECTS 418
#define NUM_BATTLE_MOVE_EFFECTS 417

#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H
7 changes: 1 addition & 6 deletions src/battle_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5606,12 +5606,7 @@ void SetTypeBeforeUsingMove(u32 move, u32 battlerAtk)
gBattleStruct->dynamicMoveType++;
gBattleStruct->dynamicMoveType |= F_DYNAMIC_TYPE_IGNORE_PHYSICALITY | F_DYNAMIC_TYPE_SET;
}
else if (gBattleMoves[move].effect == EFFECT_CHANGE_TYPE_ON_ITEM)
{
if (holdEffect == gBattleMoves[move].argument)
gBattleStruct->dynamicMoveType = ItemId_GetSecondaryId(gBattleMons[battlerAtk].item) | F_DYNAMIC_TYPE_SET;
}
else if (gBattleMoves[move].effect == EFFECT_IVY_CUDGEL && holdEffect == HOLD_EFFECT_MASK)
else if (gBattleMoves[move].effect == EFFECT_CHANGE_TYPE_ON_ITEM && holdEffect == gBattleMoves[move].argument)
{
gBattleStruct->dynamicMoveType = ItemId_GetSecondaryId(gBattleMons[battlerAtk].item) | F_DYNAMIC_TYPE_SET;
}
Expand Down
3 changes: 2 additions & 1 deletion src/data/battle_moves.h
Original file line number Diff line number Diff line change
Expand Up @@ -14447,7 +14447,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] =

[MOVE_IVY_CUDGEL] =
{
.effect = EFFECT_IVY_CUDGEL,
.effect = EFFECT_CHANGE_TYPE_ON_ITEM,
.power = 100,
.type = TYPE_GRASS,
.accuracy = 100,
Expand All @@ -14456,6 +14456,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] =
.target = MOVE_TARGET_SELECTED,
.priority = 0,
.split = SPLIT_PHYSICAL,
.argument = HOLD_EFFECT_MASK,
.zMoveEffect = Z_EFFECT_NONE,
.highCritRatio = TRUE,
.metronomeBanned = TRUE,
Expand Down
6 changes: 6 additions & 0 deletions test/battle/move_effect/ivy_cudgel.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#include "global.h"
#include "test/battle.h"

ASSUMPTIONS
{
ASSUME(gBattleMoves[MOVE_IVY_CUDGEL].effect == EFFECT_CHANGE_TYPE_ON_ITEM);
ASSUME(gBattleMoves[MOVE_IVY_CUDGEL].argument == HOLD_EFFECT_MASK);
}

SINGLE_BATTLE_TEST("Ivy Gudgel changes the move type depending on the mask the user holds")
{
u16 species;
Expand Down
31 changes: 31 additions & 0 deletions test/battle/move_effect/techno_blast.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#include "global.h"
#include "test/battle.h"

ASSUMPTIONS
{
ASSUME(gBattleMoves[MOVE_TECHNO_BLAST].effect == EFFECT_CHANGE_TYPE_ON_ITEM);
ASSUME(gBattleMoves[MOVE_TECHNO_BLAST].argument == HOLD_EFFECT_DRIVE);
}


SINGLE_BATTLE_TEST("Techno Blast changes the move type depending on the mask the user holds")
{
u16 species;
u16 item;

PARAMETRIZE { species = SPECIES_CHARIZARD; item = ITEM_DOUSE_DRIVE; }
PARAMETRIZE { species = SPECIES_BLASTOISE; item = ITEM_SHOCK_DRIVE; }
PARAMETRIZE { species = SPECIES_VENUSAUR; item = ITEM_BURN_DRIVE; }
PARAMETRIZE { species = SPECIES_DRATINI; item = ITEM_CHILL_DRIVE; }

GIVEN {
PLAYER(SPECIES_WOBBUFFET) { Item(item); }
OPPONENT(species);
} WHEN {
TURN { MOVE(player, MOVE_TECHNO_BLAST); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_TECHNO_BLAST, player);
HP_BAR(opponent);
MESSAGE("It's super effective!");
}
}

0 comments on commit 38c6185

Please sign in to comment.