|
- import { Creature, POV, Entity } from '../entity'
- import { Stat, Damage, DamageType, ConstantDamageFormula, Vigor, Side, PairAction, CombatTest, GroupAction } from '../combat'
- import { MalePronouns, ImproperNoun, POVPair, POVPairArgs, ProperNoun, TheyPronouns, FemalePronouns, RandomWord, Adjective } from '../language'
- import { LogLine, LogLines, LogEntry } from '../interface'
- import { VoreType, Stomach, Bowels, Container } from '../vore'
- import { StatTest } from '../combat/tests'
- import { AttackAction, TransferAction, FeedAction } from '../combat/actions'
- import { TogetherCondition } from '../combat/conditions'
- import { InstantKill } from '../combat/effects'
-
- const huge = new RandomWord([
- new Adjective('massive'),
- new Adjective('colossal'),
- new Adjective('big ol\''),
- new Adjective('heavy'),
- new Adjective('crushing'),
- new Adjective('huge')
- ])
-
- class BiteAction extends AttackAction {
- constructor () {
- super(new ConstantDamageFormula(new Damage({ amount: 50, type: DamageType.Slash, target: Vigor.Health })))
- this.name = "Bite"
- }
- }
-
- class StompAction extends GroupAction {
- lines: POVPair<Creature, Creature> = new POVPair([
- [[POV.First, POV.Third], (user: Creature, target: Creature) => new LogLine(`You flatten ${target.name} under your foot!`)],
- [[POV.Third, POV.First], (user: Creature, target: Creature) => new LogLine(`${user.name.capital} flattens you under ${user.pronouns.possessive} ${huge} foot!`)],
- [[POV.Third, POV.Third], (user: Creature, target: Creature) => new LogLine(`${user.name.capital} flattens ${target.name} under ${user.pronouns.possessive} ${huge} foot!`)]
- ])
-
- execute (user: Creature, target: Creature): LogEntry {
- return new LogLines(this.lines.run(user, target), new InstantKill().apply(target))
- }
-
- describe (user: Creature, target: Creature): LogEntry {
- return new LogLine('Stomp one sucker')
- }
-
- describeGroup (user: Creature, targets: Array<Creature>): LogEntry {
- return new LogLine('Stomp all ', targets.length.toString(), ' of \'em!')
- }
-
- constructor () {
- super('Stomp', 'STOMP!', [
- new TogetherCondition()
- ])
- }
- }
-
- class DevourAllAction extends GroupAction {
- lines: POVPair<Creature, Creature> = new POVPair([
- [[POV.First, POV.Third], (user: Creature, target: Creature) => new LogLine(`You scoop up ${target.name}!`)],
- [[POV.Third, POV.First], (user: Creature, target: Creature) => new LogLine(`${user.name.capital} scoops you up!`)],
- [[POV.Third, POV.Third], (user: Creature, target: Creature) => new LogLine(`${user.name.capital} scoops ${target.name} up!`)]
- ])
-
- execute (user: Creature, target: Creature): LogEntry {
- this.container.consume(target)
- return new LogLines(this.lines.run(user, target))
- }
-
- describe (user: Creature, target: Creature): LogEntry {
- return new LogLine('Stomp one sucker')
- }
-
- executeGroup (user: Creature, targets: Array<Creature>): LogEntry {
- return new LogLines(...targets.map(target => this.execute(user, target)).concat(
- [new LogLine('GULP!')]
- ))
- }
-
- describeGroup (user: Creature, targets: Array<Creature>): LogEntry {
- return new LogLine('Eat all ', targets.length.toString(), ' of \'em!')
- }
-
- constructor (private container: Container) {
- super('Devour All', 'GULP!', [
- new TogetherCondition()
- ])
- }
- }
-
- export class Withers extends Creature {
- constructor () {
- super(
- new ProperNoun('Withers'),
- FemalePronouns,
- { Toughness: 60, Power: 100, Speed: 40, Willpower: 60, Charm: 120 },
- new Set(),
- new Set([VoreType.Oral]),
- 5000)
-
- this.actions.push(new BiteAction())
- this.groupActions.push(new StompAction())
-
- this.side = Side.Monsters
-
- const stomach = new Stomach(this, 50, new Damage(
- { amount: 30, type: DamageType.Acid, target: Vigor.Health },
- { amount: 20, type: DamageType.Crush, target: Vigor.Stamina },
- { amount: 20, type: DamageType.Dominance, target: Vigor.Resolve }
- ))
-
- this.containers.push(stomach)
- this.otherActions.push(new FeedAction(stomach))
-
- this.groupActions.push(new DevourAllAction(stomach))
- }
- }
|