This repository was archived by the owner on Oct 11, 2023. It is now read-only.
added character map util function for default character emojis#214
Merged
JustinPinero merged 2 commits intopre-alpha-fixes3from May 4, 2021
Merged
added character map util function for default character emojis#214JustinPinero merged 2 commits intopre-alpha-fixes3from
JustinPinero merged 2 commits intopre-alpha-fixes3from
Conversation
JackUrb
approved these changes
May 4, 2021
Contributor
JackUrb
left a comment
There was a problem hiding this comment.
Great choices! Just making sure we don't lose the autopicking code for future releases when we may have more characters than these.
| town_doctor: "syringe", | ||
| }; | ||
|
|
||
| return EmojiMap[characterName]; |
Contributor
There was a problem hiding this comment.
In the case where characterName is not in the map, we should default to the old autopicking code:
const skipWords = ["a", "the", "an", "of", "with", "holding"];
const tryPickEmojis = !persona
? []
: persona.name
.split(" ")
.filter((token) => !!token)
.map((token) => token.replace(/\.$/, ""))
.filter((word) => skipWords.indexOf(word.toLowerCase()) === -1)
.flatMap((term) =>
emojiIndex.search(term).map((o) => {
return o.native;
})
);
const autopickedEmoji =
tryPickEmojis.length > 0 ? tryPickEmojis[0] : defaultEmoji;
return autopickedEmoji;
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added util function that assigns a default emoji based on the name of the current persona. Current map and emoji pairings are:
assassin: "dagger_knife" 🗡️
assistant_chef: "hocho" 🔪
bandit: "crossed_swords" ⚔️
battle_master: "trident" 🔱
big_sheep_like_brown_dog: "dog2" 🐕
bighorn_sheep: "ram" 🐏
butler: "bellhop_bell" 🛎️
drunk_reeling_out_of_the_saloon: "beer" 🍺
fox: "fox_face" 🦊
goblin: "smiling_imp" 😈
graveyard_keeper: "coffin" ⚰️
groundskeeper: "seedling" 🌱
half_wild_cat: "tiger" 🐯
jailer: "old_key" 🗝️
lady_of_the_house: "princess" 👸
lord: "crown" 👑
master_at_arms: "shield" 🛡️
milk_man: "glass_of_milk" 🥛
monkey_friend: "monkey" 🐒
pig: "pig" 🐷
priest: "church" ⛪
rat: "rat" 🐀
serving_boy: "boy" 👦
skeleton_assistant: "skull" 💀
small_aggressive_looking_dog: "dog" 🐶
smith: "hammer" 🔨
town_doctor: "syringe" 💉
These can be changed easily at anytime and are currently located in the DefaultEmojiMapper function in the utils file in the Light GameApp. Every persona emoji pairing has been tested in game and works properly.