Mods
This commit is contained in:
parent
5198660984
commit
0ecee9230e
|
@ -180,7 +180,7 @@ class Game:
|
|||
ant.hits += 1
|
||||
method = "hit"
|
||||
elif num == 3:
|
||||
status = Utils.random_name([])
|
||||
status = Utils.random_name([], Ants.get_names())
|
||||
method = "thinking"
|
||||
elif num == 4:
|
||||
status = Utils.rand_sentence.simple_sentence()
|
||||
|
|
|
@ -93,7 +93,14 @@ class Utils:
|
|||
return r, g, b
|
||||
|
||||
@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]
|
||||
return random.choice(filtered)
|
||||
|
||||
|
|
Loading…
Reference in New Issue