Dev pour la beta 1.4
* Changements de la texture des cristaux de Talion dans tous les assets 3D pour correspondre aux assets 2D * Ajout d'un évenement en fin de région, une résurgence de Talion qui décontamine et fait looter les plantes mature aux alentours * Ajout d'un path finding sur le mouvement du robot * Modification du flow des actions à la souris : ajout d'un nouveau son, d'un icône à l'emplacement de l'action * Modification du nombre et de l'ordre de mutation débloquées * Augmentation de la valeur maximale de zoom * Modification des scores à atteindre dans les premières régions * Modification de l'interface du vaisseau, laissant apparaitre une roadmap plus claire, et laissant inspecter l'inventaire actuel * Modification de l'icône d'action dans les scènes 3D * Augmentation de la zone d'écart entre les plantes, et augmentation du taux de zone fertile en conséquence * La station de recharge devient inutilisable après la fin de la région * Ajout d'une transparence lors de la sélection d'objets derrières d'autres objets * Les plantes juvéniles donneront toujours une graine si coupées * Ajout d'un bouclage sur les couleurs des mutations * Fix des hitbox des plantes pour l'inspection à la souris * Fix de plusieurs bugs sur la manipulation de l'inventaire * Ajout de nombreux screenshots d'utilisation des outils lors du tutoriel * Amélioration mineure de la traduction/wording
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
extends InspectableEntity
|
||||
class_name Plant
|
||||
|
||||
const PLANT_AREA_RADIUS = 20
|
||||
const PLANT_AREA_RADIUS = 40
|
||||
const PLANT_GROWING_AREA_HEIGHT = 70
|
||||
const PLANT_MATURE_AREA_HEIGHT = 150
|
||||
const HARVESTED_SEED_DISPLACEMENT_FACTOR = 100
|
||||
|
||||
const RANDOM_MAX_GROW_INTERVAL = Region.MIN_PASS_DAY_ANIMATION_TIME/2. - 0.1
|
||||
@@ -22,6 +24,7 @@ const SPRITE_SCENE : PackedScene = preload("res://entities/plants/plant_sprite.t
|
||||
@onready var influence_zone : PlantInfluenceZone
|
||||
|
||||
var harvested = false
|
||||
var last_state : PlantData.State
|
||||
|
||||
func _init(
|
||||
_data : PlantData
|
||||
@@ -30,7 +33,7 @@ func _init(
|
||||
|
||||
func _ready():
|
||||
plant_sprite = generate_sprite()
|
||||
collision_shape = generate_collision_shape()
|
||||
generate_collision_shape()
|
||||
influence_zone = generate_influence_zone()
|
||||
|
||||
plant_sprite.setup_plant_sprite(data)
|
||||
@@ -53,9 +56,6 @@ func inspect(is_inspected : bool = true):
|
||||
plant_sprite.display_lifetime_sprite = is_inspected
|
||||
influence_zone.show_influence = is_inspected
|
||||
|
||||
func affect_preview(is_affected : bool = true):
|
||||
plant_sprite.sprite_modulate = MODULATE_AFFECTED_COLOR if is_affected else default_modulate
|
||||
|
||||
func generate_sprite() -> PlantSprite:
|
||||
var sprite_object : PlantSprite = SPRITE_SCENE.instantiate()
|
||||
|
||||
@@ -64,15 +64,28 @@ func generate_sprite() -> PlantSprite:
|
||||
|
||||
return sprite_object
|
||||
|
||||
func generate_collision_shape() -> CollisionShape2D:
|
||||
var collision = CollisionShape2D.new()
|
||||
var shape = CircleShape2D.new()
|
||||
func generate_collision_shape():
|
||||
if collision_shape:
|
||||
collision_shape.queue_free()
|
||||
|
||||
collision_shape = CollisionShape2D.new()
|
||||
var shape = CapsuleShape2D.new()
|
||||
shape.radius = PLANT_AREA_RADIUS
|
||||
|
||||
collision.shape = shape
|
||||
add_child(collision)
|
||||
var height = PLANT_AREA_RADIUS
|
||||
|
||||
return collision
|
||||
match data.get_state():
|
||||
PlantData.State.GROWING:
|
||||
height = PLANT_GROWING_AREA_HEIGHT
|
||||
PlantData.State.MATURE:
|
||||
height = PLANT_MATURE_AREA_HEIGHT
|
||||
|
||||
shape.height = height
|
||||
|
||||
collision_shape.shape = shape
|
||||
|
||||
collision_shape.position.y -= height / 5.
|
||||
add_child(collision_shape)
|
||||
|
||||
func generate_influence_zone() -> PlantInfluenceZone:
|
||||
var zone = PlantInfluenceZone.new(data.get_influence_radius())
|
||||
@@ -85,13 +98,14 @@ func generate_influence_zone() -> PlantInfluenceZone:
|
||||
func _pass_day():
|
||||
await get_tree().create_timer(randf_range(0., RANDOM_MAX_GROW_INTERVAL)).timeout
|
||||
|
||||
var last_state = data.get_state()
|
||||
last_state = data.get_state()
|
||||
|
||||
data.day += 1
|
||||
|
||||
for m in data.mutations:
|
||||
m._start_day_effect(self)
|
||||
|
||||
func _end_pass_day():
|
||||
match data.get_state():
|
||||
PlantData.State.MATURE:
|
||||
if last_state != PlantData.State.MATURE:
|
||||
@@ -99,7 +113,7 @@ func _pass_day():
|
||||
PlantData.State.DEAD:
|
||||
die()
|
||||
|
||||
|
||||
generate_collision_shape()
|
||||
plant_sprite.update_plant_sprite(data, last_state != data.get_state())
|
||||
|
||||
|
||||
@@ -110,7 +124,7 @@ func calculate_plant_score(
|
||||
|
||||
func harvest():
|
||||
for i in range(data.get_seed_number()):
|
||||
produce_seed()
|
||||
await produce_seed()
|
||||
|
||||
if data.get_state() == PlantData.State.MATURE:
|
||||
for m in data.mutations:
|
||||
@@ -128,6 +142,7 @@ func produce_seed():
|
||||
global_position,
|
||||
HARVESTED_SEED_DISPLACEMENT_FACTOR,
|
||||
)
|
||||
await plant_sprite.play_bump_animation()
|
||||
|
||||
func mature():
|
||||
for m in data.mutations:
|
||||
@@ -137,7 +152,8 @@ func die():
|
||||
for m in data.mutations:
|
||||
m._start_dead_effect(self)
|
||||
for i in range(data.get_seed_number()):
|
||||
produce_seed()
|
||||
await produce_seed()
|
||||
AudioManager.play_sfx("Harvest")
|
||||
disappear()
|
||||
|
||||
func disappear():
|
||||
|
||||
@@ -96,7 +96,7 @@ func is_mature() -> bool:
|
||||
return get_state() == State.MATURE
|
||||
|
||||
func get_seed_number(state = get_state()):
|
||||
var seed_number = get_plant_info().get_seed_number() if (state == State.MATURE or state == State.DEAD) else 0
|
||||
var seed_number = get_plant_info().get_seed_number() if (state == State.MATURE or state == State.DEAD) else 1
|
||||
|
||||
for m in mutations:
|
||||
seed_number = m.mutate_seed_number(self , seed_number)
|
||||
|
||||
@@ -124,4 +124,4 @@ static func get_rarity_color(rarity: int) -> Color:
|
||||
Color("FFA617"),
|
||||
]
|
||||
|
||||
return rarity_colors[min(rarity, len(rarity_colors) - 1)%len(rarity_colors)]
|
||||
return rarity_colors[rarity%len(rarity_colors)]
|
||||
@@ -23,4 +23,4 @@ func _start_maturation_effect(plant : Plant):
|
||||
|
||||
|
||||
func get_purification_radius() -> int:
|
||||
return level * 2
|
||||
return level
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
extends Node2D
|
||||
extends Area2D
|
||||
class_name PlantSprite
|
||||
|
||||
const PLANTED_SEED_CROP_WIDTH = 50
|
||||
@@ -64,6 +64,13 @@ func set_sprite_modulate(c := sprite_modulate):
|
||||
if is_node_ready():
|
||||
%Sprite.modulate = c
|
||||
|
||||
func affect_preview(is_affected : bool = true):
|
||||
sprite_modulate = InspectableEntity.MODULATE_AFFECTED_COLOR if is_affected else Color.WHITE
|
||||
|
||||
func _on_body_entered(body: Node2D) -> void:
|
||||
if body is Player && $AnimationPlayer.current_animation != "player_move":
|
||||
$AnimationPlayer.play("player_move");
|
||||
|
||||
func play_bump_animation():
|
||||
%AnimationPlayer.play("bump")
|
||||
await %AnimationPlayer.animation_finished
|
||||
Reference in New Issue
Block a user