This commit is contained in:
Auric Vente 2024-07-25 21:43:00 -06:00
parent 6c09901496
commit b853eade5d
2 changed files with 24 additions and 13 deletions

View File

@ -53,8 +53,7 @@ class Opts:
triumph = Opt(2, Method.triumph) triumph = Opt(2, Method.triumph)
hit = Opt(2, Method.hit) hit = Opt(2, Method.hit)
travel = Opt(2, Method.travel) travel = Opt(2, Method.travel)
think_1 = Opt(2, Method.think) think = Opt(2, Method.think)
think_2 = Opt(2, Method.think)
words_1 = Opt(3, Method.words) words_1 = Opt(3, Method.words)
words_2 = Opt(3, Method.words) words_2 = Opt(3, Method.words)
words_3 = Opt(3, Method.words) words_3 = Opt(3, Method.words)
@ -70,7 +69,7 @@ class Opts:
@staticmethod @staticmethod
def opts_think() -> list[Opt]: def opts_think() -> list[Opt]:
return [Opts.think_1, Opts.think_2] return [Opts.think]
@staticmethod @staticmethod
def opts_words() -> list[Opt]: def opts_words() -> list[Opt]:
@ -309,13 +308,16 @@ class Game:
status = Utils.random_country([]) status = Utils.random_country([])
method = Opts.travel.method method = Opts.travel.method
elif value == Opts.think_1.value: elif value == Opts.think.value:
status = Utils.random_name([], Ants.get_names()) n = random.randint(1, 3)
method = Opts.think_1.method method = Opts.think.method
elif value == Opts.think_2.value: if n == 1:
status = Utils.random_emoji(3) status = Utils.random_name([], Ants.get_names())
method = Opts.think_2.method elif n == 2:
status = Utils.random_emoji(3)
elif n == 3:
status = Utils.random_words(1)[0].capitalize()
elif value == Opts.words_1.value: elif value == Opts.words_1.value:
status = Utils.words_1() status = Utils.words_1()

View File

@ -160,10 +160,19 @@ class Utils:
return random.choice(filtered) return random.choice(filtered)
@staticmethod @staticmethod
def random_word() -> str: def random_word(noun: bool = True, adj: bool = True) -> str:
word = Utils.rand_word.word( opts = []
include_parts_of_speech=["nouns", "adjectives"], word_max_length=8
) if noun:
opts.append("noun")
if adj:
opts.append("adjective")
if not len(opts):
return ""
word = Utils.rand_word.word(include_parts_of_speech=opts, word_max_length=8)
return str(word) return str(word)