Dynamaxed pokemon now have increased HP
This commit is contained in:
parent
76073fab52
commit
06bf934b02
@ -2247,8 +2247,8 @@
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro applydynamaxhpmultiplier
|
||||
various 0, VARIOUS_APPLY_DYNAMAX_HP_MULTIPLIER
|
||||
.macro updatedynamax
|
||||
various 0, VARIOUS_UPDATE_DYNAMAX
|
||||
.endm
|
||||
|
||||
@ Tries to increase or decrease a battler's stat's stat stage by a specified amount. If impossible, jumps to \script.
|
||||
|
||||
@ -6684,6 +6684,7 @@ BattleScript_PursuitSwitchDmgLoop::
|
||||
BattleScript_DoSwitchOut::
|
||||
decrementmultihit BattleScript_PursuitSwitchDmgLoop
|
||||
switchoutabilities BS_ATTACKER
|
||||
updatedynamax
|
||||
waitstate
|
||||
returnatktoball
|
||||
waitstate
|
||||
@ -10595,7 +10596,7 @@ BattleScript_DynamaxBegins::
|
||||
playanimation BS_SCRIPTING, B_ANIM_SLIDE_OFFSCREEN
|
||||
waitanimation
|
||||
returntoball BS_SCRIPTING
|
||||
@applydynamaxhpmultiplier
|
||||
updatedynamax
|
||||
switchinanim BS_SCRIPTING, TRUE
|
||||
playanimation BS_SCRIPTING, B_ANIM_DYNAMAX_GROWTH
|
||||
waitanimation
|
||||
@ -10603,6 +10604,7 @@ BattleScript_DynamaxBegins::
|
||||
|
||||
BattleScript_DynamaxEnds::
|
||||
printstring STRINGID_EMPTYSTRING3
|
||||
updatedynamax
|
||||
playanimation BS_SCRIPTING, B_ANIM_FORM_CHANGE
|
||||
waitanimation
|
||||
end2
|
||||
|
||||
@ -58,6 +58,7 @@ enum MaxMoveEffect
|
||||
|
||||
bool8 IsDynamaxed(u16 battlerId);
|
||||
bool8 CanDynamax(u16 battlerId);
|
||||
void ApplyDynamaxHPMultiplier(u16 battlerId, struct Pokemon* mon);
|
||||
void PrepareBattlerForDynamax(u16 battlerId);
|
||||
void UndoDynamax(u16 battlerId);
|
||||
bool8 ShouldUseMaxMove(u16 battlerId, u16 baseMove);
|
||||
|
||||
@ -267,7 +267,7 @@
|
||||
#define VARIOUS_TRY_SET_STATUS2 175
|
||||
#define VARIOUS_TRY_HEAL_SIXTH_HP 176
|
||||
#define VARIOUS_TRY_RECYCLE_BERRY 177
|
||||
#define VARIOUS_APPLY_DYNAMAX_HP_MULTIPLIER 178
|
||||
#define VARIOUS_UPDATE_DYNAMAX 178
|
||||
|
||||
// Cmd_manipulatedamage
|
||||
#define DMG_CHANGE_SIGN 0
|
||||
|
||||
@ -106,6 +106,21 @@ bool8 CanDynamax(u16 battlerId)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Applies the HP Multiplier for Dynamaxed Pokemon and Raid Bosses.
|
||||
void ApplyDynamaxHPMultiplier(u16 battlerId, struct Pokemon* mon)
|
||||
{
|
||||
if (gBattleMons[battlerId].species == SPECIES_SHEDINJA)
|
||||
return;
|
||||
else
|
||||
{
|
||||
u16 mult = UQ_4_12(1.5); // placeholder
|
||||
u16 hp = UQ_4_12_TO_INT((GetMonData(mon, MON_DATA_HP, NULL) * mult) + UQ_4_12_ROUND);
|
||||
u16 maxHP = UQ_4_12_TO_INT((GetMonData(mon, MON_DATA_HP, NULL) * mult) + UQ_4_12_ROUND);
|
||||
SetMonData(mon, MON_DATA_HP, &hp);
|
||||
SetMonData(mon, MON_DATA_MAX_HP, &maxHP);
|
||||
}
|
||||
}
|
||||
|
||||
// Sets flags used for Dynamaxing.
|
||||
void PrepareBattlerForDynamax(u16 battlerId)
|
||||
{
|
||||
@ -115,6 +130,7 @@ void PrepareBattlerForDynamax(u16 battlerId)
|
||||
gBattleStruct->dynamax.dynamaxTurns[battlerId] = DYNAMAX_TURNS;
|
||||
}
|
||||
|
||||
// Sets flags needed for undoing Dynamax.
|
||||
void UndoDynamax(u16 battlerId)
|
||||
{
|
||||
u8 side = GetBattlerSide(battlerId);
|
||||
|
||||
@ -8482,6 +8482,8 @@ u32 IsAbilityStatusProtected(u32 battler)
|
||||
static void RecalcBattlerStats(u32 battler, struct Pokemon *mon)
|
||||
{
|
||||
CalculateMonStats(mon);
|
||||
if (IsDynamaxed(battler) && gChosenActionByBattler[battler] != B_ACTION_SWITCH)
|
||||
ApplyDynamaxHPMultiplier(battler, mon);
|
||||
gBattleMons[battler].level = GetMonData(mon, MON_DATA_LEVEL);
|
||||
gBattleMons[battler].hp = GetMonData(mon, MON_DATA_HP);
|
||||
gBattleMons[battler].maxHP = GetMonData(mon, MON_DATA_MAX_HP);
|
||||
@ -11348,21 +11350,16 @@ static void Cmd_various(void)
|
||||
}
|
||||
return;
|
||||
}
|
||||
case VARIOUS_APPLY_DYNAMAX_HP_MULTIPLIER:
|
||||
case VARIOUS_UPDATE_DYNAMAX:
|
||||
{
|
||||
VARIOUS_ARGS();
|
||||
|
||||
if (gBattleMons[gBattleScripting.battler].species != SPECIES_SHEDINJA)
|
||||
{
|
||||
u16 multiplier = UQ_4_12(2.0); // placeholder; TODO: Dynamax level
|
||||
|
||||
gBattleMons[gBattleScripting.battler].hp = UQ_4_12_TO_INT((gBattleMons[gBattleScripting.battler].hp * multiplier) + UQ_4_12_ROUND);
|
||||
gBattleMons[gBattleScripting.battler].maxHP = UQ_4_12_TO_INT((gBattleMons[gBattleScripting.battler].maxHP * multiplier) + UQ_4_12_ROUND);
|
||||
|
||||
BtlController_EmitSetMonData(BUFFER_A, REQUEST_MAX_HP_BATTLE, 0, sizeof(gBattleMons[gBattleScripting.battler].maxHP), &gBattleMons[gBattleScripting.battler].maxHP);
|
||||
BtlController_EmitSetMonData(BUFFER_A, REQUEST_HP_BATTLE, 0, sizeof(gBattleMons[gBattleScripting.battler].hp), &gBattleMons[gBattleScripting.battler].hp);
|
||||
MarkBattlerForControllerExec(gBattleScripting.battler);
|
||||
}
|
||||
u16 battler = gBattleScripting.battler;
|
||||
if (GetBattlerSide(battler) == B_SIDE_PLAYER)
|
||||
mon = &gPlayerParty[gBattlerPartyIndexes[battler]];
|
||||
else
|
||||
mon = &gEnemyParty[gBattlerPartyIndexes[battler]];
|
||||
RecalcBattlerStats(battler, mon);
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[battler], mon, HP_BOTH);
|
||||
break;
|
||||
}
|
||||
} // End of switch (cmd->id)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user