34 lines
832 B
GDScript
34 lines
832 B
GDScript
extends PlantMutation
|
|
class_name SolarMutation
|
|
|
|
# Du coup on va probablement pas la mettre celle là
|
|
|
|
func get_icon() -> Texture:
|
|
return preload("res://common/icons/alert-triangle.svg")
|
|
|
|
func get_base_rarity() -> int:
|
|
return 1
|
|
|
|
func get_mutation_id() -> String:
|
|
return "SOLAR"
|
|
|
|
func get_mutation_name() -> String:
|
|
return tr("SOLAR")
|
|
|
|
func get_mutation_description() -> String:
|
|
return tr("SOLAR_EFFECT_TEXT").format({
|
|
"bonus_chance": get_bonus_chance(),
|
|
"bonus_energy": get_bonus_energy()
|
|
})
|
|
|
|
func _start_day_effect(plant: Plant):
|
|
var rng := RandomNumberGenerator.new()
|
|
if rng.randf() < get_bonus_chance():
|
|
plant.region.player.data.energy += get_bonus_energy()
|
|
|
|
func get_bonus_chance() -> float:
|
|
return 1 / (6 - min(level, 5))
|
|
|
|
func get_bonus_energy() -> int:
|
|
return 1
|