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/builder.gd | |
| parent | 146b302545b8cda8df456d105ac30ee961365056 (diff) | |
| download | ld38-379c2794c40bc2b212d29fa0e0847f76e3f3a870.tar.gz ld38-379c2794c40bc2b212d29fa0e0847f76e3f3a870.tar.zst ld38-379c2794c40bc2b212d29fa0e0847f76e3f3a870.zip | |
Diffstat (limited to 'scripts/builder.gd')
| -rw-r--r-- | scripts/builder.gd | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/builder.gd b/scripts/builder.gd index 74b8aaf..a37221a 100644 --- a/scripts/builder.gd +++ b/scripts/builder.gd @@ -33,13 +33,14 @@ func combine(where, materials): var gas_mass = 0 var gas_volume = 0 var gas_color = Color(0.5,0.5,0.6,0.4) + var cost = 0 for mat in materials: var item = self.items.get(mat) var category = self.items.category(mat) if category == "solid": mass += item.data["mass"] - #volume += item.data["volume"] + volume += item.data["volume"] var s = item.data["color"] color = color.blend(Color(s)) @@ -48,6 +49,7 @@ func combine(where, materials): gas_volume += item.data["volume"] var s = item.data["color"] gas_color = gas_color.blend(Color(s)) + cost += item.data["cost"] w.materials = materials w.mass = mass @@ -56,5 +58,8 @@ func combine(where, materials): w.gas_mass = gas_mass w.gas_volume = gas_volume w.gas_color = gas_color + w.total_mass = mass + gas_mass + w.total_volume = volume + gas_volume + w.cost = cost w.call_deferred("build") return w |
