From 6bed228ce99a6ca202e496c55809cc6cbfb66c15 Mon Sep 17 00:00:00 2001 From: Sebastian Stern Date: Thu, 29 Apr 2021 09:11:43 +0200 Subject: [PATCH] Renames functions and adds a remove other marker function --- Game/Scripts/automation.py | 10 +++++----- Game/Scripts/table_actions.py | 11 ++++++++++- Game/definition.xml | 12 +++++++++--- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/Game/Scripts/automation.py b/Game/Scripts/automation.py index 3c05970..3f7297a 100644 --- a/Game/Scripts/automation.py +++ b/Game/Scripts/automation.py @@ -19,8 +19,8 @@ def on_deck_loaded(args): def determine_starting_player(): - if all_players(did_bid): - notify("{} has bid {} burden token(s).".format(me, get_bid(me)) + if all_players(has_bid): + notify("{} has bid {} burden token(s).".format(me, get_bid(me))) def get_bid(player): @@ -31,12 +31,12 @@ def set_bid(player, value): player.setGlobalVariable(BidVariable, str(value)) -def did_bid(player): +def has_bid(player): return get_bid(player) != BidDefault -def did_not_bid(group, x=0, y=0): - return not did_bid(me) +def has_not_bid(group, x=0, y=0): + return not has_bid(me) def all_players(test): diff --git a/Game/Scripts/table_actions.py b/Game/Scripts/table_actions.py index 2867a62..8c42700 100644 --- a/Game/Scripts/table_actions.py +++ b/Game/Scripts/table_actions.py @@ -1,6 +1,8 @@ DamageMarker = ('Damage', 'ca152f06-41cc-476a-be27-0bdd57f4b710') BurdenMarker = ('Burden', 'ad150c1d-4534-456b-a4bd-58bf67a26c3b') TwilightMarker = ('Twilight', 'e4fe7c68-73f2-4ea6-a311-f537088965eb') +ALL_MARKER = [DamageMarker, BurdenMarker, TwilightMarker] + HighlightColor = "#ff0000" @@ -54,6 +56,13 @@ def remove_twilight(card, x=0, y=0): remove_marker(card, TwilightMarker) +def remove_other(card, x=0, y=0): + mute() + for marker in card.markers: + if marker not in ALL_MARKER: + card.markers[marker] = 0 + + def remove_marker(card, marker): mute() name = marker[0] @@ -119,7 +128,7 @@ def roll_d6(group, x=0, y=0): def bid_burdens(group, x=0, y=0): - if did_not_bid(me): + if has_not_bid(me): bid = askInteger("How much burden would you like to bid?", 0) if bid: set_bid(me, bid) diff --git a/Game/definition.xml b/Game/definition.xml index 3803269..d351d4f 100644 --- a/Game/definition.xml +++ b/Game/definition.xml @@ -87,9 +87,10 @@ - - + @@ -103,6 +104,9 @@ execute="add_other"/> + @@ -112,6 +116,8 @@ + @@ -131,7 +137,7 @@ - +