fixed some chatbox and tower preview issues
This commit is contained in:
parent
e63b765753
commit
afc0a19b36
@ -3,6 +3,8 @@ class_name Tower
|
||||
|
||||
@export var stats : TowerStats
|
||||
@export var model : Node3D
|
||||
@export var range_sphere : CSGSphere3D
|
||||
@export var minimap_range_sphere : CSGSphere3D
|
||||
|
||||
var targeted_enemy
|
||||
var cooldown := 0.0
|
||||
@ -10,6 +12,13 @@ var other_cooldown := 0.0
|
||||
|
||||
func _ready() -> void:
|
||||
cooldown = 1.0 / stats.fire_rate
|
||||
range_sphere.radius = stats.fire_range
|
||||
minimap_range_sphere.radius = stats.fire_range
|
||||
minimap_range_sphere.set_visible(true)
|
||||
|
||||
|
||||
func preview_range(value):
|
||||
range_sphere.set_visible(value)
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
|
@ -1,12 +1,20 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://fernyl7fsifv"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://fernyl7fsifv"]
|
||||
|
||||
[ext_resource type="Script" path="res://PCs/Universal/ClassCards/Assault/tower.gd" id="1_c2874"]
|
||||
[ext_resource type="Resource" uid="uid://cktq4o3yuxgsa" path="res://Resources/TurretStats/assault.tres" id="2_t516u"]
|
||||
|
||||
[node name="Node3D" type="Node3D" node_paths=PackedStringArray("model")]
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_llb88"]
|
||||
transparency = 1
|
||||
cull_mode = 2
|
||||
shading_mode = 0
|
||||
albedo_color = Color(0.686275, 0, 0, 0.278431)
|
||||
|
||||
[node name="Node3D" type="Node3D" node_paths=PackedStringArray("model", "range_sphere", "minimap_range_sphere")]
|
||||
script = ExtResource("1_c2874")
|
||||
stats = ExtResource("2_t516u")
|
||||
model = NodePath("Model")
|
||||
range_sphere = NodePath("Model/CSGSphere3D")
|
||||
minimap_range_sphere = NodePath("Model/CSGSphere3D2")
|
||||
|
||||
[node name="Model" type="Node3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0)
|
||||
@ -20,3 +28,14 @@ size = Vector3(0.481654, 0.427749, 1.38438)
|
||||
[node name="CSGBox3D3" type="CSGBox3D" parent="Model"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.715, 0, -0.424)
|
||||
size = Vector3(0.481654, 0.427749, 1.38438)
|
||||
|
||||
[node name="CSGSphere3D" type="CSGSphere3D" parent="Model"]
|
||||
visible = false
|
||||
radius = 7.5
|
||||
material = SubResource("StandardMaterial3D_llb88")
|
||||
|
||||
[node name="CSGSphere3D2" type="CSGSphere3D" parent="Model"]
|
||||
visible = false
|
||||
layers = 4
|
||||
radius = 7.5
|
||||
material = SubResource("StandardMaterial3D_llb88")
|
||||
|
@ -1,14 +1,22 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://cwc8y1nv53btu"]
|
||||
[gd_scene load_steps=5 format=3 uid="uid://cwc8y1nv53btu"]
|
||||
|
||||
[ext_resource type="Script" path="res://PCs/Universal/ClassCards/BombLauncher/bombtower.gd" id="1_u2hyk"]
|
||||
[ext_resource type="PackedScene" uid="uid://d147iwg2wcqc5" path="res://PCs/Universal/ClassCards/BombLauncher/bomb.tscn" id="2_n307r"]
|
||||
[ext_resource type="Resource" uid="uid://crmsk6lvp5i4e" path="res://Resources/TurretStats/bomblauncher.tres" id="3_xv5rx"]
|
||||
|
||||
[node name="Node3D" type="Node3D" node_paths=PackedStringArray("model")]
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_nr2od"]
|
||||
transparency = 1
|
||||
cull_mode = 2
|
||||
shading_mode = 0
|
||||
albedo_color = Color(0.686275, 0, 0, 0.278431)
|
||||
|
||||
[node name="Node3D" type="Node3D" node_paths=PackedStringArray("model", "range_sphere", "minimap_range_sphere")]
|
||||
script = ExtResource("1_u2hyk")
|
||||
bomb_scene = ExtResource("2_n307r")
|
||||
stats = ExtResource("3_xv5rx")
|
||||
model = NodePath("Model")
|
||||
range_sphere = NodePath("Model/CSGSphere3D")
|
||||
minimap_range_sphere = NodePath("Model/CSGSphere3D2")
|
||||
|
||||
[node name="Model" type="Node3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.13842, 0)
|
||||
@ -18,3 +26,14 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.13842, 0)
|
||||
[node name="CSGBox3D2" type="CSGBox3D" parent="Model"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.65)
|
||||
size = Vector3(0.596453, 0.632841, 0.539216)
|
||||
|
||||
[node name="CSGSphere3D" type="CSGSphere3D" parent="Model"]
|
||||
visible = false
|
||||
radius = 7.5
|
||||
material = SubResource("StandardMaterial3D_nr2od")
|
||||
|
||||
[node name="CSGSphere3D2" type="CSGSphere3D" parent="Model"]
|
||||
visible = false
|
||||
layers = 4
|
||||
radius = 7.5
|
||||
material = SubResource("StandardMaterial3D_nr2od")
|
||||
|
@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://dvqk2lysu02gf"]
|
||||
[gd_scene load_steps=10 format=3 uid="uid://dvqk2lysu02gf"]
|
||||
|
||||
[ext_resource type="Script" path="res://PCs/Universal/ClassCards/Flamethrower/tower_flamethrower.gd" id="1_6dcsj"]
|
||||
[ext_resource type="Resource" uid="uid://dbanx8taicddm" path="res://Resources/StatusEffects/on_fire.tres" id="2_yo2b7"]
|
||||
@ -30,12 +30,20 @@ size = Vector3(0.3, 0.3, 0.3)
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_vck5q"]
|
||||
size = Vector3(2.145, 3.125, 2.415)
|
||||
|
||||
[node name="Node3D" type="Node3D" node_paths=PackedStringArray("shapecast", "particlesystem", "model")]
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_imgrm"]
|
||||
transparency = 1
|
||||
cull_mode = 2
|
||||
shading_mode = 0
|
||||
albedo_color = Color(0.686275, 0, 0, 0.278431)
|
||||
|
||||
[node name="Node3D" type="Node3D" node_paths=PackedStringArray("shapecast", "particlesystem", "model", "range_sphere", "minimap_range_sphere")]
|
||||
script = ExtResource("1_6dcsj")
|
||||
shapecast = NodePath("Model/Node3D/ShapeCast3D")
|
||||
particlesystem = NodePath("Model/Node3D/GPUParticles3D")
|
||||
status_stats = ExtResource("2_yo2b7")
|
||||
model = NodePath("Model")
|
||||
range_sphere = NodePath("Model/CSGSphere3D")
|
||||
minimap_range_sphere = NodePath("Model/CSGSphere3D2")
|
||||
|
||||
[node name="Model" type="Node3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0)
|
||||
@ -61,3 +69,14 @@ draw_pass_1 = SubResource("BoxMesh_q83y7")
|
||||
shape = SubResource("BoxShape3D_vck5q")
|
||||
target_position = Vector3(0, 1.51, 0)
|
||||
collision_mask = 4
|
||||
|
||||
[node name="CSGSphere3D" type="CSGSphere3D" parent="Model"]
|
||||
visible = false
|
||||
radius = 7.5
|
||||
material = SubResource("StandardMaterial3D_imgrm")
|
||||
|
||||
[node name="CSGSphere3D2" type="CSGSphere3D" parent="Model"]
|
||||
visible = false
|
||||
layers = 4
|
||||
radius = 7.5
|
||||
material = SubResource("StandardMaterial3D_imgrm")
|
||||
|
@ -1,12 +1,20 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bwcdgglljbmot"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://bwcdgglljbmot"]
|
||||
|
||||
[ext_resource type="Script" path="res://PCs/Universal/ClassCards/Gatling/speedytower.gd" id="1_26he3"]
|
||||
[ext_resource type="Resource" uid="uid://cc20tomywj0jm" path="res://Resources/TurretStats/accelerator.tres" id="2_puwlv"]
|
||||
|
||||
[node name="Node3D" type="Node3D" node_paths=PackedStringArray("model")]
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_73y0x"]
|
||||
transparency = 1
|
||||
cull_mode = 2
|
||||
shading_mode = 0
|
||||
albedo_color = Color(0.686275, 0, 0, 0.278431)
|
||||
|
||||
[node name="Node3D" type="Node3D" node_paths=PackedStringArray("model", "range_sphere", "minimap_range_sphere")]
|
||||
script = ExtResource("1_26he3")
|
||||
stats = ExtResource("2_puwlv")
|
||||
model = NodePath("Model")
|
||||
range_sphere = NodePath("Model/CSGSphere3D")
|
||||
minimap_range_sphere = NodePath("Model/CSGSphere3D2")
|
||||
|
||||
[node name="Model" type="Node3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0)
|
||||
@ -36,3 +44,14 @@ size = Vector3(0.177, 0.148, 0.929)
|
||||
[node name="CSGBox3D7" type="CSGBox3D" parent="Model"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.26701, 0.102116, -0.880753)
|
||||
size = Vector3(0.177, 0.148, 0.929)
|
||||
|
||||
[node name="CSGSphere3D" type="CSGSphere3D" parent="Model"]
|
||||
visible = false
|
||||
radius = 7.5
|
||||
material = SubResource("StandardMaterial3D_73y0x")
|
||||
|
||||
[node name="CSGSphere3D2" type="CSGSphere3D" parent="Model"]
|
||||
visible = false
|
||||
layers = 4
|
||||
radius = 7.5
|
||||
material = SubResource("StandardMaterial3D_73y0x")
|
||||
|
@ -1,12 +1,20 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://dja1b2ke8clo5"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://dja1b2ke8clo5"]
|
||||
|
||||
[ext_resource type="Script" path="res://PCs/Universal/ClassCards/GlueLauncher/stickytower.gd" id="1_0fo13"]
|
||||
[ext_resource type="Resource" uid="uid://d0643gfp52x3s" path="res://Resources/StatusEffects/sticky.tres" id="2_f8mxi"]
|
||||
|
||||
[node name="Node3D" type="Node3D" node_paths=PackedStringArray("model")]
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_mrhfj"]
|
||||
transparency = 1
|
||||
cull_mode = 2
|
||||
shading_mode = 0
|
||||
albedo_color = Color(0.686275, 0, 0, 0.278431)
|
||||
|
||||
[node name="Node3D" type="Node3D" node_paths=PackedStringArray("model", "range_sphere", "minimap_range_sphere")]
|
||||
script = ExtResource("1_0fo13")
|
||||
status_stats = ExtResource("2_f8mxi")
|
||||
model = NodePath("Model")
|
||||
range_sphere = NodePath("Model/CSGSphere3D")
|
||||
minimap_range_sphere = NodePath("Model/CSGSphere3D2")
|
||||
|
||||
[node name="Model" type="Node3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0)
|
||||
@ -24,3 +32,16 @@ size = Vector3(0.329535, 0.622842, 0.319929)
|
||||
[node name="CSGBox3D4" type="CSGBox3D" parent="Model"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00590295, 0.453314, -0.265725)
|
||||
size = Vector3(0.329535, 0.622842, 0.319929)
|
||||
|
||||
[node name="CSGSphere3D" type="CSGSphere3D" parent="Model"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -2, 0)
|
||||
visible = false
|
||||
radius = 7.5
|
||||
material = SubResource("StandardMaterial3D_mrhfj")
|
||||
|
||||
[node name="CSGSphere3D2" type="CSGSphere3D" parent="Model"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -2, 0)
|
||||
visible = false
|
||||
layers = 4
|
||||
radius = 7.5
|
||||
material = SubResource("StandardMaterial3D_mrhfj")
|
||||
|
@ -1,14 +1,22 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://br3bd1jmi235x"]
|
||||
[gd_scene load_steps=5 format=3 uid="uid://br3bd1jmi235x"]
|
||||
|
||||
[ext_resource type="Script" path="res://PCs/Universal/ClassCards/RocketLauncher/rockettower.gd" id="1_8hb2v"]
|
||||
[ext_resource type="PackedScene" uid="uid://hr0dw2533tsl" path="res://PCs/Universal/ClassCards/RocketLauncher/rocket.tscn" id="2_by0gu"]
|
||||
[ext_resource type="Resource" uid="uid://duofn25nuu84q" path="res://Resources/TurretStats/rocketlauncher.tres" id="3_ynh7l"]
|
||||
|
||||
[node name="Node3D" type="Node3D" node_paths=PackedStringArray("model")]
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_fouf8"]
|
||||
transparency = 1
|
||||
cull_mode = 2
|
||||
shading_mode = 0
|
||||
albedo_color = Color(0.686275, 0, 0, 0.278431)
|
||||
|
||||
[node name="Node3D" type="Node3D" node_paths=PackedStringArray("model", "range_sphere", "minimap_range_sphere")]
|
||||
script = ExtResource("1_8hb2v")
|
||||
rocket_scene = ExtResource("2_by0gu")
|
||||
stats = ExtResource("3_ynh7l")
|
||||
model = NodePath("Model")
|
||||
range_sphere = NodePath("Model/CSGSphere3D")
|
||||
minimap_range_sphere = NodePath("Model/CSGSphere3D2")
|
||||
|
||||
[node name="Model" type="Node3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.97939, 0)
|
||||
@ -22,3 +30,14 @@ size = Vector3(0.805859, 0.771887, 1.04243)
|
||||
[node name="CSGBox3D3" type="CSGBox3D" parent="Model"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -1.20204)
|
||||
size = Vector3(0.597715, 0.561942, 0.242169)
|
||||
|
||||
[node name="CSGSphere3D" type="CSGSphere3D" parent="Model"]
|
||||
visible = false
|
||||
radius = 7.5
|
||||
material = SubResource("StandardMaterial3D_fouf8")
|
||||
|
||||
[node name="CSGSphere3D2" type="CSGSphere3D" parent="Model"]
|
||||
visible = false
|
||||
layers = 4
|
||||
radius = 7.5
|
||||
material = SubResource("StandardMaterial3D_fouf8")
|
||||
|
@ -1,12 +1,20 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://ryhc48vl36fc"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://ryhc48vl36fc"]
|
||||
|
||||
[ext_resource type="Script" path="res://PCs/Universal/ClassCards/Assault/tower.gd" id="1_tmpm5"]
|
||||
[ext_resource type="Resource" uid="uid://ddw7pj1ckwmp8" path="res://Resources/TurretStats/sniper.tres" id="2_opda8"]
|
||||
|
||||
[node name="Node3D" type="Node3D" node_paths=PackedStringArray("model")]
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_mt54a"]
|
||||
transparency = 1
|
||||
cull_mode = 2
|
||||
shading_mode = 0
|
||||
albedo_color = Color(0.686275, 0, 0, 0.278431)
|
||||
|
||||
[node name="Node3D" type="Node3D" node_paths=PackedStringArray("model", "range_sphere", "minimap_range_sphere")]
|
||||
script = ExtResource("1_tmpm5")
|
||||
stats = ExtResource("2_opda8")
|
||||
model = NodePath("Model")
|
||||
range_sphere = NodePath("Model/CSGSphere3D")
|
||||
minimap_range_sphere = NodePath("Model/CSGSphere3D2")
|
||||
|
||||
[node name="Model" type="Node3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0)
|
||||
@ -16,3 +24,14 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0)
|
||||
[node name="CSGBox3D3" type="CSGBox3D" parent="Model"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.776406)
|
||||
size = Vector3(0.481654, 0.427749, 1.38438)
|
||||
|
||||
[node name="CSGSphere3D" type="CSGSphere3D" parent="Model"]
|
||||
visible = false
|
||||
radius = 7.5
|
||||
material = SubResource("StandardMaterial3D_mt54a")
|
||||
|
||||
[node name="CSGSphere3D2" type="CSGSphere3D" parent="Model"]
|
||||
visible = false
|
||||
layers = 4
|
||||
radius = 7.5
|
||||
material = SubResource("StandardMaterial3D_mt54a")
|
||||
|
@ -81,6 +81,11 @@ func _process(delta: float) -> void:
|
||||
movement.zoom_factor = 1.0
|
||||
|
||||
if editing_mode:
|
||||
if interaction_raycast.is_colliding() and interaction_raycast.get_collider() is InteractButton:
|
||||
hud.set_hover_text(interaction_raycast.get_collider().hover_text)
|
||||
else:
|
||||
hud.unset_hover_text()
|
||||
|
||||
if edit_tool.is_looking_at_tower_base:
|
||||
card.view_tower()
|
||||
else:
|
||||
@ -176,11 +181,14 @@ func enter_editing_mode(value):
|
||||
func exit_editing_mode(value):
|
||||
hud.set_wave_count(value)
|
||||
edit_tool.enabled = false
|
||||
edit_tool.delete_tower_preview()
|
||||
left_hand.set_visible(false)
|
||||
editing_mode = false
|
||||
|
||||
|
||||
func check_left_hand_valid():
|
||||
if !editing_mode:
|
||||
return
|
||||
if inventory.contents.size() == 0:
|
||||
left_hand.set_visible(false)
|
||||
#gauntlet.texture.region = Rect2(64, 0, 64, 64)
|
||||
|
@ -154,7 +154,7 @@ size = 15.0
|
||||
script = ExtResource("12_3hpi3")
|
||||
anchor = NodePath("../..")
|
||||
|
||||
[node name="HUD" type="CanvasLayer" parent="." node_paths=PackedStringArray("wave_count", "lives_count", "enemy_count", "currency_count", "crosshair", "minimap", "minimap_cam", "minimap_viewport", "fps_label", "enemy_sprites", "enemy_counts")]
|
||||
[node name="HUD" type="CanvasLayer" parent="." node_paths=PackedStringArray("wave_count", "lives_count", "enemy_count", "currency_count", "crosshair", "minimap", "minimap_cam", "minimap_viewport", "fps_label", "hover_text", "enemy_sprites", "enemy_counts")]
|
||||
script = ExtResource("8_yl6ka")
|
||||
wave_count = NodePath("WaveCount")
|
||||
lives_count = NodePath("LivesCount")
|
||||
@ -165,6 +165,7 @@ minimap = NodePath("TextureRect2")
|
||||
minimap_cam = NodePath("../MiniMapViewport/Camera3D")
|
||||
minimap_viewport = NodePath("../MiniMapViewport")
|
||||
fps_label = NodePath("Label")
|
||||
hover_text = NodePath("Label2")
|
||||
enemy_sprites = [NodePath("TextureRect4/TextureRect"), NodePath("TextureRect4/TextureRect2"), NodePath("TextureRect4/TextureRect3"), NodePath("TextureRect4/TextureRect4"), NodePath("TextureRect4/TextureRect5")]
|
||||
enemy_counts = [NodePath("TextureRect4/TextureRect/Label"), NodePath("TextureRect4/TextureRect2/Label2"), NodePath("TextureRect4/TextureRect3/Label3"), NodePath("TextureRect4/TextureRect4/Label4"), NodePath("TextureRect4/TextureRect5/Label5")]
|
||||
|
||||
@ -413,6 +414,27 @@ text = "20"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Label2" type="Label" parent="HUD"]
|
||||
visible = false
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -93.5
|
||||
offset_top = 167.0
|
||||
offset_right = 93.5
|
||||
offset_bottom = 13.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(1, 1, 1, 1)
|
||||
theme_override_constants/outline_size = 4
|
||||
theme_override_font_sizes/font_size = 34
|
||||
text = "Press button to do thing"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="MinimapIcon" type="Sprite3D" parent="."]
|
||||
transform = Transform3D(4, 0, 0, 0, 0.0698095, 3.99939, 0, -3.99939, 0.0698095, 0, 2.86288, 0)
|
||||
layers = 4
|
||||
|
@ -6,5 +6,5 @@
|
||||
script = ExtResource("1_jhska")
|
||||
can_target = 1
|
||||
damage = 1.0
|
||||
fire_range = 15.0
|
||||
fire_range = 8.0
|
||||
fire_rate = 4.0
|
||||
|
@ -6,5 +6,5 @@
|
||||
script = ExtResource("1_ujduk")
|
||||
can_target = 1
|
||||
damage = 1.0
|
||||
fire_range = 15.0
|
||||
fire_range = 8.0
|
||||
fire_rate = 5.0
|
||||
|
@ -6,5 +6,5 @@
|
||||
script = ExtResource("1_h37p4")
|
||||
can_target = 1
|
||||
damage = 0.0
|
||||
fire_range = 4.0
|
||||
fire_range = 5.0
|
||||
fire_rate = 1.0
|
||||
|
@ -6,4 +6,4 @@
|
||||
script = ExtResource("1_sg2a6")
|
||||
damage = 8
|
||||
fire_rate = 0.5
|
||||
fire_range = 40.0
|
||||
fire_range = 80.0
|
||||
|
@ -88,6 +88,7 @@ collision_layer = 16
|
||||
collision_mask = 0
|
||||
script = ExtResource("3_iia6u")
|
||||
press_cost = 10
|
||||
hover_text = "Spend 10 Coins to print card"
|
||||
|
||||
[node name="CollisionShape3D2" type="CollisionShape3D" parent="StaticBody3D"]
|
||||
shape = SubResource("BoxShape3D_ikdwj")
|
||||
@ -100,10 +101,12 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.756734, 1.15772, 0.610684)
|
||||
collision_layer = 16
|
||||
collision_mask = 0
|
||||
script = ExtResource("3_iia6u")
|
||||
hover_text = "Select card"
|
||||
|
||||
[node name="CollisionShape3D2" type="CollisionShape3D" parent="StaticBody3D2"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0466152, -0.0297148, -0.0917365)
|
||||
shape = SubResource("BoxShape3D_gv3t5")
|
||||
disabled = true
|
||||
|
||||
[node name="StaticBody3D3" type="StaticBody3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0672475, 1.15772, 0.610684)
|
||||
@ -111,10 +114,12 @@ collision_layer = 16
|
||||
collision_mask = 0
|
||||
script = ExtResource("3_iia6u")
|
||||
button_press_value = 1
|
||||
hover_text = "Select card"
|
||||
|
||||
[node name="CollisionShape3D2" type="CollisionShape3D" parent="StaticBody3D3"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0466152, -0.0297148, -0.0917365)
|
||||
shape = SubResource("BoxShape3D_gv3t5")
|
||||
disabled = true
|
||||
|
||||
[node name="StaticBody3D4" type="StaticBody3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.883877, 1.15772, 0.610684)
|
||||
@ -122,10 +127,12 @@ collision_layer = 16
|
||||
collision_mask = 0
|
||||
script = ExtResource("3_iia6u")
|
||||
button_press_value = 2
|
||||
hover_text = "Select card"
|
||||
|
||||
[node name="CollisionShape3D2" type="CollisionShape3D" parent="StaticBody3D4"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0466152, -0.0297148, -0.0917365)
|
||||
shape = SubResource("BoxShape3D_gv3t5")
|
||||
disabled = true
|
||||
|
||||
[connection signal="button_interacted" from="StaticBody3D" to="." method="_on_static_body_3d_button_interacted"]
|
||||
[connection signal="button_interacted" from="StaticBody3D2" to="." method="retrieve_card"]
|
||||
|
@ -11,6 +11,7 @@ var last_lives_count = 120
|
||||
@export var minimap_cam : MinimapCamera3D
|
||||
@export var minimap_viewport : SubViewport
|
||||
@export var fps_label : Label
|
||||
@export var hover_text : Label
|
||||
var minimap_anchor : Node3D
|
||||
var enemy_names = []
|
||||
@export var enemy_sprites : Array[TextureRect]
|
||||
@ -21,6 +22,15 @@ func _process(_delta: float) -> void:
|
||||
fps_label.text = "FPS: " + str(Engine.get_frames_per_second())
|
||||
|
||||
|
||||
func set_hover_text(text):
|
||||
hover_text.text = text
|
||||
hover_text.set_visible(true)
|
||||
|
||||
|
||||
func unset_hover_text():
|
||||
hover_text.set_visible(false)
|
||||
|
||||
|
||||
func set_wave_count(value):
|
||||
wave_count.text = str(value)
|
||||
|
||||
|
@ -17,6 +17,7 @@ func _input(event: InputEvent) -> void:
|
||||
return
|
||||
if text_selected and event is InputEventKey and event.pressed == true:
|
||||
if event.keycode == KEY_ENTER:
|
||||
get_viewport().set_input_as_handled()
|
||||
closed.emit()
|
||||
$VBoxContainer/LineEdit.deselect()
|
||||
$VBoxContainer/LineEdit.visible = false
|
||||
@ -28,6 +29,7 @@ func _input(event: InputEvent) -> void:
|
||||
rpc("append_message", username, $VBoxContainer/LineEdit.text)
|
||||
$VBoxContainer/LineEdit.clear()
|
||||
if event.keycode == KEY_ESCAPE:
|
||||
get_viewport().set_input_as_handled()
|
||||
closed.emit()
|
||||
$VBoxContainer/LineEdit.deselect()
|
||||
$VBoxContainer/LineEdit.visible = false
|
||||
|
@ -13,6 +13,9 @@ var point_id := -1
|
||||
var obstacle_last_point := -1
|
||||
var valid_point := false
|
||||
var is_looking_at_tower_base := false
|
||||
var tower_preview
|
||||
var last_tower_base
|
||||
var last_card
|
||||
var ray_collider
|
||||
var ray_point
|
||||
|
||||
@ -54,6 +57,11 @@ func _process(delta: float) -> void:
|
||||
ray_point = ray.get_collision_point()
|
||||
|
||||
is_looking_at_tower_base = ray_collider is TowerBase
|
||||
if is_looking_at_tower_base and inventory.contents.size() > 0 and !ray_collider.has_card:
|
||||
if ray_collider != last_tower_base or inventory.selected_item != last_card:
|
||||
spawn_tower_preview()
|
||||
elif tower_preview:
|
||||
delete_tower_preview()
|
||||
if Game.level:
|
||||
point_id = Game.level.a_star_graph_3d.astar.get_closest_point(ray_point)
|
||||
if !Game.level.a_star_graph_3d.point_is_build_location(point_id) or hero.currency < Data.wall_cost:
|
||||
@ -76,9 +84,29 @@ func _process(delta: float) -> void:
|
||||
ray_collider = null
|
||||
ray_point = null
|
||||
is_looking_at_tower_base = false
|
||||
delete_tower_preview()
|
||||
wall_preview.set_visible(false)
|
||||
|
||||
|
||||
func spawn_tower_preview():
|
||||
delete_tower_preview()
|
||||
last_tower_base = ray_collider
|
||||
var card = inventory.selected_item
|
||||
last_card = card
|
||||
tower_preview = card.turret.instantiate() as Tower
|
||||
tower_preview.stats = card.tower_stats
|
||||
tower_preview.preview_range(true)
|
||||
ray_collider.add_child(tower_preview)
|
||||
|
||||
|
||||
func delete_tower_preview():
|
||||
last_tower_base = null
|
||||
last_card = null
|
||||
if tower_preview:
|
||||
tower_preview.queue_free()
|
||||
tower_preview = null
|
||||
|
||||
|
||||
func interact():
|
||||
if ray_collider is TowerBase:
|
||||
var tower_base = ray_collider as TowerBase
|
||||
|
@ -40,6 +40,10 @@ func _process(delta: float) -> void:
|
||||
signal_for_when_enemy_spawns.emit()
|
||||
if type == Data.EnemyType.AIR:
|
||||
var enemy = air_enemy_scene.instantiate() as AirEnemyController
|
||||
var radius = 10.0
|
||||
var random_dir = Vector3(randf_range(-1, 1), randf_range(-1, 1), randf_range(-1, 1))
|
||||
var random_pos = randf_range(0, radius) * random_dir.normalized()
|
||||
enemy.position = random_pos
|
||||
enemy.stats = enemy_stats
|
||||
enemy.destination = dest
|
||||
enemy.died.connect(signal_for_after_enemy_died)
|
||||
|
@ -200,10 +200,10 @@ func quit_to_desktop():
|
||||
|
||||
|
||||
func scene_switch_main_menu():
|
||||
multiplayer.multiplayer_peer.close()
|
||||
multiplayer.multiplayer_peer = null
|
||||
for node in get_children():
|
||||
node.queue_free()
|
||||
multiplayer.multiplayer_peer.close()
|
||||
multiplayer.multiplayer_peer = null
|
||||
get_tree().change_scene_to_file(main_menu_scene_path)
|
||||
|
||||
|
||||
|
@ -5,6 +5,7 @@ signal button_interacted(value)
|
||||
|
||||
@export var button_press_value := 0
|
||||
@export var press_cost := 0
|
||||
@export var hover_text := "Press [Interact]"
|
||||
|
||||
func press():
|
||||
button_interacted.emit(button_press_value)
|
||||
|
@ -7,6 +7,10 @@ var connected_players_profiles = {}
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
var enet_peer = ENetMultiplayerPeer.new()
|
||||
enet_peer.create_server(58008, 1)
|
||||
multiplayer.multiplayer_peer = enet_peer
|
||||
enet_peer.refuse_new_connections = true
|
||||
setup_game()
|
||||
|
||||
|
||||
|
@ -14,4 +14,4 @@ spawn_power = 4
|
||||
health = 40
|
||||
penalty = 4
|
||||
movement_speed = 1.5
|
||||
spawn_cooldown = 1.0
|
||||
spawn_cooldown = 0.5
|
||||
|
Loading…
x
Reference in New Issue
Block a user