Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
CreatureChat
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
Public
CreatureChat
Commits
88a88168
Commit
88a88168
authored
Aug 07, 2024
by
Jonathan Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved character creation with more random classes, speaking styles, and alignments.
parent
fa711c9b
Pipeline
#12726
passed with stages
in 2 minutes 26 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
15 deletions
+51
-15
CHANGELOG.md
CHANGELOG.md
+1
-0
ServerPackets.java
src/main/java/com/owlmaddie/network/ServerPackets.java
+15
-8
Randomizer.java
src/main/java/com/owlmaddie/utils/Randomizer.java
+35
-7
No files found.
CHANGELOG.md
View file @
88a88168
...
...
@@ -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
...
...
src/main/java/com/owlmaddie/network/ServerPackets.java
View file @
88a88168
...
...
@@ -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
);
}
...
...
src/main/java/com/owlmaddie/utils/Randomizer.java
View file @
88a88168
...
...
@@ -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"
,
"e
ssentially"
,
"e
motional"
,
"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
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment