Skip to content

Commit

Permalink
Renames functions and adds a remove other marker function
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebaestschjin committed Apr 29, 2021
1 parent c2c9c51 commit 6bed228
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
10 changes: 5 additions & 5 deletions Game/Scripts/automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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):
Expand Down
11 changes: 10 additions & 1 deletion Game/Scripts/table_actions.py
Original file line number Diff line number Diff line change
@@ -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"


Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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)
Expand Down
12 changes: 9 additions & 3 deletions Game/definition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@
<table name="Middle-Earth" visibility="undefined"
width="800" height="650"
background="Resources/background.jpg" backgroundStyle="uniformToFill">
<cardaction menu="Add Default Token" shortcut="Up" execute="add_default_marker"/>
<cardaction menu="Remove Default Token" shortcut="Down" execute="remove_default_marker"/>
<cardactions menu="Add...">
<cardaction menu="Default Token"
shortcut="Up"
execute="add_default_marker"/>
<cardaction menu="Damage"
shortcut="f1"
execute="add_damage"/>
Expand All @@ -103,6 +104,9 @@
execute="add_other"/>
</cardactions>
<cardactions menu="Remove...">
<cardaction menu="Remove Default Token"
shortcut="Down"
execute="remove_default_marker"/>
<cardaction menu="Damage"
shortcut="shift+f1"
execute="remove_damage"/>
Expand All @@ -112,6 +116,8 @@
<cardaction menu="Twilight"
shortcut="shift+f3"
execute="remove_twilight"/>
<cardaction menu="All Other"
execute="remove_other"/>
</cardactions>
<!-- standard card actions -->
<cardactions menu="Change Cards">
Expand All @@ -131,7 +137,7 @@
<groupaction menu="Roll a 6-sided Die"
execute="roll_d6"/>
</groupactions>
<groupaction menu="Bid Burdens for First Player" execute="bid_burdens"/>
<groupaction menu="Bid Burdens for First Player" execute="bid_burdens" showIf="has_not_bid"/>
</table>

<player summary="Hand:{#Hand} | Threats:{#Threats}">
Expand Down

0 comments on commit 6bed228

Please sign in to comment.