diff options
| author | J08nY | 2017-04-25 01:04:37 +0200 |
|---|---|---|
| committer | J08nY | 2017-04-25 01:04:37 +0200 |
| commit | 379c2794c40bc2b212d29fa0e0847f76e3f3a870 (patch) | |
| tree | b00311bbbc2784981dd92b1e161c414c823bbe86 /scripts/template_combine.gd | |
| parent | 146b302545b8cda8df456d105ac30ee961365056 (diff) | |
| download | ld38-379c2794c40bc2b212d29fa0e0847f76e3f3a870.tar.gz ld38-379c2794c40bc2b212d29fa0e0847f76e3f3a870.tar.zst ld38-379c2794c40bc2b212d29fa0e0847f76e3f3a870.zip | |
Diffstat (limited to 'scripts/template_combine.gd')
| -rw-r--r-- | scripts/template_combine.gd | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/scripts/template_combine.gd b/scripts/template_combine.gd index 2195e8a..7df3b69 100644 --- a/scripts/template_combine.gd +++ b/scripts/template_combine.gd @@ -6,8 +6,28 @@ func _init().("res://assets/combinator.json"): self.bases = self.data["bases"] func template(world): - var base = self.bases[randi() % self.bases.size()] - var d = Dictionary(self.data) + var base = str(self.bases[randi() % self.bases.size()]) + var d = {} d["mass"] = str(world.mass) + " sextillion tons" - d["volume"] = str(world.volume) - return self.replace_all(base, self.data) + d["volume"] = str(world.volume) + " trillion cubic metres" + if (world.gas_mass > world.mass): + d["type"] = "gaseous" + d["type_comment"] = self.data["type_comment"]["gaseous"] + else: + d["type"] = "solid" + d["type_comment"] = self.data["type_comment"]["solid"] + + if world.total_mass < 0.3: + d["mass_comment"] = self.data["mass_comment"]["very_small"] + elif world.total_mass < 0.5: + d["mass_comment"] = self.data["mass_comment"]["small"] + elif world.total_mass < 2: + d["mass_comment"] = self.data["mass_comment"]["medium"] + elif world.total_mass < 8: + d["mass_comment"] = self.data["mass_comment"]["big"] + elif world.total_mass < 20: + d["mass_comment"] = self.data["mass_comment"]["huge"] + else: + d["mass_comment"] = self.data["mass_comment"]["yuge"] + + return self.replace_all(base, d) |
