Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Pytest

on:
pull_request:
branches:
- main

jobs:
pytest:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.12'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
grep -v pywin32 requirements.txt | pip install -r /dev/stdin
pip install pytest

- name: Run tests
run: |
echo '{"token": "test-token", "game_number": 46, "gamestate_path": "/tmp/eclipse_test_games"}' > config.json
python3 -m pytest tests/

118 changes: 1 addition & 117 deletions data/basic_game.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,123 +51,7 @@
],
"tile_deck_300": [],
"tile_discard": [],
"tech_deck": [
"ade",
"ade",
"ade",
"ade",
"anc",
"anc",
"anc",
"fus",
"fus",
"fus",
"fus",
"fus",
"gas",
"gas",
"gas",
"gas",
"gas",
"imh",
"imh",
"imh",
"imh",
"imh",
"poc",
"poc",
"poc",
"poc",
"poc",
"qug",
"qug",
"qug",
"tad",
"tad",
"tad",
"adm",
"adm",
"adm",
"adm",
"glc",
"glc",
"glc",
"neb",
"neb",
"neb",
"neb",
"neb",
"phs",
"phs",
"phs",
"phs",
"phs",
"plc",
"plc",
"plc",
"plc",
"plc",
"plm",
"plm",
"plm",
"stb",
"stb",
"stb",
"stb",
"stb",
"tas",
"tas",
"tas",
"adl",
"adl",
"adl",
"adl",
"adr",
"adr",
"adr",
"adr",
"adr",
"ark",
"ark",
"ark",
"fud",
"fud",
"fud",
"fud",
"fud",
"mon",
"mon",
"mon",
"nar",
"nar",
"nar",
"nar",
"nar",
"orb",
"orb",
"orb",
"orb",
"orb",
"wog",
"wog",
"wog",
"abs",
"anl",
"ans",
"cld",
"cof",
"flm",
"iml",
"met",
"rican",
"seh",
"socan",
"trd",
"zes",
"pim",
"nea",
"wap"
],
"tech_deck": [],
"available_techs": [],
"reputation_tiles": [
4,
Expand Down
28 changes: 24 additions & 4 deletions data/techs.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"art_pt": 0,
"infdisc": 0,
"dtile": 0,
"num": 4,
"num": 5,
"description": "You may upgrade your Ship Blueprints with Gauss Shield Ship Parts. This basic shield is a starting tech for the Orion species. Reduces die rolls against this ship by 1, with no effect on Direct Hits."
},
"fus": {
Expand All @@ -20,7 +20,8 @@
"art_pt": 0,
"infdisc": 0,
"dtile": 0,
"num": 4,
"num": 5,
"num_expanded_galaxy": 6,
"description": "You may upgrade your Ship Blueprints with Fusion Source Ship Parts. Fusion Source generates 6 Energy for the ship."
},
"imh": {
Expand All @@ -33,6 +34,7 @@
"infdisc": 0,
"dtile": 0,
"num": 5,
"num_expanded_galaxy": 6,
"description": "You may upgrade your Ship Blueprints with Improved Hull Ship Parts. Improved Hull panels can each absorb up to 2 hits during the Combat phase."
},
"imhmod": {
Expand All @@ -45,6 +47,7 @@
"infdisc": 0,
"dtile": 0,
"num": 5,
"num_expanded_galaxy": 6,
"description": "You may upgrade your Ship Blueprints with modded Improved Hull Ship Parts. Improved Hull panels can each absorb up to 2 hits during the Combat phase but subtract 1 from your initiative."
},
"poc": {
Expand All @@ -56,7 +59,8 @@
"art_pt": 0,
"infdisc": 0,
"dtile": 0,
"num": 4,
"num": 5,
"num_expanded_galaxy": 6,
"description": "You may upgrade your Ship Blueprints with Positron Computer Ship Parts. Positron Computers add +2 to all non-Direct Hit (1-5) dice values rolled by this ship during the Combat Phase. Each Positron Computer requires 1 Energy."
},
"ade": {
Expand All @@ -69,6 +73,7 @@
"infdisc": 0,
"dtile": 0,
"num": 4,
"num_expanded_galaxy": 5,
"description": "You may place Population Cubes in Advanced Money (Yellow) or Neutral (White) Population Squares with your Colony Ships. Advanced Population Squares are indicated by a small starburst in the upper left corner."
},
"tad": {
Expand All @@ -93,6 +98,7 @@
"infdisc": 0,
"dtile": 0,
"num": 3,
"num_expanded_galaxy": 4,
"description": "You may upgrade your Ship Blueprints with Antimatter Cannon Ship Parts. During the Combat Phase, Antimatter Cannons deal 4 hits to a single target if 1) the red die rolls a Direct Hit, or 2) if the red die result + total Computers - total Shields of the target ship = 6 or greater. Also see Antimass Splitter. Each Antimass Cannon requires 4 Energy."
},
"qug": {
Expand All @@ -105,6 +111,7 @@
"infdisc": 2,
"dtile": 0,
"num": 3,
"num_expanded_galaxy": 4,
"description": "You receive two additional Influence Discs, placed immediately on your Influence Track."
},
"neb": {
Expand Down Expand Up @@ -141,6 +148,7 @@
"infdisc": 0,
"dtile": 0,
"num": 5,
"num_expanded_galaxy": 6,
"description": "You may upgrade your Ship Blueprints with Plasma Cannon Ship Parts. During the Combat Phase, Plasma Cannons deal 2 hits to a single target if 1) the orange die rolls a Direct Hit, or 2) if the orange die result + total Computers - total Shields of the target ship = 6 or greater. Each Plasma Cannon requires 2 Energy."
},
"phs": {
Expand All @@ -153,6 +161,7 @@
"infdisc": 0,
"dtile": 0,
"num": 5,
"num_expanded_galaxy": 6,
"description": "You may upgrade your Ship Blueprints with Phase Shield Ship Parts. Reduces die rolls against this ship by 2, with no effect on Direct Hits. Each Phase Shield requires 1 Energy."
},
"phsmod": {
Expand All @@ -165,6 +174,7 @@
"infdisc": 0,
"dtile": 0,
"num": 5,
"num_expanded_galaxy": 6,
"description": "You may upgrade your Ship Blueprints with modded Phase Shield Ship Parts. Reduces die rolls against this ship by 2, with no effect on Direct Hits. Each Phase Shield requires 1 Energy but also increases initiative by 1."
},
"adm": {
Expand All @@ -177,6 +187,7 @@
"infdisc": 0,
"dtile": 0,
"num": 4,
"num_expanded_galaxy": 5,
"description": "You may place Population Cubes in Advanced Materials (Brown) or Neutral (White) Population Squares with your Colony Ships. Advanced Population Squares are indicated by a small starburst in the upper left corner."
},
"tas": {
Expand All @@ -189,6 +200,7 @@
"infdisc": 0,
"dtile": 0,
"num": 3,
"num_expanded_galaxy": 4,
"description": "You may upgrade your Ship Blueprints with Tachyon Source Ship Parts. Tachyon Source generates 9 Energy for the ship."
},
"glc": {
Expand All @@ -201,6 +213,7 @@
"infdisc": 0,
"dtile": 0,
"num": 3,
"num_expanded_galaxy": 4,
"description": "You may upgrade your Ship Blueprints with Gluon Computer Ship Parts. Gluon Computers add +3 to all non-Direct Hit (1-5) dice values rolled by this ship during the Combat Phase. Each Gluon Computer requires 2 Energy."
},
"plm": {
Expand All @@ -213,6 +226,7 @@
"infdisc": 0,
"dtile": 0,
"num": 3,
"num_expanded_galaxy": 4,
"description": "You may upgrade your Ship Blueprints with Plasma Missile Ship Parts. A Plasma Missile box rolls two dice at the beginning of Combat Phase during the Fire Missiles step. Each Plasma Missile deals 2 hits if 1) the orange die rolls a Direct Hit, or 2) if the orange die result + total Computers - total Shields of the target ship = 6 or greater. Does not fire during the Repeated Engagement Rounds. Each Plasma Missile box requires 1 Energy."
},
"nar": {
Expand All @@ -237,6 +251,7 @@
"infdisc": 0,
"dtile": 0,
"num": 5,
"num_expanded_galaxy": 6,
"description": "You may upgrade your Ship Blueprints with Fusion Drive Ship Parts. Each Fusion Drive allows ships to Move into up to 2 systems during a single Move Activation. Each Fusion Drive also adds +2 to the Ship's Initiative value during Combat; i.e., the ship also shoots faster. Each Fusion Drive requires 2 Energy."
},
"orb": {
Expand All @@ -249,6 +264,7 @@
"infdisc": 0,
"dtile": 0,
"num": 5,
"num_expanded_galaxy": 6,
"description": "You may Build Orbitals."
},
"adr": {
Expand All @@ -261,6 +277,7 @@
"infdisc": 1,
"dtile": 0,
"num": 5,
"num_expanded_galaxy": 6,
"description": "You receive 1 additional Influence Disc, placed immediately on your Influence Track."
},
"adl": {
Expand All @@ -272,7 +289,8 @@
"art_pt": 0,
"infdisc": 0,
"dtile": 0,
"num": 5,
"num": 4,
"num_expanded_galaxy": 5,
"description": "You may place Population Cubes in Advanced Science (Pink) or Neutral (White) Population Squares with your Colony Ships. Advanced Population Squares are indicated by a small starburst in the upper left corner."
},
"mon": {
Expand All @@ -285,6 +303,7 @@
"infdisc": 0,
"dtile": 0,
"num": 3,
"num_expanded_galaxy": 4,
"description": "You may Build Monoliths."
},
"wog": {
Expand All @@ -297,6 +316,7 @@
"infdisc": 0,
"dtile": 0,
"num": 3,
"num_expanded_galaxy": 4,
"description": "You may Explore, Move to, and Influence adjacent Sectors if the edges connecting the Sectors contain 1 Wormhole."
},
"ark": {
Expand Down
1 change: 1 addition & 0 deletions helpers/DrawHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1635,6 +1635,7 @@ def get_public_points(self, player, showPrivateRegardless:bool):
points -= 1
if "per rep" in reputation:
countRep = True
points -= 1
if countAmb:
points += ambass
if countRep:
Expand Down
29 changes: 27 additions & 2 deletions helpers/GamestateHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -996,9 +996,9 @@ def setup_finished(self):
self.gamestate["setup_finished"] = 1
self.update()

def setup_techs_and_outer_rim(self, count: int, galactic_events ,hyperlane):
def setup_techs_and_outer_rim(self, count: int, galactic_events, hyperlane):
self.gamestate["player_count"] = count
draw_count = {2: [5, 12], 3: [8, 14], 4: [14, 16], 5: [16, 18], 6: [18, 20],7:[22,22],8:[24,24],9:[24,26]}
draw_count = {2: [5, 12], 3: [8, 14], 4: [14, 16], 5: [16, 18], 6: [18, 20], 7: [22, 22], 8: [24, 24], 9: [24, 26]}

third_sector_tiles = ["301", "302", "303", "304", "305", "306", "307", "308", "309", "310", "311", "312", "313",
"314", "315", "316", "317", "318", "381", "382", "398", "397", "399", "396", "394", "393"]
Expand All @@ -1017,6 +1017,27 @@ def setup_techs_and_outer_rim(self, count: int, galactic_events ,hyperlane):
with open("data/techs.json", "r") as f:
tech_data = json.load(f)

expanded_galaxy = count > 6
rift_cannon = self.gamestate.get("rift_cannon", True)
community_parts = self.gamestate.get("community_parts", False)
excluded_techs = set()
if not rift_cannon:
excluded_techs.add("rican")
if community_parts:
excluded_techs.update({"imh", "phs"})
else:
excluded_techs.update({"imhmod", "phsmod"})

for tech_id, tech_info in tech_data.items():
if tech_id in excluded_techs:
continue
if expanded_galaxy and "num_expanded_galaxy" in tech_info:
tile_count = tech_info["num_expanded_galaxy"]
else:
tile_count = tech_info["num"]
for _ in range(tile_count):
self.gamestate["tech_deck"].append(tech_id)

while sector_draws > 0:
random.shuffle(third_sector_tiles)
self.gamestate["tile_deck_300"].append(third_sector_tiles.pop(0))
Expand All @@ -1033,6 +1054,10 @@ def setup_techs_and_outer_rim(self, count: int, galactic_events ,hyperlane):
pass
else:
tech_draws -= 1

if expanded_galaxy:
self.gamestate["reputation_tiles"].extend([4, 4, 3, 3, 3, 2, 2, 1, 1])

minorDraws = 4
minor_species = ["Cruiser Discount", "Dreadnought Discount", "Monolith Discount", "Orbital Discount",
"Tech Discount", "Population Cube",
Expand Down
Loading
Loading