Implement Snap Trap

One of the basic trapping moves that got overlooked.
pull/261/head
Madmadness65 2024-04-23 13:04:42 -05:00
parent 8f36bf1dcf
commit d48de66179
5 changed files with 1226 additions and 1 deletions

File diff suppressed because it is too large Load Diff

View File

@ -78,6 +78,7 @@ export enum CommonAnim {
CURSE, CURSE,
MAGMA_STORM, MAGMA_STORM,
CLAMP, CLAMP,
SNAP_TRAP,
THUNDER_CAGE, THUNDER_CAGE,
INFESTATION, INFESTATION,
ORDER_UP_CURLY, ORDER_UP_CURLY,

View File

@ -614,6 +614,16 @@ export class MagmaStormTag extends DamagingTrapTag {
} }
} }
export class SnapTrapTag extends DamagingTrapTag {
constructor(turnCount: integer, sourceId: integer) {
super(BattlerTagType.SNAP_TRAP, CommonAnim.SNAP_TRAP, turnCount, Moves.SNAP_TRAP, sourceId);
}
getTrapMessage(pokemon: Pokemon): string {
return getPokemonMessage(pokemon, ` got trapped\nby a snap trap!`);
}
}
export class ThunderCageTag extends DamagingTrapTag { export class ThunderCageTag extends DamagingTrapTag {
constructor(turnCount: integer, sourceId: integer) { constructor(turnCount: integer, sourceId: integer) {
super(BattlerTagType.THUNDER_CAGE, CommonAnim.THUNDER_CAGE, turnCount, Moves.THUNDER_CAGE, sourceId); super(BattlerTagType.THUNDER_CAGE, CommonAnim.THUNDER_CAGE, turnCount, Moves.THUNDER_CAGE, sourceId);
@ -1103,6 +1113,8 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: integer, sourc
return new SandTombTag(turnCount, sourceId); return new SandTombTag(turnCount, sourceId);
case BattlerTagType.MAGMA_STORM: case BattlerTagType.MAGMA_STORM:
return new MagmaStormTag(turnCount, sourceId); return new MagmaStormTag(turnCount, sourceId);
case BattlerTagType.SNAP_TRAP:
return new SnapTrapTag(turnCount, sourceId);
case BattlerTagType.THUNDER_CAGE: case BattlerTagType.THUNDER_CAGE:
return new ThunderCageTag(turnCount, sourceId); return new ThunderCageTag(turnCount, sourceId);
case BattlerTagType.INFESTATION: case BattlerTagType.INFESTATION:

View File

@ -21,6 +21,7 @@ export enum BattlerTagType {
CLAMP = "CLAMP", CLAMP = "CLAMP",
SAND_TOMB = "SAND_TOMB", SAND_TOMB = "SAND_TOMB",
MAGMA_STORM = "MAGMA_STORM", MAGMA_STORM = "MAGMA_STORM",
SNAP_TRAP = "SNAP_TRAP",
THUNDER_CAGE = "THUNDER_CAGE", THUNDER_CAGE = "THUNDER_CAGE",
INFESTATION = "INFESTATION", INFESTATION = "INFESTATION",
PROTECTED = "PROTECTED", PROTECTED = "PROTECTED",

View File

@ -2511,6 +2511,7 @@ export class AddBattlerTagAttr extends MoveEffectAttr {
case BattlerTagType.CLAMP: case BattlerTagType.CLAMP:
case BattlerTagType.SAND_TOMB: case BattlerTagType.SAND_TOMB:
case BattlerTagType.MAGMA_STORM: case BattlerTagType.MAGMA_STORM:
case BattlerTagType.SNAP_TRAP:
case BattlerTagType.THUNDER_CAGE: case BattlerTagType.THUNDER_CAGE:
case BattlerTagType.INFESTATION: case BattlerTagType.INFESTATION:
return -3; return -3;
@ -4313,6 +4314,7 @@ export function initMoves() {
BattlerTagType.CLAMP, BattlerTagType.CLAMP,
BattlerTagType.SAND_TOMB, BattlerTagType.SAND_TOMB,
BattlerTagType.MAGMA_STORM, BattlerTagType.MAGMA_STORM,
BattlerTagType.SNAP_TRAP,
BattlerTagType.THUNDER_CAGE, BattlerTagType.THUNDER_CAGE,
BattlerTagType.SEEDED, BattlerTagType.SEEDED,
BattlerTagType.INFESTATION BattlerTagType.INFESTATION
@ -5784,7 +5786,7 @@ export function initMoves() {
.attr(StatChangeAttr, BattleStat.SPD, -1) .attr(StatChangeAttr, BattleStat.SPD, -1)
.makesContact(false), .makesContact(false),
new AttackMove(Moves.SNAP_TRAP, Type.GRASS, MoveCategory.PHYSICAL, 35, 100, 15, 100, 0, 8) new AttackMove(Moves.SNAP_TRAP, Type.GRASS, MoveCategory.PHYSICAL, 35, 100, 15, 100, 0, 8)
.partial(), .attr(TrapAttr, BattlerTagType.SNAP_TRAP),
new AttackMove(Moves.PYRO_BALL, Type.FIRE, MoveCategory.PHYSICAL, 120, 90, 5, 10, 0, 8) new AttackMove(Moves.PYRO_BALL, Type.FIRE, MoveCategory.PHYSICAL, 120, 90, 5, 10, 0, 8)
.attr(HealStatusEffectAttr, true, StatusEffect.FREEZE) .attr(HealStatusEffectAttr, true, StatusEffect.FREEZE)
.attr(StatusEffectAttr, StatusEffect.BURN) .attr(StatusEffectAttr, StatusEffect.BURN)
@ -6147,6 +6149,7 @@ export function initMoves() {
BattlerTagType.CLAMP, BattlerTagType.CLAMP,
BattlerTagType.SAND_TOMB, BattlerTagType.SAND_TOMB,
BattlerTagType.MAGMA_STORM, BattlerTagType.MAGMA_STORM,
BattlerTagType.SNAP_TRAP,
BattlerTagType.THUNDER_CAGE, BattlerTagType.THUNDER_CAGE,
BattlerTagType.SEEDED, BattlerTagType.SEEDED,
BattlerTagType.INFESTATION BattlerTagType.INFESTATION