Skip to content

Commit

Permalink
Prepare next release
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebaestschjin committed Apr 28, 2021
1 parent 77c8e55 commit c2c9c51
Show file tree
Hide file tree
Showing 26 changed files with 312 additions and 263 deletions.
64 changes: 48 additions & 16 deletions Game/Scripts/automation.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,51 @@
def on_player_global_cariable_changed(args):
startingPlayer()
TwilightCard = "fb909fa6-1ed7-44f7-a214-77b9bf5ce90d"
BidVariable = "burdenBid"
BidDefault = 999
DeckLoaded = "deckLoaded"

def deck_loaded(args):

def on_player_global_variable_changed(_):
determine_starting_player()


def on_deck_loaded(args):
if args.player == me:
me.setGlobalVariable("deckLoaded", "Yes")
if all(player.getGlobalVariable("deckLoaded") == "Yes" for player in getPlayers()):
twilight = table.create("fb909fa6-1ed7-44f7-a214-77b9bf5ce90d", -200, -31, 1, persist = True)
set_deck_loaded(me)

if all_players(is_deck_loaded):
twilight = table.create(TwilightCard, -200, -31, 1, persist=True)
notify("{}".format(twilight))
twilight.anchor = True

def startingPlayer():
if all(player.getGlobalVariable("burdenBid") != "999" for player in getPlayers()):
notify("{} has bid {} burden token(s).".format(me,int(me.getGlobalVariable("burdenBid"))))


def notBid(group, x=0, y=0):
if me.getGlobalVariable("burdenBid") == "999":
return True
else: return False


def determine_starting_player():
if all_players(did_bid):
notify("{} has bid {} burden token(s).".format(me, get_bid(me))


def get_bid(player):
return int(player.getGlobalVariable(BidVariable))


def set_bid(player, value):
player.setGlobalVariable(BidVariable, str(value))


def did_bid(player):
return get_bid(player) != BidDefault


def did_not_bid(group, x=0, y=0):
return not did_bid(me)


def all_players(test):
return all(test(player) for player in getPlayers())


def is_deck_loaded(player):
return player.getGlobalVariable(DeckLoaded) == "Yes"


def set_deck_loaded(player):
player.setGlobalVariable(DeckLoaded, "Yes")
1 change: 1 addition & 0 deletions Game/Scripts/hand_actions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Discard = "Discard"


def discard_card(card):
mute()
card.moveTo(me.piles[Discard])
Expand Down
86 changes: 47 additions & 39 deletions Game/Scripts/table_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
HighlightColor = "#ff0000"


def add_default_marker(card, x=0, y=0):
marker_type = determine_default_marker(card)
if marker_type:
add_marker(card, marker_type)


def add_damage(card, x=0, y=0):
add_marker(card, DamageMarker)

Expand All @@ -16,6 +22,26 @@ def add_twilight(card, x=0, y=0):
add_marker(card, TwilightMarker)


def add_other(card, x=0, y=0):
mute()
marker, qty = askMarker()
if qty != 0:
card.markers[marker] = qty


def add_marker(card, marker):
mute()
name = marker[0]
card.markers[marker] += 1
notify("{} adds a {} to {}.".format(me, name, card))


def remove_default_marker(card, x=0, y=0):
marker_type = determine_default_marker(card)
if marker_type:
remove_marker(card, marker_type)


def remove_damage(card, x=0, y=0):
remove_marker(card, DamageMarker)

Expand All @@ -27,34 +53,6 @@ def remove_burden(card, x=0, y=0):
def remove_twilight(card, x=0, y=0):
remove_marker(card, TwilightMarker)

def check_card_marker(card):
if 'Ally' in card.type or 'Companion' in card.type or 'Minion' in card.Type:
return DamageMarker
elif "Twilight Pool" in card.name:
return TwilightMarker
else:
return "None"

def add_general(card, x=0, y=0):
mute()
type = check_card_marker(card)
if type == "None": return
else:
add_marker(card, type)

def remove_general(card, x=0, y=0):
mute()
type = check_card_marker(card)
if type == "None": return
else:
remove_marker(card, type)

def add_marker(card, marker):
mute()
name = marker[0]
card.markers[marker] += 1
notify("{} adds a {} to {}.".format(me, name, card))


def remove_marker(card, marker):
mute()
Expand All @@ -64,12 +62,14 @@ def remove_marker(card, marker):
card.markers[marker] -= 1
notify("{} removes a {} from {}.".format(me, name, card))

def add_other(card, x=0, y=0):
mute()
marker, qty = askMarker()
if qty == 0: return
card.markers[marker] = qty


def determine_default_marker(card):
if is_character(card):
return DamageMarker
elif is_twilight_tracker(card):
return TwilightMarker
return None


def rotate_cards(cards, x=0, y=0):
mute()
Expand Down Expand Up @@ -117,11 +117,19 @@ def roll_d6(group, x=0, y=0):
n = rnd(1, 6)
notify("{} rolls {} on a 6-sided die.".format(me, n))


def bid_burdens(group, x=0, y=0):
if int(me.getGlobalVariable("burdenBid")) == 999:
if did_not_bid(me):
bid = askInteger("How much burden would you like to bid?", 0)
if bid == None: return
me.setGlobalVariable("burdenBid", str(bid))
if bid:
set_bid(me, bid)
else:
whisper("You've already bid for this game.")
whisper("You've already bid for this game.")


def is_character(card):
return 'Ally' in card.type or 'Companion' in card.type or 'Minion' in card.type


def is_twilight_tracker(card):
return "Twilight Pool" in card.name
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions Game/Sets/0ba2bb97-c569-4ece-832a-2826e7612e23/set.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" ?>
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.2.0.0" id="0ba2bb97-c569-4ece-832a-2826e7612e23" name="Special Cards" version="1.0">
<cards>
<card id="fb909fa6-1ed7-44f7-a214-77b9bf5ce90d" name="Twilight Pool" size="SiteCard">
<property name="Text">Track the Twilight Pool here.</property>
</card>
</cards>
</set>
2 changes: 1 addition & 1 deletion Game/Sets/1f543ba6-28f4-4043-ad73-da100468cbd6/set.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" ?>
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.1.3.2" id="1f543ba6-28f4-4043-ad73-da100468cbd6" name="Battle of Helm's Deep" version="1.0">
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.2.0.0" id="1f543ba6-28f4-4043-ad73-da100468cbd6" name="Battle of Helm's Deep" version="1.0">
<cards>
<card id="2d3cd0d3-f525-493b-94f2-eacfd4954e0d" name="Dunlending Rampager">
<property name="Kind" value="Shadow"/>
Expand Down
2 changes: 1 addition & 1 deletion Game/Sets/34593335-4142-4f22-b957-c71752e59450/set.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" ?>
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.1.3.2" id="34593335-4142-4f22-b957-c71752e59450" name="Realms of the Elf-lords" version="1.0">
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.2.0.0" id="34593335-4142-4f22-b957-c71752e59450" name="Realms of the Elf-lords" version="1.0">
<cards>
<card id="77a5efff-abcb-48a8-b6ff-39fe8635ac70" name="Book of Mazarbul">
<property name="Kind" value="Free People"/>
Expand Down
2 changes: 1 addition & 1 deletion Game/Sets/3f429435-50ec-4bee-9bf1-94b1e26a249a/set.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" ?>
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.1.3.2" id="3f429435-50ec-4bee-9bf1-94b1e26a249a" name="Bloodlines" version="1.0">
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.2.0.0" id="3f429435-50ec-4bee-9bf1-94b1e26a249a" name="Bloodlines" version="1.0">
<cards>
<card id="343126a0-a261-4ad5-862d-972b0c97df09" name="Arod">
<property name="Subname" value="Rohirrim Steed"/>
Expand Down
2 changes: 1 addition & 1 deletion Game/Sets/51e1971a-4963-4567-a3f1-a672890b4018/set.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" ?>
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.1.3.2" id="51e1971a-4963-4567-a3f1-a672890b4018" name="Mount Doom" version="1.0">
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.2.0.0" id="51e1971a-4963-4567-a3f1-a672890b4018" name="Mount Doom" version="1.0">
<cards>
<card id="18f8ec4c-d558-4ac3-9bbe-664809eedc51" name="Great Day">
<property name="Subname" value="Great Hour"/>
Expand Down
2 changes: 1 addition & 1 deletion Game/Sets/6385586f-c133-499c-8602-ca71c9a62e0c/set.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" ?>
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.1.3.2" id="6385586f-c133-499c-8602-ca71c9a62e0c" name="Reflections" version="1.0">
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.2.0.0" id="6385586f-c133-499c-8602-ca71c9a62e0c" name="Reflections" version="1.0">
<cards>
<card id="11f2b3b0-4559-48cb-b093-877acd275393" name="The One Ring">
<property name="Subname" value="The Binding Ring"/>
Expand Down
2 changes: 1 addition & 1 deletion Game/Sets/6e9d5861-ca1a-49b5-b3a4-dd736c84b346/set.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" ?>
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.1.3.2" id="6e9d5861-ca1a-49b5-b3a4-dd736c84b346" name="Black Rider" version="1.0">
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.2.0.0" id="6e9d5861-ca1a-49b5-b3a4-dd736c84b346" name="Black Rider" version="1.0">
<cards>
<card id="f82bf72a-cb2f-45b0-bebc-5d858dbb5469" name="Argument Ready to Hand">
<property name="Kind" value="Free People"/>
Expand Down
2 changes: 1 addition & 1 deletion Game/Sets/73f1d13a-38cf-46b9-a661-a7f1a1413363/set.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" ?>
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.1.3.2" id="73f1d13a-38cf-46b9-a661-a7f1a1413363" name="The Wraith Collection" version="1.0">
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.2.0.0" id="73f1d13a-38cf-46b9-a661-a7f1a1413363" name="The Wraith Collection" version="1.0">
<cards>
<card id="7e8f0500-83db-459a-8fd2-25e4f5e3e09d" name="Barrow-wight Stalker">
<property name="Kind" value="Shadow"/>
Expand Down
2 changes: 1 addition & 1 deletion Game/Sets/8a2317ad-928b-4720-bb1a-fd66695b7b40/set.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" ?>
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.1.3.2" id="8a2317ad-928b-4720-bb1a-fd66695b7b40" name="Shadows" version="1.0">
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.2.0.0" id="8a2317ad-928b-4720-bb1a-fd66695b7b40" name="Shadows" version="1.0">
<cards>
<card id="0d9c478f-5c04-43b5-be63-c39ccf68cea0" name="The One Ring">
<property name="Subname" value="The Ring of Rings"/>
Expand Down
2 changes: 1 addition & 1 deletion Game/Sets/8ec30131-dd27-4e05-adf6-d208be06a26f/set.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" ?>
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.1.3.2" id="8ec30131-dd27-4e05-adf6-d208be06a26f" name="Promotional" version="1.0">
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.2.0.0" id="8ec30131-dd27-4e05-adf6-d208be06a26f" name="Promotional" version="1.0">
<cards>
<card id="c97fd04e-ba34-417b-a692-fa8aa0276e73" name="The Lord of the Rings">
<property name="Subname" value="Trading Card Game"/>
Expand Down
2 changes: 1 addition & 1 deletion Game/Sets/90d4ec82-67e3-4bf1-8559-d2985ffcf5c8/set.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" ?>
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.1.3.2" id="90d4ec82-67e3-4bf1-8559-d2985ffcf5c8" name="Ages End" version="1.0">
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.2.0.0" id="90d4ec82-67e3-4bf1-8559-d2985ffcf5c8" name="Ages End" version="1.0">
<cards>
<card id="c51997fd-e6a3-473e-a393-b8fae751a58f" name="The One Ring">
<property name="Subname" value="The Great Ring"/>
Expand Down
2 changes: 1 addition & 1 deletion Game/Sets/983c7200-acfc-412a-9b32-f130b4500725/set.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" ?>
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.1.3.2" id="983c7200-acfc-412a-9b32-f130b4500725" name="Mines of Moria" version="1.0">
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.2.0.0" id="983c7200-acfc-412a-9b32-f130b4500725" name="Mines of Moria" version="1.0">
<cards>
<card id="d33a2385-afb6-4906-b002-ee4d2d585ad1" name="Beneath the Mountains">
<property name="Kind" value="Free People"/>
Expand Down
2 changes: 1 addition & 1 deletion Game/Sets/a3e066b5-4653-4a77-8de6-9e1fd50f48b7/set.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" ?>
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.1.3.2" id="a3e066b5-4653-4a77-8de6-9e1fd50f48b7" name="Treachery &amp; Deceit" version="1.0">
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.2.0.0" id="a3e066b5-4653-4a77-8de6-9e1fd50f48b7" name="Treachery &amp; Deceit" version="1.0">
<cards>
<card id="c3bbe645-53bb-4fa3-8a4e-4ea902e3cb34" name="Gimli">
<property name="Subname" value="Sprinter"/>
Expand Down
2 changes: 1 addition & 1 deletion Game/Sets/a9ca1341-2480-4f88-a136-cde7843daa06/set.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" ?>
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.1.3.2" id="a9ca1341-2480-4f88-a136-cde7843daa06" name="The Fellowship of the Ring" version="1.0">
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.2.0.0" id="a9ca1341-2480-4f88-a136-cde7843daa06" name="The Fellowship of the Ring" version="1.0">
<cards>
<card id="fb551228-5f0d-48d5-b418-c4aa25e27b1b" name="The One Ring">
<property name="Subname" value="Isildur's Bane"/>
Expand Down
2 changes: 1 addition & 1 deletion Game/Sets/b5556073-91a2-4d98-8de1-894a1a560bff/set.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" ?>
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.1.3.2" id="b5556073-91a2-4d98-8de1-894a1a560bff" name="Rise of Saruman" version="1.0">
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.2.0.0" id="b5556073-91a2-4d98-8de1-894a1a560bff" name="Rise of Saruman" version="1.0">
<cards>
<card id="49a422cc-3f10-4803-8de9-98f1bb841fdd" name="Armor of Khazad">
<property name="Kind" value="Free People"/>
Expand Down
2 changes: 1 addition & 1 deletion Game/Sets/bbab9a59-f3c4-4346-9fdf-023ab5585b70/set.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" ?>
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.1.3.2" id="bbab9a59-f3c4-4346-9fdf-023ab5585b70" name="The Hunters" version="1.0">
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.2.0.0" id="bbab9a59-f3c4-4346-9fdf-023ab5585b70" name="The Hunters" version="1.0">
<cards>
<card id="f368afa5-9068-4323-a970-30be16a43fc7" name="The One Ring">
<property name="Subname" value="The Ring of Doom"/>
Expand Down
2 changes: 1 addition & 1 deletion Game/Sets/c32082c8-b483-49b5-983a-89fd71799a9f/set.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" ?>
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.1.3.2" id="c32082c8-b483-49b5-983a-89fd71799a9f" name="Siege of Gondor" version="1.0">
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.2.0.0" id="c32082c8-b483-49b5-983a-89fd71799a9f" name="Siege of Gondor" version="1.0">
<cards>
<card id="4ac53ca9-14e8-4460-9b82-ed9963f6de7e" name="Aggression">
<property name="Kind" value="Free People"/>
Expand Down
2 changes: 1 addition & 1 deletion Game/Sets/c91e9615-da1e-49b9-b892-88cc431b23e9/set.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" ?>
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.1.3.2" id="c91e9615-da1e-49b9-b892-88cc431b23e9" name="The Two Towers" version="1.0">
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.2.0.0" id="c91e9615-da1e-49b9-b892-88cc431b23e9" name="The Two Towers" version="1.0">
<cards>
<card id="abeec779-8bf9-4406-b1d7-fc831b6493b1" name="The One Ring">
<property name="Subname" value="Answer To All Riddles"/>
Expand Down
2 changes: 1 addition & 1 deletion Game/Sets/cf478b52-ee5b-43f2-9321-929e8c4023a8/set.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" ?>
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.1.3.2" id="cf478b52-ee5b-43f2-9321-929e8c4023a8" name="Ents of Fangorn" version="1.0">
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.2.0.0" id="cf478b52-ee5b-43f2-9321-929e8c4023a8" name="Ents of Fangorn" version="1.0">
<cards>
<card id="6d989d41-a1ab-49dc-b1de-2ad464dd5591" name="Bound By Rage">
<property name="Kind" value="Shadow"/>
Expand Down
2 changes: 1 addition & 1 deletion Game/Sets/f6481488-4977-45aa-9a8b-0a7867beecdd/set.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" ?>
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.1.3.2" id="f6481488-4977-45aa-9a8b-0a7867beecdd" name="Expanded Middle-earth" version="1.0">
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.2.0.0" id="f6481488-4977-45aa-9a8b-0a7867beecdd" name="Expanded Middle-earth" version="1.0">
<cards>
<card id="ad1b6875-f32b-4696-a869-ca336f9f715c" name="Dain Ironfoot">
<property name="Subname" value="King Under the Mountain"/>
Expand Down
2 changes: 1 addition & 1 deletion Game/Sets/f87a7c1f-936a-477a-851b-c1dce35886cd/set.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" ?>
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.1.3.2" id="f87a7c1f-936a-477a-851b-c1dce35886cd" name="The Return of the King" version="1.0">
<set gameId="98d26dd0-7ff6-4d2c-a023-0bc916d3f001" gameVersion="1.2.0.0" id="f87a7c1f-936a-477a-851b-c1dce35886cd" name="The Return of the King" version="1.0">
<cards>
<card id="874ac25f-da6a-4521-b13b-ad0398d669ea" name="The One Ring">
<property name="Subname" value="The Ruling Ring"/>
Expand Down
Loading

0 comments on commit c2c9c51

Please sign in to comment.