|
|
|
@@ -4,11 +4,55 @@ import { ImproperNoun, POVPair, ProperNoun, FemalePronouns, RandomWord, Adjectiv |
|
|
|
import { LogLine, LogLines, LogEntry, Newline } from '../interface' |
|
|
|
import { VoreType, Stomach, VoreContainer, Vore, NormalContainer, Container } from '../vore' |
|
|
|
import { AttackAction, FeedAction, TransferAction, EatenAction } from '../combat/actions' |
|
|
|
import { TogetherCondition, ContainerCondition, EnemyCondition, AllyCondition, PairCondition, CapableCondition } from '../combat/conditions' |
|
|
|
import { TogetherCondition, ContainsCondition, EnemyCondition, AllyCondition, PairCondition, CapableCondition } from '../combat/conditions' |
|
|
|
import { InstantKill } from '../combat/effects' |
|
|
|
import * as Words from '../words' |
|
|
|
import { StatVigorTest } from '../combat/tests' |
|
|
|
|
|
|
|
class LevelDrain extends Action { |
|
|
|
lines = new POVPairArgs<Creature, Creature, { damage: Damage; container: Container }>([ |
|
|
|
[[POV.First, POV.Third], (user, target, args) => new LogLine(`Your ${args.container.name} drains power from ${target.name}, siphoning `, args.damage.renderShort(), ` from ${target.pronouns.possessive} body!`)], |
|
|
|
[[POV.Third, POV.First], (user, target, args) => new LogLine(`${user.name.capital}'s ${args.container.name} drains power from you, siphoning `, args.damage.renderShort(), ` from your body!`)], |
|
|
|
[[POV.Third, POV.Third], (user, target, args) => new LogLine(`${user.name.capital}'s ${args.container.name} drains power from ${target.name}, siphoning `, args.damage.renderShort(), ` from ${target.pronouns.possessive} body!`)] |
|
|
|
]) |
|
|
|
|
|
|
|
execute (user: Creature, target: Creature): LogEntry { |
|
|
|
const damage: Damage = new Damage(...Object.keys(Stat).map(stat => { |
|
|
|
return { |
|
|
|
type: DamageType.Acid, |
|
|
|
target: stat as Stat, |
|
|
|
amount: target.baseStats[stat as Stat] / 5 |
|
|
|
} |
|
|
|
})) |
|
|
|
const heal: Damage = new Damage(...Object.keys(Stat).map(stat => { |
|
|
|
return { |
|
|
|
type: DamageType.Heal, |
|
|
|
target: stat as Stat, |
|
|
|
amount: target.baseStats[stat as Stat] / 5 |
|
|
|
} |
|
|
|
})) |
|
|
|
|
|
|
|
user.takeDamage(heal) |
|
|
|
const targetResult = target.takeDamage(damage) |
|
|
|
|
|
|
|
return new LogLines(this.lines.run(user, target, { damage: damage, container: this.container }), targetResult) |
|
|
|
} |
|
|
|
|
|
|
|
describe (user: Creature, target: Creature): LogEntry { |
|
|
|
return new LogLine(`Drain energy from ${target.name}`) |
|
|
|
} |
|
|
|
|
|
|
|
constructor (private container: Container) { |
|
|
|
super( |
|
|
|
'Level Drain', |
|
|
|
'Drain energy from your prey', |
|
|
|
[ |
|
|
|
new ContainsCondition(container), |
|
|
|
new CapableCondition() |
|
|
|
] |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
class HypnotizeAction extends Action { |
|
|
|
lines = new POVPair<Creature, Creature>([ |
|
|
|
[[POV.First, POV.Third], (user, target) => new LogLine(`Your hypnotic gaze enthralls ${target.name}, putting ${target.pronouns.objective} under your control!`)], |
|
|
|
@@ -89,7 +133,7 @@ class FlexToesAction extends GroupAction { |
|
|
|
|
|
|
|
constructor (private damage: DamageFormula, container: Container) { |
|
|
|
super('Flex Toes', 'Flex your toes!', [ |
|
|
|
new ContainerCondition(container), |
|
|
|
new ContainsCondition(container), |
|
|
|
new PairCondition() |
|
|
|
]) |
|
|
|
} |
|
|
|
@@ -189,7 +233,7 @@ class ChewAction extends GroupAction { |
|
|
|
|
|
|
|
constructor (private damage: DamageFormula, container: Container, private killAction: Action) { |
|
|
|
super('Chew', 'Give them the big chew', [ |
|
|
|
new ContainerCondition(container) |
|
|
|
new ContainsCondition(container) |
|
|
|
]) |
|
|
|
} |
|
|
|
} |
|
|
|
@@ -378,5 +422,6 @@ export class Withers extends Creature { |
|
|
|
) |
|
|
|
|
|
|
|
this.actions.push(new HypnotizeAction()) |
|
|
|
this.actions.push(new LevelDrain(stomach)) |
|
|
|
} |
|
|
|
} |