Selaa lähdekoodia

Boot too big

vintage
Fen Dweller 5 vuotta sitten
vanhempi
commit
23e2fa383b
2 muutettua tiedostoa jossa 74 lisäystä ja 7 poistoa
  1. +2
    -2
      src/game/combat/actions.ts
  2. +72
    -5
      src/game/creatures/withers.ts

+ 2
- 2
src/game/combat/actions.ts Näytä tiedosto

@@ -73,7 +73,7 @@ export class DevourAction extends TogetherAction {
}

constructor (protected container: Container) {
super(new DynText(new LiveText(container, x => x.consumeVerb.capital), ' (', new LiveText(container, x => x.name.all), ')'), 'Try to consume your foe', [new CapableCondition()])
super(new DynText(new LiveText(container, x => x.consumeVerb.capital), ' (', new LiveText(container, x => x.name.all), ')'), new LiveText(container, x => `Try to ${x.consumeVerb} your foe`), [new CapableCondition()])
this.test = new StatVigorTest(Stat.Power)
}

@@ -86,7 +86,7 @@ export class DevourAction extends TogetherAction {
}

describe (user: Creature, target: Creature): LogEntry {
return new LogLine(`Try to consume your opponent, sending them to your ${this.container.name}. `, this.test.explain(user, target))
return new LogLine(`Try to ${this.container.consumeVerb} your opponent, sending them to your ${this.container.name}. `, this.test.explain(user, target))
}
}



+ 72
- 5
src/game/creatures/withers.ts Näytä tiedosto

@@ -1,5 +1,5 @@
import { Creature, POV } from '../entity'
import { Damage, DamageType, ConstantDamageFormula, Vigor, Side, GroupAction, CombatTest, Stat, Action, DamageFormula, UniformRandomDamageFormula } from '../combat'
import { Damage, DamageType, ConstantDamageFormula, Vigor, Side, GroupAction, CombatTest, Stat, Action, DamageFormula, UniformRandomDamageFormula, PairAction } from '../combat'
import { ImproperNoun, POVPair, ProperNoun, FemalePronouns, RandomWord, Adjective, POVPairArgs, POVSoloArgs, Verb } from '../language'
import { LogLine, LogLines, LogEntry, Newline } from '../interface'
import { VoreType, Stomach, VoreContainer, Vore, NormalContainer, Container } from '../vore'
@@ -39,6 +39,70 @@ class MawContainer extends NormalContainer {
}
}

class FlexToesAction extends GroupAction {
lines = new POVPairArgs<Creature, Creature, { damage: Damage }>([
[[POV.First, POV.Third], (user, target, args) => new LogLine(`Your toes crush ${target.name} for `, args.damage.renderShort(), ` damage!`)],
[[POV.Third, POV.First], (user, target, args) => new LogLine(`${user.name.capital}'s toes crush you for `, args.damage.renderShort(), ` damage!`)],
[[POV.Third, POV.Third], (user, target, args) => new LogLine(`${user.name.capital}'s toes crush ${target.name} for `, args.damage.renderShort(), ` damage!`)]
])

describeGroup (user: Creature, targets: Creature[]): LogEntry {
return new LogLine(`Flex your toes. `, this.damage.explain(user))
}

execute (user: Creature, target: Creature): LogEntry {
const damage = this.damage.calc(user, target)
return new LogLines(target.takeDamage(damage), this.lines.run(user, target, { damage: damage }))
}

describe (user: Creature, target: Creature): LogEntry {
return new LogLine(`Flex your toes! `, this.damage.describe(user, target))
}

constructor (private damage: DamageFormula, container: Container) {
super('Flex Toes', 'Flex your toes!', [
new ContainerCondition(container)
])
}
}

class BootContainer extends NormalContainer {
consumeLines = new POVPair<Vore, Vore>([
[[POV.First, POV.Third], (user, target) => new LogLine(`You stuff ${target.name} into your boot.`)],
[[POV.Third, POV.First], (user, target) => new LogLine(`${user.name.capital} stuffs you in ${user.pronouns.possessive} boot, pinning you between toes and insole.`)],
[[POV.Third, POV.Third], (user, target) => new LogLine(`${user.name.capital} stuffs ${target.name} in ${user.pronouns.possessive} boot.`)]
])

releaseLines = new POVPair([
[[POV.First, POV.Third], (user, target) => new LogLine(`You dump ${target.name} out from your boot.`)],
[[POV.Third, POV.First], (user, target) => new LogLine(`${user.name.capital} dumps you out from ${user.pronouns.possessive} boot.`)],
[[POV.Third, POV.Third], (user, target) => new LogLine(`${user.name.capital} dumps ${target.name} out from ${user.pronouns.possessive} boot.`)]
])

struggleLines = new POVPair([
[[POV.First, POV.Third], (user, target) => new LogLine(`You slip out from ${target.name}'s boot.`)],
[[POV.Third, POV.First], (user, target) => new LogLine(`${user.name.capital} squeezes ${user.pronouns.possessive} way free of your footwear!`)],
[[POV.Third, POV.Third], (user, target) => new LogLine(`${user.name.capital} escapes from ${target.name}'s boot.`)]
])

consumeVerb = new Verb('trap', 'traps', 'trapped', 'trapping')
releaseVerb = new Verb('dump')
struggleVerb = new Verb('struggle', 'struggles', 'struggling', 'struggled')

constructor (owner: Vore) {
super(new ImproperNoun('boot'), owner, new Set(), 50)

const flex = new FlexToesAction(new UniformRandomDamageFormula(new Damage(
{ target: Vigor.Health, type: DamageType.Crush, amount: 50 },
{ target: Vigor.Stamina, type: DamageType.Crush, amount: 50 },
{ target: Vigor.Resolve, type: DamageType.Crush, amount: 50 }
), 0.5),
this)

this.actions.push(flex)
}
}

const huge = new RandomWord([
new Adjective('massive'),
new Adjective('colossal'),
@@ -206,14 +270,17 @@ export class Withers extends Creature {

this.groupActions.push(new DevourAllAction(stomach))

const grapple = new MawContainer(this, stomach)
const maw = new MawContainer(this, stomach)

this.otherContainers.push(grapple)
this.otherContainers.push(maw)

this.actions.push(new ChewAction(new UniformRandomDamageFormula(new Damage(
{ target: Vigor.Health, type: DamageType.Crush, amount: 10000 }
), 0.5),
grapple,
new TransferAction(grapple, stomach)))
maw,
new TransferAction(maw, stomach)))

const boot = new BootContainer(this)
this.otherContainers.push(boot)
}
}

Loading…
Peruuta
Tallenna