Dev de la démo
* Modification de l'apparence de l'UI des dialogues * Changement de l'ordre de déblocage des mutations * Ajout d'une confirmation pour l'abandon * Ajout de la scène de fin avec la base Boréa, en tant que fin de démo * Modification des icône de durée de vie, temps de pousse, et de mort * Ajout d'un icône au dessus du joueur quand il n'a plus d'énergie * Amélioration des dialogues du jeu * Changement du modèle du téléphone * Ajout de cellule d'énergie et de cellule de talion trouvable sur la carte * Il est à nouveau possible de se recharger après la fin d'une région * Buff des mutations ancien sociale et solide * Modification de la mutation fertile (ne donne de gain de graine qu'à la maturation) * Ajout d'une récupération automatique des graines * Ajout de deux cartons de tutoriel ainsi qu'une option pour les revoir dans l'aide de jeu * Amélioration générale du tutoriel * Ajout d'un écran titre digne de ce nom * Lors de l'arrivée à destination, ne téléporte plus le joueur sur une map vide, mais directement dans les lieux de cinématique * Ajout graphique de plus de pattern de mousse et de roche * Le talion apparait maintenant sur toute la carte * La roche peut désormais apparaitre sur la zone de départ * Ajout dud modificateur de région Canyon * Equilibrage général * Fix de bugs en tout genre
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 144 KiB After Width: | Height: | Size: 166 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 207 KiB After Width: | Height: | Size: 224 KiB |
@@ -20,11 +20,12 @@
|
||||
|
||||
[sub_resource type="Resource" id="Resource_r4e5h"]
|
||||
script = ExtResource("3_r4e5h")
|
||||
cloud_value = 0.49210685
|
||||
wind_direction = Vector2(-0.6777254, 0.7353151)
|
||||
wind_force = 0.83562934
|
||||
rain_value = 0.42404523
|
||||
cloud_value = 0.20464431
|
||||
wind_direction = Vector2(0.4359836, 0.8999546)
|
||||
wind_force = 0.9393943
|
||||
fog_value = 0.5362279
|
||||
ambiance_name = "ExteriorFoggy"
|
||||
ambiance_name = "ExteriorWindy"
|
||||
type = 3
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_2w03p"]
|
||||
@@ -104,14 +105,14 @@ anim_speed_max = 1.0
|
||||
_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(0.4883721, 1), 0.037164874, 0.037164874, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
|
||||
point_count = 3
|
||||
|
||||
[sub_resource type="CurveTexture" id="CurveTexture_ovqi1"]
|
||||
[sub_resource type="CurveTexture" id="CurveTexture_r4e5h"]
|
||||
curve = SubResource("Curve_qdnee")
|
||||
|
||||
[sub_resource type="Curve" id="Curve_6d8m3"]
|
||||
_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(0.25581396, 1), 0.0, 0.0, 0, 0, Vector2(0.5023256, 0), 0.0, 0.0, 0, 0, Vector2(0.75348836, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
|
||||
point_count = 5
|
||||
|
||||
[sub_resource type="CurveXYZTexture" id="CurveXYZTexture_fwgig"]
|
||||
[sub_resource type="CurveXYZTexture" id="CurveXYZTexture_3lxsc"]
|
||||
curve_y = SubResource("Curve_6d8m3")
|
||||
|
||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_mlppq"]
|
||||
@@ -123,12 +124,12 @@ initial_velocity_min = 35.1
|
||||
initial_velocity_max = 39.0
|
||||
directional_velocity_min = -1.0000161
|
||||
directional_velocity_max = 0.9999839
|
||||
directional_velocity_curve = SubResource("CurveXYZTexture_fwgig")
|
||||
directional_velocity_curve = SubResource("CurveXYZTexture_3lxsc")
|
||||
gravity = Vector3(0, 0, 0)
|
||||
scale_min = 0.049999997
|
||||
scale_max = 0.099999994
|
||||
color = Color(0.9, 0.92, 1, 0.4392157)
|
||||
alpha_curve = SubResource("CurveTexture_ovqi1")
|
||||
alpha_curve = SubResource("CurveTexture_r4e5h")
|
||||
|
||||
[node name="Region" type="Node2D" unique_id=1509166288 node_paths=PackedStringArray("entity_container")]
|
||||
script = ExtResource("1_441sk")
|
||||
@@ -181,9 +182,6 @@ mouse_filter = 2
|
||||
[node name="PassDay" parent="." unique_id=1144772570 instance=ExtResource("3_ktnx3")]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="RegionGui" type="CanvasLayer" parent="." unique_id=2024485651]
|
||||
layer = 2
|
||||
|
||||
[node name="GameGui" parent="." unique_id=1970837239 instance=ExtResource("4_qdnee")]
|
||||
|
||||
[node name="Announce" parent="." unique_id=1659074958 instance=ExtResource("8_mlppq")]
|
||||
|
||||
@@ -603,6 +603,54 @@ texture_region_size = Vector2i(64, 64)
|
||||
10:1/0/terrains_peering_bit/top_left_corner = 1
|
||||
10:1/0/terrains_peering_bit/top_side = 1
|
||||
10:1/0/terrains_peering_bit/top_right_corner = 1
|
||||
12:0/0 = 0
|
||||
12:0/0/terrain_set = 0
|
||||
12:0/0/terrain = 1
|
||||
12:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-32, -32, 32, -32, 32, 32, -32, 32)
|
||||
12:0/0/terrains_peering_bit/right_side = 1
|
||||
12:0/0/terrains_peering_bit/bottom_right_corner = 1
|
||||
12:0/0/terrains_peering_bit/bottom_side = 1
|
||||
12:0/0/terrains_peering_bit/bottom_left_corner = 1
|
||||
12:0/0/terrains_peering_bit/left_side = 1
|
||||
12:0/0/terrains_peering_bit/top_left_corner = 1
|
||||
12:0/0/terrains_peering_bit/top_side = 1
|
||||
12:0/0/terrains_peering_bit/top_right_corner = 1
|
||||
12:1/0 = 0
|
||||
12:1/0/terrain_set = 0
|
||||
12:1/0/terrain = 1
|
||||
12:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-32, -32, 32, -32, 32, 32, -32, 32)
|
||||
12:1/0/terrains_peering_bit/right_side = 1
|
||||
12:1/0/terrains_peering_bit/bottom_right_corner = 1
|
||||
12:1/0/terrains_peering_bit/bottom_side = 1
|
||||
12:1/0/terrains_peering_bit/bottom_left_corner = 1
|
||||
12:1/0/terrains_peering_bit/left_side = 1
|
||||
12:1/0/terrains_peering_bit/top_left_corner = 1
|
||||
12:1/0/terrains_peering_bit/top_side = 1
|
||||
12:1/0/terrains_peering_bit/top_right_corner = 1
|
||||
12:2/0 = 0
|
||||
12:2/0/terrain_set = 0
|
||||
12:2/0/terrain = 1
|
||||
12:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-32, -32, 32, -32, 32, 32, -32, 32)
|
||||
12:2/0/terrains_peering_bit/right_side = 1
|
||||
12:2/0/terrains_peering_bit/bottom_right_corner = 1
|
||||
12:2/0/terrains_peering_bit/bottom_side = 1
|
||||
12:2/0/terrains_peering_bit/bottom_left_corner = 1
|
||||
12:2/0/terrains_peering_bit/left_side = 1
|
||||
12:2/0/terrains_peering_bit/top_left_corner = 1
|
||||
12:2/0/terrains_peering_bit/top_side = 1
|
||||
12:2/0/terrains_peering_bit/top_right_corner = 1
|
||||
12:3/0 = 0
|
||||
12:3/0/terrain_set = 0
|
||||
12:3/0/terrain = 1
|
||||
12:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-32, -32, 32, -32, 32, 32, -32, 32)
|
||||
12:3/0/terrains_peering_bit/right_side = 1
|
||||
12:3/0/terrains_peering_bit/bottom_right_corner = 1
|
||||
12:3/0/terrains_peering_bit/bottom_side = 1
|
||||
12:3/0/terrains_peering_bit/bottom_left_corner = 1
|
||||
12:3/0/terrains_peering_bit/left_side = 1
|
||||
12:3/0/terrains_peering_bit/top_left_corner = 1
|
||||
12:3/0/terrains_peering_bit/top_side = 1
|
||||
12:3/0/terrains_peering_bit/top_right_corner = 1
|
||||
|
||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_spfgy"]
|
||||
resource_name = "Cristal"
|
||||
@@ -1341,6 +1389,50 @@ texture_region_size = Vector2i(64, 64)
|
||||
11:3/0/terrains_peering_bit/left_side = 0
|
||||
11:3/0/terrains_peering_bit/top_left_corner = 0
|
||||
11:3/0/terrains_peering_bit/top_side = 0
|
||||
12:0/0 = 0
|
||||
12:0/0/terrain_set = 0
|
||||
12:0/0/terrain = 0
|
||||
12:0/0/terrains_peering_bit/right_side = 0
|
||||
12:0/0/terrains_peering_bit/bottom_right_corner = 0
|
||||
12:0/0/terrains_peering_bit/bottom_side = 0
|
||||
12:0/0/terrains_peering_bit/bottom_left_corner = 0
|
||||
12:0/0/terrains_peering_bit/left_side = 0
|
||||
12:0/0/terrains_peering_bit/top_left_corner = 0
|
||||
12:0/0/terrains_peering_bit/top_side = 0
|
||||
12:0/0/terrains_peering_bit/top_right_corner = 0
|
||||
12:1/0 = 0
|
||||
12:1/0/terrain_set = 0
|
||||
12:1/0/terrain = 0
|
||||
12:1/0/terrains_peering_bit/right_side = 0
|
||||
12:1/0/terrains_peering_bit/bottom_right_corner = 0
|
||||
12:1/0/terrains_peering_bit/bottom_side = 0
|
||||
12:1/0/terrains_peering_bit/bottom_left_corner = 0
|
||||
12:1/0/terrains_peering_bit/left_side = 0
|
||||
12:1/0/terrains_peering_bit/top_left_corner = 0
|
||||
12:1/0/terrains_peering_bit/top_side = 0
|
||||
12:1/0/terrains_peering_bit/top_right_corner = 0
|
||||
12:2/0 = 0
|
||||
12:2/0/terrain_set = 0
|
||||
12:2/0/terrain = 0
|
||||
12:2/0/terrains_peering_bit/right_side = 0
|
||||
12:2/0/terrains_peering_bit/bottom_right_corner = 0
|
||||
12:2/0/terrains_peering_bit/bottom_side = 0
|
||||
12:2/0/terrains_peering_bit/bottom_left_corner = 0
|
||||
12:2/0/terrains_peering_bit/left_side = 0
|
||||
12:2/0/terrains_peering_bit/top_left_corner = 0
|
||||
12:2/0/terrains_peering_bit/top_side = 0
|
||||
12:2/0/terrains_peering_bit/top_right_corner = 0
|
||||
12:3/0 = 0
|
||||
12:3/0/terrain_set = 0
|
||||
12:3/0/terrain = 0
|
||||
12:3/0/terrains_peering_bit/right_side = 0
|
||||
12:3/0/terrains_peering_bit/bottom_right_corner = 0
|
||||
12:3/0/terrains_peering_bit/bottom_side = 0
|
||||
12:3/0/terrains_peering_bit/bottom_left_corner = 0
|
||||
12:3/0/terrains_peering_bit/left_side = 0
|
||||
12:3/0/terrains_peering_bit/top_left_corner = 0
|
||||
12:3/0/terrains_peering_bit/top_side = 0
|
||||
12:3/0/terrains_peering_bit/top_right_corner = 0
|
||||
|
||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_3g8t4"]
|
||||
resource_name = "Ground"
|
||||
|
||||
@@ -6,7 +6,6 @@ const GENERATION_NUMBER = 4
|
||||
const NOISE_IMAGE_SIZE := 150
|
||||
|
||||
const MAX_DECONTAMINATION_DISTANCE=0
|
||||
const MAX_TALION_DISTANCE=3
|
||||
|
||||
const RANDOM_PADDING_NOISE_FREQUENCY := 0.01
|
||||
const ROCK_NOISE_FREQUENCY := 0.005
|
||||
@@ -222,8 +221,7 @@ func get_generated_rock_type(coord : Vector2i) -> RockLayer.TileType:
|
||||
get_tile_value_from_noise(coord, rock_noise_image)
|
||||
)
|
||||
var cristal_tile_value : float = (
|
||||
1. if chunk_coord.distance_to(Vector2i.ZERO) > MAX_TALION_DISTANCE
|
||||
else get_tile_value_from_noise(coord, cristal_noise_image)
|
||||
get_tile_value_from_noise(coord, cristal_noise_image)
|
||||
)
|
||||
var saved_diff := region_data.rock_tiles_data.get_tile_diff_for_local_coord(coord, chunk_coord)
|
||||
|
||||
|
||||
14
stages/terrain/region/scripts/modifiers/canyon_modifier.gd
Normal file
14
stages/terrain/region/scripts/modifiers/canyon_modifier.gd
Normal file
@@ -0,0 +1,14 @@
|
||||
extends RegionModifier
|
||||
class_name CanyonModifier
|
||||
|
||||
func get_modifier_name() -> String:
|
||||
return tr("CANYON")
|
||||
|
||||
func get_description() -> String:
|
||||
return tr("CANYON_MODIFIER_DESC_TEXT")
|
||||
|
||||
func get_icon() -> Texture:
|
||||
return preload("res://common/icons/pick.svg")
|
||||
|
||||
func modify_rock_threshold(rock_threshold : float) -> float:
|
||||
return rock_threshold * 2.5
|
||||
@@ -0,0 +1 @@
|
||||
uid://c1010kkc7fa0y
|
||||
@@ -11,7 +11,7 @@ func get_icon() -> Texture:
|
||||
return preload("res://common/icons/virus.svg")
|
||||
|
||||
func get_card_section_color() -> Color:
|
||||
return Color("8b2dffff")
|
||||
return Color("#FF006E")
|
||||
|
||||
# func modify_plant_seed_random_loose(plant_seed_random_loose : int) -> int:
|
||||
# return plant_seed_random_loose + 1
|
||||
|
||||
@@ -31,6 +31,6 @@ func region_ready(region : Region) -> void:
|
||||
door.available = true
|
||||
|
||||
region.add_entity(door)
|
||||
region.random_move_object(door,Region.DOORS_RANDOM_MOVEMENT)
|
||||
door.position = region.data.player_spawn
|
||||
region.recharge_station.available = false
|
||||
region.recharge_station.visible = false
|
||||
|
||||
@@ -11,4 +11,4 @@ func get_icon() -> Texture:
|
||||
return preload("res://common/icons/cactus.svg")
|
||||
|
||||
func modify_cristal_threshold(cristal_threshold : float) -> float:
|
||||
return cristal_threshold * 0.5
|
||||
return cristal_threshold * 0.4
|
||||
@@ -11,7 +11,7 @@ func get_icon() -> Texture:
|
||||
return preload("res://common/icons/radioactive.svg")
|
||||
|
||||
func get_card_section_color() -> Color:
|
||||
return Color("8b2dffff")
|
||||
return Color("#FF006E")
|
||||
|
||||
func modify_plant_base_score(plant_base_score : int) -> int:
|
||||
return plant_base_score - 1
|
||||
@@ -2,7 +2,7 @@
|
||||
extends Resource
|
||||
class_name RegionModifier
|
||||
|
||||
const DEFAULT_MODIFIER_COLOR = Color("ff006eff")
|
||||
const DEFAULT_MODIFIER_COLOR = Color("#8B2DFF")
|
||||
const DEFAULT_ICON = preload("res://common/icons/cloud.svg")
|
||||
|
||||
const DOOR_SCENE = preload("res://entities/interactables/door/door.tscn")
|
||||
@@ -52,6 +52,12 @@ func modify_start_decontamination_zone_radius(start_decontamination_zone_radius
|
||||
func modify_seed_rarity_pool(seed_rarity_pool : Array[int]) -> Array[int]:
|
||||
return seed_rarity_pool
|
||||
|
||||
func modify_talion_cell_chance(talion_cell_chance : Array[int]) -> Array[int]:
|
||||
return talion_cell_chance
|
||||
|
||||
func modify_energy_cell_chance(energy_cell_chance : Array[int]) -> Array[int]:
|
||||
return energy_cell_chance
|
||||
|
||||
func modify_plant_growing_time(plant_growing_time : int) -> int:
|
||||
return plant_growing_time
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ func get_icon() -> Texture:
|
||||
return preload("res://common/icons/mountain.svg")
|
||||
|
||||
func get_card_section_color() -> Color:
|
||||
return Color("8b2dffff")
|
||||
return Color("#FF006E")
|
||||
|
||||
func modify_cristal_threshold(cristal_threshold : float) -> float:
|
||||
return cristal_threshold * 0.
|
||||
@@ -16,7 +16,7 @@ func modify_seed_rarity_pool(_seed_rarity_pool : Array[int]) -> Array[int]:
|
||||
return [-1]
|
||||
|
||||
func modify_charge(charge : int) -> int:
|
||||
return charge+10
|
||||
return charge+50
|
||||
|
||||
func modify_mutation_probability(_plant_mutation_probability) -> float:
|
||||
return 1.
|
||||
@@ -27,6 +27,12 @@ func get_card_section_color() -> Color:
|
||||
func modify_region_name(_name : String) -> String:
|
||||
return "ASTRA_BASE"
|
||||
|
||||
func modify_talion_cell_chance(_c : Array[int]) -> Array[int]:
|
||||
return [0]
|
||||
|
||||
func modify_energy_cell_chance(_c : Array[int]) -> Array[int]:
|
||||
return [0]
|
||||
|
||||
func region_ready(region : Region) -> void:
|
||||
generate_astra_door(region)
|
||||
var garage_door := generate_garage_door(region)
|
||||
@@ -59,14 +65,14 @@ func generate_garage_door(region : Region) -> Door:
|
||||
garage_door.name = "GarageDoor"
|
||||
|
||||
region.add_entity(garage_door)
|
||||
region.random_move_object(garage_door,Region.SPAWN_OBJECT_RANDOM_MOVEMENT + 100)
|
||||
region.random_move_object_in_circle(garage_door,Region.SPAWN_OBJECT_RANDOM_MOVEMENT * 2 + 100)
|
||||
return garage_door
|
||||
|
||||
func generate_tutorial(region : Region) -> Tutorial:
|
||||
var tutorial := load(TUTORIAL_SCENE_PATH).instantiate() as Tutorial
|
||||
region.add_child(tutorial)
|
||||
tutorial.region = region
|
||||
tutorial.game_gui = region.find_child("GameGui")
|
||||
tutorial.player = region.entity_container.find_child("Player")
|
||||
region.add_child(tutorial)
|
||||
return tutorial
|
||||
|
||||
|
||||
@@ -24,7 +24,14 @@ func _init(meteo_seed : int = randi()):
|
||||
rng = RandomNumberGenerator.new()
|
||||
rng.seed = meteo_seed
|
||||
|
||||
type = ALL_TYPES[rng.randi_range(0, len(ALL_TYPES) - 1)]
|
||||
var available_types = ALL_TYPES
|
||||
|
||||
if type:
|
||||
available_types = available_types.filter(
|
||||
func(t : Type): return t != type
|
||||
)
|
||||
|
||||
type = available_types[rng.randi_range(0, len(available_types) - 1)]
|
||||
|
||||
func generate():
|
||||
wind_direction = Vector2(1,0).rotated(rng.randf_range(PI, -PI))
|
||||
|
||||
@@ -4,18 +4,23 @@ class_name Region
|
||||
const MIN_PASS_DAY_ANIMATION_TIME : float = PassDay.TIME_MARGIN * 2
|
||||
|
||||
const WIN_WAVE_SCENE : PackedScene = preload("res://stages/terrain/region/win_wave.tscn")
|
||||
const TALION_CELL_SCENE : PackedScene = preload("res://entities/interactables/talion_cell/talion_cell.tscn")
|
||||
const ENERGY_CELL_SCENE : PackedScene = preload("res://entities/interactables/energy_cell/energy_cell.tscn")
|
||||
|
||||
const TILE_SET : TileSet = preload("res://stages/terrain/region/resources/moss_biome.tres")
|
||||
const TILE_SCALE = 1
|
||||
const TILE_SIZE : int = roundi(TILE_SET.tile_size.x * TILE_SCALE)
|
||||
const SPAWN_OBJECT_RANDOM_MOVEMENT = 200
|
||||
const DOORS_RANDOM_MOVEMENT = 3000
|
||||
const CELLS_RANDOM_MOVEMENT = 4000
|
||||
|
||||
const CHUNK_TILE_SIZE : int = 10
|
||||
const CHUNK_SIZE = CHUNK_TILE_SIZE * TILE_SIZE
|
||||
const CHUNK_LOAD_DISTANCE : int = 2
|
||||
const CHUNK_UNLOAD_DISTANCE : int = 3
|
||||
|
||||
const REGION_DATA_UPDATE_INTERVAL = 4.
|
||||
|
||||
const MAX_GENERATION_THREAD = 1 # Crash when superior to 1
|
||||
|
||||
var is_generated : bool : get = check_is_generated
|
||||
@@ -34,6 +39,9 @@ var score_by_plant : Dictionary[PlantData, int] = {}
|
||||
var generated_chunks : Array[Chunk] = []
|
||||
var generation_semaphore : Semaphore
|
||||
|
||||
var elapsed_time = 0.
|
||||
var data_last_updated = 0.
|
||||
|
||||
@onready var recharge_station : TruckRecharge = %RechargeStation
|
||||
@onready var camera : RegionCamera = %Camera
|
||||
|
||||
@@ -78,6 +86,8 @@ func _ready():
|
||||
|
||||
random_move_object(recharge_station, SPAWN_OBJECT_RANDOM_MOVEMENT)
|
||||
recharge_station.update()
|
||||
generate_talion_cells()
|
||||
generate_energy_cells()
|
||||
|
||||
for m in data.modifiers:
|
||||
m.region_ready(self)
|
||||
@@ -88,9 +98,16 @@ func _ready():
|
||||
GameInfo.game_data.player_data.inventory.add_item(Fork.new())
|
||||
GameInfo.game_data.player_data.inventory.add_item(ShipPortal.new())
|
||||
|
||||
|
||||
data.succeded.connect(finishing_region_animation)
|
||||
|
||||
func _process(_d):
|
||||
func _process(delta : float):
|
||||
elapsed_time += delta
|
||||
|
||||
if elapsed_time > data_last_updated + REGION_DATA_UPDATE_INTERVAL:
|
||||
data_last_updated = elapsed_time
|
||||
data.update()
|
||||
|
||||
if player:
|
||||
generate_near_chunks(player)
|
||||
remove_far_chunks(player)
|
||||
@@ -149,6 +166,38 @@ func check_is_generated() -> bool:
|
||||
ret = false
|
||||
return ret
|
||||
|
||||
func generate_talion_cells() -> Array[TalionCell]:
|
||||
var tcs : Array[TalionCell] = []
|
||||
|
||||
for i in range(data.talion_cell_number):
|
||||
var new_talion_cell := (TALION_CELL_SCENE.instantiate() as TalionCell)
|
||||
new_talion_cell.name = "TalionCell%d" % i
|
||||
new_talion_cell.used = new_talion_cell.name in data.used_objects
|
||||
|
||||
add_entity(new_talion_cell)
|
||||
|
||||
random_move_object(new_talion_cell, CELLS_RANDOM_MOVEMENT)
|
||||
|
||||
tcs.append(new_talion_cell)
|
||||
|
||||
return tcs
|
||||
|
||||
func generate_energy_cells() -> Array[EnergyCell]:
|
||||
var tcs : Array[EnergyCell] = []
|
||||
|
||||
for i in range(data.energy_cell_number):
|
||||
var new_energy_cell := (ENERGY_CELL_SCENE.instantiate() as EnergyCell)
|
||||
new_energy_cell.name = "EnergyCell%d" % i
|
||||
new_energy_cell.used = new_energy_cell.name in data.used_objects
|
||||
|
||||
add_entity(new_energy_cell)
|
||||
|
||||
random_move_object(new_energy_cell, CELLS_RANDOM_MOVEMENT)
|
||||
|
||||
tcs.append(new_energy_cell)
|
||||
|
||||
return tcs
|
||||
|
||||
func get_generated_value() -> float:
|
||||
# if layer_pack:
|
||||
# return layer_pack.generated_value
|
||||
@@ -174,6 +223,20 @@ func random_move_object(
|
||||
|
||||
dig_hole(object.global_position, 100)
|
||||
|
||||
func random_move_object_in_circle(
|
||||
object : Node2D,
|
||||
random_movement: int = SPAWN_OBJECT_RANDOM_MOVEMENT,
|
||||
offset : Vector2 = Vector2.ZERO
|
||||
):
|
||||
var rng := RandomNumberGenerator.new()
|
||||
rng.seed = data.region_seed + object.name.hash()
|
||||
|
||||
var rand_angle = rng.randf_range(-PI, PI)
|
||||
|
||||
object.position = (Vector2.UP * random_movement).rotated(rand_angle) + offset
|
||||
|
||||
dig_hole(object.global_position, 100)
|
||||
|
||||
func is_chunk_generated(coord : Vector2i):
|
||||
return generated_chunks.find_custom(
|
||||
func (c: Chunk) : return get_chunk_key(c.chunk_coord) == get_chunk_key(coord)
|
||||
@@ -306,6 +369,9 @@ func decontaminate(tiles_coords : Array[Vector2i], save_tiles_diff := true):
|
||||
chunk.decontamination_layer.place_decontaminations(coords)
|
||||
|
||||
func finishing_region_animation():
|
||||
recharge_station.update()
|
||||
|
||||
await get_tree().create_timer(2.).timeout
|
||||
var win_wave := WIN_WAVE_SCENE.instantiate() as WinWave
|
||||
add_entity(win_wave)
|
||||
win_wave.started_time = 0.
|
||||
|
||||
@@ -11,8 +11,8 @@ signal pass_day_started(region_data : RegionData)
|
||||
signal pass_day_proceeded(region_data : RegionData)
|
||||
signal pass_day_ended(region_data : RegionData)
|
||||
|
||||
const MAX_RANDOM_SPAWN_DISTANCE = 3000
|
||||
const START_ROCK_HOLE_RADIUS = 5
|
||||
const MAX_RANDOM_SPAWN_DISTANCE = 2000
|
||||
const START_ROCK_HOLE_RADIUS = 0
|
||||
const PLAYER_ROCK_HOLE_RADIUS = 5
|
||||
|
||||
@export var region_seed : int
|
||||
@@ -22,7 +22,9 @@ const PLAYER_ROCK_HOLE_RADIUS = 5
|
||||
@export var decontamination_threshold : float
|
||||
@export var cristal_threshold : float
|
||||
@export var start_decontamination_hole_radius = 3
|
||||
@export var seed_rarity_pool : Array[int] = [0,0,0,0,0,0,0,1,1,1]
|
||||
@export var seed_rarity_pool : Array[int]
|
||||
@export var talion_cell_number : int
|
||||
@export var energy_cell_number : int
|
||||
|
||||
@export var day : int = 1
|
||||
@export var entities_saved_data : Array[EntityData] = []
|
||||
@@ -38,6 +40,7 @@ const PLAYER_ROCK_HOLE_RADIUS = 5
|
||||
@export var completed_doors : Array[int] = [] # List of completed doors
|
||||
@export var modifiers : Array[RegionModifier]
|
||||
|
||||
@export var used_objects : Array[String]
|
||||
|
||||
@export var charges : int :
|
||||
set(v):
|
||||
@@ -69,6 +72,8 @@ func _init(
|
||||
cristal_threshold = parameter.get_cristal_threshold()
|
||||
start_decontamination_hole_radius = parameter.get_start_decontamination_zone_radius()
|
||||
seed_rarity_pool = parameter.get_seed_rarity_pool()
|
||||
talion_cell_number = parameter.get_talion_cell_chance().pick_random()
|
||||
energy_cell_number = parameter.get_energy_cell_chance().pick_random()
|
||||
modifiers = parameter.modifiers
|
||||
|
||||
player_spawn = get_random_spawn_position()
|
||||
@@ -82,15 +87,16 @@ func _init(
|
||||
edit_map_origin()
|
||||
|
||||
func update():
|
||||
var old_state = state
|
||||
if not in_passing_day_animation and not objective_disabled:
|
||||
if objective > 0 and get_score() >= objective and not GameInfo.game_data.current_run.story_step is TutorialStoryStep:
|
||||
if state != State.SUCCEEDED:
|
||||
succeded.emit()
|
||||
state = State.SUCCEEDED
|
||||
if old_state != State.SUCCEEDED:
|
||||
succeded.emit()
|
||||
if state != State.SUCCEEDED and charges == 0:
|
||||
if state != State.FAILED:
|
||||
failed.emit()
|
||||
state = State.FAILED
|
||||
if old_state != State.FAILED:
|
||||
failed.emit()
|
||||
updated.emit(self)
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -2,11 +2,13 @@ extends Resource
|
||||
class_name RegionParameter
|
||||
|
||||
const DEFAULT_ROCK_THRESHOLD = 0.3
|
||||
const DEFAULT_DECONTAMINATION_THRESHOLD = 0.5
|
||||
const DEFAULT_DECONTAMINATION_THRESHOLD = 0.35
|
||||
const DEFAULT_CRISTAL_THRESHOLD = 0.1
|
||||
const DEFAULT_CHARGE = 8
|
||||
const DEFAULT_CHARGE = 10
|
||||
const DEFAULT_TALION_CELL_CHANCE : Array[int] = [1,2,2,2,3]
|
||||
const DEFAULT_ENERGY_CELL_CHANCE : Array[int] = [3,4,4,4,5]
|
||||
const DEFAULT_START_DECONTAMINATION_ZONE_RADIUS = 3
|
||||
const DEFAULT_SEED_RARITY_POOL: Array[int] = [-1,-1,-1,-1,0,0,0,0,1,1]
|
||||
const DEFAULT_SEED_RARITY_POOL: Array[int] = [-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,1]
|
||||
|
||||
@export var region_name : String
|
||||
@export var objective : int
|
||||
@@ -98,3 +100,19 @@ func get_seed_rarity_pool() -> Array[int]:
|
||||
seed_rarity_pool = m.modify_seed_rarity_pool(seed_rarity_pool)
|
||||
|
||||
return seed_rarity_pool
|
||||
|
||||
func get_talion_cell_chance() -> Array[int]:
|
||||
var talion_cell_chance := DEFAULT_TALION_CELL_CHANCE
|
||||
|
||||
for m in modifiers:
|
||||
talion_cell_chance = m.modify_talion_cell_chance(talion_cell_chance)
|
||||
|
||||
return talion_cell_chance
|
||||
|
||||
func get_energy_cell_chance() -> Array[int]:
|
||||
var energy_cell_chance := DEFAULT_ENERGY_CELL_CHANCE
|
||||
|
||||
for m in modifiers:
|
||||
energy_cell_chance = m.modify_energy_cell_chance(energy_cell_chance)
|
||||
|
||||
return energy_cell_chance
|
||||
|
||||
@@ -51,7 +51,6 @@ func update():
|
||||
for p in region.entity_container.get_children():
|
||||
if (
|
||||
p is Plant
|
||||
and p.data.get_state() == PlantData.State.MATURE
|
||||
and not p in plant_looted
|
||||
and p.position.distance_to(self.position) < get_radius()
|
||||
):
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
extends Region
|
||||
|
||||
func _init():
|
||||
if not GameInfo.game_data.current_region_data:
|
||||
GameInfo.game_data.current_region_data = RegionData.new(
|
||||
RegionParameter.new()
|
||||
)
|
||||
|
||||
data = GameInfo.game_data.current_region_data
|
||||
|
||||
func _ready():
|
||||
player = %Player
|
||||
|
||||
player.controlling_player = true
|
||||
|
||||
player.global_position = data.player_position
|
||||
|
||||
func _process(_d):
|
||||
pass
|
||||
@@ -0,0 +1 @@
|
||||
uid://fqe55cbk0usp
|
||||
35
stages/terrain/region/tutorial_region/tutorial_region.tscn
Normal file
35
stages/terrain/region/tutorial_region/tutorial_region.tscn
Normal file
@@ -0,0 +1,35 @@
|
||||
[gd_scene format=3 uid="uid://ne5r7ct0bnwb"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://fqe55cbk0usp" path="res://stages/terrain/region/tutorial_region/scripts/tutorial_region.gd" id="1_pj6fy"]
|
||||
[ext_resource type="PackedScene" uid="uid://12nak7amd1uq" path="res://gui/game/game_gui.tscn" id="2_362ox"]
|
||||
[ext_resource type="PackedScene" uid="uid://bgvbgeq46wee2" path="res://entities/player/player.tscn" id="2_pj6fy"]
|
||||
[ext_resource type="PackedScene" uid="uid://d324mlmgls4fs" path="res://entities/interactables/truck/recharge/truck_recharge.tscn" id="3_0uj74"]
|
||||
[ext_resource type="PackedScene" uid="uid://yk78ubpu5ghq" path="res://gui/game/pass_day/pass_day.tscn" id="3_okxyg"]
|
||||
[ext_resource type="PackedScene" uid="uid://dj7gp3crtg2yt" path="res://entities/camera/camera.tscn" id="4_pj6fy"]
|
||||
[ext_resource type="PackedScene" uid="uid://fnv0qhkh40mv" path="res://gui/game/announce/announce.tscn" id="4_qc5a5"]
|
||||
|
||||
[node name="TutorialRegion" type="Node2D" unique_id=620571771 node_paths=PackedStringArray("entity_container")]
|
||||
script = ExtResource("1_pj6fy")
|
||||
entity_container = NodePath("Entities")
|
||||
|
||||
[node name="GameGui" parent="." unique_id=274698556 instance=ExtResource("2_362ox")]
|
||||
|
||||
[node name="PassDay" parent="." unique_id=335255544 instance=ExtResource("3_okxyg")]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="Announce" parent="." unique_id=1659074958 instance=ExtResource("4_qc5a5")]
|
||||
layer = 3
|
||||
|
||||
[node name="Entities" type="Node2D" parent="." unique_id=652016014]
|
||||
y_sort_enabled = true
|
||||
|
||||
[node name="Player" parent="Entities" unique_id=447849413 instance=ExtResource("2_pj6fy")]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="RechargeStation" parent="Entities" unique_id=1099196706 instance=ExtResource("3_0uj74")]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(0, -205)
|
||||
|
||||
[node name="Camera" parent="." unique_id=62168089 node_paths=PackedStringArray("following") instance=ExtResource("4_pj6fy")]
|
||||
unique_name_in_owner = true
|
||||
following = NodePath("../Entities/Player")
|
||||
Reference in New Issue
Block a user