diff --git a/cromulant/args.py b/cromulant/args.py index 5b39559..cba71e7 100644 --- a/cromulant/args.py +++ b/cromulant/args.py @@ -29,6 +29,12 @@ class Args: score: bool = False mono: bool = False fade: bool = True + weight_merge: int = 1 + weight_triumph: int = 2 + weight_hit: int = 2 + weight_travel: int = 2 + weight_think: int = 2 + weight_words: int = 4 @staticmethod def prepare() -> None: @@ -62,6 +68,12 @@ class Args: "argdoc", "score", "mono", + "weight_merge", + "weight_triumph", + "weight_hit", + "weight_travel", + "weight_think", + "weight_words", ] for n_item in normals: diff --git a/cromulant/argspec.py b/cromulant/argspec.py index 9059824..eb0939a 100644 --- a/cromulant/argspec.py +++ b/cromulant/argspec.py @@ -34,6 +34,7 @@ class ArgSpec: defaults: dict[str, Any] arguments: dict[str, Any] infos: list[str] + weight_info = ", proportional to the other methods. The higher this is, the more likely it is to be picked" @staticmethod def prepare() -> None: @@ -184,3 +185,39 @@ class ArgSpec: action="store_false", info="Don't apply a fade-in effect on new updates", ) + + ArgSpec.add_argument( + "weight_merge", + type=int, + info=f"The weight of the merge method{ArgSpec.weight_info}", + ) + + ArgSpec.add_argument( + "weight_triumph", + type=int, + info=f"The weight of the triumph method{ArgSpec.weight_info}", + ) + + ArgSpec.add_argument( + "weight_hit", + type=int, + info=f"The weight of the hit method{ArgSpec.weight_info}", + ) + + ArgSpec.add_argument( + "weight_travel", + type=int, + info=f"The weight of the travel method{ArgSpec.weight_info}", + ) + + ArgSpec.add_argument( + "weight_think", + type=int, + info=f"The weight of the think method{ArgSpec.weight_info}", + ) + + ArgSpec.add_argument( + "weight_words", + type=int, + info=f"The weight of the words method{ArgSpec.weight_info}", + ) diff --git a/cromulant/game.py b/cromulant/game.py index d8a1bc9..b977082 100644 --- a/cromulant/game.py +++ b/cromulant/game.py @@ -52,12 +52,23 @@ class Opt: class Opts: - merge = Opt(1, Method.merge) - triumph = Opt(2, Method.triumph) - hit = Opt(2, Method.hit) - travel = Opt(2, Method.travel) - think = Opt(2, Method.think) - words = Opt(4, Method.words) + merge: Opt + triumph: Opt + hit: Opt + travel: Opt + think: Opt + words: Opt + + @staticmethod + def prepare() -> None: + from .args import Args + + Opts.merge = Opt(Args.weight_merge, Method.merge) + Opts.triumph = Opt(Args.weight_triumph, Method.triumph) + Opts.hit = Opt(Args.weight_hit, Method.hit) + Opts.travel = Opt(Args.weight_travel, Method.travel) + Opts.think = Opt(Args.weight_think, Method.think) + Opts.words = Opt(Args.weight_words, Method.words) @staticmethod def opts_score() -> list[Opt]: @@ -86,6 +97,7 @@ class Game: @staticmethod def prepare() -> None: + Opts.prepare() Game.timer = QTimer() Game.timer.timeout.connect(Game.get_status) diff --git a/cromulant/manifest.json b/cromulant/manifest.json index 9c75364..5fdbdc3 100644 --- a/cromulant/manifest.json +++ b/cromulant/manifest.json @@ -1,5 +1,5 @@ { - "version": "5.0.0", + "version": "6.0.0", "title": "Cromulant", "program": "cromulant", "author": "madprops",