Implemented Battle Bond

This commit is contained in:
LOuroboros 2021-10-01 22:32:48 -03:00
parent f616760fc9
commit f3ded43a88
6 changed files with 43 additions and 2 deletions

View File

@ -7711,6 +7711,19 @@ BattleScript_AbilityStatusEffect::
seteffectsecondary
return
BattleScript_BattleBondActivatesOnMoveEndAttacker::
pause 5
copybyte gBattlerAbility, gBattlerAttacker
call BattleScript_AbilityPopUp
printstring STRINGID_ATTACKERBECAMEFULLYCHARGED
handleformchange BS_ATTACKER, 0
handleformchange BS_ATTACKER, 1
playanimation BS_ATTACKER, B_ANIM_FORM_CHANGE, NULL
waitanimation
handleformchange BS_ATTACKER, 2
printstring STRINGID_ATTACKERBECAMEASHGRENINJA
return
BattleScript_DancerActivates::
call BattleScript_AbilityPopUp
waitmessage B_WAIT_TIME_SHORT

View File

@ -388,5 +388,6 @@ extern const u8 BattleScript_ElectricTerrainPrevents[];
extern const u8 BattleScript_DarkTypePreventsPrankster[];
extern const u8 BattleScript_GulpMissileGorging[];
extern const u8 BattleScript_GulpMissileGulping[];
extern const u8 BattleScript_BattleBondActivatesOnMoveEndAttacker[];
#endif // GUARD_BATTLE_SCRIPTS_H

View File

@ -43,6 +43,8 @@
#define SPECIES_CRAMORANT 0
#define SPECIES_CRAMORANT_GORGING 10015
#define SPECIES_CRAMORANT_GULPING 10016
#define SPECIES_GRENINJA_BATTLE_BOND 0
#define SPECIES_GRENINJA_ASH 10017
#endif
// Items with peculiar battle effects.

View File

@ -578,8 +578,10 @@
#define STRINGID_ATKGOTOVERINFATUATION 574
#define STRINGID_TORMENTEDNOMORE 575
#define STRINGID_HEALBLOCKEDNOMORE 576
#define STRINGID_ATTACKERBECAMEFULLYCHARGED 577
#define STRINGID_ATTACKERBECAMEASHGRENINJA 578
#define BATTLESTRINGS_COUNT 577
#define BATTLESTRINGS_COUNT 579
// The below IDs are all indexes into battle message tables,
// used to determine which of a set of messages to print.

View File

@ -704,10 +704,13 @@ static const u8 sText_EjectButtonActivate[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}
static const u8 sText_AttackerGotOverInfatuation[] =_("{B_ATK_NAME_WITH_PREFIX} got over\nits infatuation!");
static const u8 sText_TormentedNoMore[] = _("{B_ATK_NAME_WITH_PREFIX} is\ntormented no more!");
static const u8 sText_HealBlockedNoMore[] = _("{B_ATK_NAME_WITH_PREFIX} is cured of\nits heal block!");
static const u8 sText_AttackerBecameFullyCharged[] = _("{B_ATK_NAME_WITH_PREFIX} became fully charged\ndue to its bond with its trainer!\p");
static const u8 sText_AttackerBecameAshGreninja[] = _("{B_ATK_NAME_WITH_PREFIX} became Ash-{B_ATK_NAME_WITH_PREFIX}!\p");
const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
{
[STRINGID_ATTACKERBECAMEASHGRENINJA - 12] = sText_AttackerBecameAshGreninja,
[STRINGID_ATTACKERBECAMEFULLYCHARGED - 12] = sText_AttackerBecameFullyCharged,
[STRINGID_HEALBLOCKEDNOMORE - 12] = sText_HealBlockedNoMore,
[STRINGID_TORMENTEDNOMORE - 12] = sText_TormentedNoMore,
[STRINGID_ATKGOTOVERINFATUATION - 12] = sText_AttackerGotOverInfatuation,

View File

@ -5065,6 +5065,16 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
effect++;
}
break;
case ABILITY_BATTLE_BOND:
if (gBattleMons[gBattlerAttacker].species == SPECIES_GRENINJA_BATTLE_BOND
&& gBattleResults.opponentFaintCounter != 0)
{
gBattleStruct->changedSpecies[gBattlerPartyIndexes[gBattlerAttacker]] = gBattleMons[gBattlerAttacker].species;
gBattleMons[gBattlerAttacker].species = SPECIES_GRENINJA_ASH;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_BattleBondActivatesOnMoveEndAttacker;
}
break;
}
break;
case ABILITYEFFECT_MOVE_END_OTHER: // Abilities that activate on *another* battler's moveend: Dancer, Soul-Heart, Receiver, Symbiosis
@ -7562,6 +7572,15 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef)
break;
}
// move-specific base power changes
switch (move)
{
case MOVE_WATER_SHURIKEN:
if (gBattleMons[battlerAtk].species == SPECIES_GRENINJA_ASH)
basePower = 20;
break;
}
if (basePower == 0)
basePower = 1;
return basePower;
@ -8726,6 +8745,7 @@ void UndoFormChange(u32 monId, u32 side, bool32 isSwitchingOut)
{SPECIES_WISHIWASHI_SCHOOL, SPECIES_WISHIWASHI},
{SPECIES_CRAMORANT_GORGING, SPECIES_CRAMORANT},
{SPECIES_CRAMORANT_GULPING, SPECIES_CRAMORANT},
{SPECIES_GRENINJA_ASH, SPECIES_GRENINJA_BATTLE_BOND},
};
if (isSwitchingOut) // Don't revert Mimikyu Busted when switching out