Commit 88a88168 by Jonathan Thomas

Improved character creation with more random classes, speaking styles, and alignments.

parent fa711c9b
Pipeline #12726 passed with stages
in 2 minutes 26 seconds
......@@ -13,6 +13,7 @@ All notable changes to **CreatureChat** are documented in this file. The format
- Automatically tame best friends (who are tameable) and un-tame worst enemies!
### Changed
- Improved character creation with more random classes, speaking styles, and alignments.
- Large refactor of how MobEntity avoids targeting players when friendship > 0
- Updated LookControls to support PhantomEntity and made it more generalized (look in any direction)
- Updated FLEE behavior Y movement speed
......
......@@ -264,20 +264,27 @@ public class ServerPackets {
// Grab random adjective
String randomAdjective = Randomizer.getRandomMessage(Randomizer.RandomType.ADJECTIVE);
String randomFrequency = Randomizer.getRandomMessage(Randomizer.RandomType.FREQUENCY);
String randomClass = Randomizer.getRandomMessage(Randomizer.RandomType.CLASS);
String randomAlignment = Randomizer.getRandomMessage(Randomizer.RandomType.ALIGNMENT);
String randomSpeakingStyle = Randomizer.getRandomMessage(Randomizer.RandomType.SPEAKING_STYLE);
// Generate random name parameters
String randomLetter = Randomizer.RandomLetter();
int randomSyllables = Randomizer.RandomNumber(5) + 1;
// Build the message
StringBuilder userMessageBuilder = new StringBuilder();
userMessageBuilder.append("Please generate a " + randomFrequency + " " + randomAdjective);
userMessageBuilder.append(" character ");
userMessageBuilder.append("Please generate a ").append(randomAdjective).append(" character. ");
userMessageBuilder.append("This character is a ").append(randomClass).append(" class, who is ").append(randomAlignment).append(". ");
if (entity.getCustomName() != null && !entity.getCustomName().getString().equals("N/A")) {
userMessageBuilder.append("named '").append(entity.getCustomName().getString()).append("' ");
userMessageBuilder.append("Their name is '").append(entity.getCustomName().getString()).append("'. ");
} else {
userMessageBuilder.append("whose name starts with the letter '").append(Randomizer.RandomLetter()).append("' ");
userMessageBuilder.append("and uses ").append(Randomizer.RandomNumber(4) + 1).append(" syllables ");
userMessageBuilder.append("Their name starts with the letter '").append(randomLetter)
.append("' and is ").append(randomSyllables).append(" syllables long. ");
}
userMessageBuilder.append("and speaks in '" + userLanguage + "'" );
LOGGER.info(userMessageBuilder.toString());
userMessageBuilder.append("They speak in '").append(userLanguage).append("' with a ").append(randomSpeakingStyle).append(" style.");
LOGGER.info(userMessageBuilder.toString());
chatData.generateMessage(userLanguage, player, "system-character", userMessageBuilder.toString(), false);
}
......
......@@ -9,7 +9,7 @@ import java.util.Random;
* and phrases used by this mod.
*/
public class Randomizer {
public enum RandomType { NO_RESPONSE, ERROR, ADJECTIVE, FREQUENCY }
public enum RandomType { NO_RESPONSE, ERROR, ADJECTIVE, SPEAKING_STYLE, CLASS, ALIGNMENT }
private static List<String> noResponseMessages = Arrays.asList(
"<no response>",
"<silence>",
......@@ -79,11 +79,35 @@ public class Randomizer {
"unpredictable", "wildcard", "stuttering", "hypochondriac", "hypocritical",
"optimistic", "overconfident", "jumpy", "brief", "flighty", "visionary", "adorable",
"sparkly", "bubbly", "unstable", "sad", "angry", "bossy", "altruistic", "quirky",
"nostalgic", "essentially", "emotional", "enthusiastic", "unusual", "conspirator"
"nostalgic", "emotional", "enthusiastic", "unusual", "conspirator"
);
private static List<String> frequencyTerms = Arrays.asList(
"always", "frequently", "usually", "often", "sometimes",
"occasionally", "rarely", "seldom", "almost never", "never"
private static List<String> speakingStyles = Arrays.asList(
"formal", "casual", "eloquent", "blunt", "humorous", "sarcastic", "mysterious",
"cheerful", "melancholic", "authoritative", "nervous", "whimsical", "grumpy",
"wise", "aggressive", "soft-spoken", "patriotic", "romantic", "pedantic", "dramatic",
"inquisitive", "cynical", "empathetic", "boisterous", "monotone", "laconic", "poetic",
"archaic", "childlike", "erudite", "streetwise", "flirtatious", "stoic", "rhetorical",
"inspirational", "goofy", "overly dramatic", "deadpan", "sing-song", "pompous",
"hyperactive", "valley girl", "robot", "pirate", "baby talk", "lolcat"
);
private static List<String> classes = Arrays.asList(
"warrior", "mage", "archer", "rogue", "paladin", "necromancer", "bard", "lorekeeper",
"sorcerer", "ranger", "cleric", "berserker", "alchemist", "summoner", "shaman",
"illusionist", "assassin", "knight", "valkyrie", "hoarder", "organizer", "lurker",
"elementalist", "gladiator", "templar", "reaver", "spellblade", "enchanter", "samurai",
"runemaster", "witch", "miner", "redstone engineer", "ender knight", "decorator",
"wither hunter", "nethermancer", "slime alchemist", "trader", "noob", "griefer",
"potion master", "builder", "explorer", "herbalist", "fletcher", "enchantress",
"smith", "geomancer", "hunter", "lumberjack", "farmer", "fisherman", "cartographer",
"librarian", "blacksmith", "architect", "trapper", "baker", "mineralogist",
"beekeeper", "hermit", "farlander", "void searcher", "end explorer", "archeologist",
"hero", "villain", "mercenary", "guardian", "rebel", "paragon",
"antagonist", "avenger", "seeker", "mystic", "outlaw"
);
private static List<String> alignments = Arrays.asList(
"lawful good", "neutral good", "chaotic good",
"lawful neutral", "true neutral", "chaotic neutral",
"lawful evil", "neutral evil", "chaotic evil"
);
// Get random no response message
......@@ -96,8 +120,12 @@ public class Randomizer {
messages = noResponseMessages;
} else if (messageType.equals(RandomType.ADJECTIVE)) {
messages = characterAdjectives;
} else if (messageType.equals(RandomType.FREQUENCY)) {
messages = frequencyTerms;
} else if (messageType.equals(RandomType.CLASS)) {
messages = classes;
} else if (messageType.equals(RandomType.ALIGNMENT)) {
messages = alignments;
} else if (messageType.equals(RandomType.SPEAKING_STYLE)) {
messages = speakingStyles;
}
int index = random.nextInt(messages.size());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment