(hex: any)
| 273 | return hex; |
| 274 | }, |
| 275 | require(hex: any) { |
| 276 | if (!this.testRequirements()) return false; |
| 277 | if (this.creature === this.game.activeCreature) return false; |
| 278 | |
| 279 | const creatureOnHex = getPointFacade().getCreaturesAt({ x: hex.x, y: hex.y })[0]; |
| 280 | if (creatureOnHex == undefined) return false; |
| 281 | |
| 282 | let triggerHexes: any[] = []; |
| 283 | if (creatureOnHex === this.creature) { |
| 284 | triggerHexes = this._detectFrontHexesWithEnemy(); |
| 285 | } else if (creatureOnHex.team % 2 !== this.creature.team % 2) { |
| 286 | // isTeam Enemy |
| 287 | const frontHexWithEnemy = this._findEnemyHexInFront(hex); |
| 288 | if (frontHexWithEnemy) triggerHexes.push(frontHexWithEnemy); |
| 289 | } |
| 290 | |
| 291 | const abilityCanTrigger = |
| 292 | triggerHexes.length && |
| 293 | this.timesUsedThisTurn < this._getUsesPerTurn() && |
| 294 | !this.creature.materializationSickness && |
| 295 | !this.creature.isFrozen() && |
| 296 | this._getHopHex(); |
| 297 | |
| 298 | return !!abilityCanTrigger; |
| 299 | }, |
| 300 | }; |
| 301 | return ability; |
| 302 | } |
nothing calls this directly
no test coverage detected