jaboca, rowap berry effects

This commit is contained in:
Evan 2021-01-06 11:15:56 -07:00
parent efa4fe89ad
commit 7646855e79
4 changed files with 35 additions and 0 deletions

View file

@ -7754,3 +7754,17 @@ BattleScript_MicleBerryActivateRet_Anim:
removeitem BS_SCRIPTING
return
BattleScript_JabocaRowapBerryActivates::
jumpifability BS_TARGET, ABILITY_RIPEN, BattleScript_JabocaRowapBerryActivate_Ripen
goto BattleScript_JabocaRowapBerryActivate_Anim
BattleScript_JabocaRowapBerryActivate_Ripen:
call BattleScript_AbilityPopUp
BattleScript_JabocaRowapBerryActivate_Anim:
jumpifabsent BS_TARGET, BattleScript_JabocaRowapBerryActivate_Dmg @ dont play the animation for a fainted target
playanimation BS_TARGET, B_ANIM_HELD_ITEM_EFFECT, NULL
waitanimation
BattleScript_JabocaRowapBerryActivate_Dmg:
call BattleScript_HurtAttacker
removeitem BS_TARGET
return

View file

@ -354,5 +354,6 @@ extern const u8 BattleScript_QuickClawActivation[];
extern const u8 BattleScript_CustapBerryActivation[];
extern const u8 BattleScript_MicleBerryActivateEnd2[];
extern const u8 BattleScript_MicleBerryActivateRet[];
extern const u8 BattleScript_JabocaRowapBerryActivates[];
#endif // GUARD_BATTLE_SCRIPTS_H

View file

@ -107,6 +107,7 @@
#define HOLD_EFFECT_MICLE_BERRY 101
#define HOLD_EFFECT_JABOCA_BERRY 102
#define HOLD_EFFECT_CUSTAP_BERRY 103
#define HOLD_EFFECT_RETALIATE_BERRY 104 // rowap, jaboca
// Gen5 hold effects
#define HOLD_EFFECT_FLOAT_STONE 115

View file

@ -5890,6 +5890,25 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
gBattleScripting.statChanger = SET_STATCHANGER(STAT_SPATK, 1, FALSE);
}
break;
case HOLD_EFFECT_RETALIATE_BERRY:
if (IsBattlerAlive(battlerId)
&& TARGET_TURN_DAMAGED
&& !DoesSubstituteBlockMove(gBattlerAttacker, battlerId, gCurrentMove)
&& GetBattleMoveSplit(gCurrentMove) == ItemId_GetHoldEffectParam(gLastUsedItem))
{
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 8;
if (gBattleMoveDamage == 0)
gBattleMoveDamage = 1;
if (GetBattlerAbility(battlerId) == ABILITY_RIPEN)
gBattleMoveDamage *= 2;
effect = ITEM_HP_CHANGE;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_JabocaRowapBerryActivates;
PREPARE_ITEM_BUFFER(gBattleTextBuff1, gLastUsedItem);
RecordItemEffectBattle(battlerId, HOLD_EFFECT_ROCKY_HELMET);
}
break;
}
}
break;