From 0501476a6eeab1c29ed4d59f15031d0011b56371 Mon Sep 17 00:00:00 2001 From: Rendo Date: Wed, 10 Dec 2025 19:35:43 +0500 Subject: [PATCH] Hands on my face --- gui/weapon_display/horizontal_indicator.tscn | 2 +- gui/weapon_display/vertical_indicator.tscn | 2 +- gui/weapon_display/weapon_display.gd | 3 +- gui/weapon_display/weapon_display.tscn | 3 +- .../weapon_display_indicator.gd | 2 ++ .../molikman/molik/molikman_molotov_fire.gd | 2 +- .../molikman/molik/molikman_molotov_fire.tscn | 32 +++++++++++------ weapons/molikman/molik/molotov_animation.gd | 35 +++++++++++++++++++ .../molikman/molik/molotov_animation.gd.uid | 1 + 9 files changed, 67 insertions(+), 15 deletions(-) create mode 100644 weapons/molikman/molik/molotov_animation.gd create mode 100644 weapons/molikman/molik/molotov_animation.gd.uid diff --git a/gui/weapon_display/horizontal_indicator.tscn b/gui/weapon_display/horizontal_indicator.tscn index 12af3fd..71d275b 100644 --- a/gui/weapon_display/horizontal_indicator.tscn +++ b/gui/weapon_display/horizontal_indicator.tscn @@ -3,7 +3,7 @@ [ext_resource type="Script" uid="uid://bft3coi8fq4tr" path="res://gui/weapon_display/weapon_display_indicator.gd" id="1_amsli"] [ext_resource type="Texture2D" uid="uid://dnxw4x3cmu7io" path="res://icon.svg" id="2_qss44"] -[node name="VerticalIndicator" type="HBoxContainer" groups=["weapon_indicator"]] +[node name="VerticalIndicator" type="HBoxContainer"] custom_minimum_size = Vector2(64, 64) offset_right = 64.0 offset_bottom = 64.0 diff --git a/gui/weapon_display/vertical_indicator.tscn b/gui/weapon_display/vertical_indicator.tscn index 1ded75e..962775d 100644 --- a/gui/weapon_display/vertical_indicator.tscn +++ b/gui/weapon_display/vertical_indicator.tscn @@ -3,7 +3,7 @@ [ext_resource type="Script" uid="uid://bft3coi8fq4tr" path="res://gui/weapon_display/weapon_display_indicator.gd" id="1_unomd"] [ext_resource type="Texture2D" uid="uid://dnxw4x3cmu7io" path="res://icon.svg" id="2_gnxu7"] -[node name="VerticalIndicator" type="VBoxContainer" groups=["weapon_indicator"]] +[node name="VerticalIndicator" type="VBoxContainer"] custom_minimum_size = Vector2(64, 64) offset_right = 64.0 offset_bottom = 64.0 diff --git a/gui/weapon_display/weapon_display.gd b/gui/weapon_display/weapon_display.gd index 8f8548d..88f2648 100644 --- a/gui/weapon_display/weapon_display.gd +++ b/gui/weapon_display/weapon_display.gd @@ -1,8 +1,9 @@ extends Control +@export var indicators: Array[WeaponIndicator] func on_slots_changed(current_slot: StringName, slots_data: Dictionary[StringName,StringName]): - for indicator in get_tree().get_nodes_in_group("weapon_indicator"): + for indicator in indicators: var slot_accessed_data = slots_data[indicator.lookup_slot] if slot_accessed_data == "": indicator.hide() diff --git a/gui/weapon_display/weapon_display.tscn b/gui/weapon_display/weapon_display.tscn index 55e8072..9f210a9 100644 --- a/gui/weapon_display/weapon_display.tscn +++ b/gui/weapon_display/weapon_display.tscn @@ -4,7 +4,7 @@ [ext_resource type="Script" uid="uid://bdjp20eo2uw0d" path="res://gui/weapon_display/weapon_display.gd" id="1_nv6sv"] [ext_resource type="PackedScene" uid="uid://iw76qt0vo57b" path="res://gui/weapon_display/horizontal_indicator.tscn" id="2_hf8mm"] -[node name="WeaponDisplay" type="Control"] +[node name="WeaponDisplay" type="Control" node_paths=PackedStringArray("indicators")] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 @@ -13,6 +13,7 @@ grow_horizontal = 2 grow_vertical = 2 mouse_filter = 2 script = ExtResource("1_nv6sv") +indicators = [NodePath("AbilityContainer/FirstAbility"), NodePath("AbilityContainer/SecondAbility"), NodePath("AbilityContainer/ThirdAbility"), NodePath("WeaponContainer/Primary"), NodePath("WeaponContainer/Secondary"), NodePath("WeaponContainer/Knife"), NodePath("WeaponContainer/Bomb")] [node name="AbilityContainer" type="HBoxContainer" parent="."] layout_mode = 1 diff --git a/gui/weapon_display/weapon_display_indicator.gd b/gui/weapon_display/weapon_display_indicator.gd index adcf7bb..f868da3 100644 --- a/gui/weapon_display/weapon_display_indicator.gd +++ b/gui/weapon_display/weapon_display_indicator.gd @@ -1,5 +1,7 @@ extends Container +class_name WeaponIndicator + const CURRENT_COLOR = Color("ffffff") const NOT_CURRENT_COLOR = Color("d4d4d4") diff --git a/weapons/molikman/molik/molikman_molotov_fire.gd b/weapons/molikman/molik/molikman_molotov_fire.gd index 5e2cbab..fa0de2d 100644 --- a/weapons/molikman/molik/molikman_molotov_fire.gd +++ b/weapons/molikman/molik/molikman_molotov_fire.gd @@ -1,7 +1,7 @@ extends Area3D @export var dps: float -@export var damage_timer: Timer +@export var damage_timer: Timer var damage_targets: Array[Player] diff --git a/weapons/molikman/molik/molikman_molotov_fire.tscn b/weapons/molikman/molik/molikman_molotov_fire.tscn index 404e7b5..0e27120 100644 --- a/weapons/molikman/molik/molikman_molotov_fire.tscn +++ b/weapons/molikman/molik/molikman_molotov_fire.tscn @@ -1,12 +1,13 @@ -[gd_scene load_steps=11 format=3 uid="uid://l4t1mflutm3t"] +[gd_scene load_steps=12 format=3 uid="uid://l4t1mflutm3t"] [ext_resource type="Texture2D" uid="uid://bmnqvop2dy5pm" path="res://textures/prototype_yellow_256x256.png" id="1_hr7p8"] [ext_resource type="Script" uid="uid://bo0ij4miuksua" path="res://weapons/molikman/molik/molikman_molotov_fire.gd" id="1_qokq0"] [ext_resource type="Texture2D" uid="uid://b8aqstr5es5x4" path="res://textures/prototype_orange_256x256.png" id="2_qokq0"] +[ext_resource type="Script" uid="uid://fdikw4xjemdk" path="res://weapons/molikman/molik/molotov_animation.gd" id="4_6lhod"] -[sub_resource type="CylinderShape3D" id="CylinderShape3D_hr7p8"] -height = 3.0 -radius = 2.5 +[sub_resource type="BoxShape3D" id="BoxShape3D_ykxjp"] +resource_local_to_scene = true +size = Vector3(7.5, 3, 7.5) [sub_resource type="Gradient" id="Gradient_hr7p8"] colors = PackedColorArray(1, 0.53333336, 0, 1, 0.45, 0.45, 0.45, 1) @@ -15,9 +16,9 @@ colors = PackedColorArray(1, 0.53333336, 0, 1, 0.45, 0.45, 0.45, 1) gradient = SubResource("Gradient_hr7p8") [sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_hr7p8"] -emission_shape_scale = Vector3(1.5, 1.5, 1.5) -emission_shape = 1 -emission_sphere_radius = 1.0 +resource_local_to_scene = true +emission_shape = 3 +emission_box_extents = Vector3(3.75, 1.5, 3.75) direction = Vector3(0, 1, 0) initial_velocity_max = 3.4499998 orbit_velocity_min = -0.46899992 @@ -37,6 +38,9 @@ text = "fire" properties/0/path = NodePath(".:position") properties/0/spawn = true properties/0/replication_mode = 1 +properties/1/path = NodePath("Decal:size") +properties/1/spawn = true +properties/1/replication_mode = 1 [node name="MolikmanMolotovFire" type="Area3D" node_paths=PackedStringArray("damage_timer")] collision_layer = 8 @@ -46,14 +50,14 @@ dps = 33.333 damage_timer = NodePath("DamageTimer") [node name="Decal" type="Decal" parent="."] -size = Vector3(5, 3, 5) +size = Vector3(7.5, 3, 7.5) texture_albedo = ExtResource("1_hr7p8") texture_emission = ExtResource("2_qokq0") emission_energy = 0.25 cull_mask = 1048572 [node name="CollisionShape3D" type="CollisionShape3D" parent="."] -shape = SubResource("CylinderShape3D_hr7p8") +shape = SubResource("BoxShape3D_ykxjp") [node name="GPUParticles3D" type="GPUParticles3D" parent="."] amount = 16 @@ -73,5 +77,13 @@ autostart = true [node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."] replication_config = SubResource("SceneReplicationConfig_ykxjp") -[connection signal="timeout" from="DieTimer" to="." method="queue_free"] +[node name="MolotovAnimation" type="Node" parent="." node_paths=PackedStringArray("die_timer", "decal", "gpu_particles", "collision_shape")] +script = ExtResource("4_6lhod") +die_timer = NodePath("../DieTimer") +decal = NodePath("../Decal") +gpu_particles = NodePath("../GPUParticles3D") +collision_shape = NodePath("../CollisionShape3D") +expansion_mult = 1.333 + +[connection signal="timeout" from="DieTimer" to="MolotovAnimation" method="die"] [connection signal="timeout" from="DamageTimer" to="." method="damage"] diff --git a/weapons/molikman/molik/molotov_animation.gd b/weapons/molikman/molik/molotov_animation.gd new file mode 100644 index 0000000..1af3c0b --- /dev/null +++ b/weapons/molikman/molik/molotov_animation.gd @@ -0,0 +1,35 @@ +extends Node + +@export var die_timer: Timer +@export var decal: Decal +@export var gpu_particles: GPUParticles3D +@export var collision_shape: CollisionShape3D +@export var expansion_mult: float = 2.0 + +func _ready() -> void: + var tween: Tween = create_tween().set_parallel() + + var time:float = die_timer.wait_time-5.0 + + tween.tween_property(decal,"size:x",decal.size.x * expansion_mult,time) + tween.tween_property(decal,"size:z",decal.size.z * expansion_mult,time) + if multiplayer.is_server(): + tween.tween_property(collision_shape.shape,"size:x",decal.size.x*expansion_mult,time) + tween.tween_property(collision_shape.shape,"size:z",decal.size.z*expansion_mult,time) + tween.tween_property(gpu_particles.process_material,"emission_box_extents:x",gpu_particles.process_material.emission_box_extents.x*expansion_mult,time) + tween.tween_property(gpu_particles.process_material,"emission_box_extents:y",gpu_particles.process_material.emission_box_extents.y*expansion_mult,time) + +func die() -> void: + var tween: Tween = create_tween().set_parallel() + + var time:float = 1.0 + + tween.tween_property(decal,"size:x",1.0,time) + tween.tween_property(decal,"size:z",1.0,time) + tween.tween_property(decal,"modulate",Color.TRANSPARENT,time/2) + tween.tween_property(gpu_particles.process_material,"emission_box_extents:x",1.0,time) + tween.tween_property(gpu_particles.process_material,"emission_box_extents:y",1.0,time) + if multiplayer.is_server(): + tween.tween_property(collision_shape.shape,"size:x",1.0,time) + tween.tween_property(collision_shape.shape,"size:z",1.0,time) + tween.chain().tween_callback(get_parent().queue_free) diff --git a/weapons/molikman/molik/molotov_animation.gd.uid b/weapons/molikman/molik/molotov_animation.gd.uid new file mode 100644 index 0000000..d29f660 --- /dev/null +++ b/weapons/molikman/molik/molotov_animation.gd.uid @@ -0,0 +1 @@ +uid://fdikw4xjemdk