Skip to content

Commit 087f8ce

Browse files
committed
feat: parse hand and spell
1 parent 0c77142 commit 087f8ce

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

electron/main/game/game.parser.ts

+18
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,24 @@ export class GameParserImpl implements GameParser {
477477
this.emitCompassGameEvent(this.compassDirections);
478478
this.compassDirections = [];
479479
break;
480+
case 'spell':
481+
// Emit the spell because we are at the end of the tag.
482+
// Example: `<spell>Fire Shards</spell>`
483+
this.emitSpellGameEvent(this.gameText);
484+
this.gameText = '';
485+
break;
486+
case 'left':
487+
// Emit the left hand item because we are at the end of the tag.
488+
// Example: `<left>red backpack</left>`
489+
this.emitLeftHandGameEvent(this.gameText);
490+
this.gameText = '';
491+
break;
492+
case 'right':
493+
// Emit the right hand item because we are at the end of the tag.
494+
// Example: `<right>Empty</right>`
495+
this.emitRightHandGameEvent(this.gameText);
496+
this.gameText = '';
497+
break;
480498
}
481499

482500
if (this.activeTags.length > 0) {

electron/main/game/game.types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export interface IndicatorGameEvent {
7272
}
7373

7474
/**
75-
* <spell>Fire Ball</spell>
75+
* <spell>Fire Shards</spell>
7676
*/
7777
export interface SpellGameEvent {
7878
type: GameEventType.SPELL;

0 commit comments

Comments
 (0)