Mods
This commit is contained in:
parent
0d22a4280f
commit
4c2a8edb7c
|
@ -54,6 +54,7 @@ class Config:
|
||||||
filter_width: int = 150
|
filter_width: int = 150
|
||||||
filter_debouncer_delay: int = 200
|
filter_debouncer_delay: int = 200
|
||||||
default_population: int = 100
|
default_population: int = 100
|
||||||
|
merge_goal: int = 8
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def prepare() -> None:
|
def prepare() -> None:
|
||||||
|
|
|
@ -34,7 +34,7 @@ class Method:
|
||||||
class Game:
|
class Game:
|
||||||
timer: QTimer | None = None
|
timer: QTimer | None = None
|
||||||
playing_song: bool = False
|
playing_song: bool = False
|
||||||
last_update: int = 0
|
merge_charge: int = 0
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def prepare() -> None:
|
def prepare() -> None:
|
||||||
|
@ -169,22 +169,17 @@ class Game:
|
||||||
|
|
||||||
min_num = 0
|
min_num = 0
|
||||||
max_num = 12
|
max_num = 12
|
||||||
no_repeat = [Method.merge]
|
|
||||||
|
|
||||||
num = random.randint(min_num, max_num)
|
num = random.randint(min_num, max_num)
|
||||||
|
Game.merge_charge += 1
|
||||||
if num in no_repeat:
|
|
||||||
if Game.last_update == num:
|
|
||||||
num = max_num
|
|
||||||
|
|
||||||
Game.last_update = num
|
|
||||||
|
|
||||||
if num == Method.merge:
|
if num == Method.merge:
|
||||||
if Ants.merge():
|
if Game.merge_charge >= Config.merge_goal:
|
||||||
return
|
if Ants.merge():
|
||||||
|
Game.merge_charge = 0
|
||||||
|
return
|
||||||
|
|
||||||
# If merge failed
|
num = min_num
|
||||||
num = max_num
|
|
||||||
|
|
||||||
status = ""
|
status = ""
|
||||||
method = "normal"
|
method = "normal"
|
||||||
|
|
Loading…
Reference in New Issue