diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 102cdd7c8c..fbff3f0e73 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -305,6 +305,77 @@ gBattleScriptsForMoveEffects:: @ 82D86A8 .4byte BattleScript_EffectFlinchWithStatus .4byte BattleScript_EffectRecoil50 .4byte BattleScript_EffectShellSmash + .4byte BattleScript_EffectShiftGear + .4byte BattleScript_EffectDefenseUp3 + .4byte BattleScript_EffectNobleRoar + .4byte BattleScript_EffectvVenomDrench + +BattleScript_EffectvVenomDrench: + attackcanceler + attackstring + ppreduce + jumpifstatus BS_TARGET, STATUS1_PSN_ANY, BattleScript_EffectvVenomDrenchCanBeUsed + goto BattleScript_ButItFailed +BattleScript_EffectvVenomDrenchCanBeUsed: + jumpifstat BS_TARGET, CMP_GREATER_THAN, STAT_ATK, 0x0, BattleScript_VenomDrenchDoMoveAnim + jumpifstat BS_TARGET, CMP_GREATER_THAN, STAT_SPATK, 0x0, BattleScript_VenomDrenchDoMoveAnim + jumpifstat BS_TARGET, CMP_EQUAL, STAT_SPEED, 0x0, BattleScript_CantLowerMultipleStats +BattleScript_VenomDrenchDoMoveAnim:: + accuracycheck BattleScript_ButItFailed, ACC_CURR_MOVE + attackanimation + waitanimation + setbyte sSTAT_ANIM_PLAYED, FALSE + playstatchangeanimation BS_TARGET, BIT_ATK | BIT_SPATK | BIT_SPEED, ATK48_STAT_NEGATIVE | ATK48_ONLY_MULTIPLE + playstatchangeanimation BS_TARGET, BIT_ATK, ATK48_STAT_NEGATIVE + setstatchanger STAT_ATK, 1, TRUE + statbuffchange 0x1, BattleScript_VenomDrenchTryLowerSpAtk + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_VenomDrenchTryLowerSpAtk + printfromtable gStatDownStringIds + waitmessage 0x40 +BattleScript_VenomDrenchTryLowerSpAtk:: + playstatchangeanimation BS_TARGET, BIT_SPATK, ATK48_STAT_NEGATIVE + setstatchanger STAT_SPATK, 1, TRUE + statbuffchange 0x1, BattleScript_VenomDrenchTryLowerSpeed + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_VenomDrenchTryLowerSpeed + printfromtable gStatDownStringIds + waitmessage 0x40 +BattleScript_VenomDrenchTryLowerSpeed:: + playstatchangeanimation BS_TARGET, BIT_SPEED, ATK48_STAT_NEGATIVE + setstatchanger STAT_SPEED, 1, TRUE + statbuffchange 0x1, BattleScript_VenomDrenchEnd + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_VenomDrenchEnd + printfromtable gStatDownStringIds + waitmessage 0x40 +BattleScript_VenomDrenchEnd:: + goto BattleScript_MoveEnd + +BattleScript_EffectNobleRoar: + attackcanceler + attackstring + ppreduce + jumpifstat BS_TARGET, CMP_GREATER_THAN, STAT_ATK, 0x0, BattleScript_NobleRoarDoMoveAnim + jumpifstat BS_TARGET, CMP_EQUAL, STAT_SPATK, 0x0, BattleScript_CantLowerMultipleStats +BattleScript_NobleRoarDoMoveAnim:: + accuracycheck BattleScript_ButItFailed, ACC_CURR_MOVE + attackanimation + waitanimation + setbyte sSTAT_ANIM_PLAYED, FALSE + playstatchangeanimation BS_TARGET, BIT_ATK | BIT_SPATK, ATK48_STAT_NEGATIVE | ATK48_ONLY_MULTIPLE + playstatchangeanimation BS_TARGET, BIT_ATK, ATK48_STAT_NEGATIVE + setstatchanger STAT_ATK, 1, TRUE + statbuffchange 0x1, BattleScript_NobleRoarTryLowerSpAtk + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_NobleRoarTryLowerSpAtk + printfromtable gStatDownStringIds + waitmessage 0x40 +BattleScript_NobleRoarTryLowerSpAtk:: + playstatchangeanimation BS_TARGET, BIT_SPATK, ATK48_STAT_NEGATIVE + setstatchanger STAT_SPATK, 1, TRUE + statbuffchange 0x1, BattleScript_NobleRoarEnd + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_NobleRoarEnd + printfromtable gStatDownStringIds + waitmessage 0x40 +BattleScript_NobleRoarEnd:: + goto BattleScript_MoveEnd BattleScript_EffectShellSmash: attackcanceler @@ -436,6 +507,37 @@ BattleScript_EffectElectrify: waitmessage 0x40 goto BattleScript_MoveEnd +BattleScript_EffectShiftGear: + attackcanceler + attackstring + ppreduce + jumpifstat BS_ATTACKER, CMP_LESS_THAN, STAT_SPEED, 0xC, BattleScript_ShiftGearDoMoveAnim + jumpifstat BS_ATTACKER, CMP_EQUAL, STAT_ATK, 0xC, BattleScript_CantRaiseMultipleStats +BattleScript_ShiftGearDoMoveAnim: + attackanimation + waitanimation + setbyte sSTAT_ANIM_PLAYED, FALSE + jumpifstat BS_ATTACKER, CMP_GREATER_THAN, STAT_SPEED, 0xA, BattleScript_ShiftGearSpeedBy1 + playstatchangeanimation BS_ATTACKER, BIT_SPEED | BIT_ATK, ATK48_STAT_BY_TWO + setstatchanger STAT_SPEED, 2, FALSE + goto BattleScript_ShiftGearDoSpeed +BattleScript_ShiftGearSpeedBy1: + playstatchangeanimation BS_ATTACKER, BIT_SPEED | BIT_ATK, 0x0 + setstatchanger STAT_SPEED, 1, FALSE +BattleScript_ShiftGearDoSpeed: + statbuffchange MOVE_EFFECT_AFFECTS_USER | 0x1, BattleScript_ShiftGearTryAtk + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_ShiftGearTryAtk + printfromtable gStatUpStringIds + waitmessage 0x40 +BattleScript_ShiftGearTryAtk: + setstatchanger STAT_ATK, 1, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | 0x1, BattleScript_ShiftGearEnd + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_ShiftGearEnd + printfromtable gStatUpStringIds + waitmessage 0x40 +BattleScript_ShiftGearEnd: + goto BattleScript_MoveEnd + BattleScript_EffectCoil: attackcanceler attackstring @@ -1816,6 +1918,10 @@ BattleScript_EffectAttackUp2:: BattleScript_EffectDefenseUp2:: setstatchanger STAT_DEF, 2, FALSE goto BattleScript_EffectStatUp + +BattleScript_EffectDefenseUp3: + setstatchanger STAT_DEF, 3, FALSE + goto BattleScript_EffectStatUp BattleScript_EffectSpeedUp2:: setstatchanger STAT_SPEED, 2, FALSE diff --git a/include/battle.h b/include/battle.h index 85bf5937fa..e35f2e635a 100644 --- a/include/battle.h +++ b/include/battle.h @@ -180,6 +180,7 @@ struct DisableStruct u8 healBlockTimer; u8 laserFocusTimer; u8 usedMoves:4; + u8 wrapTurns; }; struct ProtectStruct diff --git a/include/constants/battle.h b/include/constants/battle.h index 62fcef780b..89f548cc7c 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -113,7 +113,7 @@ #define STATUS2_BIDE 0x00000300 // two bits 0x100, 0x200 #define STATUS2_LOCK_CONFUSE 0x00000C00 #define STATUS2_MULTIPLETURNS 0x00001000 -#define STATUS2_WRAPPED 0x0000E000 +#define STATUS2_WRAPPED 0x00002000 #define STATUS2_INFATUATION 0x000F0000 // 4 bits, one for every battler #define STATUS2_INFATUATED_WITH(battler) (gBitTable[battler] << 16) #define STATUS2_FOCUS_ENERGY 0x00100000 diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index d8b1383754..78d2c56285 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -294,5 +294,9 @@ #define EFFECT_FLINCH_STATUS 288 #define EFFECT_RECOIL_50 289 #define EFFECT_SHELL_SMASH 290 +#define EFFECT_SHIFT_GEAR 291 +#define EFFECT_DEFENSE_UP_3 292 +#define EFFECT_NOBLE_ROAR 293 // Atk and Sp atk down by 1 +#define EFFECT_VENOM_DRENCH 294 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index aab8dd837a..1c4e489751 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -504,7 +504,10 @@ #define STRINGID_TARGETELECTRIFIED 501 #define STRINGID_MEGAEVOREACTING 502 #define STRINGID_MEGAEVOEVOLVED 503 +#define STRINGID_DRASTICALLY 504 +#define STRINGID_SEVERELY 505 +#define STRINGID_INFESTATION 506 -#define BATTLESTRINGS_COUNT 516 +#define BATTLESTRINGS_COUNT 519 #endif // GUARD_CONSTANTS_BATTLE_STRING_IDS_H diff --git a/include/constants/hold_effects.h b/include/constants/hold_effects.h index df9b9c27dc..dd8f907ac1 100644 --- a/include/constants/hold_effects.h +++ b/include/constants/hold_effects.h @@ -106,6 +106,7 @@ #define HOLD_EFFECT_WISE_GLASSES 116 #define HOLD_EFFECT_EVIOLITE 117 #define HOLD_EFFECT_ASSAULT_VEST 118 +#define HOLD_EFFECT_BINDING_BAND 119 // Gen6 hold effects #define HOLD_EFFECT_FAIRY_POWER 130 diff --git a/src/battle_message.c b/src/battle_message.c index 416e05d1f3..a2c8003142 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -645,6 +645,9 @@ static const u8 sText_GravityPreventsUsage[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX static const u8 sText_HealBlockPreventsUsage[] = _("The opposing {B_ATK_NAME_WITH_PREFIX} was\nprevented from healing!\p"); static const u8 sText_MegaEvoReacting[] = _("{B_ATK_NAME_WITH_PREFIX}’s {B_LAST_ITEM} is reacting\nto {B_ATK_TRAINER_NAME}’s Mega Ring!"); static const u8 sText_MegaEvoEvolved[] = _("{B_ATK_NAME_WITH_PREFIX} has Mega\nEvolved into Mega {B_BUFF1}!"); +static const u8 sText_drastically[] = _("drastically "); +static const u8 sText_severely[] = _("severely "); +static const u8 sText_Infestation[] = _("{B_DEF_NAME_WITH_PREFIX} has been afflicted\nwith an infestation by {B_ATK_NAME_WITH_PREFIX}!"); const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = { @@ -1141,6 +1144,9 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = sText_TargetElectrified, sText_MegaEvoReacting, sText_MegaEvoEvolved, + sText_drastically, + sText_severely, + sText_Infestation, }; const u16 gTerrainStringIds[] = @@ -1274,7 +1280,8 @@ const u16 gFirstTurnOfTwoStringIds[] = const u16 gWrappedStringIds[] = { STRINGID_PKMNSQUEEZEDBYBIND, STRINGID_PKMNWRAPPEDBY, STRINGID_PKMNTRAPPEDINVORTEX, - STRINGID_PKMNCLAMPED, STRINGID_PKMNTRAPPEDINVORTEX, STRINGID_PKMNTRAPPEDBYSANDTOMB + STRINGID_PKMNCLAMPED, STRINGID_PKMNTRAPPEDINVORTEX, STRINGID_PKMNTRAPPEDBYSANDTOMB, + STRINGID_INFESTATION, }; const u16 gMistUsedStringIds[] = @@ -1432,7 +1439,7 @@ const u16 gCaughtMonStringIds[] = const u16 gTrappingMoves[] = { - MOVE_BIND, MOVE_WRAP, MOVE_FIRE_SPIN, MOVE_CLAMP, MOVE_WHIRLPOOL, MOVE_SAND_TOMB, 0xFFFF + MOVE_BIND, MOVE_WRAP, MOVE_FIRE_SPIN, MOVE_CLAMP, MOVE_WHIRLPOOL, MOVE_SAND_TOMB, MOVE_INFESTATION, 0xFFFF }; const u16 gRoomsStringIds[] = diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index c63e1e6d4d..003bfa80ef 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -2368,7 +2368,11 @@ void SetMoveEffect(bool8 primary, u8 certain) } else { - gBattleMons[gEffectBattler].status2 |= ((Random() & 3) + 3) << 0xD; + gBattleMons[gEffectBattler].status2 |= STATUS2_WRAPPED; + if (GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_GRIP_CLAW) + gDisableStructs[gEffectBattler].wrapTurns = 7; + else + gDisableStructs[gEffectBattler].wrapTurns = ((Random() % 2) + 4); *(gBattleStruct->wrappedMove + gEffectBattler * 2 + 0) = gCurrentMove; *(gBattleStruct->wrappedMove + gEffectBattler * 2 + 1) = gCurrentMove >> 8; @@ -2379,7 +2383,7 @@ void SetMoveEffect(bool8 primary, u8 certain) for (gBattleCommunication[MULTISTRING_CHOOSER] = 0; ; gBattleCommunication[MULTISTRING_CHOOSER]++) { - if (gBattleCommunication[MULTISTRING_CHOOSER] > 4) + if (gBattleCommunication[MULTISTRING_CHOOSER] > 5) break; if (gTrappingMoves[gBattleCommunication[MULTISTRING_CHOOSER]] == gCurrentMove) break; @@ -3894,12 +3898,14 @@ static void atk47_setgraphicalstatchangevalues(void) value = 0xF; break; case SET_STAT_BUFF_VALUE(2): // +2 + case SET_STAT_BUFF_VALUE(3): // +3 value = 0x27; break; case SET_STAT_BUFF_VALUE(1) | STAT_BUFF_NEGATIVE: // -1 value = 0x16; break; case SET_STAT_BUFF_VALUE(2) | STAT_BUFF_NEGATIVE: // -2 + case SET_STAT_BUFF_VALUE(3) | STAT_BUFF_NEGATIVE: // -3 value = 0x2E; break; } @@ -7260,6 +7266,13 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr) gBattleTextBuff2[3] = STRINGID_STATHARSHLY >> 8; index = 4; } + else if (statValue == -3) + { + gBattleTextBuff2[1] = B_BUFF_STRING; + gBattleTextBuff2[2] = STRINGID_SEVERELY & 0xFF; + gBattleTextBuff2[3] = STRINGID_SEVERELY >> 8; + index = 4; + } gBattleTextBuff2[index] = B_BUFF_STRING; index++; gBattleTextBuff2[index] = STRINGID_STATFELL; @@ -7287,6 +7300,13 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr) gBattleTextBuff2[3] = STRINGID_STATSHARPLY >> 8; index = 4; } + else if (statValue == 3) + { + gBattleTextBuff2[1] = B_BUFF_STRING; + gBattleTextBuff2[2] = STRINGID_DRASTICALLY & 0xFF; + gBattleTextBuff2[3] = STRINGID_DRASTICALLY >> 8; + index = 4; + } gBattleTextBuff2[index] = B_BUFF_STRING; index++; gBattleTextBuff2[index] = STRINGID_STATROSE; diff --git a/src/battle_util.c b/src/battle_util.c index 1b90f8cd2c..239e904ce7 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -1492,8 +1492,7 @@ u8 DoBattlerEndTurnEffects(void) case ENDTURN_WRAP: // wrap if ((gBattleMons[gActiveBattler].status2 & STATUS2_WRAPPED) && gBattleMons[gActiveBattler].hp != 0) { - gBattleMons[gActiveBattler].status2 -= 0x2000; - if (gBattleMons[gActiveBattler].status2 & STATUS2_WRAPPED) // damaged by wrap + if (--gDisableStructs[gActiveBattler].wrapTurns != 0) // damaged by wrap { // This is the only way I could get this array access to match. gBattleScripting.animArg1 = *(gBattleStruct->wrappedMove + gActiveBattler * 2 + 0); @@ -1504,12 +1503,17 @@ u8 DoBattlerEndTurnEffects(void) gBattleTextBuff1[3] = *(gBattleStruct->wrappedMove + gActiveBattler * 2 + 1); gBattleTextBuff1[4] = EOS; gBattlescriptCurrInstr = BattleScript_WrapTurnDmg; - gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / 16; + if (GetBattlerHoldEffect(gBattleStruct->wrappedBy[gActiveBattler], TRUE) == HOLD_EFFECT_BINDING_BAND) + gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / 8; + else + gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / 16; + if (gBattleMoveDamage == 0) gBattleMoveDamage = 1; } else // broke free { + gBattleMons[gActiveBattler].status2 &= ~(STATUS2_WRAPPED); gBattleTextBuff1[0] = B_BUFF_PLACEHOLDER_BEGIN; gBattleTextBuff1[1] = B_BUFF_MOVE; gBattleTextBuff1[2] = *(gBattleStruct->wrappedMove + gActiveBattler * 2 + 0); diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index d9370da997..7ccf94a893 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -6105,7 +6105,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_GEN6] = .split = SPLIT_PHYSICAL, }, { // MOVE_SHIFT_GEAR - .effect = EFFECT_PLACEHOLDER, // Needs a custom move effect + .effect = EFFECT_SHIFT_GEAR, .power = 0, .type = TYPE_STEEL, .accuracy = 0, @@ -6345,7 +6345,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_GEN6] = .split = SPLIT_SPECIAL, }, { // MOVE_WILD_CHARGE - .effect = EFFECT_PLACEHOLDER, // Needs a custom move effect (recoil damage but 1/4 instead of 1/3) + .effect = EFFECT_RECOIL, .power = 90, .type = TYPE_ELECTRIC, .accuracy = 100, @@ -6465,7 +6465,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_GEN6] = .split = SPLIT_PHYSICAL, }, { // MOVE_COTTON_GUARD - .effect = EFFECT_PLACEHOLDER, // Needs a custom move effect + .effect = EFFECT_DEFENSE_UP_3, .power = 0, .type = TYPE_GRASS, .accuracy = 0, @@ -6525,7 +6525,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_GEN6] = .split = SPLIT_SPECIAL, }, { // MOVE_HEAD_CHARGE - .effect = EFFECT_PLACEHOLDER, // Needs a custom move effect (same as WILD_CHARGE) + .effect = EFFECT_RECOIL, .power = 120, .type = TYPE_NORMAL, .accuracy = 100, @@ -6826,7 +6826,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_GEN6] = .split = SPLIT_STATUS, }, { // MOVE_NOBLE_ROAR - .effect = EFFECT_PLACEHOLDER, // Needs a custom move effect + .effect = EFFECT_NOBLE_ROAR, .power = 0, .type = TYPE_NORMAL, .accuracy = 100, @@ -7079,7 +7079,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_GEN6] = .split = SPLIT_STATUS, }, { // MOVE_PLAY_NICE - .effect = EFFECT_PLACEHOLDER, // Needs a custom move effect + .effect = EFFECT_ATTACK_DOWN, .power = 0, .type = TYPE_NORMAL, .accuracy = 0, @@ -7115,7 +7115,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_GEN6] = .split = SPLIT_PHYSICAL, }, { // MOVE_STEAM_ERUPTION - .effect = EFFECT_PLACEHOLDER, // Needs a custom move effect (Same as SCALD) + .effect = EFFECT_SCALD, .power = 110, .type = TYPE_WATER, .accuracy = 95, @@ -7127,7 +7127,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_GEN6] = .split = SPLIT_SPECIAL, }, { // MOVE_HYPERSPACE_HOLE - .effect = EFFECT_PLACEHOLDER, // Needs a custom move effect (Same as SCALD) + .effect = EFFECT_PLACEHOLDER, // Needs a custom move effect .power = 80, .type = TYPE_PSYCHIC, .accuracy = 0, @@ -7139,7 +7139,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_GEN6] = .split = SPLIT_SPECIAL, }, { // MOVE_WATER_SHURIKEN - .effect = EFFECT_PLACEHOLDER, // Needs a custom move effect (Same with tail slap, HOWEVER If Battle Bond is activated, Water Shuriken's power rises from 15 to 20, and it always hits three times, giving it an average power of 60) + .effect = EFFECT_MULTI_HIT, .power = 15, .type = TYPE_WATER, .accuracy = 100, @@ -7199,7 +7199,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_GEN6] = .split = SPLIT_STATUS, }, { // MOVE_VENOM_DRENCH - .effect = EFFECT_PLACEHOLDER, // Needs a custom move effect + .effect = EFFECT_VENOM_DRENCH, .power = 0, .type = TYPE_POISON, .accuracy = 100, @@ -7343,7 +7343,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_GEN6] = .split = SPLIT_PHYSICAL, }, { // MOVE_INFESTATION - .effect = EFFECT_PLACEHOLDER, // Needs a custom move effect + .effect = EFFECT_TRAP, .power = 20, .type = TYPE_BUG, .accuracy = 100,