|
- import { VoreAI } from '@/game/ai'
- import { DamageType, Side, Stat, StatDamageFormula, StatusEffect, Vigor } from '@/game/combat'
- import { DigestionPowerEffect } from '@/game/combat/effects'
- import { Creature } from '@/game/creature'
- import { LogEntry, LogLine, nilLog } from '@/game/interface'
- import { ImproperNoun, MalePronouns, ObjectPronouns, Preposition, Verb } from '@/game/language'
- import { anyVore, ConnectionDirection, Container, Stomach, Throat, transferDescription } from '@/game/vore'
- import * as Words from '@/game/words'
- import * as Onomatopoeia from '@/game/onomatopoeia'
-
- export default class Werewolf extends Creature {
- constructor () {
- super(
- new ImproperNoun("werewolf", "werewolves"),
- new ImproperNoun("werewolf", "werewolves"),
- MalePronouns,
- {
- Power: 45,
- Toughness: 30,
- Agility: 25,
- Reflexes: 25,
- Charm: 10,
- Willpower: 15
- },
- anyVore,
- anyVore,
- 75
- )
-
- const throat = new Throat(
- this,
- 25
- )
-
- const stomach = new Stomach(
- this,
- 50,
- new StatDamageFormula([
- { fraction: 1, stat: Stat.Toughness, type: DamageType.Acid, target: Vigor.Health }
- ])
- )
-
- stomach.effects.push(new class extends StatusEffect {
- constructor () {
- super(
- "Pinned",
- "Prey sometimes can't move.",
- "fas fa-sun"
- )
- }
-
- onApply (creature: Creature): LogEntry {
- return new LogLine(
- `${stomach.owner.name.capital.possessive} ${stomach.name} is incredibly tight, gripping ${creature.name.objective} like a vice!`
- )
- }
-
- preAction (creature: Creature): { prevented: boolean; log: LogEntry } {
- if (Math.random() < 0.5) {
- return {
- prevented: true,
- log: new LogLine(`${creature.name.capital} can't move!`)
- }
- } else {
- return {
- prevented: false,
- log: nilLog
- }
- }
- }
- }())
-
- this.addContainer(throat)
- this.addContainer(stomach)
-
- throat.connect({
- destination: stomach,
- direction: ConnectionDirection.Deeper,
- description: transferDescription(Words.Swallow, new Preposition("down"))
- })
-
- stomach.connect({
- destination: throat,
- direction: ConnectionDirection.Shallower,
- description: transferDescription(new Verb("hork"), new Preposition("up"))
- })
-
- stomach.voreRelay.subscribe("onDigested", (sender, args) => {
- return Onomatopoeia.makeOnomatopoeia(Onomatopoeia.Burp)
- })
-
- this.side = Side.Monsters
- this.ai = new VoreAI(this)
- }
- }
|