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 TogetherCondition implements Condition { allowed (user: Creature, target: Creature): boolean { return user.containedIn === target.containedIn } } export class ContainerCondition implements Condition { allowed (user: Creature, target: Creature): boolean { return target.containedIn === this.container } constructor (private container: Container) { } }