From f1df203a76c72fed81f33c3fa4a6e51d83498088 Mon Sep 17 00:00:00 2001 From: anyreso Date: Sun, 12 May 2024 21:57:44 -0400 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20=20small=20refactoring?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entities/buildings/flag_stand.tscn | 28 ------------------- .../explosive_damage.tscn | 2 +- .../explosive_damage_component.gd | 0 entities/components/health_component.gd | 3 +- .../weapons/grenade_launcher/explosion.tscn | 2 +- .../space_gun/projectile_explosion.tscn | 2 +- maps/desert/desert.tscn | 10 ++----- 7 files changed, 8 insertions(+), 39 deletions(-) delete mode 100644 entities/buildings/flag_stand.tscn rename entities/components/{ => explosive_damage}/explosive_damage.tscn (90%) rename entities/components/{ => explosive_damage}/explosive_damage_component.gd (100%) diff --git a/entities/buildings/flag_stand.tscn b/entities/buildings/flag_stand.tscn deleted file mode 100644 index c625843..0000000 --- a/entities/buildings/flag_stand.tscn +++ /dev/null @@ -1,28 +0,0 @@ -[gd_scene load_steps=2 format=3 uid="uid://brux62vritay"] - -[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_pi2gw"] -albedo_color = Color(0.666569, 0.666569, 0.666569, 1) -metallic = 0.51 -roughness = 0.63 - -[node name="FlagStand" type="Node3D"] - -[node name="Union" type="CSGCombiner3D" parent="."] -material_override = SubResource("StandardMaterial3D_pi2gw") -use_collision = true -collision_layer = 2147483649 -collision_mask = 0 - -[node name="CSGCylinder3D" type="CSGCylinder3D" parent="Union"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0) -sides = 32 - -[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="Union"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.441611, 0) -radius = 2.5 -height = 1.5 -sides = 32 - -[node name="CSGBox3D" type="CSGBox3D" parent="Union"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.01172, 0) -size = Vector3(0.1, 0.025, 0.1) diff --git a/entities/components/explosive_damage.tscn b/entities/components/explosive_damage/explosive_damage.tscn similarity index 90% rename from entities/components/explosive_damage.tscn rename to entities/components/explosive_damage/explosive_damage.tscn index d2f7165..f976608 100644 --- a/entities/components/explosive_damage.tscn +++ b/entities/components/explosive_damage/explosive_damage.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=3 format=3 uid="uid://qb5sf7awdeui"] -[ext_resource type="Script" path="res://entities/components/explosive_damage_component.gd" id="1_alx3x"] +[ext_resource type="Script" path="res://entities/components/explosive_damage/explosive_damage_component.gd" id="1_alx3x"] [sub_resource type="SphereShape3D" id="SphereShape3D_1htx7"] radius = 5.0 diff --git a/entities/components/explosive_damage_component.gd b/entities/components/explosive_damage/explosive_damage_component.gd similarity index 100% rename from entities/components/explosive_damage_component.gd rename to entities/components/explosive_damage/explosive_damage_component.gd diff --git a/entities/components/health_component.gd b/entities/components/health_component.gd index f35f5e4..56d480a 100644 --- a/entities/components/health_component.gd +++ b/entities/components/health_component.gd @@ -14,12 +14,13 @@ # along with this program. If not, see . class_name HealthComponent extends Area3D +@export var match_participant : MatchParticipant + @export var max_health : float = 1. @export var health : float = 1.: set(value): health = value health_changed.emit(value) -@export var match_participant : MatchParticipant signal health_zeroed(killer_id : int) signal health_changed(value : float) diff --git a/entities/weapons/grenade_launcher/explosion.tscn b/entities/weapons/grenade_launcher/explosion.tscn index 4e5e833..74542b6 100644 --- a/entities/weapons/grenade_launcher/explosion.tscn +++ b/entities/weapons/grenade_launcher/explosion.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=9 format=3 uid="uid://bb43ae1f5j8lw"] [ext_resource type="Script" path="res://entities/weapons/grenade_launcher/explosion.gd" id="1_xb4jo"] -[ext_resource type="PackedScene" uid="uid://qb5sf7awdeui" path="res://entities/components/explosive_damage.tscn" id="2_rq8du"] +[ext_resource type="PackedScene" uid="uid://qb5sf7awdeui" path="res://entities/components/explosive_damage/explosive_damage.tscn" id="2_rq8du"] [ext_resource type="Material" uid="uid://v7s5w3uw4hmb" path="res://entities/weapons/grenade_launcher/assets/resources/particle_process_material_sparks.tres" id="3_4u6ue"] [ext_resource type="Material" uid="uid://bbqjhgs44rnss" path="res://entities/weapons/grenade_launcher/assets/resources/material_flare.tres" id="4_634rq"] [ext_resource type="Material" uid="uid://cykwajkj5aaqx" path="res://entities/weapons/grenade_launcher/assets/resources/particle_process_material_flash.tres" id="5_mntrp"] diff --git a/entities/weapons/space_gun/projectile_explosion.tscn b/entities/weapons/space_gun/projectile_explosion.tscn index 7331386..60e481e 100644 --- a/entities/weapons/space_gun/projectile_explosion.tscn +++ b/entities/weapons/space_gun/projectile_explosion.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=8 format=3 uid="uid://8atq41j7wd55"] [ext_resource type="Script" path="res://entities/weapons/space_gun/projectile_explosion.gd" id="1_fp5td"] -[ext_resource type="PackedScene" uid="uid://qb5sf7awdeui" path="res://entities/components/explosive_damage.tscn" id="2_js0ht"] +[ext_resource type="PackedScene" uid="uid://qb5sf7awdeui" path="res://entities/components/explosive_damage/explosive_damage.tscn" id="2_js0ht"] [sub_resource type="Curve" id="Curve_rg204"] _data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] diff --git a/maps/desert/desert.tscn b/maps/desert/desert.tscn index 4f5e605..db183c0 100644 --- a/maps/desert/desert.tscn +++ b/maps/desert/desert.tscn @@ -1,10 +1,9 @@ -[gd_scene load_steps=6 format=3 uid="uid://btlkog4b87p4x"] +[gd_scene load_steps=5 format=3 uid="uid://btlkog4b87p4x"] [ext_resource type="Terrain3DStorage" uid="uid://wgmg245njt8e" path="res://maps/desert/resources/storage.res" id="1_lmk23"] [ext_resource type="Terrain3DMaterial" uid="uid://c3isipd4wqxpk" path="res://maps/desert/resources/material.tres" id="2_n44fh"] [ext_resource type="Terrain3DTextureList" uid="uid://d1j24k8sq8qpj" path="res://maps/desert/resources/textures.tres" id="3_w1yus"] [ext_resource type="Environment" uid="uid://nw62ce5cglvs" path="res://maps/desert/resources/env.tres" id="4_m7p64"] -[ext_resource type="PackedScene" uid="uid://brux62vritay" path="res://entities/buildings/flag_stand.tscn" id="5_7ta6y"] [node name="Desert" type="Terrain3D"] storage = ExtResource("1_lmk23") @@ -29,10 +28,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1024, 172.13, 1024) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1161.42, 174.535, 909.901) [node name="FlagStand" type="Marker3D" parent="."] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 895.356, 147.271, 888.261) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 895.356, 144.835, 888.261) [node name="Camera3D" type="Camera3D" parent="."] -transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 1024, 920, 1024) - -[node name="FlagPillar" parent="." instance=ExtResource("5_7ta6y")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 895.366, 145.291, 888.267) +transform = Transform3D(-0.642788, 0.586824, -0.492404, 0, 0.642788, 0.766044, 0.766045, 0.492404, -0.413176, 800, 320, 846.595)