Add Move Effect - Feint

This commit is contained in:
DizzyEggg 2018-11-24 19:37:10 +01:00
parent cc635c5e6d
commit 194139a35b
9 changed files with 44 additions and 9 deletions

View file

@ -335,6 +335,16 @@ gBattleScriptsForMoveEffects:: @ 82D86A8
.4byte BattleScript_EffectRevelationDance
.4byte BattleScript_EffectAuroraVeil
.4byte BattleScript_EffectThirdType
.4byte BattleScript_EffectFeint
BattleScript_MoveEffectFeint::
printstring STRINGID_FELLFORFEINT
waitmessage 0x40
return
BattleScript_EffectFeint:
setmoveeffect MOVE_EFFECT_FEINT
goto BattleScript_EffectHit
BattleScript_EffectThirdType:
attackcanceler

View file

@ -49,13 +49,13 @@ EverGrandeCity_PokemonLeague_1F_Pokemart_229624: @ 8229624
EverGrandeCity_PokemonLeague_1F_EventScript_229636:: @ 8229636
special SavePlayerParty
trainerbattle 10, 264, 0, NULL, EverGrandeCity_PokemonLeague_1F_Text_2297EF
trainerbattle 11, 263, 0, NULL, EverGrandeCity_PokemonLeague_1F_Text_2297EF
trainerbattle 10, TRAINER_DRAKE, 0, NULL, EverGrandeCity_PokemonLeague_1F_Text_2297EF
trainerbattle 11, TRAINER_GLACIA, 0, NULL, EverGrandeCity_PokemonLeague_1F_Text_2297EF
setvar VAR_0x8004, 11
setvar VAR_0x8004, SPECIAL_BATTLE_MULTI
setvar VAR_0x8005, 0
setvar VAR_0x8006, 404
setvar VAR_0x8007, 3
setvar VAR_0x8006, TRAINER_EDWARDO
setvar VAR_0x8007, TRAINER_BACK_PIC_LEAF
special DoSpecialTrainerBattle
waitstate

View file

@ -282,5 +282,6 @@ extern const u8 BattleScript_MoveEffectSmackDown[];
extern const u8 BattleScript_MoveEffectFlameBurst[];
extern const u8 BattleScript_TrainerSlideMsgRet[];
extern const u8 BattleScript_TrainerSlideMsgEnd2[];
extern const u8 BattleScript_MoveEffectFeint[];
#endif // GUARD_BATTLE_SCRIPTS_H

View file

@ -319,7 +319,7 @@
#define MOVE_EFFECT_SP_ATK_TWO_DOWN 0x3B
#define MOVE_EFFECT_SMACK_DOWN 0x3C
#define MOVE_EFFECT_FLAME_BURST 0x3D
#define MOVE_EFFECT_NOTHING_3E 0x3E
#define MOVE_EFFECT_FEINT 0x3E
#define MOVE_EFFECT_NOTHING_3F 0x3F
#define MOVE_EFFECT_AFFECTS_USER 0x40
#define MOVE_EFFECT_CERTAIN 0x80

View file

@ -323,5 +323,6 @@
#define EFFECT_REVELATION_DANCE 317
#define EFFECT_AURORA_VEIL 318
#define EFFECT_THIRD_TYPE 319
#define EFFECT_FEINT 320
#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H

View file

@ -512,7 +512,8 @@
#define STRINGID_BURSTINGFLAMESHIT 508
#define STRINGID_BESTOWITEMGIVING 509
#define STRINGID_THIRDTYPEADDED 510
#define STRINGID_FELLFORFEINT 511
#define BATTLESTRINGS_COUNT 521
#define BATTLESTRINGS_COUNT 525
#endif // GUARD_CONSTANTS_BATTLE_STRING_IDS_H

View file

@ -649,6 +649,7 @@ static const u8 sText_NoEffectOnTarget[] = _("It had no effect\non {B_DEF_NAME_W
static const u8 sText_BurstingFlames[] = _("The bursting flames\nhit {B_SCR_ACTIVE_NAME_WITH_PREFIX}!");
static const u8 sText_BestowItemGiving[] = _("{B_DEF_NAME_WITH_PREFIX} received {B_LAST_ITEM}\nfrom {B_ATK_NAME_WITH_PREFIX}!");
static const u8 sText_ThirdTypeAdded[] = _("{B_BUFF1} type was added to\n{B_DEF_NAME_WITH_PREFIX}!");
static const u8 sText_FellForFeint[] = _("{B_DEF_NAME_WITH_PREFIX} fell for\nthe feint!");
const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
{
@ -1152,6 +1153,7 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
sText_BurstingFlames,
sText_BestowItemGiving,
sText_ThirdTypeAdded,
sText_FellForFeint,
};
const u16 gTerrainStringIds[] =

View file

@ -926,6 +926,8 @@ bool32 IsBattlerProtected(u8 battlerId, u16 move)
{
if (!(gBattleMoves[move].flags & FLAG_PROTECT_AFFECTED))
return FALSE;
else if (gBattleMoves[move].effect == MOVE_EFFECT_FEINT)
return FALSE;
else if (gProtectStructs[battlerId].protected)
return TRUE;
else if ((gProtectStructs[battlerId].wideGuarded || gProtectStructs[BATTLE_PARTNER(battlerId)].wideGuarded)
@ -2733,6 +2735,24 @@ void SetMoveEffect(bool8 primary, u8 certain)
gBattlescriptCurrInstr = BattleScript_MoveEffectFlameBurst;
}
break;
case MOVE_EFFECT_FEINT:
if (gProtectStructs[gBattlerTarget].protected
|| gProtectStructs[gBattlerTarget].wideGuarded
|| gProtectStructs[gBattlerTarget].quickGuarded
|| gProtectStructs[gBattlerTarget].spikyShielded
|| gProtectStructs[gBattlerTarget].kingsShielded
|| gProtectStructs[gBattlerTarget].banefulBunkered)
{
gProtectStructs[gBattlerTarget].protected = 0;
gProtectStructs[gBattlerTarget].wideGuarded = 0;
gProtectStructs[gBattlerTarget].quickGuarded = 0;
gProtectStructs[gBattlerTarget].spikyShielded = 0;
gProtectStructs[gBattlerTarget].kingsShielded = 0;
gProtectStructs[gBattlerTarget].banefulBunkered = 0;
BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_MoveEffectFeint;
}
break;
}
}
}

View file

@ -4374,12 +4374,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.split = SPLIT_PHYSICAL,
},
{ // MOVE_FEINT
.effect = EFFECT_PLACEHOLDER, // Needs a custom move effect
.effect = EFFECT_FEINT,
.power = 30,
.type = TYPE_NORMAL,
.accuracy = 100,
.pp = 10,
.secondaryEffectChance = 0,
.secondaryEffectChance = 100,
.target = MOVE_TARGET_SELECTED,
.priority = 2,
.flags = FLAG_MIRROR_MOVE_AFFECTED,