31 lines
1.6 KiB
GDScript
31 lines
1.6 KiB
GDScript
|
|
extends RefCounted
|
||
|
|
const E = preload("res://world/owniverse/math/exact.gd")
|
||
|
|
|
||
|
|
static func seed(world, global, fragmented: bool = false, large: bool = false, stable: bool = false):
|
||
|
|
for id in world.catalog.entities:
|
||
|
|
world.state.amount[id] = 0
|
||
|
|
world.state.stats.total_amount[id] = 0
|
||
|
|
var entity = world.catalog.entities[id]
|
||
|
|
if entity.group_as != "":
|
||
|
|
world.state.amount[entity.group_as] = 0
|
||
|
|
world.state.stats.total_amount[entity.group_as] = 0
|
||
|
|
for id in ["RD", "BG", "TWD", "SNS", "MGT", "BH25", "SMBH", "SCD", "GEM", "LGG", "LSC", "LGF", "LGW", "LUB"]:
|
||
|
|
world.state.amount[id] = E.of("1e48")
|
||
|
|
world.state.amount.S = E.of("1e50")
|
||
|
|
world.state.amount.H = E.of("1e48")
|
||
|
|
world.state.binds.RD = {"HP": E.of("1e30"), "RP": E.of("1e30"), "GG": E.of("1e30"), "AB": E.of("1e30")}
|
||
|
|
var count = E.of("6e20") if large else 6000
|
||
|
|
for id in global.CivilizationRules:
|
||
|
|
if E.le(global.CivilizationRules[id].span, 0): continue
|
||
|
|
world.state.amount[id] = count
|
||
|
|
world.state.ethics[id] = {}
|
||
|
|
for ethic in ["m", "l", "w", "d", "c", "b"]:
|
||
|
|
world.state.ethics[id][ethic] = E.divide(count, 6)
|
||
|
|
world.state.batches[id] = []
|
||
|
|
var parties: int = 10 if fragmented else 1
|
||
|
|
for i in parties:
|
||
|
|
var lifespan = E.of(global.CivilizationRules[id].span) if stable else 1
|
||
|
|
world.state.batches[id].append({"amount": E.divide(count, parties), "created_from": i * 100, "created_to": 1000 + i * 100, "start_year": E.add(lifespan, i * 100), "end_year": E.add(lifespan, 1000 + i * 100)})
|
||
|
|
world.ledger.refresh_groups(world.state)
|
||
|
|
world.speed = 6
|