Add planet scanner and octopus biome
This commit is contained in:
parent
2ecd61de98
commit
8fbcc340ce
21 changed files with 784 additions and 30 deletions
|
|
@ -4,8 +4,9 @@ extends SceneTree
|
|||
# point loop. This test drives the real landed surface and encounter nodes.
|
||||
#
|
||||
# Covers:
|
||||
# A. the planet/profile are registered, dev mode plants it nearby, and its
|
||||
# scripted profile is excluded from the map editor
|
||||
# A. the planet/profile are registered, dev mode plants it nearby, normal
|
||||
# generation owns exactly one inside its octopus biome, and its scripted
|
||||
# profile is excluded from the map editor
|
||||
# B. landing composes BossEncounter instead of a PlanetSetup and does not
|
||||
# mark the world conquered for free
|
||||
# C. the off-screen approach remains controllable and reveals with its own cue
|
||||
|
|
@ -86,20 +87,20 @@ func _process(delta: float) -> bool:
|
|||
!= PlanetDefinitions.BOSS_ID:
|
||||
return _fail("dev mode does not plant the boss planet")
|
||||
state.dev_mode = false
|
||||
var normal_boss_found: bool = false
|
||||
var normal_boss_count: int = 0
|
||||
for x in range(-24, 25):
|
||||
for y in range(-24, 25):
|
||||
var chunk := Vector2i(x, y)
|
||||
if WorldGen.has_planet_at_chunk(chunk) \
|
||||
and String(WorldGen.planet_data_at_chunk(chunk).get(
|
||||
"definition_id", "")) == PlanetDefinitions.BOSS_ID:
|
||||
normal_boss_found = true
|
||||
break
|
||||
if normal_boss_found:
|
||||
break
|
||||
if not normal_boss_found:
|
||||
return _fail("normal world generation never produces the boss planet")
|
||||
print("boss planet registered, editor-hidden, and generated normally plus in dev mode")
|
||||
normal_boss_count += 1
|
||||
if normal_boss_count != 1 \
|
||||
or WorldGen.biome_at_chunk(WorldGen.OCTOPUS_BIOME_CENTER) \
|
||||
!= WorldGen.Biome.OCTOPUS:
|
||||
return _fail("normal world generation has %d bosses, or its only boss is outside the octopus biome" \
|
||||
% normal_boss_count)
|
||||
print("boss planet registered, editor-hidden, unique in its normal octopus biome, plus nearby in dev mode")
|
||||
|
||||
# --- B. generic surface composition ---------------------------
|
||||
encounter = surface.get_node_or_null("SurfaceFeatures/BossEncounter")
|
||||
|
|
|
|||
Loading…
Reference in a new issue