ajout de la plante pili #55
This commit is contained in:
@@ -56,10 +56,11 @@ func generate_collision_shape() -> CollisionShape2D:
|
||||
# Méthode déclenchée par la classe planet
|
||||
func _pass_day():
|
||||
await get_tree().create_timer(randf_range(0., RANDOM_MAX_GROW_INTERVAL)).timeout
|
||||
day += 1
|
||||
|
||||
|
||||
if state == State.MATURE and plant_type.cyclic_effect:
|
||||
plant_type.cyclic_effect.effect(self)
|
||||
|
||||
day += 1
|
||||
|
||||
func set_day(d):
|
||||
day = d
|
||||
|
||||
@@ -1,10 +1,18 @@
|
||||
extends PlantEffect
|
||||
class_name DecontaminateTerrainEffect
|
||||
|
||||
@export var impact_radius = 50
|
||||
@export var impact_radius = 100
|
||||
@export var improve_by_lifetime := false
|
||||
@export var improve_by_lifetime_value := 20
|
||||
|
||||
func effect(plant):
|
||||
|
||||
var radius = impact_radius
|
||||
|
||||
if improve_by_lifetime:
|
||||
radius += improve_by_lifetime_value * plant.day
|
||||
|
||||
plant.planet.impact_contamination(
|
||||
plant.global_position,
|
||||
impact_radius
|
||||
radius
|
||||
)
|
||||
Reference in New Issue
Block a user