ajout des mutation et refonte de l'inspecteur
* ajout des mutations #86 * changement de l'objectif #85 * refonte de l'inspecteur #71 * changement léger de la plantation * les plantes ne donnent que des graines de leurs espèces * refonte partielle du code, refacto
This commit is contained in:
@@ -59,7 +59,7 @@ class Step:
|
||||
|
||||
class TakeShovelStep extends Step:
|
||||
func generate_indicators(cam : Camera2D, p: Player) -> Array[InGameIndicator]:
|
||||
for entity in p.planet.entityContainer.get_children():
|
||||
for entity in p.planet.entity_container.get_children():
|
||||
if entity is ItemObject and entity.item is Shovel:
|
||||
var indicator = generate_indicator(cam, "Take the Shovel")
|
||||
indicator.follow_entity(entity)
|
||||
@@ -75,7 +75,7 @@ class TakeShovelStep extends Step:
|
||||
class DigLootStep extends Step:
|
||||
func generate_indicators(cam : Camera2D, p: Player) -> Array[InGameIndicator]:
|
||||
var indicators : Array[InGameIndicator] = []
|
||||
for entity in p.planet.entityContainer.get_children():
|
||||
for entity in p.planet.entity_container.get_children():
|
||||
if entity is UndergroundLoot:
|
||||
var indicator = generate_indicator(cam, "Dig Underground Loot")
|
||||
indicator.follow_entity(entity)
|
||||
@@ -85,7 +85,7 @@ class DigLootStep extends Step:
|
||||
return indicators
|
||||
|
||||
func is_step_over(p : Player) -> bool:
|
||||
for entity in p.planet.entityContainer.get_children():
|
||||
for entity in p.planet.entity_container.get_children():
|
||||
if entity is ItemObject and entity.item is Seed:
|
||||
return true
|
||||
return false
|
||||
@@ -93,7 +93,7 @@ class DigLootStep extends Step:
|
||||
class TakeSeedStep extends Step:
|
||||
func generate_indicators(cam : Camera2D, p: Player) -> Array[InGameIndicator]:
|
||||
var indicators : Array[InGameIndicator] = []
|
||||
for entity in p.planet.entityContainer.get_children():
|
||||
for entity in p.planet.entity_container.get_children():
|
||||
if entity is ItemObject and entity.item is Seed:
|
||||
var indicator = generate_indicator(cam, "Take a seed")
|
||||
indicator.follow_entity(entity)
|
||||
@@ -111,18 +111,18 @@ class TakeSeedStep extends Step:
|
||||
class PlantSeedStep extends Step:
|
||||
func generate_indicators(cam : Camera2D, p: Player) -> Array[InGameIndicator]:
|
||||
var indicator = generate_indicator(cam, "Plant the seed in decontamined zone")
|
||||
indicator.follow_game_position(Vector2(60,60) + p.planet.entityContainer.global_position)
|
||||
indicator.follow_game_position(Vector2(0,0) + p.planet.entity_container.global_position)
|
||||
return [indicator]
|
||||
|
||||
func is_step_over(p : Player) -> bool:
|
||||
for entity in p.planet.entityContainer.get_children():
|
||||
for entity in p.planet.entity_container.get_children():
|
||||
if entity is Plant:
|
||||
return true
|
||||
return false
|
||||
|
||||
class RechargeStep extends Step:
|
||||
func generate_indicators(cam : Camera2D, p: Player) -> Array[InGameIndicator]:
|
||||
for entity in p.planet.entityContainer.get_children():
|
||||
for entity in p.planet.entity_container.get_children():
|
||||
var indicator = generate_indicator(cam, "Recharge to pass days")
|
||||
indicator.follow_entity(entity)
|
||||
if entity is RechargeStation:
|
||||
@@ -140,7 +140,7 @@ class WaitMaturePlant extends Step:
|
||||
return []
|
||||
|
||||
func is_step_over(p : Player) -> bool:
|
||||
for entity in p.planet.entityContainer.get_children():
|
||||
for entity in p.planet.entity_container.get_children():
|
||||
if entity is Plant and entity.state == Plant.State.MATURE:
|
||||
return true
|
||||
return false
|
||||
@@ -151,7 +151,7 @@ class HarvestMaturePlant extends Step:
|
||||
|
||||
func generate_indicators(cam : Camera2D, p: Player) -> Array[InGameIndicator]:
|
||||
var indicators : Array[InGameIndicator] = []
|
||||
for entity in p.planet.entityContainer.get_children():
|
||||
for entity in p.planet.entity_container.get_children():
|
||||
if entity is Plant and entity.state == Plant.State.MATURE:
|
||||
var indicator = generate_indicator(cam, "Harvest mature plants with shovel")
|
||||
indicator.follow_entity(entity)
|
||||
@@ -163,7 +163,7 @@ class HarvestMaturePlant extends Step:
|
||||
|
||||
func is_step_over(p : Player) -> bool:
|
||||
var actual_mature_plant_number = 0
|
||||
for entity in p.planet.entityContainer.get_children():
|
||||
for entity in p.planet.entity_container.get_children():
|
||||
if entity is Plant and entity.state == Plant.State.MATURE:
|
||||
actual_mature_plant_number += 1
|
||||
return mature_plant_number != actual_mature_plant_number
|
||||
Reference in New Issue
Block a user