forked from lampe-games/godot-open-rts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add rally flag, closes lampe-games#52
From now each unit factory shall have a RallyPoint node. if its position is (0,0,0) the rally has no effect, otherwise the units will be sended to its position
- Loading branch information
Showing
8 changed files
with
101 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
extends "res://source/match/units/actions/Action.gd" | ||
|
||
|
||
static func is_applicable(unit): | ||
return unit.find_child("RallyPoint") != null | ||
|
||
|
||
static func _set_rally_point(unit, rally_point: Vector3): | ||
var rally_node = unit.find_child("RallyPoint") | ||
rally_node.global_position = rally_point |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
extends Node3D | ||
|
||
@onready var _unit = get_parent() | ||
@onready var _line = get_node("Line") | ||
@onready var _marker = get_node("Marker") | ||
|
||
|
||
func _ready(): | ||
get_node("AnimationPlayer").play("idle") | ||
|
||
|
||
func _process(_delta): | ||
visible = _unit.is_in_group("selected_units") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
[gd_scene load_steps=6 format=3 uid="uid://b8jwlpdvxgrr6"] | ||
|
||
[ext_resource type="Script" path="res://source/match/units/traits/RallyPoint.gd" id="1_jne3g"] | ||
|
||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_k3k1b"] | ||
albedo_color = Color(0.054902, 1, 0.223529, 0.12549) | ||
emission_enabled = true | ||
emission = Color(0, 1, 0, 1) | ||
emission_energy_multiplier = 1.65 | ||
|
||
[sub_resource type="CylinderMesh" id="CylinderMesh_phq1d"] | ||
material = SubResource("StandardMaterial3D_k3k1b") | ||
top_radius = 0.2 | ||
bottom_radius = 0.2 | ||
height = 0.1 | ||
|
||
[sub_resource type="Animation" id="Animation_ymm6i"] | ||
resource_name = "idle" | ||
loop_mode = 1 | ||
tracks/0/type = "scale_3d" | ||
tracks/0/imported = false | ||
tracks/0/enabled = true | ||
tracks/0/path = NodePath("Marker") | ||
tracks/0/interp = 1 | ||
tracks/0/loop_wrap = true | ||
tracks/0/keys = PackedFloat32Array(0, 1, 1, 1, 1, 0.3, 1, 1.3, 1.3, 1.3, 0.7, 1, 0.6, 0.6, 0.6, 1, 1, 1, 1, 1) | ||
|
||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_bax6m"] | ||
_data = { | ||
"idle": SubResource("Animation_ymm6i") | ||
} | ||
|
||
[node name="RallyPoint" type="Node3D"] | ||
script = ExtResource("1_jne3g") | ||
|
||
[node name="Marker" type="MeshInstance3D" parent="."] | ||
transform = Transform3D(0.845995, 0, 0, 0, 0.845995, 0, 0, 0, 0.845995, 0, 0, 0) | ||
mesh = SubResource("CylinderMesh_phq1d") | ||
|
||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."] | ||
reset_on_save = false | ||
libraries = { | ||
"": SubResource("AnimationLibrary_bax6m") | ||
} |