-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Add Choice Specs Scarf hold item effects
Credits: Scyrous
By default, Pokémon Emerald only includes the Choice Band, which boosts physical type-based moves, while restricting the holder to using only the first move selected in battle. The Choice Specs and Choice Scarf items (which boost special type-based moves and speed, respectively) were not added until generation IV. Let's add their effects to Pokémon Emerald.
Please note that this tutorial will only add the hold effects, not the actual items. Additionally, this tutorial does not take into account any physical/special split alterations you may have made.
- Update hold effects header
- Give special attack boost to Choice Specs
- Give speed boost to Choice Scarf
- Update Choice Specs and Choice Scarf move
- Lock Choice Specs and Choice Scarf move
- Update Battle AI
Edit include/constants/hold_effects.h
:
#define HOLD_EFFECT_METAL_POWDER 64
#define HOLD_EFFECT_THICK_CLUB 65
#define HOLD_EFFECT_STICK 66
+#define HOLD_EFFECT_CHOICE_SPECS 67
+#define HOLD_EFFECT_CHOICE_SCARF 68
#endif // GUARD_HOLD_EFFECTS_H
Edit src\pokemon.c
:
// Apply boosts from hold items
if (attackerHoldEffect == HOLD_EFFECT_CHOICE_BAND)
attack = (150 * attack) / 100;
+ if (attackerHoldEffect == HOLD_EFFECT_CHOICE_SPECS)
+ spAttack = (150 * spAttack) / 100;
if (attackerHoldEffect == HOLD_EFFECT_SOUL_DEW && !(gBattleTypeFlags & (BATTLE_TYPE_FRONTIER)) && (attacker->species == SPECIES_LATIAS || attacker->species == SPECIES_LATIOS))
spAttack = (150 * spAttack) / 100;
Edit src\battle_main.c
:
if (holdEffect == HOLD_EFFECT_MACHO_BRACE)
speedBattler1 /= 2;
+ if (holdEffect == HOLD_EFFECT_CHOICE_SCARF)
+ speedBattler1 *= 1.5;
+
if (gBattleMons[battler1].status1 & STATUS1_PARALYSIS)
speedBattler1 /= 4;
And also:
if (holdEffect == HOLD_EFFECT_MACHO_BRACE)
speedBattler2 /= 2;
+ if (holdEffect == HOLD_EFFECT_CHOICE_SCARF)
+ speedBattler2 *= 1.5;
+
if (gBattleMons[battler2].status1 & STATUS1_PARALYSIS)
speedBattler2 /= 4;
As you can see, we added the effect twice in the same function. This is because both speedBattler1 and speedBattler2 need to be taken into account when determining which Pokémon acts first.
Edit src\battle_script_commands.c
:
case MOVEEND_CHOICE_MOVE: // update choice band move
if (gHitMarker & HITMARKER_OBEYS
- && holdEffectAtk == HOLD_EFFECT_CHOICE_BAND
+ && (holdEffectAtk == HOLD_EFFECT_CHOICE_BAND || holdEffectAtk == HOLD_EFFECT_CHOICE_SPECS || holdEffectAtk == HOLD_EFFECT_CHOICE_SCARF)
&& gChosenMove != MOVE_STRUGGLE
&& (*choicedMoveAtk == MOVE_NONE || *choicedMoveAtk == MOVE_UNAVAILABLE))
Edit src\battle_util.c
:
gPotentialItemEffectBattler = gActiveBattler;
- if (holdEffect == HOLD_EFFECT_CHOICE_BAND && *choicedMove != MOVE_NONE && *choicedMove != MOVE_UNAVAILABLE && *choicedMove != move)
+ if ((holdEffect == HOLD_EFFECT_CHOICE_BAND || holdEffect == HOLD_EFFECT_CHOICE_SPECS || holdEffect == HOLD_EFFECT_CHOICE_SCARF) && *choicedMove != MOVE_NONE && *choicedMove != MOVE_UNAVAILABLE && *choicedMove != move)
{
gCurrentMove = *choicedMove;
gLastUsedItem = gBattleMons[gActiveBattler].item;
And also:
// Choice Band
- if (holdEffect == HOLD_EFFECT_CHOICE_BAND && *choicedMove != MOVE_NONE && *choicedMove != MOVE_UNAVAILABLE && *choicedMove != gBattleMons[battlerId].moves[i])
+ if ((holdEffect == HOLD_EFFECT_CHOICE_BAND || holdEffect == HOLD_EFFECT_CHOICE_SPECS || holdEffect == HOLD_EFFECT_CHOICE_SCARF) && *choicedMove != MOVE_NONE && *choicedMove != MOVE_UNAVAILABLE && *choicedMove != gBattleMons[battlerId].moves[i])
unusableMoves |= gBitTable[i];
}
return unusableMoves;
Edit data\battle_ai_scripts.s
:
AI_CV_Trick_EffectsToEncourage:
.byte HOLD_EFFECT_CONFUSE_SPICY
.byte HOLD_EFFECT_CONFUSE_DRY
.byte HOLD_EFFECT_CONFUSE_SWEET
.byte HOLD_EFFECT_CONFUSE_BITTER
.byte HOLD_EFFECT_CONFUSE_SOUR
.byte HOLD_EFFECT_MACHO_BRACE
.byte HOLD_EFFECT_CHOICE_BAND
+ .byte HOLD_EFFECT_CHOICE_SPECS
+ .byte HOLD_EFFECT_CHOICE_SCARF
.byte -1
AI_CV_Trick_EffectsToEncourage2:
.byte HOLD_EFFECT_CHOICE_BAND
+ .byte HOLD_EFFECT_CHOICE_SPECS
+ .byte HOLD_EFFECT_CHOICE_SCARF
.byte -1
The AI seems to check for HOLD_EFFECT_CHOICE_BAND
in some capacity, so we'll add the Specs and Scarf here as well.
Now that the effects ares finalized, they can be applied to any items of your choice (no pun intended) in src\data\items.h
.
And that's it! Happy battling.