Mods
This commit is contained in:
parent
5198660984
commit
0ecee9230e
|
@ -180,7 +180,7 @@ class Game:
|
||||||
ant.hits += 1
|
ant.hits += 1
|
||||||
method = "hit"
|
method = "hit"
|
||||||
elif num == 3:
|
elif num == 3:
|
||||||
status = Utils.random_name([])
|
status = Utils.random_name([], Ants.get_names())
|
||||||
method = "thinking"
|
method = "thinking"
|
||||||
elif num == 4:
|
elif num == 4:
|
||||||
status = Utils.rand_sentence.simple_sentence()
|
status = Utils.rand_sentence.simple_sentence()
|
||||||
|
|
|
@ -93,7 +93,14 @@ class Utils:
|
||||||
return r, g, b
|
return r, g, b
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def random_name(ignore: list[str]) -> str:
|
def random_name(ignore: list[str], include: list[str] | None = None) -> str:
|
||||||
|
names = Utils.names
|
||||||
|
|
||||||
|
if include:
|
||||||
|
for name in include:
|
||||||
|
if name not in names:
|
||||||
|
names.append(name)
|
||||||
|
|
||||||
filtered = [name for name in Utils.names if name not in ignore]
|
filtered = [name for name in Utils.names if name not in ignore]
|
||||||
return random.choice(filtered)
|
return random.choice(filtered)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue