Shell Trap

This commit is contained in:
Xhyzi 2021-06-15 20:22:50 +02:00
parent 155e9b6332
commit c2bd046ea6
12 changed files with 76 additions and 6 deletions

View File

@ -1782,6 +1782,19 @@
various BS_ATTACKER, VARIOUS_SWAP_SIDE_STATUSES
.endm
.macro setshelltrap battler:req
various \battler, VARIOUS_SET_SHELL_TRAP
.endm
.macro clearshelltrap battler:req
various \battler, VARIOUS_CLEAR_SHELL_TRAP
.endm
.macro checkshelltrap battler:req, ptr:req
various \battler, VARIOUS_CHECK_SHELL_TRAP
.4byte \ptr
.endm
@ helpful macros
.macro setstatchanger stat:req, stages:req, down:req
setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7

View File

@ -823,6 +823,7 @@ gBattleAnims_General::
.4byte General_RestoreBg @ B_ANIM_RESTORE_BG
.4byte General_TotemFlare @ B_ANIM_TOTEM_FLARE
.4byte General_BeakBlastSetUp @ B_ANIM_BEAK_BLAST_SETUP
.4byte General_ShellTrapSetUp @ B_ANIM_SHELL_TRAP_SETUP
.align 2
gBattleAnims_Special::
@ -11831,8 +11832,7 @@ Move_AURORA_VEIL::
blendoff
end
Move_SHELL_TRAP::
ShellTrapChargeUp:
General_ShellTrapSetUp:
loadspritegfx ANIM_TAG_SMALL_EMBER
loadspritegfx ANIM_TAG_IMPACT
monbg ANIM_TARGET
@ -11849,6 +11849,7 @@ ShellTrapChargeUp:
clearmonbg ANIM_TARGET
blendoff
end
Move_SHELL_TRAP::
ShellTrapUnleash:
loadspritegfx ANIM_TAG_IMPACT @pound
loadspritegfx ANIM_TAG_SMALL_RED_EYE @red

View File

@ -377,6 +377,47 @@ gBattleScriptsForMoveEffects:: @ 82D86A8
.4byte BattleScript_EffectBeakBlast
.4byte BattleScript_EffectTerrainPulse
.4byte BattleScript_EffectCourtChange
.4byte BattleScript_EffectShellTrap
BattleScript_EffectShellTrap::
checkshelltrap BS_ATTACKER, BattleScript_MoveEnd
clearshelltrap BS_ATTACKER
attackcanceler
attackstring
goto BattleScript_ButItFailed
BattleScript_ShellTrapSetUp::
setshelltrap BS_ATTACKER
printstring STRINGID_EMPTYSTRING3
waitmessage 0x1
playanimation BS_ATTACKER B_ANIM_SHELL_TRAP_SETUP, NULL
printstring STRINGID_PREPARESHELLTRAP
waitmessage 0x40
end2
BattleScript_ShellTrapExplode::
clearshelltrap BS_ATTACKER
attackcanceler
attackstring
ppreduce
critcalc
damagecalc
adjustdamage
attackanimation
waitanimation
effectivenesssound
hitanimation BS_TARGET
waitstate
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
seteffectwithchance
tryfaintmon BS_TARGET, FALSE, NULL
moveendall
end
BattleScript_EffectCourtChange::
attackcanceler

View File

@ -145,6 +145,7 @@ struct ProtectStruct
u32 micle:1;
u32 custap:1; // also quick claw
u32 beakBlastCharge:1;
u32 shellTrap:1;
u32 physicalDmg;
u32 specialDmg;
u8 physicalBattlerId;

View File

@ -372,5 +372,8 @@ extern const u8 BattleScript_BattlerGotOverItsInfatuation[];
extern const u8 BattleScript_MeltedItem[];
extern const u8 BattleScript_BeakBlastSetUp[];
extern const u8 BattleScript_BeakBlastBurn[];
extern const u8 BattleScript_ShellTrapSetUp[];
extern const u8 BattleScript_ShellTrapExplode[];
extern const u8 BattleScript_EffectShellTrap[];
#endif // GUARD_BATTLE_SCRIPTS_H

View File

@ -524,6 +524,7 @@
#define B_ANIM_RESTORE_BG 27 // for Terrain Endings
#define B_ANIM_TOTEM_FLARE 28 // Totem boosts aura flare
#define B_ANIM_BEAK_BLAST_SETUP 29
#define B_ANIM_SHELL_TRAP_SETUP 30
// special animations table (gBattleAnims_Special)
#define B_ANIM_LVL_UP 0

View File

@ -361,7 +361,8 @@
#define EFFECT_BEAK_BLAST 355
#define EFFECT_TERRAIN_PULSE 356
#define EFFECT_COURT_CHANGE 357
#define EFFECT_SHELL_TRAP 358
#define NUM_BATTLE_MOVE_EFFECTS 358
#define NUM_BATTLE_MOVE_EFFECTS 359
#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H

View File

@ -176,6 +176,9 @@
#define VARIOUS_TRY_SET_CORROSIVE_GAS 105
#define VARIOUS_SET_BEAK_BLAST 106
#define VARIOUS_SWAP_SIDE_STATUSES 107
#define VARIOUS_SET_SHELL_TRAP 108
#define VARIOUS_CLEAR_SHELL_TRAP 109
#define VARIOUS_CHECK_SHELL_TRAP 110
// Cmd_manipulatedamage
#define DMG_CHANGE_SIGN 0

View File

@ -575,8 +575,9 @@
#define STRINGID_ITEMMELTED 571
#define STRINGID_HEATUPBEAK 572
#define STRINGID_COURTCHANGE 573
#define STRINGID_PREPARESHELLTRAP 574
#define BATTLESTRINGS_COUNT 574
#define BATTLESTRINGS_COUNT 575
// The below IDs are all indexes into battle message tables,
// used to determine which of a set of messages to print.

View File

@ -4610,6 +4610,9 @@ static void CheckFocusPunch_ClearVarsBeforeTurnStarts(void)
case MOVE_BEAK_BLAST:
BattleScriptExecute(BattleScript_BeakBlastSetUp);
return;
case MOVE_SHELL_TRAP:
BattleScriptExecute(BattleScript_ShellTrapSetUp);
return;
}
}
}

View File

@ -701,9 +701,11 @@ static const u8 sText_MeteorBeamCharging[] = _("{B_ATK_NAME_WITH_PREFIX} is over
static const u8 sText_PkmnItemMelted[] = _("{B_ATK_NAME_WITH_PREFIX} corroded\n{B_DEF_NAME_WITH_PREFIX}'s {B_LAST_ITEM}!");
static const u8 sText_HeatingUpBeak[] = _("{B_ATK_NAME_WITH_PREFIX} started\nheating up its beak!");
static const u8 sText_CourtChange[] = _("{B_ATK_NAME_WITH_PREFIX} swapped the battle\neffects affecting each side!");
static const u8 sText_PrepareShellTrap[] = _("{B_ATK_NAME_WITH_PREFIX} set\n a shell trap!");
const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
{
[STRINGID_PREPARESHELLTRAP - 12] = sText_PrepareShellTrap,
[STRINGID_COURTCHANGE - 12] = sText_CourtChange,
[STRINGID_HEATUPBEAK - 12] = sText_HeatingUpBeak,
[STRINGID_ITEMMELTED - 12] = sText_PkmnItemMelted,

View File

@ -10197,13 +10197,13 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_SHELL_TRAP] =
{
.effect = EFFECT_PLACEHOLDER,
.effect = EFFECT_SHELL_TRAP,
.power = 150,
.type = TYPE_FIRE,
.accuracy = 100,
.pp = 5,
.secondaryEffectChance = 0,
.target = MOVE_TARGET_SELECTED,
.target = MOVE_TARGET_OPPONENTS_FIELD,
.priority = -3,
.flags = FLAG_PROTECT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED,
.split = SPLIT_SPECIAL,