Add gas giant resource system

This commit is contained in:
Loïc Wisniewski 2026-08-13 21:07:35 +02:00
commit fc68c4e8cf
9 changed files with 180 additions and 10 deletions

View file

@ -643,7 +643,7 @@ func _show_building_info(type: String) -> void:
lines.append("%s already has an extractor." % planet.planet_name)
can_build = false
else:
lines.append("Will mine %s." % planet.planet_name)
lines.append("Will mine %s from %s." % ["gas" if planet.resource_type == "gas" else "ore", planet.planet_name])
elif can_build and type == GameState.BUILDING_MOTHERSHIP and GameState.has_mothership():
lines.append("WARNING: only one may exist - this destroys your current one.")
@ -685,7 +685,7 @@ func _confirm_build() -> void:
if not GameState.spend(GameState.EXTRACTOR_COST):
build_status.text = "Not enough rocks (need %d, have %d)" % [GameState.EXTRACTOR_COST, GameState.rocks]
return
GameState.add_extractor(planet.planet_name, planet.position)
GameState.add_extractor(planet.planet_name, planet.position, planet.resource_type)
build_menu.visible = false
return