|
- import { Creature } from "../creature"
- import { Damage, DamageType, ConstantDamageFormula, Vigor, Side, GroupAction, FractionDamageFormula, DamageFormula, UniformRandomDamageFormula, CompositionAction, StatusEffect } from '../combat'
- import { MalePronouns, ImproperNoun, Verb, ProperNoun, ToBe, SoloLineArgs } from '../language'
- import { VoreType, NormalContainer, Vore, InnerVoreContainer, Container } from '../vore'
- import { TransferAction } from '../combat/actions'
- import { LogEntry, LogLine, LogLines } from '../interface'
- import { ContainerFullCondition, CapableCondition, EnemyCondition, TogetherCondition } from '../combat/conditions'
- import { UntouchableEffect, DazzlingEffect, StunEffect } from '../combat/effects'
- import { DamageConsequence, StatusConsequence, LogConsequence } from '../combat/consequences'
-
- class GoldeneyeCrop extends NormalContainer {
- consumeVerb: Verb = new Verb('swallow')
- releaseVerb: Verb = new Verb('free')
- struggleVerb: Verb = new Verb('struggle', 'struggles', 'struggling', 'struggled')
-
- constructor (owner: Vore) {
- super(
- new ImproperNoun('crop').all,
- owner,
- new Set([VoreType.Oral]),
- 300
- )
- }
- }
-
- class Taunt extends GroupAction {
- damage: DamageFormula = new UniformRandomDamageFormula(
- new Damage(
- { amount: 50, target: Vigor.Resolve, type: DamageType.Dominance }
- ),
- 0.5
- )
-
- constructor () {
- super(
- "Taunt",
- "Demoralize your enemies",
- [
- new EnemyCondition(),
- new CapableCondition()
- ]
- )
- }
-
- describeGroup (user: Creature, targets: Creature[]): LogEntry {
- return new LogLine(`Demoralize your foes`)
- }
-
- execute (user: Creature, target: Creature): LogEntry {
- return target.takeDamage(this.damage.calc(user, target))
- }
-
- describe (user: Creature, target: Creature): LogEntry {
- return new LogLine(`Demoralize your foes`)
- }
- }
- class Flaunt extends GroupAction {
- constructor (public container: Container) {
- super(
- "Flaunt " + container.name,
- "Show off your " + container.name,
- [new ContainerFullCondition(container), new CapableCondition(), new EnemyCondition(), new TogetherCondition()]
- )
- }
-
- groupLine: SoloLineArgs<Creature, { container: Container }> = (user, args) => new LogLine(
- `${user.name.capital} ${user.name.conjugate(new Verb('show'))} off ${user.pronouns.possessive} squirming ${args.container.name}, ${user.pronouns.possessive} doomed prey writhing beneath ${user.pronouns.possessive} pelt.`
- )
-
- describeGroup (user: Creature, targets: Creature[]): LogEntry {
- return new LogLine(`Flaunt your bulging ${this.container.name} for all your foes to see`)
- }
-
- execute (user: Creature, target: Creature): LogEntry {
- const fracDamage = new FractionDamageFormula([
- { fraction: 0.25, target: Vigor.Resolve, type: DamageType.Dominance }
- ])
- const flatDamage = new ConstantDamageFormula(
- new Damage(
- { amount: 50, target: Vigor.Resolve, type: DamageType.Dominance }
- )
- )
-
- const damage = fracDamage.calc(user, target).combine(flatDamage.calc(user, target))
-
- return new LogLines(
- new LogLine(`${target.name.capital} ${target.name.conjugate(new ToBe())} shaken for `, damage.renderShort(), '.'),
- target.takeDamage(damage)
- )
- }
-
- executeGroup (user: Creature, targets: Array<Creature>): LogEntry {
- return new LogLines(...[this.groupLine(user, { container: this.container })].concat(targets.map(target => this.execute(user, target))))
- }
-
- describe (user: Creature, target: Creature): LogEntry {
- return new LogLine(`Flaunt your bulging gut for all your foes to see`)
- }
- }
-
- class GoldeneyeStomach extends InnerVoreContainer {
- consumeVerb: Verb = new Verb('swallow')
- releaseVerb: Verb = new Verb('free')
- struggleVerb: Verb = new Verb('struggle', 'struggles', 'struggling', 'struggled')
-
- constructor (owner: Vore, crop: GoldeneyeCrop) {
- super(
- new ImproperNoun('stomach').all,
- owner,
- new Set([VoreType.Oral]),
- 900,
- new Damage(
- { amount: 1000, target: Vigor.Health, type: DamageType.Acid }
- ),
- crop
- )
- }
- }
-
- export class Goldeneye extends Creature {
- constructor () {
- super(
- new ProperNoun("Goldeneye"),
- new ImproperNoun('gryphon', 'gryphons'),
- MalePronouns,
- { Toughness: 200, Power: 200, Speed: 200, Willpower: 200, Charm: 200 },
- new Set(),
- new Set([VoreType.Oral]),
- 2000
- )
-
- this.title = "Not really a gryphon"
- this.desc = "Not really survivable, either."
-
- this.side = Side.Monsters
- this.applyEffect(new DazzlingEffect([
- new EnemyCondition(),
- new TogetherCondition()
- ]))
-
- const crop = new GoldeneyeCrop(this)
- const stomach = new GoldeneyeStomach(this, crop)
-
- this.containers.push(stomach)
- this.otherContainers.push(crop)
-
- this.actions.push(
- new TransferAction(
- crop,
- stomach
- )
- )
-
- this.groupActions.push(new Flaunt(crop))
- this.groupActions.push(new Flaunt(stomach))
- this.groupActions.push(new Taunt())
-
- this.actions.push(new CompositionAction(
- "Stomp",
- "Big step",
- {
- conditions: [
- new TogetherCondition(),
- new EnemyCondition()
- ],
- consequences: [
- new LogConsequence(
- (user, target) => new LogLine(
- `${user.name.capital} ${user.name.conjugate(new Verb('stomp'))} on ${target.name.objective} with crushing force!`
- )
- ),
- new DamageConsequence(
- new FractionDamageFormula([
- { fraction: 0.75, target: Vigor.Health, type: DamageType.Pure }
- ])
- ),
- new DamageConsequence(
- new ConstantDamageFormula(
- new Damage(
- { amount: 50, target: Vigor.Health, type: DamageType.Crush }
- )
- )
- ),
- new StatusConsequence(
- () => new StunEffect(3)
- )
- ]
- }
- ))
- }
- }
|