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:
37
common/game_data/scripts/artefacts/artefact.gd
Normal file
37
common/game_data/scripts/artefacts/artefact.gd
Normal file
@@ -0,0 +1,37 @@
|
||||
@abstract
|
||||
extends Resource
|
||||
class_name Artefact
|
||||
|
||||
const ARTEFACT_ICON = preload("res://common/icons/cube-3d-sphere.svg")
|
||||
const DESC_ICON = preload("res://common/icons/align-right.svg")
|
||||
|
||||
@abstract func get_artefact_name() -> String
|
||||
|
||||
@abstract func get_3d_scene() -> PackedScene
|
||||
|
||||
func get_artefact_desc() -> String:
|
||||
return ""
|
||||
|
||||
func modify_player_max_energy(v : int) -> int:
|
||||
return v
|
||||
|
||||
func modify_player_inventory_size(v : int) -> int:
|
||||
return v
|
||||
|
||||
func card_info() -> CardInfo:
|
||||
var info = CardInfo.new(
|
||||
get_artefact_name(),
|
||||
tr("ARTEFACT")
|
||||
)
|
||||
info.important_stat_icon = ARTEFACT_ICON
|
||||
|
||||
var desc_section := CardSectionInfo.new(
|
||||
tr("DESCRIPTION"),
|
||||
get_artefact_desc(),
|
||||
)
|
||||
desc_section.title_icon = DESC_ICON
|
||||
|
||||
info.sections.append(desc_section)
|
||||
|
||||
return info
|
||||
|
||||
1
common/game_data/scripts/artefacts/artefact.gd.uid
Normal file
1
common/game_data/scripts/artefacts/artefact.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://d2nheldbqquy1
|
||||
BIN
common/game_data/scripts/artefacts/pile/pile.blend
Normal file
BIN
common/game_data/scripts/artefacts/pile/pile.blend
Normal file
Binary file not shown.
68
common/game_data/scripts/artefacts/pile/pile.blend.import
Normal file
68
common/game_data/scripts/artefacts/pile/pile.blend.import
Normal file
@@ -0,0 +1,68 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://dolv2637emdbw"
|
||||
path="res://.godot/imported/pile.blend-80c2c782d9d6ad4f0e2e2546a3d5b176.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://common/game_data/scripts/artefacts/pile/pile.blend"
|
||||
dest_files=["res://.godot/imported/pile.blend-80c2c782d9d6ad4f0e2e2546a3d5b176.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type=""
|
||||
nodes/root_name=""
|
||||
nodes/root_script=null
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
nodes/import_as_skeleton_bones=false
|
||||
nodes/use_name_suffixes=true
|
||||
nodes/use_node_type_suffixes=true
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
meshes/force_disable_compression=false
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
animation/import_rest_as_RESET=false
|
||||
import_script/path=""
|
||||
materials/extract=0
|
||||
materials/extract_format=0
|
||||
materials/extract_path=""
|
||||
_subresources={
|
||||
"materials": {
|
||||
"Material": {
|
||||
"use_external/enabled": true,
|
||||
"use_external/fallback_path": "res://common/assets/materials/default_3d.tres",
|
||||
"use_external/path": "uid://dvvi1k5c5iowc"
|
||||
}
|
||||
}
|
||||
}
|
||||
blender/nodes/visible=0
|
||||
blender/nodes/active_collection_only=false
|
||||
blender/nodes/punctual_lights=true
|
||||
blender/nodes/cameras=true
|
||||
blender/nodes/custom_properties=true
|
||||
blender/nodes/modifiers=1
|
||||
blender/meshes/colors=false
|
||||
blender/meshes/uvs=true
|
||||
blender/meshes/normals=true
|
||||
blender/meshes/export_geometry_nodes_instances=false
|
||||
blender/meshes/gpu_instances=false
|
||||
blender/meshes/tangents=true
|
||||
blender/meshes/skins=2
|
||||
blender/meshes/export_bones_deforming_mesh_only=false
|
||||
blender/materials/unpack_enabled=true
|
||||
blender/materials/export_materials=1
|
||||
blender/animation/limit_playback=true
|
||||
blender/animation/always_sample=true
|
||||
blender/animation/group_tracks=true
|
||||
gltf/naming_version=2
|
||||
BIN
common/game_data/scripts/artefacts/pile/pile.blend1
Normal file
BIN
common/game_data/scripts/artefacts/pile/pile.blend1
Normal file
Binary file not shown.
15
common/game_data/scripts/artefacts/pile/pile.gd
Normal file
15
common/game_data/scripts/artefacts/pile/pile.gd
Normal file
@@ -0,0 +1,15 @@
|
||||
@tool
|
||||
extends Artefact
|
||||
class_name PileArtefact
|
||||
|
||||
func get_artefact_name() -> String:
|
||||
return "PILE"
|
||||
|
||||
func get_artefact_desc() -> String:
|
||||
return "PILE_DESC_TEXT"
|
||||
|
||||
func get_3d_scene() -> PackedScene:
|
||||
return preload("res://common/game_data/scripts/artefacts/pile/pile.blend")
|
||||
|
||||
func modify_player_max_energy(v : int) -> int:
|
||||
return v + 1
|
||||
1
common/game_data/scripts/artefacts/pile/pile.gd.uid
Normal file
1
common/game_data/scripts/artefacts/pile/pile.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://c6lr0fucklsto
|
||||
BIN
common/game_data/scripts/artefacts/seed_case/seed_case.blend
Normal file
BIN
common/game_data/scripts/artefacts/seed_case/seed_case.blend
Normal file
Binary file not shown.
@@ -0,0 +1,68 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://cclvb8o3vofff"
|
||||
path="res://.godot/imported/seed_case.blend-c6a943c9ac5e07f38ec4fc399a8f6f42.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://common/game_data/scripts/artefacts/seed_case/seed_case.blend"
|
||||
dest_files=["res://.godot/imported/seed_case.blend-c6a943c9ac5e07f38ec4fc399a8f6f42.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type=""
|
||||
nodes/root_name=""
|
||||
nodes/root_script=null
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
nodes/import_as_skeleton_bones=false
|
||||
nodes/use_name_suffixes=true
|
||||
nodes/use_node_type_suffixes=true
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
meshes/force_disable_compression=false
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
animation/import_rest_as_RESET=false
|
||||
import_script/path=""
|
||||
materials/extract=0
|
||||
materials/extract_format=0
|
||||
materials/extract_path=""
|
||||
_subresources={
|
||||
"materials": {
|
||||
"Material": {
|
||||
"use_external/enabled": true,
|
||||
"use_external/fallback_path": "res://common/assets/materials/default_3d.tres",
|
||||
"use_external/path": "uid://dvvi1k5c5iowc"
|
||||
}
|
||||
}
|
||||
}
|
||||
blender/nodes/visible=0
|
||||
blender/nodes/active_collection_only=false
|
||||
blender/nodes/punctual_lights=true
|
||||
blender/nodes/cameras=true
|
||||
blender/nodes/custom_properties=true
|
||||
blender/nodes/modifiers=1
|
||||
blender/meshes/colors=false
|
||||
blender/meshes/uvs=true
|
||||
blender/meshes/normals=true
|
||||
blender/meshes/export_geometry_nodes_instances=false
|
||||
blender/meshes/gpu_instances=false
|
||||
blender/meshes/tangents=true
|
||||
blender/meshes/skins=2
|
||||
blender/meshes/export_bones_deforming_mesh_only=false
|
||||
blender/materials/unpack_enabled=true
|
||||
blender/materials/export_materials=1
|
||||
blender/animation/limit_playback=true
|
||||
blender/animation/always_sample=true
|
||||
blender/animation/group_tracks=true
|
||||
gltf/naming_version=2
|
||||
15
common/game_data/scripts/artefacts/seed_case/seed_case.gd
Normal file
15
common/game_data/scripts/artefacts/seed_case/seed_case.gd
Normal file
@@ -0,0 +1,15 @@
|
||||
@tool
|
||||
extends Artefact
|
||||
class_name SeedCaseArtefact
|
||||
|
||||
func get_artefact_name() -> String:
|
||||
return "SEED_CASE"
|
||||
|
||||
func get_artefact_desc() -> String:
|
||||
return "SEED_CASE_DESC_TEXT"
|
||||
|
||||
func get_3d_scene() -> PackedScene:
|
||||
return preload("res://common/game_data/scripts/artefacts/seed_case/seed_case.blend")
|
||||
|
||||
func modify_player_inventory_size(v : int) -> int:
|
||||
return v + 1
|
||||
@@ -0,0 +1 @@
|
||||
uid://c7o5p4uk556v6
|
||||
@@ -3,15 +3,22 @@ class_name GameData
|
||||
|
||||
enum GameMode {STORY,INFINITE}
|
||||
|
||||
signal current_run_updated(r : RunData)
|
||||
signal current_region_data_updated(p : RegionData)
|
||||
|
||||
@export var current_run : RunData = null
|
||||
|
||||
@export var current_region_data : RegionData = null
|
||||
|
||||
@export var player_data : PlayerData = PlayerData.new()
|
||||
|
||||
@export var max_mutations_by_plant : int = 2
|
||||
@export var current_run : RunData = start_run() :
|
||||
set(v):
|
||||
current_run = v
|
||||
current_run_updated.emit(v)
|
||||
|
||||
@export var current_region_data : RegionData = null :
|
||||
set(v):
|
||||
current_region_data = v
|
||||
current_region_data_updated.emit(v)
|
||||
|
||||
@export var progression_data : ProgressionData = ProgressionData.new()
|
||||
|
||||
@export var last_game_scene : Scene = null
|
||||
|
||||
@@ -25,13 +32,18 @@ signal current_region_data_updated(p : RegionData)
|
||||
|
||||
@export var dialogs_done : Array[String] = [] #Chemin des dialogues démarrés
|
||||
|
||||
func start_run():
|
||||
player_data.inventory.clear_items()
|
||||
func start_run() -> RunData:
|
||||
player_data.clear_inventory()
|
||||
current_run = RunData.new()
|
||||
current_run.artefacts_changed.connect(
|
||||
func(artefacts : Array[Artefact]):
|
||||
player_data._on_artefacts_updated(artefacts)
|
||||
)
|
||||
current_run.current_run_point_changed.connect(
|
||||
func(rp : RunPoint):
|
||||
start_region(rp.region_parameter)
|
||||
)
|
||||
return current_run
|
||||
|
||||
func reset_player():
|
||||
player_data = PlayerData.new()
|
||||
@@ -42,7 +54,6 @@ func reset_all():
|
||||
|
||||
func start_region(region_param : RegionParameter):
|
||||
current_region_data = RegionData.new(region_param)
|
||||
current_region_data_updated.emit(current_region_data)
|
||||
GameInfo.save_game_data()
|
||||
|
||||
func give_up():
|
||||
|
||||
28
common/game_data/scripts/progression_data.gd
Normal file
28
common/game_data/scripts/progression_data.gd
Normal file
@@ -0,0 +1,28 @@
|
||||
extends Resource
|
||||
class_name ProgressionData
|
||||
|
||||
@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(),
|
||||
]
|
||||
|
||||
@export var available_artefacts: Array[Artefact] = [
|
||||
PileArtefact.new(),
|
||||
SeedCaseArtefact.new()
|
||||
]
|
||||
|
||||
@export var max_mutations_by_plant : int = 2
|
||||
1
common/game_data/scripts/progression_data.gd.uid
Normal file
1
common/game_data/scripts/progression_data.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cel2kwfmhvb0a
|
||||
@@ -6,7 +6,8 @@ enum State {STARTED, IN_PROGRESS, FINISHED}
|
||||
const RUN_POINTS_NEXT_NUMBER : int = 2
|
||||
const RUN_POINT_MAX_LEVEL = 5 # TODO
|
||||
|
||||
signal current_run_point_changed
|
||||
signal current_run_point_changed(rp : RunPoint)
|
||||
signal artefacts_changed(artefact : Array[Artefact])
|
||||
|
||||
var run_seed = randi()
|
||||
@export var next_run_points : Array[RunPoint] = generate_next_run_points()
|
||||
@@ -18,7 +19,19 @@ var run_seed = randi()
|
||||
|
||||
@export var last_used_modifier_name = ""
|
||||
|
||||
#region ------------------ Generation ------------------
|
||||
@export var artefacts : Array[Artefact] = []
|
||||
|
||||
var plant_info = RunDataPlantInfo.new(self)
|
||||
|
||||
func get_state() -> State:
|
||||
if not current_run_point:
|
||||
return State.STARTED
|
||||
elif current_run_point.level == RUN_POINT_MAX_LEVEL:
|
||||
return State.FINISHED
|
||||
else :
|
||||
return State.IN_PROGRESS
|
||||
|
||||
#region ------------------ Run Points ------------------
|
||||
|
||||
func generate_next_run_points(level = 0) -> Array[RunPoint]:
|
||||
|
||||
@@ -35,13 +48,12 @@ func generate_next_run_points(level = 0) -> Array[RunPoint]:
|
||||
)
|
||||
|
||||
return next_run_points
|
||||
|
||||
|
||||
func generate_next_run_point(level = 0) -> RunPoint:
|
||||
var region_parameter = RegionParameter.new()
|
||||
region_parameter.level = level
|
||||
region_parameter.region_flags = get_region_flags(region_parameter)
|
||||
region_parameter.modifiers = get_region_modifiers()
|
||||
region_parameter.modifiers = get_bad_region_modifiers()
|
||||
region_parameter.modifiers.append_array(get_good_region_modifiers())
|
||||
|
||||
return RunPoint.new(
|
||||
level,
|
||||
@@ -51,7 +63,6 @@ func generate_next_run_point(level = 0) -> RunPoint:
|
||||
func generate_borea_base_run_point() -> RunPoint:
|
||||
var region_parameter = RegionParameter.new()
|
||||
region_parameter.level = RUN_POINT_MAX_LEVEL
|
||||
region_parameter.region_flags = get_region_flags(region_parameter)
|
||||
region_parameter.region_name = tr("BOREA_BASE")
|
||||
|
||||
return RunPoint.new(
|
||||
@@ -59,16 +70,6 @@ func generate_borea_base_run_point() -> RunPoint:
|
||||
region_parameter
|
||||
)
|
||||
|
||||
#endregion
|
||||
|
||||
func get_state() -> State:
|
||||
if not current_run_point:
|
||||
return State.STARTED
|
||||
elif current_run_point.level == RUN_POINT_MAX_LEVEL:
|
||||
return State.FINISHED
|
||||
else :
|
||||
return State.IN_PROGRESS
|
||||
|
||||
func get_next_run_points() -> Array[RunPoint]:
|
||||
if current_run_point and current_run_point.level == RUN_POINT_MAX_LEVEL:
|
||||
return []
|
||||
@@ -84,15 +85,10 @@ func choose_next_run_point(run_point : RunPoint) -> RunPoint:
|
||||
last_used_modifier_name = current_run_point.region_parameter.modifiers[0].get_modifier_name()
|
||||
return current_run_point
|
||||
|
||||
func get_region_flags(region_parameter : RegionParameter) -> Array[String]:
|
||||
var flags : Array[String] = []
|
||||
func get_good_region_modifiers() -> Array[RegionModifier]:
|
||||
return [VendingMachineModifier.new(),VendingMachineModifier.new()]
|
||||
|
||||
if region_parameter.level == RUN_POINT_MAX_LEVEL and GameInfo.game_data.game_mode == GameData.GameMode.STORY:
|
||||
flags.append("borea")
|
||||
|
||||
return flags
|
||||
|
||||
func get_region_modifiers() -> Array[RegionModifier]:
|
||||
func get_bad_region_modifiers() -> Array[RegionModifier]:
|
||||
var possible_modifiers : Array[RegionModifier] = [
|
||||
AridModifier.new(),
|
||||
HumidModifier.new(),
|
||||
@@ -109,3 +105,13 @@ func get_region_modifiers() -> Array[RegionModifier]:
|
||||
last_used_modifier_name = choosen_modifier.get_modifier_name()
|
||||
|
||||
return [choosen_modifier]
|
||||
|
||||
#endregion
|
||||
|
||||
#region ------------------ Artefacts ------------------
|
||||
|
||||
func add_artefacts(a: Artefact):
|
||||
artefacts.append(a)
|
||||
artefacts_changed.emit(artefacts)
|
||||
|
||||
#endregion
|
||||
|
||||
43
common/game_data/scripts/run/run_data_plant_info.gd
Normal file
43
common/game_data/scripts/run/run_data_plant_info.gd
Normal file
@@ -0,0 +1,43 @@
|
||||
extends Node
|
||||
class_name RunDataPlantInfo
|
||||
|
||||
signal updated
|
||||
|
||||
const DEFAULT_PLANT_AREA_RADIUS = 20
|
||||
const DEFAULT_PLANT_INFLUENCE_RADIUS = 100
|
||||
const DEFAULT_GROWING_TIME = 2
|
||||
const DEFAULT_LIFETIME = 6
|
||||
const DEFAULT_BASE_SCORE = 1
|
||||
const DEFAULT_SEED_NUMBER = 2
|
||||
const DEFAULT_SEED_RANDOM_LOOSE = 1
|
||||
|
||||
var run_data : RunData
|
||||
|
||||
func _init(
|
||||
_run_data : RunData
|
||||
):
|
||||
run_data = _run_data
|
||||
|
||||
var region_modifiers : Array[RegionModifier]
|
||||
var artefacts : Array[Artefact] = []
|
||||
|
||||
func get_plant_area_radius() -> int:
|
||||
return DEFAULT_PLANT_AREA_RADIUS
|
||||
|
||||
func get_plant_influence_radius() -> int:
|
||||
return DEFAULT_PLANT_INFLUENCE_RADIUS
|
||||
|
||||
func get_growing_time() -> int:
|
||||
return DEFAULT_GROWING_TIME
|
||||
|
||||
func get_lifetime() -> int:
|
||||
return DEFAULT_LIFETIME
|
||||
|
||||
func get_base_score() -> int:
|
||||
return DEFAULT_BASE_SCORE
|
||||
|
||||
func get_seed_number() -> int:
|
||||
return DEFAULT_SEED_NUMBER
|
||||
|
||||
func get_seed_random_loose() -> int:
|
||||
return DEFAULT_SEED_RANDOM_LOOSE
|
||||
1
common/game_data/scripts/run/run_data_plant_info.gd.uid
Normal file
1
common/game_data/scripts/run/run_data_plant_info.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cf8sn5n5u2hd6
|
||||
@@ -4,7 +4,7 @@ class_name RunPoint
|
||||
|
||||
const DANGER_ICON = preload("res://common/icons/skull.svg")
|
||||
const TYPE_ICON = preload("res://common/icons/map-pin.svg")
|
||||
const OBJECTIVE_ICON = preload("res://common/icons/dna.svg")
|
||||
const OBJECTIVE_ICON = preload("res://common/icons/growth.svg")
|
||||
const CHARGE_ICON = preload("res://common/icons/bolt.svg")
|
||||
|
||||
@export var level : int = 0 # X pos along the planet, and difficulty
|
||||
@@ -24,15 +24,20 @@ func _init(
|
||||
position = _position
|
||||
|
||||
func card_info() -> CardInfo:
|
||||
var info = CardInfo.new(region_parameter.region_name)
|
||||
info.important_stat_icon = DANGER_ICON
|
||||
info.important_stat_text = "%d" % level
|
||||
var info = CardInfo.new(
|
||||
region_parameter.region_name,
|
||||
tr("REGION_TO_VISIT")
|
||||
)
|
||||
|
||||
info.type_icon = TYPE_ICON
|
||||
|
||||
info.stats.append_array([
|
||||
CardStatInfo.new(str(region_parameter.objective), OBJECTIVE_ICON),
|
||||
CardStatInfo.new(str(region_parameter.charges), CHARGE_ICON),
|
||||
CardStatInfo.new(str(region_parameter.get_objective()), OBJECTIVE_ICON),
|
||||
CardStatInfo.new(str(region_parameter.get_charge()), CHARGE_ICON),
|
||||
])
|
||||
|
||||
for m in region_parameter.modifiers:
|
||||
|
||||
info.sections.append(m.card_section())
|
||||
|
||||
return info
|
||||
|
||||
Reference in New Issue
Block a user