ajout de la porte et équilibrage des mutations
This commit is contained in:
@@ -72,7 +72,8 @@ func story():
|
||||
%LiftAnimationPlayer.play("arrive")
|
||||
AudioManager.play_sfx("Elevator")
|
||||
await %Lift.clicked
|
||||
%LiftAnimationPlayer.play_backwards("arrive")
|
||||
%Player3D.controlling_player = false
|
||||
|
||||
AudioManager.play_sfx("Elevator")
|
||||
|
||||
await get_tree().create_timer(LIFT_TIME).timeout
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="9_2kujw"]
|
||||
[ext_resource type="PackedScene" uid="uid://cm5b7w7j6527f" path="res://stages/title_screen/planet_3d.tscn" id="12_stoj6"]
|
||||
[ext_resource type="Texture2D" uid="uid://bsgmxvuphn73c" path="res://common/icons/arrow-narrow-down.svg" id="13_5d7hc"]
|
||||
[ext_resource type="PackedScene" uid="uid://crbjmwumboelw" path="res://gui/game/inventory_gui/inventory_3d.tscn" id="17_inbnt"]
|
||||
[ext_resource type="Script" uid="uid://bq7admu4ahs5r" path="res://entities/player/inventory/scripts/item.gd" id="18_qm808"]
|
||||
[ext_resource type="Script" uid="uid://fnu2d6wna4yc" path="res://entities/player/inventory/scripts/inventory.gd" id="19_kh1yg"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_f7ho8"]
|
||||
script = ExtResource("4_v8ur5")
|
||||
@@ -30,13 +33,13 @@ modifiers = Array[ExtResource("3_xy0a5")]([SubResource("Resource_f7ho8")])
|
||||
[sub_resource type="Resource" id="Resource_qm808"]
|
||||
script = ExtResource("5_v8ur5")
|
||||
region_parameter = SubResource("Resource_inbnt")
|
||||
position = 0.008863045261805778
|
||||
position = 0.00886304526180577
|
||||
metadata/_custom_type_script = "uid://b4eimt3v08jhc"
|
||||
|
||||
[sub_resource type="ViewportTexture" id="ViewportTexture_cvt2p"]
|
||||
viewport_path = NodePath("DestinationScreen/SubViewport")
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_kh1yg"]
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_gbmux"]
|
||||
frequency = 1.0
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_5d7hc"]
|
||||
@@ -193,6 +196,12 @@ _data = {
|
||||
&"hover": SubResource("Animation_stoj6")
|
||||
}
|
||||
|
||||
[sub_resource type="Resource" id="Resource_ne0dp"]
|
||||
script = ExtResource("19_kh1yg")
|
||||
items = Array[ExtResource("18_qm808")]([null, null, null])
|
||||
n_tools = 1
|
||||
metadata/_custom_type_script = "uid://fnu2d6wna4yc"
|
||||
|
||||
[node name="Dashboard" type="Node3D" unique_id=1374334508]
|
||||
script = ExtResource("1_2q8cl")
|
||||
main_screen_icon = ExtResource("2_vlkbw")
|
||||
@@ -204,7 +213,7 @@ right_destination = SubResource("Resource_qm808")
|
||||
|
||||
[node name="DestinationScreen" type="Sprite3D" parent="." unique_id=1067303692]
|
||||
unique_name_in_owner = true
|
||||
transform = Transform3D(-1, 0, -8.742278e-08, 0, 1.0000002, 0, 8.742278e-08, 0, -1, 0, 0.63727874, 0.9382038)
|
||||
transform = Transform3D(-1, 0, -8.742278e-08, 0, 1.0000002, 0, 8.742278e-08, 0, -1, 0, 0.76403993, 0.9382038)
|
||||
pixel_size = 0.002
|
||||
texture = SubResource("ViewportTexture_cvt2p")
|
||||
|
||||
@@ -212,7 +221,7 @@ texture = SubResource("ViewportTexture_cvt2p")
|
||||
transform = Transform3D(-0.1, 0, 8.742278e-09, 0, 0.09999998, 0, -8.742278e-09, 0, -0.1, -1.8938096e-10, 0.24558258, 0.0021662712)
|
||||
radius = 1.0
|
||||
details = 32
|
||||
noise = SubResource("FastNoiseLite_kh1yg")
|
||||
noise = SubResource("FastNoiseLite_gbmux")
|
||||
height = 0.625
|
||||
terrain_material = SubResource("StandardMaterial3D_5d7hc")
|
||||
water_level = 0.0
|
||||
@@ -653,3 +662,9 @@ shape = SubResource("SphereShape3D_2kujw")
|
||||
|
||||
[node name="HoverAnimationPlayer" type="AnimationPlayer" parent="LeftScreen" unique_id=332045443]
|
||||
libraries/ = SubResource("AnimationLibrary_5d7hc")
|
||||
|
||||
[node name="Inventory3D" parent="." unique_id=810532522 instance=ExtResource("17_inbnt")]
|
||||
unique_name_in_owner = true
|
||||
transform = Transform3D(1, 0, 8.940697e-08, 0, 1, 0, -8.940697e-08, 0, 1, 0, 0.5876103, 0.89364576)
|
||||
no_tools = true
|
||||
test_inventory = SubResource("Resource_ne0dp")
|
||||
|
||||
@@ -43,6 +43,9 @@ func _ready():
|
||||
set_left_destination()
|
||||
set_right_destination()
|
||||
|
||||
if not Engine.is_editor_hint() and GameInfo.game_data.player_data:
|
||||
%Inventory3D.update(GameInfo.game_data.player_data.inventory)
|
||||
|
||||
func set_main_screen_icon(v : Texture = main_screen_icon):
|
||||
main_screen_icon = v
|
||||
if is_node_ready():
|
||||
|
||||
@@ -12,6 +12,9 @@
|
||||
[ext_resource type="PackedScene" uid="uid://b8m537op75gib" path="res://entities/interactables/door/door.tscn" id="8_2f6js"]
|
||||
[ext_resource type="PackedScene" uid="uid://dj7gp3crtg2yt" path="res://entities/camera/camera.tscn" id="8_fwgig"]
|
||||
[ext_resource type="Texture2D" uid="uid://rdrhi3r11ey6" path="res://common/icons/square-rounded.svg" id="10_ktnx3"]
|
||||
[ext_resource type="Texture2D" uid="uid://b752eqq4cm7ve" path="res://common/icons/building-factory-2.svg" id="11_fwgig"]
|
||||
[ext_resource type="Texture2D" uid="uid://dg00xnpp6ixls" path="res://common/icons/server-2.svg" id="12_mlppq"]
|
||||
[ext_resource type="Texture2D" uid="uid://1ynlp05wj0hm" path="res://common/icons/rocket.svg" id="13_r4e5h"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_qdnee"]
|
||||
shader = ExtResource("2_ktnx3")
|
||||
@@ -135,8 +138,7 @@ position = Vector2(-405, -151)
|
||||
[node name="AstraDoor" parent="Entities" unique_id=2053096538 instance=ExtResource("8_2f6js")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
modulate = Color(1, 0, 0, 1)
|
||||
available = false
|
||||
icon = ExtResource("11_fwgig")
|
||||
default_info_title = "ASTRA_FACTORY"
|
||||
default_info_desc = "ASTRA_FACTORY_TEXT"
|
||||
|
||||
@@ -145,18 +147,19 @@ unique_name_in_owner = true
|
||||
visible = false
|
||||
position = Vector2(91, -177)
|
||||
to_scene_id = "BOREA"
|
||||
icon = ExtResource("12_mlppq")
|
||||
default_interact_text = "ENTER"
|
||||
available = true
|
||||
default_info_title = "BOREA_BASE"
|
||||
default_info_desc = "BOREA_BASE_DESC_TEXT"
|
||||
|
||||
[node name="ShipGarageDoor" parent="Entities" unique_id=1073871193 instance=ExtResource("8_2f6js")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
modulate = Color(1, 0, 0, 1)
|
||||
position = Vector2(91, -177)
|
||||
to_scene_id = "GARAGE"
|
||||
icon = ExtResource("13_r4e5h")
|
||||
default_interact_text = "ENTER"
|
||||
available = false
|
||||
default_info_title = "MYSTERIOUS_DOOR"
|
||||
default_info_desc = "MYSTERIOUS_DOOR_TEXT"
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ func _ready():
|
||||
if e is Plant:
|
||||
data.add_plant_data(e.data, false)
|
||||
|
||||
%AstraDoor.global_position = data.player_spawn
|
||||
%AstraDoor.global_position = data.player_spawn + Vector2.UP * 100
|
||||
player.global_position = data.player_position
|
||||
|
||||
setup_flagged_properties()
|
||||
@@ -153,14 +153,14 @@ func save():
|
||||
data.player_position = player.global_position
|
||||
GameInfo.save_game_data()
|
||||
|
||||
func spawn_object_random_move(object : Node2D):
|
||||
func spawn_object_random_move(object : Node2D, offset : Vector2 = Vector2.ZERO):
|
||||
var rng := RandomNumberGenerator.new()
|
||||
rng.seed = data.region_seed + object.name.hash()
|
||||
|
||||
object.position = Vector2(
|
||||
rng.randf_range(-SPAWN_OBJECT_RANDOM_MOVEMENT,+SPAWN_OBJECT_RANDOM_MOVEMENT),
|
||||
rng.randf_range(-SPAWN_OBJECT_RANDOM_MOVEMENT,SPAWN_OBJECT_RANDOM_MOVEMENT)
|
||||
)
|
||||
) + offset
|
||||
|
||||
func setup_flagged_properties():
|
||||
|
||||
@@ -177,6 +177,7 @@ func setup_flagged_properties():
|
||||
%ShipGarageDoor.available = data.state == RegionData.State.SUCCEEDED
|
||||
%Tutorial.succeded.connect(
|
||||
func ():
|
||||
await get_tree().create_timer(1.).timeout
|
||||
%ShipGarageDoor.available = true
|
||||
)
|
||||
"borea":
|
||||
@@ -230,7 +231,6 @@ func get_chunk_for_coord(tile_coord : Vector2i) -> Chunk:
|
||||
if chunk.is_generated:
|
||||
var local_coord = TilesDiffData.get_local_coord(tile_coord, chunk.chunk_coord)
|
||||
if chunk.is_tile_in_chunk(local_coord):
|
||||
print(chunk.chunk_coord)
|
||||
return chunk
|
||||
return null
|
||||
|
||||
@@ -266,4 +266,15 @@ func loot_talion(coord : Vector2i):
|
||||
10
|
||||
)
|
||||
|
||||
func decontaminate(tiles_coords : Array[Vector2i], save_tiles_diff := true):
|
||||
if save_tiles_diff :
|
||||
data.decontamination_tiles_data.update_tiles_diff(tiles_coords, TilesDiffData.TileDiff.PRESENT)
|
||||
|
||||
for coord in tiles_coords:
|
||||
var chunk : Chunk = get_chunk_for_coord(coord)
|
||||
if chunk:
|
||||
var local_coord := TilesDiffData.get_local_coord(coord, chunk.chunk_coord)
|
||||
|
||||
chunk.decontamination_layer.place_decontamination(local_coord)
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -9,76 +9,75 @@ var player : Player
|
||||
|
||||
|
||||
func instantiate_entity(s: PackedScene, entity_position : Vector2):
|
||||
var entity = s.instantiate() as Node2D
|
||||
var entity = s.instantiate() as Node2D
|
||||
|
||||
add_entity(entity, entity_position)
|
||||
add_entity(entity, entity_position)
|
||||
|
||||
entity.global_position = entity_position
|
||||
entity.global_position = entity_position
|
||||
|
||||
func add_entity(entity : Node2D, entity_global_position : Vector2 = Vector2.ZERO, container : Node2D = entity_container):
|
||||
if entity.get_parent():
|
||||
if entity.get_parent().get_parent() is Terrain:
|
||||
entity.get_parent().get_parent().remove_entity(entity)
|
||||
else:
|
||||
entity.get_parent().remove_child(entity)
|
||||
if entity.get_parent():
|
||||
if entity.get_parent().get_parent() is Terrain:
|
||||
entity.get_parent().get_parent().remove_entity(entity)
|
||||
else:
|
||||
entity.get_parent().remove_child(entity)
|
||||
|
||||
enroll_entity(entity)
|
||||
enroll_entity(entity)
|
||||
|
||||
container.add_child(entity)
|
||||
entity.global_position = entity_global_position
|
||||
container.add_child(entity)
|
||||
entity.global_position = entity_global_position
|
||||
|
||||
func enroll_entity(entity : Node2D):
|
||||
if "terrain" in entity:
|
||||
entity.terrain = self
|
||||
if "terrain" in entity:
|
||||
entity.terrain = self
|
||||
|
||||
if entity is Player:
|
||||
player = entity
|
||||
if entity is Player:
|
||||
player = entity
|
||||
|
||||
|
||||
func save_entities() -> Array[EntityData]:
|
||||
var saved_entities_data : Array[EntityData] = []
|
||||
for e in entity_container.get_children():
|
||||
if e is Entity:
|
||||
var saved_data : EntityData = e.save()
|
||||
if saved_data:
|
||||
saved_entities_data.append(saved_data)
|
||||
return saved_entities_data
|
||||
var saved_entities_data : Array[EntityData] = []
|
||||
for e in entity_container.get_children():
|
||||
if e is Entity:
|
||||
var saved_data : EntityData = e.save()
|
||||
if saved_data:
|
||||
saved_entities_data.append(saved_data)
|
||||
return saved_entities_data
|
||||
|
||||
func load_entities(saved_entities_data : Array[EntityData]):
|
||||
for static_entity in entity_container.get_children():
|
||||
enroll_entity(static_entity)
|
||||
for static_entity in entity_container.get_children():
|
||||
enroll_entity(static_entity)
|
||||
|
||||
for save_data in saved_entities_data:
|
||||
var entity = save_data.load_entity()
|
||||
if entity:
|
||||
add_entity(entity, save_data.position)
|
||||
for save_data in saved_entities_data:
|
||||
var entity = save_data.load_entity()
|
||||
if entity:
|
||||
add_entity(entity, save_data.position)
|
||||
|
||||
func remove_entity(e : Node2D, container : Node2D = entity_container):
|
||||
if e.get_parent() == entity_container:
|
||||
container.remove_child(e)
|
||||
if e.get_parent() == entity_container:
|
||||
container.remove_child(e)
|
||||
|
||||
func create_entity_container() -> Node2D:
|
||||
var container = Node2D.new()
|
||||
container.y_sort_enabled = true
|
||||
var container = Node2D.new()
|
||||
container.y_sort_enabled = true
|
||||
|
||||
add_child(container)
|
||||
add_child(container)
|
||||
|
||||
return container
|
||||
return container
|
||||
|
||||
func drop_item(item: Item, item_position : Vector2, random_displacement_factor = 0) -> ItemObject:
|
||||
var item_object = ItemObject.new(item)
|
||||
add_entity(item_object, item_position)
|
||||
var item_object = ItemObject.new(item)
|
||||
add_entity(item_object, item_position)
|
||||
|
||||
if random_displacement_factor:
|
||||
var displacement_direction = randf_range(0,2*PI)
|
||||
var displacement = Vector2.ONE.rotated(displacement_direction) * randf_range(0, random_displacement_factor)
|
||||
var tween : Tween = get_tree().create_tween()
|
||||
tween.tween_property(
|
||||
item_object,
|
||||
"position",
|
||||
item_object.position + displacement,
|
||||
0.2
|
||||
)
|
||||
|
||||
return item_object
|
||||
if random_displacement_factor:
|
||||
var displacement_direction = randf_range(0,2*PI)
|
||||
var displacement = Vector2.ONE.rotated(displacement_direction) * randf_range(0, random_displacement_factor)
|
||||
var tween : Tween = get_tree().create_tween()
|
||||
tween.tween_property(
|
||||
item_object,
|
||||
"position",
|
||||
item_object.position + displacement,
|
||||
0.2
|
||||
)
|
||||
|
||||
return item_object
|
||||
|
||||
Reference in New Issue
Block a user