-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0
More file actions
15 lines (15 loc) · 3.81 KB
/
Copy path0
File metadata and controls
15 lines (15 loc) · 3.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
F:/Repos/Aralia/src/utils/combat/deathSaveUtils.ts:62:export function addUnconsciousCondition(character: CombatCharacter): CombatCharacter {
F:/Repos/Aralia/src/utils/combat/deathSaveUtils.ts:123:export function applyDamageAndCheckDowned(character: CombatCharacter, amount: number, isCritical: boolean = false): CombatCharacter {
F:/Repos/Aralia/src/utils/combat/deathSaveUtils.ts:125: const originalHP = updatedCharacter.currentHP;
F:/Repos/Aralia/src/utils/combat/deathSaveUtils.ts:140: updatedCharacter.currentHP = Math.max(0, updatedCharacter.currentHP - damageToApply);
F:/Repos/Aralia/src/utils/combat/deathSaveUtils.ts:144: if (updatedCharacter.currentHP === 0 && originalHP > 0) {
F:/Repos/Aralia/src/utils/combat/deathSaveUtils.ts:147: updatedCharacter.deathSaves = {
F:/Repos/Aralia/src/utils/combat/deathSaveUtils.ts:152: updatedCharacter = addUnconsciousCondition(updatedCharacter);
F:/Repos/Aralia/src/utils/combat/deathSaveUtils.ts:154: } else if (updatedCharacter.currentHP === 0 && originalHP === 0 && updatedCharacter.team === 'player' && amount > 0) {
F:/Repos/Aralia/src/utils/combat/deathSaveUtils.ts:158: const currentFailures = updatedCharacter.deathSaves?.failures || 0;
F:/Repos/Aralia/src/utils/combat/deathSaveUtils.ts:161: updatedCharacter.deathSaves = {
F:/Repos/Aralia/src/utils/combat/deathSaveUtils.ts:162: successes: updatedCharacter.deathSaves?.successes || 0,
F:/Repos/Aralia/src/utils/combat/deathSaveUtils.ts:181: const originalHP = updatedCharacter.currentHP;
F:/Repos/Aralia/src/utils/combat/deathSaveUtils.ts:184: updatedCharacter.currentHP = Math.min(updatedCharacter.maxHP, updatedCharacter.currentHP + amount);
F:/Repos/Aralia/src/utils/combat/deathSaveUtils.ts:187: if (originalHP === 0 && updatedCharacter.currentHP > 0 && updatedCharacter.team === 'player') {
F:/Repos/Aralia/src/utils/combat/deathSaveUtils.ts:188: updatedCharacter.deathSaves = undefined;