divers changements pour la sortie du second proto
* ajout du panneau solaire #54 * ajout d'un tutoriel #53 * equilibrage du jeu #73 * ajout d'un son pour l'annonce
This commit is contained in:
@@ -5,17 +5,14 @@ var containing_seed : int = 0
|
||||
|
||||
func get_seed_needed(l : int = level) -> int:
|
||||
match l:
|
||||
1: return 3
|
||||
2: return 2
|
||||
3: return 2
|
||||
_: return 1
|
||||
|
||||
func get_energy_production(l : int = level) -> int:
|
||||
match l:
|
||||
1: return 1
|
||||
2: return 1
|
||||
1: return 5
|
||||
2: return 4
|
||||
3: return 3
|
||||
_: return 2
|
||||
|
||||
func setup_machine_sprite():
|
||||
%Sprite.self_modulate = Machine.get_level_color(level)
|
||||
|
||||
func _process(_delta):
|
||||
%ProgressBar.value = lerp(%ProgressBar.value, float(containing_seed) / float(get_seed_needed()) * 100, 0.5)
|
||||
|
||||
@@ -35,7 +32,10 @@ func interact(p : Player) -> bool:
|
||||
if containing_seed >= get_seed_needed():
|
||||
$AnimationPlayer.play("empty")
|
||||
containing_seed = 0
|
||||
p.recharge(get_energy_production())
|
||||
product(p)
|
||||
else:
|
||||
$AnimationPlayer.play("fill")
|
||||
return true
|
||||
|
||||
func product(player : Player):
|
||||
pass
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
extends Compost
|
||||
class_name EnergyCompost
|
||||
|
||||
func get_energy_production(l : int = level) -> int:
|
||||
match l:
|
||||
1: return 1
|
||||
2: return 1
|
||||
3: return 1
|
||||
_: return 1
|
||||
|
||||
func product(player : Player):
|
||||
player.recharge(get_energy_production())
|
||||
@@ -0,0 +1 @@
|
||||
uid://bw2ckthka71y8
|
||||
@@ -0,0 +1,17 @@
|
||||
extends Compost
|
||||
class_name SeedCompost
|
||||
|
||||
func get_seeds_production(l : int = level) -> int:
|
||||
match l:
|
||||
1: return 2
|
||||
2: return 2
|
||||
3: return 2
|
||||
_: return 1
|
||||
|
||||
func product(player : Player):
|
||||
for i in range(get_seeds_production()):
|
||||
player.planet.drop_item(
|
||||
Seed.new(GameInfo.game_data.unlocked_plant_types.pick_random()),
|
||||
global_position,
|
||||
100
|
||||
)
|
||||
@@ -0,0 +1 @@
|
||||
uid://d0yt8pd41j2os
|
||||
Reference in New Issue
Block a user