Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | // filepath: /workspaces/blacktrigram/src/systems/combat/types.ts /** * Type definitions for combat types * Auto-generated by type migration script */ // Combat-specific imports from shared types import { GameMode, GamePhase, Position, TrigramStance } from "@/types"; import { PlayerMatchStats, PlayerState } from "../player"; import { StatusEffect } from "../types"; import { KoreanTechnique, VitalPointHitResult } from "../vitalpoint/types"; export interface CombatResult { readonly success: boolean; readonly damage: number; readonly isCritical: boolean; readonly hit: boolean; readonly isBlocked: boolean; readonly vitalPointHit: boolean; readonly effects: readonly any[]; readonly attacker?: any; readonly defender?: any; readonly technique?: KoreanTechnique; readonly criticalHit: boolean; readonly timestamp: number; } // Round result information export interface RoundResult { readonly roundNumber: number; readonly winner: PlayerState | null; readonly method: "knockout" | "time" | "forfeit" | "draw"; readonly duration: number; readonly finalHealth: readonly [number, number]; readonly damageDealt: readonly [number, number]; readonly combatEvents: readonly CombatResult[]; } // Match statistics - Fix: Remove duplicate and use single definition export interface MatchStatistics { // Top-level match statistics readonly totalDamageDealt: number; readonly totalDamageTaken: number; readonly criticalHits: number; readonly vitalPointHits: number; readonly techniquesUsed: number; readonly perfectStrikes: number; readonly consecutiveWins: number; readonly matchDuration: number; readonly totalMatches: number; readonly maxRounds: number; readonly winner: number; readonly totalRounds: number; readonly currentRound: number; readonly timeRemaining: number; readonly combatEvents: readonly CombatEventData[]; readonly finalScore: { player1: number; player2: number }; readonly roundsWon: { player1: number; player2: number }; // Individual player statistics readonly player1: PlayerMatchStats; readonly player2: PlayerMatchStats; } // Main game state interface export interface GameState { readonly mode: GameMode; readonly phase: GamePhase; readonly players: readonly [PlayerState, PlayerState]; readonly currentRound: number; readonly maxRounds: number; readonly timeRemaining: number; readonly isPaused: boolean; readonly matchStatistics: MatchStatistics; readonly winner?: PlayerState | null; } export interface TrainingCombatResult extends CombatResult { readonly accuracyScore: number; readonly techniqueScore: number; readonly formScore: number; readonly improvementAreas: readonly string[]; readonly nextTrainingGoals: readonly string[]; } export interface CombatEventData { readonly id: string; readonly timestamp: number; readonly type: | "attack" | "block" | "critical" | "vital_point" | "stance_change"; readonly attacker: number; readonly defender: number; readonly damage: number; readonly technique?: string; readonly result: "hit" | "miss" | "blocked" | "critical"; readonly effects?: readonly string[]; } export interface CombatStats { readonly totalDamage: number; readonly criticalHits: number; readonly vitalPointHits: number; readonly techniquesUsed: number; readonly stamina: number; readonly ki: number; } export interface CombatSystemInterface { calculateDamage: ( technique: KoreanTechnique, attacker: PlayerState, defender: PlayerState, hitResult: VitalPointHitResult ) => { baseDamage: number; modifierDamage: number; totalDamage: number; effectsApplied: readonly StatusEffect[]; finalDefenderState?: Partial<PlayerState>; }; resolveAttack: ( attacker: PlayerState, defender: PlayerState, technique: KoreanTechnique, targetedVitalPointId?: string ) => CombatResult; applyCombatResult: ( result: CombatResult, attacker: PlayerState, defender: PlayerState ) => { updatedAttacker: PlayerState; updatedDefender: PlayerState }; getAvailableTechniques: (player: PlayerState) => readonly KoreanTechnique[]; } export interface CombatSystem { readonly update: ( players: readonly [PlayerState, PlayerState], deltaTime: number ) => any; readonly processTechnique: ( technique: KoreanTechnique, attacker: PlayerState, defender: PlayerState ) => any; readonly calculateDamage: ( technique: KoreanTechnique, attacker: PlayerState, defender: PlayerState ) => number; } export interface TrainingResult { readonly accuracyScore: number; readonly techniqueScore: number; readonly formScore: number; readonly improvementAreas: readonly string[]; readonly nextTrainingGoals: readonly string[]; readonly hit: boolean; readonly damage: number; readonly timestamp: number; } export interface TrainingSession { readonly id: string; readonly startTime: number; readonly endTime?: number; readonly mode: TrainingMode; readonly difficulty: TrainingDifficulty; readonly player: PlayerState; readonly results: readonly TrainingResult[]; readonly overallScore: number; readonly improvements: readonly string[]; } export type TrainingMode = | "basics" | "techniques" | "sparring" | "philosophy" | "meditation"; export type TrainingDifficulty = | "beginner" | "intermediate" | "advanced" | "master"; export interface TrainingTarget { readonly id: string; readonly position: Position; readonly size: number; readonly type: "vital_point" | "technique_zone" | "balance_point"; readonly difficulty: number; readonly active: boolean; } export interface TrainingProgression { readonly currentLevel: number; readonly experience: number; readonly masteredTechniques: readonly string[]; readonly availableStances: readonly TrigramStance[]; readonly achievements: readonly string[]; } |