From 961d03dd60b14b7606be0131935a8395494e7d7e Mon Sep 17 00:00:00 2001 From: Allan Martinez Date: Mon, 31 Jul 2023 11:36:35 -0700 Subject: [PATCH] remove deprecated `createTrap` call also typed `createTrap` params --- src/abilities/Bounty-Hunter.ts | 4 ++-- src/utility/hex.ts | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/abilities/Bounty-Hunter.ts b/src/abilities/Bounty-Hunter.ts index de63f541a..c6a8263f5 100644 --- a/src/abilities/Bounty-Hunter.ts +++ b/src/abilities/Bounty-Hunter.ts @@ -7,6 +7,7 @@ import { Effect } from '../effect'; import Game from '../game'; import { Creature } from '../creature'; import { Hex } from '../utility/hex'; +import { Trap } from '../utility/trap'; /* *TODO @@ -422,8 +423,7 @@ export default (G: Game) => { ), ]; - // TODO: `createTrap` is deprecated - hex.createTrap('mud-bath', effects, ability.creature.player); + new Trap(hex.x, hex.y, 'mud-bath', effects, ability.creature.player, {}, G); G.soundsys.playSFX('sounds/mudbath'); // Trigger trap immediately if on self if (isSelf) { diff --git a/src/utility/hex.ts b/src/utility/hex.ts index 15e3a2544..b5df8d406 100644 --- a/src/utility/hex.ts +++ b/src/utility/hex.ts @@ -8,6 +8,8 @@ import Phaser, { Point, Polygon } from 'phaser-ce'; import { DEBUG } from '../debug'; import { getPointFacade } from './pointfacade'; import * as Const from './const'; +import { Effect } from '../effect'; +import { Player } from '../player'; export enum Direction { None = -1, @@ -586,7 +588,7 @@ export class Hex { * * @deprecated Use new Trap(x, y, type, effects, own, opt, game) */ - createTrap(type, effects, owner, opt?): Trap { + createTrap(type: string, effects: Effect[], owner: Player, opt: Partial = {}): Trap { return new Trap(this.x, this.y, type, effects, owner, opt, this.game); }