From dd51edd881ff0fa09d19f93e5aa0e66f9b374205 Mon Sep 17 00:00:00 2001 From: Evan Date: Thu, 28 Jan 2021 10:51:00 -0700 Subject: [PATCH 1/9] add eerie spell, surging strikes, jungle healing --- asm/macros/battle_script.inc | 15 +++++ data/battle_anim_scripts.s | 2 +- data/battle_scripts_1.s | 68 ++++++++++++++++++- include/constants/battle_move_effects.h | 2 + include/constants/battle_script_commands.h | 3 + src/battle_script_commands.c | 76 +++++++++++++++++++++- src/data/battle_moves.h | 8 +-- src/data/pokemon/level_up_learnsets.h | 34 ---------- 8 files changed, 167 insertions(+), 41 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index b1c42e491..208ef616c 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1765,6 +1765,21 @@ .4byte \ptr .endm + .macro eeriespellppreduce ptr:req + various BS_TARGET, VARIOUS_EERIE_SPELL_PP_REDUCE + .4byte \ptr + .endm + + .macro jumpifteamhealthy battler:req, ptr:req + various \battler, VARIOUS_JUMP_IF_TEAM_HEALTHY + .4byte \ptr + .endm + + .macro tryhealquarterhealth battler:req, ptr:req + various \battler, VARIOUS_TRY_HEAL_QUARTER_HP + .4byte \ptr + .endm + @ helpful macros .macro setstatchanger stat:req, stages:req, down:req setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7 diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index c62255f89..aa97ae324 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -14022,7 +14022,7 @@ Move_SCORCHING_SANDS:: end @to do: Move_JUNGLE_HEALING:: - end @to do: + goto Move_AROMATHERAPY Move_WICKED_BLOW:: end @to do: diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index bff609d59..9860fb38d 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -365,6 +365,40 @@ gBattleScriptsForMoveEffects:: @ 82D86A8 .4byte BattleScript_EffectFairyLock .4byte BattleScript_EffectAllySwitch .4byte BattleScript_EffectSleepHit + .4byte BattleScript_EffectEerieSpell + .4byte BattleScript_EffectJungleHealing + +BattleScript_EffectJungleHealing: + attackcanceler + attackstring + ppreduce + jumpifteamhealthy BS_ATTACKER, BattleScript_ButItFailed + attackanimation + waitanimation + copybyte gBattlerTarget, gBattlerAttacker + setbyte gBattleCommunication, 0 +JungleHealing_RestoreTargetHealth: + copybyte gBattlerAttacker, gBattlerTarget + tryhealquarterhealth BS_TARGET, JungleHealing_TryCureStatus + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE + healthbarupdate BS_TARGET + datahpupdate BS_TARGET + printstring STRINGID_PKMNREGAINEDHEALTH + waitmessage 0x40 +JungleHealing_TryCureStatus: + jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_JungleHealingCureStatus + goto JungleHealingTryRestoreAlly +BattleScript_JungleHealingCureStatus: + curestatus BS_TARGET + updatestatusicon BS_TARGET + printstring STRINGID_PKMNSTATUSNORMAL + waitmessage 0x40 +JungleHealingTryRestoreAlly: + jumpifbyte CMP_NOT_EQUAL, gBattleCommunication, 0x0, BattleScript_MoveEnd + addbyte gBattleCommunication, 1 + jumpifnoally BS_TARGET, BattleScript_MoveEnd + setallytonexttarget JungleHealing_RestoreTargetHealth + goto BattleScript_MoveEnd BattleScript_EffectSleepHit: setmoveeffect MOVE_EFFECT_SLEEP @@ -3441,6 +3475,32 @@ BattleScript_EffectDestinyBond:: waitmessage 0x40 goto BattleScript_MoveEnd +BattleScript_EffectEerieSpell:: + attackcanceler + attackstring + ppreduce + accuracycheck BattleScript_ButItFailed, ACC_CURR_MOVE + attackstring + ppreduce + critcalc + damagecalc + adjustdamage + attackanimation + waitanimation + effectivenesssound + hitanimation BS_TARGET + waitstate + healthbarupdate BS_TARGET + datahpupdate BS_TARGET + critmessage + waitmessage 0x40 + resultmessage + waitmessage 0x40 + tryfaintmon BS_TARGET, FALSE, NULL + eeriespellppreduce BattleScript_MoveEnd + printstring STRINGID_PKMNREDUCEDPP + goto BattleScript_MoveEnd + BattleScript_EffectSpite:: attackcanceler attackstring @@ -3491,7 +3551,13 @@ BattleScript_TripleKickLoop:: BattleScript_DoTripleKickAttack:: accuracycheck BattleScript_TripleKickNoMoreHits, ACC_CURR_MOVE movevaluescleanup - addbyte sTRIPLE_KICK_POWER, 10 + jumpifmove MOVE_SURGING_STRIKES, EffectTripleKick_DoDmgCalcs @ no power boost each hit + jumpifmove MOVE_TRIPLE_AXEL, EffectTripleKick_TripleAxelBoost @ triple axel gets +20 power + addbyte sTRIPLE_KICK_POWER, 10 @ triple kick gets +10 power + goto EffectTripleKick_DoDmgCalcs +EffectTripleKick_TripleAxelBoost: + addbyte sTRIPLE_KICK_POWER, 20 +EffectTripleKick_DoDmgCalcs: addbyte sMULTIHIT_STRING + 4, 0x1 critcalc damagecalc diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index b018429de..2376336d8 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -351,5 +351,7 @@ #define EFFECT_FAIRY_LOCK 345 #define EFFECT_ALLY_SWITCH 346 #define EFFECT_SLEEP_HIT 347 // Relic Song +#define EFFECT_EERIE_SPELL 348 +#define EFFECT_JUNGLE_HEALING 349 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 424009d20..f2e6fbf88 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -168,6 +168,9 @@ #define VARIOUS_JUMP_IF_ABSENT 101 #define VARIOUS_DESTROY_ABILITY_POPUP 102 #define VARIOUS_TOTEM_BOOST 103 +#define VARIOUS_EERIE_SPELL_PP_REDUCE 104 +#define VARIOUS_JUMP_IF_TEAM_HEALTHY 105 +#define VARIOUS_TRY_HEAL_QUARTER_HP 106 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 66d3154a4..b053eef54 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1711,7 +1711,8 @@ s32 CalcCritChanceStage(u8 battlerAtk, u8 battlerDef, u32 move, bool32 recordAbi } else if (gStatuses3[battlerAtk] & STATUS3_LASER_FOCUS || gBattleMoves[move].effect == EFFECT_ALWAYS_CRIT - || (abilityAtk == ABILITY_MERCILESS && gBattleMons[battlerDef].status1 & STATUS1_PSN_ANY)) + || (abilityAtk == ABILITY_MERCILESS && gBattleMons[battlerDef].status1 & STATUS1_PSN_ANY) + || move == MOVE_SURGING_STRIKES) { critChance = -2; } @@ -8333,6 +8334,79 @@ static void Cmd_various(void) gBattlescriptCurrInstr += 7; // exit if loop failed (failsafe) } return; + case VARIOUS_EERIE_SPELL_PP_REDUCE: + if (gLastMoves[gActiveBattler] != 0 && gLastMoves[gActiveBattler] != 0xFFFF) + { + s32 i; + + for (i = 0; i < MAX_MON_MOVES; i++) + { + if (gLastMoves[gActiveBattler] == gBattleMons[gActiveBattler].moves[i]) + break; + } + + if (i != MAX_MON_MOVES && gBattleMons[gActiveBattler].pp[i] != 0) + { + s32 ppToDeduct = 3; + + if (gBattleMons[gActiveBattler].pp[i] < ppToDeduct) + ppToDeduct = gBattleMons[gActiveBattler].pp[i]; + + PREPARE_MOVE_BUFFER(gBattleTextBuff1, gLastMoves[gActiveBattler]) + ConvertIntToDecimalStringN(gBattleTextBuff2, ppToDeduct, STR_CONV_MODE_LEFT_ALIGN, 1); + PREPARE_BYTE_NUMBER_BUFFER(gBattleTextBuff2, 1, ppToDeduct) + gBattleMons[gActiveBattler].pp[i] -= ppToDeduct; + if (!(gDisableStructs[gActiveBattler].mimickedMoves & gBitTable[i]) + && !(gBattleMons[gActiveBattler].status2 & STATUS2_TRANSFORMED)) + { + BtlController_EmitSetMonData(0, REQUEST_PPMOVE1_BATTLE + i, 0, 1, &gBattleMons[gActiveBattler].pp[i]); + MarkBattlerForControllerExec(gActiveBattler); + } + + if (gBattleMons[gActiveBattler].pp[i] == 0) + CancelMultiTurnMoves(gActiveBattler); + + gBattlescriptCurrInstr += 7; // continue + } + else + { + gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); // cant reduce pp + } + } + else + { + gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); // cant reduce pp + } + return; + case VARIOUS_JUMP_IF_TEAM_HEALTHY: + if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && IsBattlerAlive(BATTLE_PARTNER(gActiveBattler))) + { + u8 partner = BATTLE_PARTNER(gActiveBattler); + if ((gBattleMons[gActiveBattler].hp == gBattleMons[gActiveBattler].maxHP && !(gBattleMons[gActiveBattler].status1 & STATUS1_ANY)) + && (gBattleMons[partner].hp == gBattleMons[partner].maxHP && !(gBattleMons[partner].status1 & STATUS1_ANY))) + gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); // fail + else + gBattlescriptCurrInstr += 7; + } + else // single battle + { + if (gBattleMons[gActiveBattler].hp == gBattleMons[gActiveBattler].maxHP && !(gBattleMons[gActiveBattler].status1 & STATUS1_ANY)) + gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); // fail + else + gBattlescriptCurrInstr += 7; + } + return; + case VARIOUS_TRY_HEAL_QUARTER_HP: + gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / 4; + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + gBattleMoveDamage *= -1; + + if (gBattleMons[gActiveBattler].hp == gBattleMons[gActiveBattler].maxHP) + gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); // fail + else + gBattlescriptCurrInstr += 7; // can heal + return; } gBattlescriptCurrInstr += 3; diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index fdc6b15f9..5ce967ecd 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -11306,7 +11306,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_TRIPLE_AXEL] = { - .effect = EFFECT_TRIPLE_KICK, //TODO: Increase damage by 20 instead of 10 + .effect = EFFECT_TRIPLE_KICK, .power = 20, .type = TYPE_ICE, .accuracy = 90, @@ -11348,7 +11348,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_JUNGLE_HEALING] = { - .effect = EFFECT_PLACEHOLDER, //TODO + .effect = EFFECT_JUNGLE_HEALING, .power = 0, .type = TYPE_GRASS, .accuracy = 0, @@ -11375,7 +11375,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_SURGING_STRIKES] = { - .effect = EFFECT_PLACEHOLDER, //TODO (Multi hit + Always Crit) + .effect = EFFECT_TRIPLE_KICK, .power = 25, .type = TYPE_WATER, .accuracy = 100, @@ -11487,7 +11487,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_EERIE_SPELL] = { - .effect = EFFECT_HIT, // To do. It's a copy of Spite that inflicts damage and reduced the target's last move's PP by 3 instead of 4. + .effect = EFFECT_EERIE_SPELL, .power = 80, .type = TYPE_PSYCHIC, .accuracy = 100, diff --git a/src/data/pokemon/level_up_learnsets.h b/src/data/pokemon/level_up_learnsets.h index a5091c5e1..8dd06410e 100644 --- a/src/data/pokemon/level_up_learnsets.h +++ b/src/data/pokemon/level_up_learnsets.h @@ -1630,23 +1630,7 @@ static const struct LevelUpMove sDodrioLevelUpLearnset[] = { }; static const struct LevelUpMove sSeelLevelUpLearnset[] = { - LEVEL_UP_MOVE( 1, MOVE_HEADBUTT), LEVEL_UP_MOVE( 3, MOVE_GROWL), - LEVEL_UP_MOVE( 7, MOVE_WATER_SPORT), - LEVEL_UP_MOVE(11, MOVE_ICY_WIND), - LEVEL_UP_MOVE(13, MOVE_ENCORE), - LEVEL_UP_MOVE(17, MOVE_ICE_SHARD), - LEVEL_UP_MOVE(21, MOVE_REST), - LEVEL_UP_MOVE(23, MOVE_AQUA_RING), - LEVEL_UP_MOVE(27, MOVE_AURORA_BEAM), - LEVEL_UP_MOVE(31, MOVE_AQUA_JET), - LEVEL_UP_MOVE(33, MOVE_BRINE), - LEVEL_UP_MOVE(37, MOVE_TAKE_DOWN), - LEVEL_UP_MOVE(41, MOVE_DIVE), - LEVEL_UP_MOVE(43, MOVE_AQUA_TAIL), - LEVEL_UP_MOVE(47, MOVE_ICE_BEAM), - LEVEL_UP_MOVE(51, MOVE_SAFEGUARD), - LEVEL_UP_MOVE(53, MOVE_HAIL), LEVEL_UP_END }; @@ -2355,25 +2339,7 @@ static const struct LevelUpMove sSeakingLevelUpLearnset[] = { }; static const struct LevelUpMove sStaryuLevelUpLearnset[] = { - LEVEL_UP_MOVE( 1, MOVE_TACKLE), LEVEL_UP_MOVE( 1, MOVE_HARDEN), - LEVEL_UP_MOVE( 4, MOVE_WATER_GUN), - LEVEL_UP_MOVE( 7, MOVE_RAPID_SPIN), - LEVEL_UP_MOVE(10, MOVE_RECOVER), - LEVEL_UP_MOVE(13, MOVE_PSYWAVE), - LEVEL_UP_MOVE(16, MOVE_SWIFT), - LEVEL_UP_MOVE(18, MOVE_BUBBLE_BEAM), - LEVEL_UP_MOVE(22, MOVE_CAMOUFLAGE), - LEVEL_UP_MOVE(24, MOVE_GYRO_BALL), - LEVEL_UP_MOVE(28, MOVE_BRINE), - LEVEL_UP_MOVE(31, MOVE_MINIMIZE), - LEVEL_UP_MOVE(35, MOVE_REFLECT_TYPE), - LEVEL_UP_MOVE(37, MOVE_POWER_GEM), - LEVEL_UP_MOVE(40, MOVE_CONFUSE_RAY), - LEVEL_UP_MOVE(42, MOVE_PSYCHIC), - LEVEL_UP_MOVE(46, MOVE_LIGHT_SCREEN), - LEVEL_UP_MOVE(49, MOVE_COSMIC_POWER), - LEVEL_UP_MOVE(53, MOVE_HYDRO_PUMP), LEVEL_UP_END }; From a37acb8345b9335e9448543379ae42a47d6fda92 Mon Sep 17 00:00:00 2001 From: Evan Date: Thu, 28 Jan 2021 12:21:11 -0700 Subject: [PATCH 2/9] coaching, lash out, burning jealousy --- data/battle_anim_scripts.s | 2 +- data/battle_scripts_1.s | 31 +++++++++++++++++++++++++ include/battle.h | 2 ++ include/constants/battle.h | 3 ++- include/constants/battle_move_effects.h | 2 ++ src/battle_script_commands.c | 17 ++++++++++++-- src/battle_util.c | 4 ++++ src/data/battle_moves.h | 8 +++---- 8 files changed, 61 insertions(+), 8 deletions(-) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index aa97ae324..3b3d59c82 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -13995,7 +13995,7 @@ Move_SKITTER_SMACK:: end @to do: Move_BURNING_JEALOUSY:: - end @to do: + goto Move_OVERHEAT Move_LASH_OUT:: end @to do: diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 9860fb38d..39a000cbd 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -367,6 +367,36 @@ gBattleScriptsForMoveEffects:: @ 82D86A8 .4byte BattleScript_EffectSleepHit .4byte BattleScript_EffectEerieSpell .4byte BattleScript_EffectJungleHealing + .4byte BattleScript_EffectCoaching + .4byte BattleScript_EffectLashOut + +BattleScript_EffectCoaching: + attackcanceler + attackstring + ppreduce + jumpifnoally BS_ATTACKER, BattleScript_ButItFailed + copybyte gBattlerTarget, gBattlerAttacker + setallytonexttarget EffectCoaching_CheckAllyStats + goto BattleScript_ButItFailed +EffectCoaching_CheckAllyStats: + jumpifstat BS_TARGET, CMP_NOT_EQUAL, STAT_ATK, 12, BattleScript_CoachingWorks + jumpifstat BS_TARGET, CMP_NOT_EQUAL, STAT_DEF, 12, BattleScript_CoachingWorks + goto BattleScript_ButItFailed @ ally at max atk, def +BattleScript_CoachingWorks: + setbyte sSTAT_ANIM_PLAYED, FALSE + playstatchangeanimation BS_TARGET, BIT_ATK | BIT_DEF, 0x0 + setstatchanger STAT_ATK, 1, FALSE + statbuffchange STAT_BUFF_ALLOW_PTR | STAT_BUFF_NOT_PROTECT_AFFECTED, BattleScript_CoachingBoostDef + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_CoachingBoostDef + printfromtable gStatUpStringIds + waitmessage 0x40 +BattleScript_CoachingBoostDef: + setstatchanger STAT_DEF, 1, FALSE + statbuffchange STAT_BUFF_ALLOW_PTR | STAT_BUFF_NOT_PROTECT_AFFECTED, BattleScript_MoveEnd + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_MoveEnd + printfromtable gStatUpStringIds + waitmessage 0x40 + goto BattleScript_MoveEnd BattleScript_EffectJungleHealing: attackcanceler @@ -2082,6 +2112,7 @@ BattleScript_EffectChangeTypeOnItem: BattleScript_EffectFusionCombo: BattleScript_EffectRevelationDance: BattleScript_EffectBelch: +BattleScript_EffectLashOut: BattleScript_HitFromAtkCanceler:: attackcanceler diff --git a/include/battle.h b/include/battle.h index 5917a4ab3..632d7e7fa 100644 --- a/include/battle.h +++ b/include/battle.h @@ -144,6 +144,8 @@ struct ProtectStruct u32 specialDmg; u8 physicalBattlerId; u8 specialBattlerId; + u8 statFell:1; // placed here since cleared at end of round + u8 statRaised:1; }; struct SpecialStatus diff --git a/include/constants/battle.h b/include/constants/battle.h index 40c604c9e..a0c29d3cd 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -342,7 +342,8 @@ #define MOVE_EFFECT_THROAT_CHOP 0x43 #define MOVE_EFFECT_INCINERATE 0x44 #define MOVE_EFFECT_BUG_BITE 0x45 -#define NUM_MOVE_EFFECTS 0x46 +#define MOVE_EFFECT_BURNING_JEALOUSY 0x46 +#define NUM_MOVE_EFFECTS 0x47 #define MOVE_EFFECT_AFFECTS_USER 0x4000 #define MOVE_EFFECT_CERTAIN 0x8000 diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 2376336d8..a15cb0c6b 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -353,5 +353,7 @@ #define EFFECT_SLEEP_HIT 347 // Relic Song #define EFFECT_EERIE_SPELL 348 #define EFFECT_JUNGLE_HEALING 349 +#define EFFECT_COACHING 350 +#define EFFECT_LASH_OUT 351 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index b053eef54..7ce9692d2 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1252,7 +1252,7 @@ static bool32 TryAegiFormChange(void) static void Cmd_attackcanceler(void) { s32 i, moveType; - + if (gBattleOutcome != 0) { gCurrentActionFuncId = B_ACTION_FINISHED; @@ -2506,6 +2506,9 @@ void SetMoveEffect(bool32 primary, u32 certain) statusChanged = TRUE; break; case STATUS1_BURN: + if (gCurrentMove == MOVE_BURNING_JEALOUSY && gProtectStructs[gEffectBattler].statRaised == 0) + break; + if (GetBattlerAbility(gEffectBattler) == ABILITY_WATER_VEIL && (primary == TRUE || certain == MOVE_EFFECT_CERTAIN)) { @@ -9090,11 +9093,16 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr gBattleTextBuff2[index] = STRINGID_STATFELL >> 8; index++; gBattleTextBuff2[index] = B_BUFF_EOS; - + if (gBattleMons[gActiveBattler].statStages[statId] == MIN_STAT_STAGE) + { gBattleCommunication[MULTISTRING_CHOOSER] = 2; + } else + { gBattleCommunication[MULTISTRING_CHOOSER] = (gBattlerTarget == gActiveBattler); + gProtectStructs[gActiveBattler].statFell = 1; + } } } else // stat increase @@ -9129,9 +9137,14 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr gBattleTextBuff2[index] = B_BUFF_EOS; if (gBattleMons[gActiveBattler].statStages[statId] == MAX_STAT_STAGE) + { gBattleCommunication[MULTISTRING_CHOOSER] = 2; + } else + { gBattleCommunication[MULTISTRING_CHOOSER] = (gBattlerTarget == gActiveBattler); + gProtectStructs[gActiveBattler].statRaised = 1; + } } gBattleMons[gActiveBattler].statStages[statId] += statValue; diff --git a/src/battle_util.c b/src/battle_util.c index 58219080e..69c7706b1 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -6686,6 +6686,10 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) if (gBattleMoves[gLastUsedMove].effect == EFFECT_FUSION_COMBO && move != gLastUsedMove) basePower *= 2; break; + case EFFECT_LASH_OUT: + if (gProtectStructs[battlerAtk].statFell == 1) + basePower *= 2; + break; } if (basePower == 0) diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 5ce967ecd..9ba9c20bc 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -11222,12 +11222,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_BURNING_JEALOUSY] = { - .effect = EFFECT_PLACEHOLDER, //TODO + .effect = EFFECT_BURN_HIT, .power = 70, .type = TYPE_FIRE, .accuracy = 100, .pp = 5, - .secondaryEffectChance = 0, + .secondaryEffectChance = 100, .target = MOVE_TARGET_BOTH, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, @@ -11236,7 +11236,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_LASH_OUT] = { - .effect = EFFECT_PLACEHOLDER, //TODO + .effect = EFFECT_LASH_OUT, .power = 75, .type = TYPE_DARK, .accuracy = 100, @@ -11278,7 +11278,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_COACHING] = { - .effect = EFFECT_PLACEHOLDER, //TODO + .effect = EFFECT_COACHING, .power = 0, .type = TYPE_FIGHTING, .accuracy = 0, From c009b51ae822b3edf0ea07f3785d4bed3c0eb43a Mon Sep 17 00:00:00 2001 From: Evan Date: Thu, 28 Jan 2021 13:27:00 -0700 Subject: [PATCH 3/9] add grassy glide, misty explosion, steel roller, obstruct, behemoth, decorate, snipe shot --- asm/macros/battle_script.inc | 4 ++ data/battle_anim_scripts.s | 4 +- data/battle_scripts_1.s | 60 ++++++++++++++++++++++ include/battle.h | 5 +- include/constants/battle.h | 2 +- include/constants/battle_move_effects.h | 5 ++ include/constants/battle_script_commands.h | 1 + src/battle_anim.c | 2 +- src/battle_bg.c | 2 +- src/battle_main.c | 7 +++ src/battle_message.c | 7 ++- src/battle_script_commands.c | 46 +++++++++++++++-- src/battle_util.c | 12 +++++ src/data/battle_moves.h | 18 +++---- 14 files changed, 155 insertions(+), 20 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 208ef616c..371c1e27f 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1780,6 +1780,10 @@ .4byte \ptr .endm + .macro removeterrain + various BS_ATTACKER, VARIOUS_REMOVE_TERRAIN + .endm + @ helpful macros .macro setstatchanger stat:req, stages:req, down:req setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7 diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 3b3d59c82..9e9f4f441 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -13492,7 +13492,7 @@ Move_BODY_PRESS:: end Move_DECORATE:: - end @to do: + goto Move_FLOWER_SHIELD Move_DRUM_BEATING:: loadspritegfx ANIM_TAG_MUSIC_NOTES @@ -13968,7 +13968,7 @@ Move_EXPANDING_FORCE:: end @to do: Move_STEEL_ROLLER:: - end @to do: + goto Move_GYRO_BALL Move_SCALE_SHOT:: end @to do: diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 39a000cbd..63f99c7a4 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -369,6 +369,62 @@ gBattleScriptsForMoveEffects:: @ 82D86A8 .4byte BattleScript_EffectJungleHealing .4byte BattleScript_EffectCoaching .4byte BattleScript_EffectLashOut + .4byte BattleScript_EffectGrassyGlide + .4byte BattleScript_EffectRemoveTerrain + .4byte BattleScript_EffectBehemoth + .4byte BattleScript_EffectDecorate + +BattleScript_EffectDecorate: + attackcanceler + attackstring + ppreduce + jumpifstat BS_TARGET, CMP_NOT_EQUAL, STAT_ATK, 12, BattleScript_DecorateBoost + jumpifstat BS_TARGET, CMP_NOT_EQUAL, STAT_SPATK, 12, BattleScript_DecorateBoost + goto BattleScript_ButItFailed +BattleScript_DecorateBoost: + attackanimation + waitanimation + setbyte sSTAT_ANIM_PLAYED, FALSE + playstatchangeanimation BS_TARGET, BIT_ATK | BIT_SPATK, 0x0 + setstatchanger STAT_ATK, 2, FALSE + statbuffchange STAT_BUFF_ALLOW_PTR | STAT_BUFF_NOT_PROTECT_AFFECTED, BattleScript_DecorateBoostSpAtk + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_DecorateBoostSpAtk + printfromtable gStatUpStringIds + waitmessage 0x40 +BattleScript_DecorateBoostSpAtk: + setstatchanger STAT_SPATK, 2, FALSE + statbuffchange STAT_BUFF_ALLOW_PTR | STAT_BUFF_NOT_PROTECT_AFFECTED, BattleScript_MoveEnd + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_MoveEnd + printfromtable gStatUpStringIds + waitmessage 0x40 + goto BattleScript_MoveEnd + +BattleScript_EffectRemoveTerrain: + attackcanceler + attackstring + ppreduce + jumpifword CMP_NO_COMMON_BITS, gFieldStatuses, STATUS_FIELD_TERRAIN_ANY, BattleScript_ButItFailed + critcalc + damagecalc + adjustdamage + attackanimation + waitanimation + effectivenesssound + hitanimation BS_TARGET + waitstate + healthbarupdate BS_TARGET + datahpupdate BS_TARGET + critmessage + waitmessage 0x40 + resultmessage + waitmessage 0x40 + removeterrain + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 4, BattleScript_MoveEnd + printfromtable gTerrainEndingStringIds + waitmessage 0x40 + playanimation BS_ATTACKER, B_ANIM_RESTORE_BG, NULL + tryfaintmon BS_TARGET, FALSE, NULL + goto BattleScript_MoveEnd BattleScript_EffectCoaching: attackcanceler @@ -383,6 +439,8 @@ EffectCoaching_CheckAllyStats: jumpifstat BS_TARGET, CMP_NOT_EQUAL, STAT_DEF, 12, BattleScript_CoachingWorks goto BattleScript_ButItFailed @ ally at max atk, def BattleScript_CoachingWorks: + attackanimation + waitanimation setbyte sSTAT_ANIM_PLAYED, FALSE playstatchangeanimation BS_TARGET, BIT_ATK | BIT_DEF, 0x0 setstatchanger STAT_ATK, 1, FALSE @@ -2113,6 +2171,8 @@ BattleScript_EffectFusionCombo: BattleScript_EffectRevelationDance: BattleScript_EffectBelch: BattleScript_EffectLashOut: +BattleScript_EffectGrassyGlide: +BattleScript_EffectBehemoth: BattleScript_HitFromAtkCanceler:: attackcanceler diff --git a/include/battle.h b/include/battle.h index 632d7e7fa..95f03d8e1 100644 --- a/include/battle.h +++ b/include/battle.h @@ -117,6 +117,7 @@ struct ProtectStruct u32 spikyShielded:1; u32 kingsShielded:1; u32 banefulBunkered:1; + u32 obstruct:1; u32 endured:1; u32 noValidMoves:1; u32 helpingHand:1; @@ -140,12 +141,12 @@ struct ProtectStruct u32 usedGravityPreventedMove:1; u32 powderSelfDmg:1; u32 usedThroatChopPreventedMove:1; + u32 statFell:1; + u32 statRaised:1; u32 physicalDmg; u32 specialDmg; u8 physicalBattlerId; u8 specialBattlerId; - u8 statFell:1; // placed here since cleared at end of round - u8 statRaised:1; }; struct SpecialStatus diff --git a/include/constants/battle.h b/include/constants/battle.h index a0c29d3cd..f9e34d88b 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -234,7 +234,7 @@ #define STATUS_FIELD_ION_DELUGE 0x400 #define STATUS_FIELD_FAIRY_LOCK 0x800 -#define STATUS_TERRAIN_ANY (STATUS_FIELD_GRASSY_TERRAIN | STATUS_FIELD_MISTY_TERRAIN | STATUS_FIELD_ELECTRIC_TERRAIN | STATUS_FIELD_PSYCHIC_TERRAIN) +#define STATUS_FIELD_TERRAIN_ANY (STATUS_FIELD_GRASSY_TERRAIN | STATUS_FIELD_MISTY_TERRAIN | STATUS_FIELD_ELECTRIC_TERRAIN | STATUS_FIELD_PSYCHIC_TERRAIN) // Flags describing move's result #define MOVE_RESULT_MISSED (1 << 0) diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index a15cb0c6b..8e1f1a0cf 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -355,5 +355,10 @@ #define EFFECT_JUNGLE_HEALING 349 #define EFFECT_COACHING 350 #define EFFECT_LASH_OUT 351 +#define EFFECT_GRASSY_GLIDE 352 +#define EFFECT_REMOVE_TERRAIN 353 +#define EFFECT_BEHEMOTH 354 +#define EFFECT_DECORATE 355 +#define EFFECT_SNIPE_SHOT 356 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index f2e6fbf88..04d824830 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -171,6 +171,7 @@ #define VARIOUS_EERIE_SPELL_PP_REDUCE 104 #define VARIOUS_JUMP_IF_TEAM_HEALTHY 105 #define VARIOUS_TRY_HEAL_QUARTER_HP 106 +#define VARIOUS_REMOVE_TERRAIN 107 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/src/battle_anim.c b/src/battle_anim.c index cb7ea5bea..168b7a980 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -3205,7 +3205,7 @@ static void LoadDefaultBg(void) if (IsContest()) LoadContestBgAfterMoveAnim(); #if B_TERRAIN_BG_CHANGE == TRUE - else if (gFieldStatuses & STATUS_TERRAIN_ANY) + else if (gFieldStatuses & STATUS_FIELD_TERRAIN_ANY) DrawTerrainTypeBattleBackground(); #endif else diff --git a/src/battle_bg.c b/src/battle_bg.c index ca1893d65..521d0eae5 100644 --- a/src/battle_bg.c +++ b/src/battle_bg.c @@ -1422,7 +1422,7 @@ bool8 LoadChosenBattleElement(u8 caseId) void DrawTerrainTypeBattleBackground(void) { - switch (gFieldStatuses & STATUS_TERRAIN_ANY) + switch (gFieldStatuses & STATUS_FIELD_TERRAIN_ANY) { case STATUS_FIELD_GRASSY_TERRAIN: LoadMoveBg(BG_GRASSY_TERRAIN); diff --git a/src/battle_main.c b/src/battle_main.c index f48129acb..0ae2ca952 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -3081,6 +3081,7 @@ void FaintClearSetData(void) gProtectStructs[gActiveBattler].spikyShielded = 0; gProtectStructs[gActiveBattler].kingsShielded = 0; gProtectStructs[gActiveBattler].banefulBunkered = 0; + gProtectStructs[gActiveBattler].obstruct = 0; gProtectStructs[gActiveBattler].endured = 0; gProtectStructs[gActiveBattler].noValidMoves = 0; gProtectStructs[gActiveBattler].helpingHand = 0; @@ -3102,6 +3103,8 @@ void FaintClearSetData(void) gProtectStructs[gActiveBattler].usesBouncedMove = 0; gProtectStructs[gActiveBattler].usedGravityPreventedMove = 0; gProtectStructs[gActiveBattler].usedThroatChopPreventedMove = 0; + gProtectStructs[gActiveBattler].statFell = 0; + gProtectStructs[gActiveBattler].statRaised = 0; gDisableStructs[gActiveBattler].isFirstTurn = 2; @@ -4315,6 +4318,10 @@ s8 GetMovePriority(u32 battlerId, u16 move) { priority++; } + else if (gBattleMoves[move].effect == EFFECT_GRASSY_GLIDE && gFieldStatuses & STATUS_FIELD_GRASSY_TERRAIN && IsBattlerGrounded(battlerId)) + { + priority++; + } else if (GetBattlerAbility(battlerId) == ABILITY_TRIAGE) { switch (gBattleMoves[move].effect) diff --git a/src/battle_message.c b/src/battle_message.c index 90e8c8967..cddfb3745 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -1252,6 +1252,11 @@ const u16 gTerrainStringIds[] = STRINGID_TERRAINBECOMESMISTY, STRINGID_TERRAINBECOMESGRASSY, STRINGID_TERRAINBECOMESELECTRIC, STRINGID_TERRAINBECOMESPSYCHIC }; +const u16 gTerrainEndingStringIds[] = +{ + STRINGID_MISTYTERRAINENDS, STRINGID_GRASSYTERRAINENDS, STRINGID_ELECTRICTERRAINENDS, STRINGID_PSYCHICTERRAINENDS +}; + const u16 gTerrainPreventsStringIds[] = { STRINGID_MISTYTERRAINPREVENTS, STRINGID_ELECTRICTERRAINPREVENTS, STRINGID_PSYCHICTERRAINPREVENTS @@ -1330,7 +1335,7 @@ const u16 gRainContinuesStringIds[] = const u16 gProtectLikeUsedStringIds[] = { - STRINGID_PKMNPROTECTEDITSELF2, STRINGID_PKMNBRACEDITSELF, STRINGID_BUTITFAILED, STRINGID_PROTECTEDTEAM, + STRINGID_PKMNPROTECTEDITSELF2, STRINGID_PKMNBRACEDITSELF, STRINGID_BUTITFAILED, STRINGID_PROTECTEDTEAM }; const u16 gReflectLightScreenSafeguardStringIds[] = diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 7ce9692d2..d2bcf86b6 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1171,13 +1171,15 @@ bool32 IsBattlerProtected(u8 battlerId, u16 move) return FALSE; else if (gBattleMoves[move].effect == MOVE_EFFECT_FEINT) return FALSE; - else if (gProtectStructs[battlerId].protected) + else if (gProtectStructs[battlerId].protected && move != MOVE_DECORATE) return TRUE; else if (gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_WIDE_GUARD && gBattleMoves[move].target & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY)) return TRUE; else if (gProtectStructs[battlerId].banefulBunkered) return TRUE; + else if (gProtectStructs[battlerId].obstruct && !IS_MOVE_STATUS(move)) + return TRUE; else if (gProtectStructs[battlerId].spikyShielded) return TRUE; else if (gProtectStructs[battlerId].kingsShielded && gBattleMoves[move].power != 0) @@ -3126,7 +3128,8 @@ void SetMoveEffect(bool32 primary, u32 certain) || gSideStatuses[GetBattlerSide(gBattlerTarget)] & SIDE_STATUS_MAT_BLOCK || gProtectStructs[gBattlerTarget].spikyShielded || gProtectStructs[gBattlerTarget].kingsShielded - || gProtectStructs[gBattlerTarget].banefulBunkered) + || gProtectStructs[gBattlerTarget].banefulBunkered + || gProtectStructs[gBattlerTarget].obstruct) { gProtectStructs[gBattlerTarget].protected = 0; gSideStatuses[GetBattlerSide(gBattlerTarget)] &= ~(SIDE_STATUS_WIDE_GUARD); @@ -3136,6 +3139,7 @@ void SetMoveEffect(bool32 primary, u32 certain) gProtectStructs[gBattlerTarget].spikyShielded = 0; gProtectStructs[gBattlerTarget].kingsShielded = 0; gProtectStructs[gBattlerTarget].banefulBunkered = 0; + gProtectStructs[gBattlerTarget].obstruct = 0; if (gCurrentMove == MOVE_FEINT) { BattleScriptPush(gBattlescriptCurrInstr + 1); @@ -4722,6 +4726,16 @@ static void Cmd_moveend(void) gBattlescriptCurrInstr = BattleScript_BanefulBunkerEffect; effect = 1; } + else if (gProtectStructs[gBattlerTarget].obstruct && gCurrentMove != MOVE_SUCKER_PUNCH) + { + i = gBattlerAttacker; + gBattlerAttacker = gBattlerTarget; + gBattlerTarget = i; // gBattlerTarget and gBattlerAttacker are swapped in order to activate Defiant, if applicable + gBattleScripting.moveEffect = MOVE_EFFECT_DEF_MINUS_2; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_KingsShieldEffect; + effect = 1; + } } gBattleScripting.moveendState++; break; @@ -6951,7 +6965,7 @@ static void HandleTerrainMove(u32 moveEffect) } else { - gFieldStatuses &= ~STATUS_TERRAIN_ANY; + gFieldStatuses &= ~STATUS_FIELD_TERRAIN_ANY; gFieldStatuses |= statusFlag; if (GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_TERRAIN_EXTENDER) *timer = 8; @@ -8410,6 +8424,27 @@ static void Cmd_various(void) else gBattlescriptCurrInstr += 7; // can heal return; + case VARIOUS_REMOVE_TERRAIN: + switch (gFieldStatuses & STATUS_FIELD_TERRAIN_ANY) + { + case STATUS_FIELD_MISTY_TERRAIN: + gBattleCommunication[MULTISTRING_CHOOSER] = 0; + break; + case STATUS_FIELD_GRASSY_TERRAIN: + gBattleCommunication[MULTISTRING_CHOOSER] = 1; + break; + case STATUS_FIELD_ELECTRIC_TERRAIN: + gBattleCommunication[MULTISTRING_CHOOSER] = 2; + break; + case STATUS_FIELD_PSYCHIC_TERRAIN: + gBattleCommunication[MULTISTRING_CHOOSER] = 3; + break; + default: + gBattleCommunication[MULTISTRING_CHOOSER] = 4; // failsafe + break; + } + gFieldStatuses &= ~STATUS_FIELD_TERRAIN_ANY; // remove the terrain + break; } gBattlescriptCurrInstr += 3; @@ -8455,6 +8490,11 @@ static void Cmd_setprotectlike(void) gProtectStructs[gBattlerAttacker].banefulBunkered = 1; gBattleCommunication[MULTISTRING_CHOOSER] = 0; } + else if (gCurrentMove == MOVE_OBSTRUCT) + { + gProtectStructs[gBattlerAttacker].obstruct = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = 0; + } gDisableStructs[gBattlerAttacker].protectUses++; fail = FALSE; diff --git a/src/battle_util.c b/src/battle_util.c index 69c7706b1..326aa412c 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -141,6 +141,7 @@ void HandleAction_UseMove(void) && gBattleMoves[gCurrentMove].target == MOVE_TARGET_SELECTED && GetBattlerSide(gBattlerAttacker) != GetBattlerSide(gSideTimers[side].followmeTarget) && gBattleMons[gSideTimers[side].followmeTarget].hp != 0 + && gBattleMoves[gCurrentMove].effect != EFFECT_SNIPE_SHOT && (GetBattlerAbility(gBattlerAttacker) != ABILITY_PROPELLER_TAIL || GetBattlerAbility(gBattlerAttacker) != ABILITY_STALWART)) { @@ -162,6 +163,7 @@ void HandleAction_UseMove(void) && ((GetBattlerAbility(gActiveBattler) == ABILITY_LIGHTNING_ROD && moveType == TYPE_ELECTRIC) || (GetBattlerAbility(gActiveBattler) == ABILITY_STORM_DRAIN && moveType == TYPE_WATER)) && GetBattlerTurnOrderNum(gActiveBattler) < var + && gBattleMoves[gCurrentMove].effect != EFFECT_SNIPE_SHOT && (GetBattlerAbility(gBattlerAttacker) != ABILITY_PROPELLER_TAIL || GetBattlerAbility(gBattlerAttacker) != ABILITY_STALWART)) { @@ -6690,6 +6692,16 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) if (gProtectStructs[battlerAtk].statFell == 1) basePower *= 2; break; + case EFFECT_EXPLOSION: + if (move == MOVE_MISTY_EXPLOSION && gFieldStatuses & STATUS_FIELD_MISTY_TERRAIN && IsBattlerGrounded(battlerAtk)) + basePower = 150; + break; + case EFFECT_BEHEMOTH: + #ifdef B_DYNAMAX + if (IsDynamaxed(battlerDef))/ + basePower *= 2; + #endif + break; } if (basePower == 0) diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 9ba9c20bc..5a45f8dda 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -10605,7 +10605,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_SNIPE_SHOT] = { - .effect = EFFECT_PLACEHOLDER, //TODO + .effect = EFFECT_SNIPE_SHOT, .power = 80, .type = TYPE_WATER, .accuracy = 100, @@ -10613,7 +10613,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_SPECIAL, }, @@ -10802,7 +10802,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_DECORATE] = { - .effect = EFFECT_PLACEHOLDER, // TODO .. EFFECT_DECORATE + .effect = EFFECT_DECORATE, .power = 0, .type = TYPE_FAIRY, .accuracy = 0, @@ -10858,7 +10858,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_BEHEMOTH_BLADE] = { - .effect = EFFECT_HIT, //TODO: 2x damage if dynamaxed? meh... + .effect = EFFECT_BEHEMOTH, .power = 100, .type = TYPE_STEEL, .accuracy = 100, @@ -10872,7 +10872,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_BEHEMOTH_BASH] = { - .effect = EFFECT_HIT, //TODO: 2x damage if dynamaxed? meh... + .effect = EFFECT_BEHEMOTH, .power = 100, .type = TYPE_STEEL, .accuracy = 100, @@ -11012,7 +11012,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_OBSTRUCT] = { - .effect = EFFECT_PLACEHOLDER, //TODO. EFFECT_PROTECT? + .effect = EFFECT_PROTECT, .power = 0, .type = TYPE_DARK, .accuracy = 100, @@ -11096,7 +11096,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_STEEL_ROLLER] = { - .effect = EFFECT_PLACEHOLDER, //TODO + .effect = EFFECT_REMOVE_TERRAIN, .power = 130, .type = TYPE_STEEL, .accuracy = 100, @@ -11152,7 +11152,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_MISTY_EXPLOSION] = { - .effect = EFFECT_PLACEHOLDER, //TODO + .effect = EFFECT_EXPLOSION, .power = 100, .type = TYPE_FAIRY, .accuracy = 100, @@ -11166,7 +11166,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_GRASSY_GLIDE] = { - .effect = EFFECT_PLACEHOLDER, //TODO + .effect = EFFECT_GRASSY_GLIDE, .power = 70, .type = TYPE_GRASS, .accuracy = 100, From e11100b030f51f6c2b64888c79683c22b24ad8d2 Mon Sep 17 00:00:00 2001 From: Evan Date: Thu, 28 Jan 2021 13:31:57 -0700 Subject: [PATCH 4/9] fix temp learnsets --- src/data/pokemon/level_up_learnsets.h | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/data/pokemon/level_up_learnsets.h b/src/data/pokemon/level_up_learnsets.h index 8dd06410e..a5091c5e1 100644 --- a/src/data/pokemon/level_up_learnsets.h +++ b/src/data/pokemon/level_up_learnsets.h @@ -1630,7 +1630,23 @@ static const struct LevelUpMove sDodrioLevelUpLearnset[] = { }; static const struct LevelUpMove sSeelLevelUpLearnset[] = { + LEVEL_UP_MOVE( 1, MOVE_HEADBUTT), LEVEL_UP_MOVE( 3, MOVE_GROWL), + LEVEL_UP_MOVE( 7, MOVE_WATER_SPORT), + LEVEL_UP_MOVE(11, MOVE_ICY_WIND), + LEVEL_UP_MOVE(13, MOVE_ENCORE), + LEVEL_UP_MOVE(17, MOVE_ICE_SHARD), + LEVEL_UP_MOVE(21, MOVE_REST), + LEVEL_UP_MOVE(23, MOVE_AQUA_RING), + LEVEL_UP_MOVE(27, MOVE_AURORA_BEAM), + LEVEL_UP_MOVE(31, MOVE_AQUA_JET), + LEVEL_UP_MOVE(33, MOVE_BRINE), + LEVEL_UP_MOVE(37, MOVE_TAKE_DOWN), + LEVEL_UP_MOVE(41, MOVE_DIVE), + LEVEL_UP_MOVE(43, MOVE_AQUA_TAIL), + LEVEL_UP_MOVE(47, MOVE_ICE_BEAM), + LEVEL_UP_MOVE(51, MOVE_SAFEGUARD), + LEVEL_UP_MOVE(53, MOVE_HAIL), LEVEL_UP_END }; @@ -2339,7 +2355,25 @@ static const struct LevelUpMove sSeakingLevelUpLearnset[] = { }; static const struct LevelUpMove sStaryuLevelUpLearnset[] = { + LEVEL_UP_MOVE( 1, MOVE_TACKLE), LEVEL_UP_MOVE( 1, MOVE_HARDEN), + LEVEL_UP_MOVE( 4, MOVE_WATER_GUN), + LEVEL_UP_MOVE( 7, MOVE_RAPID_SPIN), + LEVEL_UP_MOVE(10, MOVE_RECOVER), + LEVEL_UP_MOVE(13, MOVE_PSYWAVE), + LEVEL_UP_MOVE(16, MOVE_SWIFT), + LEVEL_UP_MOVE(18, MOVE_BUBBLE_BEAM), + LEVEL_UP_MOVE(22, MOVE_CAMOUFLAGE), + LEVEL_UP_MOVE(24, MOVE_GYRO_BALL), + LEVEL_UP_MOVE(28, MOVE_BRINE), + LEVEL_UP_MOVE(31, MOVE_MINIMIZE), + LEVEL_UP_MOVE(35, MOVE_REFLECT_TYPE), + LEVEL_UP_MOVE(37, MOVE_POWER_GEM), + LEVEL_UP_MOVE(40, MOVE_CONFUSE_RAY), + LEVEL_UP_MOVE(42, MOVE_PSYCHIC), + LEVEL_UP_MOVE(46, MOVE_LIGHT_SCREEN), + LEVEL_UP_MOVE(49, MOVE_COSMIC_POWER), + LEVEL_UP_MOVE(53, MOVE_HYDRO_PUMP), LEVEL_UP_END }; From 9fcf7d2453bcb199a1987dc3cb3099c621bd03ab Mon Sep 17 00:00:00 2001 From: Evan Date: Thu, 28 Jan 2021 13:51:39 -0700 Subject: [PATCH 5/9] zero terrain timers for steel roll, remove unused move effectd --- include/constants/battle.h | 3 +-- src/battle_script_commands.c | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/constants/battle.h b/include/constants/battle.h index f9e34d88b..48616d6cd 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -342,8 +342,7 @@ #define MOVE_EFFECT_THROAT_CHOP 0x43 #define MOVE_EFFECT_INCINERATE 0x44 #define MOVE_EFFECT_BUG_BITE 0x45 -#define MOVE_EFFECT_BURNING_JEALOUSY 0x46 -#define NUM_MOVE_EFFECTS 0x47 +#define NUM_MOVE_EFFECTS 0x46 #define MOVE_EFFECT_AFFECTS_USER 0x4000 #define MOVE_EFFECT_CERTAIN 0x8000 diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index d2bcf86b6..bdefc61c6 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -8428,15 +8428,19 @@ static void Cmd_various(void) switch (gFieldStatuses & STATUS_FIELD_TERRAIN_ANY) { case STATUS_FIELD_MISTY_TERRAIN: + gFieldTimers.mistyTerrainTimer = 0; gBattleCommunication[MULTISTRING_CHOOSER] = 0; break; case STATUS_FIELD_GRASSY_TERRAIN: + gFieldTimers.grassyTerrainTimer = 0; gBattleCommunication[MULTISTRING_CHOOSER] = 1; break; case STATUS_FIELD_ELECTRIC_TERRAIN: + gFieldTimers.electricTerrainTimer = 0; gBattleCommunication[MULTISTRING_CHOOSER] = 2; break; case STATUS_FIELD_PSYCHIC_TERRAIN: + gFieldTimers.psychicTerrainTimer = 0; gBattleCommunication[MULTISTRING_CHOOSER] = 3; break; default: From c914ed8572c800d9239642ee2f92cc6124d1dbda Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Sun, 25 Jul 2021 09:38:54 -0600 Subject: [PATCH 6/9] fix sucker punch, surging strikes, obstruct, and snipe shot --- asm/macros/battle_script.inc | 5 +++ data/battle_scripts_1.s | 39 +++++++++++++++++---- include/battle.h | 2 +- include/constants/battle_move_effects.h | 5 +-- include/constants/battle_script_commands.h | 1 + src/battle_main.c | 2 +- src/battle_script_commands.c | 40 ++++++++++++++++------ src/battle_util.c | 6 ++-- src/data/battle_moves.h | 8 ++--- 9 files changed, 80 insertions(+), 28 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 9d2c58b56..6aacc37de 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1787,6 +1787,11 @@ .macro removeterrain various BS_ATTACKER, VARIOUS_REMOVE_TERRAIN .endm + + .macro jumpifobstruct ptr:req + various BS_ATTACKER, VARIOUS_JUMP_IF_OBSTRUCT + .4byte \ptr + .endm @ helpful macros .macro setstatchanger stat:req, stages:req, down:req diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index a376ae4ef..8ff056d76 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -374,8 +374,10 @@ gBattleScriptsForMoveEffects:: @ 82D86A8 .4byte BattleScript_EffectLashOut .4byte BattleScript_EffectGrassyGlide .4byte BattleScript_EffectRemoveTerrain - .4byte BattleScript_EffectBehemoth + .4byte BattleScript_EffectDynamaxDoubleDmg .4byte BattleScript_EffectDecorate + .4byte BattleScript_EffectSnipeShot + .4byte BattleScript_EffectTripleHit BattleScript_EffectDecorate: attackcanceler @@ -470,22 +472,22 @@ BattleScript_EffectJungleHealing: setbyte gBattleCommunication, 0 JungleHealing_RestoreTargetHealth: copybyte gBattlerAttacker, gBattlerTarget - tryhealquarterhealth BS_TARGET, JungleHealing_TryCureStatus + tryhealquarterhealth BS_TARGET, BattleScript_JungleHealing_TryCureStatus orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE healthbarupdate BS_TARGET datahpupdate BS_TARGET printstring STRINGID_PKMNREGAINEDHEALTH waitmessage 0x40 -JungleHealing_TryCureStatus: - jumpifmove MOVE_LIFE_DEW, JungleHealingTryRestoreAlly @ life dew only heals +BattleScript_JungleHealing_TryCureStatus: + jumpifmove MOVE_LIFE_DEW, BattleScript_JungleHealingTryRestoreAlly @ life dew only heals jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_JungleHealingCureStatus - goto JungleHealingTryRestoreAlly + goto BattleScript_JungleHealingTryRestoreAlly BattleScript_JungleHealingCureStatus: curestatus BS_TARGET updatestatusicon BS_TARGET printstring STRINGID_PKMNSTATUSNORMAL waitmessage 0x40 -JungleHealingTryRestoreAlly: +BattleScript_JungleHealingTryRestoreAlly: jumpifbyte CMP_NOT_EQUAL, gBattleCommunication, 0x0, BattleScript_MoveEnd addbyte gBattleCommunication, 1 jumpifnoally BS_TARGET, BattleScript_MoveEnd @@ -2183,7 +2185,8 @@ BattleScript_EffectBelch: BattleScript_EffectBodyPress: BattleScript_EffectLashOut: BattleScript_EffectGrassyGlide: -BattleScript_EffectBehemoth: +BattleScript_EffectDynamaxDoubleDmg: +BattleScript_EffectSnipeShot: BattleScript_HitFromAtkCanceler:: attackcanceler @@ -2255,6 +2258,17 @@ BattleScript_MoveMissed:: effectivenesssound resultmessage waitmessage B_WAIT_TIME_LONG + jumpifobstruct BattleScript_ObstructActivates + goto BattleScript_MoveEnd + +BattleScript_ObstructActivates: + jumpifstat BS_ATTACKER, CMP_EQUAL, STAT_DEF, MIN_STAT_STAGE, BattleScript_ObstructActivationEnd + setgraphicalstatchangevalues + playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 + statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_ObstructActivationEnd + printfromtable gStatDownStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_ObstructActivationEnd: goto BattleScript_MoveEnd BattleScript_EffectSleep:: @@ -2932,6 +2946,16 @@ BattleScript_EffectTrap:: setmoveeffect MOVE_EFFECT_WRAP goto BattleScript_EffectHit +BattleScript_EffectTripleHit:: + attackcanceler + accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE + attackstring + ppreduce + setmultihitcounter 3 + initmultihitstring + sethword sMULTIHIT_EFFECT, 0 + goto BattleScript_MultiHitLoop + BattleScript_EffectDoubleHit:: attackcanceler accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE @@ -8130,3 +8154,4 @@ BattleScript_JabocaRowapBerryActivate_Dmg: call BattleScript_HurtAttacker removeitem BS_TARGET return + diff --git a/include/battle.h b/include/battle.h index 3dfe8f42a..73de6fadf 100644 --- a/include/battle.h +++ b/include/battle.h @@ -119,7 +119,7 @@ struct ProtectStruct u32 spikyShielded:1; u32 kingsShielded:1; u32 banefulBunkered:1; - u32 obstruct:1; + u32 obstructed:1; u32 endured:1; u32 noValidMoves:1; u32 helpingHand:1; diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 7690c974f..43b5615a5 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -358,10 +358,11 @@ #define EFFECT_LASH_OUT 352 #define EFFECT_GRASSY_GLIDE 353 #define EFFECT_REMOVE_TERRAIN 354 -#define EFFECT_BEHEMOTH 355 +#define EFFECT_DYNAMAX_DOUBLE_DMG 355 #define EFFECT_DECORATE 356 #define EFFECT_SNIPE_SHOT 357 +#define EFFECT_TRIPLE_HIT 358 -#define NUM_BATTLE_MOVE_EFFECTS 358 +#define NUM_BATTLE_MOVE_EFFECTS 359 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index d0d5a7899..c23ec6c63 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -177,6 +177,7 @@ #define VARIOUS_JUMP_IF_TEAM_HEALTHY 106 #define VARIOUS_TRY_HEAL_QUARTER_HP 107 #define VARIOUS_REMOVE_TERRAIN 108 +#define VARIOUS_JUMP_IF_OBSTRUCT 109 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/src/battle_main.c b/src/battle_main.c index 844d0e20e..1dada5a2e 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -3064,7 +3064,7 @@ void FaintClearSetData(void) gProtectStructs[gActiveBattler].spikyShielded = 0; gProtectStructs[gActiveBattler].kingsShielded = 0; gProtectStructs[gActiveBattler].banefulBunkered = 0; - gProtectStructs[gActiveBattler].obstruct = 0; + gProtectStructs[gActiveBattler].obstructed = 0; gProtectStructs[gActiveBattler].endured = 0; gProtectStructs[gActiveBattler].noValidMoves = 0; gProtectStructs[gActiveBattler].helpingHand = 0; diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index f4a1c879f..5b2c9e4a4 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1241,14 +1241,18 @@ bool32 IsBattlerProtected(u8 battlerId, u16 move) return FALSE; else if (gBattleMoves[move].effect == MOVE_EFFECT_FEINT) return FALSE; - else if (gProtectStructs[battlerId].protected && move != MOVE_DECORATE) + else if (gProtectStructs[battlerId].protected) + { + if (move == MOVE_DECORATE && !(gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_CRAFTY_SHIELD)) + return FALSE; // decorate bypasses protect and detect, but not crafty shield return TRUE; + } else if (gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_WIDE_GUARD && gBattleMoves[move].target & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY)) return TRUE; else if (gProtectStructs[battlerId].banefulBunkered) return TRUE; - else if (gProtectStructs[battlerId].obstruct && !IS_MOVE_STATUS(move)) + else if (gProtectStructs[battlerId].obstructed && !IS_MOVE_STATUS(move)) return TRUE; else if (gProtectStructs[battlerId].spikyShielded) return TRUE; @@ -1258,10 +1262,10 @@ bool32 IsBattlerProtected(u8 battlerId, u16 move) && GetChosenMovePriority(gBattlerAttacker) > 0) return TRUE; else if (gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_CRAFTY_SHIELD - && gBattleMoves[move].power == 0) + && IS_MOVE_STATUS(move)) return TRUE; else if (gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_MAT_BLOCK - && gBattleMoves[move].power != 0) + && !IS_MOVE_STATUS(move)) return TRUE; else return FALSE; @@ -1324,7 +1328,7 @@ static bool32 TryAegiFormChange(void) static void Cmd_attackcanceler(void) { s32 i, moveType; - + if (gBattleOutcome != 0) { gCurrentActionFuncId = B_ACTION_FINISHED; @@ -3203,7 +3207,7 @@ void SetMoveEffect(bool32 primary, u32 certain) || gProtectStructs[gBattlerTarget].spikyShielded || gProtectStructs[gBattlerTarget].kingsShielded || gProtectStructs[gBattlerTarget].banefulBunkered - || gProtectStructs[gBattlerTarget].obstruct) + || gProtectStructs[gBattlerTarget].obstructed) { gProtectStructs[gBattlerTarget].protected = 0; gSideStatuses[GetBattlerSide(gBattlerTarget)] &= ~(SIDE_STATUS_WIDE_GUARD); @@ -3213,7 +3217,7 @@ void SetMoveEffect(bool32 primary, u32 certain) gProtectStructs[gBattlerTarget].spikyShielded = 0; gProtectStructs[gBattlerTarget].kingsShielded = 0; gProtectStructs[gBattlerTarget].banefulBunkered = 0; - gProtectStructs[gBattlerTarget].obstruct = 0; + gProtectStructs[gBattlerTarget].obstructed = 0; if (gCurrentMove == MOVE_FEINT) { BattleScriptPush(gBattlescriptCurrInstr + 1); @@ -4814,7 +4818,7 @@ static void Cmd_moveend(void) gBattlescriptCurrInstr = BattleScript_BanefulBunkerEffect; effect = 1; } - else if (gProtectStructs[gBattlerTarget].obstruct && gCurrentMove != MOVE_SUCKER_PUNCH) + else if (gProtectStructs[gBattlerTarget].obstructed && gCurrentMove != MOVE_SUCKER_PUNCH) { i = gBattlerAttacker; gBattlerAttacker = gBattlerTarget; @@ -7766,7 +7770,9 @@ static void Cmd_various(void) } return; case VARIOUS_SUCKER_PUNCH_CHECK: - if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget)) + if (gProtectStructs[gBattlerTarget].obstructed) + gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + else if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget)) gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); else if (gBattleMoves[gBattleMons[gBattlerTarget].moves[gBattleStruct->chosenMovePositions[gBattlerTarget]]].power == 0) gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); @@ -8538,6 +8544,20 @@ static void Cmd_various(void) } gFieldStatuses &= ~STATUS_FIELD_TERRAIN_ANY; // remove the terrain break; + case VARIOUS_JUMP_IF_OBSTRUCT: + // if obstruct blocked a contact move, sharply lower defense + if (IsMoveMakingContact(gCurrentMove, gBattlerAttacker) && gProtectStructs[gBattlerTarget].obstructed && !IS_MOVE_STATUS(gCurrentMove)) + { + SET_STATCHANGER(STAT_DEF, 2, TRUE); + gBattleScripting.battler = gBattlerAttacker; + gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + } + else + { + gBattlescriptCurrInstr += 7; + + } + return; } gBattlescriptCurrInstr += 3; @@ -8585,7 +8605,7 @@ static void Cmd_setprotectlike(void) } else if (gCurrentMove == MOVE_OBSTRUCT) { - gProtectStructs[gBattlerAttacker].obstruct = 1; + gProtectStructs[gBattlerAttacker].obstructed = 1; gBattleCommunication[MULTISTRING_CHOOSER] = 0; } diff --git a/src/battle_util.c b/src/battle_util.c index babd0b5d4..5a415ce66 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -7199,11 +7199,11 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) break; case EFFECT_EXPLOSION: if (move == MOVE_MISTY_EXPLOSION && gFieldStatuses & STATUS_FIELD_MISTY_TERRAIN && IsBattlerGrounded(battlerAtk)) - basePower = 150; + MulModifier(&basePower, UQ_4_12(1.5)); break; - case EFFECT_BEHEMOTH: + case EFFECT_DYNAMAX_DOUBLE_DMG: #ifdef B_DYNAMAX - if (IsDynamaxed(battlerDef))/ + if (IsDynamaxed(battlerDef)) basePower *= 2; #endif break; diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 5c4a035a5..be4240a21 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -10996,7 +10996,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_BEHEMOTH_BLADE] = { - .effect = EFFECT_BEHEMOTH, + .effect = EFFECT_DYNAMAX_DOUBLE_DMG, .power = 100, .type = TYPE_STEEL, .accuracy = 100, @@ -11010,7 +11010,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_BEHEMOTH_BASH] = { - .effect = EFFECT_BEHEMOTH, + .effect = EFFECT_DYNAMAX_DOUBLE_DMG, .power = 100, .type = TYPE_STEEL, .accuracy = 100, @@ -11158,7 +11158,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_USER, .priority = 4, - .flags = 0, + .flags = FLAG_PROTECTION_MOVE, .split = SPLIT_STATUS, }, @@ -11513,7 +11513,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_SURGING_STRIKES] = { - .effect = EFFECT_TRIPLE_KICK, + .effect = EFFECT_TRIPLE_HIT, .power = 25, .type = TYPE_WATER, .accuracy = 100, From c2e0990aabd6fea94f68e61ca15f150ca8e5face Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Thu, 16 Sep 2021 13:29:36 -0400 Subject: [PATCH 7/9] fix some merge conflicts --- data/battle_scripts_1.s | 648 ++++----------------- include/constants/battle_move_effects.h | 251 +------- include/constants/battle_script_commands.h | 13 +- 3 files changed, 141 insertions(+), 771 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index a49692594..865b1512d 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -18,483 +18,6 @@ .section script_data, "aw", %progbits .align 2 -<<<<<<< HEAD -gBattleScriptsForMoveEffects:: @ 82D86A8 - .4byte BattleScript_EffectHit - .4byte BattleScript_EffectSleep - .4byte BattleScript_EffectPoisonHit - .4byte BattleScript_EffectAbsorb - .4byte BattleScript_EffectBurnHit - .4byte BattleScript_EffectFreezeHit - .4byte BattleScript_EffectParalyzeHit - .4byte BattleScript_EffectExplosion - .4byte BattleScript_EffectDreamEater - .4byte BattleScript_EffectMirrorMove - .4byte BattleScript_EffectAttackUp - .4byte BattleScript_EffectDefenseUp - .4byte BattleScript_EffectSpeedUp - .4byte BattleScript_EffectSpecialAttackUp - .4byte BattleScript_EffectSpecialDefenseUp - .4byte BattleScript_EffectAccuracyUp - .4byte BattleScript_EffectEvasionUp - .4byte BattleScript_EffectSpecialAttackUp3 - .4byte BattleScript_EffectAttackDown - .4byte BattleScript_EffectDefenseDown - .4byte BattleScript_EffectSpeedDown - .4byte BattleScript_EffectSpecialAttackDown - .4byte BattleScript_EffectSpecialDefenseDown - .4byte BattleScript_EffectAccuracyDown - .4byte BattleScript_EffectEvasionDown - .4byte BattleScript_EffectHaze - .4byte BattleScript_EffectBide - .4byte BattleScript_EffectRampage - .4byte BattleScript_EffectRoar - .4byte BattleScript_EffectMultiHit - .4byte BattleScript_EffectConversion - .4byte BattleScript_EffectFlinchHit - .4byte BattleScript_EffectRestoreHp - .4byte BattleScript_EffectToxic - .4byte BattleScript_EffectPayDay - .4byte BattleScript_EffectLightScreen - .4byte BattleScript_EffectTriAttack - .4byte BattleScript_EffectRest - .4byte BattleScript_EffectOHKO - .4byte BattleScript_EffectFusionCombo - .4byte BattleScript_EffectSuperFang - .4byte BattleScript_EffectDragonRage - .4byte BattleScript_EffectTrap - .4byte BattleScript_EffectHealBlock - .4byte BattleScript_EffectDoubleHit - .4byte BattleScript_EffectRecoilIfMiss - .4byte BattleScript_EffectMist - .4byte BattleScript_EffectFocusEnergy - .4byte BattleScript_EffectRecoil25 - .4byte BattleScript_EffectConfuse - .4byte BattleScript_EffectAttackUp2 - .4byte BattleScript_EffectDefenseUp2 - .4byte BattleScript_EffectSpeedUp2 - .4byte BattleScript_EffectSpecialAttackUp2 - .4byte BattleScript_EffectSpecialDefenseUp2 - .4byte BattleScript_EffectAccuracyUp2 - .4byte BattleScript_EffectEvasionUp2 - .4byte BattleScript_EffectTransform - .4byte BattleScript_EffectAttackDown2 - .4byte BattleScript_EffectDefenseDown2 - .4byte BattleScript_EffectSpeedDown2 - .4byte BattleScript_EffectSpecialAttackDown2 - .4byte BattleScript_EffectSpecialDefenseDown2 - .4byte BattleScript_EffectAccuracyDown2 - .4byte BattleScript_EffectEvasionDown2 - .4byte BattleScript_EffectReflect - .4byte BattleScript_EffectPoison - .4byte BattleScript_EffectParalyze - .4byte BattleScript_EffectAttackDownHit - .4byte BattleScript_EffectDefenseDownHit - .4byte BattleScript_EffectSpeedDownHit - .4byte BattleScript_EffectSpecialAttackDownHit - .4byte BattleScript_EffectSpecialDefenseDownHit - .4byte BattleScript_EffectAccuracyDownHit - .4byte BattleScript_EffectEvasionDownHit - .4byte BattleScript_EffectTwoTurnsAttack - .4byte BattleScript_EffectConfuseHit - .4byte BattleScript_EffectTwineedle - .4byte BattleScript_EffectVitalThrow - .4byte BattleScript_EffectSubstitute - .4byte BattleScript_EffectRecharge - .4byte BattleScript_EffectRage - .4byte BattleScript_EffectMimic - .4byte BattleScript_EffectMetronome - .4byte BattleScript_EffectLeechSeed - .4byte BattleScript_EffectDoNothing - .4byte BattleScript_EffectDisable - .4byte BattleScript_EffectLevelDamage - .4byte BattleScript_EffectPsywave - .4byte BattleScript_EffectCounter - .4byte BattleScript_EffectEncore - .4byte BattleScript_EffectPainSplit - .4byte BattleScript_EffectSnore - .4byte BattleScript_EffectConversion2 - .4byte BattleScript_EffectLockOn - .4byte BattleScript_EffectSketch - .4byte BattleScript_EffectHammerArm - .4byte BattleScript_EffectSleepTalk - .4byte BattleScript_EffectDestinyBond - .4byte BattleScript_EffectFlail - .4byte BattleScript_EffectSpite - .4byte BattleScript_EffectFalseSwipe - .4byte BattleScript_EffectHealBell - .4byte BattleScript_EffectAlwaysCrit - .4byte BattleScript_EffectTripleKick - .4byte BattleScript_EffectThief - .4byte BattleScript_EffectMeanLook - .4byte BattleScript_EffectNightmare - .4byte BattleScript_EffectMinimize - .4byte BattleScript_EffectCurse - .4byte BattleScript_EffectHealingWish - .4byte BattleScript_EffectProtect - .4byte BattleScript_EffectSpikes - .4byte BattleScript_EffectForesight - .4byte BattleScript_EffectPerishSong - .4byte BattleScript_EffectSandstorm - .4byte BattleScript_EffectEndure - .4byte BattleScript_EffectRollout - .4byte BattleScript_EffectSwagger - .4byte BattleScript_EffectFuryCutter - .4byte BattleScript_EffectAttract - .4byte BattleScript_EffectReturn - .4byte BattleScript_EffectPresent - .4byte BattleScript_EffectFrustration - .4byte BattleScript_EffectSafeguard - .4byte BattleScript_EffectMagnitude - .4byte BattleScript_EffectBatonPass - .4byte BattleScript_EffectPursuit - .4byte BattleScript_EffectRapidSpin - .4byte BattleScript_EffectSonicboom - .4byte BattleScript_EffectCaptivate - .4byte BattleScript_EffectMorningSun - .4byte BattleScript_EffectSynthesis - .4byte BattleScript_EffectMoonlight - .4byte BattleScript_EffectHiddenPower - .4byte BattleScript_EffectRainDance - .4byte BattleScript_EffectSunnyDay - .4byte BattleScript_EffectDefenseUpHit - .4byte BattleScript_EffectAttackUpHit - .4byte BattleScript_EffectAllStatsUpHit - .4byte BattleScript_EffectFellStinger - .4byte BattleScript_EffectBellyDrum - .4byte BattleScript_EffectPsychUp - .4byte BattleScript_EffectMirrorCoat - .4byte BattleScript_EffectSkullBash - .4byte BattleScript_EffectTwister - .4byte BattleScript_EffectEarthquake - .4byte BattleScript_EffectFutureSight - .4byte BattleScript_EffectGust - .4byte BattleScript_EffectStomp - .4byte BattleScript_EffectSolarbeam - .4byte BattleScript_EffectThunder - .4byte BattleScript_EffectTeleport - .4byte BattleScript_EffectBeatUp - .4byte BattleScript_EffectSemiInvulnerable - .4byte BattleScript_EffectDefenseCurl - .4byte BattleScript_EffectSoftboiled - .4byte BattleScript_EffectFakeOut - .4byte BattleScript_EffectUproar - .4byte BattleScript_EffectStockpile - .4byte BattleScript_EffectSpitUp - .4byte BattleScript_EffectSwallow - .4byte BattleScript_EffectWorrySeed - .4byte BattleScript_EffectHail - .4byte BattleScript_EffectTorment - .4byte BattleScript_EffectFlatter - .4byte BattleScript_EffectWillOWisp - .4byte BattleScript_EffectMemento - .4byte BattleScript_EffectFacade - .4byte BattleScript_EffectFocusPunch - .4byte BattleScript_EffectSmellingsalt - .4byte BattleScript_EffectFollowMe - .4byte BattleScript_EffectNaturePower - .4byte BattleScript_EffectCharge - .4byte BattleScript_EffectTaunt - .4byte BattleScript_EffectHelpingHand - .4byte BattleScript_EffectTrick - .4byte BattleScript_EffectRolePlay - .4byte BattleScript_EffectWish - .4byte BattleScript_EffectAssist - .4byte BattleScript_EffectIngrain - .4byte BattleScript_EffectSuperpower - .4byte BattleScript_EffectMagicCoat - .4byte BattleScript_EffectRecycle - .4byte BattleScript_EffectRevenge - .4byte BattleScript_EffectBrickBreak - .4byte BattleScript_EffectYawn - .4byte BattleScript_EffectKnockOff - .4byte BattleScript_EffectEndeavor - .4byte BattleScript_EffectEruption - .4byte BattleScript_EffectSkillSwap - .4byte BattleScript_EffectImprison - .4byte BattleScript_EffectRefresh - .4byte BattleScript_EffectGrudge - .4byte BattleScript_EffectSnatch - .4byte BattleScript_EffectLowKick - .4byte BattleScript_EffectSecretPower - .4byte BattleScript_EffectRecoil33 - .4byte BattleScript_EffectTeeterDance - .4byte BattleScript_EffectHitEscape - .4byte BattleScript_EffectMudSport - .4byte BattleScript_EffectPoisonFang - .4byte BattleScript_EffectWeatherBall - .4byte BattleScript_EffectOverheat - .4byte BattleScript_EffectTickle - .4byte BattleScript_EffectCosmicPower - .4byte BattleScript_EffectSkyUppercut - .4byte BattleScript_EffectBulkUp - .4byte BattleScript_EffectPlaceholder - .4byte BattleScript_EffectWaterSport - .4byte BattleScript_EffectCalmMind - .4byte BattleScript_EffectDragonDance - .4byte BattleScript_EffectCamouflage - .4byte BattleScript_EffectPledge - .4byte BattleScript_EffectFling - .4byte BattleScript_EffectNaturalGift - .4byte BattleScript_EffectWakeUpSlap - .4byte BattleScript_EffectWringOut - .4byte BattleScript_EffectHex - .4byte BattleScript_EffectAssurance - .4byte BattleScript_EffectTrump_card - .4byte BattleScript_EffectAcrobatics - .4byte BattleScript_EffectHeatCrash - .4byte BattleScript_EffectPunishment - .4byte BattleScript_EffectStoredPower - .4byte BattleScript_EffectElectroBall - .4byte BattleScript_EffectGyroBall - .4byte BattleScript_EffectEchoedVoice - .4byte BattleScript_EffectPayback - .4byte BattleScript_EffectRound - .4byte BattleScript_EffectBrine - .4byte BattleScript_EffectVenoshock - .4byte BattleScript_EffectRetalitate - .4byte BattleScript_EffectBulldoze - .4byte BattleScript_EffectFoulPlay - .4byte BattleScript_EffectPsyshock - .4byte BattleScript_EffectRoost - .4byte BattleScript_EffectGravity - .4byte BattleScript_EffectMircleEye - .4byte BattleScript_EffectTailwind - .4byte BattleScript_EffectEmbargo - .4byte BattleScript_EffectAquaRing - .4byte BattleScript_EffectTrickRoom - .4byte BattleScript_EffectWonderRoom - .4byte BattleScript_EffectMagicRoom - .4byte BattleScript_EffectMagnetRise - .4byte BattleScript_EffectToxicSpikes - .4byte BattleScript_EffectGastroAcid - .4byte BattleScript_EffectStealthRock - .4byte BattleScript_EffectTelekinesis - .4byte BattleScript_EffectPowerSwap - .4byte BattleScript_EffectGuardSwap - .4byte BattleScript_EffectHeartSwap - .4byte BattleScript_EffectPowerSplit - .4byte BattleScript_EffectGuardSplit - .4byte BattleScript_EffectStickyWeb - .4byte BattleScript_EffectMetalBurst - .4byte BattleScript_EffectLuckyChant - .4byte BattleScript_EffectSuckerPunch - .4byte BattleScript_EffectSpecialDefenseDownHit2 - .4byte BattleScript_EffectSimpleBeam - .4byte BattleScript_EffectEntrainment - .4byte BattleScript_EffectHealPulse - .4byte BattleScript_EffectQuash - .4byte BattleScript_EffectIonDeluge - .4byte BattleScript_EffectFreezeDry - .4byte BattleScript_EffectTopsyTurvy - .4byte BattleScript_EffectMistyTerrain - .4byte BattleScript_EffectGrassyTerrain - .4byte BattleScript_EffectElectricTerrain - .4byte BattleScript_EffectPsychicTerrain - .4byte BattleScript_EffectAttackAccUp - .4byte BattleScript_EffectAttackSpAttackUp - .4byte BattleScript_EffectHurricane - .4byte BattleScript_EffectTwoTypedMove - .4byte BattleScript_EffectMeFirst - .4byte BattleScript_EffectSpeedUpHit - .4byte BattleScript_EffectQuiverDance - .4byte BattleScript_EffectCoil - .4byte BattleScript_EffectElectrify - .4byte BattleScript_EffectScald - .4byte BattleScript_EffectReflectType - .4byte BattleScript_EffectSoak - .4byte BattleScript_EffectGrowth - .4byte BattleScript_EffectCloseCombat - .4byte BattleScript_EffectLastResort - .4byte BattleScript_EffectRecoil33WithStatus - .4byte BattleScript_EffectFlinchWithStatus - .4byte BattleScript_EffectRecoil50 - .4byte BattleScript_EffectShellSmash - .4byte BattleScript_EffectShiftGear - .4byte BattleScript_EffectDefenseUp3 - .4byte BattleScript_EffectNobleRoar - .4byte BattleScript_EffectVenomDrench - .4byte BattleScript_EffectToxicThread - .4byte BattleScript_EffectClearSmog - .4byte BattleScript_EffectHitSwitchTarget - .4byte BattleScript_EffectFinalGambit - .4byte BattleScript_EffectChangeTypeOnItem - .4byte BattleScript_EffectAutotomize - .4byte BattleScript_EffectCopycat - .4byte BattleScript_EffectDefog - .4byte BattleScript_EffectHitEnemyHealAlly - .4byte BattleScript_EffectSmackDown - .4byte BattleScript_EffectSynchronoise - .4byte BattleScript_EffectPsychoShift - .4byte BattleScript_EffectPowerTrick - .4byte BattleScript_EffectFlameBurst - .4byte BattleScript_EffectAfterYou - .4byte BattleScript_EffectBestow - .4byte BattleScript_EffectRototiller - .4byte BattleScript_EffectFlowerShield - .4byte BattleScript_EffectHitPreventEscape - .4byte BattleScript_EffectSpeedSwap - .4byte BattleScript_EffectDefenseUp2Hit - .4byte BattleScript_EffectRevelationDance - .4byte BattleScript_EffectAuroraVeil - .4byte BattleScript_EffectThirdType - .4byte BattleScript_EffectFeint - .4byte BattleScript_EffectSparklingAria - .4byte BattleScript_EffectAcupressure - .4byte BattleScript_EffectAromaticMist - .4byte BattleScript_EffectPowder - .4byte BattleScript_EffectSpAtkUpHit - .4byte BattleScript_EffectBelch - .4byte BattleScript_EffectPartingShot - .4byte BattleScript_EffectSpectralThief - .4byte BattleScript_EffectVCreate - .4byte BattleScript_EffectMatBlock - .4byte BattleScript_EffectStompingTantrum - .4byte BattleScript_EffectCoreEnforcer - .4byte BattleScript_EffectInstruct - .4byte BattleScript_EffectThroatChop - .4byte BattleScript_EffectLaserFocus - .4byte BattleScript_EffectMagneticFlux - .4byte BattleScript_EffectGearUp - .4byte BattleScript_EffectIncinerate - .4byte BattleScript_EffectBugBite - .4byte BattleScript_EffectStrengthSap - .4byte BattleScript_EffectMindBlown - .4byte BattleScript_EffectPurify - .4byte BattleScript_EffectBurnUp - .4byte BattleScript_EffectShoreUp - .4byte BattleScript_EffectGeomancy - .4byte BattleScript_EffectFairyLock - .4byte BattleScript_EffectAllySwitch - .4byte BattleScript_EffectSleepHit - .4byte BattleScript_EffectAttackerDefenseDownHit - .4byte BattleScript_EffectBodyPress - .4byte BattleScript_EffectEerieSpell - .4byte BattleScript_EffectJungleHealing - .4byte BattleScript_EffectCoaching - .4byte BattleScript_EffectLashOut - .4byte BattleScript_EffectGrassyGlide - .4byte BattleScript_EffectRemoveTerrain - .4byte BattleScript_EffectDynamaxDoubleDmg - .4byte BattleScript_EffectDecorate - .4byte BattleScript_EffectSnipeShot - .4byte BattleScript_EffectTripleHit - -BattleScript_EffectDecorate: - attackcanceler - attackstring - ppreduce - jumpifstat BS_TARGET, CMP_NOT_EQUAL, STAT_ATK, 12, BattleScript_DecorateBoost - jumpifstat BS_TARGET, CMP_NOT_EQUAL, STAT_SPATK, 12, BattleScript_DecorateBoost - goto BattleScript_ButItFailed -BattleScript_DecorateBoost: - attackanimation - waitanimation - setbyte sSTAT_ANIM_PLAYED, FALSE - playstatchangeanimation BS_TARGET, BIT_ATK | BIT_SPATK, 0x0 - setstatchanger STAT_ATK, 2, FALSE - statbuffchange STAT_BUFF_ALLOW_PTR | STAT_BUFF_NOT_PROTECT_AFFECTED, BattleScript_DecorateBoostSpAtk - jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_DecorateBoostSpAtk - printfromtable gStatUpStringIds - waitmessage 0x40 -BattleScript_DecorateBoostSpAtk: - setstatchanger STAT_SPATK, 2, FALSE - statbuffchange STAT_BUFF_ALLOW_PTR | STAT_BUFF_NOT_PROTECT_AFFECTED, BattleScript_MoveEnd - jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_MoveEnd - printfromtable gStatUpStringIds - waitmessage 0x40 - goto BattleScript_MoveEnd - -BattleScript_EffectRemoveTerrain: - attackcanceler - attackstring - ppreduce - jumpifword CMP_NO_COMMON_BITS, gFieldStatuses, STATUS_FIELD_TERRAIN_ANY, BattleScript_ButItFailed - critcalc - damagecalc - adjustdamage - attackanimation - waitanimation - effectivenesssound - hitanimation BS_TARGET - waitstate - healthbarupdate BS_TARGET - datahpupdate BS_TARGET - critmessage - waitmessage 0x40 - resultmessage - waitmessage 0x40 - removeterrain - jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 4, BattleScript_MoveEnd - printfromtable gTerrainEndingStringIds - waitmessage 0x40 - playanimation BS_ATTACKER, B_ANIM_RESTORE_BG, NULL - tryfaintmon BS_TARGET, FALSE, NULL - goto BattleScript_MoveEnd - -BattleScript_EffectCoaching: - attackcanceler - attackstring - ppreduce - jumpifnoally BS_ATTACKER, BattleScript_ButItFailed - copybyte gBattlerTarget, gBattlerAttacker - setallytonexttarget EffectCoaching_CheckAllyStats - goto BattleScript_ButItFailed -EffectCoaching_CheckAllyStats: - jumpifstat BS_TARGET, CMP_NOT_EQUAL, STAT_ATK, 12, BattleScript_CoachingWorks - jumpifstat BS_TARGET, CMP_NOT_EQUAL, STAT_DEF, 12, BattleScript_CoachingWorks - goto BattleScript_ButItFailed @ ally at max atk, def -BattleScript_CoachingWorks: - attackanimation - waitanimation - setbyte sSTAT_ANIM_PLAYED, FALSE - playstatchangeanimation BS_TARGET, BIT_ATK | BIT_DEF, 0x0 - setstatchanger STAT_ATK, 1, FALSE - statbuffchange STAT_BUFF_ALLOW_PTR | STAT_BUFF_NOT_PROTECT_AFFECTED, BattleScript_CoachingBoostDef - jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_CoachingBoostDef - printfromtable gStatUpStringIds - waitmessage 0x40 -BattleScript_CoachingBoostDef: - setstatchanger STAT_DEF, 1, FALSE - statbuffchange STAT_BUFF_ALLOW_PTR | STAT_BUFF_NOT_PROTECT_AFFECTED, BattleScript_MoveEnd - jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_MoveEnd - printfromtable gStatUpStringIds - waitmessage 0x40 - goto BattleScript_MoveEnd - -BattleScript_EffectJungleHealing: - attackcanceler - attackstring - ppreduce - jumpifteamhealthy BS_ATTACKER, BattleScript_ButItFailed - attackanimation - waitanimation - copybyte gBattlerTarget, gBattlerAttacker - setbyte gBattleCommunication, 0 -JungleHealing_RestoreTargetHealth: - copybyte gBattlerAttacker, gBattlerTarget - tryhealquarterhealth BS_TARGET, BattleScript_JungleHealing_TryCureStatus - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE - healthbarupdate BS_TARGET - datahpupdate BS_TARGET - printstring STRINGID_PKMNREGAINEDHEALTH - waitmessage 0x40 -BattleScript_JungleHealing_TryCureStatus: - jumpifmove MOVE_LIFE_DEW, BattleScript_JungleHealingTryRestoreAlly @ life dew only heals - jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_JungleHealingCureStatus - goto BattleScript_JungleHealingTryRestoreAlly -BattleScript_JungleHealingCureStatus: - curestatus BS_TARGET - updatestatusicon BS_TARGET - printstring STRINGID_PKMNSTATUSNORMAL - waitmessage 0x40 -BattleScript_JungleHealingTryRestoreAlly: - jumpifbyte CMP_NOT_EQUAL, gBattleCommunication, 0x0, BattleScript_MoveEnd - addbyte gBattleCommunication, 1 - jumpifnoally BS_TARGET, BattleScript_MoveEnd - setallytonexttarget JungleHealing_RestoreTargetHealth - goto BattleScript_MoveEnd -======= gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectHit @ EFFECT_HIT .4byte BattleScript_EffectSleep @ EFFECT_SLEEP @@ -846,7 +369,131 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectSleepHit @ EFFECT_SLEEP_HIT .4byte BattleScript_EffectAttackerDefenseDownHit @ EFFECT_ATTACKER_DEFENSE_DOWN_HIT .4byte BattleScript_EffectHit @ EFFECT_BODY_PRESS ->>>>>>> 0cd7f3ffcde00002691719ae33b4fa0516662acf + .4byte BattleScript_EffectEerieSpell @ EFFECT_EERIE_SPELL + .4byte BattleScript_EffectJungleHealing @ EFFECT_JUNGLE_HEALING + .4byte BattleScript_EffectCoaching @ EFFECT_COACHING + .4byte BattleScript_EffectHit @ EFFECT_LASH_OUT + .4byte BattleScript_EffectHit @ EFFECT_GRASSY_GLIDE + .4byte BattleScript_EffectRemoveTerrain @ EFFECT_REMOVE_TERRAIN + .4byte BattleScript_EffectHit @ EFFECT_DYNAMAX_DOUBLE_DMG + .4byte BattleScript_EffectDecorate @ EFFECT_DECORATE + .4byte BattleScript_EffectHit @ EFFECT_SNIPE_SHOT + .4byte BattleScript_EffectTripleHit @ EFFECT_TRIPLE_HIT + +BattleScript_EffectDecorate: + attackcanceler + attackstring + ppreduce + jumpifstat BS_TARGET, CMP_NOT_EQUAL, STAT_ATK, 12, BattleScript_DecorateBoost + jumpifstat BS_TARGET, CMP_NOT_EQUAL, STAT_SPATK, 12, BattleScript_DecorateBoost + goto BattleScript_ButItFailed +BattleScript_DecorateBoost: + attackanimation + waitanimation + setbyte sSTAT_ANIM_PLAYED, FALSE + playstatchangeanimation BS_TARGET, BIT_ATK | BIT_SPATK, 0x0 + setstatchanger STAT_ATK, 2, FALSE + statbuffchange STAT_BUFF_ALLOW_PTR | STAT_BUFF_NOT_PROTECT_AFFECTED, BattleScript_DecorateBoostSpAtk + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_DecorateBoostSpAtk + printfromtable gStatUpStringIds + waitmessage 0x40 +BattleScript_DecorateBoostSpAtk: + setstatchanger STAT_SPATK, 2, FALSE + statbuffchange STAT_BUFF_ALLOW_PTR | STAT_BUFF_NOT_PROTECT_AFFECTED, BattleScript_MoveEnd + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_MoveEnd + printfromtable gStatUpStringIds + waitmessage 0x40 + goto BattleScript_MoveEnd + +BattleScript_EffectRemoveTerrain: + attackcanceler + attackstring + ppreduce + jumpifword CMP_NO_COMMON_BITS, gFieldStatuses, STATUS_FIELD_TERRAIN_ANY, BattleScript_ButItFailed + critcalc + damagecalc + adjustdamage + attackanimation + waitanimation + effectivenesssound + hitanimation BS_TARGET + waitstate + healthbarupdate BS_TARGET + datahpupdate BS_TARGET + critmessage + waitmessage 0x40 + resultmessage + waitmessage 0x40 + removeterrain + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 4, BattleScript_MoveEnd + printfromtable gTerrainEndingStringIds + waitmessage 0x40 + playanimation BS_ATTACKER, B_ANIM_RESTORE_BG, NULL + tryfaintmon BS_TARGET, FALSE, NULL + goto BattleScript_MoveEnd + +BattleScript_EffectCoaching: + attackcanceler + attackstring + ppreduce + jumpifnoally BS_ATTACKER, BattleScript_ButItFailed + copybyte gBattlerTarget, gBattlerAttacker + setallytonexttarget EffectCoaching_CheckAllyStats + goto BattleScript_ButItFailed +EffectCoaching_CheckAllyStats: + jumpifstat BS_TARGET, CMP_NOT_EQUAL, STAT_ATK, 12, BattleScript_CoachingWorks + jumpifstat BS_TARGET, CMP_NOT_EQUAL, STAT_DEF, 12, BattleScript_CoachingWorks + goto BattleScript_ButItFailed @ ally at max atk, def +BattleScript_CoachingWorks: + attackanimation + waitanimation + setbyte sSTAT_ANIM_PLAYED, FALSE + playstatchangeanimation BS_TARGET, BIT_ATK | BIT_DEF, 0x0 + setstatchanger STAT_ATK, 1, FALSE + statbuffchange STAT_BUFF_ALLOW_PTR | STAT_BUFF_NOT_PROTECT_AFFECTED, BattleScript_CoachingBoostDef + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_CoachingBoostDef + printfromtable gStatUpStringIds + waitmessage 0x40 +BattleScript_CoachingBoostDef: + setstatchanger STAT_DEF, 1, FALSE + statbuffchange STAT_BUFF_ALLOW_PTR | STAT_BUFF_NOT_PROTECT_AFFECTED, BattleScript_MoveEnd + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_MoveEnd + printfromtable gStatUpStringIds + waitmessage 0x40 + goto BattleScript_MoveEnd + +BattleScript_EffectJungleHealing: + attackcanceler + attackstring + ppreduce + jumpifteamhealthy BS_ATTACKER, BattleScript_ButItFailed + attackanimation + waitanimation + copybyte gBattlerTarget, gBattlerAttacker + setbyte gBattleCommunication, 0 +JungleHealing_RestoreTargetHealth: + copybyte gBattlerAttacker, gBattlerTarget + tryhealquarterhealth BS_TARGET, BattleScript_JungleHealing_TryCureStatus + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE + healthbarupdate BS_TARGET + datahpupdate BS_TARGET + printstring STRINGID_PKMNREGAINEDHEALTH + waitmessage 0x40 +BattleScript_JungleHealing_TryCureStatus: + jumpifmove MOVE_LIFE_DEW, BattleScript_JungleHealingTryRestoreAlly @ life dew only heals + jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_JungleHealingCureStatus + goto BattleScript_JungleHealingTryRestoreAlly +BattleScript_JungleHealingCureStatus: + curestatus BS_TARGET + updatestatusicon BS_TARGET + printstring STRINGID_PKMNSTATUSNORMAL + waitmessage 0x40 +BattleScript_JungleHealingTryRestoreAlly: + jumpifbyte CMP_NOT_EQUAL, gBattleCommunication, 0x0, BattleScript_MoveEnd + addbyte gBattleCommunication, 1 + jumpifnoally BS_TARGET, BattleScript_MoveEnd + setallytonexttarget JungleHealing_RestoreTargetHealth + goto BattleScript_MoveEnd BattleScript_EffectAttackerDefenseDownHit: setmoveeffect MOVE_EFFECT_DEF_MINUS_1 | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN @@ -2495,49 +2142,6 @@ BattleScript_EffectPlaceholder: goto BattleScript_MoveEnd BattleScript_EffectHit:: -<<<<<<< HEAD -BattleScript_EffectLowKick: -BattleScript_EffectFlail: -BattleScript_EffectFacade: -BattleScript_EffectRevenge: -BattleScript_EffectReturn: -BattleScript_EffectFrustration: -BattleScript_EffectEruption: -BattleScript_EffectPledge: -BattleScript_EffectFling: -BattleScript_EffectWringOut: -BattleScript_EffectHex: -BattleScript_EffectAssurance: -BattleScript_EffectTrump_card: -BattleScript_EffectAcrobatics: -BattleScript_EffectHeatCrash: -BattleScript_EffectPunishment: -BattleScript_EffectStoredPower: -BattleScript_EffectElectroBall: -BattleScript_EffectGyroBall: -BattleScript_EffectEchoedVoice: -BattleScript_EffectPayback: -BattleScript_EffectRound: -BattleScript_EffectBrine: -BattleScript_EffectVenoshock: -BattleScript_EffectRetalitate: -BattleScript_EffectFoulPlay: -BattleScript_EffectPsyshock: -BattleScript_EffectWeatherBall: -BattleScript_EffectHiddenPower: -BattleScript_EffectTwoTypedMove: -BattleScript_EffectChangeTypeOnItem: -BattleScript_EffectFusionCombo: -BattleScript_EffectRevelationDance: -BattleScript_EffectBelch: -BattleScript_EffectBodyPress: -BattleScript_EffectLashOut: -BattleScript_EffectGrassyGlide: -BattleScript_EffectDynamaxDoubleDmg: -BattleScript_EffectSnipeShot: - -======= ->>>>>>> 0cd7f3ffcde00002691719ae33b4fa0516662acf BattleScript_HitFromAtkCanceler:: attackcanceler BattleScript_HitFromAccCheck:: @@ -8544,5 +8148,3 @@ BattleScript_StickyBarbTransfer:: waitmessage B_WAIT_TIME_LONG removeitem BS_TARGET return - ->>>>>>> 0cd7f3ffcde00002691719ae33b4fa0516662acf diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index e7249f11f..760ee66fd 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -126,244 +126,6 @@ #define EFFECT_PRESENT 122 #define EFFECT_FRUSTRATION 123 #define EFFECT_SAFEGUARD 124 -<<<<<<< HEAD -#define EFFECT_MAGNITUDE 125 -#define EFFECT_BATON_PASS 126 -#define EFFECT_PURSUIT 127 -#define EFFECT_RAPID_SPIN 128 -#define EFFECT_SONICBOOM 129 -#define EFFECT_CAPTIVATE 130 -#define EFFECT_MORNING_SUN 131 -#define EFFECT_SYNTHESIS 132 -#define EFFECT_MOONLIGHT 133 -#define EFFECT_HIDDEN_POWER 134 -#define EFFECT_RAIN_DANCE 135 -#define EFFECT_SUNNY_DAY 136 -#define EFFECT_DEFENSE_UP_HIT 137 -#define EFFECT_ATTACK_UP_HIT 138 -#define EFFECT_ALL_STATS_UP_HIT 139 -#define EFFECT_FELL_STINGER 140 -#define EFFECT_BELLY_DRUM 141 -#define EFFECT_PSYCH_UP 142 -#define EFFECT_MIRROR_COAT 143 -#define EFFECT_SKULL_BASH 144 -#define EFFECT_TWISTER 145 -#define EFFECT_EARTHQUAKE 146 -#define EFFECT_FUTURE_SIGHT 147 -#define EFFECT_GUST 148 -#define EFFECT_FLINCH_MINIMIZE_HIT 149 -#define EFFECT_SOLARBEAM 150 -#define EFFECT_THUNDER 151 -#define EFFECT_TELEPORT 152 -#define EFFECT_BEAT_UP 153 -#define EFFECT_SEMI_INVULNERABLE 154 -#define EFFECT_DEFENSE_CURL 155 -#define EFFECT_SOFTBOILED 156 -#define EFFECT_FAKE_OUT 157 -#define EFFECT_UPROAR 158 -#define EFFECT_STOCKPILE 159 -#define EFFECT_SPIT_UP 160 -#define EFFECT_SWALLOW 161 -#define EFFECT_WORRY_SEED 162 -#define EFFECT_HAIL 163 -#define EFFECT_TORMENT 164 -#define EFFECT_FLATTER 165 -#define EFFECT_WILL_O_WISP 166 -#define EFFECT_MEMENTO 167 -#define EFFECT_FACADE 168 -#define EFFECT_FOCUS_PUNCH 169 -#define EFFECT_SMELLINGSALT 170 -#define EFFECT_FOLLOW_ME 171 -#define EFFECT_NATURE_POWER 172 -#define EFFECT_CHARGE 173 -#define EFFECT_TAUNT 174 -#define EFFECT_HELPING_HAND 175 -#define EFFECT_TRICK 176 -#define EFFECT_ROLE_PLAY 177 -#define EFFECT_WISH 178 -#define EFFECT_ASSIST 179 -#define EFFECT_INGRAIN 180 -#define EFFECT_SUPERPOWER 181 -#define EFFECT_MAGIC_COAT 182 -#define EFFECT_RECYCLE 183 -#define EFFECT_REVENGE 184 -#define EFFECT_BRICK_BREAK 185 -#define EFFECT_YAWN 186 -#define EFFECT_KNOCK_OFF 187 -#define EFFECT_ENDEAVOR 188 -#define EFFECT_ERUPTION 189 -#define EFFECT_SKILL_SWAP 190 -#define EFFECT_IMPRISON 191 -#define EFFECT_REFRESH 192 -#define EFFECT_GRUDGE 193 -#define EFFECT_SNATCH 194 -#define EFFECT_LOW_KICK 195 -#define EFFECT_SECRET_POWER 196 -#define EFFECT_RECOIL_33 197 -#define EFFECT_TEETER_DANCE 198 -#define EFFECT_HIT_ESCAPE 199 -#define EFFECT_MUD_SPORT 200 -#define EFFECT_POISON_FANG 201 -#define EFFECT_WEATHER_BALL 202 -#define EFFECT_OVERHEAT 203 -#define EFFECT_TICKLE 204 -#define EFFECT_COSMIC_POWER 205 -#define EFFECT_SKY_UPPERCUT 206 -#define EFFECT_BULK_UP 207 -#define EFFECT_PLACEHOLDER 208 -#define EFFECT_WATER_SPORT 209 -#define EFFECT_CALM_MIND 210 -#define EFFECT_DRAGON_DANCE 211 -#define EFFECT_CAMOUFLAGE 212 - -// -#define EFFECT_PLEDGE 213 -#define EFFECT_FLING 214 -#define EFFECT_NATURAL_GIFT 215 -#define EFFECT_WAKE_UP_SLAP 216 -#define EFFECT_WRING_OUT 217 -#define EFFECT_HEX 218 -#define EFFECT_ASSURANCE 219 -#define EFFECT_TRUMP_CARD 220 -#define EFFECT_ACROBATICS 221 -#define EFFECT_HEAT_CRASH 222 -#define EFFECT_PUNISHMENT 223 -#define EFFECT_STORED_POWER 224 -#define EFFECT_ELECTRO_BALL 225 -#define EFFECT_GYRO_BALL 226 -#define EFFECT_ECHOED_VOICE 227 -#define EFFECT_PAYBACK 228 -#define EFFECT_ROUND 229 -#define EFFECT_BRINE 230 -#define EFFECT_VENOSHOCK 231 -#define EFFECT_RETALITATE 232 -#define EFFECT_BULLDOZE 233 -#define EFFECT_FOUL_PLAY 234 -#define EFFECT_PSYSHOCK 235 -#define EFFECT_ROOST 236 -#define EFFECT_GRAVITY 237 -#define EFFECT_MIRACLE_EYE 238 -#define EFFECT_TAILWIND 239 -#define EFFECT_EMBARGO 240 -#define EFFECT_AQUA_RING 241 -#define EFFECT_TRICK_ROOM 242 -#define EFFECT_WONDER_ROOM 243 -#define EFFECT_MAGIC_ROOM 244 -#define EFFECT_MAGNET_RISE 245 -#define EFFECT_TOXIC_SPIKES 246 -#define EFFECT_GASTRO_ACID 247 -#define EFFECT_STEALTH_ROCK 248 -#define EFFECT_TELEKINESIS 249 -#define EFFECT_POWER_SWAP 250 -#define EFFECT_GUARD_SWAP 251 -#define EFFECT_HEART_SWAP 252 -#define EFFECT_POWER_SPLIT 253 -#define EFFECT_GUARD_SPLIT 254 -#define EFFECT_STICKY_WEB 255 -#define EFFECT_METAL_BURST 256 -#define EFFECT_LUCKY_CHANT 257 -#define EFFECT_SUCKER_PUNCH 258 -#define EFFECT_SPECIAL_DEFENSE_DOWN_HIT_2 259 -#define EFFECT_SIMPLE_BEAM 260 -#define EFFECT_ENTRAINMENT 261 -#define EFFECT_HEAL_PULSE 262 -#define EFFECT_QUASH 263 -#define EFFECT_ION_DELUGE 264 -#define EFFECT_FREEZE_DRY 265 -#define EFFECT_TOPSY_TURVY 266 -#define EFFECT_MISTY_TERRAIN 267 -#define EFFECT_GRASSY_TERRAIN 268 -#define EFFECT_ELECTRIC_TERRAIN 269 -#define EFFECT_PSYCHIC_TERRAIN 270 -#define EFFECT_ATTACK_ACCURACY_UP 271 -#define EFFECT_ATTACK_SPATK_UP 272 -#define EFFECT_HURRICANE 273 -#define EFFECT_TWO_TYPED_MOVE 274 -#define EFFECT_ME_FIRST 275 -#define EFFECT_SPEED_UP_HIT 276 -#define EFFECT_QUIVER_DANCE 277 -#define EFFECT_COIL 278 -#define EFFECT_ELECTRIFY 279 -#define EFFECT_SCALD 280 -#define EFFECT_REFLECT_TYPE 281 -#define EFFECT_SOAK 282 -#define EFFECT_GROWTH 283 -#define EFFECT_CLOSE_COMBAT 284 -#define EFFECT_LAST_RESORT 285 -#define EFFECT_RECOIL_33_STATUS 286 -#define EFFECT_FLINCH_STATUS 287 -#define EFFECT_RECOIL_50 288 -#define EFFECT_SHELL_SMASH 289 -#define EFFECT_SHIFT_GEAR 290 -#define EFFECT_DEFENSE_UP_3 291 -#define EFFECT_NOBLE_ROAR 292 -#define EFFECT_VENOM_DRENCH 293 -#define EFFECT_TOXIC_THREAD 294 -#define EFFECT_CLEAR_SMOG 295 -#define EFFECT_HIT_SWITCH_TARGET 296 -#define EFFECT_FINAL_GAMBIT 297 -#define EFFECT_CHANGE_TYPE_ON_ITEM 298 -#define EFFECT_AUTOTOMIZE 299 -#define EFFECT_COPYCAT 300 -#define EFFECT_DEFOG 301 -#define EFFECT_HIT_ENEMY_HEAL_ALLY 302 -#define EFFECT_SMACK_DOWN 303 -#define EFFECT_SYNCHRONOISE 304 -#define EFFECT_PSYCHO_SHIFT 305 -#define EFFECT_POWER_TRICK 306 -#define EFFECT_FLAME_BURST 307 -#define EFFECT_AFTER_YOU 308 -#define EFFECT_BESTOW 309 -#define EFFECT_ROTOTILLER 310 -#define EFFECT_FLOWER_SHIELD 311 -#define EFFECT_HIT_PREVENT_ESCAPE 312 -#define EFFECT_SPEED_SWAP 313 -#define EFFECT_DEFENSE_UP2_HIT 314 -#define EFFECT_REVELATION_DANCE 315 -#define EFFECT_AURORA_VEIL 316 -#define EFFECT_THIRD_TYPE 317 -#define EFFECT_FEINT 318 -#define EFFECT_SPARKLING_ARIA 319 -#define EFFECT_ACUPRESSURE 320 -#define EFFECT_AROMATIC_MIST 321 -#define EFFECT_POWDER 322 -#define EFFECT_SP_ATTACK_UP_HIT 323 -#define EFFECT_BELCH 324 -#define EFFECT_PARTING_SHOT 325 -#define EFFECT_SPECTRAL_THIEF 326 -#define EFFECT_V_CREATE 327 -#define EFFECT_MAT_BLOCK 328 -#define EFFECT_STOMPING_TANTRUM 329 -#define EFFECT_CORE_ENFORCER 330 -#define EFFECT_INSTRUCT 331 -#define EFFECT_THROAT_CHOP 332 -#define EFFECT_LASER_FOCUS 333 -#define EFFECT_MAGNETIC_FLUX 334 -#define EFFECT_GEAR_UP 335 -#define EFFECT_INCINERATE 336 -#define EFFECT_BUG_BITE 337 -#define EFFECT_STRENGTH_SAP 338 -#define EFFECT_MIND_BLOWN 339 -#define EFFECT_PURIFY 340 -#define EFFECT_BURN_UP 341 -#define EFFECT_SHORE_UP 342 -#define EFFECT_GEOMANCY 343 -#define EFFECT_FAIRY_LOCK 344 -#define EFFECT_ALLY_SWITCH 345 -#define EFFECT_SLEEP_HIT 346 -#define EFFECT_ATTACKER_DEFENSE_DOWN_HIT 347 -#define EFFECT_BODY_PRESS 348 -#define EFFECT_EERIE_SPELL 349 -#define EFFECT_JUNGLE_HEALING 350 -#define EFFECT_COACHING 351 -#define EFFECT_LASH_OUT 352 -#define EFFECT_GRASSY_GLIDE 353 -#define EFFECT_REMOVE_TERRAIN 354 -#define EFFECT_DYNAMAX_DOUBLE_DMG 355 -#define EFFECT_DECORATE 356 -#define EFFECT_SNIPE_SHOT 357 -#define EFFECT_TRIPLE_HIT 358 -======= #define EFFECT_UNUSED_125 125 #define EFFECT_MAGNITUDE 126 #define EFFECT_BATON_PASS 127 @@ -591,8 +353,17 @@ #define EFFECT_SLEEP_HIT 347 #define EFFECT_ATTACKER_DEFENSE_DOWN_HIT 348 #define EFFECT_BODY_PRESS 349 ->>>>>>> 0cd7f3ffcde00002691719ae33b4fa0516662acf +#define EFFECT_EERIE_SPELL 350 +#define EFFECT_JUNGLE_HEALING 351 +#define EFFECT_COACHING 352 +#define EFFECT_LASH_OUT 353 +#define EFFECT_GRASSY_GLIDE 354 +#define EFFECT_REMOVE_TERRAIN 355 +#define EFFECT_DYNAMAX_DOUBLE_DMG 356 +#define EFFECT_DECORATE 357 +#define EFFECT_SNIPE_SHOT 358 +#define EFFECT_TRIPLE_HIT 359 -#define NUM_BATTLE_MOVE_EFFECTS 359 +#define NUM_BATTLE_MOVE_EFFECTS 360 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index f9af60765..e6c806784 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -173,15 +173,12 @@ #define VARIOUS_DESTROY_ABILITY_POPUP 102 #define VARIOUS_TOTEM_BOOST 103 #define VARIOUS_TRY_ACTIVATE_GRIM_NEIGH 104 -<<<<<<< HEAD -#define VARIOUS_EERIE_SPELL_PP_REDUCE 105 -#define VARIOUS_JUMP_IF_TEAM_HEALTHY 106 -#define VARIOUS_TRY_HEAL_QUARTER_HP 107 -#define VARIOUS_REMOVE_TERRAIN 108 -#define VARIOUS_JUMP_IF_OBSTRUCT 109 -======= #define VARIOUS_MOVEEND_ITEM_EFFECTS 105 ->>>>>>> 0cd7f3ffcde00002691719ae33b4fa0516662acf +#define VARIOUS_EERIE_SPELL_PP_REDUCE 106 +#define VARIOUS_JUMP_IF_TEAM_HEALTHY 107 +#define VARIOUS_TRY_HEAL_QUARTER_HP 108 +#define VARIOUS_REMOVE_TERRAIN 109 +#define VARIOUS_JUMP_IF_OBSTRUCT 110 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 From 13062b5a8fad46ec1d4e9ecfcdee08b15f334023 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Wed, 22 Sep 2021 09:43:40 -0400 Subject: [PATCH 8/9] fix lash out, obstruct, and decorate --- asm/macros/battle_script.inc | 5 --- data/battle_scripts_1.s | 39 +++++++++------------- include/battle.h | 1 - include/constants/battle_script_commands.h | 1 - src/battle_main.c | 1 - src/battle_script_commands.c | 27 ++++++--------- src/battle_util.c | 2 +- 7 files changed, 26 insertions(+), 50 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 70ddbdf58..02c2a91d1 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1816,11 +1816,6 @@ various BS_ATTACKER, VARIOUS_REMOVE_TERRAIN .endm - .macro jumpifobstruct ptr:req - various BS_ATTACKER, VARIOUS_JUMP_IF_OBSTRUCT - .4byte \ptr - .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 261145048..755b2c382 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -382,6 +382,7 @@ gBattleScriptsForMoveEffects:: BattleScript_EffectDecorate: attackcanceler + accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE attackstring ppreduce jumpifstat BS_TARGET, CMP_NOT_EQUAL, STAT_ATK, 12, BattleScript_DecorateBoost @@ -396,13 +397,13 @@ BattleScript_DecorateBoost: statbuffchange STAT_BUFF_ALLOW_PTR | STAT_BUFF_NOT_PROTECT_AFFECTED, BattleScript_DecorateBoostSpAtk jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_DecorateBoostSpAtk printfromtable gStatUpStringIds - waitmessage 0x40 + waitmessage B_WAIT_TIME_LONG BattleScript_DecorateBoostSpAtk: setstatchanger STAT_SPATK, 2, FALSE statbuffchange STAT_BUFF_ALLOW_PTR | STAT_BUFF_NOT_PROTECT_AFFECTED, BattleScript_MoveEnd jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_MoveEnd printfromtable gStatUpStringIds - waitmessage 0x40 + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectRemoveTerrain: @@ -421,13 +422,13 @@ BattleScript_EffectRemoveTerrain: healthbarupdate BS_TARGET datahpupdate BS_TARGET critmessage - waitmessage 0x40 + waitmessage B_WAIT_TIME_LONG resultmessage - waitmessage 0x40 + waitmessage B_WAIT_TIME_LONG removeterrain jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 4, BattleScript_MoveEnd printfromtable gTerrainEndingStringIds - waitmessage 0x40 + waitmessage B_WAIT_TIME_LONG playanimation BS_ATTACKER, B_ANIM_RESTORE_BG, NULL tryfaintmon BS_TARGET, FALSE, NULL goto BattleScript_MoveEnd @@ -441,8 +442,8 @@ BattleScript_EffectCoaching: setallytonexttarget EffectCoaching_CheckAllyStats goto BattleScript_ButItFailed EffectCoaching_CheckAllyStats: - jumpifstat BS_TARGET, CMP_NOT_EQUAL, STAT_ATK, 12, BattleScript_CoachingWorks - jumpifstat BS_TARGET, CMP_NOT_EQUAL, STAT_DEF, 12, BattleScript_CoachingWorks + jumpifstat BS_TARGET, CMP_NOT_EQUAL, STAT_ATK, MAX_STAT_STAGE, BattleScript_CoachingWorks + jumpifstat BS_TARGET, CMP_NOT_EQUAL, STAT_DEF, MAX_STAT_STAGE, BattleScript_CoachingWorks goto BattleScript_ButItFailed @ ally at max atk, def BattleScript_CoachingWorks: attackanimation @@ -453,13 +454,13 @@ BattleScript_CoachingWorks: statbuffchange STAT_BUFF_ALLOW_PTR | STAT_BUFF_NOT_PROTECT_AFFECTED, BattleScript_CoachingBoostDef jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_CoachingBoostDef printfromtable gStatUpStringIds - waitmessage 0x40 + waitmessage B_WAIT_TIME_LONG BattleScript_CoachingBoostDef: setstatchanger STAT_DEF, 1, FALSE statbuffchange STAT_BUFF_ALLOW_PTR | STAT_BUFF_NOT_PROTECT_AFFECTED, BattleScript_MoveEnd jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_MoveEnd printfromtable gStatUpStringIds - waitmessage 0x40 + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectJungleHealing: @@ -478,7 +479,7 @@ JungleHealing_RestoreTargetHealth: healthbarupdate BS_TARGET datahpupdate BS_TARGET printstring STRINGID_PKMNREGAINEDHEALTH - waitmessage 0x40 + waitmessage B_WAIT_TIME_LONG BattleScript_JungleHealing_TryCureStatus: jumpifmove MOVE_LIFE_DEW, BattleScript_JungleHealingTryRestoreAlly @ life dew only heals jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_JungleHealingCureStatus @@ -487,7 +488,7 @@ BattleScript_JungleHealingCureStatus: curestatus BS_TARGET updatestatusicon BS_TARGET printstring STRINGID_PKMNSTATUSNORMAL - waitmessage 0x40 + waitmessage B_WAIT_TIME_LONG BattleScript_JungleHealingTryRestoreAlly: jumpifbyte CMP_NOT_EQUAL, gBattleCommunication, 0x0, BattleScript_MoveEnd addbyte gBattleCommunication, 1 @@ -2233,17 +2234,6 @@ BattleScript_MoveMissed:: effectivenesssound resultmessage waitmessage B_WAIT_TIME_LONG - jumpifobstruct BattleScript_ObstructActivates - goto BattleScript_MoveEnd - -BattleScript_ObstructActivates: - jumpifstat BS_ATTACKER, CMP_EQUAL, STAT_DEF, MIN_STAT_STAGE, BattleScript_ObstructActivationEnd - setgraphicalstatchangevalues - playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 - statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_ObstructActivationEnd - printfromtable gStatDownStringIds - waitmessage B_WAIT_TIME_LONG -BattleScript_ObstructActivationEnd: goto BattleScript_MoveEnd BattleScript_EffectSleep:: @@ -3624,12 +3614,13 @@ BattleScript_EffectEerieSpell:: healthbarupdate BS_TARGET datahpupdate BS_TARGET critmessage - waitmessage 0x40 + waitmessage B_WAIT_TIME_LONG resultmessage - waitmessage 0x40 + waitmessage B_WAIT_TIME_LONG tryfaintmon BS_TARGET, FALSE, NULL eeriespellppreduce BattleScript_MoveEnd printstring STRINGID_PKMNREDUCEDPP + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectSpite:: diff --git a/include/battle.h b/include/battle.h index 491e67acf..cf231f5ae 100644 --- a/include/battle.h +++ b/include/battle.h @@ -143,7 +143,6 @@ struct ProtectStruct u32 usedGravityPreventedMove:1; u32 powderSelfDmg:1; u32 usedThroatChopPreventedMove:1; - u32 statFell:1; u32 statRaised:1; u32 micle:1; u32 custap:1; // also quick claw diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 1f3a72a67..12a789c8b 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -183,7 +183,6 @@ #define VARIOUS_JUMP_IF_TEAM_HEALTHY 111 #define VARIOUS_TRY_HEAL_QUARTER_HP 112 #define VARIOUS_REMOVE_TERRAIN 113 -#define VARIOUS_JUMP_IF_OBSTRUCT 114 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/src/battle_main.c b/src/battle_main.c index ebdd54e41..0780c8802 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -3093,7 +3093,6 @@ void FaintClearSetData(void) gProtectStructs[gActiveBattler].usesBouncedMove = 0; gProtectStructs[gActiveBattler].usedGravityPreventedMove = 0; gProtectStructs[gActiveBattler].usedThroatChopPreventedMove = 0; - gProtectStructs[gActiveBattler].statFell = 0; gProtectStructs[gActiveBattler].statRaised = 0; gDisableStructs[gActiveBattler].isFirstTurn = 2; diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index e58e34725..313d3ea46 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1237,16 +1237,21 @@ static const u8 sBattlePalaceNatureToFlavorTextId[NUM_NATURES] = bool32 IsBattlerProtected(u8 battlerId, u16 move) { + // Decorate bypasses protect and detect, but not crafty shield + if (move == MOVE_DECORATE) + { + if (gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_CRAFTY_SHIELD) + return TRUE; + else if (gProtectStructs[battlerId].protected) + return FALSE; + } + if (!(gBattleMoves[move].flags & FLAG_PROTECT_AFFECTED)) return FALSE; else if (gBattleMoves[move].effect == MOVE_EFFECT_FEINT) return FALSE; else if (gProtectStructs[battlerId].protected) - { - if (move == MOVE_DECORATE && !(gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_CRAFTY_SHIELD)) - return FALSE; // decorate bypasses protect and detect, but not crafty shield return TRUE; - } else if (gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_WIDE_GUARD && gBattleMoves[move].target & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY)) return TRUE; @@ -4778,6 +4783,7 @@ static void Cmd_moveend(void) } else if (gProtectStructs[gBattlerTarget].obstructed && gCurrentMove != MOVE_SUCKER_PUNCH) { + gProtectStructs[gBattlerAttacker].touchedProtectLike = 0; i = gBattlerAttacker; gBattlerAttacker = gBattlerTarget; gBattlerTarget = i; // gBattlerTarget and gBattlerAttacker are swapped in order to activate Defiant, if applicable @@ -8697,19 +8703,6 @@ static void Cmd_various(void) } gFieldStatuses &= ~STATUS_FIELD_TERRAIN_ANY; // remove the terrain break; - case VARIOUS_JUMP_IF_OBSTRUCT: - // if obstruct blocked a contact move, sharply lower defense - if (IsMoveMakingContact(gCurrentMove, gBattlerAttacker) && gProtectStructs[gBattlerTarget].obstructed && !IS_MOVE_STATUS(gCurrentMove)) - { - SET_STATCHANGER(STAT_DEF, 2, TRUE); - gBattleScripting.battler = gBattlerAttacker; - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); - } - else - { - gBattlescriptCurrInstr += 7; - } - return; } gBattlescriptCurrInstr += 3; diff --git a/src/battle_util.c b/src/battle_util.c index 0473fa054..16adcda75 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -7468,7 +7468,7 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) basePower *= 2; break; case EFFECT_LASH_OUT: - if (gProtectStructs[battlerAtk].statFell == 1) + if (gSpecialStatuses[battlerAtk].statFell == 1) basePower *= 2; break; case EFFECT_EXPLOSION: From 9bf2ffe45902a8ba23a0310a847e0cb32986bb74 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Wed, 22 Sep 2021 21:15:02 -0400 Subject: [PATCH 9/9] fix lash out stat fell --- include/battle.h | 2 +- src/battle_script_commands.c | 6 +++--- src/battle_util.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/battle.h b/include/battle.h index cf231f5ae..b36780ee5 100644 --- a/include/battle.h +++ b/include/battle.h @@ -148,6 +148,7 @@ struct ProtectStruct u32 custap:1; // also quick claw u32 touchedProtectLike:1; u32 disableEjectPack:1; + u32 statFell:1; u32 physicalDmg; u32 specialDmg; u8 physicalBattlerId; @@ -156,7 +157,6 @@ struct ProtectStruct struct SpecialStatus { - u8 statFell:1; u8 statLowered:1; u8 lightningRodRedirected:1; u8 restoredBattlerSprite: 1; diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index ea9278f45..42e723ecc 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -5164,12 +5164,12 @@ static void Cmd_moveend(void) { u8 battler = battlers[i]; if (IsBattlerAlive(battler) - && gSpecialStatuses[battler].statFell + && gProtectStructs[battler].statFell && GetBattlerHoldEffect(battler, TRUE) == HOLD_EFFECT_EJECT_PACK && !(gCurrentMove == MOVE_PARTING_SHOT && CanBattlerSwitch(gBattlerAttacker)) // Does not activate if attacker used Parting Shot and can switch out && CountUsablePartyMons(battler) > 0) // Has mon to switch into { - gSpecialStatuses[battler].statFell = FALSE; + gProtectStructs[battler].statFell = FALSE; gActiveBattler = gBattleScripting.battler = battler; gLastUsedItem = gBattleMons[battler].item; BattleScriptPushCursor(); @@ -9409,7 +9409,7 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr { // Check eject pack. disableEjectPack set for edge cases (e.g. attacking weak armor'd eject pack holder with u-turn) if (gProtectStructs[gActiveBattler].disableEjectPack == 0) - gSpecialStatuses[gActiveBattler].statFell = TRUE; + gProtectStructs[gActiveBattler].statFell = 1; gBattleCommunication[MULTISTRING_CHOOSER] = (gBattlerTarget == gActiveBattler); // B_MSG_ATTACKER_STAT_FELL or B_MSG_DEFENDER_STAT_FELL } } diff --git a/src/battle_util.c b/src/battle_util.c index 6eb655636..80b5f824c 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -5996,10 +5996,10 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) } break; case HOLD_EFFECT_EJECT_PACK: - if (gSpecialStatuses[battlerId].statFell + if (gProtectStructs[battlerId].statFell && !(gCurrentMove == MOVE_PARTING_SHOT && CanBattlerSwitch(gBattlerAttacker))) // Does not activate if attacker used Parting Shot and can switch out { - gSpecialStatuses[battlerId].statFell = FALSE; + gProtectStructs[battlerId].statFell = FALSE; gActiveBattler = gBattleScripting.battler = battlerId; effect = ITEM_STATS_CHANGE; if (moveTurn) @@ -7468,7 +7468,7 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) basePower *= 2; break; case EFFECT_LASH_OUT: - if (gSpecialStatuses[battlerAtk].statFell == 1) + if (gProtectStructs[battlerAtk].statFell) basePower *= 2; break; case EFFECT_EXPLOSION: