basic building structures
This commit is contained in:
9
buildings/arms_building.cs
Normal file
9
buildings/arms_building.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using Godot;
|
||||
|
||||
public partial class arms_building : base_building
|
||||
{
|
||||
[Export]
|
||||
public int Megaton { get; set; } = 1;
|
||||
[Export]
|
||||
public int Approval { get; set; } = -1;
|
||||
}
|
||||
31
buildings/base_building.cs
Normal file
31
buildings/base_building.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using Godot;
|
||||
|
||||
public partial class base_building : Node3D
|
||||
{
|
||||
[Export]
|
||||
public Node3D BlocksNode { get; set; } = null;
|
||||
private building_block[] _blocks = null;
|
||||
|
||||
[Export]
|
||||
public string DisplayName { get; set; } = "base_building";
|
||||
[Export]
|
||||
public int KashCost { get; set; } = -1;
|
||||
public bool IsPlaceable
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public override void _Ready()
|
||||
{
|
||||
if (BlocksNode != null)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
}
|
||||
}
|
||||
34
buildings/building_block.cs
Normal file
34
buildings/building_block.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using Godot;
|
||||
public enum TileTypes
|
||||
{
|
||||
NONE,
|
||||
Grass,
|
||||
Sand,
|
||||
Water,
|
||||
}
|
||||
|
||||
public partial class building_block : Node3D
|
||||
{
|
||||
[Export]
|
||||
public RayCast3D _ray = null;
|
||||
|
||||
[Export]
|
||||
private TileTypes _compatible_tile = TileTypes.NONE;
|
||||
|
||||
public bool IsPlaceable
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_ray == null || _compatible_tile == TileTypes.NONE)
|
||||
return false;
|
||||
|
||||
GodotObject collider = _ray.GetCollider();
|
||||
GD.Print(collider);
|
||||
|
||||
if (collider == null)
|
||||
return false;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
13
buildings/grass_block.tscn
Normal file
13
buildings/grass_block.tscn
Normal file
@@ -0,0 +1,13 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://m3lrwoup4i4r"]
|
||||
|
||||
[ext_resource type="Script" path="res://buildings/building_block.cs" id="1_3ht4p"]
|
||||
[ext_resource type="PackedScene" uid="uid://cdakee12nn8un" path="res://assets/meshes/highlights_grass.tscn" id="2_m6bs4"]
|
||||
|
||||
[node name="grass_block" type="Node3D" node_paths=PackedStringArray("_ray")]
|
||||
script = ExtResource("1_3ht4p")
|
||||
_ray = NodePath("RayCast3D")
|
||||
_compatible_tile = 1
|
||||
|
||||
[node name="highlights-grass" parent="." instance=ExtResource("2_m6bs4")]
|
||||
|
||||
[node name="RayCast3D" type="RayCast3D" parent="."]
|
||||
7
buildings/kash_building.cs
Normal file
7
buildings/kash_building.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
using Godot;
|
||||
|
||||
public partial class kash_building : base_building
|
||||
{
|
||||
[Export]
|
||||
public int KashGenPerSec { get; set; } = 1;
|
||||
}
|
||||
7
buildings/propaganda_building.cs
Normal file
7
buildings/propaganda_building.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
using Godot;
|
||||
|
||||
public partial class propaganda_building : base_building
|
||||
{
|
||||
[Export]
|
||||
public int Approval { get; set; } = 1;
|
||||
}
|
||||
13
buildings/sand_block.tscn
Normal file
13
buildings/sand_block.tscn
Normal file
@@ -0,0 +1,13 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://dffhktks7ro6y"]
|
||||
|
||||
[ext_resource type="Script" path="res://buildings/building_block.cs" id="1_xuxw4"]
|
||||
[ext_resource type="PackedScene" uid="uid://bea5tpiqs0m4b" path="res://assets/meshes/highlights_sand.tscn" id="2_pmjbb"]
|
||||
|
||||
[node name="sand_block" type="Node3D" node_paths=PackedStringArray("_ray")]
|
||||
script = ExtResource("1_xuxw4")
|
||||
_ray = NodePath("RayCast3D")
|
||||
_compatible_tile = 2
|
||||
|
||||
[node name="highlights-sand" parent="." instance=ExtResource("2_pmjbb")]
|
||||
|
||||
[node name="RayCast3D" type="RayCast3D" parent="."]
|
||||
13
buildings/water_block.tscn
Normal file
13
buildings/water_block.tscn
Normal file
@@ -0,0 +1,13 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://b3jpnuj1suvcj"]
|
||||
|
||||
[ext_resource type="Script" path="res://buildings/building_block.cs" id="1_p3ylt"]
|
||||
[ext_resource type="PackedScene" uid="uid://ds0lxspxtnkcp" path="res://assets/meshes/highlights-water.glb" id="2_53d7w"]
|
||||
|
||||
[node name="water_block" type="Node3D" node_paths=PackedStringArray("_ray")]
|
||||
script = ExtResource("1_p3ylt")
|
||||
_ray = NodePath("RayCast3D")
|
||||
_compatible_tile = 3
|
||||
|
||||
[node name="highlights-water" parent="." instance=ExtResource("2_53d7w")]
|
||||
|
||||
[node name="RayCast3D" type="RayCast3D" parent="."]
|
||||
Reference in New Issue
Block a user