Add Harvest

This commit is contained in:
DizzyEggg 2018-07-28 17:13:47 +02:00
parent b3e6dc8457
commit 3a0c244f40
4 changed files with 20 additions and 1 deletions

View File

@ -4528,6 +4528,12 @@ BattleScript_RainDishActivates::
datahpupdate BS_ATTACKER
end3
BattleScript_HarvestActivates::
pause 0x5
printstring STRINGID_HARVESTBERRY
waitmessage 0x40
end3
BattleScript_SolarPowerActivates::
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
healthbarupdate BS_ATTACKER

View File

@ -323,5 +323,6 @@ extern const u8 BattleScript_MummyActivates[];
extern const u8 BattleScript_WeakArmorActivates[];
extern const u8 BattleScript_FellStingerRaisesStat[];
extern const u8 BattleScript_SnowWarningActivates[];
extern const u8 BattleScript_HarvestActivates[];
#endif // GUARD_BATTLE_SCRIPTS_H

View File

@ -610,7 +610,7 @@ static const u8 sText_IceBodyHpGain[] = _("{B_ATK_NAME_WITH_PREFIX}s {B_ATK_A
static const u8 sText_SnowWarningHail[] = _("It started to hail!");
static const u8 sText_FriskActivates[] = _("{B_ATK_NAME_WITH_PREFIX} frisked {B_DEF_NAME_WITH_PREFIX} and\nfound its {B_LAST_ITEM}!");
static const u8 sText_UnnerveEnters[] = _("{B_ATK_NAME_WITH_PREFIX} is too nervous to eat Berries!");
static const u8 sText_HarvestBerry[] = _("{B_ATK_NAME_WITH_PREFIX} harvested its {B_LAST_ITEM}!");
static const u8 sText_HarvestBerry[] = _("{B_ATK_NAME_WITH_PREFIX} harvested\nits {B_LAST_ITEM}!");
static const u8 sText_MoxieAtkRise[] = _("{B_ATK_NAME_WITH_PREFIX}s {B_ATK_ABILITY} raised its Attack!");
static const u8 sText_MagicBounceActivates[] = _("The {B_DEF_NAME_WITH_PREFIX} bounced the\n{B_ATK_NAME_WITH_PREFIX} back!");
static const u8 sText_ProteanTypeChange[] = _("{B_ATK_NAME_WITH_PREFIX}s {B_ATK_ABILITY} transformed\nit into the {B_BUFF1} type!");

View File

@ -2587,6 +2587,18 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
gBattlerAttacker = battler;
switch (gLastUsedAbility)
{
case ABILITY_HARVEST:
if (((WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY) || Random() % 2 == 0)
&& gBattleMons[battler].item == ITEM_NONE
&& gBattleStruct->changedItems[battler] == ITEM_NONE
&& ItemId_GetPocket(gBattleStruct->usedHeldItems[battler]) == POCKET_BERRIES)
{
gLastUsedItem = gBattleStruct->changedItems[battler] = gBattleStruct->usedHeldItems[battler];
gBattleStruct->usedHeldItems[battler] = ITEM_NONE;
BattleScriptPushCursorAndCallback(BattleScript_HarvestActivates);
effect++;
}
break;
case ABILITY_RAIN_DISH:
if (WEATHER_HAS_EFFECT
&& (gBattleWeather & WEATHER_RAIN_ANY)