correct pass_day method name

This commit is contained in:
2025-08-20 10:34:39 +02:00
parent 3021567ecb
commit 352c49cefa
4 changed files with 16 additions and 28 deletions

View File

@@ -2,7 +2,9 @@ extends Terrain
class_name Planet
signal planet_updated(planet : Planet)
signal day_limit_exceed
const DAY_LIMIT : int = 3
const PLANET_TEXTURE_SCALE : float = 5.0
@export_group("Loot")
@@ -23,7 +25,7 @@ const PLANET_TEXTURE_SCALE : float = 5.0
planet_updated.emit(self)
var contamination_texture : ImageTexture
var day : int = 0 :
var day : int = 1 :
set(v):
day = v
planet_updated.emit(self)
@@ -113,12 +115,14 @@ func is_there_contamination(point : Vector2) -> bool:
return terrainData.get_contamination(point) < 0.5
func pass_day():
for e : Node2D in entityContainer.get_children():
if e.has_method("pass_day"):
e.pass_day()
day += 1
generate_loot()
if day > DAY_LIMIT:
day_limit_exceed.emit()
else:
for e : Node2D in entityContainer.get_children():
if e.has_method("_pass_day"):
e._pass_day()
generate_loot()
func generate_loot(number : int = loot_number.pick_random()):
for i in range(number):