| @@ -1,6 +1,6 @@ | |||||
| import { Creature } from '../entity' | import { Creature } from '../entity' | ||||
| import { Damage, DamageType, ConstantDamageFormula, Vigor, Stats, Vigors } from '../combat' | import { Damage, DamageType, ConstantDamageFormula, Vigor, Stats, Vigors } from '../combat' | ||||
| import { MalePronouns, Noun, Pronoun } from '../language' | |||||
| import { MalePronouns, Noun, Pronoun, ImproperNoun } from '../language' | |||||
| import { VoreType } from '../vore' | import { VoreType } from '../vore' | ||||
| import { AttackAction } from '../combat/actions' | import { AttackAction } from '../combat/actions' | ||||
| @@ -19,7 +19,7 @@ export class Human extends Creature { | |||||
| } else { | } else { | ||||
| stats = options.stats | stats = options.stats | ||||
| } | } | ||||
| super(name, pronouns, stats, new Set([VoreType.Oral, VoreType.Anal]), new Set([VoreType.Oral, VoreType.Anal]), 25) | |||||
| super(name, new ImproperNoun('human', 'humans'), pronouns, stats, new Set([VoreType.Oral, VoreType.Anal]), new Set([VoreType.Oral, VoreType.Anal]), 25) | |||||
| this.actions.push(new AttackAction(new ConstantDamageFormula( | this.actions.push(new AttackAction(new ConstantDamageFormula( | ||||
| new Damage( | new Damage( | ||||
| { amount: 20, target: Vigor.Health, type: DamageType.Slash } | { amount: 20, target: Vigor.Health, type: DamageType.Slash } | ||||
| @@ -1,12 +1,12 @@ | |||||
| import { Creature, POV } from '../entity' | import { Creature, POV } from '../entity' | ||||
| import { ProperNoun, TheyPronouns } from '../language' | |||||
| import { ProperNoun, TheyPronouns, ImproperNoun } from '../language' | |||||
| import { Stat, Damage, DamageType, Vigor, ConstantDamageFormula } from '../combat' | import { Stat, Damage, DamageType, Vigor, ConstantDamageFormula } from '../combat' | ||||
| import { Stomach, Bowels, VoreType } from '../vore' | import { Stomach, Bowels, VoreType } from '../vore' | ||||
| import { AttackAction } from '../combat/actions' | import { AttackAction } from '../combat/actions' | ||||
| export class Player extends Creature { | export class Player extends Creature { | ||||
| constructor () { | constructor () { | ||||
| super(new ProperNoun('The Dude'), TheyPronouns, { Toughness: 20, Power: 20, Speed: 20, Willpower: 20, Charm: 20 }, new Set([VoreType.Oral, VoreType.Anal]), new Set([VoreType.Oral, VoreType.Anal]), 50) | |||||
| super(new ProperNoun('The Dude'), new ImproperNoun('player', 'players'), TheyPronouns, { Toughness: 20, Power: 20, Speed: 20, Willpower: 20, Charm: 20 }, new Set([VoreType.Oral, VoreType.Anal]), new Set([VoreType.Oral, VoreType.Anal]), 50) | |||||
| this.actions.push(new AttackAction(new ConstantDamageFormula(new Damage({ type: DamageType.Pierce, amount: 20, target: Vigor.Health }, { type: DamageType.Pierce, amount: 20, target: Vigor.Stamina })))) | this.actions.push(new AttackAction(new ConstantDamageFormula(new Damage({ type: DamageType.Pierce, amount: 20, target: Vigor.Health }, { type: DamageType.Pierce, amount: 20, target: Vigor.Stamina })))) | ||||
| @@ -1,10 +1,9 @@ | |||||
| 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 { Creature, POV } from '../entity' | |||||
| import { Damage, DamageType, ConstantDamageFormula, Vigor, Side, GroupAction } from '../combat' | |||||
| import { ImproperNoun, POVPair, ProperNoun, FemalePronouns, RandomWord, Adjective } from '../language' | |||||
| import { LogLine, LogLines, LogEntry } from '../interface' | 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 { VoreType, Stomach, Container } from '../vore' | |||||
| import { AttackAction, FeedAction } from '../combat/actions' | |||||
| import { TogetherCondition } from '../combat/conditions' | import { TogetherCondition } from '../combat/conditions' | ||||
| import { InstantKill } from '../combat/effects' | import { InstantKill } from '../combat/effects' | ||||
| @@ -27,7 +26,7 @@ class BiteAction extends AttackAction { | |||||
| class StompAction extends GroupAction { | class StompAction extends GroupAction { | ||||
| lines: POVPair<Creature, Creature> = new POVPair([ | lines: POVPair<Creature, Creature> = new POVPair([ | ||||
| [[POV.First, POV.Third], (user: Creature, target: Creature) => new LogLine(`You flatten ${target.name} under your foot!`)], | [[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.First], (user: 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!`)] | [[POV.Third, POV.Third], (user: Creature, target: Creature) => new LogLine(`${user.name.capital} flattens ${target.name} under ${user.pronouns.possessive} ${huge} foot!`)] | ||||
| ]) | ]) | ||||
| @@ -53,7 +52,7 @@ class StompAction extends GroupAction { | |||||
| class DevourAllAction extends GroupAction { | class DevourAllAction extends GroupAction { | ||||
| lines: POVPair<Creature, Creature> = new POVPair([ | lines: POVPair<Creature, Creature> = new POVPair([ | ||||
| [[POV.First, POV.Third], (user: Creature, target: Creature) => new LogLine(`You scoop up ${target.name}!`)], | [[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.First], (user: 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!`)] | [[POV.Third, POV.Third], (user: Creature, target: Creature) => new LogLine(`${user.name.capital} scoops ${target.name} up!`)] | ||||
| ]) | ]) | ||||
| @@ -68,7 +67,7 @@ class DevourAllAction extends GroupAction { | |||||
| executeGroup (user: Creature, targets: Array<Creature>): LogEntry { | executeGroup (user: Creature, targets: Array<Creature>): LogEntry { | ||||
| return new LogLines(...targets.map(target => this.execute(user, target)).concat( | return new LogLines(...targets.map(target => this.execute(user, target)).concat( | ||||
| [new LogLine('GULP!')] | |||||
| [new LogLine(`All ${targets.length} of them are ${user.kind} chow now`)] | |||||
| )) | )) | ||||
| } | } | ||||
| @@ -87,8 +86,9 @@ export class Withers extends Creature { | |||||
| constructor () { | constructor () { | ||||
| super( | super( | ||||
| new ProperNoun('Withers'), | new ProperNoun('Withers'), | ||||
| new ImproperNoun('hellhound', 'hellhounds'), | |||||
| FemalePronouns, | FemalePronouns, | ||||
| { Toughness: 60, Power: 100, Speed: 40, Willpower: 60, Charm: 120 }, | |||||
| { Toughness: 60, Power: 70, Speed: 40, Willpower: 60, Charm: 120 }, | |||||
| new Set(), | new Set(), | ||||
| new Set([VoreType.Oral]), | new Set([VoreType.Oral]), | ||||
| 5000) | 5000) | ||||
| @@ -44,7 +44,7 @@ class HypnoAction extends AttackAction { | |||||
| export class Wolf extends Creature { | export class Wolf extends Creature { | ||||
| constructor () { | constructor () { | ||||
| super(new ImproperNoun('wolf', 'wolves'), MalePronouns, { Toughness: 20, Power: 20, Speed: 20, Willpower: 20, Charm: 20 }, new Set([VoreType.Oral, VoreType.Anal]), new Set([VoreType.Oral, VoreType.Anal]), 25) | |||||
| super(new ImproperNoun('wolf', 'wolves'), new ImproperNoun('wolf', 'wolves'), MalePronouns, { Toughness: 20, Power: 20, Speed: 20, Willpower: 20, Charm: 20 }, new Set([VoreType.Oral, VoreType.Anal]), new Set([VoreType.Oral, VoreType.Anal]), 25) | |||||
| this.actions.push(new BiteAction()) | this.actions.push(new BiteAction()) | ||||
| this.actions.push(new HypnoAction()) | this.actions.push(new HypnoAction()) | ||||
| @@ -1,5 +1,5 @@ | |||||
| import { DamageType, Damage, Combatant, Stats, Action, Vigor, VoreStats, VoreStat, Stat, Side, GroupAction } from './combat' | import { DamageType, Damage, Combatant, Stats, Action, Vigor, VoreStats, VoreStat, Stat, Side, GroupAction } from './combat' | ||||
| import { Noun, Pronoun } from './language' | |||||
| import { Noun, Pronoun, Adjective, ImproperNoun } from './language' | |||||
| import { LogEntry, LogLine } from './interface' | import { LogEntry, LogLine } from './interface' | ||||
| import { Vore, Container, VoreType } from './vore' | import { Vore, Container, VoreType } from './vore' | ||||
| @@ -12,6 +12,7 @@ export interface Entity { | |||||
| } | } | ||||
| export interface Mortal extends Entity { | export interface Mortal extends Entity { | ||||
| kind: Noun; | |||||
| vigors: {[key in Vigor]: number}; | vigors: {[key in Vigor]: number}; | ||||
| maxVigors: {[key in Vigor]: number}; | maxVigors: {[key in Vigor]: number}; | ||||
| disabled: boolean; | disabled: boolean; | ||||
| @@ -57,7 +58,7 @@ export class Creature extends Vore implements Combatant { | |||||
| containedIn: Container|null = null; | containedIn: Container|null = null; | ||||
| constructor (public name: Noun, public pronouns: Pronoun, public stats: Stats, public preyPrefs: Set<VoreType>, public predPrefs: Set<VoreType>, mass: number) { | |||||
| constructor (public name: Noun, public kind: Noun, public pronouns: Pronoun, public stats: Stats, public preyPrefs: Set<VoreType>, public predPrefs: Set<VoreType>, mass: number) { | |||||
| super() | super() | ||||
| const containers = this.containers | const containers = this.containers | ||||
| this.baseStats = Object.keys(Stat).reduce((base: any, key) => { base[key] = stats[key as Stat]; return base }, {}) | this.baseStats = Object.keys(Stat).reduce((base: any, key) => { base[key] = stats[key as Stat]; return base }, {}) | ||||
| @@ -117,52 +117,52 @@ export abstract class Word { | |||||
| // These functions are pure; they don't mutate the original object. | // These functions are pure; they don't mutate the original object. | ||||
| // This is necessary to avoid causing chaos. | // This is necessary to avoid causing chaos. | ||||
| get capital (): Word { | |||||
| get capital (): this { | |||||
| const opts: WordOptions = Object.assign({}, this.opt) | const opts: WordOptions = Object.assign({}, this.opt) | ||||
| opts.capital = true | opts.capital = true | ||||
| return this.configure(opts) | |||||
| return this.configure(opts) as this | |||||
| } | } | ||||
| get plural (): Word { | |||||
| get plural (): this { | |||||
| const opts: WordOptions = Object.assign({}, this.opt) | const opts: WordOptions = Object.assign({}, this.opt) | ||||
| opts.plural = true | opts.plural = true | ||||
| return this.configure(opts) | |||||
| return this.configure(opts) as this | |||||
| } | } | ||||
| get proper (): Word { | |||||
| get proper (): this { | |||||
| const opts: WordOptions = Object.assign({}, this.opt) | const opts: WordOptions = Object.assign({}, this.opt) | ||||
| opts.proper = true | opts.proper = true | ||||
| return this.configure(opts) | |||||
| return this.configure(opts) as this | |||||
| } | } | ||||
| get improper (): Word { | |||||
| get improper (): this { | |||||
| const opts: WordOptions = Object.assign({}, this.opt) | const opts: WordOptions = Object.assign({}, this.opt) | ||||
| opts.proper = false | opts.proper = false | ||||
| return this.configure(opts) | |||||
| return this.configure(opts) as this | |||||
| } | } | ||||
| get specific (): Word { | |||||
| get specific (): this { | |||||
| const opts: WordOptions = Object.assign({}, this.opt) | const opts: WordOptions = Object.assign({}, this.opt) | ||||
| opts.kind = NounKind.Specific | opts.kind = NounKind.Specific | ||||
| return this.configure(opts) | |||||
| return this.configure(opts) as this | |||||
| } | } | ||||
| get nonspecific (): Word { | |||||
| get nonspecific (): this { | |||||
| const opts: WordOptions = Object.assign({}, this.opt) | const opts: WordOptions = Object.assign({}, this.opt) | ||||
| opts.kind = NounKind.Nonspecific | opts.kind = NounKind.Nonspecific | ||||
| return this.configure(opts) | |||||
| return this.configure(opts) as this | |||||
| } | } | ||||
| get all (): Word { | |||||
| get all (): this { | |||||
| const opts: WordOptions = Object.assign({}, this.opt) | const opts: WordOptions = Object.assign({}, this.opt) | ||||
| opts.kind = NounKind.All | opts.kind = NounKind.All | ||||
| return this.configure(opts) | |||||
| return this.configure(opts) as this | |||||
| } | } | ||||
| get uncountable (): Word { | |||||
| get uncountable (): this { | |||||
| const opts: WordOptions = Object.assign({}, this.opt) | const opts: WordOptions = Object.assign({}, this.opt) | ||||
| opts.count = false | opts.count = false | ||||
| return this.configure(opts) | |||||
| return this.configure(opts) as this | |||||
| } | } | ||||
| } | } | ||||
| @@ -13,6 +13,7 @@ export enum VoreType { | |||||
| export abstract class Vore implements Mortal { | export abstract class Vore implements Mortal { | ||||
| abstract name: Noun; | abstract name: Noun; | ||||
| abstract kind: Noun; | |||||
| abstract pronouns: Pronoun; | abstract pronouns: Pronoun; | ||||
| abstract perspective: POV; | abstract perspective: POV; | ||||
| abstract vigors: {[key in Vigor]: number}; | abstract vigors: {[key in Vigor]: number}; | ||||