import { Condition, Vigor } from "../combat" import { Creature } from "../entity" import { Container } from '../vore' export class InverseCondition implements Condition { allowed (user: Creature, target: Creature): boolean { return !this.condition.allowed(user, target) } constructor (private condition: Condition) { } } export class CapableCondition implements Condition { allowed (user: Creature, target: Creature): boolean { return !user.disabled } } export class DrainedVigorCondition implements Condition { allowed (user: Creature, target: Creature): boolean { return user.vigors[this.vigor] <= 0 } constructor (private vigor: Vigor) { } } export class SoloCondition implements Condition { allowed (user: Creature, target: Creature): boolean { return user === target } } export class PairCondition implements Condition { allowed (user: Creature, target: Creature): boolean { return user !== target } } export class TogetherCondition implements Condition { allowed (user: Creature, target: Creature): boolean { return user.containedIn === target.containedIn && user !== target } } export class ContainerCondition implements Condition { allowed (user: Creature, target: Creature): boolean { return target.containedIn === this.container } constructor (private container: Container) { } } export class AllyCondition implements Condition { allowed (user: Creature, target: Creature): boolean { return user.side === target.side } } export class EnemyCondition implements Condition { allowed (user: Creature, target: Creature): boolean { return user.side !== target.side } }