feat(combat): model monster intent and potion count in combat state types
This commit is contained in:
@@ -3,10 +3,21 @@ import { CombatAction } from './combat-action.enum';
|
|||||||
import { CombatEventType } from './combat-event-type.enum';
|
import { CombatEventType } from './combat-event-type.enum';
|
||||||
import { CombatStatus } from './combat-status.enum';
|
import { CombatStatus } from './combat-status.enum';
|
||||||
|
|
||||||
|
// Only HEAVY_ATTACK needs telegraphing today; NORMAL_ATTACK resolves
|
||||||
|
// immediately and is never held as a pending intent (Playable Slice 0.6
|
||||||
|
// spec §5). Add members here as future slices add more prepared actions.
|
||||||
|
export type CombatIntent = 'HEAVY_ATTACK';
|
||||||
|
|
||||||
export interface CombatEngineCombatantStats {
|
export interface CombatEngineCombatantStats {
|
||||||
attack: number;
|
attack: number;
|
||||||
weaponDamage?: number;
|
weaponDamage?: number;
|
||||||
armor: number;
|
armor: number;
|
||||||
|
// Player-only: seeded at combat start, decremented by POTION. Optional
|
||||||
|
// because the monster's stats never carry it.
|
||||||
|
potionsRemaining?: number;
|
||||||
|
// Monster-only: set when it telegraphs, cleared when the action resolves
|
||||||
|
// or is interrupted. Optional because the player's stats never carry it.
|
||||||
|
pendingAction?: CombatIntent;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CombatEngineCombatant {
|
export interface CombatEngineCombatant {
|
||||||
|
|||||||
@@ -11,15 +11,18 @@ import {
|
|||||||
import { Character } from '../../characters/entities/character.entity';
|
import { Character } from '../../characters/entities/character.entity';
|
||||||
import { HuntEncounter } from '../../hunting/entities/hunt-encounter.entity';
|
import { HuntEncounter } from '../../hunting/entities/hunt-encounter.entity';
|
||||||
import { MonsterDefinition } from '../../monsters/entities/monster-definition.entity';
|
import { MonsterDefinition } from '../../monsters/entities/monster-definition.entity';
|
||||||
|
import { CombatIntent } from '../combat-engine.types';
|
||||||
import { CombatStatus } from '../combat-status.enum';
|
import { CombatStatus } from '../combat-status.enum';
|
||||||
|
|
||||||
export interface CombatCombatantState {
|
export interface CombatCombatantState {
|
||||||
attack: number;
|
attack: number;
|
||||||
armor: number;
|
armor: number;
|
||||||
|
pendingAction?: CombatIntent;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CombatPlayerState extends CombatCombatantState {
|
export interface CombatPlayerState extends CombatCombatantState {
|
||||||
weaponDamage: number;
|
weaponDamage: number;
|
||||||
|
potionsRemaining: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Entity({ name: 'combats' })
|
@Entity({ name: 'combats' })
|
||||||
|
|||||||
Reference in New Issue
Block a user