phreddrickk
Member
For monsters with certain articles, lastEncounter strips the article out of the monster name:
It looks like there are exactly 69 monsters right now that don't fit this set of articles:
I can throw in a PR for this, but I'm not sure the ideal solution. Should CombatActionManager also reference MonsterDatabase.findMonster? Should I just add those additional 6 articles to the chain of else ifs in CombatActionManger.encounterKey? Is there a third, even better solution?
But for other articles, it fails to do so:[36769] A Recent Fight
Preference lastEncounter changed from Travel to a Recent Fight to pumpkin spice wraith
Encounter: pumpkin spice wraith
It looks like the articles it searches for are basically hardcoded in CombatActionManager.encounterKey:[38066] A Recent Fight
Preference lastEncounter changed from Travel to a Recent Fight to The Yuleviathan
Encounter: The Yuleviathan
Code:
if (key.startsWith("a ")) {
key = key.substring(2);
line = line.substring(2);
} else if (key.startsWith("an ")) {
key = key.substring(3);
line = line.substring(3);
} else if (key.startsWith("the ")) {
// It really is "The Man" or "The Big Wisniewski"
} else if (key.startsWith("some ")) {
key = key.substring(5);
line = line.substring(5);
}
It looks like there are exactly 69 monsters right now that don't fit this set of articles:
And there are exactly 6 articles right now that aren't included in this conga line:> js Monster.all().filter(({ article }) => !["a", "an", "the", "some", ""].includes(article))
Returned: aggregate monster [69]
The CrystalBallManager handles a similar problem by referencing MonsterDatabase.findMonster, which seems to properly check all possible monster articles.> js Array.from(new Set(Monster.all().map(({ article }) => article).filter((article) => !["a", "an", "the", "some", ""].includes(article))))
Returned: aggregate string [6]
0 => The
1 => Some
2 => A
3 => La
4 => El
5 => An
I can throw in a PR for this, but I'm not sure the ideal solution. Should CombatActionManager also reference MonsterDatabase.findMonster? Should I just add those additional 6 articles to the chain of else ifs in CombatActionManger.encounterKey? Is there a third, even better solution?