aftermath damp pop-ups and string
This commit is contained in:
parent
0c4c3fbbb7
commit
0dc5e1e685
5 changed files with 40 additions and 19 deletions
|
@ -7900,6 +7900,16 @@ BattleScript_AftermathDmg::
|
|||
waitmessage B_WAIT_TIME_LONG
|
||||
tryfaintmon BS_ATTACKER
|
||||
return
|
||||
|
||||
BattleScript_DampPreventsAftermath::
|
||||
pause B_WAIT_TIME_SHORT
|
||||
call BattleScript_AbilityPopUp
|
||||
pause 40
|
||||
copybyte gBattlerAbility, sBATTLER
|
||||
call BattleScript_AbilityPopUp
|
||||
printstring STRINGID_PKMNSABILITYPREVENTSABILITY
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
return
|
||||
|
||||
BattleScript_MoveUsedIsAsleep::
|
||||
printstring STRINGID_PKMNFASTASLEEP
|
||||
|
|
|
@ -451,6 +451,7 @@ extern const u8 BattleScript_EarthEaterActivates[];
|
|||
extern const u8 BattleScript_MimicryActivates_End3[];
|
||||
extern const u8 BattleScript_IceFaceNullsDamage[];
|
||||
extern const u8 BattleScript_BattlerFormChangeWithStringEnd3[];
|
||||
extern const u8 BattleScript_DampPreventsAftermath[];
|
||||
|
||||
// zmoves
|
||||
extern const u8 BattleScript_ZMoveActivateDamaging[];
|
||||
|
|
|
@ -638,8 +638,9 @@
|
|||
#define STRINGID_ELECTRICTERRAINACTIVATEDABILITY 636
|
||||
#define STRINGID_ABILITYWEAKENEDFSURROUNDINGMONSSTAT 637
|
||||
#define STRINGID_ATTACKERGAINEDSTRENGTHFROMTHEFALLEN 638
|
||||
#define STRINGID_PKMNSABILITYPREVENTSABILITY 639
|
||||
|
||||
#define BATTLESTRINGS_COUNT 639
|
||||
#define BATTLESTRINGS_COUNT 640
|
||||
|
||||
// This is the string id that gBattleStringsTable starts with.
|
||||
// String ids before this (e.g. STRINGID_INTROMSG) are not in the table,
|
||||
|
@ -740,7 +741,6 @@
|
|||
// gUproarAwakeStringIds
|
||||
#define B_MSG_CANT_SLEEP_UPROAR 0
|
||||
#define B_MSG_UPROAR_KEPT_AWAKE 1
|
||||
#define B_MSG_STAYED_AWAKE_USING 2
|
||||
|
||||
// gUproarOverTurnStringIds
|
||||
#define B_MSG_UPROAR_CONTINUES 0
|
||||
|
|
|
@ -306,6 +306,7 @@ static const u8 sText_PreventedFromWorking[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_
|
|||
static const u8 sText_PkmnsXMadeItIneffective[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_SCR_ACTIVE_ABILITY}\nmade it ineffective!");
|
||||
static const u8 sText_PkmnsXPreventsFlinching[] = _("{B_EFF_NAME_WITH_PREFIX}'s {B_EFF_ABILITY}\nprevents flinching!");
|
||||
static const u8 sText_PkmnsXPreventsYsZ[] = _("{B_ATK_NAME_WITH_PREFIX}'s {B_ATK_ABILITY}\nprevents {B_DEF_NAME_WITH_PREFIX}'s\l{B_DEF_ABILITY} from working!");
|
||||
static const u8 sText_PkmnsAbilityPreventsAbility[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_SCR_ACTIVE_ABILITY}\nprevents {B_DEF_NAME_WITH_PREFIX}'s\l{B_DEF_ABILITY} from working!");
|
||||
static const u8 sText_PkmnsXCuredItsYProblem[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_SCR_ACTIVE_ABILITY}\ncured its {B_BUFF1} problem!");
|
||||
static const u8 sText_PkmnsXHadNoEffectOnY[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_SCR_ACTIVE_ABILITY}\nhad no effect on {B_EFF_NAME_WITH_PREFIX}!");
|
||||
const u8 gText_StatSharply[] = _("sharply ");
|
||||
|
@ -1402,6 +1403,7 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
|
|||
[STRINGID_PKMNTOOKTARGETHIGH - BATTLESTRINGS_TABLE_START] = sText_PkmnTookTargetHigh,
|
||||
[STRINGID_TARGETTOOHEAVY - BATTLESTRINGS_TABLE_START] = sText_TargetTooHeavy,
|
||||
[STRINGID_ATTACKERLOSTELECTRICTYPE - BATTLESTRINGS_TABLE_START] = sText_AttackerLostElectricType,
|
||||
[STRINGID_PKMNSABILITYPREVENTSABILITY - BATTLESTRINGS_TABLE_START] = sText_PkmnsAbilityPreventsAbility,
|
||||
};
|
||||
|
||||
const u16 gZEffectStringIds[] =
|
||||
|
@ -1592,7 +1594,6 @@ const u16 gUproarAwakeStringIds[] =
|
|||
{
|
||||
[B_MSG_CANT_SLEEP_UPROAR] = STRINGID_PKMNCANTSLEEPINUPROAR2,
|
||||
[B_MSG_UPROAR_KEPT_AWAKE] = STRINGID_UPROARKEPTPKMNAWAKE,
|
||||
[B_MSG_STAYED_AWAKE_USING] = STRINGID_PKMNSTAYEDAWAKEUSING,
|
||||
};
|
||||
|
||||
const u16 gStatUpStringIds[] =
|
||||
|
|
|
@ -3814,7 +3814,7 @@ u8 AtkCanceller_UnableToUseMove(void)
|
|||
{
|
||||
SetRandomMultiHitCounter();
|
||||
}
|
||||
|
||||
|
||||
PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0)
|
||||
}
|
||||
else if (gBattleMoves[gCurrentMove].flags & FLAG_TWO_STRIKES)
|
||||
|
@ -3841,7 +3841,7 @@ u8 AtkCanceller_UnableToUseMove(void)
|
|||
party = gPlayerParty;
|
||||
else
|
||||
party = gEnemyParty;
|
||||
|
||||
|
||||
for (i = 0; i < PARTY_SIZE; i++)
|
||||
{
|
||||
if (GetMonData(&party[i], MON_DATA_HP)
|
||||
|
@ -5487,7 +5487,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
|
|||
RecordItemEffectBattle(gBattlerAttacker, HOLD_EFFECT_ABILITY_SHIELD);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
gLastUsedAbility = gBattleMons[gBattlerAttacker].ability;
|
||||
gBattleMons[gBattlerAttacker].ability = gBattleStruct->overwrittenAbilities[gBattlerAttacker] = gBattleMons[gBattlerTarget].ability;
|
||||
gBattleMons[gBattlerTarget].ability = gBattleStruct->overwrittenAbilities[gBattlerTarget] = gLastUsedAbility;
|
||||
|
@ -5566,17 +5566,26 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
|
|||
}
|
||||
break;
|
||||
case ABILITY_AFTERMATH:
|
||||
if (!IsAbilityOnField(ABILITY_DAMP)
|
||||
&& !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
|
||||
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
|
||||
&& gBattleMons[gBattlerTarget].hp == 0
|
||||
&& IsBattlerAlive(gBattlerAttacker)
|
||||
&& IsMoveMakingContact(move, gBattlerAttacker))
|
||||
{
|
||||
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4;
|
||||
if (gBattleMoveDamage == 0)
|
||||
gBattleMoveDamage = 1;
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_AftermathDmg;
|
||||
u8 battler;
|
||||
if ((battler = IsAbilityOnField(ABILITY_DAMP)))
|
||||
{
|
||||
gBattleScripting.battler = battler - 1;
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_DampPreventsAftermath;
|
||||
}
|
||||
else
|
||||
{
|
||||
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4;
|
||||
if (gBattleMoveDamage == 0)
|
||||
gBattleMoveDamage = 1;
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_AftermathDmg;
|
||||
}
|
||||
effect++;
|
||||
}
|
||||
break;
|
||||
|
@ -6858,7 +6867,7 @@ static u8 ItemEffectMoveEnd(u32 battlerId, u16 holdEffect)
|
|||
{
|
||||
u8 effect = 0;
|
||||
u32 i;
|
||||
|
||||
|
||||
switch (holdEffect)
|
||||
{
|
||||
#if B_HP_BERRIES >= GEN_4
|
||||
|
@ -7027,7 +7036,7 @@ static u8 ItemEffectMoveEnd(u32 battlerId, u16 holdEffect)
|
|||
&& !(gBattleMons[battlerId].status2 & STATUS2_FOCUS_ENERGY)
|
||||
&& HasEnoughHpToEatBerry(battlerId, GetBattlerItemHoldEffectParam(battlerId, gLastUsedItem), gLastUsedItem))
|
||||
{
|
||||
gBattleMons[battlerId].status2 |= STATUS2_FOCUS_ENERGY;
|
||||
gBattleMons[battlerId].status2 |= STATUS2_FOCUS_ENERGY;
|
||||
gBattleScripting.battler = battlerId;
|
||||
gPotentialItemEffectBattler = battlerId;
|
||||
BattleScriptPushCursor();
|
||||
|
@ -7036,7 +7045,7 @@ static u8 ItemEffectMoveEnd(u32 battlerId, u16 holdEffect)
|
|||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return effect;
|
||||
}
|
||||
|
||||
|
@ -7053,7 +7062,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
|||
gLastUsedItem = gBattleMons[battlerId].item;
|
||||
battlerHoldEffect = GetBattlerHoldEffect(battlerId, TRUE);
|
||||
}
|
||||
|
||||
|
||||
atkItem = gBattleMons[gBattlerAttacker].item;
|
||||
atkHoldEffect = GetBattlerHoldEffect(gBattlerAttacker, TRUE);
|
||||
atkHoldEffectParam = GetBattlerHoldEffectParam(gBattlerAttacker);
|
||||
|
@ -8184,7 +8193,7 @@ u32 GetBattlerHoldEffect(u8 battlerId, bool32 checkNegating)
|
|||
return ItemId_GetHoldEffect(gBattleMons[battlerId].item);
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
static u32 GetBattlerItemHoldEffectParam(u8 battlerId, u16 item)
|
||||
{
|
||||
if (item == ITEM_ENIGMA_BERRY)
|
||||
|
@ -8234,7 +8243,7 @@ bool32 IsBattlerProtected(u8 battlerId, u16 move)
|
|||
else if (gProtectStructs[battlerId].protected)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
if (move == MOVE_TEATIME)
|
||||
{
|
||||
return FALSE;
|
||||
|
|
Loading…
Reference in a new issue