This commit is contained in:
Auric Vente 2024-07-21 22:05:17 -06:00
parent de39189712
commit 738cc7c305
2 changed files with 1 additions and 9 deletions

View File

@ -52,6 +52,7 @@ Then a random number between 0 and 12 is picked.
For each number an action happens to produce an update. For each number an action happens to produce an update.
The top score is calculated as (Triumph - Hits). The top score is calculated as (Triumph - Hits).
If multiple ants have the same score, the oldest one wins.
For merge, the words of each name are used. For merge, the words of each name are used.
They get filled with random words if less than 2 words. They get filled with random words if less than 2 words.

View File

@ -101,14 +101,9 @@ class Ants:
def hatch(num: int = 1, on_change: bool = True) -> None: def hatch(num: int = 1, on_change: bool = True) -> None:
from .game import Game from .game import Game
now = Utils.now()
for _ in range(num): for _ in range(num):
ant = Ant() ant = Ant()
ant.created = now
ant.updated = now
ant.name = Ants.random_name() ant.name = Ants.random_name()
Ants.ants.append(ant) Ants.ants.append(ant)
Game.add_update(ant) Game.add_update(ant)
@ -269,12 +264,8 @@ class Ants:
Ants.set_terminated(ant_1) Ants.set_terminated(ant_1)
Ants.set_terminated(ant_2) Ants.set_terminated(ant_2)
now = Utils.now()
ant = Ant() ant = Ant()
ant.name = name ant.name = name
ant.created = now
ant.updated = now
ant.triumph = ant_1.triumph + ant_2.triumph ant.triumph = ant_1.triumph + ant_2.triumph
ant.hits = ant_1.hits + ant_2.hits ant.hits = ant_1.hits + ant_2.hits