import { Vore, Container, VoreType } from './vore'
import { Vore, Container, VoreType, VoreStat, VoreStats } from './vore'
export enum POV {First, Third}
@@ -35,6 +35,8 @@ export class Creature extends Vore implements Combatant {
[Vigor.Resolve]: 100
}
voreStats: VoreStats
get disabled (): boolean {
return Object.values(this.vigors).some(val => val <= 0)
}
@@ -44,17 +46,47 @@ export class Creature extends Vore implements Combatant {
containers: Array<Container> = []
actions: Array<Action> = [];
otherActions: Array<Action> = [];
private baseBulk: number;
get bulk (): number {
return this.baseBulk + this.containers.reduce((total, conatiner) => { return total + conatiner.contents.reduce((total, prey) => total + prey.bulk, 0) }, 0)
return this.voreStats.Mass + this.containers.reduce((total, conatiner) => { return total + conatiner.contents.reduce((total, prey) => total + prey.voreStats.Bulk, 0) }, 0)
}
containedIn: Container|null = null;
constructor (public name: Noun, public pronouns: Pronoun, public stats: Stats, public preyPrefs: Set<VoreType>, public predPrefs: Set<VoreType>, bulk: number) {
constructor (public name: Noun, public pronouns: Pronoun, public stats: Stats, public preyPrefs: Set<VoreType>, public predPrefs: Set<VoreType>, mass: number) {