From 4c8bc9d526ed14a3f122463c4e43d3d9f13a8672 Mon Sep 17 00:00:00 2001 From: Papa Cancer Date: Wed, 3 Apr 2019 20:33:37 +0100 Subject: [PATCH] Three pointless moves MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Celebrate, Hold Hands and Happy Hour. Yay(!) Update: turns out Pay Day works differently to how I thought, so I added a new move effect for Happy Hour doubling prize money. Made all three effects subset of EFFECT_SPLASH, now called EFFECT_DUMB, as per Egg's instructions ( ͡° ͜ʖ ͡°) --- data/battle_scripts_1.s | 23 ++++++++++++++++++++--- include/constants/battle.h | 1 + include/constants/battle_move_effects.h | 2 +- include/constants/battle_string_ids.h | 1 + src/battle_message.c | 2 ++ src/battle_script_commands.c | 12 ++++++++++++ src/battle_util.c | 2 +- src/data/battle_moves.h | 10 +++++----- 8 files changed, 43 insertions(+), 10 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 764ff256c..3da8995d4 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -100,7 +100,7 @@ gBattleScriptsForMoveEffects:: @ 82D86A8 .4byte BattleScript_EffectMimic .4byte BattleScript_EffectMetronome .4byte BattleScript_EffectLeechSeed - .4byte BattleScript_EffectSplash + .4byte BattleScript_EffectDoNothing .4byte BattleScript_EffectDisable .4byte BattleScript_EffectLevelDamage .4byte BattleScript_EffectPsywave @@ -345,7 +345,7 @@ gBattleScriptsForMoveEffects:: @ 82D86A8 .4byte BattleScript_EffectPartingShot .4byte BattleScript_EffectSpectralThief .4byte BattleScript_EffectVCreate - + BattleScript_EffectVCreate: setmoveeffect MOVE_EFFECT_V_CREATE | MOVE_EFFECT_AFFECTS_USER goto BattleScript_EffectHit @@ -2835,16 +2835,33 @@ BattleScript_DoLeechSeed:: waitmessage 0x40 goto BattleScript_MoveEnd -BattleScript_EffectSplash:: +BattleScript_EffectDoNothing:: attackcanceler attackstring ppreduce + jumpifmove MOVE_HOLD_HANDS, BattleScript_EffectHoldHands attackanimation waitanimation + jumpifmove MOVE_CELEBRATE, BattleScript_EffectCelebrate + jumpifmove MOVE_HAPPY_HOUR, BattleScript_EffectHappyHour incrementgamestat GAME_STAT_USED_SPLASH printstring STRINGID_BUTNOTHINGHAPPENED waitmessage 0x40 goto BattleScript_MoveEnd +BattleScript_EffectHoldHands: + jumpifsideaffecting BS_TARGET, SIDE_STATUS_CRAFTY_SHIELD, BattleScript_ButItFailed + jumpifnotbattletype BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_DOUBLE, BattleScript_ButItFailed + attackanimation + waitanimation + goto BattleScript_MoveEnd +BattleScript_EffectCelebrate: + printstring STRINGID_CELEBRATEMESSAGE + waitmessage 0x40 + goto BattleScript_MoveEnd +BattleScript_EffectHappyHour: + setmoveeffect MOVE_EFFECT_HAPPY_HOUR + seteffectprimary + goto BattleScript_MoveEnd BattleScript_EffectDisable:: attackcanceler diff --git a/include/constants/battle.h b/include/constants/battle.h index c42188596..3b513ba06 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -326,6 +326,7 @@ #define MOVE_EFFECT_FEINT 0x3E #define MOVE_EFFECT_SPECTRAL_THIEF 0x3F #define MOVE_EFFECT_V_CREATE 0x40 +#define MOVE_EFFECT_HAPPY_HOUR 0x41 #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 bd52d065e..62b2a7ff8 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -86,7 +86,7 @@ #define EFFECT_MIMIC 82 #define EFFECT_METRONOME 83 #define EFFECT_LEECH_SEED 84 -#define EFFECT_SPLASH 85 +#define EFFECT_DO_NOTHING 85 #define EFFECT_DISABLE 86 #define EFFECT_LEVEL_DAMAGE 87 #define EFFECT_PSYWAVE 88 diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 684f2b111..5114102f7 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -527,6 +527,7 @@ #define STRINGID_FLOWERVEILPROTECTED 523 #define STRINGID_SWEETVEILPROTECTED 524 #define STRINGID_AROMAVEILPROTECTED 525 +#define STRINGID_CELEBRATEMESSAGE 526 #define BATTLESTRINGS_COUNT 529 diff --git a/src/battle_message.c b/src/battle_message.c index a344eebff..77a2829aa 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -653,9 +653,11 @@ static const u8 sText_SafetyGooglesProtected[] = _("{B_DEF_NAME_WITH_PREFIX} is static const u8 sText_FlowerVeilProtected[] = _("{B_DEF_NAME_WITH_PREFIX} surrounded itself\nwith a veil of petals!"); static const u8 sText_SweetVeilProtected[] = _("{B_DEF_NAME_WITH_PREFIX} surrounded itself\nwith a veil of sweetness!"); static const u8 sText_AromaVeilProtected[] = _("{B_DEF_NAME_WITH_PREFIX} is protected\nby an aromatic veil!"); +static const u8 sText_CelebrateMessage[] = _("Congratulations, {B_PLAYER_NAME}!"); const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = { + [STRINGID_CELEBRATEMESSAGE - 12] = sText_CelebrateMessage, [STRINGID_AROMAVEILPROTECTED - 12] = sText_AromaVeilProtected, [STRINGID_SWEETVEILPROTECTED - 12] = sText_SweetVeilProtected, [STRINGID_FLOWERVEILPROTECTED - 12] = sText_FlowerVeilProtected, diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 6595bb805..3e71638fc 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -2006,6 +2006,11 @@ void SetMoveEffect(bool32 primary, u32 certain) affectsUser = MOVE_EFFECT_AFFECTS_USER; gBattleScripting.battler = gBattlerTarget; // theoretically the attacker } + + // Just in case this flag is still set + if (gBattleScripting.moveEffect & MOVE_EFFECT_CERTAIN) + gBattleScripting.moveEffect &= ~(MOVE_EFFECT_CERTAIN); + else { gEffectBattler = gBattlerTarget; @@ -2364,6 +2369,13 @@ void SetMoveEffect(bool32 primary, u32 certain) BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = sMoveEffectBS_Ptrs[gBattleScripting.moveEffect]; break; + case MOVE_EFFECT_HAPPY_HOUR: + if (GET_BATTLER_SIDE(gBattlerAttacker) == B_SIDE_PLAYER) + { + gBattleStruct->moneyMultiplier *= 2; + } + gBattlescriptCurrInstr++; + break; case MOVE_EFFECT_TRI_ATTACK: if (gBattleMons[gEffectBattler].status1) { diff --git a/src/battle_util.c b/src/battle_util.c index d5088b9f9..0d57cb342 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -3700,7 +3700,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) { case HOLD_EFFECT_DOUBLE_PRIZE: if (GetBattlerSide(battlerId) == B_SIDE_PLAYER) - gBattleStruct->moneyMultiplier = 2; + gBattleStruct->moneyMultiplier *= 2; break; case HOLD_EFFECT_RESTORE_STATS: for (i = 0; i < NUM_BATTLE_STATS; i++) diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 18d5bd61d..3d6c81990 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -2103,7 +2103,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_SPLASH] = { - .effect = EFFECT_SPLASH, + .effect = EFFECT_DO_NOTHING, .power = 0, .type = TYPE_NORMAL, .accuracy = 0, @@ -8463,7 +8463,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_HAPPY_HOUR] = { - .effect = EFFECT_PLACEHOLDER, // Needs a custom move effect + .effect = EFFECT_DO_NOTHING, .power = 0, .type = TYPE_NORMAL, .accuracy = 0, @@ -8505,7 +8505,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_CELEBRATE] = { - .effect = EFFECT_PLACEHOLDER, // Needs a custom move effect + .effect = EFFECT_DO_NOTHING, .power = 0, .type = TYPE_NORMAL, .accuracy = 0, @@ -8519,13 +8519,13 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_HOLD_HANDS] = { - .effect = EFFECT_PLACEHOLDER, // Needs a custom move effect + .effect = EFFECT_DO_NOTHING, .power = 0, .type = TYPE_NORMAL, .accuracy = 0, .pp = 40, .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, + .target = MOVE_TARGET_ALLY, .priority = 0, .flags = 0, .split = SPLIT_STATUS,