80 lines
2.9 KiB
Text
80 lines
2.9 KiB
Text
[gd_scene load_steps=10 format=3 uid="uid://pev6k21vqaem"]
|
|
|
|
[ext_resource type="Script" path="res://scripts/Ship/ship.gd" id="1_82bba"]
|
|
[ext_resource type="PackedScene" uid="uid://bkd4gyhlota7l" path="res://scenes/Ships/Modules/Hulls/kamikaze_hull.tscn" id="2_165nu"]
|
|
[ext_resource type="PackedScene" uid="uid://mw4kwxoeqch3" path="res://scenes/Ships/Modules/Engines/engine.tscn" id="3_plu72"]
|
|
[ext_resource type="PackedScene" uid="uid://bunboi5ouscw8" path="res://scenes/Ships/Modules/Shields/shield.tscn" id="4_aos8x"]
|
|
[ext_resource type="Script" path="res://scripts/Ship/weapons.gd" id="5_8eieq"]
|
|
[ext_resource type="Script" path="res://scripts/State Machine/tree.gd" id="5_m8m3f"]
|
|
[ext_resource type="Script" path="res://scripts/State Machine/Kamikaze/WanderingState.gd" id="6_emcj1"]
|
|
[ext_resource type="Script" path="res://scripts/State Machine/Kamikaze/AttackState.gd" id="7_ilmkp"]
|
|
|
|
[sub_resource type="GDScript" id="GDScript_nif6i"]
|
|
resource_name = "health_shield_counter"
|
|
script/source = "extends Label
|
|
|
|
## Text with placeholder
|
|
@onready var unformatted_text: String = text
|
|
## Shortcut to get_parent().get_parent().get_parent()
|
|
@onready var ship: Ship = get_parent().get_parent().get_parent()
|
|
|
|
func _process(_delta):
|
|
text = unformatted_text.format([
|
|
round(ship.hull.hp * 100) / 100.0,
|
|
ship.hull.max_hp,
|
|
round(ship.shield.capacity * 100) / 100.0,
|
|
ship.shield.max_capacity
|
|
])
|
|
"
|
|
|
|
[node name="KamikazeShip" type="Node2D"]
|
|
script = ExtResource("1_82bba")
|
|
id = "SHIP_KAMIKAZE"
|
|
|
|
[node name="HullHolder" type="Node" parent="."]
|
|
|
|
[node name="Hull" parent="HullHolder" instance=ExtResource("2_165nu")]
|
|
collision_damage = 15.0
|
|
|
|
[node name="Engine" parent="." instance=ExtResource("3_plu72")]
|
|
|
|
[node name="Shield" parent="." instance=ExtResource("4_aos8x")]
|
|
max_capacity = 5
|
|
|
|
[node name="Weapons" type="Node2D" parent="."]
|
|
script = ExtResource("5_8eieq")
|
|
|
|
[node name="StateTree" type="Node" parent="." node_paths=PackedStringArray("state")]
|
|
script = ExtResource("5_m8m3f")
|
|
state = NodePath("WanderingState")
|
|
|
|
[node name="WanderingState" type="Node" parent="StateTree"]
|
|
script = ExtResource("6_emcj1")
|
|
|
|
[node name="UpdateDestination" type="Timer" parent="StateTree/WanderingState"]
|
|
wait_time = 10.0
|
|
|
|
[node name="AttackState" type="Node" parent="StateTree"]
|
|
script = ExtResource("7_ilmkp")
|
|
|
|
[node name="StatHolder" type="Node" parent="."]
|
|
|
|
[node name="StatCarry" type="Node2D" parent="StatHolder"]
|
|
|
|
[node name="HealthShield" type="Label" parent="StatHolder/StatCarry"]
|
|
offset_left = -49.0
|
|
offset_top = -133.0
|
|
offset_right = 50.0
|
|
offset_bottom = -84.0
|
|
text = "{0}/{1} HP
|
|
{2}/{3} SP"
|
|
horizontal_alignment = 1
|
|
vertical_alignment = 1
|
|
script = SubResource("GDScript_nif6i")
|
|
|
|
[node name="RemoteTransform2D" type="RemoteTransform2D" parent="."]
|
|
remote_path = NodePath("../StatHolder/StatCarry")
|
|
update_rotation = false
|
|
update_scale = false
|
|
|
|
[connection signal="timeout" from="StateTree/WanderingState/UpdateDestination" to="StateTree/WanderingState" method="update_destination"]
|