From 22e433155067f91653e0509471c62ec76557bb43 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Thu, 5 May 2022 12:07:26 -0400 Subject: [PATCH] Add text that displays when your turn starts while eaten; add a werewolf --- .eslintrc.js | 9 ++++-- src/components/Combat.vue | 9 ++++++ src/game/creatures/monsters/werewolf.ts | 39 +++++++++++++++++++++++++ src/game/maps/town.ts | 21 +++++++++++++ src/game/vore.ts | 10 ++++++- src/game/words.ts | 6 ++++ 6 files changed, 91 insertions(+), 3 deletions(-) create mode 100644 src/game/creatures/monsters/werewolf.ts diff --git a/.eslintrc.js b/.eslintrc.js index f7019e1..9a5a14b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -6,7 +6,7 @@ module.exports = { extends: [ 'plugin:vue/essential', '@vue/standard', - '@vue/typescript/recommended' + '@vue/typescript/recommended', ], parserOptions: { ecmaVersion: 2020 @@ -18,6 +18,11 @@ module.exports = { '@typescript-eslint/no-unused-vars': 'off', 'quotes': 'off', 'function-paren-newline': ['error', 'multiline-arguments'], - '@typescript-eslint/member-ordering': ['warn'] + '@typescript-eslint/member-ordering': ['warn'], + 'indent': 'off', + '@typescript-eslint/indent': [ + 'error', + 2 + ], } } diff --git a/src/components/Combat.vue b/src/components/Combat.vue index 5207262..d0c0a3a 100644 --- a/src/components/Combat.vue +++ b/src/components/Combat.vue @@ -222,6 +222,15 @@ export default class Combat extends Vue { } else { this.executedRight(this.encounter.currentMove.ai.decide(this.encounter.currentMove, this.encounter)) } + } else { + if (this.encounter.currentMove.containedIn) { + this.writeLog( + this.encounter.currentMove.containedIn.statusLine( + this.encounter.currentMove.containedIn.owner, + this.encounter.currentMove + ) + ) + } } } } diff --git a/src/game/creatures/monsters/werewolf.ts b/src/game/creatures/monsters/werewolf.ts new file mode 100644 index 0000000..67301dc --- /dev/null +++ b/src/game/creatures/monsters/werewolf.ts @@ -0,0 +1,39 @@ +import { VoreAI } from '@/game/ai' +import { DamageType, Side, Stat, StatDamageFormula, Vigor } from '@/game/combat' +import { Creature } from '@/game/creature' +import { ImproperNoun, ObjectPronouns } from '@/game/language' +import { anyVore, Goo, Stomach } from '@/game/vore' + +export default class Werewolf extends Creature { + constructor () { + super( + new ImproperNoun("werewolf", "werewolves"), + new ImproperNoun("werewolf", "werewolves"), + ObjectPronouns, + { + Power: 45, + Toughness: 30, + Agility: 25, + Reflexes: 25, + Charm: 10, + Willpower: 15 + }, + anyVore, + anyVore, + 75 + ) + + const stomach = new Stomach( + this, + 50, + new StatDamageFormula([ + { fraction: 1, stat: Stat.Toughness, type: DamageType.Acid, target: Vigor.Health } + ]) + ) + + this.addVoreContainer(stomach) + + this.side = Side.Monsters + this.ai = new VoreAI(this) + } +} diff --git a/src/game/maps/town.ts b/src/game/maps/town.ts index 3ccfecf..d4a940b 100644 --- a/src/game/maps/town.ts +++ b/src/game/maps/town.ts @@ -12,6 +12,7 @@ import { DeliciousPerk } from '@/game/combat/perks' import Inazuma from '../creatures/characters/inazuma' import Human from '../creatures/human' import Slime from '../creatures/monsters/slime' +import Werewolf from '../creatures/monsters/werewolf' function makeParty (): Creature[] { const fighter = new Human(new ProperNoun("Redgar"), MalePronouns, { @@ -340,6 +341,26 @@ export const Town = (): Place => { ) ) + woods.choices.push( + new Choice( + "Fight a werewolf", + "Go fight a werewolf", + (world, executor) => { + const enemy = new Werewolf() + enemy.location = world.player.location + const encounter = new Encounter( + { + name: "Fight some tasty nerd", + intro: () => new LogLine(`A werewolf draws near!`) + }, + [world.player, enemy].concat(world.party) + ) + world.encounter = encounter + return nilLog + } + ) + ) + debug.choices.push( new Choice( "Add money", diff --git a/src/game/vore.ts b/src/game/vore.ts index f631194..2c3dc01 100644 --- a/src/game/vore.ts +++ b/src/game/vore.ts @@ -1,6 +1,6 @@ import { Damage, DamageType, Actionable, Action, Vigor, DamageInstance, DamageFormula } from '@/game/combat' import { LogLines, LogEntry, LogLine, nilLog, RandomEntry } from '@/game/interface' -import { Noun, ImproperNoun, Verb, RandomWord, Word, Preposition } from '@/game/language' +import { Noun, ImproperNoun, Verb, RandomWord, Word, Preposition, ToBe } from '@/game/language' import { RubAction, DevourAction, ReleaseAction, StruggleAction, TransferAction } from '@/game/combat/actions' import * as Words from '@/game/words' import { Creature } from '@/game/creature' @@ -53,6 +53,8 @@ export interface Container extends Actionable { consumeLine (user: Creature, target: Creature): LogEntry; + statusLine (user: Creature, target: Creature): LogEntry; + } export abstract class NormalContainer implements Container { @@ -82,6 +84,12 @@ export abstract class NormalContainer implements Container { return new LogLine(`${user.name.capital} ${user.name.conjugate(this.consumeVerb)} ${target.name.objective} ${this.consumePreposition} ${user.pronouns.possessive} ${this.name}.`) } + statusLine (user: Creature, target: Creature): LogEntry { + return new LogLine( + `${target.name.capital} ${target.name.conjugate(new ToBe())} ${Words.Stuck} inside ${user.name.possessive} ${this.name}.` + ) + } + releaseLine (user: Creature, target: Creature): LogEntry { return new LogLine(`${user.name.capital} ${user.name.conjugate(this.releaseVerb)} ${target.name.objective} ${this.releasePreposition} ${user.pronouns.possessive} ${this.name}.`) } diff --git a/src/game/words.ts b/src/game/words.ts index 3ffba23..cc37152 100644 --- a/src/game/words.ts +++ b/src/game/words.ts @@ -120,3 +120,9 @@ export const Sloppily = new RandomWord([ new Adverb("sloppily"), new Adverb("messily") ]) + +export const Stuck = new RandomWord([ + new Adjective("stuck"), + new Adjective("trapped"), + new Adjective("imprisoned") +])