diff --git a/src/data/arena-tag.ts b/src/data/arena-tag.ts index 8942cfe4b..3551b4cac 100644 --- a/src/data/arena-tag.ts +++ b/src/data/arena-tag.ts @@ -496,7 +496,7 @@ class TailwindTag extends ArenaTag { } } -export function getArenaTag(tagType: ArenaTagType, turnCount: integer, sourceMove: Moves, sourceId: integer, targetIndex?: BattlerIndex, side: ArenaTagSide = ArenaTagSide.BOTH): ArenaTag { +export function getArenaTag(tagType: ArenaTagType, turnCount: integer, sourceMove: Moves, sourceId: integer, side: ArenaTagSide = ArenaTagSide.BOTH, targetIndex?: BattlerIndex): ArenaTag { switch (tagType) { case ArenaTagType.MIST: return new MistTag(turnCount, sourceId, side); diff --git a/src/field/arena.ts b/src/field/arena.ts index e8cc98c0a..b5c3661a1 100644 --- a/src/field/arena.ts +++ b/src/field/arena.ts @@ -498,7 +498,7 @@ export class Arena { return false; } - const newTag = getArenaTag(tagType, turnCount || 0, sourceMove, sourceId, targetIndex, side); + const newTag = getArenaTag(tagType, turnCount || 0, sourceMove, sourceId, side, targetIndex); this.tags.push(newTag); newTag.onAdd(this); diff --git a/src/system/arena-data.ts b/src/system/arena-data.ts index 4d5fb10e8..ef03c0a28 100644 --- a/src/system/arena-data.ts +++ b/src/system/arena-data.ts @@ -1,5 +1,5 @@ import { Arena } from "../field/arena"; -import { ArenaTag } from "../data/arena-tag"; +import { ArenaTag, getArenaTag } from "../data/arena-tag"; import { Biome } from "../data/enums/biome"; import { Weather } from "../data/weather"; @@ -12,6 +12,10 @@ export default class ArenaData { const sourceArena = source instanceof Arena ? source as Arena : null; this.biome = sourceArena ? sourceArena.biomeType : source.biome; this.weather = sourceArena ? sourceArena.weather : source.weather ? new Weather(source.weather.weatherType, source.weather.turnsLeft) : undefined; - this.tags = sourceArena ? sourceArena.tags : []; + const arenaTags: ArenaTag[] = sourceArena ? sourceArena.tags : source.tags; + this.tags = []; + for (let tag of arenaTags) { + this.tags.push(getArenaTag(tag.tagType, tag.turnCount, tag.sourceMove, tag.sourceId, tag.side, tag?.targetIndex)) + } } } \ No newline at end of file diff --git a/src/system/game-data.ts b/src/system/game-data.ts index 2be2ee155..83fc0597f 100644 --- a/src/system/game-data.ts +++ b/src/system/game-data.ts @@ -673,8 +673,7 @@ export class GameData { }); scene.arena.weather = sessionData.arena.weather; - // TODO - //scene.arena.tags = sessionData.arena.tags; + scene.arena.tags = sessionData.arena.tags; const modifiersModule = await import('../modifier/modifier');