Dev pour la béta 1
* ajout des artefacts avec la pile et l'emplacement de graine * affichage des artefacts dans le vaisseau sur une étagère * ajout des distributeurs d'artefacts dans les régions * affichage des attributs de bases de plantes dans le vaisseau * changement de l'affichage du choix des régions * changement des icônes du détecteur
This commit is contained in:
@@ -10,18 +10,15 @@ const SCORE_ICON = preload("res://common/icons/growth.svg")
|
||||
const RARITY_POOL : Array[int] = [0,0,0,0,0,0,0,1,1,1]
|
||||
|
||||
@export var plant_name : String
|
||||
@export var plant_archetype: PlantArchetype
|
||||
@export var plant_mutations: Array[PlantMutation]
|
||||
@export var random_seed : int
|
||||
var stored_icon : Texture
|
||||
|
||||
func _init(
|
||||
_plant_name : String = "",
|
||||
_plant_archetype : PlantArchetype = PlantArchetype.get_random(),
|
||||
_plant_mutations : Array[PlantMutation] = [],
|
||||
):
|
||||
plant_name = _plant_name
|
||||
plant_archetype = _plant_archetype
|
||||
plant_mutations = _plant_mutations
|
||||
random_seed = randi()
|
||||
|
||||
@@ -29,23 +26,18 @@ static func generate_from_parent(plant_data : PlantData) -> Seed:
|
||||
if randf() < MUTATION_PROBABILITY:
|
||||
return Seed.new(
|
||||
plant_data.plant_name,
|
||||
plant_data.archetype,
|
||||
mutate_mutations(plant_data)
|
||||
)
|
||||
else :
|
||||
return Seed.new(
|
||||
plant_data.plant_name,
|
||||
plant_data.archetype,
|
||||
plant_data.mutations.duplicate_deep()
|
||||
)
|
||||
|
||||
static func generate_random() -> Seed:
|
||||
var archetype = PlantArchetype.get_random()
|
||||
|
||||
var new_seed = Seed.new(
|
||||
Random.generate_random_word(),
|
||||
PlantArchetype.get_random(),
|
||||
[generate_first_mutation(archetype)]
|
||||
[generate_first_mutation()]
|
||||
)
|
||||
|
||||
return new_seed
|
||||
@@ -142,10 +134,10 @@ func get_particles() -> Array[EffectParticles.Parameters]:
|
||||
|
||||
return param
|
||||
|
||||
static func generate_first_mutation(archetype : PlantArchetype) -> PlantMutation:
|
||||
static func generate_first_mutation() -> PlantMutation:
|
||||
var rarity : int = RARITY_POOL.pick_random()
|
||||
|
||||
var possible_mutation : PlantMutation = archetype.available_mutations.filter(
|
||||
var possible_mutation : PlantMutation = GameInfo.game_data.progression_data.available_mutations.filter(
|
||||
func (m : PlantMutation): return m.get_base_rarity() <= rarity
|
||||
).pick_random().duplicate_deep()
|
||||
|
||||
@@ -162,7 +154,7 @@ static func mutate_mutations(parent : PlantData) -> Array[PlantMutation]:
|
||||
]
|
||||
|
||||
if (
|
||||
len(parent.mutations) >= GameInfo.game_data.max_mutations_by_plant
|
||||
len(parent.mutations) >= GameInfo.game_data.progression_data.max_mutations_by_plant
|
||||
):
|
||||
mutation_possibility = [
|
||||
UpgradeMutation.new(),
|
||||
@@ -184,7 +176,7 @@ class MutationPossibility:
|
||||
class AddMutation extends MutationPossibility:
|
||||
func mutate(parent : PlantData)-> Array[PlantMutation]:
|
||||
var new_mutations = parent.mutations.duplicate_deep()
|
||||
var possible_new_mutations = parent.archetype.available_mutations.duplicate_deep()
|
||||
var possible_new_mutations = GameInfo.game_data.progression_data.available_mutations.duplicate_deep()
|
||||
|
||||
possible_new_mutations = possible_new_mutations.filter(
|
||||
func (m : PlantMutation):
|
||||
|
||||
@@ -33,17 +33,17 @@ func _init(region : Region, pos : Vector2):
|
||||
signals.append(
|
||||
DetectorSignalIndividual.new(
|
||||
(pos - e.global_position).normalized().angle(),
|
||||
DOOR_ICON,
|
||||
(e as Door).icon,
|
||||
Color("ffa617ff")
|
||||
),
|
||||
)
|
||||
if e is Plant:
|
||||
signals.append(
|
||||
DetectorSignalIndividual.new(
|
||||
(pos - e.global_position).normalized().angle(),
|
||||
PLANT_ICON
|
||||
)
|
||||
)
|
||||
# if e is Plant:
|
||||
# signals.append(
|
||||
# DetectorSignalIndividual.new(
|
||||
# (pos - e.global_position).normalized().angle(),
|
||||
# PLANT_ICON
|
||||
# )
|
||||
# )
|
||||
|
||||
func _draw():
|
||||
if started_time < SIGNAL_DURATION:
|
||||
|
||||
Reference in New Issue
Block a user