Skip to content

Commit b379c43

Browse files
committed
feat: show exp learning rate
1 parent dc4b3ac commit b379c43

File tree

2 files changed

+57
-4
lines changed

2 files changed

+57
-4
lines changed

electron/common/game/game.types.ts

+42
Original file line numberDiff line numberDiff line change
@@ -295,3 +295,45 @@ export enum IndicatorType {
295295
HIDDEN = 'HIDDEN', // character is hidden
296296
INVISIBLE = 'INVISIBLE', // character is invisible
297297
}
298+
299+
/**
300+
* Map of mind states to their learning rate (0-34).
301+
* https://elanthipedia.play.net/Experience#Mindstates
302+
*/
303+
export const ExperienceMindStateMap: Record<string, number> = {
304+
clear: 0,
305+
dabbling: 1,
306+
perusing: 2,
307+
learning: 3,
308+
thoughtful: 4,
309+
thinking: 5,
310+
considering: 6,
311+
pondering: 7,
312+
ruminating: 8,
313+
concentrating: 9,
314+
attentive: 10,
315+
deliberative: 11,
316+
interested: 12,
317+
examining: 13,
318+
understanding: 14,
319+
absorbing: 15,
320+
intrigued: 16,
321+
scrutinizing: 17,
322+
analyzing: 18,
323+
studious: 19,
324+
focused: 20,
325+
'very focused': 21,
326+
engaged: 22,
327+
'very engaged': 23,
328+
cogitating: 24,
329+
fascinated: 25,
330+
captivated: 26,
331+
engrossed: 27,
332+
riveted: 28,
333+
'very riveted': 29,
334+
rapt: 30,
335+
'very rapt': 31,
336+
enthralled: 32,
337+
'nearly locked': 33,
338+
'mind lock': 34,
339+
};

electron/renderer/pages/grid.tsx

+15-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type { ReactNode } from 'react';
77
import { useCallback, useEffect, useState } from 'react';
88
import * as rxjs from 'rxjs';
99
import { v4 as uuid } from 'uuid';
10-
import { GameEventType } from '../../common/game';
10+
import { ExperienceMindStateMap, GameEventType } from '../../common/game';
1111
import type {
1212
ExperienceGameEvent,
1313
GameEvent,
@@ -52,12 +52,23 @@ const GridPage: React.FC = (): ReactNode => {
5252
const formatExperienceText = useCallback(
5353
(gameEvent: ExperienceGameEvent): string => {
5454
const { skill, rank, percent, mindState } = gameEvent;
55+
const mindStateRate = ExperienceMindStateMap[mindState];
56+
5557
const txtSkill = skill.padStart(15);
5658
const txtRank = String(rank).padStart(3);
5759
const txtPercent = String(percent).padStart(2) + '%';
58-
const txtMindState = mindState.padEnd(15);
59-
// TODO add option to show mind state as the numbers (x/34)
60-
return `${txtSkill} ${txtRank} ${txtPercent} ${txtMindState}`;
60+
61+
// TODO add user pref to toggle between mind state rate and mind state
62+
const txtMindStateRate = `(${mindStateRate}/34)`.padStart(7);
63+
// const txtMindState = mindState.padEnd(15);
64+
65+
return [
66+
txtSkill,
67+
txtRank,
68+
txtPercent,
69+
txtMindStateRate,
70+
// txtMindState,
71+
].join(' ');
6172
},
6273
[]
6374
);

0 commit comments

Comments
 (0)