|
|
|
@@ -1,5 +1,5 @@ |
|
|
|
import { Creature, POV } from '../entity' |
|
|
|
import { Damage, DamageType, ConstantDamageFormula, Vigor, Side, GroupAction, CombatTest, Stat, Action } from '../combat' |
|
|
|
import { Damage, DamageType, ConstantDamageFormula, Vigor, Side, GroupAction, CombatTest, Stat, Action, DamageFormula, UniformRandomDamageFormula } 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' |
|
|
|
@@ -63,14 +63,15 @@ class ChewAction extends GroupAction { |
|
|
|
]) |
|
|
|
|
|
|
|
describeGroup (user: Creature, targets: Creature[]): LogEntry { |
|
|
|
return new LogLine('CRUNCH') |
|
|
|
return new LogLine('Crunch \'em all. ', this.damage.explain(user)) |
|
|
|
} |
|
|
|
|
|
|
|
execute (user: Creature, target: Creature): LogEntry { |
|
|
|
const damage = this.damage.calc(user, target) |
|
|
|
const results: Array<LogEntry> = [] |
|
|
|
results.push(this.lines.run(user, target, { damage: this.damage })) |
|
|
|
results.push(this.lines.run(user, target, { damage: damage })) |
|
|
|
results.push(new LogLine(' ')) |
|
|
|
results.push(target.takeDamage(this.damage)) |
|
|
|
results.push(target.takeDamage(damage)) |
|
|
|
|
|
|
|
if (target.vigors.Health <= 0) { |
|
|
|
if (this.killAction.allowed(user, target)) { |
|
|
|
@@ -86,7 +87,7 @@ class ChewAction extends GroupAction { |
|
|
|
return new LogLine('Do the crunch') |
|
|
|
} |
|
|
|
|
|
|
|
constructor (private damage: Damage, container: Container, private killAction: Action) { |
|
|
|
constructor (private damage: DamageFormula, container: Container, private killAction: Action) { |
|
|
|
super('Chew', 'Give them the big chew', [ |
|
|
|
new ContainerCondition(container) |
|
|
|
]) |
|
|
|
@@ -206,9 +207,9 @@ export class Withers extends Creature { |
|
|
|
|
|
|
|
this.otherContainers.push(grapple) |
|
|
|
|
|
|
|
this.actions.push(new ChewAction(new Damage( |
|
|
|
this.actions.push(new ChewAction(new UniformRandomDamageFormula(new Damage( |
|
|
|
{ target: Vigor.Health, type: DamageType.Crush, amount: 10000 } |
|
|
|
), |
|
|
|
), 0.5), |
|
|
|
grapple, |
|
|
|
new TransferAction(grapple, stomach))) |
|
|
|
} |
|
|
|
|