New beginnings
This commit is contained in:
parent
074bb21ffd
commit
d9b2d16db8
105 changed files with 10 additions and 1923 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
[gd_resource type="Theme" load_steps=6 format=3 uid="uid://csh7en7c4otv6"]
|
[gd_resource type="Theme" load_steps=6 format=3 uid="uid://csh7en7c4otv6"]
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://3h6y6jxhf1qp" path="res://sprites/Uitto.png" id="1_cpeo0"]
|
[ext_resource type="Texture2D" uid="uid://3h6y6jxhf1qp" path="res://atlasses/Uitto.png" id="1_cpeo0"]
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_cpeo0"]
|
[sub_resource type="AtlasTexture" id="AtlasTexture_cpeo0"]
|
||||||
atlas = ExtResource("1_cpeo0")
|
atlas = ExtResource("1_cpeo0")
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
|
@ -3,15 +3,15 @@
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://3h6y6jxhf1qp"
|
uid="uid://3h6y6jxhf1qp"
|
||||||
path="res://.godot/imported/Uitto.png-aa56f94032c469259c3a25656653a91a.ctex"
|
path="res://.godot/imported/Uitto.png-9efeca1f14ae166610f5a34f2f69dbbd.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://sprites/Uitto.png"
|
source_file="res://atlasses/Uitto.png"
|
||||||
dest_files=["res://.godot/imported/Uitto.png-aa56f94032c469259c3a25656653a91a.ctex"]
|
dest_files=["res://.godot/imported/Uitto.png-9efeca1f14ae166610f5a34f2f69dbbd.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 919 B After Width: | Height: | Size: 919 B |
|
|
@ -3,15 +3,15 @@
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://5a173ko7iowk"
|
uid="uid://5a173ko7iowk"
|
||||||
path="res://.godot/imported/Lorpeka.png-f43a0d85fcb09484172c72994d520a0f.ctex"
|
path="res://.godot/imported/Lorpeka.png-b67436292437ad95740c1d05d46f150b.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://sprites/atlasses/Lorpeka.png"
|
source_file="res://atlasses/atlasses/Lorpeka.png"
|
||||||
dest_files=["res://.godot/imported/Lorpeka.png-f43a0d85fcb09484172c72994d520a0f.ctex"]
|
dest_files=["res://.godot/imported/Lorpeka.png-b67436292437ad95740c1d05d46f150b.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
|
@ -3,15 +3,15 @@
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://gfkhedfdi7ug"
|
uid="uid://gfkhedfdi7ug"
|
||||||
path="res://.godot/imported/Popekko.png-5c34a5f2a8c85fcf59453310fa6553d9.ctex"
|
path="res://.godot/imported/Popekko.png-819a403b20da6f38897fc9b448aa97ec.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://sprites/atlasses/Popekko.png"
|
source_file="res://atlasses/atlasses/Popekko.png"
|
||||||
dest_files=["res://.godot/imported/Popekko.png-5c34a5f2a8c85fcf59453310fa6553d9.ctex"]
|
dest_files=["res://.godot/imported/Popekko.png-819a403b20da6f38897fc9b448aa97ec.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
[gd_resource type="Resource" script_class="Item" load_steps=4 format=3 uid="uid://cpjlj1vm46t08"]
|
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://gfkhedfdi7ug" path="res://sprites/atlasses/Popekko.png" id="1_hmnnx"]
|
|
||||||
[ext_resource type="Script" uid="uid://p5327ibxtyfs" path="res://scripts/item.gd" id="2_t6mdl"]
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_h7cm1"]
|
|
||||||
atlas = ExtResource("1_hmnnx")
|
|
||||||
region = Rect2(0, 16, 4, 4)
|
|
||||||
|
|
||||||
[resource]
|
|
||||||
script = ExtResource("2_t6mdl")
|
|
||||||
display_name = &"Input1"
|
|
||||||
preview = SubResource("AtlasTexture_h7cm1")
|
|
||||||
stack_size = 2
|
|
||||||
metadata/_custom_type_script = "uid://p5327ibxtyfs"
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
[gd_resource type="Resource" script_class="Item" load_steps=4 format=3 uid="uid://c23vqjqnyo6f3"]
|
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://gfkhedfdi7ug" path="res://sprites/atlasses/Popekko.png" id="1_7lekm"]
|
|
||||||
[ext_resource type="Script" uid="uid://p5327ibxtyfs" path="res://scripts/item.gd" id="2_50iur"]
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_7lekm"]
|
|
||||||
atlas = ExtResource("1_7lekm")
|
|
||||||
region = Rect2(4, 16, 4, 4)
|
|
||||||
|
|
||||||
[resource]
|
|
||||||
script = ExtResource("2_50iur")
|
|
||||||
display_name = &"Input2"
|
|
||||||
preview = SubResource("AtlasTexture_7lekm")
|
|
||||||
stack_size = 2
|
|
||||||
metadata/_custom_type_script = "uid://p5327ibxtyfs"
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
[gd_resource type="Resource" script_class="Item" load_steps=4 format=3 uid="uid://c16fy6r43xlg1"]
|
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://gfkhedfdi7ug" path="res://sprites/atlasses/Popekko.png" id="1_r3jjm"]
|
|
||||||
[ext_resource type="Script" uid="uid://p5327ibxtyfs" path="res://scripts/item.gd" id="2_rkyi0"]
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_r3jjm"]
|
|
||||||
atlas = ExtResource("1_r3jjm")
|
|
||||||
region = Rect2(8, 16, 4, 4)
|
|
||||||
|
|
||||||
[resource]
|
|
||||||
script = ExtResource("2_rkyi0")
|
|
||||||
display_name = &"Output"
|
|
||||||
preview = SubResource("AtlasTexture_r3jjm")
|
|
||||||
stack_size = 5
|
|
||||||
metadata/_custom_type_script = "uid://p5327ibxtyfs"
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
[gd_resource type="TileSet" load_steps=3 format=3 uid="uid://bv75bu0af04vs"]
|
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://5a173ko7iowk" path="res://sprites/atlasses/Lorpeka.png" id="1_eak7k"]
|
|
||||||
|
|
||||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_vxqge"]
|
|
||||||
texture = ExtResource("1_eak7k")
|
|
||||||
0:0/0 = 0
|
|
||||||
0:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
|
||||||
1:0/0 = 0
|
|
||||||
0:1/0 = 0
|
|
||||||
0:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
|
||||||
1:1/0 = 0
|
|
||||||
0:2/0 = 0
|
|
||||||
1:2/0 = 0
|
|
||||||
2:2/0 = 0
|
|
||||||
2:1/0 = 0
|
|
||||||
2:0/0 = 0
|
|
||||||
3:0/0 = 0
|
|
||||||
3:1/0 = 0
|
|
||||||
3:2/0 = 0
|
|
||||||
4:1/0 = 0
|
|
||||||
4:2/0 = 0
|
|
||||||
5:2/0 = 0
|
|
||||||
5:1/0 = 0
|
|
||||||
4:0/0 = 0
|
|
||||||
5:0/0 = 0
|
|
||||||
6:0/0 = 0
|
|
||||||
6:1/0 = 0
|
|
||||||
|
|
||||||
[resource]
|
|
||||||
physics_layer_0/collision_layer = 1
|
|
||||||
sources/0 = SubResource("TileSetAtlasSource_vxqge")
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
[gd_resource type="Resource" script_class="Prototype" load_steps=5 format=3 uid="uid://dj524jjal1f0n"]
|
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://c80sp6f77l5ha" path="res://scripts/prototype.gd" id="1_53h7j"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://gfkhedfdi7ug" path="res://sprites/atlasses/Popekko.png" id="1_x27pp"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://b0h8dd82b3ox5" path="res://scenes/structures/conveyor.tscn" id="2_hinjf"]
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_uvy8r"]
|
|
||||||
atlas = ExtResource("1_x27pp")
|
|
||||||
region = Rect2(16, 0, 16, 16)
|
|
||||||
|
|
||||||
[resource]
|
|
||||||
script = ExtResource("1_53h7j")
|
|
||||||
scene = ExtResource("2_hinjf")
|
|
||||||
preview = SubResource("AtlasTexture_uvy8r")
|
|
||||||
metadata/_custom_type_script = "uid://c80sp6f77l5ha"
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
[gd_resource type="Resource" script_class="Prototype" load_steps=5 format=3 uid="uid://yn1iesx30nfu"]
|
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://c80sp6f77l5ha" path="res://scripts/prototype.gd" id="1_mqcr0"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://gfkhedfdi7ug" path="res://sprites/atlasses/Popekko.png" id="1_sh8t1"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://dfatkxv6n55dw" path="res://scenes/structures/debug_assembler.tscn" id="2_kf3x0"]
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_kf3x0"]
|
|
||||||
atlas = ExtResource("1_sh8t1")
|
|
||||||
region = Rect2(48, 0, 32, 32)
|
|
||||||
|
|
||||||
[resource]
|
|
||||||
script = ExtResource("1_mqcr0")
|
|
||||||
scene = ExtResource("2_kf3x0")
|
|
||||||
preview = SubResource("AtlasTexture_kf3x0")
|
|
||||||
metadata/_custom_type_script = "uid://c80sp6f77l5ha"
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
[gd_resource type="Resource" script_class="Prototype" load_steps=4 format=3 uid="uid://jhe8wtjoo6c6"]
|
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://ugbe4qcmgfw0" path="res://icon.svg" id="1_movbu"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://cteh8r405wqwk" path="res://scenes/structures/debug_item_deposit.tscn" id="2_wp7ck"]
|
|
||||||
[ext_resource type="Script" uid="uid://c80sp6f77l5ha" path="res://scripts/prototype.gd" id="3_benq7"]
|
|
||||||
|
|
||||||
[resource]
|
|
||||||
script = ExtResource("3_benq7")
|
|
||||||
scene = ExtResource("2_wp7ck")
|
|
||||||
preview = ExtResource("1_movbu")
|
|
||||||
metadata/_custom_type_script = "uid://c80sp6f77l5ha"
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
[gd_resource type="Resource" script_class="Prototype" load_steps=5 format=3 uid="uid://bm2tggegnoik2"]
|
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://c80sp6f77l5ha" path="res://scripts/prototype.gd" id="1_cghkd"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://gfkhedfdi7ug" path="res://sprites/atlasses/Popekko.png" id="1_flgjh"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://bp4uvx2sdunfr" path="res://scenes/structures/splitter.tscn" id="2_2ry43"]
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_04mjq"]
|
|
||||||
atlas = ExtResource("1_flgjh")
|
|
||||||
region = Rect2(80, 16, 16, 32)
|
|
||||||
|
|
||||||
[resource]
|
|
||||||
script = ExtResource("1_cghkd")
|
|
||||||
scene = ExtResource("2_2ry43")
|
|
||||||
preview = SubResource("AtlasTexture_04mjq")
|
|
||||||
metadata/_custom_type_script = "uid://c80sp6f77l5ha"
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
[gd_resource type="Resource" script_class="Prototype" load_steps=5 format=3 uid="uid://wxfa130pbn18"]
|
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://gfkhedfdi7ug" path="res://sprites/atlasses/Popekko.png" id="1_erjr6"]
|
|
||||||
[ext_resource type="Script" uid="uid://c80sp6f77l5ha" path="res://scripts/prototype.gd" id="1_jurq1"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://dpsrwmum6rbmi" path="res://scenes/structures/trash_can.tscn" id="2_qlygk"]
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_lldoj"]
|
|
||||||
atlas = ExtResource("1_erjr6")
|
|
||||||
region = Rect2(80, 0, 16, 16)
|
|
||||||
|
|
||||||
[resource]
|
|
||||||
script = ExtResource("1_jurq1")
|
|
||||||
scene = ExtResource("2_qlygk")
|
|
||||||
preview = SubResource("AtlasTexture_lldoj")
|
|
||||||
metadata/_custom_type_script = "uid://c80sp6f77l5ha"
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
[gd_resource type="Resource" script_class="Recipe" load_steps=9 format=3 uid="uid://d2lbc1qqkayaa"]
|
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://w4v6jqv1ygqb" path="res://scripts/recipe/recipe_part.gd" id="1_no0hw"]
|
|
||||||
[ext_resource type="Resource" uid="uid://cpjlj1vm46t08" path="res://generic/items/dbg_input1.tres" id="2_f53xa"]
|
|
||||||
[ext_resource type="Script" uid="uid://dl0i68ut0lw70" path="res://scripts/recipe/recipe.gd" id="2_w6qf0"]
|
|
||||||
[ext_resource type="Resource" uid="uid://c23vqjqnyo6f3" path="res://generic/items/dbg_input2.tres" id="3_heoi8"]
|
|
||||||
[ext_resource type="Resource" uid="uid://c16fy6r43xlg1" path="res://generic/items/dbg_output.tres" id="4_0enwg"]
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_q2e78"]
|
|
||||||
script = ExtResource("1_no0hw")
|
|
||||||
item = ExtResource("2_f53xa")
|
|
||||||
amount = 1
|
|
||||||
metadata/_custom_type_script = "uid://w4v6jqv1ygqb"
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_ry6el"]
|
|
||||||
script = ExtResource("1_no0hw")
|
|
||||||
item = ExtResource("3_heoi8")
|
|
||||||
amount = 1
|
|
||||||
metadata/_custom_type_script = "uid://w4v6jqv1ygqb"
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_ek2yb"]
|
|
||||||
script = ExtResource("1_no0hw")
|
|
||||||
item = ExtResource("4_0enwg")
|
|
||||||
amount = 5
|
|
||||||
metadata/_custom_type_script = "uid://w4v6jqv1ygqb"
|
|
||||||
|
|
||||||
[resource]
|
|
||||||
script = ExtResource("2_w6qf0")
|
|
||||||
ingridients = Array[ExtResource("1_no0hw")]([SubResource("Resource_q2e78"), SubResource("Resource_ry6el")])
|
|
||||||
result = SubResource("Resource_ek2yb")
|
|
||||||
metadata/_custom_type_script = "uid://dl0i68ut0lw70"
|
|
||||||
15
lore/basic
15
lore/basic
|
|
@ -1,15 +0,0 @@
|
||||||
Отрывок из "Исторического развития космических полётов":
|
|
||||||
"<...>
|
|
||||||
В 2036 году после рождения христа совершается первый полёт на марс человеком, который завершается к середине 2037
|
|
||||||
В 2040 году после рождения христа году последняя христианская страна переходит на голоценовый календарь на фоне падения культурной значимости религии на фоне развития искуственного интеллекта
|
|
||||||
В 12060-х публикуется исследование свойств тахиократических систем частиц, доказывая, что тахионы существуют, окончательно доказывая, что мнимые числа не такие уж и мнимые
|
|
||||||
В конце 12070-х был получен первый тахион в лабораторных условиях
|
|
||||||
Ближе к 12100-м разрабатывается технология использования тахионов в космических полётах
|
|
||||||
В 12105 году совершается первый полёт на Марс, совершённый за неделю в самой дальней орбите
|
|
||||||
<...>"
|
|
||||||
|
|
||||||
Со стороны государств тахионные технологии получили финансирование тогда, когда в России был перемещён из Москвы во Владивосток кусок фольги. Вместе с тем, была в разработке технология атмосаэдра, тогда носившую название "Атмосфера Два Ноль". Атмосаэдр - это икосаэдрический щит, в то время разрабатываемый для ультимативной защиты от ядерных боеголовок. В будущем Атмосаэдр станет залогом существования колоний, выступая искуственной атмосферой. Страна, называемая Ч, которая первой разработала Атмосаэдр, вскоре начала обмен ядерными боеголовками с Америкой. Это был ужаснейший геноцид, спецификой которого стало то, что пострадала только одна страна. Америка, как уничтоженная страна, не перестала существовать, правительство и столица были перенесены на Марсианскую колонию, однако эта страна перестала быть сверхдержавой. Начала новая эпоха взаимоотношений между государствами, были разработаны аналоги атмосаэдров, что позволило сохранить суверенитет остальных стран. Сплочёнными усилиями учёных со всего мира, был разработана технология поддержания огромного атмосаэдра, децентрализованный и стабильный, что позволило сдавить авторитет Ч в области щитов. Этот щит прозвали Зартум. Вскоре, были разработаны Отзечные врата. Это такие врата, которые позволяли проходить через Зартум, не выключая его. Вскоре после создания этой технологии, торговля и транспортировка между колониями удешевилась, что позволило некоторым колониям получить суверенитет. Однако, Писдосия (Peacedosia, некогда USA) организовала первый в галактике планетарный теракт. На одной из лун Ч, Форт Сатис, были диверсированы Столбы Зартума, что привело к уничтожению атмосферы, и геноциду всех, кто не находился в герметичных помещениях. Это вызвало невообразимые социальные потрясения, в ходе чего репрессивный аппарат Ч был перенесён на все колонии, а также были разработаны Лофадуры. Лофадуры выступали как ПВО, защищающие Отзечные врата. Несмотря на это, Ч в ходе социальных противоречий была разделена на кучу стран, все колонии были зависимы от самой крупой - Пахлосомии, но она не смогла установить контроль, и все Колонии стали независимыми. Из-за этого, технология Платформ утекла. Писдосия с того теракта закрыла свой Зартум, установив отзечные врата так, чтобы их было легко контроллировать с Марса. Вдохновившись Писдосией, были некоторые колонии так же стали террористическими государствами.
|
|
||||||
|
|
||||||
Мы играем на территории полусуверенной полуколонии, являясь инжинером Лофадуры, защищающей Отзечные врата. Мы можем использовать приспособленный метеокрюк, чтобы захватывать другие Лофадуры, метеоры, астероиды и мусор. На Астероидах встречаются различные пока что безымянные материалы. Мы можем строить турели, создавать производственные цепочки. Кроме того, на главной Лофадуре установлен Контрольно Пропускной Модуль, который позволяет нам идентифицировать корабли, и автоматически открывать Отзечные врата. Пролетая мимо нас, торговцы могут с нами торговать. На нас будут постоянно совершать нападения различного рода государства.
|
|
||||||
|
|
||||||
Кстати, я хотел добавить возможность перепрограммировать КПП Модуль, позволяющие скентится с "пиратами". Это выступало бы аналогом дружбы с гроксами, ибо колония бы направила все свои орбитальные силы на тебя, чтобы уничтожить тебя
|
|
||||||
13
lore/geo
13
lore/geo
|
|
@ -1,13 +0,0 @@
|
||||||
сейчас либо 123XY год по голоцену (X>5), либо 1240Y
|
|
||||||
Колонии внутри системы скорее кластерами, чем рассеянно, редко когда встретишь одиночную колонию в системе
|
|
||||||
при этом, на одной планете почти всегда несколько колоний разных стран
|
|
||||||
а на одной луне (размером с нашу луну, или меркурий) всегда колония одной страны
|
|
||||||
я думаю, что к 12500 в целом будут все колонии повсеместно по всей галактике, т.е. в разных точках по разному
|
|
||||||
но относительно нашей колонии, родная планета где-то через пару десятков солнечных систем. Я думаю, что типо, PI/12 или PI/8 радиан относительно центра галактики
|
|
||||||
Со всеми колониями на планете, на которой мы находимся, мы находимся в очень хороших отношениях, полусимбиотических.
|
|
||||||
С колониями из солнечной системы:
|
|
||||||
Планета Кертыш - В целом нейтрально с нами. Принадлежит в основном к Неосерби и Ч, но есть одна полусуверенная колония
|
|
||||||
Луна Флорк - принадлежит пиратам Хопсер, они наши противники
|
|
||||||
Планета Миртум - мы у них в долгу за установку Держила, тахионного "поезда" между солнечными системами, мы у них в экономической зависимости, полностью независимая
|
|
||||||
Есть Земное Союзное Право, по которому живут все земные колонии кроме колоний Бларистии и Орканы, у них на территории колоний просто копия местной конституции
|
|
||||||
Есть Негласные правила Писдосии, который просто является террористическим манифестом, по нему никто не живёт, но все пираты вдохновлены
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
ну, короче, государство Ч это на самом деле Чэбялин, это буквально то государство, которое начало новую эпоху. Из-за террактов Писдосии (+ исторически) у неё хороший репрессивный аппарат. Политика в экономике направлена на расширение производств, что видно по тому, как они любят экспансию. Не нападают первыми (больше). Культурно наследница России (а как же)
|
|
||||||
Писдосия это мифическое государство, о котором никто и ничего не знает. С тех пор, как они закрыли в последний раз отзечные врата, любая коммуникация с ними сошла на нет. Поговаривают, что они вознеслись в четвёртое измерение.
|
|
||||||
Бларистия, Оркана, Неосербия - это земные государства, которые можно сравнить с современной европой. Вроде суверенные, сильные, но так то лежат под Чэбялин. (Культурно все отличаются). Полагаются во многом на торговлю.
|
|
||||||
Так же есть Африканская империя. Благодаря атмосаэдрам, они превзошли свои природные ограничения. Сильная промышленность, чем-то чэбялин похожи, но в основном они идеологически ведут войну против всех пиратов.
|
|
||||||
Миртум - самая близкая к нам суверенная колония. Технократия. Экономика направлена на инновации.
|
|
||||||
Доллинджер,, Гоготки - самые влиятельные неземные колонии.
|
|
||||||
Доллинджер - Демкоратия с экономикой заточенной под торговлю и сферой услуг
|
|
||||||
Гоготки - Исследовательский институт атома и тахионов, в основном продаёт и производит эти технологии
|
|
||||||
Сигвойды - Летающая "планета" (огромный корабль) с теократией-технократией.
|
|
||||||
14
lore/trade
14
lore/trade
|
|
@ -1,14 +0,0 @@
|
||||||
Писдосия предпочитает торговать только с суверенными государствами (т.е. не торгует со своими колониями, чужими колониями, и лофадурами), при этом торгует с "пиратами". Традиционно использует ЦифР
|
|
||||||
Бларистия, Оркана, Неосербия - предпочитают торговать с кем угодно кроме пиратов и своих колоний. Использует Объединённую монету для торговли
|
|
||||||
Африканская империя ведёт весьма ограниченую торговлю с другими государствами, предпочитая покупать только боеприпасы. Валюта - объединённая монета
|
|
||||||
Миртум ведёт расширенную технологиями со всеми, и только внутри системы проводит оптовую торговлю. Имеет банк. Валюта - объединённая монета
|
|
||||||
Доллинджер - как сучка продаёт свои ресурсы. Сфера услуг доступна только Родной планете. Валюта - Объединённая монета
|
|
||||||
Гоготки - в целом, то же самое, что и Миртум. Валюта - Кисивась
|
|
||||||
|
|
||||||
Текущие ходовые товары:
|
|
||||||
Патроны разного вида
|
|
||||||
Ресурсы, которые встречаются на астероиде
|
|
||||||
Электроэнергия
|
|
||||||
Тахионные приблуды
|
|
||||||
Карманные атмосаедры
|
|
||||||
(пока так, я так то планировал это расписывать от экономики игры)
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
В галактике превалирует глобально Трисеть. Трисеть можно назвать солнечным интернетом, с интерфейсом взаимодействия с другими интернетами
|
|
||||||
любой идентификатор в трисети состоит из следующих трибит информации (я заранее говорю, не уверен, что стоит именно такое число бит выделить):
|
|
||||||
первый трибит - тип идентификатора (статический, динамический, приватный)
|
|
||||||
шестнадцать трибитов - "глава" сети (солнечная система)
|
|
||||||
остальные трибиты - сам идентификатор
|
|
||||||
|
|
||||||
прикол статичных идентификаторов - они по факту являются хешированными названиями. Т.е. 2ndbeam.ru будет чёто типо 0tx00000000000000000<хэш>
|
|
||||||
не нужен дополнительно dns, ты просто обращаешься к своему космопровайдеру, и в само название вшит айпишник
|
|
||||||
в качестве кстати военной коммуникации используется запутанность бобионов
|
|
||||||
15
lore/ttech
15
lore/ttech
|
|
@ -1,15 +0,0 @@
|
||||||
Общие технологии:
|
|
||||||
Держил - аналог космических реле. Позволяет нетахионным транспортным средствам перемещатся по солнечным системам
|
|
||||||
Мельтжил - позволяет сразу же переместится из одной солнечной системы в другую
|
|
||||||
|
|
||||||
Гражданские технологии:
|
|
||||||
Старожил - тахионный грузовик
|
|
||||||
Выжил - тахионный "поезд"
|
|
||||||
Отвыяз - класс "тахионных движков" гражданской калибровки
|
|
||||||
|
|
||||||
Военные технологии:
|
|
||||||
Барбед - экспериментальная технология, позволяет нетахионным транспортным средствам работать как тахионные
|
|
||||||
Шломлага - не совсем транспортная технология, но она позволяет не разбиваться об атмосаедр, и вместо этого его немного гнуть
|
|
||||||
Пирлипед - традиционное оружие. Это атомная боеголовка тахионная. Моментально взрывает противника. Не использовалась хуеву кучу лет
|
|
||||||
Мавитон - класс "тахионных движков" военной калибровки
|
|
||||||
|
|
||||||
|
|
@ -11,7 +11,6 @@ config_version=5
|
||||||
[application]
|
[application]
|
||||||
|
|
||||||
config/name="Delurbelako"
|
config/name="Delurbelako"
|
||||||
run/main_scene="uid://u7thalwj5742"
|
|
||||||
config/features=PackedStringArray("4.5", "GL Compatibility")
|
config/features=PackedStringArray("4.5", "GL Compatibility")
|
||||||
config/icon="res://icon.svg"
|
config/icon="res://icon.svg"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,81 +0,0 @@
|
||||||
[gd_scene load_steps=8 format=3 uid="uid://u7thalwj5742"]
|
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://b7du4vul4bmpq" path="res://scenes/player_platform.tscn" id="1_4ia00"]
|
|
||||||
[ext_resource type="Script" uid="uid://bnjwg4rlcfd8k" path="res://scripts/gui/construction_buttons_generator.gd" id="3_i7yte"]
|
|
||||||
[ext_resource type="Script" uid="uid://b4nkk0ndqcto" path="res://scripts/placement_manager.gd" id="4_i7yte"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://bac552xgua68e" path="res://scenes/other_platform.tscn" id="5_mnxrb"]
|
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_bq5r8"]
|
|
||||||
length = 0.001
|
|
||||||
tracks/0/type = "value"
|
|
||||||
tracks/0/imported = false
|
|
||||||
tracks/0/enabled = true
|
|
||||||
tracks/0/path = NodePath("OtherPlatform:position")
|
|
||||||
tracks/0/interp = 1
|
|
||||||
tracks/0/loop_wrap = true
|
|
||||||
tracks/0/keys = {
|
|
||||||
"times": PackedFloat32Array(0),
|
|
||||||
"transitions": PackedFloat32Array(1),
|
|
||||||
"update": 0,
|
|
||||||
"values": [Vector2(309, 15)]
|
|
||||||
}
|
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_ymyc2"]
|
|
||||||
resource_name = "main"
|
|
||||||
length = 10.0
|
|
||||||
loop_mode = 1
|
|
||||||
tracks/0/type = "value"
|
|
||||||
tracks/0/imported = false
|
|
||||||
tracks/0/enabled = true
|
|
||||||
tracks/0/path = NodePath("OtherPlatform:position")
|
|
||||||
tracks/0/interp = 1
|
|
||||||
tracks/0/loop_wrap = true
|
|
||||||
tracks/0/keys = {
|
|
||||||
"times": PackedFloat32Array(0, 5),
|
|
||||||
"transitions": PackedFloat32Array(-2, -2),
|
|
||||||
"update": 0,
|
|
||||||
"values": [Vector2(309, 15), Vector2(309, 131)]
|
|
||||||
}
|
|
||||||
|
|
||||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_mogn5"]
|
|
||||||
_data = {
|
|
||||||
&"RESET": SubResource("Animation_bq5r8"),
|
|
||||||
&"main": SubResource("Animation_ymyc2")
|
|
||||||
}
|
|
||||||
|
|
||||||
[node name="2D World" type="Node2D"]
|
|
||||||
|
|
||||||
[node name="PlayerPlatform" parent="." instance=ExtResource("1_4ia00")]
|
|
||||||
position = Vector2(17, 17)
|
|
||||||
|
|
||||||
[node name="OtherPlatform" parent="." instance=ExtResource("5_mnxrb")]
|
|
||||||
position = Vector2(309, 15)
|
|
||||||
|
|
||||||
[node name="GUI" type="CanvasLayer" parent="."]
|
|
||||||
|
|
||||||
[node name="Panel" type="Panel" parent="GUI"]
|
|
||||||
anchors_preset = -1
|
|
||||||
anchor_top = 0.757
|
|
||||||
anchor_right = 1.0
|
|
||||||
anchor_bottom = 1.0
|
|
||||||
offset_top = -0.01600647
|
|
||||||
grow_horizontal = 2
|
|
||||||
grow_vertical = 0
|
|
||||||
|
|
||||||
[node name="HBoxContainer" type="HBoxContainer" parent="GUI/Panel"]
|
|
||||||
layout_mode = 1
|
|
||||||
anchors_preset = 15
|
|
||||||
anchor_right = 1.0
|
|
||||||
anchor_bottom = 1.0
|
|
||||||
grow_horizontal = 2
|
|
||||||
grow_vertical = 2
|
|
||||||
script = ExtResource("3_i7yte")
|
|
||||||
|
|
||||||
[node name="Placer" type="Node2D" parent="."]
|
|
||||||
script = ExtResource("4_i7yte")
|
|
||||||
|
|
||||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
|
||||||
libraries = {
|
|
||||||
&"": SubResource("AnimationLibrary_mogn5")
|
|
||||||
}
|
|
||||||
autoplay = "main"
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
[gd_scene load_steps=3 format=3 uid="uid://bbh7akfbskq4u"]
|
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://dinyjq8853usn" path="res://sprites/atlasses/Popekko.png" id="1_omb5g"]
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_laovn"]
|
|
||||||
atlas = ExtResource("1_omb5g")
|
|
||||||
region = Rect2(0, 0, 5, 5)
|
|
||||||
|
|
||||||
[node name="DebugItem" type="Node2D"]
|
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
|
||||||
texture = SubResource("AtlasTexture_laovn")
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
[gd_scene load_steps=2 format=3 uid="uid://dwq8u8ptmcegk"]
|
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://db37xmo8ygwhg" path="res://scripts/gui/construction_button.gd" id="1_unpdg"]
|
|
||||||
|
|
||||||
[node name="ConstructionButton" type="AspectRatioContainer"]
|
|
||||||
offset_right = 12.0
|
|
||||||
offset_bottom = 9.0
|
|
||||||
size_flags_horizontal = 3
|
|
||||||
size_flags_vertical = 3
|
|
||||||
theme_type_variation = &"CRT"
|
|
||||||
|
|
||||||
[node name="Button" type="Button" parent="."]
|
|
||||||
layout_mode = 2
|
|
||||||
theme_type_variation = &"CRT"
|
|
||||||
icon_alignment = 1
|
|
||||||
expand_icon = true
|
|
||||||
script = ExtResource("1_unpdg")
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
[gd_scene load_steps=3 format=3 uid="uid://buklkcwb0k2rc"]
|
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://416h8gs1f7x0" path="res://sprites/atlasses/Popekko.png" id="1_ligff"]
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_qfuiw"]
|
|
||||||
atlas = ExtResource("1_ligff")
|
|
||||||
region = Rect2(0, 0, 5, 5)
|
|
||||||
|
|
||||||
[node name="MountedGun" type="Node2D"]
|
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
|
||||||
position = Vector2(-2.5, 2.5)
|
|
||||||
texture = SubResource("AtlasTexture_qfuiw")
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
[gd_scene load_steps=4 format=4 uid="uid://bac552xgua68e"]
|
|
||||||
|
|
||||||
[ext_resource type="TileSet" uid="uid://bv75bu0af04vs" path="res://generic/platform.tres" id="1_fs1oy"]
|
|
||||||
[ext_resource type="Script" uid="uid://lw1ya3iu14uf" path="res://scripts/placement_zone.gd" id="2_bwire"]
|
|
||||||
[ext_resource type="Script" uid="uid://x5edy155eg0s" path="res://scripts/grid_controller.gd" id="3_qaudu"]
|
|
||||||
|
|
||||||
[node name="OtherPlatform" type="TileMapLayer"]
|
|
||||||
tile_map_data = PackedByteArray("AAAAAAAAAAAAAAAAAAAAAAEAAAAAAAEAAAAAAAIAAAAAAAEAAAAAAAMAAAAAAAEAAAAAAAQAAAAAAAEAAAABAAAAAAAAAAEAAAABAAEAAAAAAAEAAAABAAIAAAAAAAEAAAABAAMAAAAAAAAAAAABAAQAAAAAAAEAAAACAAAAAAAAAAAAAAACAAEAAAAAAAEAAAACAAIAAAAAAAEAAAACAAMAAAAAAAAAAAACAAQAAAAAAAAAAAD/////AAACAAEAAAD//wAAAAAEAAIAAAD//wEAAAAEAAIAAAD//wIAAAAEAAIAAAD//wMAAAAEAAIAAAD//wQAAAAEAAIAAAAAAP//AAABAAIAAAABAP//AAABAAIAAAACAP//AAABAAIAAAADAP//AAADAAEAAAD//wUAAAAEAAEAAAADAAUAAAAFAAEAAAAAAAUAAAAGAAEAAAABAAUAAAAGAAEAAAACAAUAAAAGAAEAAAADAAAAAAAFAAIAAAADAAEAAAAFAAIAAAADAAIAAAAFAAIAAAADAAMAAAAFAAIAAAADAAQAAAAFAAIAAAA=")
|
|
||||||
tile_set = ExtResource("1_fs1oy")
|
|
||||||
|
|
||||||
[node name="BuildZone" type="Marker2D" parent="." node_paths=PackedStringArray("grid_controller")]
|
|
||||||
script = ExtResource("2_bwire")
|
|
||||||
building_rect = Rect2(0, 0, 48, 80)
|
|
||||||
grid_controller = NodePath("../EntityHolder")
|
|
||||||
metadata/_custom_type_script = "uid://lw1ya3iu14uf"
|
|
||||||
|
|
||||||
[node name="EntityHolder" type="Node2D" parent="." node_paths=PackedStringArray("building_zone")]
|
|
||||||
script = ExtResource("3_qaudu")
|
|
||||||
building_zone = NodePath("../BuildZone")
|
|
||||||
metadata/_custom_type_script = "uid://x5edy155eg0s"
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
[gd_scene load_steps=4 format=4 uid="uid://b7du4vul4bmpq"]
|
|
||||||
|
|
||||||
[ext_resource type="TileSet" uid="uid://bv75bu0af04vs" path="res://generic/platform.tres" id="1_khkq2"]
|
|
||||||
[ext_resource type="Script" uid="uid://lw1ya3iu14uf" path="res://scripts/placement_zone.gd" id="2_wpmwa"]
|
|
||||||
[ext_resource type="Script" uid="uid://x5edy155eg0s" path="res://scripts/grid_controller.gd" id="3_6hjoe"]
|
|
||||||
|
|
||||||
[node name="PlayerPlatform" type="Node2D"]
|
|
||||||
|
|
||||||
[node name="TileMapLayer" type="TileMapLayer" parent="."]
|
|
||||||
tile_map_data = PackedByteArray("AAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAACAAAAAAAAAAEAAAADAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAGAAAAAAAAAAEAAAAHAAAAAAAAAAAAAAAIAAAAAAAAAAEAAAAJAAAAAAAAAAEAAAAKAAAAAAAAAAEAAAALAAAAAAAAAAAAAAAMAAAAAAAAAAEAAAANAAAAAAAAAAEAAAAOAAAAAAAAAAEAAAAPAAAAAAAAAAAAAAAQAAAAAAAAAAEAAAAQAAEAAAAAAAAAAAAPAAEAAAAAAAAAAAAOAAEAAAAAAAEAAAANAAEAAAAAAAAAAAAMAAEAAAAAAAAAAAALAAEAAAAAAAEAAAAKAAEAAAAAAAEAAAAJAAEAAAAAAAEAAAAIAAEAAAAAAAEAAAAHAAEAAAAAAAAAAAAGAAEAAAAAAAEAAAAFAAEAAAAAAAEAAAAEAAEAAAAAAAAAAAADAAEAAAAAAAAAAAACAAEAAAAAAAEAAAABAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAIAAAAAAAAAAAABAAIAAAAAAAEAAAACAAIAAAAAAAEAAAACAAMAAAAAAAEAAAADAAMAAAAAAAAAAAADAAIAAAAAAAAAAAAEAAIAAAAAAAAAAAAFAAIAAAAAAAEAAAAGAAIAAAAAAAEAAAAHAAIAAAAAAAEAAAAIAAIAAAAAAAEAAAAJAAIAAAAAAAEAAAAKAAIAAAAAAAEAAAALAAIAAAAAAAAAAAAMAAIAAAAAAAEAAAANAAIAAAAAAAEAAAAOAAIAAAAAAAAAAAAPAAIAAAAAAAEAAAAQAAIAAAAAAAEAAAAQAAMAAAAAAAEAAAAPAAMAAAAAAAEAAAAOAAMAAAAAAAEAAAANAAMAAAAAAAAAAAANAAQAAAAAAAAAAAAMAAQAAAAAAAEAAAALAAQAAAAAAAEAAAAKAAQAAAAAAAEAAAAJAAQAAAAAAAAAAAAJAAMAAAAAAAAAAAAIAAMAAAAAAAAAAAAHAAMAAAAAAAEAAAAGAAMAAAAAAAAAAAAFAAMAAAAAAAEAAAAEAAMAAAAAAAEAAAABAAMAAAAAAAEAAAAAAAMAAAAAAAEAAAAAAAQAAAAAAAAAAAABAAQAAAAAAAEAAAACAAQAAAAAAAAAAAADAAQAAAAAAAAAAAAEAAQAAAAAAAEAAAAFAAQAAAAAAAAAAAAGAAQAAAAAAAAAAAAHAAQAAAAAAAAAAAAIAAQAAAAAAAEAAAAOAAQAAAAAAAEAAAAPAAQAAAAAAAEAAAAQAAQAAAAAAAEAAAAMAAMAAAAAAAAAAAALAAMAAAAAAAEAAAAKAAMAAAAAAAEAAAABAAUAAAAAAAEAAAAAAAUAAAAAAAAAAAACAAUAAAAAAAEAAAADAAUAAAAAAAEAAAAEAAUAAAAAAAEAAAAFAAUAAAAAAAEAAAAGAAUAAAAAAAEAAAAHAAUAAAAAAAEAAAAIAAUAAAAAAAEAAAAJAAUAAAAAAAEAAAAKAAUAAAAAAAAAAAALAAUAAAAAAAAAAAAMAAUAAAAAAAAAAAANAAUAAAAAAAAAAAAOAAUAAAAAAAEAAAAPAAUAAAAAAAAAAAAQAAUAAAAAAAAAAAAQAAYAAAAAAAEAAAAPAAYAAAAAAAAAAAAPAAcAAAAAAAAAAAAOAAcAAAAAAAAAAAAOAAYAAAAAAAAAAAANAAYAAAAAAAAAAAAMAAYAAAAAAAAAAAALAAYAAAAAAAEAAAAKAAYAAAAAAAEAAAAJAAYAAAAAAAEAAAAIAAYAAAAAAAEAAAAHAAYAAAAAAAAAAAAGAAYAAAAAAAEAAAAFAAYAAAAAAAAAAAAEAAYAAAAAAAEAAAADAAYAAAAAAAEAAAACAAYAAAAAAAEAAAABAAYAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAcAAAAAAAAAAAABAAcAAAAAAAAAAAACAAcAAAAAAAAAAAADAAcAAAAAAAAAAAAEAAcAAAAAAAEAAAAFAAcAAAAAAAAAAAAGAAcAAAAAAAAAAAAHAAcAAAAAAAAAAAAIAAcAAAAAAAEAAAAJAAcAAAAAAAAAAAAKAAcAAAAAAAEAAAALAAcAAAAAAAAAAAAMAAcAAAAAAAAAAAANAAcAAAAAAAEAAAAQAAcAAAAAAAAAAAARAAAAAAABAAEAAAARAAEAAAABAAEAAAARAAIAAAABAAEAAAARAAMAAAABAAEAAAARAAQAAAABAAEAAAARAAUAAAABAAEAAAARAAYAAAABAAEAAAARAAcAAAABAAEAAAD//wAAAAABAAAAAAD//wEAAAABAAAAAAD//wIAAAABAAAAAAD//wMAAAABAAAAAAD//wQAAAABAAAAAAD//wUAAAABAAAAAAD//wYAAAABAAAAAAD//wcAAAABAAAAAAAAAP//AAAAAAIAAAABAP//AAAAAAIAAAACAP//AAAAAAIAAAADAP//AAAAAAIAAAAEAP//AAAAAAIAAAAFAP//AAAAAAIAAAAGAP//AAAAAAIAAAAHAP//AAAAAAIAAAAIAP//AAAAAAIAAAAJAP//AAAAAAIAAAAKAP//AAAAAAIAAAALAP//AAAAAAIAAAAMAP//AAAAAAIAAAANAP//AAAAAAIAAAAOAP//AAAAAAIAAAAPAP//AAAAAAIAAAAQAP//AAAAAAIAAAD/////AAACAAIAAAARAP//AAADAAIAAAD//wgAAAADAAAAAAARAAgAAAAEAAAAAAAQAAgAAAACAAAAAAAPAAgAAAACAAAAAAAOAAgAAAACAAAAAAANAAgAAAACAAAAAAAMAAgAAAACAAAAAAALAAgAAAACAAAAAAAKAAgAAAACAAAAAAAJAAgAAAACAAAAAAAIAAgAAAACAAAAAAAHAAgAAAACAAAAAAAGAAgAAAACAAAAAAAFAAgAAAACAAAAAAAEAAgAAAACAAAAAAADAAgAAAACAAAAAAACAAgAAAACAAAAAAABAAgAAAACAAAAAAAAAAgAAAACAAAAAAA=")
|
|
||||||
tile_set = ExtResource("1_khkq2")
|
|
||||||
|
|
||||||
[node name="BuildRect" type="Marker2D" parent="." node_paths=PackedStringArray("grid_controller")]
|
|
||||||
script = ExtResource("2_wpmwa")
|
|
||||||
building_rect = Rect2(0, 0, 272, 128)
|
|
||||||
grid_controller = NodePath("../EntityHolder")
|
|
||||||
|
|
||||||
[node name="EntityHolder" type="Node2D" parent="." node_paths=PackedStringArray("building_zone")]
|
|
||||||
script = ExtResource("3_6hjoe")
|
|
||||||
building_zone = NodePath("../BuildRect")
|
|
||||||
metadata/_custom_type_script = "uid://x5edy155eg0s"
|
|
||||||
|
|
@ -1,99 +0,0 @@
|
||||||
[gd_scene load_steps=16 format=3 uid="uid://b0h8dd82b3ox5"]
|
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://gfkhedfdi7ug" path="res://sprites/atlasses/Popekko.png" id="1_kqxj7"]
|
|
||||||
[ext_resource type="Script" uid="uid://bbd7o2st8kmgl" path="res://scripts/structure.gd" id="1_y326v"]
|
|
||||||
[ext_resource type="Script" uid="uid://bd4ojfqrl8idm" path="res://scripts/inventory/inventory_slot.gd" id="2_54w8r"]
|
|
||||||
[ext_resource type="Script" uid="uid://v0hkuo3gda1b" path="res://scripts/inventory/belt_inventory.gd" id="3_ruvuk"]
|
|
||||||
[ext_resource type="Script" uid="uid://bp341eiwvfvyl" path="res://scripts/structures/belt.gd" id="5_54w8r"]
|
|
||||||
[ext_resource type="Script" uid="uid://lchhqigib2t0" path="res://scripts/structures/directional_sprite.gd" id="5_ruvuk"]
|
|
||||||
[ext_resource type="Script" uid="uid://drsty3i1820ha" path="res://scripts/structures/belt_animation_sync.gd" id="7_t4je2"]
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_t4je2"]
|
|
||||||
resource_local_to_scene = true
|
|
||||||
script = ExtResource("3_ruvuk")
|
|
||||||
capacity = 4
|
|
||||||
pop_treshold = 0.95
|
|
||||||
internal_array = Array[ExtResource("2_54w8r")]([Object(RefCounted,"script":ExtResource("2_54w8r"),"held_item":null,"amount":0,"filter":null,"updated":null)
|
|
||||||
, Object(RefCounted,"script":ExtResource("2_54w8r"),"held_item":null,"amount":0,"filter":null,"updated":null)
|
|
||||||
, Object(RefCounted,"script":ExtResource("2_54w8r"),"held_item":null,"amount":0,"filter":null,"updated":null)
|
|
||||||
, Object(RefCounted,"script":ExtResource("2_54w8r"),"held_item":null,"amount":0,"filter":null,"updated":null)
|
|
||||||
])
|
|
||||||
metadata/_custom_type_script = "uid://v0hkuo3gda1b"
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_54w8r"]
|
|
||||||
atlas = ExtResource("1_kqxj7")
|
|
||||||
region = Rect2(16, 0, 16, 64)
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_crbfm"]
|
|
||||||
atlas = ExtResource("1_kqxj7")
|
|
||||||
region = Rect2(32, 64, 16, 64)
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_t4je2"]
|
|
||||||
atlas = ExtResource("1_kqxj7")
|
|
||||||
region = Rect2(32, 0, 16, 64)
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ruvuk"]
|
|
||||||
atlas = ExtResource("1_kqxj7")
|
|
||||||
region = Rect2(16, 64, 16, 64)
|
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_ruvuk"]
|
|
||||||
length = 0.001
|
|
||||||
tracks/0/type = "value"
|
|
||||||
tracks/0/imported = false
|
|
||||||
tracks/0/enabled = true
|
|
||||||
tracks/0/path = NodePath("Sprite2D:frame")
|
|
||||||
tracks/0/interp = 1
|
|
||||||
tracks/0/loop_wrap = true
|
|
||||||
tracks/0/keys = {
|
|
||||||
"times": PackedFloat32Array(0),
|
|
||||||
"transitions": PackedFloat32Array(1),
|
|
||||||
"update": 1,
|
|
||||||
"values": [0]
|
|
||||||
}
|
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_54w8r"]
|
|
||||||
resource_name = "right"
|
|
||||||
length = 1.000025
|
|
||||||
loop_mode = 1
|
|
||||||
step = 0.25
|
|
||||||
tracks/0/type = "value"
|
|
||||||
tracks/0/imported = false
|
|
||||||
tracks/0/enabled = true
|
|
||||||
tracks/0/path = NodePath("Sprite2D:frame")
|
|
||||||
tracks/0/interp = 1
|
|
||||||
tracks/0/loop_wrap = true
|
|
||||||
tracks/0/keys = {
|
|
||||||
"times": PackedFloat32Array(0, 0.25, 0.5, 0.75),
|
|
||||||
"transitions": PackedFloat32Array(1, 1, 1, 1),
|
|
||||||
"update": 1,
|
|
||||||
"values": [0, 1, 2, 3]
|
|
||||||
}
|
|
||||||
|
|
||||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_crbfm"]
|
|
||||||
_data = {
|
|
||||||
&"RESET": SubResource("Animation_ruvuk"),
|
|
||||||
&"right": SubResource("Animation_54w8r")
|
|
||||||
}
|
|
||||||
|
|
||||||
[node name="Conveyor" type="Node2D" groups=["buildings"]]
|
|
||||||
script = ExtResource("1_y326v")
|
|
||||||
inventory = SubResource("Resource_t4je2")
|
|
||||||
maximum_directions = 4
|
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="." node_paths=PackedStringArray("structure")]
|
|
||||||
texture = SubResource("AtlasTexture_54w8r")
|
|
||||||
vframes = 4
|
|
||||||
script = ExtResource("5_ruvuk")
|
|
||||||
textures = Array[Texture]([SubResource("AtlasTexture_54w8r"), SubResource("AtlasTexture_crbfm"), SubResource("AtlasTexture_t4je2"), SubResource("AtlasTexture_ruvuk")])
|
|
||||||
structure = NodePath("..")
|
|
||||||
|
|
||||||
[node name="Conveyor" type="Node2D" parent="."]
|
|
||||||
z_index = 1
|
|
||||||
script = ExtResource("5_54w8r")
|
|
||||||
|
|
||||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
|
||||||
libraries = {
|
|
||||||
&"": SubResource("AnimationLibrary_crbfm")
|
|
||||||
}
|
|
||||||
autoplay = "right"
|
|
||||||
script = ExtResource("7_t4je2")
|
|
||||||
|
|
@ -1,56 +0,0 @@
|
||||||
[gd_scene load_steps=13 format=3 uid="uid://dfatkxv6n55dw"]
|
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://bbd7o2st8kmgl" path="res://scripts/structure.gd" id="1_k5y3y"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://gfkhedfdi7ug" path="res://sprites/atlasses/Popekko.png" id="2_4befw"]
|
|
||||||
[ext_resource type="Script" uid="uid://bd4ojfqrl8idm" path="res://scripts/inventory/inventory_slot.gd" id="2_p1cyh"]
|
|
||||||
[ext_resource type="Script" uid="uid://m6b6vawdqgqb" path="res://scripts/inventory/in_out_inventory.gd" id="3_wqoim"]
|
|
||||||
[ext_resource type="Script" uid="uid://c7mx3uatj6ulm" path="res://scripts/structures/assembler.gd" id="5_0x00x"]
|
|
||||||
[ext_resource type="Script" uid="uid://lchhqigib2t0" path="res://scripts/structures/directional_sprite.gd" id="5_kno0u"]
|
|
||||||
[ext_resource type="Resource" uid="uid://d2lbc1qqkayaa" path="res://generic/recipes/test_recipe.tres" id="6_wqoim"]
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_kno0u"]
|
|
||||||
resource_local_to_scene = true
|
|
||||||
script = ExtResource("3_wqoim")
|
|
||||||
input_capacity = 2
|
|
||||||
output_capacity = 1
|
|
||||||
input_array = Array[ExtResource("2_p1cyh")]([Object(RefCounted,"script":ExtResource("2_p1cyh"),"held_item":null,"amount":0,"filter":null)
|
|
||||||
, Object(RefCounted,"script":ExtResource("2_p1cyh"),"held_item":null,"amount":0,"filter":null)
|
|
||||||
])
|
|
||||||
output_slot = Object(RefCounted,"script":ExtResource("2_p1cyh"),"held_item":null,"amount":0,"filter":null)
|
|
||||||
|
|
||||||
metadata/_custom_type_script = "uid://m6b6vawdqgqb"
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_xh4eg"]
|
|
||||||
atlas = ExtResource("2_4befw")
|
|
||||||
region = Rect2(48, 0, 32, 32)
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_0x00x"]
|
|
||||||
atlas = ExtResource("2_4befw")
|
|
||||||
region = Rect2(48, 32, 32, 32)
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_dr8in"]
|
|
||||||
atlas = ExtResource("2_4befw")
|
|
||||||
region = Rect2(48, 96, 32, 32)
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_kno0u"]
|
|
||||||
atlas = ExtResource("2_4befw")
|
|
||||||
region = Rect2(48, 64, 32, 32)
|
|
||||||
|
|
||||||
[node name="DebugAssembler" type="Node2D"]
|
|
||||||
script = ExtResource("1_k5y3y")
|
|
||||||
dimensions = Rect2i(0, 0, 2, 2)
|
|
||||||
inventory = SubResource("Resource_kno0u")
|
|
||||||
direction = 1.571
|
|
||||||
maximum_directions = 4
|
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="." node_paths=PackedStringArray("structure")]
|
|
||||||
texture = SubResource("AtlasTexture_xh4eg")
|
|
||||||
offset = Vector2(8, 8)
|
|
||||||
script = ExtResource("5_kno0u")
|
|
||||||
textures = Array[Texture]([SubResource("AtlasTexture_0x00x"), SubResource("AtlasTexture_xh4eg"), SubResource("AtlasTexture_dr8in"), SubResource("AtlasTexture_kno0u")])
|
|
||||||
structure = NodePath("..")
|
|
||||||
|
|
||||||
[node name="Assembler" type="Node2D" parent="."]
|
|
||||||
position = Vector2(16, 16)
|
|
||||||
script = ExtResource("5_0x00x")
|
|
||||||
selected_recipe = ExtResource("6_wqoim")
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
[gd_scene load_steps=5 format=3 uid="uid://cteh8r405wqwk"]
|
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://bbd7o2st8kmgl" path="res://scripts/structure.gd" id="1_uhivg"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://gfkhedfdi7ug" path="res://sprites/atlasses/Popekko.png" id="2_evk1q"]
|
|
||||||
[ext_resource type="Script" uid="uid://v3j1d3qyg30i" path="res://scripts/structures/debug_item_deposit.gd" id="5_nh3xp"]
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_wxqk4"]
|
|
||||||
atlas = ExtResource("2_evk1q")
|
|
||||||
region = Rect2(16, 0, 16, 16)
|
|
||||||
|
|
||||||
[node name="DebugItemDeposit" type="Node2D"]
|
|
||||||
script = ExtResource("1_uhivg")
|
|
||||||
metadata/_custom_type_script = "uid://bbd7o2st8kmgl"
|
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
|
||||||
self_modulate = Color(1, 0, 0, 1)
|
|
||||||
texture = SubResource("AtlasTexture_wxqk4")
|
|
||||||
|
|
||||||
[node name="ItemDeposit" type="Node2D" parent="."]
|
|
||||||
script = ExtResource("5_nh3xp")
|
|
||||||
metadata/_custom_type_script = "uid://iidfsh0lirc2"
|
|
||||||
|
|
@ -1,69 +0,0 @@
|
||||||
[gd_scene load_steps=17 format=3 uid="uid://bp4uvx2sdunfr"]
|
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://bbd7o2st8kmgl" path="res://scripts/structure.gd" id="1_0ta8r"]
|
|
||||||
[ext_resource type="Script" uid="uid://bd4ojfqrl8idm" path="res://scripts/inventory/inventory_slot.gd" id="2_lbove"]
|
|
||||||
[ext_resource type="Script" uid="uid://dlt3mbu6hk572" path="res://scripts/inventory/splitter_inventory.gd" id="3_2ulpw"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://gfkhedfdi7ug" path="res://sprites/atlasses/Popekko.png" id="4_iov8t"]
|
|
||||||
[ext_resource type="Script" uid="uid://lchhqigib2t0" path="res://scripts/structures/directional_sprite.gd" id="5_mimwr"]
|
|
||||||
[ext_resource type="Script" uid="uid://bml2n6vo5my0c" path="res://scripts/inventory/advanced_rotation.gd" id="6_mimwr"]
|
|
||||||
[ext_resource type="Script" uid="uid://bac6ei0tpoiqe" path="res://scripts/structures/splitter.gd" id="7_0dkfh"]
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_iov8t"]
|
|
||||||
resource_local_to_scene = true
|
|
||||||
script = ExtResource("3_2ulpw")
|
|
||||||
capacity = 1
|
|
||||||
upper_array = Array[ExtResource("2_lbove")]([Object(RefCounted,"script":ExtResource("2_lbove"),"held_item":null,"amount":0,"filter":null)
|
|
||||||
])
|
|
||||||
down_array = Array[ExtResource("2_lbove")]([Object(RefCounted,"script":ExtResource("2_lbove"),"held_item":null,"amount":0,"filter":null)
|
|
||||||
])
|
|
||||||
metadata/_custom_type_script = "uid://dlt3mbu6hk572"
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_0dkfh"]
|
|
||||||
atlas = ExtResource("4_iov8t")
|
|
||||||
region = Rect2(80, 16, 16, 32)
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_04mjq"]
|
|
||||||
atlas = ExtResource("4_iov8t")
|
|
||||||
region = Rect2(80, 16, 16, 32)
|
|
||||||
|
|
||||||
[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_41jic"]
|
|
||||||
load_path = "res://.godot/imported/Popekko.png-5c34a5f2a8c85fcf59453310fa6553d9.ctex"
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ksqgd"]
|
|
||||||
atlas = SubResource("CompressedTexture2D_41jic")
|
|
||||||
region = Rect2(80, 64, 32, 16)
|
|
||||||
|
|
||||||
[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_f7n4f"]
|
|
||||||
load_path = "res://.godot/imported/Popekko.png-5c34a5f2a8c85fcf59453310fa6553d9.ctex"
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_0x331"]
|
|
||||||
atlas = SubResource("CompressedTexture2D_f7n4f")
|
|
||||||
region = Rect2(96, 16, 16, 32)
|
|
||||||
|
|
||||||
[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_hmwxr"]
|
|
||||||
load_path = "res://.godot/imported/Popekko.png-5c34a5f2a8c85fcf59453310fa6553d9.ctex"
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_upfxh"]
|
|
||||||
atlas = SubResource("CompressedTexture2D_hmwxr")
|
|
||||||
region = Rect2(80, 48, 32, 16)
|
|
||||||
|
|
||||||
[node name="Splitter" type="Node2D"]
|
|
||||||
script = ExtResource("1_0ta8r")
|
|
||||||
dimensions = Rect2i(0, 0, 1, 2)
|
|
||||||
inventory = SubResource("Resource_iov8t")
|
|
||||||
maximum_directions = 4
|
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="." node_paths=PackedStringArray("structure")]
|
|
||||||
texture = SubResource("AtlasTexture_0dkfh")
|
|
||||||
offset = Vector2(0, 8)
|
|
||||||
script = ExtResource("5_mimwr")
|
|
||||||
textures = Array[Texture]([SubResource("AtlasTexture_04mjq"), SubResource("AtlasTexture_ksqgd"), SubResource("AtlasTexture_0x331"), SubResource("AtlasTexture_upfxh")])
|
|
||||||
structure = NodePath("..")
|
|
||||||
|
|
||||||
[node name="AdvancedRotation" type="Node" parent="." node_paths=PackedStringArray("structure", "sprite")]
|
|
||||||
script = ExtResource("6_mimwr")
|
|
||||||
structure = NodePath("..")
|
|
||||||
sprite = NodePath("../Sprite2D")
|
|
||||||
|
|
||||||
[node name="Splitter" type="Node2D" parent="."]
|
|
||||||
script = ExtResource("7_0dkfh")
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
[gd_scene load_steps=6 format=3 uid="uid://dpsrwmum6rbmi"]
|
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://bbd7o2st8kmgl" path="res://scripts/structure.gd" id="1_818vg"]
|
|
||||||
[ext_resource type="Script" uid="uid://conadqnb0asi0" path="res://scripts/inventory/void_inventory.gd" id="3_y1ram"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://gfkhedfdi7ug" path="res://sprites/atlasses/Popekko.png" id="5_y1ram"]
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_818vg"]
|
|
||||||
script = ExtResource("3_y1ram")
|
|
||||||
metadata/_custom_type_script = "uid://conadqnb0asi0"
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_lldoj"]
|
|
||||||
atlas = ExtResource("5_y1ram")
|
|
||||||
region = Rect2(80, 0, 16, 16)
|
|
||||||
|
|
||||||
[node name="TrashCan" type="Node2D"]
|
|
||||||
script = ExtResource("1_818vg")
|
|
||||||
inventory = SubResource("Resource_818vg")
|
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
|
||||||
texture = SubResource("AtlasTexture_lldoj")
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
extends Node
|
|
||||||
|
|
||||||
# TODO: Use this autoload for conveyor optimizations
|
|
||||||
|
|
||||||
var sync_time : float
|
|
||||||
|
|
||||||
func _process(delta: float) -> void:
|
|
||||||
sync_time += delta
|
|
||||||
if sync_time > 1:
|
|
||||||
sync_time -= 1
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://damurnhtipmga
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
## Global class for runtime
|
|
||||||
extends Node
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://coqgbea1uchn4
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
## Global class for player in-game data
|
|
||||||
|
|
||||||
extends Node
|
|
||||||
|
|
||||||
func _ready() -> void:
|
|
||||||
get_tree().scene_changed.connect(cleanup_runtime_cache)
|
|
||||||
|
|
||||||
## Method to cleanup all data that will be nulled
|
|
||||||
func cleanup_runtime_cache():
|
|
||||||
build_zones.clear()
|
|
||||||
|
|
||||||
var build_zones : Array[PlacementZone]
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://bmowwtsy0f8mf
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
extends Timer
|
|
||||||
|
|
||||||
const tics_per_second :float = 32.0
|
|
||||||
signal tick(current_tick: int)
|
|
||||||
|
|
||||||
var current_tick: int
|
|
||||||
|
|
||||||
func _ready() -> void:
|
|
||||||
start(1.0/tics_per_second)
|
|
||||||
timeout.connect(make_tick)
|
|
||||||
|
|
||||||
func make_tick():
|
|
||||||
current_tick += 1
|
|
||||||
if current_tick >= tics_per_second:
|
|
||||||
current_tick -= int(tics_per_second)
|
|
||||||
tick.emit(current_tick)
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://cl3bqbr52mwfl
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
@abstract
|
|
||||||
extends Object
|
|
||||||
|
|
||||||
class_name Globals
|
|
||||||
|
|
||||||
const GRID_SIZE : Vector2 = Vector2(16,16)
|
|
||||||
|
|
||||||
enum Sides {
|
|
||||||
RIGHT,
|
|
||||||
DOWN,
|
|
||||||
LEFT,
|
|
||||||
UP
|
|
||||||
}
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://bnmjkc8vfd7mo
|
|
||||||
|
|
@ -1,54 +0,0 @@
|
||||||
extends Node2D
|
|
||||||
|
|
||||||
# TODO: Make able to hold multiple placement zones, supporting uniform forms
|
|
||||||
|
|
||||||
## Class that contains all structures of platform
|
|
||||||
|
|
||||||
class_name GridController
|
|
||||||
|
|
||||||
|
|
||||||
## Building zone controller uses for checks and capacity
|
|
||||||
@export var building_zone : PlacementZone
|
|
||||||
|
|
||||||
## Internal structure storage
|
|
||||||
var structures : Array[Structure]
|
|
||||||
|
|
||||||
func _ready() -> void:
|
|
||||||
structures.resize(building_zone.get_capacity())
|
|
||||||
|
|
||||||
## Tries to add structure to its internal storage [br]
|
|
||||||
## Returns false if has colliding structures
|
|
||||||
func add_structure(structure : Structure) -> bool:
|
|
||||||
var structure_dp = structure.get_dimension_points()
|
|
||||||
for point in structure_dp:
|
|
||||||
if structures[building_zone.indexify_global_point(structure.global_position + point)]:
|
|
||||||
return false
|
|
||||||
structure.reparent(self)
|
|
||||||
structure.global_position = building_zone.get_placement_position(structure.global_position)
|
|
||||||
|
|
||||||
for point in structure_dp:
|
|
||||||
structures[building_zone.indexify_global_point(structure.global_position + point)] = structure
|
|
||||||
return true
|
|
||||||
|
|
||||||
## Returns structure at point. [br]
|
|
||||||
## Returns null if no structure is at point
|
|
||||||
func get_at(point : Vector2) -> Structure:
|
|
||||||
var index = building_zone.indexify_global_point(point)
|
|
||||||
if index == -1:
|
|
||||||
return null
|
|
||||||
return structures[index]
|
|
||||||
|
|
||||||
func destroy_at(point : Vector2) -> void:
|
|
||||||
var index = building_zone.indexify_global_point(point)
|
|
||||||
if index == -1:
|
|
||||||
return
|
|
||||||
|
|
||||||
var found: Structure = structures[index]
|
|
||||||
|
|
||||||
for dim_point in found.get_dimension_points():
|
|
||||||
structures[building_zone.indexify_global_point(found.global_position+dim_point)] = null
|
|
||||||
|
|
||||||
found.queue_free()
|
|
||||||
|
|
||||||
func is_point_occupied(point : Vector2) -> bool:
|
|
||||||
return get_at(point) != null
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://x5edy155eg0s
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
extends Button
|
|
||||||
|
|
||||||
class_name ConstructionButton
|
|
||||||
|
|
||||||
var prototype : Prototype:
|
|
||||||
set(value):
|
|
||||||
prototype = value
|
|
||||||
icon = prototype.preview
|
|
||||||
get:
|
|
||||||
return prototype
|
|
||||||
|
|
||||||
func _pressed() -> void:
|
|
||||||
GuiEventBus.construction_selected.emit(prototype)
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://db37xmo8ygwhg
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
extends Node
|
|
||||||
|
|
||||||
const button = preload("res://scenes/gui/construction_button.tscn")
|
|
||||||
|
|
||||||
func _ready() -> void:
|
|
||||||
for file in ResourceLoader.list_directory("res://generic/prototypes/"):
|
|
||||||
var btn = button.instantiate()
|
|
||||||
var loaded_prototype : Prototype = ResourceLoader.load("res://generic/prototypes/"+file)
|
|
||||||
|
|
||||||
btn.get_node("Button").prototype = loaded_prototype
|
|
||||||
add_child(btn)
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://bnjwg4rlcfd8k
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
extends Node
|
|
||||||
|
|
||||||
@warning_ignore_start("unused_signal")
|
|
||||||
|
|
||||||
signal construction_selected(prototype : Prototype)
|
|
||||||
signal construction_placed(prototype : Prototype)
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://x5eghpenp777
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
extends Node
|
|
||||||
|
|
||||||
@export var structure : Structure
|
|
||||||
@export var sprite : Sprite2D
|
|
||||||
|
|
||||||
@onready var initial_dimensions : Rect2i = structure.dimensions
|
|
||||||
@onready var initial_offset : Vector2 = sprite.offset
|
|
||||||
|
|
||||||
func _ready() -> void:
|
|
||||||
structure.changed_direction.connect(on_changed_direction)
|
|
||||||
|
|
||||||
func on_changed_direction(to: float,max_directions : int):
|
|
||||||
var calculated_size = Vector2(initial_dimensions.size).rotated(to).abs().ceil()
|
|
||||||
structure.dimensions = Rect2i(initial_dimensions.position,calculated_size)
|
|
||||||
sprite.offset = initial_offset.rotated(to).abs()
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://bml2n6vo5my0c
|
|
||||||
|
|
@ -1,101 +0,0 @@
|
||||||
@tool
|
|
||||||
extends Inventory
|
|
||||||
|
|
||||||
class_name BeltInventory
|
|
||||||
|
|
||||||
## Amount of stacks that can be held in storage
|
|
||||||
@export var capacity : int:
|
|
||||||
set(value):
|
|
||||||
if value < 0:
|
|
||||||
return
|
|
||||||
if value == capacity:
|
|
||||||
return
|
|
||||||
capacity = value
|
|
||||||
get:
|
|
||||||
return capacity
|
|
||||||
|
|
||||||
@export var pop_treshold : float = 0.99
|
|
||||||
|
|
||||||
## :3
|
|
||||||
@export_storage var internal_array : Array[InventorySlot] = []
|
|
||||||
|
|
||||||
func _init() -> void:
|
|
||||||
super()
|
|
||||||
deferred_init.call_deferred()
|
|
||||||
|
|
||||||
func deferred_init():
|
|
||||||
internal_array.resize(capacity)
|
|
||||||
for i in range(capacity):
|
|
||||||
internal_array[i] = InventorySlot.new()
|
|
||||||
|
|
||||||
## Finds first entry of item. Returns -1 if no item found
|
|
||||||
func find(item : Item) -> int:
|
|
||||||
for i in range(capacity):
|
|
||||||
if internal_array[i].can_be_merged(item):
|
|
||||||
return i
|
|
||||||
return -1
|
|
||||||
|
|
||||||
## Tries to add an item into inventory. Returns not stored stack of item.
|
|
||||||
func add(stack: Stack, context: InventoryContext = null) -> Stack:
|
|
||||||
if context != null:
|
|
||||||
var ang_diff = (context.position - context.source.global_position).angle()-context.target.direction
|
|
||||||
if is_equal_approx(abs(ang_diff),PI/2):
|
|
||||||
if internal_array[capacity/2].amount != 0:
|
|
||||||
return null
|
|
||||||
stack_added.emit(stack,capacity/2)
|
|
||||||
internal_array[capacity/2].merge_stack(stack)
|
|
||||||
return stack
|
|
||||||
elif is_equal_approx(abs(ang_diff), PI):
|
|
||||||
if internal_array[capacity-1].amount != 0:
|
|
||||||
return null
|
|
||||||
stack_added.emit(stack,capacity-1)
|
|
||||||
internal_array[capacity-1].merge_stack(stack)
|
|
||||||
return stack
|
|
||||||
if internal_array[0].amount != 0:
|
|
||||||
return null
|
|
||||||
stack_added.emit(stack,0)
|
|
||||||
internal_array[0].merge_stack(stack)
|
|
||||||
return stack
|
|
||||||
|
|
||||||
|
|
||||||
func can_add(_item : Item = null, context : InventoryContext = null) -> bool:
|
|
||||||
if context != null:
|
|
||||||
var ang_diff = (context.position - context.source.global_position).angle()-context.target.direction
|
|
||||||
if is_equal_approx(abs(ang_diff),PI/2):
|
|
||||||
return internal_array[capacity/2].amount == 0
|
|
||||||
elif is_equal_approx(abs(ang_diff),PI):
|
|
||||||
return internal_array[capacity-1].amount == 0
|
|
||||||
return internal_array[0].amount == 0
|
|
||||||
|
|
||||||
## Tries to take first item. Returns null if no items in inventory
|
|
||||||
func pop() -> Stack:
|
|
||||||
if internal_array[capacity-1].amount == 0:
|
|
||||||
return null
|
|
||||||
stack_taken.emit(internal_array[capacity-1], capacity-1)
|
|
||||||
return internal_array[capacity-1].extract()
|
|
||||||
|
|
||||||
func peek() -> Stack:
|
|
||||||
if internal_array[capacity-1].amount == 0:
|
|
||||||
return null
|
|
||||||
return internal_array[capacity-1].as_stack()
|
|
||||||
|
|
||||||
func advance() -> void:
|
|
||||||
for i in range(capacity-1,0,-1):
|
|
||||||
if internal_array[i].amount == 0 and internal_array[0].updated == false:
|
|
||||||
var extracted_stack = internal_array[i-1].extract()
|
|
||||||
internal_array[i].merge_stack(extracted_stack)
|
|
||||||
if extracted_stack != null and extracted_stack.is_valid():
|
|
||||||
internal_array[i-1].merge_stack(extracted_stack)
|
|
||||||
|
|
||||||
## Tries to take certain item from inventory. Returns null if no item found
|
|
||||||
func take(item: Item,amount: int) -> Stack:
|
|
||||||
var found = find(item)
|
|
||||||
if found == -1:
|
|
||||||
return null
|
|
||||||
var extracted = internal_array[found].extract_stack(amount)
|
|
||||||
stack_taken.emit(extracted,found)
|
|
||||||
return extracted
|
|
||||||
|
|
||||||
func refresh() -> void:
|
|
||||||
for i in range(capacity):
|
|
||||||
internal_array[i].updated = false
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://v0hkuo3gda1b
|
|
||||||
|
|
@ -1,77 +0,0 @@
|
||||||
@tool
|
|
||||||
extends Inventory
|
|
||||||
|
|
||||||
class_name InOutInventory
|
|
||||||
|
|
||||||
@export var input_capacity : int
|
|
||||||
@export var output_capacity : int
|
|
||||||
|
|
||||||
@export_storage var input_array : Array[InventorySlot]
|
|
||||||
@export_storage var output_slot : InventorySlot
|
|
||||||
|
|
||||||
func resize() -> void:
|
|
||||||
input_array.resize(input_capacity)
|
|
||||||
for i in range(input_capacity):
|
|
||||||
input_array[i] = InventorySlot.new()
|
|
||||||
output_slot = InventorySlot.new()
|
|
||||||
|
|
||||||
func _init() -> void:
|
|
||||||
super()
|
|
||||||
resize.call_deferred()
|
|
||||||
|
|
||||||
func add(stack : Stack, _context: InventoryContext = null) -> Stack:
|
|
||||||
if stack == null:
|
|
||||||
return stack
|
|
||||||
for i in range(input_capacity):
|
|
||||||
if input_array[i].can_be_merged(stack.held_item):
|
|
||||||
stack_added.emit(stack,i)
|
|
||||||
input_array[i].merge_stack(stack)
|
|
||||||
if stack.is_valid() == false:
|
|
||||||
return null
|
|
||||||
return stack
|
|
||||||
|
|
||||||
func can_add(item : Item = null, _context: InventoryContext = null) -> bool:
|
|
||||||
if item == null:
|
|
||||||
return false
|
|
||||||
else:
|
|
||||||
for i in range(input_capacity):
|
|
||||||
if input_array[i].can_be_merged(item):
|
|
||||||
return true
|
|
||||||
return false
|
|
||||||
|
|
||||||
|
|
||||||
## Tries to take first item. Returns null if no items in inventory
|
|
||||||
func pop() -> Stack:
|
|
||||||
if output_slot.held_item != null:
|
|
||||||
var extracted = output_slot.extract()
|
|
||||||
stack_taken.emit(extracted,0)
|
|
||||||
return extracted
|
|
||||||
return null
|
|
||||||
|
|
||||||
func peek() -> Stack:
|
|
||||||
if output_slot.held_item != null:
|
|
||||||
var peeked = output_slot.as_stack()
|
|
||||||
return peeked
|
|
||||||
return null
|
|
||||||
|
|
||||||
## Tries to take certain item from inventory. Returns null if no item found
|
|
||||||
func take(item: Item,amount: int) -> Stack:
|
|
||||||
if item != output_slot.filter:
|
|
||||||
return null
|
|
||||||
var extracted = output_slot.extract_stack(amount)
|
|
||||||
return extracted
|
|
||||||
|
|
||||||
func find_input(item : Item) -> int:
|
|
||||||
for i in range(input_capacity):
|
|
||||||
if input_array[i].held_item == item:
|
|
||||||
return i
|
|
||||||
return -1
|
|
||||||
|
|
||||||
func find(item : Item) -> int:
|
|
||||||
if output_slot.held_item == item:
|
|
||||||
return 0
|
|
||||||
return -1
|
|
||||||
|
|
||||||
func refresh() -> void:
|
|
||||||
for i in range(input_capacity):
|
|
||||||
input_array[i].updated = false
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://m6b6vawdqgqb
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
@abstract
|
|
||||||
extends Resource
|
|
||||||
|
|
||||||
## Class that can hold items in it
|
|
||||||
class_name Inventory
|
|
||||||
|
|
||||||
signal stack_added(item : Stack,position : int)
|
|
||||||
signal stack_taken(item : Stack,position : int)
|
|
||||||
|
|
||||||
func _init() -> void:
|
|
||||||
resource_local_to_scene = true
|
|
||||||
|
|
||||||
## Tries to add an item into inventory. Returns not stored stack of item.
|
|
||||||
@abstract
|
|
||||||
func add(stack : Stack, context: InventoryContext = null) -> Stack
|
|
||||||
|
|
||||||
## Returns if conditions of adding are met
|
|
||||||
@abstract
|
|
||||||
func can_add(item : Item = null, context: InventoryContext = null) -> bool
|
|
||||||
|
|
||||||
## Tries to take first item. Returns null if no items in inventory
|
|
||||||
@abstract
|
|
||||||
func pop() -> Stack
|
|
||||||
|
|
||||||
@abstract
|
|
||||||
func peek() -> Stack
|
|
||||||
|
|
||||||
## Tries to take certain item from inventory. Returns null if no item found
|
|
||||||
@abstract
|
|
||||||
func take(item : Item,amount: int) -> Stack
|
|
||||||
|
|
||||||
## Finds first entry of item. Returns -1 if no item found
|
|
||||||
@abstract
|
|
||||||
func find(item : Item) -> int
|
|
||||||
|
|
||||||
@abstract
|
|
||||||
func refresh() -> void
|
|
||||||
|
|
||||||
## Does inventory have certain item?
|
|
||||||
func has(item : Item) -> bool:
|
|
||||||
return find(item) != -1
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://01aqkh38trcr
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
extends RefCounted
|
|
||||||
|
|
||||||
class_name InventoryContext
|
|
||||||
|
|
||||||
func _init(_source: Structure, _target: Structure,_position: Vector2) -> void:
|
|
||||||
self.source = _source
|
|
||||||
self.target = _target
|
|
||||||
self.position = _position
|
|
||||||
|
|
||||||
|
|
||||||
var source : Structure
|
|
||||||
var target : Structure
|
|
||||||
var position : Vector2
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://d3ytipk4nt11d
|
|
||||||
|
|
@ -1,105 +0,0 @@
|
||||||
@tool
|
|
||||||
extends RefCounted
|
|
||||||
|
|
||||||
class_name InventorySlot
|
|
||||||
|
|
||||||
@export_storage var held_item : Item:
|
|
||||||
set(value):
|
|
||||||
if held_item == null and value != null:
|
|
||||||
held_item = value
|
|
||||||
amount += 1
|
|
||||||
return
|
|
||||||
held_item = value
|
|
||||||
get:
|
|
||||||
return held_item
|
|
||||||
|
|
||||||
@export_storage var amount : int:
|
|
||||||
set(value):
|
|
||||||
if value <= 0:
|
|
||||||
held_item = null
|
|
||||||
amount = 0
|
|
||||||
return
|
|
||||||
if held_item == null:
|
|
||||||
amount = 0
|
|
||||||
return
|
|
||||||
if value > held_item.stack_size:
|
|
||||||
amount = held_item.stack_size
|
|
||||||
return
|
|
||||||
amount = value
|
|
||||||
get:
|
|
||||||
return amount
|
|
||||||
|
|
||||||
@export_storage var filter : Comparable
|
|
||||||
@export_storage var updated : bool
|
|
||||||
|
|
||||||
## Get some amount of items from slot. Returns null if slot is empty
|
|
||||||
func extract_stack(extract_amount: int) -> Stack:
|
|
||||||
if amount == 0 or updated:
|
|
||||||
return null
|
|
||||||
|
|
||||||
updated = true
|
|
||||||
|
|
||||||
var return_stack : Stack
|
|
||||||
if extract_amount > amount:
|
|
||||||
return_stack = Stack.new(held_item,amount)
|
|
||||||
else:
|
|
||||||
return_stack = Stack.new(held_item,extract_amount)
|
|
||||||
|
|
||||||
self.amount = 0
|
|
||||||
|
|
||||||
return return_stack
|
|
||||||
|
|
||||||
## Extract entire stack from slot. Returns null if slot is empty
|
|
||||||
func extract() -> Stack:
|
|
||||||
if amount == 0 or updated:
|
|
||||||
return null
|
|
||||||
|
|
||||||
updated = true
|
|
||||||
|
|
||||||
var return_stack : Stack = Stack.new(held_item,amount)
|
|
||||||
self.amount = 0
|
|
||||||
|
|
||||||
return return_stack
|
|
||||||
|
|
||||||
func as_stack() -> Stack:
|
|
||||||
if amount == 0:
|
|
||||||
return null
|
|
||||||
|
|
||||||
var return_stack : Stack = Stack.new(held_item,amount)
|
|
||||||
|
|
||||||
return return_stack
|
|
||||||
|
|
||||||
func can_be_merged(item : Item) -> bool:
|
|
||||||
if updated:
|
|
||||||
return false
|
|
||||||
if filter != null:
|
|
||||||
return filter.is_equal(item)
|
|
||||||
if amount <= 0:
|
|
||||||
return true
|
|
||||||
return item == held_item
|
|
||||||
|
|
||||||
## Add provided stack's amount to this amount. Returns null if stack is empty or items arent matching
|
|
||||||
func merge_stack(stack: Stack) -> bool:
|
|
||||||
if stack == null or stack.is_valid() == false or updated:
|
|
||||||
return false
|
|
||||||
|
|
||||||
if filter and filter.is_equal(stack.held_item) == false:
|
|
||||||
return false
|
|
||||||
|
|
||||||
updated = true
|
|
||||||
|
|
||||||
if held_item == null:
|
|
||||||
held_item = stack.held_item
|
|
||||||
amount = stack.amount
|
|
||||||
stack.invalidate()
|
|
||||||
return true
|
|
||||||
|
|
||||||
var delta_amount = stack.amount - (held_item.stack_size - amount)
|
|
||||||
amount += stack.amount
|
|
||||||
|
|
||||||
if delta_amount <= 0:
|
|
||||||
stack.invalidate()
|
|
||||||
return true
|
|
||||||
|
|
||||||
stack.amount = delta_amount
|
|
||||||
return true
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://bd4ojfqrl8idm
|
|
||||||
|
|
@ -1,79 +0,0 @@
|
||||||
@tool
|
|
||||||
|
|
||||||
extends Inventory
|
|
||||||
|
|
||||||
class_name SplitterInventory
|
|
||||||
|
|
||||||
@export var capacity : int:
|
|
||||||
set(value):
|
|
||||||
if value < 0:
|
|
||||||
return
|
|
||||||
if value == capacity:
|
|
||||||
return
|
|
||||||
capacity = value
|
|
||||||
get:
|
|
||||||
return capacity
|
|
||||||
|
|
||||||
@export_storage var upper_array : Array[InventorySlot]
|
|
||||||
@export_storage var down_array : Array[InventorySlot]
|
|
||||||
|
|
||||||
func _init() -> void:
|
|
||||||
super()
|
|
||||||
deferred_init.call_deferred()
|
|
||||||
|
|
||||||
func deferred_init():
|
|
||||||
upper_array.resize(capacity)
|
|
||||||
down_array.resize(capacity)
|
|
||||||
for i in range(capacity):
|
|
||||||
upper_array[i] = InventorySlot.new()
|
|
||||||
down_array[i] = InventorySlot.new()
|
|
||||||
|
|
||||||
func add(stack : Stack, context: InventoryContext = null) -> Stack:
|
|
||||||
if context == null or stack == null:
|
|
||||||
return stack
|
|
||||||
if context.position == context.target.global_position:
|
|
||||||
return add_to_array(stack,upper_array,context)
|
|
||||||
return add_to_array(stack,down_array,context)
|
|
||||||
|
|
||||||
func add_to_array(stack: Stack, array: Array[InventorySlot], context: InventoryContext = null) -> Stack:
|
|
||||||
for i in range(len(array)):
|
|
||||||
if array[i].held_item == null or array[i].held_item == stack.held_item:
|
|
||||||
stack_added.emit(stack,i)
|
|
||||||
array[i].merge_stack(stack)
|
|
||||||
if stack.is_valid() == false:
|
|
||||||
return null
|
|
||||||
return stack
|
|
||||||
|
|
||||||
func can_add(item : Item = null, context: InventoryContext = null) -> bool:
|
|
||||||
if context == null:
|
|
||||||
return false
|
|
||||||
if item == null:
|
|
||||||
for i in range(capacity):
|
|
||||||
if upper_array[i].amount == 0 or down_array[i].amount == 0:
|
|
||||||
return true
|
|
||||||
else:
|
|
||||||
for i in range(capacity):
|
|
||||||
if upper_array[i].amount == 0:
|
|
||||||
return upper_array[i].can_be_merged(item)
|
|
||||||
if down_array[i].amount ==0:
|
|
||||||
return down_array[i].can_be_merged(item)
|
|
||||||
return false
|
|
||||||
|
|
||||||
func pop() -> Stack:
|
|
||||||
return null
|
|
||||||
|
|
||||||
func peek() -> Stack:
|
|
||||||
return null
|
|
||||||
|
|
||||||
## Tries to take certain item from inventory. Returns null if no item found
|
|
||||||
func take(item : Item,amount: int) -> Stack:
|
|
||||||
return null
|
|
||||||
|
|
||||||
## Finds first entry of item. Returns -1 if no item found
|
|
||||||
func find(item : Item) -> int:
|
|
||||||
return -1
|
|
||||||
|
|
||||||
func refresh() -> void:
|
|
||||||
for i in range(capacity):
|
|
||||||
upper_array[i].updated = false
|
|
||||||
down_array[i].updated = false
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://dlt3mbu6hk572
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
extends RefCounted
|
|
||||||
|
|
||||||
## Structure of item and amount of it. Basic object that more complex exchange
|
|
||||||
|
|
||||||
class_name Stack
|
|
||||||
|
|
||||||
func _init(item: Item = null, amount: int = 0) -> void:
|
|
||||||
held_item = item
|
|
||||||
self.amount = amount
|
|
||||||
|
|
||||||
## Item in stack
|
|
||||||
@export_storage var held_item : Item
|
|
||||||
|
|
||||||
## Amount of items in stack
|
|
||||||
@export_storage var amount : int
|
|
||||||
|
|
||||||
func invalidate() -> void:
|
|
||||||
held_item = null
|
|
||||||
amount = 0
|
|
||||||
|
|
||||||
func is_valid() -> bool:
|
|
||||||
return held_item != null or amount > 0
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://h78lmbi3vbfe
|
|
||||||
|
|
@ -1,93 +0,0 @@
|
||||||
@tool
|
|
||||||
extends Inventory
|
|
||||||
|
|
||||||
## Base class for simple storages with no differentiation.
|
|
||||||
|
|
||||||
class_name Storage
|
|
||||||
|
|
||||||
## Amount of stacks that can be held in storage
|
|
||||||
@export var capacity : int:
|
|
||||||
set(value):
|
|
||||||
if value < 0:
|
|
||||||
return
|
|
||||||
if value == capacity:
|
|
||||||
return
|
|
||||||
capacity = value
|
|
||||||
get:
|
|
||||||
return capacity
|
|
||||||
|
|
||||||
## :3
|
|
||||||
@export_storage var internal_array : Array[InventorySlot] = []
|
|
||||||
|
|
||||||
func _init() -> void:
|
|
||||||
super()
|
|
||||||
deferred_init.call_deferred()
|
|
||||||
|
|
||||||
func deferred_init():
|
|
||||||
internal_array.resize(capacity)
|
|
||||||
for i in range(capacity):
|
|
||||||
internal_array[i] = InventorySlot.new()
|
|
||||||
|
|
||||||
## Finds first entry of item. Returns -1 if no item found
|
|
||||||
func find(item : Item) -> int:
|
|
||||||
for i in range(len(internal_array)):
|
|
||||||
if internal_array[i].held_item == item:
|
|
||||||
return i
|
|
||||||
return -1
|
|
||||||
|
|
||||||
## Tries to add an item into inventory. Returns not stored stack of item.
|
|
||||||
func add(stack: Stack, _context: InventoryContext = null) -> Stack:
|
|
||||||
var found_index : int = find(stack.held_item)
|
|
||||||
if found_index != -1:
|
|
||||||
stack_added.emit(stack,found_index)
|
|
||||||
internal_array[found_index].merge_stack(stack)
|
|
||||||
if stack.is_valid() == false:
|
|
||||||
return null
|
|
||||||
for i in range(len(internal_array)):
|
|
||||||
if internal_array[i].can_be_merged(stack.held_item):
|
|
||||||
stack_added.emit(stack,i)
|
|
||||||
internal_array[i].merge_stack(stack)
|
|
||||||
if stack.is_valid() == false:
|
|
||||||
return null
|
|
||||||
return stack
|
|
||||||
|
|
||||||
func can_add(item : Item = null, _context: InventoryContext = null) -> bool:
|
|
||||||
if item == null:
|
|
||||||
for i in range(capacity):
|
|
||||||
if internal_array[i].can_be_merged(item):
|
|
||||||
return true
|
|
||||||
return false
|
|
||||||
else:
|
|
||||||
for i in range(capacity):
|
|
||||||
if internal_array[i].can_be_merged(item):
|
|
||||||
return true
|
|
||||||
return false
|
|
||||||
|
|
||||||
## Tries to take first item. Returns null if no items in inventory
|
|
||||||
func pop() -> Stack:
|
|
||||||
for i in range(len(internal_array)):
|
|
||||||
if internal_array[i].held_item != null:
|
|
||||||
var extracted = internal_array[i].extract()
|
|
||||||
stack_taken.emit(extracted,i)
|
|
||||||
return extracted
|
|
||||||
return null
|
|
||||||
|
|
||||||
func peek() -> Stack:
|
|
||||||
for i in range(len(internal_array)):
|
|
||||||
if internal_array[i].held_item != null:
|
|
||||||
var peeked = internal_array[i].as_stack()
|
|
||||||
return peeked
|
|
||||||
return null
|
|
||||||
|
|
||||||
## Tries to take certain item from inventory. Returns null if no item found
|
|
||||||
func take(item: Item,amount: int) -> Stack:
|
|
||||||
var found = find(item)
|
|
||||||
if found == -1:
|
|
||||||
return null
|
|
||||||
var extracted = internal_array[found].extract_stack(amount)
|
|
||||||
stack_taken.emit(extracted,found)
|
|
||||||
return extracted
|
|
||||||
|
|
||||||
func refresh() -> void:
|
|
||||||
for i in range(capacity):
|
|
||||||
internal_array[i].updated = false
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://1scdy7mttx5h
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
extends Inventory
|
|
||||||
|
|
||||||
## Base class for simple storages with no differentiation.
|
|
||||||
|
|
||||||
class_name VoidInventory
|
|
||||||
|
|
||||||
|
|
||||||
## Tries to add an item into inventory. Returns not stored stack of item.
|
|
||||||
func add(stack : Stack, context: InventoryContext = null) -> Stack:
|
|
||||||
return null
|
|
||||||
|
|
||||||
## Returns if conditions of adding are met
|
|
||||||
func can_add(item : Item = null, context: InventoryContext = null) -> bool:
|
|
||||||
return true
|
|
||||||
|
|
||||||
## Tries to take first item. Returns null if no items in inventory
|
|
||||||
func pop() -> Stack:
|
|
||||||
return null
|
|
||||||
|
|
||||||
func peek() -> Stack:
|
|
||||||
return null
|
|
||||||
|
|
||||||
## Tries to take certain item from inventory. Returns null if no item found
|
|
||||||
func take(item : Item,amount: int) -> Stack:
|
|
||||||
return null
|
|
||||||
|
|
||||||
## Finds first entry of item. Returns -1 if no item found
|
|
||||||
func find(item : Item) -> int:
|
|
||||||
return -1
|
|
||||||
|
|
||||||
func refresh():
|
|
||||||
pass
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://conadqnb0asi0
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
extends Comparable
|
|
||||||
|
|
||||||
## Base unit of manipulated objects
|
|
||||||
|
|
||||||
class_name Item
|
|
||||||
|
|
||||||
## Name of item that is displayed
|
|
||||||
@export var display_name : StringName
|
|
||||||
|
|
||||||
## Preview in UI
|
|
||||||
@export var preview : Texture2D
|
|
||||||
|
|
||||||
## Maximum amount of items that can be held in inventory
|
|
||||||
@export var stack_size : int
|
|
||||||
|
|
||||||
@export var scene : PackedScene
|
|
||||||
|
|
||||||
func is_equal(to: Comparable) -> bool:
|
|
||||||
if to is Item:
|
|
||||||
return to == self
|
|
||||||
elif to is ItemTag:
|
|
||||||
return self in to.items
|
|
||||||
return false
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://p5327ibxtyfs
|
|
||||||
|
|
@ -1,75 +0,0 @@
|
||||||
extends Node2D
|
|
||||||
|
|
||||||
## Currently held structure
|
|
||||||
var held_construction : Structure
|
|
||||||
var selected_prototype : Prototype
|
|
||||||
var delete_mode : bool = false
|
|
||||||
|
|
||||||
func _ready() -> void:
|
|
||||||
GuiEventBus.construction_selected.connect(on_construction_selected)
|
|
||||||
|
|
||||||
func _input(event: InputEvent) -> void:
|
|
||||||
|
|
||||||
if event.is_action_pressed("plc_remove_toggle"):
|
|
||||||
delete_mode = not delete_mode
|
|
||||||
if held_construction:
|
|
||||||
held_construction.queue_free()
|
|
||||||
selected_prototype = null
|
|
||||||
|
|
||||||
if event.is_action_pressed("plc_place") and delete_mode:
|
|
||||||
var zone : PlacementZone = try_get_zone(global_position)
|
|
||||||
if zone != null and zone.grid_controller.is_point_occupied(global_position):
|
|
||||||
zone.grid_controller.destroy_at(global_position)
|
|
||||||
|
|
||||||
if event.is_action_pressed("plc_cancel") and delete_mode:
|
|
||||||
delete_mode = false
|
|
||||||
|
|
||||||
if held_construction == null or delete_mode:
|
|
||||||
return
|
|
||||||
|
|
||||||
if event.is_action_pressed("plc_place"):
|
|
||||||
var zone = try_get_zone(held_construction.global_position)
|
|
||||||
if zone != null and held_construction.try_place(zone):
|
|
||||||
var direction = held_construction.direction
|
|
||||||
held_construction = selected_prototype.scene.instantiate()
|
|
||||||
add_child(held_construction)
|
|
||||||
held_construction.set_direction(direction)
|
|
||||||
|
|
||||||
if event.is_action_pressed("plc_rotate_up"):
|
|
||||||
if held_construction != null:
|
|
||||||
held_construction.increment_direction()
|
|
||||||
|
|
||||||
if event.is_action_pressed("plc_rotate_down"):
|
|
||||||
if held_construction != null:
|
|
||||||
held_construction.decrement_direction()
|
|
||||||
|
|
||||||
if event.is_action_pressed("plc_cancel"):
|
|
||||||
held_construction.queue_free()
|
|
||||||
selected_prototype = null
|
|
||||||
|
|
||||||
func on_construction_selected(constructible : Prototype):
|
|
||||||
if delete_mode:
|
|
||||||
return
|
|
||||||
if held_construction:
|
|
||||||
held_construction.queue_free()
|
|
||||||
held_construction = constructible.scene.instantiate()
|
|
||||||
add_child(held_construction)
|
|
||||||
selected_prototype = constructible
|
|
||||||
|
|
||||||
|
|
||||||
func _process(_delta: float) -> void:
|
|
||||||
var mouse_pos = get_global_mouse_position()
|
|
||||||
if held_construction == null:
|
|
||||||
global_position = mouse_pos
|
|
||||||
return
|
|
||||||
var zone = try_get_zone(mouse_pos)
|
|
||||||
if zone and held_construction.can_be_placed(zone):
|
|
||||||
global_position = zone.get_placement_position(mouse_pos)
|
|
||||||
else:
|
|
||||||
global_position = mouse_pos
|
|
||||||
|
|
||||||
func try_get_zone(point : Vector2) -> PlacementZone:
|
|
||||||
for zone in RuntimePlayerData.build_zones:
|
|
||||||
if zone.is_global_point_in_zone(point):
|
|
||||||
return zone
|
|
||||||
return null
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://b4nkk0ndqcto
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
@tool
|
|
||||||
@warning_ignore_start("integer_division")
|
|
||||||
|
|
||||||
## Class that helps to manage construction sites
|
|
||||||
extends Marker2D
|
|
||||||
|
|
||||||
class_name PlacementZone
|
|
||||||
|
|
||||||
## Rect that used for bounds check and conversions
|
|
||||||
@export var building_rect : Rect2:
|
|
||||||
set(value):
|
|
||||||
building_rect = value
|
|
||||||
if Engine.is_editor_hint():
|
|
||||||
queue_redraw()
|
|
||||||
get:
|
|
||||||
return building_rect
|
|
||||||
|
|
||||||
@export var grid_controller : GridController
|
|
||||||
|
|
||||||
func _ready() -> void:
|
|
||||||
if not Engine.is_editor_hint():
|
|
||||||
RuntimePlayerData.build_zones.append(self)
|
|
||||||
|
|
||||||
func _draw() -> void:
|
|
||||||
if Engine.is_editor_hint() and EditorInterface.get_inspector().get_edited_object() == self:
|
|
||||||
draw_rect(building_rect,Color.CYAN,false,1)
|
|
||||||
|
|
||||||
## Returns true if point (local coordinates) in rect, else return false
|
|
||||||
func is_point_in_zone(point : Vector2) -> bool:
|
|
||||||
return building_rect.has_point(point)
|
|
||||||
|
|
||||||
## Returns true if point (global coordinates) in rect, else return false
|
|
||||||
func is_global_point_in_zone(point: Vector2) -> bool:
|
|
||||||
return is_point_in_zone(to_local(point))
|
|
||||||
|
|
||||||
## Returns index of point (local coordinates) to be used in array
|
|
||||||
func indexify_point(point : Vector2) -> int:
|
|
||||||
if is_point_in_zone(point) == false:
|
|
||||||
return -1
|
|
||||||
return int(point.x) / int(Globals.GRID_SIZE.x) + int(building_rect.size.x/Globals.GRID_SIZE.x)*(int(point.y) / int(Globals.GRID_SIZE.y))
|
|
||||||
|
|
||||||
## Returns index of point (global coordinates) to be used in array
|
|
||||||
func indexify_global_point(point : Vector2) -> int:
|
|
||||||
return indexify_point(to_local(point))
|
|
||||||
|
|
||||||
## Inverses indexification of point, returning snapped position
|
|
||||||
func inverse_index(index: int) -> Vector2:
|
|
||||||
return to_global(Vector2(index%int(building_rect.size.x/Globals.GRID_SIZE.x)*Globals.GRID_SIZE.x,index / int(building_rect.size.x/Globals.GRID_SIZE.x) * Globals.GRID_SIZE.y))
|
|
||||||
|
|
||||||
## Returns snapped position of point (global coordinates).
|
|
||||||
## Equivalent of [code]
|
|
||||||
## inverse_index(indexify_global_point(point))
|
|
||||||
## [/code]
|
|
||||||
func get_placement_position(point : Vector2) -> Vector2:
|
|
||||||
if is_global_point_in_zone(point) == false:
|
|
||||||
return Vector2.ZERO
|
|
||||||
return to_global((to_local(point) / Globals.GRID_SIZE).floor()*Globals.GRID_SIZE + Globals.GRID_SIZE/2.0)
|
|
||||||
|
|
||||||
## Returns capacity of building zone to be used in the array
|
|
||||||
func get_capacity() -> int:
|
|
||||||
return int(building_rect.size.x/Globals.GRID_SIZE.x)*int(building_rect.size.y/Globals.GRID_SIZE.y)
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://lw1ya3iu14uf
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
extends Resource
|
|
||||||
|
|
||||||
## Player instantiatable resource
|
|
||||||
|
|
||||||
class_name Prototype
|
|
||||||
|
|
||||||
## Scene to instantiate
|
|
||||||
@export var scene : PackedScene
|
|
||||||
|
|
||||||
## UI Preview
|
|
||||||
@export var preview : Texture2D
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://c80sp6f77l5ha
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
@abstract
|
|
||||||
extends Resource
|
|
||||||
|
|
||||||
class_name Comparable
|
|
||||||
|
|
||||||
@abstract
|
|
||||||
func is_equal(to: Comparable) -> bool
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://bqcyt8qnxvonj
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
extends Comparable
|
|
||||||
|
|
||||||
class_name ItemTag
|
|
||||||
|
|
||||||
@export var items : Array[Item]
|
|
||||||
|
|
||||||
func is_equal(to: Comparable) -> bool:
|
|
||||||
if to is Item:
|
|
||||||
return to in self.items
|
|
||||||
elif to is ItemTag:
|
|
||||||
return to == self
|
|
||||||
return false
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://iasxpubh7f3i
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
extends Resource
|
|
||||||
|
|
||||||
class_name Recipe
|
|
||||||
|
|
||||||
@export var ingridients : Array[RecipePart]
|
|
||||||
@export var result : RecipePart
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://dl0i68ut0lw70
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
extends Resource
|
|
||||||
|
|
||||||
class_name RecipePart
|
|
||||||
|
|
||||||
@export var item : Comparable
|
|
||||||
@export var amount : int
|
|
||||||
|
|
||||||
func is_stack_sufficient(stack: Stack) -> bool:
|
|
||||||
return item.is_equal(stack.held_item) and stack.amount >= amount
|
|
||||||
|
|
||||||
func consume_stack(stack: Stack) -> bool:
|
|
||||||
if is_stack_sufficient(stack) == false:
|
|
||||||
return false
|
|
||||||
stack.amount -= amount
|
|
||||||
return true
|
|
||||||
|
|
||||||
func create_stack() -> Stack:
|
|
||||||
if item is Item:
|
|
||||||
return Stack.new(item,amount)
|
|
||||||
elif item is ItemTag:
|
|
||||||
return Stack.new(item.items[randi_range(0,len(item.items))],amount)
|
|
||||||
return null
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://w4v6jqv1ygqb
|
|
||||||
|
|
@ -1,86 +0,0 @@
|
||||||
@tool
|
|
||||||
extends Node2D
|
|
||||||
|
|
||||||
## Game object that interact with other structures in its grid space
|
|
||||||
class_name Structure
|
|
||||||
|
|
||||||
signal changed_direction(to: float,max_directions : int)
|
|
||||||
|
|
||||||
## Dimensions of structure in grid tiles
|
|
||||||
@export var dimensions : Rect2i = Rect2i(0,0,1,1):
|
|
||||||
set(value):
|
|
||||||
dimensions = value
|
|
||||||
if Engine.is_editor_hint():
|
|
||||||
queue_redraw()
|
|
||||||
get:
|
|
||||||
return dimensions
|
|
||||||
|
|
||||||
## Inventory of this structure
|
|
||||||
@export var inventory : Inventory
|
|
||||||
@export var direction : float
|
|
||||||
@export var maximum_directions : int
|
|
||||||
|
|
||||||
## Debug draw of points
|
|
||||||
func _draw() -> void:
|
|
||||||
if Engine.is_editor_hint():
|
|
||||||
for x in range(dimensions.size.x):
|
|
||||||
for y in range(dimensions.size.y):
|
|
||||||
draw_circle((dimensions.position+Vector2i(x,y)) * Vector2i(Globals.GRID_SIZE),2,Color.AQUA)
|
|
||||||
|
|
||||||
## Get structure at tile coordinates relative to this structure [br]
|
|
||||||
## dv : Vector2 - get position in tiles [br]
|
|
||||||
func get_relative(dv : Vector2) -> Structure:
|
|
||||||
if get_parent() is GridController:
|
|
||||||
return get_parent().get_at(relative_tile_as_global(dv))
|
|
||||||
return null
|
|
||||||
|
|
||||||
func relative_tile_as_global(dv: Vector2) -> Vector2:
|
|
||||||
return global_position+dv*Globals.GRID_SIZE
|
|
||||||
|
|
||||||
## Check structure is in zone and does not collide with any other structures [br]
|
|
||||||
## Returns true if structure is in zone and does not collide with any other structure [br]
|
|
||||||
## Returns false if structure is not in zone or does not collide with any other structure
|
|
||||||
func can_be_placed(zone : PlacementZone) -> bool:
|
|
||||||
for dp in get_dimension_points():
|
|
||||||
var point = global_position + dp
|
|
||||||
if zone.is_global_point_in_zone(point) == false:
|
|
||||||
return false
|
|
||||||
if zone.grid_controller.is_point_occupied(point):
|
|
||||||
return false
|
|
||||||
return true
|
|
||||||
|
|
||||||
## Tries to place structure in zone's grid controller
|
|
||||||
## Returns false if structure is not in zone or collides with any structure
|
|
||||||
func try_place(zone : PlacementZone) -> bool:
|
|
||||||
if can_be_placed(zone) == false:
|
|
||||||
return false
|
|
||||||
|
|
||||||
return zone.grid_controller.add_structure(self)
|
|
||||||
|
|
||||||
## Returns array of integer points in dimensions
|
|
||||||
func get_dimension_points() -> Array[Vector2]:
|
|
||||||
var result : Array[Vector2] = []
|
|
||||||
result.resize(dimensions.size.x*dimensions.size.y)
|
|
||||||
for x in range(dimensions.size.x):
|
|
||||||
for y in range(dimensions.size.y):
|
|
||||||
result[x + y * dimensions.size.x] = (Vector2(x,y)*Globals.GRID_SIZE + Vector2(dimensions.position))
|
|
||||||
return result
|
|
||||||
|
|
||||||
func set_direction(to : float) -> void:
|
|
||||||
direction = to
|
|
||||||
changed_direction.emit(direction,maximum_directions)
|
|
||||||
|
|
||||||
func increment_direction() -> void:
|
|
||||||
set_direction(wrapf(direction + TAU/maximum_directions,0,TAU))
|
|
||||||
|
|
||||||
func decrement_direction() -> void:
|
|
||||||
set_direction(wrapf(direction - TAU/maximum_directions,0,TAU))
|
|
||||||
|
|
||||||
func direction_vector() -> Vector2:
|
|
||||||
return Vector2.from_angle(direction)
|
|
||||||
|
|
||||||
func direction_to(structure: Structure):
|
|
||||||
return (structure.global_position-global_position).angle()
|
|
||||||
|
|
||||||
func direction_difference(structure: Structure):
|
|
||||||
return direction-structure.direction
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://bbd7o2st8kmgl
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
@abstract
|
|
||||||
extends Node2D
|
|
||||||
|
|
||||||
class_name StructureBehaviour
|
|
||||||
|
|
||||||
@onready var structure_parent : Structure = get_parent()
|
|
||||||
|
|
||||||
func _ready() -> void:
|
|
||||||
Ticker.tick.connect(_tick)
|
|
||||||
|
|
||||||
@abstract
|
|
||||||
func _tick(current_tick : int) -> void
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://iidfsh0lirc2
|
|
||||||
|
|
@ -1,51 +0,0 @@
|
||||||
extends StructureBehaviour
|
|
||||||
|
|
||||||
@onready var inventory : InOutInventory = structure_parent.inventory
|
|
||||||
@export var selected_recipe : Recipe
|
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
|
||||||
inventory.stack_added.connect(check_for_recipe)
|
|
||||||
switch_recipe.call_deferred(selected_recipe)
|
|
||||||
|
|
||||||
func switch_recipe(recipe: Recipe) -> void:
|
|
||||||
selected_recipe = recipe
|
|
||||||
inventory.input_capacity = len(selected_recipe.ingridients)
|
|
||||||
inventory.resize()
|
|
||||||
for i in range(len(selected_recipe.ingridients)):
|
|
||||||
inventory.input_array[i].filter = selected_recipe.ingridients[i].item
|
|
||||||
|
|
||||||
func _tick(_current_tick : int) -> void:
|
|
||||||
if inventory.output_slot.amount <= 0:
|
|
||||||
return
|
|
||||||
inventory.refresh()
|
|
||||||
var output : Structure = get_output_structure()
|
|
||||||
if output == null:
|
|
||||||
return
|
|
||||||
var transfer_context : InventoryContext = InventoryContext.new(structure_parent,output,structure_parent.relative_tile_as_global(get_output_position()))
|
|
||||||
if output.inventory.can_add(inventory.output_slot.held_item,transfer_context):
|
|
||||||
inventory.output_slot.merge_stack(output.inventory.add(inventory.output_slot.extract(),transfer_context))
|
|
||||||
|
|
||||||
func get_output_structure() -> Structure:
|
|
||||||
var rotated = Vector2(1.5,-0.5).rotated(structure_parent.direction)
|
|
||||||
return structure_parent.get_relative(rotated+Vector2(0.5,0.5))
|
|
||||||
|
|
||||||
func get_output_position() -> Vector2:
|
|
||||||
return to_global(Vector2(1.5,-0.5).rotated(structure_parent.direction)+Vector2(0.5,0.5))
|
|
||||||
|
|
||||||
func check_for_recipe(_stack : Stack, _position : int) -> void:
|
|
||||||
var flag:bool = false
|
|
||||||
for i in range(inventory.input_capacity):
|
|
||||||
if inventory.input_array[i].can_be_merged(_stack.held_item):
|
|
||||||
flag = true
|
|
||||||
if flag == false:
|
|
||||||
return
|
|
||||||
for i in range(len(selected_recipe.ingridients)):
|
|
||||||
if inventory.input_array[i].amount < selected_recipe.ingridients[i].amount:
|
|
||||||
return
|
|
||||||
craft()
|
|
||||||
|
|
||||||
func craft() -> void:
|
|
||||||
for i in range(len(selected_recipe.ingridients)):
|
|
||||||
inventory.input_array[i].extract_stack(selected_recipe.ingridients[i].amount)
|
|
||||||
inventory.output_slot.merge_stack(Stack.new(selected_recipe.result.item,selected_recipe.result.amount))
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://c7mx3uatj6ulm
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
||||||
extends StructureBehaviour
|
|
||||||
|
|
||||||
@onready var inventory : BeltInventory = structure_parent.inventory
|
|
||||||
|
|
||||||
func _draw() -> void:
|
|
||||||
for i in range(inventory.capacity):
|
|
||||||
if inventory.internal_array[i].amount > 0:
|
|
||||||
var calculated_position = calculate_position(i) - inventory.internal_array[i].held_item.preview.get_size()/2.0
|
|
||||||
draw_texture(inventory.internal_array[i].held_item.preview,calculated_position)
|
|
||||||
|
|
||||||
func _tick(current_tick: int) -> void:
|
|
||||||
queue_redraw()
|
|
||||||
if current_tick % 8 != 0:
|
|
||||||
return
|
|
||||||
inventory.refresh()
|
|
||||||
inventory.advance()
|
|
||||||
var next : Structure = get_next()
|
|
||||||
try_transfer(next)
|
|
||||||
|
|
||||||
func calculate_position(index: int) -> Vector2:
|
|
||||||
var indexed_part = 16.0 / inventory.capacity
|
|
||||||
|
|
||||||
return -structure_parent.direction_vector()*8 + structure_parent.direction_vector() * indexed_part * index
|
|
||||||
|
|
||||||
func get_next() -> Structure:
|
|
||||||
return structure_parent.get_relative(structure_parent.direction_vector())
|
|
||||||
|
|
||||||
func try_transfer(structure : Structure) -> void:
|
|
||||||
if structure == null or inventory.internal_array[inventory.capacity-1].amount == 0:
|
|
||||||
return
|
|
||||||
var last_slot = inventory.internal_array[inventory.capacity-1]
|
|
||||||
var transfer_context : InventoryContext = InventoryContext.new(structure_parent,structure,to_global(structure_parent.direction_vector()))
|
|
||||||
if structure.inventory.can_add(last_slot.held_item,transfer_context) == false:
|
|
||||||
return
|
|
||||||
last_slot.merge_stack(structure.inventory.add(last_slot.extract(),transfer_context))
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://bp341eiwvfvyl
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
extends AnimationPlayer
|
|
||||||
|
|
||||||
func _ready() -> void:
|
|
||||||
seek.call_deferred(BeltManager.sync_time, true)
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
uid://drsty3i1820ha
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
extends StructureBehaviour
|
|
||||||
|
|
||||||
const inp1 := preload("res://generic/items/dbg_input1.tres")
|
|
||||||
const inp2 := preload("res://generic/items/dbg_input2.tres")
|
|
||||||
const out := preload("res://generic/items/dbg_output.tres")
|
|
||||||
|
|
||||||
func _tick(_current_tick: int) -> void:
|
|
||||||
try_add(Vector2.UP,Stack.new(inp1,1))
|
|
||||||
try_add(Vector2.DOWN,Stack.new(inp2,1))
|
|
||||||
try_add(Vector2.RIGHT,Stack.new(out,1))
|
|
||||||
|
|
||||||
func try_add(dir: Vector2,stack : Stack):
|
|
||||||
var found = structure_parent.get_relative(dir)
|
|
||||||
if found != null and found.inventory != null:
|
|
||||||
found.inventory.add(stack)
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue