Aroma Veil

This commit is contained in:
DizzyEggg 2019-04-01 11:42:37 +02:00
parent e878de782e
commit 62192b86f7
4 changed files with 24 additions and 1 deletions

View File

@ -1664,6 +1664,7 @@ BattleScript_EffectHealBlock:
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
attackstring
ppreduce
jumpifability BS_TARGET_SIDE, ABILITY_AROMA_VEIL, BattleScript_AromaVeilProtects
sethealblock BattleScript_ButItFailed
attackanimation
waitanimation
@ -1849,6 +1850,18 @@ BattleScript_SweetVeilProtects:
call BattleScript_SweetVeilProtectsRet
orhalfword gMoveResultFlags, MOVE_RESULT_FAILED
goto BattleScript_MoveEnd
BattleScript_AromaVeilProtectsRet::
pause 0x20
call BattleScript_AbilityPopUp
printstring STRINGID_AROMAVEILPROTECTED
waitmessage 0x40
return
BattleScript_AromaVeilProtects:
call BattleScript_AromaVeilProtectsRet
orhalfword gMoveResultFlags, MOVE_RESULT_FAILED
goto BattleScript_MoveEnd
BattleScript_AlreadyAsleep::
setalreadystatusedmoveattempt BS_ATTACKER
@ -2837,6 +2850,7 @@ BattleScript_EffectDisable::
attackcanceler
attackstring
ppreduce
jumpifability BS_TARGET_SIDE, ABILITY_AROMA_VEIL, BattleScript_AromaVeilProtects
accuracycheck BattleScript_ButItFailed, ACC_CURR_MOVE
disablelastusedattack BattleScript_ButItFailed
attackanimation
@ -2883,6 +2897,7 @@ BattleScript_EffectEncore::
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
attackstring
ppreduce
jumpifability BS_TARGET_SIDE, ABILITY_AROMA_VEIL, BattleScript_AromaVeilProtects
trysetencore BattleScript_ButItFailed
attackanimation
waitanimation
@ -3298,6 +3313,7 @@ BattleScript_EffectAttract::
attackstring
ppreduce
accuracycheck BattleScript_ButItFailed, ACC_CURR_MOVE
jumpifability BS_TARGET_SIDE, ABILITY_AROMA_VEIL, BattleScript_AromaVeilProtects
tryinfatuating BattleScript_ButItFailed
attackanimation
waitanimation
@ -3782,6 +3798,7 @@ BattleScript_EffectTorment::
attackstring
ppreduce
accuracycheck BattleScript_ButItFailed, ACC_CURR_MOVE
jumpifability BS_TARGET_SIDE, ABILITY_AROMA_VEIL, BattleScript_AromaVeilProtects
settorment BattleScript_ButItFailed
attackanimation
waitanimation
@ -3938,6 +3955,7 @@ BattleScript_EffectTaunt::
attackcanceler
attackstring
ppreduce
jumpifability BS_TARGET_SIDE, ABILITY_AROMA_VEIL, BattleScript_AromaVeilProtects
accuracycheck BattleScript_ButItFailed, ACC_CURR_MOVE
settaunt BattleScript_ButItFailed
attackanimation

View File

@ -526,6 +526,7 @@
#define STRINGID_SAFETYGOOGLESPROTECTED 522
#define STRINGID_FLOWERVEILPROTECTED 523
#define STRINGID_SWEETVEILPROTECTED 524
#define STRINGID_AROMAVEILPROTECTED 525
#define BATTLESTRINGS_COUNT 529

View File

@ -651,9 +651,11 @@ static const u8 sText_PsychicTerrainPreventsPriority[] = _("{B_DEF_NAME_WITH_PRE
static const u8 sText_SafetyGooglesProtected[] = _("{B_DEF_NAME_WITH_PREFIX} is not affected\nthanks to its {B_LAST_ITEM}!");
static const u8 sText_FlowerVeilProtected[] = _("{B_DEF_NAME_WITH_PREFIX} surrounded itself\nwith a veil of petals!");
static const u8 sText_SweetVeilProtected[] = _("{B_DEF_NAME_WITH_PREFIX} surrounded itself\nwith a veil of sweetness!");
static const u8 sText_AromaVeilProtected[] = _("{B_DEF_NAME_WITH_PREFIX} is protected\nby an aromatic veil!");
const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
{
[STRINGID_AROMAVEILPROTECTED - 12] = sText_AromaVeilProtected,
[STRINGID_SWEETVEILPROTECTED - 12] = sText_SweetVeilProtected,
[STRINGID_FLOWERVEILPROTECTED - 12] = sText_FlowerVeilProtected,
[STRINGID_SAFETYGOOGLESPROTECTED - 12] = sText_SafetyGooglesProtected,

View File

@ -3168,6 +3168,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
&& TARGET_TURN_DAMAGED
&& gDisableStructs[gBattlerAttacker].disabledMove == MOVE_NONE
&& IsBattlerAlive(gBattlerAttacker)
&& !IsAbilityOnSide(gBattlerAttacker, ABILITY_AROMA_VEIL)
&& gBattleMons[gBattlerAttacker].pp[gChosenMovePos] != 0
&& (Random() % 3) == 0)
{
@ -3330,7 +3331,8 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
&& TARGET_TURN_DAMAGED
&& gBattleMons[gBattlerTarget].hp != 0
&& (Random() % 3) == 0
&& gBattleMons[gBattlerAttacker].ability != ABILITY_OBLIVIOUS
&& GetBattlerAbility(gBattlerAttacker) != ABILITY_OBLIVIOUS
&& !IsAbilityOnSide(gBattlerAttacker, ABILITY_AROMA_VEIL)
&& GetGenderFromSpeciesAndPersonality(speciesAtk, pidAtk) != GetGenderFromSpeciesAndPersonality(speciesDef, pidDef)
&& !(gBattleMons[gBattlerAttacker].status2 & STATUS2_INFATUATION)
&& GetGenderFromSpeciesAndPersonality(speciesAtk, pidAtk) != MON_GENDERLESS