| @@ -25,20 +25,12 @@ | |||||
| </div> | </div> | ||||
| <br> | <br> | ||||
| <div class="stat-line"> | <div class="stat-line"> | ||||
| <div class="stat-entry"> | |||||
| <i class="fas fa-weight-hanging" /> | |||||
| <div> {{ subject.bulk }} </div> | |||||
| <div class="stat-entry" v-for="stat in Object.keys(subject.voreStats)" v-bind:key="stat"> | |||||
| <i :class="voreStatIcons[stat]" /> | |||||
| <div>{{subject.voreStats[stat]}}</div> | |||||
| <div class="tooltip-template"> | <div class="tooltip-template"> | ||||
| <div class="tooltip-title"> Bulk </div> | |||||
| <div class="tooltip-body"> How much space you take up </div> | |||||
| </div> | |||||
| </div> | |||||
| <div class="stat-entry"> | |||||
| <i class="fas fa-utensils" /> | |||||
| <div> {{ subject.containers.reduce((total, container) => total + container.contents.length, 0) }} </div> | |||||
| <div class="tooltip-template"> | |||||
| <div class="tooltip-title"> Prey Count </div> | |||||
| <div class="tooltip-body"> How many things you've eaten </div> | |||||
| <div class="tooltip-title">{{ stat }}</div> | |||||
| <div class="tooltip-body">{{ voreStatDescs[stat] }}</div> | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| @@ -51,7 +43,7 @@ | |||||
| <script lang="ts"> | <script lang="ts"> | ||||
| import { Component, Prop, Vue, Watch, Emit } from 'vue-property-decorator' | import { Component, Prop, Vue, Watch, Emit } from 'vue-property-decorator' | ||||
| import { Creature, POV } from '@/game/entity' | import { Creature, POV } from '@/game/entity' | ||||
| import { Stats, Stat, StatIcons, StatDescs, Vigor, VigorIcons, VigorDescs } from '@/game/combat' | |||||
| import { Stats, Stat, StatIcons, StatDescs, Vigor, VigorIcons, VigorDescs, VoreStatDescs, VoreStatIcons } from '@/game/combat' | |||||
| import ContainerView from './ContainerView.vue' | import ContainerView from './ContainerView.vue' | ||||
| import tippy from 'tippy.js' | import tippy from 'tippy.js' | ||||
| import 'tippy.js/dist/tippy.css' | import 'tippy.js/dist/tippy.css' | ||||
| @@ -67,8 +59,10 @@ export default class Statblock extends Vue { | |||||
| private vigorIcons = VigorIcons | private vigorIcons = VigorIcons | ||||
| private statIcons = StatIcons | private statIcons = StatIcons | ||||
| private voreStatIcons = VoreStatIcons | |||||
| private vigorDescs = VigorDescs | private vigorDescs = VigorDescs | ||||
| private statDescs = StatDescs | private statDescs = StatDescs | ||||
| private voreStatDescs = VoreStatDescs | |||||
| private vigor = Vigor | private vigor = Vigor | ||||
| firstperson: POV = POV.First | firstperson: POV = POV.First | ||||
| @@ -65,6 +65,26 @@ export const StatDescs: {[key in Stat]: string} = { | |||||
| Charm: 'Your mental power' | Charm: 'Your mental power' | ||||
| } | } | ||||
| export enum VoreStat { | |||||
| Mass = "Mass", | |||||
| Bulk = "Bulk", | |||||
| PreyCount = "Prey Count" | |||||
| } | |||||
| export type VoreStats = {[key in VoreStat]: number} | |||||
| export const VoreStatIcons: {[key in VoreStat]: string} = { | |||||
| [VoreStat.Mass]: "fas fa-weight", | |||||
| [VoreStat.Bulk]: "fas fa-weight-hanging", | |||||
| [VoreStat.PreyCount]: "fas fa-utensils" | |||||
| } | |||||
| export const VoreStatDescs: {[key in VoreStat]: string} = { | |||||
| [VoreStat.Mass]: "How much you weigh", | |||||
| [VoreStat.Bulk]: "Your weight, plus the weigh of your prey", | |||||
| [VoreStat.PreyCount]: "How many creatures you've got inside of you" | |||||
| } | |||||
| export interface CombatTest { | export interface CombatTest { | ||||
| test: (user: Creature, target: Creature) => boolean; | test: (user: Creature, target: Creature) => boolean; | ||||
| odds: (user: Creature, target: Creature) => number; | odds: (user: Creature, target: Creature) => number; | ||||
| @@ -1,7 +1,7 @@ | |||||
| import { DamageType, Damage, Combatant, Stats, Action, Vigor } from './combat' | |||||
| import { DamageType, Damage, Combatant, Stats, Action, Vigor, VoreStats, VoreStat } from './combat' | |||||
| import { Noun, Pronoun } from './language' | import { Noun, Pronoun } from './language' | ||||
| import { LogEntry, LogLine } from './interface' | import { LogEntry, LogLine } from './interface' | ||||
| import { Vore, Container, VoreType, VoreStat, VoreStats } from './vore' | |||||
| import { Vore, Container, VoreType } from './vore' | |||||
| export enum POV {First, Third} | export enum POV {First, Third} | ||||
| @@ -67,6 +67,11 @@ export class Creature extends Vore implements Combatant { | |||||
| return total + prey.voreStats.Bulk | return total + prey.voreStats.Bulk | ||||
| }, | }, | ||||
| 0 | 0 | ||||
| ) + container.digested.reduce( | |||||
| (total: number, prey: Vore) => { | |||||
| return total + prey.voreStats.Bulk | |||||
| }, | |||||
| 0 | |||||
| ) | ) | ||||
| }, | }, | ||||
| this.Mass | this.Mass | ||||
| @@ -78,7 +83,7 @@ export class Creature extends Vore implements Combatant { | |||||
| (total: number, container: Container) => { | (total: number, container: Container) => { | ||||
| return total + container.contents.reduce( | return total + container.contents.reduce( | ||||
| (total: number, prey: Vore) => { | (total: number, prey: Vore) => { | ||||
| return total + prey.voreStats[VoreStat.PreyCount] | |||||
| return total + 1 + prey.voreStats[VoreStat.PreyCount] | |||||
| }, | }, | ||||
| 0 | 0 | ||||
| ) | ) | ||||
| @@ -1,4 +1,4 @@ | |||||
| import { Stat, Vigor, StatDescs, VigorDescs, StatIcons, VigorIcons } from './combat' | |||||
| import { Stat, Vigor, StatDescs, VigorDescs, StatIcons, VigorIcons, VoreStat, VoreStatIcons, VoreStatDescs } from './combat' | |||||
| import tippy from 'tippy.js' | import tippy from 'tippy.js' | ||||
| /** | /** | ||||
| @@ -135,7 +135,7 @@ export class FAElem implements LogEntry { | |||||
| * A tooltip is attached to the symbol | * A tooltip is attached to the symbol | ||||
| */ | */ | ||||
| export class PropElem implements LogEntry { | export class PropElem implements LogEntry { | ||||
| constructor (private prop: Stat | Vigor, private value: number|null = null) { | |||||
| constructor (private prop: Stat | Vigor | VoreStat, private value: number|null = null) { | |||||
| } | } | ||||
| @@ -146,6 +146,8 @@ export class PropElem implements LogEntry { | |||||
| cls = StatIcons[this.prop as Stat] | cls = StatIcons[this.prop as Stat] | ||||
| } else if (this.prop in Vigor) { | } else if (this.prop in Vigor) { | ||||
| cls = VigorIcons[this.prop as Vigor] | cls = VigorIcons[this.prop as Vigor] | ||||
| } else if (this.prop in Vigor) { | |||||
| cls = VoreStatIcons[this.prop as VoreStat] | |||||
| } else { | } else { | ||||
| // this shouldn't be possible, given the typing... | // this shouldn't be possible, given the typing... | ||||
| cls = "fas fa-exclamation-triangle" | cls = "fas fa-exclamation-triangle" | ||||
| @@ -163,15 +165,14 @@ export class PropElem implements LogEntry { | |||||
| tooltipTemplate.appendChild(tooltipTitle) | tooltipTemplate.appendChild(tooltipTitle) | ||||
| tooltipTemplate.appendChild(tooltipBody) | tooltipTemplate.appendChild(tooltipBody) | ||||
| if (this.prop in Stat) { | |||||
| tooltipTitle.textContent = this.prop | |||||
| } else if (this.prop in Vigor) { | |||||
| tooltipTitle.textContent = this.prop | |||||
| } | |||||
| tooltipTitle.textContent = this.prop | |||||
| if (this.prop in Stat) { | if (this.prop in Stat) { | ||||
| tooltipBody.textContent = StatDescs[this.prop as Stat] | tooltipBody.textContent = StatDescs[this.prop as Stat] | ||||
| } else if (this.prop in Vigor) { | } else if (this.prop in Vigor) { | ||||
| tooltipBody.textContent = VigorDescs[this.prop as Vigor] | tooltipBody.textContent = VigorDescs[this.prop as Vigor] | ||||
| } else if (this.prop in VoreStat) { | |||||
| tooltipBody.textContent = VoreStatDescs[this.prop as VoreStat] | |||||
| } | } | ||||
| if (this.value !== null) { | if (this.value !== null) { | ||||
| @@ -1,5 +1,5 @@ | |||||
| import { Entity, Mortal, POV, Creature } from './entity' | import { Entity, Mortal, POV, Creature } from './entity' | ||||
| import { Damage, DamageType, Stats, Actionable, Action, Vigor } from './combat' | |||||
| import { Damage, DamageType, Stats, Actionable, Action, Vigor, VoreStats } from './combat' | |||||
| import { LogLines, LogEntry, CompositeLog, LogLine } from './interface' | import { LogLines, LogEntry, CompositeLog, LogLine } from './interface' | ||||
| import { Noun, Pronoun, POVPair, POVPairArgs, ImproperNoun, POVSolo } from './language' | import { Noun, Pronoun, POVPair, POVPairArgs, ImproperNoun, POVSolo } from './language' | ||||
| import { DigestAction, DevourAction, ReleaseAction, StruggleAction } from './combat/actions' | import { DigestAction, DevourAction, ReleaseAction, StruggleAction } from './combat/actions' | ||||
| @@ -11,14 +11,6 @@ export enum VoreType { | |||||
| Unbirth = "Unbirthing" | Unbirth = "Unbirthing" | ||||
| } | } | ||||
| export enum VoreStat { | |||||
| Mass = "Mass", | |||||
| Bulk = "Bulk", | |||||
| PreyCount = "Prey Count" | |||||
| } | |||||
| export type VoreStats = {[key in VoreStat]: number} | |||||
| export abstract class Vore implements Mortal { | export abstract class Vore implements Mortal { | ||||
| abstract name: Noun; | abstract name: Noun; | ||||
| abstract pronouns: Pronoun; | abstract pronouns: Pronoun; | ||||
| @@ -120,7 +112,7 @@ abstract class NormalContainer implements Container { | |||||
| } | } | ||||
| tick (dt: number): LogEntry { | tick (dt: number): LogEntry { | ||||
| const digested: Array<Vore> = [] | |||||
| const justDigested: Array<Vore> = [] | |||||
| const scaled = this.damage.scale(dt / 60) | const scaled = this.damage.scale(dt / 60) | ||||
| @@ -129,12 +121,13 @@ abstract class NormalContainer implements Container { | |||||
| damageResults.push(prey.takeDamage(scaled)) | damageResults.push(prey.takeDamage(scaled)) | ||||
| if (prey.vigors[Vigor.Health] <= 0) { | if (prey.vigors[Vigor.Health] <= 0) { | ||||
| digested.push(prey) | |||||
| this.digested.push(prey) | |||||
| justDigested.push(prey) | |||||
| } | } | ||||
| }) | }) | ||||
| const tickedEntries = new LogLines(...this.contents.map(prey => this.tickLines.run(this.owner, prey, { damage: scaled }))) | const tickedEntries = new LogLines(...this.contents.map(prey => this.tickLines.run(this.owner, prey, { damage: scaled }))) | ||||
| const digestedEntries = new LogLines(...digested.map(prey => this.digest(prey))) | |||||
| const digestedEntries = new LogLines(...justDigested.map(prey => this.digest(prey))) | |||||
| this.contents = this.contents.filter(prey => { | this.contents = this.contents.filter(prey => { | ||||
| return prey.vigors[Vigor.Health] > 0 | return prey.vigors[Vigor.Health] > 0 | ||||