|
|
@@ -8,17 +8,13 @@ import { Container } from '../vore' |
|
|
* Takes a function, and thus can do anything. |
|
|
* Takes a function, and thus can do anything. |
|
|
*/ |
|
|
*/ |
|
|
export class ArbitraryConsequence extends Consequence { |
|
|
export class ArbitraryConsequence extends Consequence { |
|
|
constructor (public apply: (user: Creature, target: Creature) => LogEntry, conditions: Condition[] = []) { |
|
|
|
|
|
|
|
|
constructor ( |
|
|
|
|
|
public apply: (user: Creature, target: Creature) => LogEntry, |
|
|
|
|
|
public describe: (user: Creature, target: Creature) => LogEntry, |
|
|
|
|
|
conditions: Condition[] = [] |
|
|
|
|
|
) { |
|
|
super(conditions) |
|
|
super(conditions) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
describeSolo (user: Creature): LogEntry { |
|
|
|
|
|
return nilLog |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
describePair (user: Creature): LogEntry { |
|
|
|
|
|
return nilLog |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
@@ -33,6 +29,10 @@ export class LogConsequence extends Consequence { |
|
|
apply (user: Creature, target: Creature): LogEntry { |
|
|
apply (user: Creature, target: Creature): LogEntry { |
|
|
return this.line(user, target) |
|
|
return this.line(user, target) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
describe (user: Creature, target: Creature): LogEntry { |
|
|
|
|
|
return nilLog |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
@@ -51,7 +51,7 @@ export class DamageConsequence extends Consequence { |
|
|
) |
|
|
) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
describePair (user: Creature, target: Creature): LogEntry { |
|
|
|
|
|
|
|
|
describe (user: Creature, target: Creature): LogEntry { |
|
|
return new LogLine( |
|
|
return new LogLine( |
|
|
this.damageFormula.describe(user, target) |
|
|
this.damageFormula.describe(user, target) |
|
|
) |
|
|
) |
|
|
@@ -74,7 +74,7 @@ export class HealingConsequence extends Consequence { |
|
|
) |
|
|
) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
describePair (user: Creature, target: Creature): LogEntry { |
|
|
|
|
|
|
|
|
describe (user: Creature, target: Creature): LogEntry { |
|
|
return new LogLine( |
|
|
return new LogLine( |
|
|
`Heals for `, |
|
|
`Heals for `, |
|
|
this.damageFormula.describe(user, target) |
|
|
this.damageFormula.describe(user, target) |
|
|
@@ -94,7 +94,7 @@ export class StatusConsequence extends Consequence { |
|
|
return target.applyEffect(this.statusMaker(user, target)) |
|
|
return target.applyEffect(this.statusMaker(user, target)) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
describePair (user: Creature, target: Creature): LogEntry { |
|
|
|
|
|
|
|
|
describe (user: Creature, target: Creature): LogEntry { |
|
|
return new LogLine( |
|
|
return new LogLine( |
|
|
`Applies a ${this.statusMaker(user, target)} effect.` |
|
|
`Applies a ${this.statusMaker(user, target)} effect.` |
|
|
) |
|
|
) |
|
|
@@ -112,4 +112,10 @@ export class ConsumeConsequence extends Consequence { |
|
|
apply (user: Creature, target: Creature): LogEntry { |
|
|
apply (user: Creature, target: Creature): LogEntry { |
|
|
return this.container.consume(target) |
|
|
return this.container.consume(target) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
describe (user: Creature, target: Creature): LogEntry { |
|
|
|
|
|
return new LogLine( |
|
|
|
|
|
`Devours the target.` |
|
|
|
|
|
) |
|
|
|
|
|
} |
|
|
} |
|
|
} |