mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-27 20:24:18 +01:00
micle berry
This commit is contained in:
parent
f2e486eb0d
commit
efa4fe89ad
@ -7729,3 +7729,28 @@ BattleScript_CustapBerryActivation::
|
||||
waitmessage 0x40
|
||||
removeitem BS_ATTACKER
|
||||
end2
|
||||
|
||||
BattleScript_MicleBerryActivateEnd2::
|
||||
jumpifability BS_ATTACKER, ABILITY_RIPEN, BattleScript_MicleBerryActivateEnd2_Ripen
|
||||
goto BattleScript_MicleBerryActivateEnd2_Anim
|
||||
BattleScript_MicleBerryActivateEnd2_Ripen:
|
||||
call BattleScript_AbilityPopUp
|
||||
BattleScript_MicleBerryActivateEnd2_Anim:
|
||||
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL
|
||||
printstring STRINGID_MICLEBERRYACTIVATES
|
||||
waitmessage 0x40
|
||||
removeitem BS_ATTACKER
|
||||
end2
|
||||
|
||||
BattleScript_MicleBerryActivateRet::
|
||||
jumpifability BS_SCRIPTING, ABILITY_RIPEN, BattleScript_MicleBerryActivateRet_Ripen
|
||||
goto BattleScript_MicleBerryActivateRet_Anim
|
||||
BattleScript_MicleBerryActivateRet_Ripen:
|
||||
call BattleScript_AbilityPopUp
|
||||
BattleScript_MicleBerryActivateRet_Anim:
|
||||
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL
|
||||
printstring STRINGID_MICLEBERRYACTIVATES
|
||||
waitmessage 0x40
|
||||
removeitem BS_SCRIPTING
|
||||
return
|
||||
|
||||
|
@ -429,7 +429,7 @@ struct Illusion
|
||||
|
||||
struct PinchBerry
|
||||
{
|
||||
u8 micleBerry:1;
|
||||
u8 micle:1;
|
||||
u8 custap:1; // also quick claw
|
||||
|
||||
};
|
||||
|
@ -352,5 +352,7 @@ extern const u8 BattleScript_CheekPouchActivates[];
|
||||
extern const u8 BattleScript_AnnounceAirLockCloudNine[];
|
||||
extern const u8 BattleScript_QuickClawActivation[];
|
||||
extern const u8 BattleScript_CustapBerryActivation[];
|
||||
extern const u8 BattleScript_MicleBerryActivateEnd2[];
|
||||
extern const u8 BattleScript_MicleBerryActivateRet[];
|
||||
|
||||
#endif // GUARD_BATTLE_SCRIPTS_H
|
||||
|
@ -559,8 +559,9 @@
|
||||
#define STRINGID_COMATOSEENTERS 555
|
||||
#define STRINGID_SCREENCLEANERENTERS 556
|
||||
#define STRINGID_CANACTFASTERTHANKSTO 557
|
||||
#define STRINGID_MICLEBERRYACTIVATES 558
|
||||
|
||||
#define BATTLESTRINGS_COUNT 558
|
||||
#define BATTLESTRINGS_COUNT 559
|
||||
|
||||
//// multichoice message IDs
|
||||
// switch in ability message
|
||||
|
@ -685,10 +685,12 @@ static const u8 sText_FairyAuraActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}
|
||||
static const u8 sText_AuraBreakActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} reversed all\nother POKéMON's auras!");
|
||||
static const u8 sText_ComatoseActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} is drowsing!");
|
||||
static const u8 sText_ScreenCleanerActivates[] = _("All screens on the field were\ncleansed!");
|
||||
static const u8 sText_CanActFaster[] = _("{B_ATK_NAME_WITH_PREFIX} can act\nfaster, thanks to {B_LAST_ITEM}!");
|
||||
static const u8 sText_CanActFaster[] = _("{B_ATK_NAME_WITH_PREFIX} can act faster,\nthanks to {B_LAST_ITEM}!");
|
||||
static const u8 sText_MicleBerryActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} boosted the accuracy of its\nnext move using {B_LAST_ITEM}!");
|
||||
|
||||
const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
|
||||
{
|
||||
[STRINGID_MICLEBERRYACTIVATES - 12] = sText_MicleBerryActivates,
|
||||
[STRINGID_CANACTFASTERTHANKSTO - 12] = sText_CanActFaster,
|
||||
[STRINGID_STATWASNOTLOWERED - 12] = sText_StatWasNotLowered,
|
||||
[STRINGID_CLOAKEDINAFREEZINGLIGHT - 12] = sText_CloakedInAFreezingLight,
|
||||
|
@ -1564,6 +1564,15 @@ u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move)
|
||||
else if (atkHoldEffect == HOLD_EFFECT_ZOOM_LENS && GetBattlerTurnOrderNum(battlerAtk) > GetBattlerTurnOrderNum(battlerDef));
|
||||
calc = (calc * (100 + atkParam)) / 100;
|
||||
|
||||
if (gBattleStruct->pinchBerry[battlerAtk].micle)
|
||||
{
|
||||
gBattleStruct->pinchBerry[battlerAtk].micle = FALSE;
|
||||
if (atkAbility == ABILITY_RIPEN)
|
||||
calc = (calc * 140) / 100; // ripen gives 40% acc boost
|
||||
else
|
||||
calc = (calc * 120) / 100; // 20% acc boost
|
||||
}
|
||||
|
||||
return calc;
|
||||
}
|
||||
|
||||
|
@ -5073,6 +5073,26 @@ static u8 RandomStatRaiseBerry(u32 battlerId, u32 itemId)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static u8 TrySetMicleBerry(u32 battlerId, u32 itemId, bool32 end2)
|
||||
{
|
||||
if (HasEnoughHpToEatBerry(battlerId, 4, itemId))
|
||||
{
|
||||
gBattleStruct->pinchBerry[battlerId].micle = TRUE; // battler's next attack has increased accuracy
|
||||
|
||||
if (end2)
|
||||
{
|
||||
BattleScriptExecute(BattleScript_MicleBerryActivateEnd2);
|
||||
}
|
||||
else
|
||||
{
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_MicleBerryActivateRet;
|
||||
}
|
||||
return ITEM_EFFECT_OTHER;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static u8 ItemHealHp(u32 battlerId, u32 itemId, bool32 end2, bool32 percentHeal)
|
||||
{
|
||||
if (HasEnoughHpToEatBerry(battlerId, 2, itemId))
|
||||
@ -5569,6 +5589,10 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
effect = ITEM_EFFECT_OTHER;
|
||||
}
|
||||
break;
|
||||
case HOLD_EFFECT_MICLE_BERRY:
|
||||
if (!moveTurn)
|
||||
effect = TrySetMicleBerry(battlerId, gLastUsedItem, TRUE);
|
||||
break;
|
||||
}
|
||||
|
||||
if (effect)
|
||||
@ -5595,6 +5619,10 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
battlerHoldEffect = GetBattlerHoldEffect(battlerId, TRUE);
|
||||
switch (battlerHoldEffect)
|
||||
{
|
||||
case HOLD_EFFECT_MICLE_BERRY:
|
||||
if (B_HP_BERRIES >= GEN_4)
|
||||
effect = TrySetMicleBerry(battlerId, gLastUsedItem, FALSE);
|
||||
break;
|
||||
case HOLD_EFFECT_RESTORE_HP:
|
||||
if (B_HP_BERRIES >= GEN_4)
|
||||
effect = ItemHealHp(battlerId, gLastUsedItem, FALSE, FALSE);
|
||||
|
Loading…
Reference in New Issue
Block a user