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 208 209 210 211 212 213 214 215 216 217 218 219 | 59x 1x 59x 59x 2x 30x 2x 57x 3x 24x 24x 24x 8x 8x 8x 8x 528x 120x 408x 8x 2x 6x 9x 461x 16x 2x 1x 1x 1x 10x 30x | import { PlayerArchetype } from "../../types";
import { TrigramStance } from "../../types/common";
import { PlayerState } from "../player";
import { PLAYER_ARCHETYPES_DATA } from "../types";
import { KoreanTechnique } from "../vitalpoint";
import {
DARK_OPS_ARCHETYPE_BONUSES,
DARK_OPS_TECHNIQUES,
TRIGRAM_TECHNIQUES,
} from "./techniques";
/**
* Korean martial arts techniques system
*/
export class KoreanTechniquesSystem {
/**
* Get available techniques for a trigram stance
*/
static getAvailableTechniques(
stance: TrigramStance
): readonly KoreanTechnique[] {
return (TRIGRAM_TECHNIQUES[stance] as readonly KoreanTechnique[]) || [];
}
/**
* Get Dark Ops techniques (암흑작전부대 기술)
* Specialized techniques for 암살자 (Amsalja) archetype
*/
static getDarkOpsTechniques(): readonly KoreanTechnique[] {
return DARK_OPS_TECHNIQUES;
}
/**
* Get all available techniques including Dark Ops
*/
static getAllAvailableTechniques(
stance: TrigramStance,
archetype?: PlayerArchetype
): readonly KoreanTechnique[] {
const stanceTechniques = this.getAvailableTechniques(stance);
// Add Dark Ops techniques for 암살자 (Amsalja) archetype
if (archetype === PlayerArchetype.AMSALJA) {
const darkOpsTechniques = DARK_OPS_TECHNIQUES.filter(
(tech) => tech.stance === stance
);
return [...stanceTechniques, ...darkOpsTechniques];
}
return stanceTechniques;
}
/**
* Get primary technique for stance
*/
static getPrimaryTechnique(stance: TrigramStance): KoreanTechnique | null {
const techniques = this.getAvailableTechniques(stance);
return techniques[0] ?? null;
}
/**
* Check if player can execute technique
*/
static canExecuteTechnique(
player: PlayerState,
technique: KoreanTechnique
): boolean {
return (
player.ki >= technique.kiCost &&
player.stamina >= technique.staminaCost &&
player.currentStance === technique.stance
);
}
/**
* Get technique effectiveness against target stance
*/
static getTechniqueEffectiveness(
attackerStance: TrigramStance,
defenderStance: TrigramStance
): number {
return (
TECHNIQUE_EFFECTIVENESS_MATRIX[attackerStance]?.[defenderStance] ?? 1.0
);
}
/**
* Get all techniques
*/
static getAllTechniques(): KoreanTechnique[] {
// Fix: Convert readonly array to mutable array using spread operator
const stanceTechniques = Object.values(TRIGRAM_TECHNIQUES).flat();
const darkOpsTechniques = [...DARK_OPS_TECHNIQUES];
return [...stanceTechniques, ...darkOpsTechniques] as KoreanTechnique[];
}
static getTechniquesByArchetype(
archetype: PlayerArchetype
): readonly KoreanTechnique[] {
const allTechniques = this.getAllTechniques();
// Filter techniques based on archetype preferences
const archetypeData = PLAYER_ARCHETYPES_DATA[archetype]; // Fix: Now properly imported
const favoredStances = archetypeData.favoredStances || [];
// Filter by favored stances (excludes Dark Ops techniques initially)
const filteredTechniques = allTechniques.filter((technique) => {
// Exclude Dark Ops from initial filtering
if (technique.id.startsWith("darkops_")) {
return false;
}
return favoredStances.includes(technique.stance);
});
// Add Dark Ops techniques for 암살자 (Amsalja) only
if (archetype === PlayerArchetype.AMSALJA) {
return [...filteredTechniques, ...DARK_OPS_TECHNIQUES];
}
return filteredTechniques;
}
static getTechniqueById(id: string): KoreanTechnique | undefined {
const allTechniques = this.getAllTechniques();
return allTechniques.find((technique) => technique.id === id);
}
/**
* Check if technique is a Dark Ops technique
*/
static isDarkOpsTechnique(techniqueId: string): boolean {
return DARK_OPS_TECHNIQUES.some((tech) => tech.id === techniqueId);
}
/**
* Get Dark Ops archetype effectiveness multiplier
* Uses DARK_OPS_ARCHETYPE_BONUSES from techniques.ts
*/
static getDarkOpsArchetypeBonus(archetype: PlayerArchetype): number {
return DARK_OPS_ARCHETYPE_BONUSES[archetype] || 1.0;
}
/**
* Get night operations bonus (simulated)
* In a full game, this would use actual game time
*/
static getNightOperationsBonus(): number {
// Simulate night time for now (in real game, use game clock)
// Night: 00:00-06:00, 18:00-23:59 = 1.25x
// Day: 06:00-18:00 = 1.0x
const hour = new Date().getHours();
Iif (hour >= 0 && hour < 6) return 1.25; // Night
Eif (hour >= 18 && hour < 24) return 1.25; // Night
if (hour >= 5 && hour < 7) return 1.15; // Twilight
if (hour >= 17 && hour < 19) return 1.15; // Twilight
return 1.0; // Day
}
}
// Export functions for backwards compatibility
export function getTechniquesByStance(
stance: TrigramStance
): KoreanTechnique[] {
// Fix: Convert readonly array to mutable array
return [
...((TRIGRAM_TECHNIQUES[stance] as unknown as KoreanTechnique[]) || []),
];
}
// Export TRIGRAM_TECHNIQUES for tests
export { DARK_OPS_TECHNIQUES, TRIGRAM_TECHNIQUES } from "./techniques";
// Export Dark Ops constants
export {
DARK_OPS_ARCHETYPE_BONUSES,
DARK_OPS_NIGHT_BONUS,
DARK_OPS_SPECIAL_EFFECTS,
DARK_OPS_UNITS,
} from "./techniques";
// Export technique effectiveness matrix
export const TECHNIQUE_EFFECTIVENESS_MATRIX: Record<
TrigramStance,
Partial<Record<TrigramStance, number>>
> = {
[TrigramStance.GEON]: {
[TrigramStance.GON]: 1.2,
[TrigramStance.SON]: 0.8,
},
[TrigramStance.TAE]: {
[TrigramStance.JIN]: 1.2,
[TrigramStance.GAN]: 0.8,
},
[TrigramStance.LI]: {
[TrigramStance.GAM]: 1.2,
[TrigramStance.TAE]: 0.8,
},
[TrigramStance.JIN]: {
[TrigramStance.SON]: 1.2,
[TrigramStance.GEON]: 0.8,
},
[TrigramStance.SON]: {
[TrigramStance.GON]: 1.2,
[TrigramStance.LI]: 0.8,
},
[TrigramStance.GAM]: {
[TrigramStance.LI]: 1.2,
[TrigramStance.JIN]: 0.8,
},
[TrigramStance.GAN]: {
[TrigramStance.TAE]: 1.2,
[TrigramStance.GAM]: 0.8,
},
[TrigramStance.GON]: {
[TrigramStance.GEON]: 1.2,
[TrigramStance.SON]: 0.8,
},
};
|