diff --git a/node_3d.tscn b/node_3d.tscn index e46644f..176fd14 100644 --- a/node_3d.tscn +++ b/node_3d.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=64 format=4 uid="uid://bwftban1ppo17"] +[gd_scene load_steps=66 format=4 uid="uid://bwftban1ppo17"] [ext_resource type="Script" uid="uid://y8qfdplqsijx" path="res://grid_map_test.gd" id="1_noarx"] [ext_resource type="Script" uid="uid://tx3j02eib7ba" path="res://scripts/camera.gd" id="1_wlxy5"] @@ -18,7 +18,9 @@ [ext_resource type="Texture2D" uid="uid://c41pea1l3e5b8" path="res://assets/images/icons/miner.png" id="15_3v7ru"] [ext_resource type="Script" uid="uid://tmyvv1p7co51" path="res://scripts/building_place_button.gd" id="17_tuemg"] [ext_resource type="Texture2D" uid="uid://dh2iqb21845yr" path="res://assets/images/icons/processor.png" id="18_ealrb"] +[ext_resource type="Texture2D" uid="uid://cgbwagn11sku6" path="res://assets/images/icons/storage.png" id="19_5t8nk"] [ext_resource type="Texture2D" uid="uid://c1mmxh7v77d8j" path="res://assets/images/icons/turret.png" id="19_jsnrv"] +[ext_resource type="PackedScene" uid="uid://buoyeprlof38x" path="res://objects/buildings/storage.tscn" id="20_j3e5s"] [ext_resource type="Texture2D" uid="uid://b48vbil24uyma" path="res://assets/images/icons/conveyor.png" id="20_jsnrv"] [ext_resource type="PackedScene" uid="uid://skxli3htgn7" path="res://objects/units/citizen.tscn" id="21_lggff"] [ext_resource type="Script" uid="uid://ckf7i6ig4twnq" path="res://scripts/CitizenManager.gd" id="21_s0gvp"] @@ -423,11 +425,11 @@ cell_size = Vector3(2, 1, 2) collision_mask = 31 bake_navigation = true data = { -"cells": PackedInt32Array(0, 0, 0, 0, 10, 0, 1, 3, 0, 1, 4, 0, 1, 6, 0, 2, 0, 0, 2, 1, 0, 2, 2, 0, 2, 5, 0, 2, 6, 0, 2, 7, 0, 2, 8, 0, 2, 9, 0, 2, 10, 0, 3, 1, 0, 3, 2, 0, 3, 3, 0, 3, 4, 0, 3, 5, 0, 3, 6, 0, 3, 7, 0, 3, 8, 0, 3, 9, 0, 3, 10, 0, 4, 1, 0, 4, 2, 0, 4, 3, 0, 4, 4, 0, 4, 5, 0, 4, 6, 0, 4, 7, 0, 4, 8, 0, 4, 9, 0, 4, 10, 0, 5, 1, 0, 5, 2, 0, 5, 3, 0, 5, 4, 0, 5, 5, 0, 5, 6, 0, 5, 7, 0, 5, 8, 0, 5, 9, 0, 5, 10, 0, 6, 1, 0, 6, 2, 0, 6, 3, 0, 6, 4, 0, 6, 5, 0, 6, 6, 0, 6, 7, 0, 6, 8, 0, 6, 9, 0, 6, 10, 0, 7, 2, 0, 7, 3, 0, 7, 4, 0, 7, 5, 0, 7, 6, 0, 7, 7, 0, 7, 8, 0, 7, 9, 0, 7, 10, 0, 8, 2, 0, 8, 3, 0, 8, 4, 0, 8, 5, 0, 8, 6, 0, 8, 7, 0, 8, 8, 0, 8, 9, 0, 8, 10, 0, 9, 1, 0, 9, 2, 0, 9, 3, 0, 9, 4, 0, 9, 5, 0, 9, 6, 0, 9, 7, 0, 9, 8, 0, 9, 9, 0, 9, 10, 0, 10, 0, 0, 10, 1, 0, 10, 2, 0, 10, 3, 0, 10, 4, 0, 10, 5, 0, 10, 6, 0, 10, 7, 0, 10, 8, 0, 10, 9, 0, 10, 10, 0, 11, 0, 0, 11, 1, 0, 11, 2, 0, 11, 3, 0, 11, 4, 0, 11, 5, 0, 11, 6, 0, 11, 7, 0, 11, 8, 0, 11, 9, 0, 11, 10, 0, 65536, 1, 0, 65536, 2, 0, 65537, 1, 1, 65537, 2, 1, 65536, 3, 0, 65536, 4, 0, 65536, 5, 0, 65536, 6, 0, 65536, 7, 0, 65536, 8, 0, 65536, 9, 0, 65537, 8, 1, 65537, 9, 1, 8, 1, 0, 7, 1, 0, 393226, 0, 655360, 393226, 1, 655360, 393225, 1, 655360, 393225, 2, 655360, 393226, 2, 655360, 393225, 3, 655360, 393226, 3, 655360, 9, 0, 655360, 8, 0, 655360, 7, 0, 655360, 6, 0, 524288, 5, 0, 524288, 4, 0, 524288, 65537, 0, 1441795, 65536, 0, 1048577, 65537, 3, 655362, 65537, 4, 1048578, 65538, 4, 655363, 65538, 3, 1441795, 65537, 5, 655363, 65537, 7, 1441795, 65537, 10, 655363, 65536, 10, 1441793, 1, 10, 0, 1, 7, 0, 1, 5, 0, 2, 4, 0, 2, 3, 0, 1, 0, 0, 3, 0, 131072, 0, 65525, 0, 0, 65526, 0, 0, 65527, 0, 0, 65528, 0, 0, 65529, 0, 0, 65530, 0, 0, 65531, 0, 0, 65532, 0, 0, 65533, 0, 0, 65534, 0, 0, 65535, 0, 1, 65525, 0, 1, 65526, 0, 1, 65527, 0, 1, 65528, 0, 1, 65529, 0, 1, 65530, 0, 1, 65531, 0, 1, 65532, 0, 1, 65533, 0, 1, 65534, 0, 1, 65535, 0, 2, 65525, 0, 2, 65526, 0, 2, 65527, 0, 2, 65528, 0, 2, 65529, 0, 2, 65530, 0, 2, 65531, 0, 2, 65532, 0, 2, 65533, 0, 2, 65534, 0, 2, 65535, 0, 3, 65525, 0, 3, 65526, 0, 3, 65527, 0, 3, 65528, 0, 3, 65529, 0, 3, 65530, 0, 3, 65531, 0, 3, 65532, 0, 3, 65533, 0, 3, 65534, 0, 3, 65535, 0, 4, 65525, 0, 4, 65526, 0, 4, 65527, 0, 4, 65528, 0, 4, 65529, 0, 4, 65530, 0, 4, 65531, 0, 4, 65532, 0, 4, 65533, 0, 4, 65534, 0, 4, 65535, 0, 5, 65525, 0, 5, 65526, 0, 5, 65527, 0, 5, 65528, 0, 5, 65529, 0, 5, 65530, 0, 5, 65531, 0, 5, 65532, 0, 5, 65533, 0, 5, 65534, 0, 5, 65535, 0, 6, 65525, 0, 6, 65526, 0, 6, 65527, 0, 6, 65528, 0, 6, 65529, 0, 6, 65530, 0, 6, 65531, 0, 6, 65532, 0, 6, 65533, 0, 6, 65534, 0, 6, 65535, 0, 7, 65525, 0, 7, 65526, 0, 7, 65527, 0, 7, 65528, 0, 7, 65529, 0, 7, 65530, 0, 7, 65531, 0, 7, 65532, 0, 7, 65533, 0, 7, 65534, 0, 7, 65535, 0, 8, 65525, 0, 8, 65526, 0, 8, 65527, 0, 8, 65528, 0, 8, 65529, 0, 8, 65530, 0, 8, 65531, 0, 8, 65532, 0, 8, 65533, 0, 8, 65534, 0, 8, 65535, 0, 9, 65525, 0, 9, 65526, 0, 9, 65527, 0, 9, 65528, 0, 9, 65529, 0, 9, 65530, 0, 9, 65531, 0, 9, 65532, 0, 9, 65533, 0, 9, 65534, 0, 9, 65535, 0, 10, 65525, 0, 10, 65526, 0, 10, 65527, 0, 10, 65528, 0, 10, 65529, 0, 10, 65530, 0, 10, 65531, 0, 10, 65532, 0, 10, 65533, 0, 10, 65534, 0, 10, 65535, 0, 11, 65525, 0, 11, 65526, 0, 11, 65527, 0, 11, 65528, 0, 11, 65529, 0, 11, 65530, 0, 11, 65531, 0, 11, 65532, 0, 11, 65533, 0, 11, 65534, 0, 11, 65535, 0, 12, 65525, 0, 12, 65526, 0, 12, 65527, 0, 12, 65528, 0, 12, 65529, 0, 12, 65530, 0, 12, 65531, 0, 12, 65532, 0, 12, 65533, 0, 12, 65534, 0, 12, 65535, 0, 12, 0, 0, 12, 1, 0, 12, 2, 0, 12, 3, 0, 12, 4, 0, 12, 5, 0, 12, 6, 0, 12, 7, 0, 12, 8, 0, 12, 9, 0, 12, 10, 0, 13, 65525, 0, 13, 65526, 0, 13, 65527, 0, 13, 65528, 0, 13, 65529, 0, 13, 65530, 0, 13, 65531, 0, 13, 65532, 0, 13, 65533, 0, 13, 65534, 0, 13, 65535, 0, 13, 0, 0, 13, 1, 0, 13, 2, 0, 13, 3, 0, 13, 4, 0, 13, 5, 0, 13, 6, 0, 13, 7, 0, 13, 8, 0, 13, 9, 0, 13, 10, 0, 14, 65525, 0, 14, 65526, 0, 14, 65527, 0, 14, 65528, 0, 14, 65529, 0, 14, 65530, 0, 14, 65531, 0, 14, 65532, 0, 14, 65533, 0, 14, 65534, 0, 14, 65535, 0, 14, 0, 0, 14, 1, 0, 14, 2, 0, 14, 3, 0, 14, 4, 0, 14, 5, 0, 14, 6, 0, 14, 7, 0, 14, 8, 0, 14, 9, 0, 14, 10, 0, 15, 65525, 0, 15, 65526, 0, 15, 65527, 0, 15, 65528, 0, 15, 65529, 0, 15, 65530, 0, 15, 65531, 0, 15, 65532, 0, 15, 65533, 0, 15, 65534, 0, 15, 65535, 0, 15, 0, 0, 15, 1, 0, 15, 2, 0, 15, 3, 0, 15, 4, 0, 15, 5, 0, 15, 6, 0, 15, 7, 0, 15, 8, 0, 15, 9, 0, 15, 10, 0, 16, 65525, 0, 16, 65526, 0, 16, 65527, 0, 16, 65528, 0, 16, 65529, 0, 16, 65530, 0, 16, 65531, 0, 16, 65532, 0, 16, 65533, 0, 16, 65534, 0, 16, 65535, 0, 16, 0, 0, 16, 1, 0, 16, 2, 0, 16, 3, 0, 16, 4, 0, 16, 5, 0, 16, 6, 0, 16, 7, 0, 16, 8, 0, 16, 9, 0, 16, 10, 0, 17, 65525, 0, 17, 65526, 0, 17, 65527, 0, 17, 65528, 0, 17, 65529, 0, 17, 65530, 0, 17, 65531, 0, 17, 65532, 0, 17, 65533, 0, 17, 65534, 0, 17, 65535, 0, 17, 0, 0, 17, 1, 0, 17, 2, 0, 17, 3, 0, 17, 4, 0, 17, 5, 0, 17, 6, 0, 17, 7, 0, 17, 8, 0, 17, 9, 0, 17, 10, 0, 18, 65525, 0, 18, 65526, 0, 18, 65527, 0, 18, 65528, 0, 18, 65529, 0, 18, 65530, 0, 18, 65531, 0, 18, 65532, 0, 18, 65533, 0, 18, 65534, 0, 18, 65535, 0, 18, 0, 0, 18, 1, 0, 18, 2, 0, 18, 3, 0, 18, 4, 0, 18, 5, 0, 18, 6, 0, 18, 7, 0, 18, 8, 0, 18, 9, 0, 18, 10, 0, 19, 65525, 0, 19, 65526, 0, 19, 65527, 0, 19, 65528, 0, 19, 65529, 0, 19, 65530, 0, 19, 65531, 0, 19, 65532, 0, 19, 65533, 0, 19, 65534, 0, 19, 65535, 0, 19, 0, 0, 19, 1, 0, 19, 2, 0, 19, 3, 0, 19, 4, 0, 19, 5, 0, 19, 6, 0, 19, 7, 0, 19, 8, 0, 19, 9, 0, 19, 10, 0, 20, 65525, 0, 20, 65526, 0, 20, 65527, 0, 20, 65528, 0, 20, 65529, 0, 20, 65530, 0, 20, 65531, 0, 20, 65532, 0, 20, 65533, 0, 20, 65534, 0, 20, 65535, 0, 20, 0, 0, 20, 1, 0, 20, 2, 0, 20, 3, 0, 20, 4, 0, 20, 5, 0, 20, 6, 0, 20, 7, 0, 20, 8, 0, 20, 9, 0, 20, 10, 0, 21, 65525, 0, 21, 65526, 0, 21, 65527, 0, 21, 65528, 0, 21, 65529, 0, 21, 65530, 0, 21, 65531, 0, 21, 65532, 0, 21, 65533, 0, 21, 65534, 0, 21, 65535, 0, 21, 0, 0, 21, 1, 0, 21, 2, 0, 21, 3, 0, 21, 4, 0, 21, 5, 0, 21, 6, 0, 21, 7, 0, 21, 8, 0, 21, 9, 0, 21, 10, 0, 22, 65525, 0, 22, 65526, 0, 22, 65527, 0, 22, 65528, 0, 22, 65529, 0, 22, 65530, 0, 22, 65531, 0, 22, 65532, 0, 22, 65533, 0, 22, 65534, 0, 22, 65535, 0, 22, 0, 0, 22, 1, 0, 22, 2, 0, 22, 3, 0, 22, 4, 0, 22, 5, 0, 22, 6, 0, 22, 7, 0, 22, 8, 0, 22, 9, 0, 22, 10, 0, 23, 65525, 0, 23, 65526, 0, 23, 65527, 0, 23, 65528, 0, 23, 65529, 0, 23, 65530, 0, 23, 65531, 0, 23, 65532, 0, 23, 65533, 0, 23, 65534, 0, 23, 65535, 0, 23, 0, 0, 23, 1, 0, 23, 2, 0, 23, 3, 0, 23, 4, 0, 23, 5, 0, 23, 6, 0, 23, 7, 0, 23, 8, 0, 23, 9, 0, 23, 10, 0, 24, 65525, 0, 24, 65526, 0, 24, 65527, 0, 24, 65528, 0, 24, 65529, 0, 24, 65530, 0, 24, 65531, 0, 24, 65532, 0, 24, 65533, 0, 24, 65534, 0, 24, 65535, 0, 24, 0, 0, 24, 1, 0, 24, 2, 0, 24, 3, 0, 24, 4, 0, 24, 5, 0, 24, 6, 0, 24, 7, 0, 24, 8, 0, 24, 9, 0, 24, 10, 0, 25, 65525, 0, 25, 65526, 0, 25, 65527, 0, 25, 65528, 0, 25, 65529, 0, 25, 65530, 0, 25, 65531, 0, 25, 65532, 0, 25, 65533, 0, 25, 65534, 0, 25, 65535, 0, 25, 0, 0, 25, 1, 0, 25, 2, 0, 25, 3, 0, 25, 4, 0, 25, 5, 0, 25, 6, 0, 25, 7, 0, 25, 8, 0, 25, 9, 0, 25, 10, 0, 26, 65525, 0, 26, 65526, 0, 26, 65527, 0, 26, 65528, 0, 26, 65529, 0, 26, 65530, 0, 26, 65531, 0, 26, 65532, 0, 26, 65533, 0, 26, 65534, 0, 26, 65535, 0, 26, 0, 0, 26, 1, 0, 26, 2, 0, 26, 3, 0, 26, 4, 0, 26, 5, 0, 26, 6, 0, 26, 7, 0, 26, 8, 0, 26, 9, 0, 26, 10, 0, 27, 65525, 0, 27, 65526, 0, 27, 65527, 0, 27, 65528, 0, 27, 65529, 0, 27, 65530, 0, 27, 65531, 0, 27, 65532, 0, 27, 65533, 0, 27, 65534, 0, 27, 65535, 0, 27, 0, 0, 27, 1, 0, 27, 2, 0, 27, 3, 0, 27, 4, 0, 27, 5, 0, 27, 6, 0, 27, 7, 0, 27, 8, 0, 27, 9, 0, 27, 10, 0, 65555, 6, 655360, 65555, 5, 655360, 65554, 4, 655360, 65552, 2, 655360, 65552, 1, 655360, 65551, 0, 655360, 65551, 65533, 655360, 65551, 65532, 655360, 65552, 65532, 655360, 65552, 65533, 655360, 65553, 65533, 655360, 65556, 2, 655360, 65556, 3, 655360, 65557, 3, 655360, 65557, 4, 655360, 65556, 4, 655360, 65555, 4, 655360, 65552, 0, 655360, 65542, 65529, 655360, 65543, 65529, 655360, 65543, 65530, 655360, 65544, 65530, 655360, 65545, 65530, 655360, 65546, 65530, 655360, 65547, 65530, 655360, 65547, 65529, 655360, 65547, 65528, 655360, 65546, 65528, 655360, 65545, 65527, 655360, 65544, 65527, 655360, 65543, 65527, 655360, 65542, 65527, 655360, 65541, 65527, 655360, 65540, 65527, 655360, 65540, 65528, 655360, 65541, 65528, 655360, 65542, 65528, 655360, 65544, 65529, 655360, 65545, 65529, 655360, 65546, 65529, 655360, 65543, 65528, 655360, 65544, 65528, 655360, 65545, 65528, 655360, 65561, 65532, 655360, 65560, 65531, 655360, 65559, 65530, 655360, 65558, 65529, 655360, 65558, 65528, 655360, 65559, 65528, 655360, 65559, 65529, 655360, 65560, 65529, 655360, 65560, 65530, 655360, 65561, 65530, 655360, 65561, 65531, 655360, 65562, 65532, 655360, 65557, 65528, 655360, 65561, 6, 655360, 65561, 5, 655360, 65561, 4, 655360, 65560, 3, 655360, 65560, 2, 655360, 65560, 1, 655360, 65561, 2, 655360, 65561, 3, 655360, 65562, 4, 655360, 65562, 5, 655360, 65562, 6, 655360, 65558, 4, 1, 65558, 3, 1, 65552, 65531, 1048577, 65551, 65531, 1048577, 65548, 65530, 1, 65548, 65528, 1, 65545, 65526, 1048577, 65544, 65526, 1048577, 65543, 65526, 1048577, 65542, 65526, 1048577, 65541, 65526, 1048577, 65540, 65526, 1048577, 65548, 65527, 1441795, 65546, 65526, 1441795, 65547, 65527, 1048577, 65546, 65527, 655362, 65539, 65526, 3, 65539, 65527, 655361, 65539, 65528, 655361, 65556, 0, 1, 65558, 2, 1441795, 65557, 1, 1441795, 65557, 2, 655362, 65556, 1, 655362, 65553, 65532, 655362, 65554, 65533, 1, 65556, 65535, 1441795, 65554, 65532, 1441795, 65553, 65531, 1441795, 65558, 5, 655363, 65556, 7, 655363, 65556, 6, 1, 65556, 5, 1048578, 65557, 5, 1441793, 65551, 1, 1441793, 65550, 1, 1441793, 65550, 65535, 1441794, 65549, 65535, 3, 65549, 1, 1048579, 65549, 0, 655361, 65550, 0, 655360, 65550, 65531, 3, 65550, 65532, 655361, 65550, 65533, 655361, 131079, 65528, 655360, 131080, 65528, 655360, 131081, 65529, 655360, 131080, 65529, 655360, 131090, 2, 655360, 131090, 1, 655360, 131089, 1, 655360, 131089, 0, 655360, 131088, 65535, 655360, 131089, 65535, 655360, 131090, 0, 655360, 131082, 65529, 1, 131080, 65527, 1048577, 131079, 65527, 1048577, 131078, 65528, 655361, 131081, 65530, 1441793, 131080, 65530, 1441793, 131082, 65528, 1441795, 131081, 65527, 1441795, 131081, 65528, 655362, 131078, 65527, 3, 131078, 65529, 1048579, 131079, 65530, 1048579, 131079, 65529, 2, 65541, 65529, 2, 65542, 65530, 2, 65539, 65529, 1048579, 65542, 65531, 1048579, 65540, 65529, 1441793, 65543, 65531, 1441793, 65544, 65531, 1441793, 65545, 65531, 1441793, 65546, 65531, 1441793, 65541, 65530, 1048579, 65548, 65531, 655363, 65547, 65531, 1441793, 131082, 65530, 655363, 65550, 65534, 655361, 131091, 2, 1, 131091, 1, 1, 131091, 0, 1, 131089, 65534, 1048577, 131088, 65534, 1048577, 131090, 65535, 655362, 131091, 65535, 1441795, 131088, 0, 655361, 131087, 65535, 655361, 131087, 65534, 3, 131088, 2, 1048579, 131089, 3, 1048579, 131089, 2, 2, 131088, 1, 655361, 131090, 3, 1441793, 131091, 3, 655363, 65560, 65527, 1441795, 65561, 65528, 1441795, 65562, 65529, 1441795, 65563, 65531, 1441795, 65563, 65533, 655363, 65559, 65532, 1048579, 65560, 65533, 1048579, 65558, 65531, 1048579, 65557, 65530, 1048579, 65556, 65529, 1048579, 65556, 65527, 3, 65561, 65533, 1441793, 65562, 65533, 1441793, 65556, 65528, 655361, 65559, 65527, 1048577, 65558, 65527, 1048577, 65557, 65527, 1048577, 65562, 65530, 1, 65562, 65531, 655362, 65561, 65529, 655362, 65560, 65528, 655362, 65563, 65532, 1, 65557, 65529, 2, 65558, 65530, 2, 65559, 65531, 2, 65560, 65532, 2, 393227, 3, 0, 393227, 2, 0, 393227, 1, 0, 393226, 65535, 0, 393226, 65534, 0, 393226, 65533, 0, 393226, 65532, 0, 393226, 65531, 0, 393226, 65530, 0, 393227, 65529, 0, 393227, 65528, 0, 393226, 65528, 0, 393225, 65528, 0, 393225, 65529, 0, 393226, 65529, 0, 393224, 65528, 655361, 327687, 65528, 655361, 262150, 65528, 655361, 196613, 65528, 655361, 131076, 65528, 655361, 131077, 65528, 524289, 196614, 65528, 524289, 262151, 65528, 524289, 327688, 65528, 524289, 65560, 5, 655361, 65560, 6, 655361, 65561, 7, 1441793, 65562, 7, 1441793, 65559, 1, 655361, 65559, 2, 655361, 65559, 3, 655361, 65560, 0, 1048577, 65562, 3, 1, 65562, 2, 1, 65563, 4, 1, 65563, 5, 1, 65563, 6, 1, 65563, 7, 655363, 65560, 7, 1048579, 65559, 4, 1048579, 65560, 4, 2, 65559, 0, 3, 65561, 0, 1441795, 65561, 1, 1, 131090, 65534, 1441795, 65555, 65535, 524288, 65546, 5, 0, 65546, 6, 0, 65546, 7, 0, 65546, 9, 0, 65546, 10, 0, 131082, 6, 1441793, 65546, 8, 1441793, 0, 11, 1441792, 0, 12, 1441792, 0, 13, 1441792, 0, 14, 1441792, 0, 15, 1441792, 0, 16, 1441792, 0, 17, 1441792, 0, 18, 1441792, 0, 19, 1441792, 0, 20, 1441792, 0, 21, 1441792, 0, 22, 1441792, 0, 23, 1441792, 1, 11, 1441792, 1, 12, 1441792, 1, 13, 1441792, 1, 14, 1441792, 1, 15, 1441792, 1, 16, 1441792, 1, 17, 1441792, 1, 18, 1441792, 1, 19, 1441792, 1, 20, 1441792, 1, 21, 1441792, 1, 22, 1441792, 1, 23, 1441792, 2, 11, 1441792, 2, 12, 1441792, 2, 13, 1441792, 2, 14, 1441792, 2, 15, 1441792, 2, 16, 1441792, 2, 17, 1441792, 2, 18, 1441792, 2, 19, 1441792, 2, 20, 1441792, 2, 21, 1441792, 2, 22, 1441792, 2, 23, 1441792, 3, 11, 1441792, 3, 12, 1441792, 3, 13, 1441792, 3, 14, 1441792, 3, 15, 1441792, 3, 16, 1441792, 3, 17, 1441792, 3, 18, 1441792, 3, 19, 1441792, 3, 20, 1441792, 3, 21, 1441792, 3, 22, 1441792, 3, 23, 1441792, 4, 11, 1441792, 4, 12, 1441792, 4, 13, 1441792, 4, 14, 1441792, 4, 15, 1441792, 4, 16, 1441792, 4, 17, 1441792, 4, 18, 1441792, 4, 19, 1441792, 4, 20, 1441792, 4, 21, 1441792, 4, 22, 1441792, 4, 23, 1441792, 5, 11, 1441792, 5, 12, 1441792, 5, 13, 1441792, 5, 14, 1441792, 5, 15, 1441792, 5, 16, 1441792, 5, 17, 1441792, 5, 18, 1441792, 5, 19, 1441792, 5, 20, 1441792, 5, 21, 1441792, 5, 22, 1441792, 5, 23, 1441792, 6, 11, 1441792, 6, 12, 1441792, 6, 13, 1441792, 6, 14, 1441792, 6, 15, 1441792, 6, 16, 1441792, 6, 17, 1441792, 6, 18, 1441792, 6, 19, 1441792, 6, 20, 1441792, 6, 21, 1441792, 6, 22, 1441792, 6, 23, 1441792, 7, 11, 1441792, 7, 12, 1441792, 7, 13, 1441792, 7, 14, 1441792, 7, 15, 1441792, 7, 16, 1441792, 7, 17, 1441792, 7, 18, 1441792, 7, 19, 1441792, 7, 20, 1441792, 7, 21, 1441792, 7, 22, 1441792, 7, 23, 1441792, 8, 11, 1441792, 8, 12, 1441792, 8, 13, 1441792, 8, 14, 1441792, 8, 15, 1441792, 8, 16, 1441792, 8, 17, 1441792, 8, 18, 1441792, 8, 19, 1441792, 8, 20, 1441792, 8, 21, 1441792, 8, 22, 1441792, 8, 23, 1441792, 9, 11, 1441792, 9, 12, 1441792, 9, 13, 1441792, 9, 14, 1441792, 9, 15, 1441792, 9, 16, 1441792, 9, 17, 1441792, 9, 18, 1441792, 9, 19, 1441792, 9, 20, 1441792, 9, 21, 1441792, 9, 22, 1441792, 9, 23, 1441792, 10, 11, 1441792, 10, 12, 1441792, 10, 13, 1441792, 10, 14, 1441792, 10, 15, 1441792, 10, 16, 1441792, 10, 17, 1441792, 10, 18, 1441792, 10, 19, 1441792, 10, 20, 1441792, 10, 21, 1441792, 10, 22, 1441792, 10, 23, 1441792, 11, 11, 1441792, 11, 12, 1441792, 11, 13, 1441792, 11, 14, 1441792, 11, 15, 1441792, 11, 16, 1441792, 11, 17, 1441792, 11, 18, 1441792, 11, 19, 1441792, 11, 20, 1441792, 11, 21, 1441792, 11, 22, 1441792, 11, 23, 1441792, 12, 11, 1441792, 12, 12, 1441792, 12, 13, 1441792, 12, 14, 1441792, 12, 15, 1441792, 12, 16, 1441792, 12, 17, 1441792, 12, 18, 1441792, 12, 19, 1441792, 12, 20, 1441792, 12, 21, 1441792, 12, 22, 1441792, 12, 23, 1441792, 13, 11, 1441792, 13, 12, 1441792, 13, 13, 1441792, 13, 14, 1441792, 13, 15, 1441792, 13, 16, 1441792, 13, 17, 1441792, 13, 18, 1441792, 13, 19, 1441792, 13, 20, 1441792, 13, 21, 1441792, 13, 22, 1441792, 13, 23, 1441792, 14, 11, 1441792, 14, 12, 1441792, 14, 13, 1441792, 14, 14, 1441792, 14, 15, 1441792, 14, 16, 1441792, 14, 17, 1441792, 14, 18, 1441792, 14, 19, 1441792, 14, 20, 1441792, 14, 21, 1441792, 14, 22, 1441792, 14, 23, 1441792, 15, 11, 1441792, 15, 12, 1441792, 15, 13, 1441792, 15, 14, 1441792, 15, 15, 1441792, 15, 16, 1441792, 15, 17, 1441792, 15, 18, 1441792, 15, 19, 1441792, 15, 20, 1441792, 15, 21, 1441792, 15, 22, 1441792, 15, 23, 1441792, 16, 11, 1441792, 16, 12, 1441792, 16, 13, 1441792, 16, 14, 1441792, 16, 15, 1441792, 16, 16, 1441792, 16, 17, 1441792, 16, 18, 1441792, 16, 19, 1441792, 16, 20, 1441792, 16, 21, 1441792, 16, 22, 1441792, 16, 23, 1441792, 17, 11, 1441792, 17, 12, 1441792, 17, 13, 1441792, 17, 14, 1441792, 17, 15, 1441792, 17, 16, 1441792, 17, 17, 1441792, 17, 18, 1441792, 17, 19, 1441792, 17, 20, 1441792, 17, 21, 1441792, 17, 22, 1441792, 17, 23, 1441792, 18, 11, 1441792, 18, 12, 1441792, 18, 13, 1441792, 18, 14, 1441792, 18, 15, 1441792, 18, 16, 1441792, 18, 17, 1441792, 18, 18, 1441792, 18, 19, 1441792, 18, 20, 1441792, 18, 21, 1441792, 18, 22, 1441792, 18, 23, 1441792, 19, 11, 1441792, 19, 12, 1441792, 19, 13, 1441792, 19, 14, 1441792, 19, 15, 1441792, 19, 16, 1441792, 19, 17, 1441792, 19, 18, 1441792, 19, 19, 1441792, 19, 20, 1441792, 19, 21, 1441792, 19, 22, 1441792, 19, 23, 1441792, 20, 11, 1441792, 20, 12, 1441792, 20, 13, 1441792, 20, 14, 1441792, 20, 15, 1441792, 20, 16, 1441792, 20, 17, 1441792, 20, 18, 1441792, 20, 19, 1441792, 20, 20, 1441792, 20, 21, 1441792, 20, 22, 1441792, 20, 23, 1441792, 21, 11, 1441792, 21, 12, 1441792, 21, 13, 1441792, 21, 14, 1441792, 21, 15, 1441792, 21, 16, 1441792, 21, 17, 1441792, 21, 18, 1441792, 21, 19, 1441792, 21, 20, 1441792, 21, 21, 1441792, 21, 22, 1441792, 21, 23, 1441792, 22, 11, 1441792, 22, 12, 1441792, 22, 13, 1441792, 22, 14, 1441792, 22, 15, 1441792, 22, 16, 1441792, 22, 17, 1441792, 22, 18, 1441792, 22, 19, 1441792, 22, 20, 1441792, 22, 21, 1441792, 22, 22, 1441792, 22, 23, 1441792, 23, 11, 1441792, 23, 12, 1441792, 23, 13, 1441792, 23, 14, 1441792, 23, 15, 1441792, 23, 16, 1441792, 23, 17, 1441792, 23, 18, 1441792, 23, 19, 1441792, 23, 20, 1441792, 23, 21, 1441792, 23, 22, 1441792, 23, 23, 1441792, 24, 11, 1441792, 24, 12, 1441792, 24, 13, 1441792, 24, 14, 1441792, 24, 15, 1441792, 24, 16, 1441792, 24, 17, 1441792, 24, 18, 1441792, 24, 19, 1441792, 24, 20, 1441792, 24, 21, 1441792, 24, 22, 1441792, 24, 23, 1441792, 25, 11, 1441792, 25, 12, 1441792, 25, 13, 1441792, 25, 14, 1441792, 25, 15, 1441792, 25, 16, 1441792, 25, 17, 1441792, 25, 18, 1441792, 25, 19, 1441792, 25, 20, 1441792, 25, 21, 1441792, 25, 22, 1441792, 25, 23, 1441792, 26, 11, 1441792, 26, 12, 1441792, 26, 13, 1441792, 26, 14, 1441792, 26, 15, 1441792, 26, 16, 1441792, 26, 17, 1441792, 26, 18, 1441792, 26, 19, 1441792, 26, 20, 1441792, 26, 21, 1441792, 26, 22, 1441792, 26, 23, 1441792, 27, 11, 1441792, 27, 12, 1441792, 27, 13, 1441792, 27, 14, 1441792, 27, 15, 1441792, 27, 16, 1441792, 27, 17, 1441792, 27, 18, 1441792, 27, 19, 1441792, 27, 20, 1441792, 27, 21, 1441792, 27, 22, 1441792, 27, 23, 1441792, 393225, 11, 1441792, 393225, 12, 1441792, 393225, 13, 1441792, 393226, 11, 1441792, 393226, 12, 1441792, 393226, 13, 1441792, 393227, 11, 1441792, 393227, 12, 1441792, 393227, 13, 1441792, 393225, 19, 1441792, 393225, 20, 1441792, 393225, 21, 1441792, 393226, 19, 1441792, 393226, 20, 1441792, 393226, 21, 1441792, 393227, 19, 1441792, 393227, 20, 1441792, 393227, 21, 0, 393226, 14, 1441792, 393226, 15, 1441792, 393226, 16, 1441792, 393226, 17, 1441792, 393226, 18, 1441792, 393224, 2, 655361, 327687, 2, 655361, 262150, 2, 655361, 196613, 2, 655361, 131076, 2, 655361, 65539, 2, 655361, 65540, 2, 524289, 131077, 2, 524289, 196614, 2, 524289, 262151, 2, 524289, 327688, 2, 524289, 196625, 2, 1, 262160, 2, 1, 327695, 2, 1, 393230, 2, 1, 393228, 2, 0, 393229, 2, 0, 196624, 2, 131073, 262159, 2, 131073, 327694, 2, 131073, 393226, 65527, 0, 393225, 65527, 0, 393226, 65526, 0, 393226, 65525, 0, 393226, 65524, 0, 393224, 12, 0, 393228, 12, 0, 393226, 22, 0, 393226, 23, 0, 393228, 20, 0, 393223, 20, 655361, 393223, 12, 655361, 327686, 20, 655361, 262149, 20, 655361, 196612, 20, 655361, 131075, 20, 655361, 65538, 20, 655361, 393229, 20, 1, 327694, 20, 1, 262159, 20, 1, 196624, 20, 1, 131089, 20, 1, 65554, 20, 0, 65553, 20, 131073, 131088, 20, 131073, 196623, 20, 131073, 262158, 20, 131073, 327693, 20, 131073, 327687, 20, 524289, 262150, 20, 524289, 196613, 20, 524289, 131076, 20, 524289, 65539, 20, 524289, 327686, 12, 655361, 262149, 12, 655361, 196612, 12, 655361, 131075, 12, 655361, 65538, 12, 655361, 393229, 12, 1, 327694, 12, 1, 262159, 12, 1, 196624, 12, 1, 131089, 12, 1, 65554, 12, 1, 65539, 12, 524289, 131076, 12, 524289, 196613, 12, 524289, 262150, 12, 524289, 327687, 12, 524289, 327693, 12, 131073, 262158, 12, 131073, 196623, 12, 131073, 131088, 12, 131073, 65553, 12, 131073, 65542, 15, 0, 65542, 16, 0, 65541, 16, 0, 65541, 17, 0, 65540, 17, 1441793, 65539, 17, 0, 65538, 16, 0, 65539, 16, 0, 65540, 16, 0, 65551, 21, 0, 65552, 21, 0, 65552, 22, 0, 65553, 22, 0, 65553, 21, 0, 65554, 21, 0, 65555, 21, 1441793, 65554, 19, 0, 65555, 19, 0, 65555, 18, 0, 65556, 18, 0, 65556, 17, 0, 65557, 17, 0, 65557, 18, 0, 65557, 19, 0, 65556, 19, 0, 65556, 20, 0, 65555, 20, 0, 131093, 17, 0, 131092, 17, 0, 131091, 17, 0, 131092, 18, 0, 131093, 18, 0, 131094, 18, 0, 131094, 17, 0, 131094, 16, 0, 131094, 15, 0, 131094, 14, 0, 131095, 14, 0, 131095, 13, 0, 131096, 13, 0, 131096, 12, 0, 131097, 12, 0, 131097, 13, 0, 131097, 14, 0, 131096, 14, 0, 131096, 15, 0, 131095, 15, 0, 131095, 16, 0, 131096, 16, 0, 131096, 17, 0, 131097, 17, 0, 131097, 16, 0, 131098, 16, 0, 131098, 15, 0, 131097, 15, 0, 65563, 13, 0, 65562, 13, 0, 65562, 12, 0, 65562, 11, 0, 65561, 11, 0, 65560, 11, 655361, 65560, 12, 0, 65561, 12, 0, 65562, 10, 0, 65561, 10, 0, 65560, 10, 0, 65561, 9, 0, 65562, 9, 0, 65543, 16, 0, 65544, 16, 0, 65545, 16, 0, 65546, 16, 0, 65547, 16, 0, 65547, 17, 0, 65546, 17, 0, 65548, 17, 0, 65549, 17, 0, 65549, 16, 0, 65550, 16, 0, 65551, 16, 0, 65551, 15, 0, 65552, 15, 1048577, 65552, 16, 0, 65548, 16, 0, 65553, 15, 0, 65554, 15, 0, 65553, 16, 0, 65554, 22, 1, 131092, 19, 1441793, 131093, 19, 1441793, 131091, 18, 1441793, 131098, 13, 1, 131098, 12, 1, 65550, 17, 1441793, 65551, 17, 1441793, 65552, 17, 1441793, 65553, 17, 1441793, 65549, 18, 1441793, 65548, 18, 1441793, 65547, 18, 1441793, 65546, 18, 1441793, 65554, 16, 1441793, 65554, 14, 1048577, 65553, 14, 1048577, 65551, 14, 1048577, 65541, 15, 1048577, 65540, 15, 1048577, 65539, 15, 1048577, 65538, 15, 1048577, 65542, 14, 1048577, 65543, 15, 1048577, 65544, 15, 1048577, 65545, 15, 1048577, 65555, 7, 1441793, 65548, 65529, 131072, 65549, 65529, 1, 65550, 65529, 655361, 65551, 65529, 655361, 65552, 65529, 655360, 131088, 65529, 1, 131084, 65529, 1, 65553, 65529, 1, 65546, 11, 1441793, 393224, 20, 0, 393227, 65527, 0) +"cells": PackedInt32Array(0, 0, 0, 0, 10, 0, 1, 3, 0, 1, 4, 0, 1, 6, 0, 2, 0, 0, 2, 1, 0, 2, 2, 0, 2, 5, 0, 2, 6, 0, 2, 7, 0, 2, 8, 0, 2, 9, 0, 2, 10, 0, 3, 1, 0, 3, 2, 0, 3, 3, 0, 3, 4, 0, 3, 5, 0, 3, 6, 0, 3, 7, 0, 3, 8, 0, 3, 9, 0, 3, 10, 0, 4, 1, 0, 4, 2, 0, 4, 3, 0, 4, 4, 0, 4, 5, 0, 4, 6, 0, 4, 7, 0, 4, 8, 0, 4, 9, 0, 4, 10, 0, 5, 1, 0, 5, 2, 0, 5, 3, 0, 5, 4, 0, 5, 5, 0, 5, 6, 0, 5, 7, 0, 5, 8, 0, 5, 9, 0, 5, 10, 0, 6, 1, 0, 6, 2, 0, 6, 3, 0, 6, 4, 0, 6, 5, 0, 6, 6, 0, 6, 7, 0, 6, 8, 0, 6, 9, 0, 6, 10, 0, 7, 2, 0, 7, 3, 0, 7, 4, 0, 7, 5, 0, 7, 6, 0, 7, 7, 0, 7, 8, 0, 7, 9, 0, 7, 10, 0, 8, 2, 0, 8, 3, 0, 8, 4, 0, 8, 5, 0, 8, 6, 0, 8, 7, 0, 8, 8, 0, 8, 9, 0, 8, 10, 0, 9, 1, 0, 9, 2, 0, 9, 3, 0, 9, 4, 0, 9, 5, 0, 9, 6, 0, 9, 7, 0, 9, 8, 0, 9, 9, 0, 9, 10, 0, 10, 0, 0, 10, 1, 0, 10, 2, 0, 10, 3, 0, 10, 4, 0, 10, 5, 0, 10, 6, 0, 10, 7, 0, 10, 8, 0, 10, 9, 0, 10, 10, 0, 11, 0, 0, 11, 1, 0, 11, 2, 0, 11, 3, 0, 11, 4, 0, 11, 5, 0, 11, 6, 0, 11, 7, 0, 11, 8, 0, 11, 9, 0, 11, 10, 0, 65536, 1, 0, 65536, 2, 0, 65537, 1, 1, 65537, 2, 1, 65536, 3, 0, 65536, 4, 0, 65536, 5, 0, 65536, 6, 0, 65536, 7, 0, 65536, 8, 0, 65536, 9, 0, 65537, 8, 1, 65537, 9, 1, 8, 1, 0, 7, 1, 0, 393226, 0, 655360, 393226, 1, 655360, 393225, 1, 655360, 393225, 2, 655360, 393226, 2, 655360, 393225, 3, 655360, 393226, 3, 655360, 9, 0, 655360, 8, 0, 655360, 7, 0, 655360, 6, 0, 524288, 5, 0, 524288, 4, 0, 524288, 65537, 0, 1441795, 65536, 0, 1048577, 65537, 3, 655362, 65537, 4, 1048578, 65538, 4, 655363, 65538, 3, 1441795, 65537, 5, 655363, 65537, 7, 1441795, 65537, 10, 655363, 65536, 10, 1441793, 1, 10, 0, 1, 7, 0, 1, 5, 0, 2, 4, 0, 2, 3, 0, 1, 0, 0, 3, 0, 131072, 0, 65525, 0, 0, 65526, 0, 0, 65527, 0, 0, 65528, 0, 0, 65529, 0, 0, 65530, 0, 0, 65531, 0, 0, 65532, 0, 0, 65533, 0, 0, 65534, 0, 0, 65535, 0, 1, 65525, 0, 1, 65526, 0, 1, 65527, 0, 1, 65528, 0, 1, 65529, 0, 1, 65530, 0, 1, 65531, 0, 1, 65532, 0, 1, 65533, 0, 1, 65534, 0, 1, 65535, 0, 2, 65525, 0, 2, 65526, 0, 2, 65527, 0, 2, 65528, 0, 2, 65529, 0, 2, 65530, 0, 2, 65531, 0, 2, 65532, 0, 2, 65533, 0, 2, 65534, 0, 2, 65535, 0, 3, 65525, 0, 3, 65526, 0, 3, 65527, 0, 3, 65528, 0, 3, 65529, 0, 3, 65530, 0, 3, 65531, 0, 3, 65532, 0, 3, 65533, 0, 3, 65534, 0, 3, 65535, 0, 4, 65525, 0, 4, 65526, 0, 4, 65527, 0, 4, 65528, 0, 4, 65529, 0, 4, 65530, 0, 4, 65531, 0, 4, 65532, 0, 4, 65533, 0, 4, 65534, 0, 4, 65535, 0, 5, 65525, 0, 5, 65526, 0, 5, 65527, 0, 5, 65528, 0, 5, 65529, 0, 5, 65530, 0, 5, 65531, 0, 5, 65532, 0, 5, 65533, 0, 5, 65534, 0, 5, 65535, 0, 6, 65525, 0, 6, 65526, 0, 6, 65527, 0, 6, 65528, 0, 6, 65529, 0, 6, 65530, 0, 6, 65531, 0, 6, 65532, 0, 6, 65533, 0, 6, 65534, 0, 6, 65535, 0, 7, 65525, 0, 7, 65526, 0, 7, 65527, 0, 7, 65528, 0, 7, 65529, 0, 7, 65530, 0, 7, 65531, 0, 7, 65532, 0, 7, 65533, 0, 7, 65534, 0, 7, 65535, 0, 8, 65525, 0, 8, 65526, 0, 8, 65527, 0, 8, 65528, 0, 8, 65529, 0, 8, 65530, 0, 8, 65531, 0, 8, 65532, 0, 8, 65533, 0, 8, 65534, 0, 8, 65535, 0, 9, 65525, 0, 9, 65526, 0, 9, 65527, 0, 9, 65528, 0, 9, 65529, 0, 9, 65530, 0, 9, 65531, 0, 9, 65532, 0, 9, 65533, 0, 9, 65534, 0, 9, 65535, 0, 10, 65525, 0, 10, 65526, 0, 10, 65527, 0, 10, 65528, 0, 10, 65529, 0, 10, 65530, 0, 10, 65531, 0, 10, 65532, 0, 10, 65533, 0, 10, 65534, 0, 10, 65535, 0, 11, 65525, 0, 11, 65526, 0, 11, 65527, 0, 11, 65528, 0, 11, 65529, 0, 11, 65530, 0, 11, 65531, 0, 11, 65532, 0, 11, 65533, 0, 11, 65534, 0, 11, 65535, 0, 12, 65525, 0, 12, 65526, 0, 12, 65527, 0, 12, 65528, 0, 12, 65529, 0, 12, 65530, 0, 12, 65531, 0, 12, 65532, 0, 12, 65533, 0, 12, 65534, 0, 12, 65535, 0, 12, 0, 0, 12, 1, 0, 12, 2, 0, 12, 3, 0, 12, 4, 0, 12, 5, 0, 12, 6, 0, 12, 7, 0, 12, 8, 0, 12, 9, 0, 12, 10, 0, 13, 65525, 0, 13, 65526, 0, 13, 65527, 0, 13, 65528, 0, 13, 65529, 0, 13, 65530, 0, 13, 65531, 0, 13, 65532, 0, 13, 65533, 0, 13, 65534, 0, 13, 65535, 0, 13, 0, 0, 13, 1, 0, 13, 2, 0, 13, 3, 0, 13, 4, 0, 13, 5, 0, 13, 6, 0, 13, 7, 0, 13, 8, 0, 13, 9, 0, 13, 10, 0, 14, 65525, 0, 14, 65526, 0, 14, 65527, 0, 14, 65528, 0, 14, 65529, 0, 14, 65530, 0, 14, 65531, 0, 14, 65532, 0, 14, 65533, 0, 14, 65534, 0, 14, 65535, 0, 14, 0, 0, 14, 1, 0, 14, 2, 0, 14, 3, 0, 14, 4, 0, 14, 5, 0, 14, 6, 0, 14, 7, 0, 14, 8, 0, 14, 9, 0, 14, 10, 0, 15, 65525, 0, 15, 65526, 0, 15, 65527, 0, 15, 65528, 0, 15, 65529, 0, 15, 65530, 0, 15, 65531, 0, 15, 65532, 0, 15, 65533, 0, 15, 65534, 0, 15, 65535, 0, 15, 0, 0, 15, 1, 0, 15, 2, 0, 15, 3, 0, 15, 4, 0, 15, 5, 0, 15, 6, 0, 15, 7, 0, 15, 8, 0, 15, 9, 0, 15, 10, 0, 16, 65525, 0, 16, 65526, 0, 16, 65527, 0, 16, 65528, 0, 16, 65529, 0, 16, 65530, 0, 16, 65531, 0, 16, 65532, 0, 16, 65533, 0, 16, 65534, 0, 16, 65535, 0, 16, 0, 0, 16, 1, 0, 16, 2, 0, 16, 3, 0, 16, 4, 0, 16, 5, 0, 16, 6, 0, 16, 7, 0, 16, 8, 0, 16, 9, 0, 16, 10, 0, 17, 65525, 0, 17, 65526, 0, 17, 65527, 0, 17, 65528, 0, 17, 65529, 0, 17, 65530, 0, 17, 65531, 0, 17, 65532, 0, 17, 65533, 0, 17, 65534, 0, 17, 65535, 0, 17, 0, 0, 17, 1, 0, 17, 2, 0, 17, 3, 0, 17, 4, 0, 17, 5, 0, 17, 6, 0, 17, 7, 0, 17, 8, 0, 17, 9, 0, 17, 10, 0, 18, 65525, 0, 18, 65526, 0, 18, 65527, 0, 18, 65528, 0, 18, 65529, 0, 18, 65530, 0, 18, 65531, 0, 18, 65532, 0, 18, 65533, 0, 18, 65534, 0, 18, 65535, 0, 18, 0, 0, 18, 1, 0, 18, 2, 0, 18, 3, 0, 18, 4, 0, 18, 5, 0, 18, 6, 0, 18, 7, 0, 18, 8, 0, 18, 9, 0, 18, 10, 0, 19, 65525, 0, 19, 65526, 0, 19, 65527, 0, 19, 65528, 0, 19, 65529, 0, 19, 65530, 0, 19, 65531, 0, 19, 65532, 0, 19, 65533, 0, 19, 65534, 0, 19, 65535, 0, 19, 0, 0, 19, 1, 0, 19, 2, 0, 19, 3, 0, 19, 4, 0, 19, 5, 0, 19, 6, 0, 19, 7, 0, 19, 8, 0, 19, 9, 0, 19, 10, 0, 20, 65525, 0, 20, 65526, 0, 20, 65527, 0, 20, 65528, 0, 20, 65529, 0, 20, 65530, 0, 20, 65531, 0, 20, 65532, 0, 20, 65533, 0, 20, 65534, 0, 20, 65535, 0, 20, 0, 0, 20, 1, 0, 20, 2, 0, 20, 3, 0, 20, 4, 0, 20, 5, 0, 20, 6, 0, 20, 7, 0, 20, 8, 0, 20, 9, 0, 20, 10, 0, 21, 65525, 0, 21, 65526, 0, 21, 65527, 0, 21, 65528, 0, 21, 65529, 0, 21, 65530, 0, 21, 65531, 0, 21, 65532, 0, 21, 65533, 0, 21, 65534, 0, 21, 65535, 0, 21, 0, 0, 21, 1, 0, 21, 2, 0, 21, 3, 0, 21, 4, 0, 21, 5, 0, 21, 6, 0, 21, 7, 0, 21, 8, 0, 21, 9, 0, 21, 10, 0, 22, 65525, 0, 22, 65526, 0, 22, 65527, 0, 22, 65528, 0, 22, 65529, 0, 22, 65530, 0, 22, 65531, 0, 22, 65532, 0, 22, 65533, 0, 22, 65534, 0, 22, 65535, 0, 22, 0, 0, 22, 1, 0, 22, 2, 0, 22, 3, 0, 22, 4, 0, 22, 5, 0, 22, 6, 0, 22, 7, 0, 22, 8, 0, 22, 9, 0, 22, 10, 0, 23, 65525, 0, 23, 65526, 0, 23, 65527, 0, 23, 65528, 0, 23, 65529, 0, 23, 65530, 0, 23, 65531, 0, 23, 65532, 0, 23, 65533, 0, 23, 65534, 0, 23, 65535, 0, 23, 0, 0, 23, 1, 0, 23, 2, 0, 23, 3, 0, 23, 4, 0, 23, 5, 0, 23, 6, 0, 23, 7, 0, 23, 8, 0, 23, 9, 0, 23, 10, 0, 24, 65525, 0, 24, 65526, 0, 24, 65527, 0, 24, 65528, 0, 24, 65529, 0, 24, 65530, 0, 24, 65531, 0, 24, 65532, 0, 24, 65533, 0, 24, 65534, 0, 24, 65535, 0, 24, 0, 0, 24, 1, 0, 24, 2, 0, 24, 3, 0, 24, 4, 0, 24, 5, 0, 24, 6, 0, 24, 7, 0, 24, 8, 0, 24, 9, 0, 24, 10, 0, 25, 65525, 0, 25, 65526, 0, 25, 65527, 0, 25, 65528, 0, 25, 65529, 0, 25, 65530, 0, 25, 65531, 0, 25, 65532, 0, 25, 65533, 0, 25, 65534, 0, 25, 65535, 0, 25, 0, 0, 25, 1, 0, 25, 2, 0, 25, 3, 0, 25, 4, 0, 25, 5, 0, 25, 6, 0, 25, 7, 0, 25, 8, 0, 25, 9, 0, 25, 10, 0, 26, 65525, 0, 26, 65526, 0, 26, 65527, 0, 26, 65528, 0, 26, 65529, 0, 26, 65530, 0, 26, 65531, 0, 26, 65532, 0, 26, 65533, 0, 26, 65534, 0, 26, 65535, 0, 26, 0, 0, 26, 1, 0, 26, 2, 0, 26, 3, 0, 26, 4, 0, 26, 5, 0, 26, 6, 0, 26, 7, 0, 26, 8, 0, 26, 9, 0, 26, 10, 0, 27, 65525, 0, 27, 65526, 0, 27, 65527, 0, 27, 65528, 0, 27, 65529, 0, 27, 65530, 0, 27, 65531, 0, 27, 65532, 0, 27, 65533, 0, 27, 65534, 0, 27, 65535, 0, 27, 0, 0, 27, 1, 0, 27, 2, 0, 27, 3, 0, 27, 4, 0, 27, 5, 0, 27, 6, 0, 27, 7, 0, 27, 8, 0, 27, 9, 0, 27, 10, 0, 65555, 6, 655360, 65555, 5, 655360, 65554, 4, 655360, 65552, 2, 655360, 65552, 1, 655360, 65551, 0, 655360, 65551, 65533, 655360, 65551, 65532, 655360, 65552, 65532, 655360, 65552, 65533, 655360, 65553, 65533, 655360, 65556, 2, 655360, 65556, 3, 655360, 65557, 3, 655360, 65557, 4, 655360, 65556, 4, 655360, 65555, 4, 655360, 65552, 0, 655360, 65542, 65529, 655360, 65543, 65529, 655360, 65543, 65530, 655360, 65544, 65530, 655360, 65545, 65530, 655360, 65546, 65530, 655360, 65547, 65530, 655360, 65547, 65529, 655360, 65547, 65528, 655360, 65546, 65528, 655360, 65545, 65527, 655360, 65544, 65527, 655360, 65543, 65527, 655360, 65542, 65527, 655360, 65541, 65527, 655360, 65540, 65527, 655360, 65540, 65528, 655360, 65541, 65528, 655360, 65542, 65528, 655360, 65544, 65529, 655360, 65545, 65529, 655360, 65546, 65529, 655360, 65543, 65528, 655360, 65544, 65528, 655360, 65545, 65528, 655360, 65561, 65532, 655360, 65560, 65531, 655360, 65559, 65530, 655360, 65558, 65529, 655360, 65558, 65528, 655360, 65559, 65528, 655360, 65559, 65529, 655360, 65560, 65529, 655360, 65560, 65530, 655360, 65561, 65530, 655360, 65561, 65531, 655360, 65562, 65532, 655360, 65557, 65528, 655360, 65561, 6, 655360, 65561, 5, 655360, 65561, 4, 655360, 65560, 3, 655360, 65560, 2, 655360, 65560, 1, 655360, 65561, 2, 655360, 65561, 3, 655360, 65562, 4, 655360, 65562, 5, 655360, 65562, 6, 655360, 65558, 4, 1, 65558, 3, 1, 65552, 65531, 1048577, 65551, 65531, 1048577, 65548, 65530, 1, 65548, 65528, 1, 65545, 65526, 1048577, 65544, 65526, 1048577, 65543, 65526, 1048577, 65542, 65526, 1048577, 65541, 65526, 1048577, 65540, 65526, 1048577, 65548, 65527, 1441795, 65546, 65526, 1441795, 65547, 65527, 1048577, 65546, 65527, 655362, 65539, 65526, 3, 65539, 65527, 655361, 65539, 65528, 655361, 65556, 0, 1, 65558, 2, 1441795, 65557, 1, 1441795, 65557, 2, 655362, 65556, 1, 655362, 65553, 65532, 655362, 65554, 65533, 1, 65556, 65535, 1441795, 65554, 65532, 1441795, 65553, 65531, 1441795, 65558, 5, 655363, 65556, 7, 655363, 65556, 6, 1, 65556, 5, 1048578, 65557, 5, 1441793, 65551, 1, 1441793, 65550, 1, 1441793, 65550, 65535, 1441794, 65549, 65535, 3, 65549, 1, 1048579, 65549, 0, 655361, 65550, 0, 655360, 65550, 65531, 3, 65550, 65532, 655361, 65550, 65533, 655361, 131079, 65528, 655360, 131080, 65528, 655360, 131081, 65529, 655360, 131080, 65529, 655360, 131090, 2, 655360, 131090, 1, 655360, 131089, 1, 655360, 131089, 0, 655360, 131088, 65535, 655360, 131089, 65535, 655360, 131090, 0, 655360, 131082, 65529, 1, 131080, 65527, 1048577, 131079, 65527, 1048577, 131078, 65528, 655361, 131081, 65530, 1441793, 131080, 65530, 1441793, 131082, 65528, 1441795, 131081, 65527, 1441795, 131081, 65528, 655362, 131078, 65527, 3, 131078, 65529, 1048579, 131079, 65530, 1048579, 131079, 65529, 2, 65541, 65529, 2, 65542, 65530, 2, 65539, 65529, 1048579, 65542, 65531, 1048579, 65540, 65529, 1441793, 65543, 65531, 1441793, 65544, 65531, 1441793, 65545, 65531, 1441793, 65546, 65531, 1441793, 65541, 65530, 1048579, 65548, 65531, 655363, 65547, 65531, 1441793, 131082, 65530, 655363, 65550, 65534, 655361, 131091, 2, 1, 131091, 1, 1, 131091, 0, 1, 131089, 65534, 1048577, 131088, 65534, 1048577, 131090, 65535, 655362, 131091, 65535, 1441795, 131088, 0, 655361, 131087, 65535, 655361, 131087, 65534, 3, 131088, 2, 1048579, 131089, 3, 1048579, 131089, 2, 2, 131088, 1, 655361, 131090, 3, 1441793, 131091, 3, 655363, 65560, 65527, 1441795, 65561, 65528, 1441795, 65562, 65529, 1441795, 65563, 65531, 1441795, 65563, 65533, 655363, 65559, 65532, 1048579, 65560, 65533, 1048579, 65558, 65531, 1048579, 65557, 65530, 1048579, 65556, 65529, 1048579, 65556, 65527, 3, 65561, 65533, 1441793, 65562, 65533, 1441793, 65556, 65528, 655361, 65559, 65527, 1048577, 65558, 65527, 1048577, 65557, 65527, 1048577, 65562, 65530, 1, 65562, 65531, 655362, 65561, 65529, 655362, 65560, 65528, 655362, 65563, 65532, 1, 65557, 65529, 2, 65558, 65530, 2, 65559, 65531, 2, 65560, 65532, 2, 393227, 3, 0, 393227, 2, 0, 393227, 1, 0, 393226, 65535, 0, 393226, 65534, 0, 393226, 65533, 0, 393226, 65532, 0, 393226, 65531, 0, 393226, 65530, 0, 393227, 65529, 0, 393227, 65528, 0, 393226, 65528, 0, 393225, 65528, 0, 393225, 65529, 0, 393226, 65529, 0, 393224, 65528, 655361, 327687, 65528, 655361, 262150, 65528, 655361, 196613, 65528, 655361, 131076, 65528, 655361, 131077, 65528, 524289, 196614, 65528, 524289, 262151, 65528, 524289, 327688, 65528, 524289, 65560, 5, 655361, 65560, 6, 655361, 65561, 7, 1441793, 65562, 7, 1441793, 65559, 1, 655361, 65559, 2, 655361, 65559, 3, 655361, 65560, 0, 1048577, 65562, 3, 1, 65562, 2, 1, 65563, 4, 1, 65563, 5, 1, 65563, 6, 1, 65563, 7, 655363, 65560, 7, 1048579, 65559, 4, 1048579, 65560, 4, 2, 65559, 0, 3, 65561, 0, 1441795, 65561, 1, 1, 131090, 65534, 1441795, 65555, 65535, 524288, 65546, 5, 0, 65546, 6, 0, 65546, 7, 0, 65546, 9, 0, 65546, 10, 0, 131082, 6, 1441793, 65546, 8, 1441793, 0, 11, 1441792, 0, 12, 1441792, 0, 13, 1441792, 0, 14, 1441792, 0, 15, 1441792, 0, 16, 1441792, 0, 17, 1441792, 0, 18, 1441792, 0, 19, 1441792, 0, 20, 1441792, 0, 21, 1441792, 0, 22, 1441792, 0, 23, 1441792, 1, 11, 1441792, 1, 12, 1441792, 1, 13, 1441792, 1, 14, 1441792, 1, 15, 1441792, 1, 16, 1441792, 1, 17, 1441792, 1, 18, 1441792, 1, 19, 1441792, 1, 20, 1441792, 1, 21, 1441792, 1, 22, 1441792, 1, 23, 1441792, 2, 11, 1441792, 2, 12, 1441792, 2, 13, 1441792, 2, 14, 1441792, 2, 15, 1441792, 2, 16, 1441792, 2, 17, 1441792, 2, 18, 1441792, 2, 19, 1441792, 2, 20, 1441792, 2, 21, 1441792, 2, 22, 1441792, 2, 23, 1441792, 3, 11, 1441792, 3, 12, 1441792, 3, 13, 1441792, 3, 14, 1441792, 3, 15, 1441792, 3, 16, 1441792, 3, 17, 1441792, 3, 18, 1441792, 3, 19, 1441792, 3, 20, 1441792, 3, 21, 1441792, 3, 22, 1441792, 3, 23, 1441792, 4, 11, 1441792, 4, 12, 1441792, 4, 13, 1441792, 4, 14, 1441792, 4, 15, 1441792, 4, 16, 1441792, 4, 17, 1441792, 4, 18, 1441792, 4, 19, 1441792, 4, 20, 1441792, 4, 21, 1441792, 4, 22, 1441792, 4, 23, 1441792, 5, 11, 1441792, 5, 12, 1441792, 5, 13, 1441792, 5, 14, 1441792, 5, 15, 1441792, 5, 16, 1441792, 5, 17, 1441792, 5, 18, 1441792, 5, 19, 1441792, 5, 20, 1441792, 5, 21, 1441792, 5, 22, 1441792, 5, 23, 1441792, 6, 11, 1441792, 6, 12, 1441792, 6, 13, 1441792, 6, 14, 1441792, 6, 15, 1441792, 6, 16, 1441792, 6, 17, 1441792, 6, 18, 1441792, 6, 19, 1441792, 6, 20, 1441792, 6, 21, 1441792, 6, 22, 1441792, 6, 23, 1441792, 7, 11, 1441792, 7, 12, 1441792, 7, 13, 1441792, 7, 14, 1441792, 7, 15, 1441792, 7, 16, 1441792, 7, 17, 1441792, 7, 18, 1441792, 7, 19, 1441792, 7, 20, 1441792, 7, 21, 1441792, 7, 22, 1441792, 7, 23, 1441792, 8, 11, 1441792, 8, 12, 1441792, 8, 13, 1441792, 8, 14, 1441792, 8, 15, 1441792, 8, 16, 1441792, 8, 17, 1441792, 8, 18, 1441792, 8, 19, 1441792, 8, 20, 1441792, 8, 21, 1441792, 8, 22, 1441792, 8, 23, 1441792, 9, 11, 1441792, 9, 12, 1441792, 9, 13, 1441792, 9, 14, 1441792, 9, 15, 1441792, 9, 16, 1441792, 9, 17, 1441792, 9, 18, 1441792, 9, 19, 1441792, 9, 20, 1441792, 9, 21, 1441792, 9, 22, 1441792, 9, 23, 1441792, 10, 11, 1441792, 10, 12, 1441792, 10, 13, 1441792, 10, 14, 1441792, 10, 15, 1441792, 10, 16, 1441792, 10, 17, 1441792, 10, 18, 1441792, 10, 19, 1441792, 10, 20, 1441792, 10, 21, 1441792, 10, 22, 1441792, 10, 23, 1441792, 11, 11, 1441792, 11, 12, 1441792, 11, 13, 1441792, 11, 14, 1441792, 11, 15, 1441792, 11, 16, 1441792, 11, 17, 1441792, 11, 18, 1441792, 11, 19, 1441792, 11, 20, 1441792, 11, 21, 1441792, 11, 22, 1441792, 11, 23, 1441792, 12, 11, 1441792, 12, 12, 1441792, 12, 13, 1441792, 12, 14, 1441792, 12, 15, 1441792, 12, 16, 1441792, 12, 17, 1441792, 12, 18, 1441792, 12, 19, 1441792, 12, 20, 1441792, 12, 21, 1441792, 12, 22, 1441792, 12, 23, 1441792, 13, 11, 1441792, 13, 12, 1441792, 13, 13, 1441792, 13, 14, 1441792, 13, 15, 1441792, 13, 16, 1441792, 13, 17, 1441792, 13, 18, 1441792, 13, 19, 1441792, 13, 20, 1441792, 13, 21, 1441792, 13, 22, 1441792, 13, 23, 1441792, 14, 11, 1441792, 14, 12, 1441792, 14, 13, 1441792, 14, 14, 1441792, 14, 15, 1441792, 14, 16, 1441792, 14, 17, 1441792, 14, 18, 1441792, 14, 19, 1441792, 14, 20, 1441792, 14, 21, 1441792, 14, 22, 1441792, 14, 23, 1441792, 15, 11, 1441792, 15, 12, 1441792, 15, 13, 1441792, 15, 14, 1441792, 15, 15, 1441792, 15, 16, 1441792, 15, 17, 1441792, 15, 18, 1441792, 15, 19, 1441792, 15, 20, 1441792, 15, 21, 1441792, 15, 22, 1441792, 15, 23, 1441792, 16, 11, 1441792, 16, 12, 1441792, 16, 13, 1441792, 16, 14, 1441792, 16, 15, 1441792, 16, 16, 1441792, 16, 17, 1441792, 16, 18, 1441792, 16, 19, 1441792, 16, 20, 1441792, 16, 21, 1441792, 16, 22, 1441792, 16, 23, 1441792, 17, 11, 1441792, 17, 12, 1441792, 17, 13, 1441792, 17, 14, 1441792, 17, 15, 1441792, 17, 16, 1441792, 17, 17, 1441792, 17, 18, 1441792, 17, 19, 1441792, 17, 20, 1441792, 17, 21, 1441792, 17, 22, 1441792, 17, 23, 1441792, 18, 11, 1441792, 18, 12, 1441792, 18, 13, 1441792, 18, 14, 1441792, 18, 15, 1441792, 18, 16, 1441792, 18, 17, 1441792, 18, 18, 1441792, 18, 19, 1441792, 18, 20, 1441792, 18, 21, 1441792, 18, 22, 1441792, 18, 23, 1441792, 19, 11, 1441792, 19, 12, 1441792, 19, 13, 1441792, 19, 14, 1441792, 19, 15, 1441792, 19, 16, 1441792, 19, 17, 1441792, 19, 18, 1441792, 19, 19, 1441792, 19, 20, 1441792, 19, 21, 1441792, 19, 22, 1441792, 19, 23, 1441792, 20, 11, 1441792, 20, 12, 1441792, 20, 13, 1441792, 20, 14, 1441792, 20, 15, 1441792, 20, 16, 1441792, 20, 17, 1441792, 20, 18, 1441792, 20, 19, 1441792, 20, 20, 1441792, 20, 21, 1441792, 20, 22, 1441792, 20, 23, 1441792, 21, 11, 1441792, 21, 12, 1441792, 21, 13, 1441792, 21, 14, 1441792, 21, 15, 1441792, 21, 16, 1441792, 21, 17, 1441792, 21, 18, 1441792, 21, 19, 1441792, 21, 20, 1441792, 21, 21, 1441792, 21, 22, 1441792, 21, 23, 1441792, 22, 11, 1441792, 22, 12, 1441792, 22, 13, 1441792, 22, 14, 1441792, 22, 15, 1441792, 22, 16, 1441792, 22, 17, 1441792, 22, 18, 1441792, 22, 19, 1441792, 22, 20, 1441792, 22, 21, 1441792, 22, 22, 1441792, 22, 23, 1441792, 23, 11, 1441792, 23, 12, 1441792, 23, 13, 1441792, 23, 14, 1441792, 23, 15, 1441792, 23, 16, 1441792, 23, 17, 1441792, 23, 18, 1441792, 23, 19, 1441792, 23, 20, 1441792, 23, 21, 1441792, 23, 22, 1441792, 23, 23, 1441792, 24, 11, 1441792, 24, 12, 1441792, 24, 13, 1441792, 24, 14, 1441792, 24, 15, 1441792, 24, 16, 1441792, 24, 17, 1441792, 24, 18, 1441792, 24, 19, 1441792, 24, 20, 1441792, 24, 21, 1441792, 24, 22, 1441792, 24, 23, 1441792, 25, 11, 1441792, 25, 12, 1441792, 25, 13, 1441792, 25, 14, 1441792, 25, 15, 1441792, 25, 16, 1441792, 25, 17, 1441792, 25, 18, 1441792, 25, 19, 1441792, 25, 20, 1441792, 25, 21, 1441792, 25, 22, 1441792, 25, 23, 1441792, 26, 11, 1441792, 26, 12, 1441792, 26, 13, 1441792, 26, 14, 1441792, 26, 15, 1441792, 26, 16, 1441792, 26, 17, 1441792, 26, 18, 1441792, 26, 19, 1441792, 26, 20, 1441792, 26, 21, 1441792, 26, 22, 1441792, 26, 23, 1441792, 27, 11, 1441792, 27, 12, 1441792, 27, 13, 1441792, 27, 14, 1441792, 27, 15, 1441792, 27, 16, 1441792, 27, 17, 1441792, 27, 18, 1441792, 27, 19, 1441792, 27, 20, 1441792, 27, 21, 1441792, 27, 22, 1441792, 27, 23, 1441792, 393225, 11, 1441792, 393225, 12, 1441792, 393225, 13, 1441792, 393226, 11, 1441792, 393226, 12, 1441792, 393226, 13, 1441792, 393227, 11, 1441792, 393227, 12, 1441792, 393227, 13, 1441792, 393225, 19, 1441792, 393225, 20, 1441792, 393225, 21, 1441792, 393226, 19, 1441792, 393226, 20, 1441792, 393226, 21, 1441792, 393227, 19, 1441792, 393227, 20, 1441792, 393227, 21, 0, 393226, 14, 1441792, 393226, 15, 1441792, 393226, 16, 1441792, 393226, 17, 1441792, 393226, 18, 1441792, 393224, 2, 655361, 327687, 2, 655361, 262150, 2, 655361, 196613, 2, 655361, 131076, 2, 655361, 65539, 2, 655361, 65540, 2, 524289, 131077, 2, 524289, 196614, 2, 524289, 262151, 2, 524289, 327688, 2, 524289, 196625, 2, 1, 262160, 2, 1, 327695, 2, 1, 393230, 2, 1, 393228, 2, 0, 393229, 2, 0, 196624, 2, 131073, 262159, 2, 131073, 327694, 2, 131073, 393226, 65527, 0, 393225, 65527, 0, 393226, 65526, 0, 393226, 65525, 0, 393226, 65524, 0, 393224, 12, 0, 393228, 12, 0, 393226, 22, 0, 393226, 23, 0, 393228, 20, 0, 393223, 20, 655361, 393223, 12, 655361, 327686, 20, 655361, 262149, 20, 655361, 196612, 20, 655361, 131075, 20, 655361, 65538, 20, 655361, 393229, 20, 1, 327694, 20, 1, 262159, 20, 1, 196624, 20, 1, 131089, 20, 1, 65554, 20, 0, 65553, 20, 131073, 131088, 20, 131073, 196623, 20, 131073, 262158, 20, 131073, 327693, 20, 131073, 327687, 20, 524289, 262150, 20, 524289, 196613, 20, 524289, 131076, 20, 524289, 65539, 20, 524289, 327686, 12, 655361, 262149, 12, 655361, 196612, 12, 655361, 131075, 12, 655361, 65538, 12, 655361, 393229, 12, 1, 327694, 12, 1, 262159, 12, 1, 196624, 12, 1, 131089, 12, 1, 65554, 12, 1, 65539, 12, 524289, 131076, 12, 524289, 196613, 12, 524289, 262150, 12, 524289, 327687, 12, 524289, 327693, 12, 131073, 262158, 12, 131073, 196623, 12, 131073, 131088, 12, 131073, 65553, 12, 131073, 65542, 15, 0, 65542, 16, 0, 65541, 16, 0, 65541, 17, 0, 65540, 17, 1441793, 65539, 17, 0, 65538, 16, 0, 65539, 16, 0, 65540, 16, 0, 65551, 21, 0, 65552, 21, 0, 65552, 22, 0, 65553, 22, 0, 65553, 21, 0, 65554, 21, 0, 65555, 21, 1441793, 65554, 19, 0, 65555, 19, 0, 65555, 18, 0, 65556, 18, 0, 65556, 17, 0, 65557, 17, 0, 65557, 18, 0, 65557, 19, 0, 65556, 19, 0, 65556, 20, 0, 65555, 20, 0, 131093, 17, 0, 131092, 17, 0, 131091, 17, 0, 131092, 18, 0, 131093, 18, 0, 131094, 18, 0, 131094, 17, 0, 131094, 16, 0, 131094, 15, 0, 131094, 14, 0, 131095, 14, 0, 131095, 13, 0, 131096, 13, 0, 131096, 12, 0, 131097, 12, 0, 131097, 13, 0, 131097, 14, 0, 131096, 14, 0, 131096, 15, 0, 131095, 15, 0, 131095, 16, 0, 131096, 16, 0, 131096, 17, 0, 131097, 17, 0, 131097, 16, 0, 131098, 16, 0, 131098, 15, 0, 131097, 15, 0, 65563, 13, 0, 65562, 13, 0, 65562, 12, 0, 65562, 11, 0, 65561, 11, 0, 65560, 11, 655361, 65560, 12, 0, 65561, 12, 0, 65562, 10, 0, 65561, 10, 0, 65560, 10, 0, 65561, 9, 0, 65562, 9, 0, 65543, 16, 0, 65544, 16, 0, 65545, 16, 0, 65546, 16, 0, 65547, 16, 0, 65547, 17, 0, 65546, 17, 0, 65548, 17, 0, 65549, 17, 0, 65549, 16, 0, 65550, 16, 0, 65551, 16, 0, 65551, 15, 0, 65552, 15, 1048577, 65552, 16, 0, 65548, 16, 0, 65553, 15, 0, 65554, 15, 0, 65553, 16, 0, 65554, 22, 1, 131092, 19, 1441793, 131093, 19, 1441793, 131091, 18, 1441793, 131098, 13, 1, 131098, 12, 1, 65550, 17, 1441793, 65551, 17, 1441793, 65552, 17, 1441793, 65553, 17, 1441793, 65549, 18, 1441793, 65548, 18, 1441793, 65547, 18, 1441793, 65546, 18, 1441793, 65554, 16, 1441793, 65554, 14, 1048577, 65553, 14, 1048577, 65551, 14, 1048577, 65541, 15, 1048577, 65540, 15, 1048577, 65539, 15, 1048577, 65538, 15, 1048577, 65542, 14, 1048577, 65543, 15, 1048577, 65544, 15, 1048577, 65545, 15, 1048577, 65555, 7, 1441793, 65548, 65529, 131072, 65549, 65529, 1, 65550, 65529, 655361, 65551, 65529, 655361, 65552, 65529, 655360, 131088, 65529, 1, 131084, 65529, 1, 65553, 65529, 1, 65546, 11, 1441793, 393224, 20, 0, 393227, 65527, 0, 65527, 65525, 0, 65527, 65526, 0, 65527, 65527, 0, 65527, 65528, 0, 65527, 65529, 0, 65527, 65530, 0, 65527, 65531, 0, 65527, 65532, 0, 65527, 65533, 0, 65527, 65534, 0, 65527, 65535, 0, 65527, 0, 0, 65527, 1, 0, 65527, 2, 0, 65527, 3, 0, 65527, 4, 0, 65527, 5, 0, 65527, 6, 0, 65527, 7, 0, 65527, 8, 0, 65527, 9, 0, 65527, 10, 0, 65527, 11, 0, 65527, 12, 0, 65527, 13, 0, 65527, 14, 0, 65527, 15, 0, 65527, 16, 0, 65527, 17, 0, 65527, 18, 0, 65527, 19, 0, 65527, 20, 0, 65527, 21, 0, 65527, 22, 0, 65527, 23, 0, 65528, 65525, 0, 65528, 65526, 0, 65528, 65527, 0, 65528, 65528, 0, 65528, 65529, 0, 65528, 65530, 0, 65528, 65531, 0, 65528, 65532, 0, 65528, 65533, 0, 65528, 65534, 0, 65528, 65535, 0, 65528, 0, 0, 65528, 1, 0, 65528, 2, 0, 65528, 3, 0, 65528, 4, 0, 65528, 5, 0, 65528, 6, 0, 65528, 7, 0, 65528, 8, 0, 65528, 9, 0, 65528, 10, 0, 65528, 11, 0, 65528, 12, 0, 65528, 13, 0, 65528, 14, 0, 65528, 15, 0, 65528, 16, 0, 65528, 17, 0, 65528, 18, 0, 65528, 19, 0, 65528, 20, 0, 65528, 21, 0, 65528, 22, 0, 65528, 23, 0, 65529, 65525, 0, 65529, 65526, 0, 65529, 65527, 0, 65529, 65528, 0, 65529, 65529, 0, 65529, 65530, 0, 65529, 65531, 0, 65529, 65532, 0, 65529, 65533, 0, 65529, 65534, 0, 65529, 65535, 0, 65529, 0, 0, 65529, 1, 0, 65529, 2, 0, 65529, 3, 0, 65529, 4, 0, 65529, 5, 0, 65529, 6, 0, 65529, 7, 0, 65529, 8, 0, 65529, 9, 0, 65529, 10, 0, 65529, 11, 0, 65529, 12, 0, 65529, 13, 0, 65529, 14, 0, 65529, 15, 0, 65529, 16, 0, 65529, 17, 0, 65529, 18, 0, 65529, 19, 0, 65529, 20, 0, 65529, 21, 0, 65529, 22, 0, 65529, 23, 0, 65530, 65525, 0, 65530, 65526, 0, 65530, 65527, 0, 65530, 65528, 0, 65530, 65529, 0, 65530, 65530, 0, 65530, 65531, 0, 65530, 65532, 0, 65530, 65533, 0, 65530, 65534, 0, 65530, 65535, 0, 65530, 0, 0, 65530, 1, 0, 65530, 2, 0, 65530, 3, 0, 65530, 4, 0, 65530, 5, 0, 65530, 6, 0, 65530, 7, 0, 65530, 8, 0, 65530, 9, 0, 65530, 10, 0, 65530, 11, 0, 65530, 12, 0, 65530, 13, 0, 65530, 14, 0, 65530, 15, 0, 65530, 16, 0, 65530, 17, 0, 65530, 18, 0, 65530, 19, 0, 65530, 20, 0, 65530, 21, 0, 65530, 22, 0, 65530, 23, 0, 65531, 65525, 0, 65531, 65526, 0, 65531, 65527, 0, 65531, 65528, 0, 65531, 65529, 0, 65531, 65530, 0, 65531, 65531, 0, 65531, 65532, 0, 65531, 65533, 0, 65531, 65534, 0, 65531, 65535, 0, 65531, 0, 0, 65531, 1, 0, 65531, 2, 0, 65531, 3, 0, 65531, 4, 0, 65531, 5, 0, 65531, 6, 0, 65531, 7, 0, 65531, 8, 0, 65531, 9, 0, 65531, 10, 0, 65531, 11, 0, 65531, 12, 0, 65531, 13, 0, 65531, 14, 0, 65531, 15, 0, 65531, 16, 0, 65531, 17, 0, 65531, 18, 0, 65531, 19, 0, 65531, 20, 0, 65531, 21, 0, 65531, 22, 0, 65531, 23, 0, 65532, 65525, 0, 65532, 65526, 0, 65532, 65527, 0, 65532, 65528, 0, 65532, 65529, 0, 65532, 65530, 0, 65532, 65531, 0, 65532, 65532, 0, 65532, 65533, 0, 65532, 65534, 0, 65532, 65535, 0, 65532, 0, 0, 65532, 1, 0, 65532, 2, 0, 65532, 3, 0, 65532, 4, 0, 65532, 5, 0, 65532, 6, 0, 65532, 7, 0, 65532, 8, 0, 65532, 9, 0, 65532, 10, 0, 65532, 11, 0, 65532, 12, 0, 65532, 13, 0, 65532, 14, 0, 65532, 15, 0, 65532, 16, 0, 65532, 17, 0, 65532, 18, 0, 65532, 19, 0, 65532, 20, 0, 65532, 21, 0, 65532, 22, 0, 65532, 23, 0, 65533, 65525, 0, 65533, 65526, 0, 65533, 65527, 0, 65533, 65528, 0, 65533, 65529, 0, 65533, 65530, 0, 65533, 65531, 0, 65533, 65532, 0, 65533, 65533, 0, 65533, 65534, 0, 65533, 65535, 0, 65533, 0, 0, 65533, 1, 0, 65533, 2, 0, 65533, 3, 0, 65533, 4, 0, 65533, 5, 0, 65533, 6, 0, 65533, 7, 0, 65533, 8, 0, 65533, 9, 0, 65533, 10, 0, 65533, 11, 0, 65533, 12, 0, 65533, 13, 0, 65533, 14, 0, 65533, 15, 0, 65533, 16, 0, 65533, 17, 0, 65533, 18, 0, 65533, 19, 0, 65533, 20, 0, 65533, 21, 0, 65533, 22, 0, 65533, 23, 0, 65534, 65525, 0, 65534, 65526, 0, 65534, 65527, 0, 65534, 65528, 0, 65534, 65529, 0, 65534, 65530, 0, 65534, 65531, 0, 65534, 65532, 0, 65534, 65533, 0, 65534, 65534, 0, 65534, 65535, 0, 65534, 0, 0, 65534, 1, 0, 65534, 2, 0, 65534, 3, 0, 65534, 4, 0, 65534, 5, 0, 65534, 6, 0, 65534, 7, 0, 65534, 8, 0, 65534, 9, 0, 65534, 10, 0, 65534, 11, 0, 65534, 12, 0, 65534, 13, 0, 65534, 14, 0, 65534, 15, 0, 65534, 16, 0, 65534, 17, 0, 65534, 18, 0, 65534, 19, 0, 65534, 20, 0, 65534, 21, 0, 65534, 22, 0, 65534, 23, 0, 65535, 65525, 0, 65535, 65526, 0, 65535, 65527, 0, 65535, 65528, 0, 65535, 65529, 0, 65535, 65530, 0, 65535, 65531, 0, 65535, 65532, 0, 65535, 65533, 0, 65535, 65534, 0, 65535, 65535, 0, 65535, 0, 0, 65535, 1, 0, 65535, 2, 0, 65535, 3, 0, 65535, 4, 0, 65535, 5, 0, 65535, 6, 0, 65535, 7, 0, 65535, 8, 0, 65535, 9, 0, 65535, 10, 0, 65535, 11, 0, 65535, 12, 0, 65535, 13, 0, 65535, 14, 0, 65535, 15, 0, 65535, 16, 0, 65535, 17, 0, 65535, 18, 0, 65535, 19, 0, 65535, 20, 0, 65535, 21, 0, 65535, 22, 0, 65535, 23, 0, 131068, 65525, 0, 131067, 65525, 0, 131067, 65526, 0, 131066, 65526, 0, 131066, 65527, 0, 131065, 65527, 0, 131065, 65528, 0, 131065, 65529, 0, 131064, 65529, 0, 131064, 65530, 0, 131064, 65531, 0, 131064, 65532, 0, 131064, 65533, 0, 131064, 65534, 0, 131064, 65535, 0, 131064, 0, 0, 131064, 1, 0, 131064, 2, 0, 131064, 3, 0, 131064, 4, 0, 131065, 4, 0, 131065, 5, 0, 131065, 6, 0, 131065, 7, 0, 131065, 8, 0, 131065, 9, 0, 131066, 9, 0, 131066, 10, 0, 131066, 11, 0, 131066, 12, 0, 131066, 13, 0, 131066, 14, 0, 131066, 15, 0, 131066, 16, 0, 131066, 17, 0, 131066, 18, 0, 131066, 19, 0, 131065, 19, 0, 131065, 20, 0, 131064, 20, 0, 131064, 21, 0, 131063, 21, 0, 131063, 22, 0, 131062, 22, 0, 131062, 23, 0, 131066, 65525, 0, 131065, 65526, 0, 131064, 65526, 0, 131064, 65527, 0, 131064, 65528, 0, 131063, 65528, 0, 131063, 65529, 0, 131063, 65530, 0, 131063, 65531, 0, 131063, 65532, 0, 131063, 65533, 0, 131063, 65534, 0, 131063, 65535, 0, 131063, 0, 0, 131063, 1, 0, 131063, 2, 0, 131063, 3, 0, 131063, 4, 0, 131063, 5, 0, 131063, 6, 0, 131063, 7, 0, 131063, 8, 0, 131064, 8, 0, 131064, 9, 0, 131064, 10, 0, 131064, 11, 0, 131064, 7, 0, 131064, 6, 0, 131064, 5, 0, 131064, 12, 0, 131064, 13, 0, 131065, 13, 0, 131065, 11, 0, 131065, 12, 0, 131065, 10, 0, 131063, 10, 0, 131063, 9, 0, 131063, 11, 0, 131063, 12, 0, 131063, 13, 0, 131063, 14, 0, 131064, 14, 0, 131064, 15, 0, 131065, 15, 0, 131065, 16, 0, 131065, 17, 0, 131064, 17, 0, 131064, 16, 0, 131063, 16, 0, 131063, 15, 0, 131065, 18, 0, 131064, 18, 0, 131064, 19, 0, 131063, 18, 0, 131063, 17, 0, 131063, 19, 0, 131063, 20, 0, 131063, 24, 0, 131063, 23, 0, 131064, 23, 0, 131064, 22, 0, 131065, 22, 0, 131065, 21, 0, 131066, 21, 0, 131066, 20, 0, 131067, 20, 0, 131067, 19, 0, 131068, 19, 0, 131068, 18, 0, 131068, 17, 0, 131068, 16, 0, 131068, 15, 0, 131067, 14, 0, 131067, 13, 0, 131067, 12, 0, 131067, 11, 0, 131067, 10, 0, 131066, 8, 0, 131066, 7, 0, 131066, 6, 0, 131066, 5, 0, 131066, 4, 0, 131066, 3, 0, 131065, 3, 0, 131065, 2, 0, 131065, 1, 0, 131065, 0, 0, 131065, 65535, 0, 131065, 65534, 0, 131065, 65533, 0, 131066, 65533, 0, 131066, 65532, 0, 131066, 65531, 0, 131066, 65530, 0, 131066, 65529, 0, 131066, 65528, 0, 131067, 65528, 0, 131067, 65527, 0, 131068, 65526, 0, 131068, 65527, 0, 131067, 65529, 0, 131065, 65531, 0, 131065, 65532, 0, 131066, 65535, 0, 131066, 1, 0, 131067, 8, 0, 131067, 9, 0, 131067, 15, 0, 131067, 16, 0, 131067, 17, 0, 131065, 14, 0, 131067, 18, 0, 131067, 7, 0, 131067, 6, 0, 131066, 2, 0, 131066, 0, 0, 131066, 65534, 0, 131065, 65530, 0, 196599, 23, 0, 196599, 22, 0, 196599, 21, 0, 196600, 21, 0, 196600, 20, 0, 196600, 19, 0, 196600, 18, 0, 196601, 18, 0, 196601, 17, 0, 196601, 16, 0, 196601, 15, 0, 196601, 14, 0, 196601, 13, 0, 196601, 12, 0, 196601, 11, 0, 196601, 10, 0, 196601, 9, 0, 196600, 9, 0, 196600, 8, 0, 196600, 7, 0, 196600, 6, 0, 196600, 5, 0, 196600, 4, 0, 196600, 3, 0, 196600, 2, 0, 196600, 1, 0, 196600, 0, 0, 196599, 65535, 0, 196599, 65534, 0, 196599, 65533, 0, 196599, 65532, 0, 196599, 65531, 0, 196600, 65531, 0, 196600, 65530, 0, 196600, 65529, 0, 196600, 65528, 0, 196600, 65527, 0, 196600, 65526, 0, 196599, 65527, 0, 196599, 65528, 0, 196599, 65529, 0, 196599, 65530, 0, 196599, 0, 0, 196599, 1, 0, 196599, 2, 0, 196599, 3, 0, 196599, 4, 0, 196599, 5, 0, 196599, 6, 0, 196599, 7, 0, 196599, 8, 0, 196600, 10, 0, 196600, 11, 0, 196600, 12, 0, 196600, 13, 0, 196600, 14, 0, 196600, 15, 0, 196600, 16, 0, 196600, 17, 0, 196599, 19, 0, 196599, 20, 0, 196599, 18, 0, 196599, 17, 0, 196599, 16, 0, 196599, 15, 0, 196599, 12, 0, 196599, 11, 0, 196599, 10, 0, 196599, 13, 0, 196599, 14, 0, 196599, 9, 0, 196600, 65525, 0, 196599, 65525, 0, 196599, 65526, 0, 196601, 65525, 0, 262135, 65526, 0, 262135, 65527, 0, 262135, 65528, 0, 131069, 19, 1, 131069, 18, 1, 131069, 17, 1, 131069, 16, 1, 131069, 15, 1, 131068, 14, 655362, 131068, 13, 1, 131068, 12, 1, 131068, 11, 1, 131068, 10, 1, 131068, 9, 1, 131068, 8, 1, 131068, 7, 1, 131068, 6, 1, 131067, 5, 655362, 131067, 4, 1, 131067, 3, 1, 131067, 2, 1, 131067, 1, 1, 131067, 0, 1, 131067, 65535, 1, 131067, 65534, 1, 131067, 65533, 1, 131067, 65532, 1, 131067, 65531, 1, 131067, 65530, 1048578, 131068, 65529, 1, 131068, 65528, 1048578, 131069, 65527, 1, 131069, 65526, 1, 131069, 65525, 1, 131068, 20, 1048578, 131067, 21, 1048578, 131066, 22, 1048578, 131065, 23, 1048578, 131069, 20, 655363, 131068, 21, 655363, 131067, 22, 655363, 131066, 23, 655363, 131069, 14, 1441795, 131068, 5, 1441795, 131068, 65530, 655363, 131069, 65528, 655363, 196602, 65526, 655363, 196601, 65532, 655363, 196601, 65535, 1441795, 196602, 8, 1441795, 196602, 19, 655363, 196601, 22, 655363, 196601, 19, 1048578, 196600, 22, 1048578, 196601, 8, 655362, 196602, 18, 1, 196601, 21, 1, 196601, 20, 1, 196600, 23, 1, 196602, 17, 1, 196602, 16, 1, 196602, 15, 1, 196602, 14, 1, 196602, 13, 1, 196602, 12, 1, 196602, 11, 1, 196602, 10, 1, 196602, 9, 1, 196601, 7, 1, 196601, 6, 1, 196601, 5, 1, 196601, 4, 1, 196601, 3, 1, 196601, 2, 1, 196601, 1, 1, 196601, 0, 1, 196600, 65534, 1, 196600, 65533, 1, 196600, 65535, 655362, 196600, 65532, 1048578, 196601, 65531, 1, 196601, 65530, 1, 196601, 65529, 1, 196601, 65528, 1, 196601, 65527, 1, 196601, 65526, 1048578, 196602, 65525, 1, 262136, 65528, 1, 262136, 65527, 1, 262136, 65526, 1, 262136, 65529, 655363, 262136, 65525, 1441795, 262135, 65525, 1048577, 262135, 65529, 1441793, 131070, 1, 655361, 131070, 2, 655361, 131070, 3, 655361, 131070, 4, 655361, 131071, 6, 655361, 131070, 8, 655361, 131070, 9, 1048579, 131071, 10, 1048579, 131071, 9, 2, 131071, 5, 2, 131071, 7, 1441794, 131070, 5, 1048579, 131070, 7, 3, 131071, 8, 0, 131071, 4, 0, 131071, 3, 0, 131071, 2, 0, 131071, 1, 0, 131071, 0, 1048577, 131070, 0, 3) } script = ExtResource("1_noarx") metadata/_custom_type_script = "uid://b61ea0hhhekmp" -metadata/_editor_floor_ = Vector3(0, 6, 0) +metadata/_editor_floor_ = Vector3(0, 1, 0) [node name="Buildings" type="Node3D" parent="."] script = ExtResource("4_tcnuu") @@ -523,6 +525,15 @@ vertical_icon_alignment = 0 script = ExtResource("17_tuemg") place_scene = ExtResource("6_i5arm") +[node name="Button5" type="Button" parent="UI/VBoxContainer"] +layout_mode = 2 +text = "Storage" +icon = ExtResource("19_5t8nk") +icon_alignment = 1 +vertical_icon_alignment = 0 +script = ExtResource("17_tuemg") +place_scene = ExtResource("20_j3e5s") + [node name="Button4" type="Button" parent="UI/VBoxContainer"] layout_mode = 2 text = "Conveyor" @@ -545,7 +556,11 @@ instance_shader_parameters/build_progress = 0.76 instance_shader_parameters/damage = 0.69 mesh = SubResource("SphereMesh_dhlwf") +[node name="Miner" parent="." instance=ExtResource("9_4arys")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 25, 1, 21) + [connection signal="place_requested" from="UI/VBoxContainer/Button" to="Buildings" method="start_placement"] [connection signal="place_requested" from="UI/VBoxContainer/Button2" to="Buildings" method="start_placement"] [connection signal="place_requested" from="UI/VBoxContainer/Button3" to="Buildings" method="start_placement"] +[connection signal="place_requested" from="UI/VBoxContainer/Button5" to="Buildings" method="start_placement"] [connection signal="place_requested" from="UI/VBoxContainer/Button4" to="Buildings" method="start_placement"] diff --git a/objects/buildings/building.tscn b/objects/buildings/building.tscn index c87ac55..f4e28f9 100644 --- a/objects/buildings/building.tscn +++ b/objects/buildings/building.tscn @@ -34,6 +34,7 @@ ExtResource("3_w18nb"): 5 [node name="MeshInstance3D" type="MeshInstance3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0) +layers = 2 mesh = SubResource("BoxMesh_cee1v") [node name="CollisionShape3D" type="CollisionShape3D" parent="."] diff --git a/objects/buildings/storage.tscn b/objects/buildings/storage.tscn index 541ae62..df4ff73 100644 --- a/objects/buildings/storage.tscn +++ b/objects/buildings/storage.tscn @@ -12,7 +12,7 @@ albedo_color = Color(0, 1, 0.979857, 1) material = SubResource("StandardMaterial3D_nr174") size = Vector3(2, 2, 2) -[node name="Building" instance=ExtResource("1_7qwib")] +[node name="Storage" instance=ExtResource("1_7qwib")] script = ExtResource("2_evbsr") [node name="MeshInstance3D" parent="." index="0"] diff --git a/objects/buildings/turret.tscn b/objects/buildings/turret.tscn index 9db6f7b..ecdbd45 100644 --- a/objects/buildings/turret.tscn +++ b/objects/buildings/turret.tscn @@ -1,9 +1,10 @@ -[gd_scene load_steps=9 format=3 uid="uid://cw3vtaevqx20y"] +[gd_scene load_steps=10 format=3 uid="uid://cw3vtaevqx20y"] [ext_resource type="PackedScene" uid="uid://b1fnsl3k1mo5c" path="res://objects/buildings/building.tscn" id="1_cgb0l"] [ext_resource type="Script" uid="uid://bl78fqp1abxd6" path="res://scripts/buildings/turret.gd" id="2_brx0q"] [ext_resource type="Script" uid="uid://bshiyw2k3op02" path="res://scripts/building_components/consumer.gd" id="2_wh3b5"] [ext_resource type="PackedScene" uid="uid://cav22qho14o47" path="res://objects/bullet.tscn" id="3_kpsgq"] +[ext_resource type="Script" uid="uid://b3jshlhs24s8d" path="res://scripts/building_components/detector.gd" id="5_vuktq"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_cgb0l"] albedo_color = Color(0, 0.00397563, 1, 1) @@ -34,7 +35,9 @@ fire_cooldown_time = 0.2 reload_time = 1.0 bullet_scene = ExtResource("3_kpsgq") fire_position = Vector3(0, 2.1, 0) +bullets_at_once = 1 shot_velocity = 50.0 +deviation = Vector2(1, 1) lead_shots = true compensate_for_gravity = true use_artillery_firing_solution = false @@ -50,8 +53,12 @@ mesh = SubResource("CylinderMesh_kpsgq") transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 1) mesh = SubResource("CylinderMesh_vuktq") -[node name="Consumer" type="Node" parent="." index="5"] +[node name="Consumer" type="Node" parent="." index="6"] script = ExtResource("2_wh3b5") metadata/_custom_type_script = "uid://bshiyw2k3op02" +[node name="Detector" type="Node3D" parent="." index="7"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.31252, 0) +script = ExtResource("5_vuktq") + [connection signal="item_added" from="Consumer" to="." method="_on_consumer_item_added"] diff --git a/objects/units/citizen.tscn b/objects/units/citizen.tscn index de19840..1ef09d1 100644 --- a/objects/units/citizen.tscn +++ b/objects/units/citizen.tscn @@ -1,10 +1,11 @@ -[gd_scene load_steps=8 format=3 uid="uid://skxli3htgn7"] +[gd_scene load_steps=9 format=3 uid="uid://skxli3htgn7"] [ext_resource type="PackedScene" uid="uid://1gcj3gixy6hs" path="res://objects/units/unit.tscn" id="1_6046h"] -[ext_resource type="Script" uid="uid://b7xficxq807qd" path="res://objects/units/citizen.gd" id="2_dv62s"] +[ext_resource type="Script" uid="uid://b7xficxq807qd" path="res://scripts/units/citizen.gd" id="2_dv62s"] [ext_resource type="Texture2D" uid="uid://brjswv5ryy8om" path="res://assets/images/lilguy.png" id="3_pedvu"] [ext_resource type="Texture2D" uid="uid://cpov32m0nxjvh" path="res://assets/images/lilguy_arms.png" id="4_i1unn"] [ext_resource type="ArrayMesh" uid="uid://c6yj8uwsgqxv0" path="res://assets/models/Ingot.obj" id="5_dv62s"] +[ext_resource type="Script" uid="uid://b3jshlhs24s8d" path="res://scripts/building_components/detector.gd" id="6_pedvu"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_vpcy6"] albedo_texture = ExtResource("3_pedvu") @@ -32,6 +33,7 @@ text = "HP: 100" [node name="Body" type="Sprite3D" parent="." index="5"] transform = Transform3D(3, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0) +layers = 4 billboard = 2 shaded = true alpha_cut = 1 @@ -41,6 +43,7 @@ hframes = 2 [node name="Hands" type="Sprite3D" parent="Body" index="0"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.0522564) +layers = 4 billboard = 2 shaded = true alpha_cut = 1 @@ -52,3 +55,9 @@ transform = Transform3D(0.17, 0, 0, 0, 0.17, 0, 0, 0, 0.17, 5.96046e-08, -0.0189 visible = false mesh = ExtResource("5_dv62s") skeleton = NodePath("../../..") + +[node name="Detector" type="Node3D" parent="." index="6"] +script = ExtResource("6_pedvu") +detection_range = 50.0 +scan_period = 0.5 +metadata/_custom_type_script = "uid://b3jshlhs24s8d" diff --git a/objects/units/enemy.tscn b/objects/units/enemy.tscn index f4a87b2..8135ba5 100644 --- a/objects/units/enemy.tscn +++ b/objects/units/enemy.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=3 uid="uid://q80xjurpsmjb"] [ext_resource type="PackedScene" uid="uid://1gcj3gixy6hs" path="res://objects/units/unit.tscn" id="1_8hi5e"] -[ext_resource type="Script" uid="uid://cl0k7xolx5rf2" path="res://scripts/enemy.gd" id="2_14ipn"] +[ext_resource type="Script" uid="uid://cl0k7xolx5rf2" path="res://scripts/units/enemy.gd" id="2_14ipn"] [node name="Enemy" groups=["Enemies"] instance=ExtResource("1_8hi5e")] collision_layer = 4 diff --git a/objects/units/unit.tscn b/objects/units/unit.tscn index 9800cba..a2368ed 100644 --- a/objects/units/unit.tscn +++ b/objects/units/unit.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=7 format=3 uid="uid://1gcj3gixy6hs"] -[ext_resource type="Script" uid="uid://f0j7u0so2ug5" path="res://scripts/unit.gd" id="1_dberb"] +[ext_resource type="Script" uid="uid://f0j7u0so2ug5" path="res://scripts/units/unit.gd" id="1_dberb"] [ext_resource type="Texture2D" uid="uid://3javrn230ddq" path="res://assets/images/enemy.png" id="2_2pk7s"] [sub_resource type="PhysicsMaterial" id="PhysicsMaterial_a0tk4"] @@ -43,6 +43,7 @@ debug_path_custom_color = Color(1, 0, 0.0808306, 1) shape = SubResource("SphereShape3D_a202f") [node name="MeshInstance3D" type="MeshInstance3D" parent="."] +layers = 4 mesh = SubResource("QuadMesh_i5arm") [node name="ShapeCast3D" type="ShapeCast3D" parent="."] diff --git a/project.godot b/project.godot index de860f1..002394c 100644 --- a/project.godot +++ b/project.godot @@ -28,11 +28,11 @@ run/main_scene="uid://bwftban1ppo17" config/features=PackedStringArray("4.4") config/icon="uid://u1hpdb62rxlc" addons/icon_finder/preview_size=25 -config/git_describe="78bfcde" [autoload] IconsFonts="*res://addons/icons-fonts/icons_fonts/IconsFonts.gd" +TowerUtil="*res://scripts/util.gd" [debug] @@ -146,6 +146,7 @@ building_cancel={ 3d_navigation/layer_3="Citizens" 3d_physics/layer_4="Citizens" 3d_physics/layer_5="Projectiles" +3d_physics/layer_32="Mouse Selectable" [navigation] diff --git a/scripts/building_components/building.gd b/scripts/building_components/building.gd index 97168fd..bf11344 100644 --- a/scripts/building_components/building.gd +++ b/scripts/building_components/building.gd @@ -23,6 +23,9 @@ class_name Building @onready var consumer: Consumer = $Consumer @onready var producer: Producer = $Producer @onready var collision_shape: CollisionShape3D = $CollisionShape3D +@onready var detector: Detector = $Detector + +var initial_collision_layer: int = 1 << 1 # layer 2: buildings signal functional_changed(functional: bool) @@ -77,7 +80,9 @@ func _ready() -> void: if producer != null: functional_changed.connect(func(enable:bool): producer.enabled = enable) if collision_shape != null: - functional_changed.connect(func(enable:bool): collision_shape.disabled = !enable) + functional_changed.connect(set_collision_enabled) + if detector != null: + functional_changed.connect(func(enable:bool): detector.enabled = enable) func _process(delta: float) -> void: if build_state == BuildState.UNPLACED: @@ -177,3 +182,12 @@ func set_visual_build_progress(ratio: float) -> void: geometry.set_instance_shader_parameter("built_amount", built_amount) #var opacity: float = 0.5 + (ratio * 0.5) #geometry.transparency = 1.0 - opacity + +func set_collision_enabled(enabled: bool) -> void: + if collision_shape == null: + return + if !enabled: + initial_collision_layer = collision_shape.get_parent().collision_layer + collision_shape.get_parent().collision_layer = 1 << 31 + else: + collision_shape.get_parent().collision_layer = initial_collision_layer diff --git a/scripts/building_components/detector.gd b/scripts/building_components/detector.gd new file mode 100644 index 0000000..5ca0ce7 --- /dev/null +++ b/scripts/building_components/detector.gd @@ -0,0 +1,43 @@ +extends Node3D +class_name Detector + +@export var enabled: bool = true +@export var detection_range: float = 200.0 +@export var requires_los: bool = true +@export_flags_3d_physics var los_physics_layers: int = 0b001 +@export var detected_group_name: StringName = "Enemies" +@export var scan_period: float = 0.1 +@export var debug_draw: bool = true + +var scan_timer: float = 0.0 + +func _process(delta: float) -> void: + if enabled: + scan_timer += delta + if scan_timer >= scan_period: + scan_timer -= scan_period + scan() + +func scan() -> void: + for node in get_tree().get_nodes_in_group(detected_group_name): + var enemy: Enemy = node as Enemy + if enemy != null and !enemy.sighted and can_see(enemy): + enemy.sighted = true + +func can_see(enemy: Enemy) -> bool: + var distance: float = enemy.global_position.distance_to(global_position) + if distance >= detection_range: + return false + if requires_los: + var params: PhysicsRayQueryParameters3D = PhysicsRayQueryParameters3D.create(global_position, enemy.global_position) + params.collision_mask = los_physics_layers + var result: Dictionary = get_world_3d().direct_space_state.intersect_ray(params) + if debug_draw: + TowerUtil.draw_raycast_hit(params, result, 1.0) + #DebugDraw3D.draw_line_hit(global_position, enemy.global_position, result[''] is_hit) + if result.has("collider"): + if result.get("collider") == enemy: + return true + return false # something's in the way + return true + diff --git a/scripts/building_components/detector.gd.uid b/scripts/building_components/detector.gd.uid new file mode 100644 index 0000000..a4558dd --- /dev/null +++ b/scripts/building_components/detector.gd.uid @@ -0,0 +1 @@ +uid://b3jshlhs24s8d diff --git a/scripts/building_manager.gd b/scripts/building_manager.gd index 6d6dc92..c3b71d0 100644 --- a/scripts/building_manager.gd +++ b/scripts/building_manager.gd @@ -31,6 +31,7 @@ func placement_mouse_input(screen_position: Vector2, confirmed: bool) -> void: var ray_origin: Vector3 = camera.project_ray_origin(screen_position) var ray_normal: Vector3 = ray_origin + camera.project_ray_normal(screen_position) * 200 var params: PhysicsRayQueryParameters3D = PhysicsRayQueryParameters3D.create(ray_origin, ray_normal) + params.collision_mask = (1 << 31) | (1 << 1) | (1) # selectables, buildings, terrain if placing_building.collision_shape != null: params.exclude = [placing_building.get_rid()] var result: Dictionary = get_world_3d().direct_space_state.intersect_ray(params) diff --git a/scripts/buildings/storage.gd b/scripts/buildings/storage.gd index 3a00f0b..2483db0 100644 --- a/scripts/buildings/storage.gd +++ b/scripts/buildings/storage.gd @@ -3,8 +3,10 @@ extends Building var held_item: Item = null func _process(delta: float) -> void: - if !producer.consumers.is_empty(): - held_item = consumer.take_any_item_from_storage() - + super(delta) + if is_functional(): + if !producer.consumers.is_empty() and held_item == null: + held_item = consumer.take_any_item_from_storage() + if held_item != null and producer.send_item(held_item): held_item = null diff --git a/scripts/buildings/turret.gd b/scripts/buildings/turret.gd index a881f5f..90b499a 100644 --- a/scripts/buildings/turret.gd +++ b/scripts/buildings/turret.gd @@ -9,13 +9,16 @@ class_name Turret @export_group("Bullet Spawning") @export var bullet_scene: PackedScene = preload("res://objects/bullet.tscn") ## The entity to spawn as a bullet. @export var fire_position: Vector3 = Vector3(0,1,0) ## The local position to fire from. +@export var bullets_at_once: int = 5 @export_group("Ballistics") @export var shot_velocity: float = 100 ## The velocity that bullets are fired at, in m/s. +@export var deviation: Vector2 = Vector2(1.0, 1.0) @export var lead_shots: bool = true ## Turn on to make the turret aim ahead of moving targets. @export var compensate_for_gravity: bool = true ## Turn on to make the turret aim above distant targets to arc it's shots. @export var use_artillery_firing_solution: bool = false ## If compensating for gravity, turn this on to make the turret aim high instead of low. + enum LoadState {UNLOADED, RELOADING, LOADED} @onready var ammo: int = 0 @@ -42,16 +45,15 @@ func _process(delta: float) -> void: cooldown_timer += delta if cooldown_timer >= fire_cooldown_time: cooldown_timer -= fire_cooldown_time + if current_target != null and !is_valid_target(current_target): + current_target = null if current_target == null: - search_for_enemy() + find_target() if current_target != null: - fire_at_target() - -func check_target_status() -> void: - if current_target.is_queued_for_deletion(): - current_target = null + for i in range(bullets_at_once): + fire_at_target() -func search_for_enemy() -> void: +func find_target() -> void: var enemies: Array[Node] = get_tree().get_nodes_in_group("Enemies") var closest: float = 9999999999 for enemy: Enemy in enemies: @@ -59,57 +61,64 @@ func search_for_enemy() -> void: continue var distance_sqr = global_position.distance_squared_to(enemy.global_position) if distance_sqr <= closest: - var params: PhysicsRayQueryParameters3D = PhysicsRayQueryParameters3D.new() - params.collision_mask = 0b00101 - params.from = to_global(fire_position) - params.to = enemy.global_position - var result: Dictionary = get_world_3d().direct_space_state.intersect_ray(params) - #DebugDraw3D.draw_line_hit(params.from, params.to, result["position"] if result.has("position") else Vector3(), result.has("position"), 0.25, Color.YELLOW, Color.BLACK, 1.0) - if result.has("collider"): - if !result["collider"] is PhysicsBody3D: - continue - var body: PhysicsBody3D = result["collider"] - if body is Enemy: - current_target = body - closest = body.global_position.distance_squared_to(global_position) + if is_valid_target(enemy): + current_target = enemy + closest = distance_sqr + +func is_valid_target(enemy: Enemy) -> bool: + if enemy == null: + return false + if enemy.is_queued_for_deletion(): + return false + return detector.can_see(enemy) func fire_at_target() -> void: #Engine.time_scale = 0.1 + if ammo <= 0 or current_target == null: + return var bullet: RigidBody3D = bullet_scene.instantiate() + bullet.target = current_target add_child(bullet) var bullet_pos: Vector3 = to_global(fire_position) bullet.global_position = bullet_pos + var aim_target: Vector3 = current_target.global_position + var target_range: float = bullet_pos.distance_to(current_target.global_position) + var target_height: float = (aim_target.y - bullet_pos.y) var shot_time: float = (target_range / shot_velocity) - var aim_target: Vector3 = current_target.global_position if lead_shots: aim_target += current_target.linear_velocity * shot_time target_range = bullet_pos.distance_to(aim_target) #DebugDraw3D.draw_sphere(aim_target, 0.25, Color.RED, shot_time) - var fire_direction: Vector3 + var elevation: float = 0.0 + var azimuth: float = Vector3.FORWARD.signed_angle_to((aim_target-bullet_pos).slide(Vector3.UP), Vector3.UP) if compensate_for_gravity: - var elevation: float = find_fire_angle(target_range, (aim_target.y - bullet_pos.y), use_artillery_firing_solution) - var azimuth: float = Vector3.FORWARD.signed_angle_to((aim_target-bullet_pos).slide(Vector3.UP), Vector3.UP) + elevation = find_fire_angle(target_range, target_height, use_artillery_firing_solution) print("Shot params: θ=%d φ=%d" % [rad_to_deg(elevation), rad_to_deg(azimuth)]) if elevation < -PI or elevation > PI or is_nan(elevation): print("wtf?? θ=%d" % rad_to_deg(elevation)) return - fire_direction = Vector3.FORWARD - fire_direction = fire_direction.rotated(Vector3(1,0,0), elevation) - fire_direction = fire_direction.rotated(Vector3(0,1,0), azimuth) else: - fire_direction = (aim_target - bullet_pos).normalized() + elevation = atan2(target_height, target_range) + #fire_direction = (aim_target - bullet_pos).normalized() + # apply deviation + elevation += randfn(0, deg_to_rad(deviation.y)) + azimuth += randfn(0, deg_to_rad(deviation.x)) + + var fire_direction: Vector3 = Vector3.FORWARD + fire_direction = fire_direction.rotated(Vector3(1,0,0), elevation) + fire_direction = fire_direction.rotated(Vector3(0,1,0), azimuth) #DebugDraw3D.draw_arrow_ray(bullet_pos, fire_direction, target_range, Color.RED, 0.5, true, shot_time) bullet.look_at(bullet_pos+fire_direction) bullet.linear_velocity = (-bullet.global_basis.z * shot_velocity) #bullet.apply_impulse((aim_target - bullet.global_position).normalized()*shot_impulse) bullet.angular_velocity = (bullet.global_basis * Vector3(0,0,deg_to_rad(1080))) - current_target = null + # ammo -= 1 if ammo <= 0: Engine.time_scale = 1.0 diff --git a/scripts/bullet.gd b/scripts/bullet.gd index 8c4f934..6abb037 100644 --- a/scripts/bullet.gd +++ b/scripts/bullet.gd @@ -3,6 +3,9 @@ extends RigidBody3D @export var damage_per_speed: float = 1.0 @export var min_damage: float = 10.0 @export var lifetime: float = 2.0 +@export var homing_force: float = 10.0 + +var target: Enemy = null func _on_body_entered(body: Node) -> void: #print("Bullet collided with %s" % body.name) @@ -19,5 +22,10 @@ func _process(delta: float) -> void: if global_position.y < -10: destroy() +func _physics_process(delta: float) -> void: + if homing_force > 0 and target != null: + var distance: float = global_position.distance_to(target.global_position) + var velocity_direction: Vector3 = linear_velocity.limit_length() + func destroy() -> void: queue_free() diff --git a/scripts/camera.gd b/scripts/camera.gd index cd8f4f6..aac8f42 100644 --- a/scripts/camera.gd +++ b/scripts/camera.gd @@ -3,8 +3,11 @@ class_name GameCamera @export var keyboard_movement_speed: float = 10 @export var maximum_movement_speed: float = 30 +@export var camera_movement_standard_distance: float = 20.0 @export var mouse_orbit_sensitivity: float = 0.003 @export var zoom_sensitivity: float = 0.1 +@export var minimum_camera_distance: float = 1.0 +@export var maximum_camera_distance: float = 100.0 @export var focus_follows_terrain: bool = true var focus_offset: Vector3 = Vector3(10, 10, 10) @@ -33,14 +36,16 @@ func _process(delta: float) -> void: if focus_object != null: focus_position = focus_object.global_position + + var movement_speed_multiplier: float = (global_position.distance_to(focus_position)) / camera_movement_standard_distance - process_focus_movement(delta) - process_camera_rotation(delta) - process_camera_zoom(delta) + process_focus_movement(delta, movement_speed_multiplier) + process_camera_rotation(delta, movement_speed_multiplier) + process_camera_zoom(delta, movement_speed_multiplier) var target_position: Vector3 = focus_position + focus_offset if target_position.distance_squared_to(global_position) > 0: - global_position = global_position.move_toward(target_position, maximum_movement_speed*delta) + global_position = global_position.move_toward(target_position, maximum_movement_speed*delta*movement_speed_multiplier) #else: basis = basis.slerp(Basis.looking_at(focus_position - target_position), 0.05) @@ -53,7 +58,7 @@ func _process(delta: float) -> void: #look_at(focus_position) -func process_focus_movement(delta: float) -> void: +func process_focus_movement(delta: float, movement_speed: float) -> void: var camera_forwards: Vector3 = -global_basis.z camera_forwards = camera_forwards.slide(Vector3.UP).normalized() @@ -68,7 +73,7 @@ func process_focus_movement(delta: float) -> void: focus_object = null input = input_basis * input - var movement: Vector3 = input * keyboard_movement_speed * delta + var movement: Vector3 = input * keyboard_movement_speed * delta * movement_speed global_position += movement focus_position += movement @@ -82,7 +87,7 @@ func process_focus_movement(delta: float) -> void: if result.has("position"): focus_position = result["position"] -func process_camera_rotation(delta: float) -> void: +func process_camera_rotation(delta: float, movement_speed: float) -> void: #var mouse_position: Vector2 = viewport.get_mouse_position() #var mouse_position: Vector2 = Vector2() #var mouse_movement: Vector2 = (mouse_position - last_mouse_position) * delta @@ -95,10 +100,13 @@ func process_camera_rotation(delta: float) -> void: look_at(focus_position) mouse_movement = Vector2() -func process_camera_zoom(_delta: float) -> void: +func process_camera_zoom(_delta: float, movement_speed: float) -> void: #var wheel_input: float = Input.get_axis("camera_zoom_in", "camera_zoom_out") var change: float = 1.0 + (-mouse_wheel_delta * zoom_sensitivity) focus_offset *= change + focus_offset = focus_offset.limit_length(maximum_camera_distance) + if focus_offset.length() < minimum_camera_distance: + focus_offset = focus_offset.normalized() * minimum_camera_distance mouse_wheel_delta = 0 func _input(event: InputEvent) -> void: diff --git a/scripts/units/action.gd b/scripts/units/action.gd new file mode 100644 index 0000000..e1a7e5d --- /dev/null +++ b/scripts/units/action.gd @@ -0,0 +1,80 @@ +extends RefCounted +class_name UnitAction + +var unit: Unit = null +var time_limit: float = 300.0 + +func process(delta: float) -> Unit.TaskStatus: + time_limit -= delta + if time_limit <= 0: + return Unit.TaskStatus.TIMED_OUT + return Unit.TaskStatus.DONE + +class MoveAction extends UnitAction: + var last_distance_to_target: float = 99999999.9 + var stuck_timer: float = 0.0 + var move_target: Vector3 = Vector3(16, 1, 13): + set(target): + move_target = target + unit.nav_agent_3d.target_position = move_target + + func process(delta: float) -> Unit.TaskStatus: + if unit.nav_agent_3d.is_navigation_finished(): + #task_updated.emit(TaskStatus.DONE) + unit.target_velocity = Vector3() + #nav_agent_3d.target_position = move_target + Vector3(randfn(0, move_radius), 0, randfn(0, move_radius)) + #nav_agent_3d.target_position = NavigationServer3D.map_get_random_point(NavigationServer3D.get_maps()[0], 1, true) + #last_distance_to_target = nav_agent_3d.distance_to_target() + if unit.nav_agent_3d.is_target_reachable(): + return Unit.TaskStatus.DONE + else: + return Unit.TaskStatus.IMPOSSIBLE + else: + var next_point: Vector3 = unit.nav_agent_3d.get_next_path_position() + if unit.shapecast_3d.is_colliding(): + var distance_to_target: float = unit.global_position.distance_to(next_point) + var progress_rate: float = (last_distance_to_target - distance_to_target) / delta + last_distance_to_target = distance_to_target + if progress_rate < unit.minimum_progress_rate: + stuck_timer += delta + if stuck_timer >= unit.stuck_time: + unit.unstuck() + else: + unit.label_3d.modulate = Color.WHITE + stuck_timer = 0 + DebugDraw3D.draw_sphere(unit.nav_agent_3d.target_position, 0.5, Color.RED) + #DebugDraw3D.draw_sphere(next_point, 0.1, Color.YELLOW) + var direction: Vector3 = (next_point - unit.global_position).normalized() + #basis = Basis.looking_at(direction) + #DebugDraw3D.draw_line(global_position, global_position + linear_velocity, Color.BLUE) + unit.target_velocity = direction * unit.max_speed + unit.nav_agent_3d.velocity = unit.target_velocity + #DebugDraw3D.draw_line(global_position, global_positiaon + target_velocity, Color.MAGENTA) + #DebugDraw3D.draw_text(global_position + Vector3(0,1,0), "%f" % nav_agent_3d.distance_to_target()) + return Unit.TaskStatus.IN_PROGRESS + +class BuildAction extends UnitAction: + var building: Building + + func process(delta: float) -> Unit.TaskStatus: + if building == null or building.is_queued_for_deletion(): + return Unit.TaskStatus.IMPOSSIBLE + building.build_progress += delta + if building.build_state == Building.BuildState.READY: + return Unit.TaskStatus.DONE + elif building.build_state != Building.BuildState.BUILDING: + return Unit.TaskStatus.IMPOSSIBLE # can't build if the building's not there + else: + return Unit.TaskStatus.IN_PROGRESS + +class RepairAction extends UnitAction: + var building: Building + + func process(delta: float) -> Unit.TaskStatus: + if building == null or building.is_queued_for_deletion() or building.build_state != Building.BuildState.READY: + return Unit.TaskStatus.IMPOSSIBLE + building.hp += delta * 10.0 + if building.hp >= building.max_hp: + building.hp = building.max_hp + return Unit.TaskStatus.DONE + return Unit.TaskStatus.IN_PROGRESS diff --git a/scripts/units/action.gd.uid b/scripts/units/action.gd.uid new file mode 100644 index 0000000..2dcbd10 --- /dev/null +++ b/scripts/units/action.gd.uid @@ -0,0 +1 @@ +uid://cvmoolyvemu8s diff --git a/objects/units/citizen.gd b/scripts/units/citizen.gd similarity index 74% rename from objects/units/citizen.gd rename to scripts/units/citizen.gd index ba7281d..79bed73 100644 --- a/objects/units/citizen.gd +++ b/scripts/units/citizen.gd @@ -7,10 +7,6 @@ class_name Citizen var task: Task = null var working: bool = false -enum WorkStatus { NONE, CONSTRUCTING_BUILDING } -var work_status: WorkStatus -var work_building: Building = null - func _ready() -> void: held_item_meshinstance = $"Body/Hands/Held Item" @@ -39,13 +35,6 @@ func _process(delta: float) -> void: CitizenManager._instance.add_task(task) task = null working = false - - if work_status == WorkStatus.CONSTRUCTING_BUILDING: - work_building.build_progress += delta - if work_building.build_state == Building.BuildState.READY: - send_task_update(TaskStatus.DONE) - elif work_building.build_state != Building.BuildState.BUILDING: - send_task_update(TaskStatus.IMPOSSIBLE) func assign_task(t: Task) -> void: task = t @@ -67,9 +56,8 @@ func put_item_in_building_storage(building: Building) -> bool: return true func build_building(building: Building) -> bool: - work_building = building - work_status = WorkStatus.CONSTRUCTING_BUILDING + var build_action: UnitAction.BuildAction = UnitAction.BuildAction.new() + build_action.building = building + action = build_action var ok: bool = await wait_for_task_update() == TaskStatus.DONE - work_building = null - work_status = WorkStatus.NONE return ok diff --git a/objects/units/citizen.gd.uid b/scripts/units/citizen.gd.uid similarity index 100% rename from objects/units/citizen.gd.uid rename to scripts/units/citizen.gd.uid diff --git a/scripts/enemy.gd b/scripts/units/enemy.gd similarity index 50% rename from scripts/enemy.gd rename to scripts/units/enemy.gd index 5bc6eb8..aeca187 100644 --- a/scripts/enemy.gd +++ b/scripts/units/enemy.gd @@ -1,7 +1,11 @@ extends Unit class_name Enemy -var sighted: bool = true +var sighted: bool = true: + set(val): + sighted = val + visible = sighted func _ready() -> void: + sighted = false go_to_destination(Vector3(17,1,15)) diff --git a/scripts/enemy.gd.uid b/scripts/units/enemy.gd.uid similarity index 100% rename from scripts/enemy.gd.uid rename to scripts/units/enemy.gd.uid diff --git a/scripts/task.gd b/scripts/units/task.gd similarity index 100% rename from scripts/task.gd rename to scripts/units/task.gd diff --git a/scripts/task.gd.uid b/scripts/units/task.gd.uid similarity index 100% rename from scripts/task.gd.uid rename to scripts/units/task.gd.uid diff --git a/scripts/unit.gd b/scripts/units/unit.gd similarity index 62% rename from scripts/unit.gd rename to scripts/units/unit.gd index d075cc9..52a74e5 100644 --- a/scripts/unit.gd +++ b/scripts/units/unit.gd @@ -17,13 +17,6 @@ class_name Unit var target_velocity: Vector3 = Vector3() var avoidance_velocity: Vector3 = Vector3() var avoidance_timeout: float = 0.0 -var last_distance_to_target: float = 0.0 -var stuck_timer: float = 0.0 -var moving: bool = false -var move_target: Vector3 = Vector3(16, 1, 13): - set(target): - move_target = target - nav_agent_3d.target_position = move_target var move_radius: float = 5.0 var held_item: Item = null: @@ -39,9 +32,12 @@ var held_item: Item = null: @onready var label_3d: Label3D = $Label3D @onready var held_item_meshinstance: MeshInstance3D = null -var action_timeout: float = 0.0 +var action: UnitAction = null + +var task_timeout: float = 0.0 enum TaskStatus { + IN_PROGRESS, INTERRUPTED, TIMED_OUT, IMPOSSIBLE, @@ -61,59 +57,34 @@ func avoidance_velocity_computed(velocity: Vector3) -> void: func _process(delta: float) -> void: label_3d.text = "HP: %d" % hp - if action_timeout > 0: - action_timeout -= delta - if action_timeout <= 0: - task_updated.emit(TaskStatus.TIMED_OUT) - - if moving: - if nav_agent_3d.is_target_reached() \ - or nav_agent_3d.target_position.is_zero_approx() \ - or !nav_agent_3d.is_target_reachable(): - moving = false - task_updated.emit(TaskStatus.DONE) - target_velocity = Vector3() - #nav_agent_3d.target_position = move_target + Vector3(randfn(0, move_radius), 0, randfn(0, move_radius)) - #nav_agent_3d.target_position = NavigationServer3D.map_get_random_point(NavigationServer3D.get_maps()[0], 1, true) - last_distance_to_target = nav_agent_3d.distance_to_target() - else: - var next_point: Vector3 = nav_agent_3d.get_next_path_position() - if shapecast_3d.is_colliding(): - var distance_to_target: float = global_position.distance_to(next_point) - var progress_rate: float = (last_distance_to_target - distance_to_target) / delta - last_distance_to_target = distance_to_target - if progress_rate < minimum_progress_rate: - stuck_timer += delta - if stuck_timer >= stuck_time: - unstuck() - else: - label_3d.modulate = Color.WHITE - stuck_timer = 0 - if global_position.y <= -10: - unstuck() - DebugDraw3D.draw_sphere(nav_agent_3d.target_position, 0.5, Color.RED) - #DebugDraw3D.draw_sphere(next_point, 0.1, Color.YELLOW) - var direction: Vector3 = (next_point - global_position).normalized() - #basis = Basis.looking_at(direction) - #DebugDraw3D.draw_line(global_position, global_position + linear_velocity, Color.BLUE) - target_velocity = direction * max_speed - nav_agent_3d.velocity = target_velocity - #DebugDraw3D.draw_line(global_position, global_positiaon + target_velocity, Color.MAGENTA) - #DebugDraw3D.draw_text(global_position + Vector3(0,1,0), "%f" % nav_agent_3d.distance_to_target()) + if task_timeout > 0: + task_timeout -= delta + if task_timeout <= 0: + send_task_update(TaskStatus.TIMED_OUT) + + if action != null: + var status: TaskStatus = action.process(delta) + if status != TaskStatus.IN_PROGRESS: + action = null + send_task_update(status) + + if global_position.y <= -10: + unstuck() func unstuck() -> void: # teleport to next path point linear_velocity = Vector3() global_position = nav_agent_3d.get_next_path_position() - stuck_timer = 0 func hurt(damage: float) -> void: hp -= damage + interrupt() #print("%s hit for %f damage, HP=%f" % [name, damage, hp]) if hp <= 0: die() func die() -> void: + interrupt() queue_free() func _physics_process(delta: float) -> void: @@ -133,6 +104,9 @@ func _physics_process(delta: float) -> void: #DebugDraw3D.draw_line(global_position, global_position - global_basis.z, Color.BLUE) #DebugDraw3D.draw_line(global_position, global_position + force_direction, Color.RED) +func interrupt() -> void: + send_task_update(TaskStatus.INTERRUPTED) + func send_task_update(task_status: TaskStatus) -> void: task_updated.emit(task_status) @@ -141,8 +115,11 @@ func wait_for_task_update() -> TaskStatus: return status_received func go_to_destination(destination: Vector3) -> bool: - move_target = destination - moving = true + var move_action: UnitAction.MoveAction = UnitAction.MoveAction.new() + move_action.unit = self + move_action.move_target = destination + action = move_action + #move_target = destination return (await wait_for_task_update()) == TaskStatus.DONE func take_item_from_building(item: Item, building: Building) -> bool: diff --git a/scripts/unit.gd.uid b/scripts/units/unit.gd.uid similarity index 100% rename from scripts/unit.gd.uid rename to scripts/units/unit.gd.uid diff --git a/scripts/util.gd b/scripts/util.gd new file mode 100644 index 0000000..f84aee2 --- /dev/null +++ b/scripts/util.gd @@ -0,0 +1,6 @@ +extends Node + +func draw_raycast_hit(params: PhysicsRayQueryParameters3D, result: Dictionary, duration: float = 0.0) -> void: + var is_hit: bool = result.has("collider") + var hit_loc: Vector3 = result.get("position", params.to) + DebugDraw3D.draw_line_hit(params.from, params.to, hit_loc, is_hit, 0.25, Color.RED, Color.BLACK, duration) diff --git a/scripts/util.gd.uid b/scripts/util.gd.uid new file mode 100644 index 0000000..5a9b109 --- /dev/null +++ b/scripts/util.gd.uid @@ -0,0 +1 @@ +uid://c42mpvgqhysam