Skip to content

Commit

Permalink
Add Leader attribute data
Browse files Browse the repository at this point in the history
  • Loading branch information
iamlogand committed Feb 12, 2024
1 parent 3f4b4c0 commit 278d612
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 22 deletions.
2 changes: 1 addition & 1 deletion backend/rorapp/admin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
from .title import TitleAdmin # noqa: F401
from .turn import TurnAdmin # noqa: F401
from .waitlist_entry import WaitlistEntryAdmin # noqa: F401
from .war import WarAdmin # noqa: F401
from .war import WarAdmin # noqa: F401
12 changes: 7 additions & 5 deletions backend/rorapp/functions/game_starter.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,6 @@ def create_situations_and_secrets(
secret.save()
secrets.append(secret)
situations = list(secret_situations)
situations += [
Situation(name=name, type=data["type"], secret=False, game=game, index=0)
for name, data in situations_dict.items()
if data["type"] == "leader"
]
wars_json_path = os.path.join(settings.BASE_DIR, "rorapp", "presets", "war.json")
with open(wars_json_path, "r") as file:
wars_dict = json.load(file)
Expand All @@ -305,6 +300,13 @@ def create_situations_and_secrets(
for title in wars_dict.keys()
if title != "Punic 1"
]
leaders_json_path = os.path.join(settings.BASE_DIR, "rorapp", "presets", "leader.json")
with open(leaders_json_path, "r") as file:
leaders_dict = json.load(file)
situations += [
Situation(name=name, type="leader", secret=False, game=game, index=0)
for name in leaders_dict.keys()
]
situations += [
Situation(name=name, type="senator", secret=False, game=game, index=0)
for name in unassigned_senator_names
Expand Down
22 changes: 22 additions & 0 deletions backend/rorapp/presets/leader.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"Hamilcar": {
"strength": 3,
"disaster_number": 8,
"standoff_number": 12
},
"Hannibal": {
"strength": 7,
"disaster_number": 9,
"standoff_number": 16
},
"Antiochus III": {
"strength": 5,
"disaster_number": 14,
"standoff_number": 17
},
"Philip V": {
"strength": 6,
"disaster_number": 15,
"standoff_number": 14
}
}
16 changes: 0 additions & 16 deletions backend/rorapp/presets/situation.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
{
"Hamilcar": {
"scenario": 1,
"type": "leader"
},
"Hannibal": {
"scenario": 1,
"type": "leader"
},
"Antiochus III": {
"scenario": 1,
"type": "leader"
},
"Philip V": {
"scenario": 1,
"type": "leader"
},
"Tribune": {
"scenario": 1,
"type": "intrigue",
Expand Down

0 comments on commit 278d612

Please sign in to comment.