ajout du camion #87

* changements des objectifs, donnent juste des graines, sprite moins gros et objectifs plus nombreux
* changement de la probabilité de mutation
* refactor du code terrain et planet
This commit is contained in:
2025-10-12 19:59:53 +02:00
parent ef392595de
commit d90d4c5df6
52 changed files with 627 additions and 346 deletions

View File

@@ -5,14 +5,7 @@ const RANDOM_MAX_OBJECTIVE_INTERVAL = 1.
const DECONTAMINATION_ICON = preload("res://common/icons/skull.svg")
var completed : bool = false
var planet : Planet
@export var reward : ObjectiveReward = null :
set(r):
reward = r
update_reward_info(r)
func _ready():
update_reward_info(reward)
@export var reward : ObjectiveReward = null
func pointer_text():
return "Contamination Objective"
@@ -20,7 +13,7 @@ func pointer_text():
func inspector_info() -> Inspector.Info:
var info : Inspector.Info = Inspector.Info.new(
pointer_text(),
"This dead log can hide a treasure of life."
"This dead branch can hide a treasure of life."
)
info.framed_infos.append(
@@ -40,9 +33,3 @@ func _end_pass_day():
%AnimationPlayer.play("activate")
%RewardInfo.visible = false
completed = true
func update_reward_info(r : ObjectiveReward):
if r:
%RewardText.text = r.get_text()
%RewardIcon.texture = r.get_icon()
%RewardInfo.visible = r != null

View File

@@ -7,7 +7,8 @@ func _init(_day_limit_increase : int):
day_limit_increase = _day_limit_increase
func reward(objective : Objective):
objective.planet.day_limit += day_limit_increase
if objective.planet:
objective.planet.day_limit += day_limit_increase
func get_icon() -> Texture:
return preload("res://common/icons/hourglass-empty.svg")

View File

@@ -18,7 +18,7 @@ func get_description() -> String:
return "Loot the following item: " + item.name + "."
func reward(objective : Objective):
objective.planet.drop_item(
objective.terrain.drop_item(
item,
objective.global_position,
REWARD_ITEM_RANDOM_DISPLACEMENT_FACTOR

View File

@@ -19,7 +19,7 @@ func get_description() -> String:
func reward(objective : Objective):
for i in range(seeds_number):
objective.planet.drop_item(
objective.terrain.drop_item(
Seed.new(GameInfo.game_data.unlocked_plant_types.pick_random()),
objective.global_position,
REWARD_SEED_RANDOM_DISPLACEMENT_FACTOR

View File

@@ -7,7 +7,7 @@ func _init(_recharge_amount : int = 1):
recharge_amount = _recharge_amount
func reward(objective : Objective):
objective.planet.player.recharge(recharge_amount)
objective.terrain.player.recharge(recharge_amount)
func get_icon() -> Texture:
return preload("res://common/icons/bolt.svg")

View File

@@ -7,7 +7,7 @@ func _init(_upgrade_amount : int = 1):
upgrade_amount = _upgrade_amount
func reward(objective : Objective):
objective.planet.player.upgrade_max_energy(upgrade_amount)
objective.terrain.player.upgrade_max_energy(upgrade_amount)
func get_icon() -> Texture:
return preload("res://common/icons/bolt.svg")

View File

@@ -7,7 +7,7 @@ func _init(_upgrade_amount : int = 1):
upgrade_amount = _upgrade_amount
func reward(objective : Objective):
objective.planet.player.upgrade_inventory_size(upgrade_amount)
objective.terrain.player.upgrade_inventory_size(upgrade_amount)
func get_icon() -> Texture:
return preload("res://common/icons/backpack.svg")