Tweaked some numbers to get a better "swarm"
This commit is contained in:
@@ -13,6 +13,7 @@ func _on_attack_timer_timeout() -> void:
|
||||
if ant is EnemyAnt and other_ant is not EnemyAnt:
|
||||
other_ant.hit(randi_range(0, ant.damage))
|
||||
attack.emit()
|
||||
if ant is SoldierAnt: return
|
||||
for area in get_overlapping_areas():
|
||||
if area.get_parent() is Building:
|
||||
var building := area.get_parent() as Building
|
||||
|
||||
@@ -5,5 +5,5 @@ extends MeshInstance3D
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
visible = ant.capacity > 0 and \
|
||||
ant.target == PlayerCamp.instance and \
|
||||
ant.target is PlayerCamp and \
|
||||
ant.source_target.type == type
|
||||
|
||||
@@ -15,8 +15,6 @@ height = 2.88419
|
||||
axis_lock_angular_x = true
|
||||
axis_lock_angular_z = true
|
||||
script = ExtResource("1_kehry")
|
||||
damage = 4
|
||||
max_health = 15
|
||||
speed = 3.0
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
@@ -24,7 +22,7 @@ transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 1.4
|
||||
shape = SubResource("CapsuleShape3D_bqyr6")
|
||||
|
||||
[node name="NavigationAgent3D" type="NavigationAgent3D" parent="."]
|
||||
target_desired_distance = 2.0
|
||||
target_desired_distance = 3.0
|
||||
avoidance_enabled = true
|
||||
debug_path_custom_color = Color(0.3, 0.381667, 1, 1)
|
||||
|
||||
@@ -38,9 +36,9 @@ texture = ExtResource("2_hdgws")
|
||||
|
||||
[node name="Skeleton3D" parent="enemy/EnemyAnt" index="0"]
|
||||
bones/0/rotation = Quaternion(-0.151731, -0.023891, -0.015694, 0.988008)
|
||||
bones/1/rotation = Quaternion(-0.448048, 0.00344809, -0.000394401, 0.894003)
|
||||
bones/1/rotation = Quaternion(-0.453618, 0.00738223, -0.000844401, 0.891166)
|
||||
bones/2/rotation = Quaternion(0.597894, 0.051707, -0.697194, 0.392135)
|
||||
bones/3/rotation = Quaternion(-0.268977, 0.0602213, -0.581107, 0.765729)
|
||||
bones/3/rotation = Quaternion(-0.261701, 0.0566905, -0.585419, 0.765234)
|
||||
bones/3/scale = Vector3(1, 1, 1)
|
||||
bones/4/rotation = Quaternion(-0.185361, 0.0767715, -0.304188, 0.931245)
|
||||
bones/4/scale = Vector3(1, 1, 1)
|
||||
@@ -55,10 +53,10 @@ bones/8/rotation = Quaternion(0.731112, 0.216438, -0.270013, 0.587982)
|
||||
bones/9/rotation = Quaternion(-0.147272, -0.690287, -0.291994, 0.64541)
|
||||
bones/10/rotation = Quaternion(0.035527, -0.0722718, -0.344413, 0.935358)
|
||||
bones/10/scale = Vector3(1, 1, 1)
|
||||
bones/11/rotation = Quaternion(0.582122, -0.384409, 0.688139, 0.199572)
|
||||
bones/11/rotation = Quaternion(0.58198, -0.38065, 0.688782, 0.204903)
|
||||
bones/12/rotation = Quaternion(-0.275331, -0.0633099, 0.577289, 0.766108)
|
||||
bones/12/scale = Vector3(1, 1, 1)
|
||||
bones/13/rotation = Quaternion(0.0216325, 0.352033, 0.113455, 0.928834)
|
||||
bones/13/rotation = Quaternion(0.0127256, 0.347415, 0.116465, 0.930364)
|
||||
bones/13/scale = Vector3(1, 1, 1)
|
||||
bones/14/position = Vector3(-0.131012, 0.4206, 0.0209323)
|
||||
bones/14/rotation = Quaternion(0.311801, -0.156763, 0.515707, 0.782465)
|
||||
@@ -71,7 +69,7 @@ bones/17/rotation = Quaternion(0.742166, -0.221688, 0.264848, 0.574369)
|
||||
bones/18/rotation = Quaternion(-0.156224, 0.731565, 0.301322, 0.59128)
|
||||
bones/19/rotation = Quaternion(0.035527, 0.0722718, 0.344413, 0.935358)
|
||||
bones/19/scale = Vector3(1, 1, 1)
|
||||
bones/20/rotation = Quaternion(0.000485378, 0.711083, 0.703105, -0.00183471)
|
||||
bones/20/rotation = Quaternion(0.00103909, 0.715589, 0.69851, -0.00392773)
|
||||
|
||||
[node name="AnimationTree" type="AnimationTree" parent="enemy"]
|
||||
tree_root = ExtResource("4_px4kn")
|
||||
|
||||
@@ -76,9 +76,9 @@ stretch_mode = 4
|
||||
|
||||
[node name="Skeleton3D" parent="soldier/SoldierAnt" index="0"]
|
||||
bones/0/rotation = Quaternion(-0.151731, -0.023891, -0.015694, 0.988008)
|
||||
bones/1/rotation = Quaternion(-0.454449, 0.00797132, -0.000911783, 0.890736)
|
||||
bones/1/rotation = Quaternion(-0.513811, 0.0510532, -0.00583962, 0.856363)
|
||||
bones/2/rotation = Quaternion(0.597894, 0.051707, -0.697194, 0.392135)
|
||||
bones/3/rotation = Quaternion(-0.26061, 0.0561613, -0.58606, 0.765155)
|
||||
bones/3/rotation = Quaternion(-0.179347, 0.0171244, -0.630019, 0.755392)
|
||||
bones/3/scale = Vector3(1, 1, 1)
|
||||
bones/4/rotation = Quaternion(-0.185361, 0.0767715, -0.304188, 0.931245)
|
||||
bones/4/scale = Vector3(1, 1, 1)
|
||||
@@ -93,10 +93,10 @@ bones/8/rotation = Quaternion(0.731112, 0.216438, -0.270013, 0.587982)
|
||||
bones/9/rotation = Quaternion(-0.147272, -0.690287, -0.291994, 0.64541)
|
||||
bones/10/rotation = Quaternion(0.035527, -0.0722718, -0.344413, 0.935358)
|
||||
bones/10/scale = Vector3(1, 1, 1)
|
||||
bones/11/rotation = Quaternion(0.581957, -0.380086, 0.688875, 0.2057)
|
||||
bones/11/rotation = Quaternion(0.578724, -0.337804, 0.693925, 0.263507)
|
||||
bones/12/rotation = Quaternion(-0.275331, -0.0633099, 0.577289, 0.766108)
|
||||
bones/12/scale = Vector3(1, 1, 1)
|
||||
bones/13/rotation = Quaternion(0.0113916, 0.34672, 0.116915, 0.930584)
|
||||
bones/13/rotation = Quaternion(-0.0864303, 0.293427, 0.149054, 0.940326)
|
||||
bones/13/scale = Vector3(1, 1, 1)
|
||||
bones/14/position = Vector3(-0.131012, 0.4206, 0.0209323)
|
||||
bones/14/rotation = Quaternion(0.311801, -0.156763, 0.515707, 0.782465)
|
||||
@@ -109,7 +109,7 @@ bones/17/rotation = Quaternion(0.742166, -0.221688, 0.264848, 0.574369)
|
||||
bones/18/rotation = Quaternion(-0.156224, 0.731565, 0.301322, 0.59128)
|
||||
bones/19/rotation = Quaternion(0.035527, 0.0722718, 0.344413, 0.935358)
|
||||
bones/19/scale = Vector3(1, 1, 1)
|
||||
bones/20/rotation = Quaternion(0.001122, 0.716261, 0.697819, -0.00424113)
|
||||
bones/20/rotation = Quaternion(0.00718503, 0.763404, 0.64531, -0.0271591)
|
||||
|
||||
[node name="AnimationTree" type="AnimationTree" parent="soldier"]
|
||||
tree_root = ExtResource("5_c6ikb")
|
||||
|
||||
@@ -43,3 +43,23 @@ func _on_target_reached() -> void:
|
||||
capacity = 0
|
||||
target = source_target
|
||||
go_to(target.global_position)
|
||||
|
||||
|
||||
func _on_area_3d_area_entered(area: Area3D) -> void:
|
||||
if area.get_parent() is CollectableResource:
|
||||
var resource := area.get_parent() as CollectableResource
|
||||
capacity = resource.collect(5)
|
||||
target = PlayerCamp.instance
|
||||
go_to(target.global_position)
|
||||
elif area.get_parent() is PlayerCamp:
|
||||
var camp := area.get_parent() as PlayerCamp
|
||||
match source_target.type:
|
||||
CollectableResource.ResourceType.FOOD:
|
||||
camp.food_capacity += capacity
|
||||
CollectableResource.ResourceType.WOOD:
|
||||
camp.wood_capacity += capacity
|
||||
CollectableResource.ResourceType.STONE:
|
||||
camp.stone_capacity += capacity
|
||||
capacity = 0
|
||||
target = source_target
|
||||
go_to(target.global_position)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=23 format=4 uid="uid://cbc61u4p4mn05"]
|
||||
[gd_scene load_steps=24 format=4 uid="uid://cbc61u4p4mn05"]
|
||||
|
||||
[ext_resource type="Script" path="res://entities/ants/worker_ant.gd" id="1_hmrg3"]
|
||||
[ext_resource type="PackedScene" uid="uid://v2kcdfr5npqb" path="res://assets/fbx/base_ant.fbx" id="2_b8awe"]
|
||||
@@ -123,6 +123,9 @@ fill_to = Vector2(1, 1)
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_uj2kw"]
|
||||
texture = SubResource("GradientTexture2D_upbt3")
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_6s5hc"]
|
||||
size = Vector3(3, 3, 3)
|
||||
|
||||
[node name="WorkerAnt" type="CharacterBody3D"]
|
||||
axis_lock_angular_x = true
|
||||
axis_lock_angular_z = true
|
||||
@@ -136,7 +139,7 @@ shape = SubResource("CapsuleShape3D_bqyr6")
|
||||
|
||||
[node name="Skeleton3D" parent="base_ant/BaseAnt" index="0"]
|
||||
bones/0/rotation = Quaternion(9.9051e-05, -8.31996e-29, 6.6946e-17, 1)
|
||||
bones/1/rotation = Quaternion(0.0811275, 0.000963642, -0.206745, 0.975025)
|
||||
bones/1/rotation = Quaternion(0.0536049, -3.59708e-18, -7.87621e-17, 0.998562)
|
||||
bones/3/rotation = Quaternion(0.541099, 0.16567, -0.351117, 0.745978)
|
||||
bones/4/rotation = Quaternion(-0.275331, 0.0633099, -0.577289, 0.766108)
|
||||
bones/7/rotation = Quaternion(0.674429, 0.240017, -0.247256, 0.652994)
|
||||
@@ -152,7 +155,7 @@ bones/24/rotation = Quaternion(0.0469251, 0.0954517, 0.66037, 0.74337)
|
||||
bones/27/rotation = Quaternion(0, 0, 1, 0)
|
||||
|
||||
[node name="BoneAttachment3D" type="BoneAttachment3D" parent="base_ant/BaseAnt/Skeleton3D" index="0"]
|
||||
transform = Transform3D(0.914511, 0.40332, -0.0316663, -0.403001, 0.901318, -0.158797, -0.0355045, 0.157983, 0.986803, 1.16994e-19, 0.00431615, 0.00552689)
|
||||
transform = Transform3D(1, 2.3791e-17, -1.2808e-18, -2.37911e-17, 0.994232, -0.107253, -1.27823e-18, 0.107253, 0.994232, 1.16994e-19, 0.00431615, 0.00552689)
|
||||
bone_name = "Head"
|
||||
bone_idx = 1
|
||||
|
||||
@@ -189,7 +192,7 @@ anim_player = NodePath("../AnimationPlayer")
|
||||
parameters/blend_position = 0.0
|
||||
|
||||
[node name="NavigationAgent3D" type="NavigationAgent3D" parent="."]
|
||||
target_desired_distance = 2.0
|
||||
target_desired_distance = 3.0
|
||||
avoidance_enabled = true
|
||||
debug_path_custom_color = Color(0.3, 0.381667, 1, 1)
|
||||
|
||||
@@ -224,9 +227,17 @@ texture = ExtResource("6_l4m2r")
|
||||
|
||||
[node name="Node3D" parent="." instance=ExtResource("8_th62q")]
|
||||
|
||||
[node name="Area3D" type="Area3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.672495, -2.70862)
|
||||
monitorable = false
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"]
|
||||
shape = SubResource("BoxShape3D_6s5hc")
|
||||
|
||||
[connection signal="mouse_entered" from="." to="base_ant/BaseAnt/Skeleton3D/Head2" method="_on_mouse_entered"]
|
||||
[connection signal="mouse_exited" from="." to="base_ant/BaseAnt/Skeleton3D/Head2" method="_on_mouse_exited"]
|
||||
[connection signal="navigation_finished" from="NavigationAgent3D" to="." method="_on_target_reached"]
|
||||
[connection signal="velocity_computed" from="NavigationAgent3D" to="." method="_on_velocity_computed"]
|
||||
[connection signal="area_entered" from="Area3D" to="." method="_on_area_3d_area_entered"]
|
||||
|
||||
[editable path="base_ant"]
|
||||
|
||||
@@ -3,8 +3,8 @@ class_name PlayerCamp extends Building
|
||||
static var instance:PlayerCamp
|
||||
|
||||
var food_capacity:=100
|
||||
var wood_capacity:=100
|
||||
var stone_capacity:=100
|
||||
var wood_capacity:=40
|
||||
var stone_capacity:=40
|
||||
|
||||
var active_indicator:Indicator
|
||||
|
||||
@@ -24,7 +24,7 @@ func on_interact(object:CollisionObject3D, point:Vector3)->void:
|
||||
buy_ant(40, point, soldier_scene)
|
||||
if active_indicator.type == Indicator.IndicatorType.BUILDING_BALISTA:
|
||||
var ballista_scene := load("res://entities/buildings/ballista.tscn") as PackedScene
|
||||
buy_building(40, 40, point, ballista_scene)
|
||||
buy_building(20, 20, point, ballista_scene)
|
||||
|
||||
func _on_worker_pressed() -> void:
|
||||
if active_indicator != null: active_indicator.queue_free()
|
||||
|
||||
@@ -54,7 +54,7 @@ script/source = "extends Panel
|
||||
func _process(delta: float) -> void:
|
||||
$HBoxContainer/Worker/Worker.disabled = PlayerCamp.instance.food_capacity < 20
|
||||
$HBoxContainer/Soldier/Soldier.disabled = PlayerCamp.instance.food_capacity < 40
|
||||
$HBoxContainer/Balista/AspectRatioContainer/balista.disabled = PlayerCamp.instance.stone_capacity < 40 or PlayerCamp.instance.wood_capacity < 40
|
||||
$HBoxContainer/Balista/AspectRatioContainer/balista.disabled = PlayerCamp.instance.stone_capacity < 20 or PlayerCamp.instance.wood_capacity < 20
|
||||
"
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_hx5fy"]
|
||||
@@ -261,7 +261,7 @@ expand_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="RecruitOptions/HBoxContainer/Balista/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "40"
|
||||
text = "20"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="Healthbar" parent="." instance=ExtResource("13_0oymu")]
|
||||
|
||||
@@ -16,4 +16,4 @@ func collect(amount:int)->int:
|
||||
|
||||
func _on_tick() -> void:
|
||||
if capacity < 100: return
|
||||
capacity += 1
|
||||
capacity += 10
|
||||
|
||||
@@ -34,6 +34,13 @@ layers = 2
|
||||
billboard = 1
|
||||
texture = ExtResource("4_w3ttc")
|
||||
|
||||
[node name="Area3D" type="Area3D" parent="."]
|
||||
monitoring = false
|
||||
|
||||
[node name="CollisionShape3D2" type="CollisionShape3D" parent="Area3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.442429, 0)
|
||||
shape = SubResource("SphereShape3D_g8vog")
|
||||
|
||||
[connection signal="mouse_entered" from="." to="food/Food" method="_on_mouse_entered"]
|
||||
[connection signal="mouse_exited" from="." to="food/Food" method="_on_mouse_exited"]
|
||||
[connection signal="timeout" from="Timer" to="." method="_on_tick"]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://kslywe6neejo"]
|
||||
[gd_scene load_steps=6 format=3 uid="uid://kslywe6neejo"]
|
||||
|
||||
[ext_resource type="Script" path="res://entities/resources/collectable_resource.gd" id="1_ybx4f"]
|
||||
[ext_resource type="PackedScene" uid="uid://rheyik3n6qia" path="res://assets/fbx/rock.fbx" id="2_uwrg3"]
|
||||
@@ -7,6 +7,9 @@
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_2ifhi"]
|
||||
radius = 1.9217
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_gjw2c"]
|
||||
radius = 2.0
|
||||
|
||||
[node name="StoneResource" type="StaticBody3D" groups=["NavmeshTargets"]]
|
||||
script = ExtResource("1_ybx4f")
|
||||
type = 1
|
||||
@@ -27,6 +30,13 @@ layers = 2
|
||||
billboard = 1
|
||||
texture = ExtResource("3_uq1d7")
|
||||
|
||||
[node name="Area3D" type="Area3D" parent="."]
|
||||
monitoring = false
|
||||
|
||||
[node name="CollisionShape3D2" type="CollisionShape3D" parent="Area3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.442429, 0)
|
||||
shape = SubResource("SphereShape3D_gjw2c")
|
||||
|
||||
[connection signal="timeout" from="Timer" to="." method="_on_tick"]
|
||||
|
||||
[editable path="rock"]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://kh5xmgawk26n"]
|
||||
[gd_scene load_steps=7 format=3 uid="uid://kh5xmgawk26n"]
|
||||
|
||||
[ext_resource type="Script" path="res://entities/resources/collectable_resource.gd" id="1_khlta"]
|
||||
[ext_resource type="PackedScene" uid="uid://87uikru2r8pc" path="res://assets/fbx/plant.fbx" id="2_u6krj"]
|
||||
@@ -10,6 +10,9 @@ radius = 2.49866
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_do68j"]
|
||||
albedo_color = Color(0.53, 0.366053, 0.1908, 1)
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_gc3ak"]
|
||||
radius = 2.0
|
||||
|
||||
[node name="WoodResource" type="StaticBody3D" groups=["NavmeshTargets"]]
|
||||
script = ExtResource("1_khlta")
|
||||
type = 2
|
||||
@@ -34,6 +37,13 @@ layers = 2
|
||||
billboard = 1
|
||||
texture = ExtResource("3_i5i26")
|
||||
|
||||
[node name="Area3D" type="Area3D" parent="."]
|
||||
monitoring = false
|
||||
|
||||
[node name="CollisionShape3D2" type="CollisionShape3D" parent="Area3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.442429, 0)
|
||||
shape = SubResource("SphereShape3D_gc3ak")
|
||||
|
||||
[connection signal="timeout" from="Timer" to="." method="_on_tick"]
|
||||
|
||||
[editable path="plant"]
|
||||
|
||||
Reference in New Issue
Block a user