Cleanup small parts of code

This commit is contained in:
Jakub Hanko 2024-05-17 08:54:13 +02:00
parent 5c10268e25
commit 83d76fd535
No known key found for this signature in database
GPG Key ID: 775D427937A306CC
2 changed files with 6 additions and 5 deletions

View File

@ -1279,9 +1279,9 @@ export class CursedTag extends BattlerTag {
export class FriendGuardTag extends BattlerTag { export class FriendGuardTag extends BattlerTag {
public powerMultiplier: number; public powerMultiplier: number;
constructor(powerMultiplier: number) { constructor() {
super(BattlerTagType.FRIEND_GUARD, BattlerTagLapseType.PRE_MOVE, 1, undefined); super(BattlerTagType.FRIEND_GUARD, BattlerTagLapseType.TURN_END, 1, undefined);
this.powerMultiplier = 1 - powerMultiplier; this.powerMultiplier = 0.75;
} }
/** /**
@ -1406,7 +1406,7 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: integer, sourc
case BattlerTagType.MINIMIZED: case BattlerTagType.MINIMIZED:
return new MinimizeTag(); return new MinimizeTag();
case BattlerTagType.FRIEND_GUARD: case BattlerTagType.FRIEND_GUARD:
return new FriendGuardTag(0.25); return new FriendGuardTag();
case BattlerTagType.NONE: case BattlerTagType.NONE:
default: default:
return new BattlerTag(tagType, BattlerTagLapseType.CUSTOM, turnCount, sourceMove, sourceId); return new BattlerTag(tagType, BattlerTagLapseType.CUSTOM, turnCount, sourceMove, sourceId);

View File

@ -1640,7 +1640,6 @@ export class TurnInitPhase extends FieldPhase {
this.scene.getField().forEach((pokemon, i) => { this.scene.getField().forEach((pokemon, i) => {
if (pokemon?.isActive()) { if (pokemon?.isActive()) {
applyAbAttrs(FriendGuardAbAttr, pokemon, undefined);
if (pokemon.isPlayer()) if (pokemon.isPlayer())
this.scene.currentBattle.addParticipant(pokemon as PlayerPokemon); this.scene.currentBattle.addParticipant(pokemon as PlayerPokemon);
@ -2028,6 +2027,8 @@ export class TurnStartPhase extends FieldPhase {
if (turnCommand.skip) if (turnCommand.skip)
continue; continue;
applyAbAttrs(FriendGuardAbAttr, pokemon, undefined);
switch (turnCommand.command) { switch (turnCommand.command) {
case Command.FIGHT: case Command.FIGHT:
const queuedMove = turnCommand.move; const queuedMove = turnCommand.move;