summaryrefslogtreecommitdiff
path: root/scripts/template_combine.gd
blob: 2195e8aca8f89d62f434d88cdff196e9d2376104 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
extends "res://scripts/template.gd"

var bases = null

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)
  d["mass"] = str(world.mass) + " sextillion tons"
  d["volume"] = str(world.volume)
  return self.replace_all(base, self.data)