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:
@@ -179,7 +179,7 @@ func save() -> EntityData:
|
||||
func card_info() -> CardInfo:
|
||||
var info = CardInfo.new(
|
||||
data.plant_name,
|
||||
tr("MATURE") if data.is_mature() else tr("JUVENILE")# data.archetype.archetype_name
|
||||
tr("MATURE") if data.is_mature() else tr("JUVENILE")
|
||||
)
|
||||
|
||||
info.important_stat_icon = SCORE_ICON
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
extends Resource
|
||||
class_name PlantArchetype
|
||||
|
||||
@export var archetype_name := Random.generate_random_word()
|
||||
@export var plant_area_radius = 20
|
||||
@export var plant_influence_radius = 100
|
||||
@export var growing_time = 2
|
||||
@export var lifetime = 6
|
||||
@export var base_score = 1
|
||||
@export var seed_number = 2
|
||||
@export var seed_random_loose = 1
|
||||
@export var available_mutations: Array[PlantMutation] = [
|
||||
AncientMutation.new(),
|
||||
EphemeralMutation.new(),
|
||||
FertileMutation.new(),
|
||||
GenerousMutation.new(),
|
||||
HurriedMutation.new(),
|
||||
PrecociousMutation.new(),
|
||||
ProlificMutation.new(),
|
||||
ProtectiveMutation.new(),
|
||||
PureMutation.new(),
|
||||
PurificationMutation.new(),
|
||||
QualityMutation.new(),
|
||||
QuickMutation.new(),
|
||||
RobustMutation.new(),
|
||||
SocialMutation.new(),
|
||||
ToughMutation.new(),
|
||||
VivaciousMutation.new(),
|
||||
]
|
||||
|
||||
static func get_all() -> Array[PlantArchetype]:
|
||||
return [PlantArchetype.new()]
|
||||
|
||||
static func get_random() -> PlantArchetype:
|
||||
return get_all().pick_random()
|
||||
@@ -1 +0,0 @@
|
||||
uid://chdj832c0rrky
|
||||
@@ -7,7 +7,6 @@ signal nearby_plant_updated()
|
||||
|
||||
enum State {PLANTED, GROWING, MATURE, DEAD}
|
||||
|
||||
@export var archetype: PlantArchetype
|
||||
@export var plant_name: String
|
||||
@export var mutations: Array[PlantMutation]
|
||||
@export var day: int:
|
||||
@@ -16,24 +15,17 @@ enum State {PLANTED, GROWING, MATURE, DEAD}
|
||||
updated.emit(self )
|
||||
@export var random_seed: int
|
||||
|
||||
@export var leafs = 0 # +1 score
|
||||
@export var roots = 0 # +1 lifetime
|
||||
|
||||
# var texture_builder: TextureBuilder = preload("res://entities/plants/scripts/texture_builder/texture_builder.tres")
|
||||
|
||||
var decontamination_area_factor = 0.
|
||||
var nearby_plants : Array[PlantData]
|
||||
|
||||
func _init(
|
||||
_position: Vector2 = Vector2.ZERO,
|
||||
_archetype: PlantArchetype = PlantArchetype.get_random(),
|
||||
_plant_name: String = Random.generate_random_word(),
|
||||
_mutations: Array[PlantMutation] = [],
|
||||
_day: int = 0,
|
||||
_random_seed = randi()
|
||||
):
|
||||
position = _position
|
||||
archetype = _archetype
|
||||
plant_name = _plant_name
|
||||
mutations = _mutations
|
||||
day = _day
|
||||
@@ -45,11 +37,13 @@ func _init(
|
||||
static func generate_from_seed(plant_seed: Seed, plant_position: Vector2) -> PlantData:
|
||||
return PlantData.new(
|
||||
plant_position,
|
||||
plant_seed.plant_archetype,
|
||||
plant_seed.plant_name,
|
||||
plant_seed.plant_mutations
|
||||
)
|
||||
|
||||
func get_plant_info() -> RunDataPlantInfo:
|
||||
return GameInfo.game_data.current_run.plant_info
|
||||
|
||||
func load_entity() -> Entity:
|
||||
var plant = Plant.new(
|
||||
self
|
||||
@@ -57,7 +51,7 @@ func load_entity() -> Entity:
|
||||
return plant
|
||||
|
||||
func get_lifetime() -> int:
|
||||
var lifetime = archetype.lifetime + roots
|
||||
var lifetime = get_plant_info().get_lifetime()
|
||||
|
||||
for m in mutations:
|
||||
lifetime = m.mutate_lifetime(self , lifetime)
|
||||
@@ -68,7 +62,7 @@ func get_lifetime() -> int:
|
||||
return lifetime
|
||||
|
||||
func get_growing_time() -> int:
|
||||
var growing_time = archetype.growing_time
|
||||
var growing_time = get_plant_info().get_growing_time()
|
||||
|
||||
for m in mutations:
|
||||
growing_time = m.mutate_growing_time(self , growing_time)
|
||||
@@ -76,7 +70,7 @@ func get_growing_time() -> int:
|
||||
return growing_time
|
||||
|
||||
func get_score(state: State = get_state()) -> int:
|
||||
var score = archetype.base_score + leafs if state == State.MATURE else 0
|
||||
var score = get_plant_info().get_base_score() if state == State.MATURE else 0
|
||||
|
||||
var mult := 1
|
||||
|
||||
@@ -102,7 +96,7 @@ func is_mature() -> bool:
|
||||
return get_state() == State.MATURE
|
||||
|
||||
func get_seed_number(state = get_state()):
|
||||
var seed_number = archetype.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 0
|
||||
|
||||
for m in mutations:
|
||||
seed_number = m.mutate_seed_number(self , seed_number)
|
||||
@@ -113,7 +107,7 @@ func get_seed_number(state = get_state()):
|
||||
return seed_number
|
||||
|
||||
func get_seed_random_loose():
|
||||
var seed_random_loose = archetype.seed_random_loose
|
||||
var seed_random_loose = get_plant_info().get_seed_random_loose()
|
||||
for m in mutations:
|
||||
seed_random_loose = m.mutate_seed_random_loose(self , seed_random_loose)
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ func generate_plants():
|
||||
elif plant_state == PlantData.State.DEAD:
|
||||
plant_data.day = plant_data.get_lifetime()
|
||||
for j in n_mutation_per_plant:
|
||||
plant_data.mutations.append(plant_data.archetype.available_mutations.pick_random())
|
||||
plant_data.mutations.append(GameInfo.game_data.progression_data.available_mutations.pick_random())
|
||||
var plant: Plant = Plant.new(plant_data)
|
||||
print(plant.data.plant_name)
|
||||
%Plants.add_child(plant)
|
||||
|
||||
Reference in New Issue
Block a user