Files
core2026/app/game-api/src/battleSim/logFormatter.ts
T
Hide_D 56e662a7db feat(battle-sim): implement battle simulation logic and metrics tracking
- Added WarBattleMetrics interface to track attacker and defender skills during battles.
- Enhanced WarUnit class with method to log activated skills.
- Introduced environment setup for battle simulation, including unit set loading and configuration resolution.
- Developed in-memory and Redis transport layers for handling battle simulation requests and results.
- Created types and interfaces for battle simulation payloads and responses.
- Implemented battle simulation processing logic, including logging and skill tracking.
- Added tests for battle simulation processor to ensure functionality and correctness.
2025-12-30 11:17:28 +00:00

40 lines
1.7 KiB
TypeScript

export const convertLog = (value: string, type = 1): string => {
if (!value) {
return '';
}
let result = value;
if (type > 0) {
result = result.replaceAll('<1>', '<font size=1>');
result = result.replaceAll('<Y1>', '<font size=1 color=yellow>');
result = result.replaceAll('<R>', '<font color=red>');
result = result.replaceAll('<B>', '<font color=blue>');
result = result.replaceAll('<G>', '<font color=green>');
result = result.replaceAll('<M>', '<font color=magenta>');
result = result.replaceAll('<C>', '<font color=cyan>');
result = result.replaceAll('<L>', '<font color=limegreen>');
result = result.replaceAll('<S>', '<font color=skyblue>');
result = result.replaceAll('<O>', '<font color=orangered>');
result = result.replaceAll('<D>', '<font color=orangered>');
result = result.replaceAll('<Y>', '<font color=yellow>');
result = result.replaceAll('<W>', '<font color=white>');
result = result.replaceAll('</>', '</font>');
return result;
}
result = result.replaceAll('<1>', '');
result = result.replaceAll('<Y1>', '');
result = result.replaceAll('<R>', '');
result = result.replaceAll('<B>', '');
result = result.replaceAll('<G>', '');
result = result.replaceAll('<M>', '');
result = result.replaceAll('<C>', '');
result = result.replaceAll('<L>', '');
result = result.replaceAll('<S>', '');
result = result.replaceAll('<O>', '');
result = result.replaceAll('<D>', '');
result = result.replaceAll('<Y>', '');
result = result.replaceAll('<W>', '');
result = result.replaceAll('</>', '');
return result;
};