Skip to content

Commit

Permalink
Added calculation of cost based on progressive technology tier
Browse files Browse the repository at this point in the history
Also made it so that progressive techs can't be researched by AI
  • Loading branch information
DestinyPlayer committed Oct 7, 2024
1 parent 6e454a5 commit 99b653c
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 29 deletions.
5 changes: 3 additions & 2 deletions worlds/stellaris/CreateTechs.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ def createTech():
tier = tech["tier"]
category = tech["category"]
for i in range(tech["levels"]):
cost = techProgCost
if str(i+1) in tech["non_research"]:
cost = techProgCost
cost = cost + "0"
weight = 0
weight_null = weightNull
else:
cost = tech["cost"]
cost = cost + str(tech["tier"]+i)
weight = tech["weight"]
weight_null = ""
techText = techText + techTemplate.format(type = type, num = i+1, area = area, category = category, cost = cost,
Expand Down
6 changes: 5 additions & 1 deletion worlds/stellaris/Generate.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import shutil

from . import CreateEvents, CreateTechs, Utility

def generateMod():
Expand All @@ -8,4 +10,6 @@ def generateMod():
CreateEvents.createEvents()
CreateEvents.createEventLocalisations()

Utility.copyOtherLocalisationFiles("archipelago_events_l_english.yml")
Utility.copyOtherLocalisationFiles("archipelago_events_l_english.yml")

#shutil.copytree("worlds/stellaris/mod","output/mod")
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
@progressive_cost = 9999999
@progressive_cost_0 = 9999999
@progressive_cost_1 = 1000
@progressive_cost_2 = 4000
@progressive_cost_3 = 10000
@progressive_cost_4 = 24000
@progressive_cost_5 = 40000

tech_progressive_reactor_1 = {
cost = @progressive_cost
cost = @progressive_cost_0
area = physics
is_rare = yes
potential = {
is_ai = no
}
tier = 1
category = { particles }
weight = 0
Expand All @@ -13,18 +21,24 @@ tech_progressive_reactor_1 = {
}

tech_progressive_reactor_2 = {
cost = 100
cost = @progressive_cost_2
area = physics
is_rare = yes
potential = {
is_ai = no
}
tier = 2
category = { particles }
weight = 100
}

tech_progressive_reactor_3 = {
cost = @progressive_cost
cost = @progressive_cost_0
area = physics
is_rare = yes
potential = {
is_ai = no
}
tier = 3
category = { particles }
weight = 0
Expand All @@ -34,27 +48,36 @@ tech_progressive_reactor_3 = {
}

tech_progressive_reactor_4 = {
cost = 100
cost = @progressive_cost_4
area = physics
is_rare = yes
potential = {
is_ai = no
}
tier = 4
category = { particles }
weight = 100
}

tech_progressive_reactor_5 = {
cost = 100
cost = @progressive_cost_5
area = physics
is_rare = yes
potential = {
is_ai = no
}
tier = 5
category = { particles }
weight = 100
}

tech_progressive_hyperdrive_1 = {
cost = @progressive_cost
cost = @progressive_cost_0
area = physics
is_rare = yes
potential = {
is_ai = no
}
tier = 1
category = { particles }
weight = 0
Expand All @@ -64,18 +87,24 @@ tech_progressive_hyperdrive_1 = {
}

tech_progressive_hyperdrive_2 = {
cost = 100
cost = @progressive_cost_2
area = physics
is_rare = yes
potential = {
is_ai = no
}
tier = 2
category = { particles }
weight = 100
}

tech_progressive_hyperdrive_3 = {
cost = @progressive_cost
cost = @progressive_cost_0
area = physics
is_rare = yes
potential = {
is_ai = no
}
tier = 3
category = { particles }
weight = 0
Expand All @@ -85,18 +114,24 @@ tech_progressive_hyperdrive_3 = {
}

tech_progressive_hyperdrive_4 = {
cost = 100
cost = @progressive_cost_4
area = physics
is_rare = yes
potential = {
is_ai = no
}
tier = 4
category = { particles }
weight = 100
}

tech_progressive_thruster_1 = {
cost = @progressive_cost
cost = @progressive_cost_0
area = engineering
is_rare = yes
potential = {
is_ai = no
}
tier = 1
category = { rocketry }
weight = 0
Expand All @@ -106,18 +141,24 @@ tech_progressive_thruster_1 = {
}

tech_progressive_thruster_2 = {
cost = 100
cost = @progressive_cost_2
area = engineering
is_rare = yes
potential = {
is_ai = no
}
tier = 2
category = { rocketry }
weight = 100
}

tech_progressive_thruster_3 = {
cost = @progressive_cost
cost = @progressive_cost_0
area = engineering
is_rare = yes
potential = {
is_ai = no
}
tier = 3
category = { rocketry }
weight = 0
Expand All @@ -127,18 +168,24 @@ tech_progressive_thruster_3 = {
}

tech_progressive_thruster_4 = {
cost = 100
cost = @progressive_cost_4
area = engineering
is_rare = yes
potential = {
is_ai = no
}
tier = 4
category = { rocketry }
weight = 100
}

tech_progressive_ship_1 = {
cost = @progressive_cost
cost = @progressive_cost_0
area = engineering
is_rare = yes
potential = {
is_ai = no
}
tier = 1
category = { voidcraft }
weight = 0
Expand All @@ -148,18 +195,24 @@ tech_progressive_ship_1 = {
}

tech_progressive_ship_2 = {
cost = 100
cost = @progressive_cost_2
area = engineering
is_rare = yes
potential = {
is_ai = no
}
tier = 2
category = { voidcraft }
weight = 100
}

tech_progressive_ship_3 = {
cost = @progressive_cost
cost = @progressive_cost_0
area = engineering
is_rare = yes
potential = {
is_ai = no
}
tier = 3
category = { voidcraft }
weight = 0
Expand All @@ -169,27 +222,36 @@ tech_progressive_ship_3 = {
}

tech_progressive_ship_4 = {
cost = 100
cost = @progressive_cost_4
area = engineering
is_rare = yes
potential = {
is_ai = no
}
tier = 4
category = { voidcraft }
weight = 100
}

tech_progressive_ship_5 = {
cost = 100
cost = @progressive_cost_5
area = engineering
is_rare = yes
potential = {
is_ai = no
}
tier = 5
category = { voidcraft }
weight = 100
}

tech_progressive_starbase_1 = {
cost = @progressive_cost
cost = @progressive_cost_0
area = engineering
is_rare = yes
potential = {
is_ai = no
}
tier = 1
category = { voidcraft }
weight = 0
Expand All @@ -199,18 +261,24 @@ tech_progressive_starbase_1 = {
}

tech_progressive_starbase_2 = {
cost = 100
cost = @progressive_cost_2
area = engineering
is_rare = yes
potential = {
is_ai = no
}
tier = 2
category = { voidcraft }
weight = 100
}

tech_progressive_starbase_3 = {
cost = @progressive_cost
cost = @progressive_cost_0
area = engineering
is_rare = yes
potential = {
is_ai = no
}
tier = 3
category = { voidcraft }
weight = 0
Expand All @@ -220,18 +288,24 @@ tech_progressive_starbase_3 = {
}

tech_progressive_wormhole_1 = {
cost = 100
cost = @progressive_cost_2
area = physics
is_rare = yes
potential = {
is_ai = no
}
tier = 2
category = { particles }
weight = 200
}

tech_progressive_wormhole_2 = {
cost = @progressive_cost
cost = @progressive_cost_0
area = physics
is_rare = yes
potential = {
is_ai = no
}
tier = 3
category = { particles }
weight = 0
Expand Down
13 changes: 11 additions & 2 deletions worlds/stellaris/templates/TemplateTech.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
techStart = '@progressive_cost = 9999999\n'
techStart = '''@progressive_cost_0 = 9999999
@progressive_cost_1 = 1000
@progressive_cost_2 = 4000
@progressive_cost_3 = 10000
@progressive_cost_4 = 24000
@progressive_cost_5 = 40000
'''

techProgCost = "@progressive_cost"
techProgCost = "@progressive_cost_"

techTemplate = '''
tech_progressive_{type}_{num} = {{
cost = {cost}
area = {area}
is_rare = yes
potential = {{
is_ai = no
}}
tier = {tier}
category = {{ {category} }}
weight = {weight}{weight_null}
Expand Down

0 comments on commit 99b653c

Please sign in to comment.