diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 9a5c1d8ed..cceb83ac7 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1844,6 +1844,10 @@ various \battler, VARIOUS_TRY_ACTIVATE_BATTLE_BOND .endm + .macro applyplasmafists + various BS_ATTACKER, VARIOUS_APPLY_PLASMA_FISTS + .endm + @ helpful macros .macro setstatchanger stat:req, stages:req, down:req setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7 diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 3d7dde94d..4d28d1394 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -389,6 +389,33 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectSappySeed @ EFFECT_SAPPY_SEED .4byte BattleScript_EffectFreezyFrost @ EFFECT_FREEZY_FROST .4byte BattleScript_EffectSparklySwirl @ EFFECT_SPARKLY_SWIRL + .4byte BattleScript_EffectPlasmaFists @ EFFECT_PLASMA_FISTS + +BattleScript_EffectPlasmaFists: + attackcanceler + accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE + attackstring + ppreduce + critcalc + damagecalc + adjustdamage + attackanimation + waitanimation + effectivenesssound + hitanimation BS_TARGET + waitstate + healthbarupdate BS_TARGET + datahpupdate BS_TARGET + critmessage + waitmessage B_WAIT_TIME_LONG + resultmessage + waitmessage B_WAIT_TIME_LONG + seteffectwithchance + tryfaintmon BS_TARGET, FALSE, NULL + applyplasmafists + printstring STRINGID_IONDELUGEON + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd BattleScript_EffectSparklySwirl: attackcanceler diff --git a/include/constants/battle.h b/include/constants/battle.h index 0682d3503..260e6153c 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -173,6 +173,7 @@ #define STATUS3_SEMI_INVULNERABLE (STATUS3_UNDERGROUND | STATUS3_ON_AIR | STATUS3_UNDERWATER | STATUS3_PHANTOM_FORCE) #define STATUS4_ELECTRIFIED (1 << 0) +#define STATUS4_PLASMA_FISTS (1 << 1) #define HITMARKER_x10 (1 << 4) #define HITMARKER_x20 (1 << 5) diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 383e37559..f405c32c6 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -373,7 +373,8 @@ #define EFFECT_SAPPY_SEED 367 #define EFFECT_FREEZY_FROST 368 #define EFFECT_SPARKLY_SWIRL 369 +#define EFFECT_PLASMA_FISTS 370 -#define NUM_BATTLE_MOVE_EFFECTS 370 +#define NUM_BATTLE_MOVE_EFFECTS 371 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 829664e75..7590cfffb 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -190,6 +190,7 @@ #define VARIOUS_JUMP_IF_NOT_ROTOTILLER_AFFECTED 117 #define VARIOUS_TRY_ACTIVATE_BATTLE_BOND 118 #define VARIOUS_CONSUME_BERRY 119 +#define VARIOUS_APPLY_PLASMA_FISTS 120 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/src/battle_main.c b/src/battle_main.c index ec0ee5300..3a42d61f1 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -5156,6 +5156,10 @@ void SetTypeBeforeUsingMove(u16 move, u8 battlerAtk) { gBattleStruct->dynamicMoveType = 0x80 | TYPE_WATER; } + else if (gStatuses4[battlerAtk] & STATUS4_PLASMA_FISTS && moveType == TYPE_NORMAL) + { + gBattleStruct->dynamicMoveType = 0x80 | TYPE_ELECTRIC; + } // Check if a gem should activate. GET_MOVE_TYPE(move, moveType); diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index ee3b39bcd..268509781 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -8910,6 +8910,10 @@ static void Cmd_various(void) gBattlescriptCurrInstr += 4; return; + case VARIOUS_APPLY_PLASMA_FISTS: + for (i = 0; i < gBattlersCount; i++) + gStatuses4[i] |= STATUS4_PLASMA_FISTS; + break; } gBattlescriptCurrInstr += 3; diff --git a/src/battle_util.c b/src/battle_util.c index ea8fb75d1..c5ee5220a 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -2379,6 +2379,7 @@ enum ENDTURN_POWDER, ENDTURN_THROAT_CHOP, ENDTURN_SLOW_START, + ENDTURN_PLASMA_FISTS, ENDTURN_BATTLER_COUNT }; @@ -2885,6 +2886,11 @@ u8 DoBattlerEndTurnEffects(void) } gBattleStruct->turnEffectsTracker++; break; + case ENDTURN_PLASMA_FISTS: + for (i = 0; i < gBattlersCount; i++) + gStatuses4[i] &= ~(STATUS4_PLASMA_FISTS); + gBattleStruct->turnEffectsTracker++; + break; case ENDTURN_BATTLER_COUNT: // done gBattleStruct->turnEffectsTracker = 0; gBattleStruct->turnEffectsBattlerId++; diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 911ae0df2..b7d5dcad9 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -10435,7 +10435,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_PLASMA_FISTS] = { - .effect = EFFECT_PLACEHOLDER, // Needs a custom move effect + .effect = EFFECT_PLASMA_FISTS, .power = 100, .type = TYPE_ELECTRIC, .accuracy = 100,