Skip to content

Commit

Permalink
remove deprecated createTrap call
Browse files Browse the repository at this point in the history
also typed `createTrap` params
  • Loading branch information
allmtz committed Jul 31, 2023
1 parent 97c98ff commit 961d03d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/abilities/Bounty-Hunter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 3 additions & 1 deletion src/utility/hex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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> = {}): Trap {
return new Trap(this.x, this.y, type, effects, owner, opt, this.game);
}

Expand Down

0 comments on commit 961d03d

Please sign in to comment.