better exec
Browse files
src/lib/components/Pages/Battle.svelte
CHANGED
@@ -108,10 +108,18 @@
|
|
108 |
moveIndex: enemyMoveIndex
|
109 |
};
|
110 |
|
|
|
|
|
|
|
111 |
// Execute the turn - battle engine handles priority automatically
|
112 |
-
|
113 |
battleState = battleEngine.getState();
|
114 |
|
|
|
|
|
|
|
|
|
|
|
115 |
// Show battle messages with timing
|
116 |
if (result.log && result.log.length > 0) {
|
117 |
let messageIndex = 0;
|
|
|
108 |
moveIndex: enemyMoveIndex
|
109 |
};
|
110 |
|
111 |
+
// Get log entries before action to track new messages
|
112 |
+
const logBefore = battleEngine.getLog();
|
113 |
+
|
114 |
// Execute the turn - battle engine handles priority automatically
|
115 |
+
battleEngine.executeActions(moveAction, enemyAction);
|
116 |
battleState = battleEngine.getState();
|
117 |
|
118 |
+
// Get only the new log entries from this turn
|
119 |
+
const logAfter = battleEngine.getLog();
|
120 |
+
const newLogEntries = logAfter.slice(logBefore.length);
|
121 |
+
const result = { log: newLogEntries };
|
122 |
+
|
123 |
// Show battle messages with timing
|
124 |
if (result.log && result.log.length > 0) {
|
125 |
let messageIndex = 0;
|