feat: weapon wound kinds as vault slashing/piercing/blunt list
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -180,7 +180,7 @@ export async function resolveLifeSteal(actor: CastableActor, hpActuallyLost: num
|
||||
|
||||
/**
|
||||
* Złożenie w Ofierze: 1 Zapał, free Akcja Natychmiastowa, once per round. Triggers when your attack
|
||||
* kills a target with a cutting / piercing wound within 1 m. `successes` are the Sukcesy of the
|
||||
* kills a target with a slashing / piercing wound within 1 m. `successes` are the Sukcesy of the
|
||||
* killing attack's Test: heal Sukcesy + Magia, gain Krew = Sukcesy.
|
||||
*/
|
||||
export async function sacrifice(actor: CastableActor, successes: number): Promise<BloodActionResult> {
|
||||
@@ -256,7 +256,7 @@ export async function absorbBlood(
|
||||
|
||||
/**
|
||||
* Passive Krew (talents): 1 per 4 HP lost (Szacunek do Życia) / 1 per 2 HP (Krwisty Pojedynkowicz),
|
||||
* by either side, only from cutting or piercing weapons. Call for the victim and the attacker.
|
||||
* by either side, only from slashing or piercing weapons. Call for the victim and the attacker.
|
||||
*/
|
||||
export async function gainKrewFromWeaponDamage(actor: CastableActor, hpLost: number): Promise<number> {
|
||||
const blood = (actor.system.attributes as any)?.blood;
|
||||
|
||||
+4
-3
@@ -35,7 +35,8 @@ export interface ApplyDamageOptions {
|
||||
/** Rozerwanie Run: permanently destroys N Runiczny Pancerz points (lowers its maximum). */
|
||||
destroyRunicPoints?: number;
|
||||
/** Wound kind of a weapon hit (gear data has none yet – callers pass it); drives passive Krew. */
|
||||
woundKind?: 'cutting' | 'piercing' | 'blunt';
|
||||
/** Wound kinds of the attacking weapon; only slashing / piercing give passive Krew. */
|
||||
woundKinds?: ('slashing' | 'piercing' | 'blunt')[];
|
||||
/** Attacker, for passive Krew gain (Szacunek do Życia / Krwisty Pojedynkowicz). */
|
||||
sourceActor?: any;
|
||||
postChat?: boolean;
|
||||
@@ -161,8 +162,8 @@ export async function applyDamage(actor: ActorLike, opts: ApplyDamageOptions): P
|
||||
|
||||
if (Object.keys(updates).length > 0) await actor.update(updates);
|
||||
|
||||
// Passive Krew from cutting / piercing weapons (talents): victim and attacker side.
|
||||
if (report.hpDamage > 0 && (opts.woundKind === 'cutting' || opts.woundKind === 'piercing')) {
|
||||
// Passive Krew from slashing / piercing weapons (talents): victim and attacker side.
|
||||
if (report.hpDamage > 0 && (opts.woundKinds ?? []).some((k) => k === 'slashing' || k === 'piercing')) {
|
||||
report.krewGained = {
|
||||
victim: await gainKrewFromWeaponDamage(actor as any, report.hpDamage),
|
||||
source: opts.sourceActor ? await gainKrewFromWeaponDamage(opts.sourceActor, report.hpDamage) : 0,
|
||||
|
||||
+1
-1
@@ -196,7 +196,7 @@ export function greatSacrificeResult(successes: number, highestAttribute: number
|
||||
if (successes > highestAttribute) return { kills: true, heal: 0, krew: Math.max(0, targetHealth) };
|
||||
return { kills: false, heal: Math.max(0, successes), krew: 0 };
|
||||
}
|
||||
/** Passive Krew: Szacunek do Życia 1 per 4 HP, Krwisty Pojedynkowicz 1 per 2 HP (cutting/piercing only). */
|
||||
/** Passive Krew: Szacunek do Życia 1 per 4 HP, Krwisty Pojedynkowicz 1 per 2 HP (slashing/piercing only). */
|
||||
export function krewFromWeaponHpLoss(hpLost: number, talent: KrewTalent | null): number {
|
||||
if (talent === 'respect-for-life') return Math.floor(Math.max(0, hpLost) / 4);
|
||||
if (talent === 'krwisty-pojedynkowicz') return Math.floor(Math.max(0, hpLost) / 2);
|
||||
|
||||
Reference in New Issue
Block a user