Skip to content
Snippets Groups Projects
Commit 338f8eac authored by STAVRIDIS ADONIS's avatar STAVRIDIS ADONIS :speech_balloon:
Browse files

#141 added the bling my man

parent 647f44fd
Branches
Tags
No related merge requests found
...@@ -6,12 +6,16 @@ var hp:int ...@@ -6,12 +6,16 @@ var hp:int
var posPv var posPv
var player var player
var my_id var my_id
var healVfx:Resource
var healSfx:Resource
func _ready(): func _ready():
hp = 0 hp = 0
posPv = Vector3(0,0,0) posPv = Vector3(0,0,0)
player = get_node("../../") player = get_node("../../")
my_id = get_tree().get_network_unique_id() my_id = get_tree().get_network_unique_id()
healVfx = preload("res://entities/vfx/Heal.tscn")
healSfx = preload("res://entities/sfx/healSfx.tscn")
update_printed_hp(hp) update_printed_hp(hp)
...@@ -27,6 +31,11 @@ func _process(_delta): ...@@ -27,6 +31,11 @@ func _process(_delta):
# update the current hp labels # update the current hp labels
func update_printed_hp(newHp:int): func update_printed_hp(newHp:int):
if (newHp < hp):
var particle = healVfx.instance()
player.get_node("Model").add_child(particle)
var sound = healSfx.instance()
player.get_node("Model").add_child(sound)
hp = newHp hp = newHp
if str(my_id) != str(player.get_name()): if str(my_id) != str(player.get_name()):
set_text(String(hp) + ' %') set_text(String(hp) + ' %')
......
[gd_scene load_steps=13 format=2] [gd_scene load_steps=15 format=2]
   
[ext_resource path="res://entities/items/item.gd" type="Script" id=1] [ext_resource path="res://entities/items/item.gd" type="Script" id=1]
[ext_resource path="res://entities/vfx/Item.tscn" type="PackedScene" id=2]
   
[sub_resource type="Shader" id=1] [sub_resource type="Shader" id=1]
resource_name = "Shader Nodetree" resource_name = "Shader Nodetree"
...@@ -292,14 +293,57 @@ surfaces/4 = { ...@@ -292,14 +293,57 @@ surfaces/4 = {
"vertex_count": 48 "vertex_count": 48
} }
   
[sub_resource type="Animation" id=12]
resource_name = "beerAnimation"
length = 2.0
loop = true
tracks/0/type = "transform"
tracks/0/path = NodePath(".")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = PoolRealArray( )
tracks/1/type = "value"
tracks/1/path = NodePath(".:translation")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0, 1, 2 ),
"transitions": PoolRealArray( 1, 1, 1 ),
"update": 0,
"values": [ Vector3( 0, 0, 0 ), Vector3( 0, 0.3, 0 ), Vector3( 0, 0, 0 ) ]
}
tracks/2/type = "value"
tracks/2/path = NodePath(".:rotation_degrees")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0, 2 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Vector3( 0, -90, 0 ), Vector3( 0, 270, 0 ) ]
}
[node name="beer" type="Spatial"] [node name="beer" type="Spatial"]
script = ExtResource( 1 ) script = ExtResource( 1 )
   
[node name="Cylinder" type="MeshInstance" parent="."] [node name="Cylinder" type="MeshInstance" parent="."]
transform = Transform( -1.62921e-07, 0, -1, 0, 1, 0, 1, 0, -1.62921e-07, 0, 0, 0 ) transform = Transform( 0.66563, 0, 0.746282, 0, 1, 0, -0.746282, 0, 0.66563, 0, 0.230449, 0 )
mesh = SubResource( 11 ) mesh = SubResource( 11 )
material/0 = null material/0 = null
material/1 = null material/1 = null
material/2 = null material/2 = null
material/3 = null material/3 = null
material/4 = null material/4 = null
[node name="AnimationPlayer" type="AnimationPlayer" parent="Cylinder"]
autoplay = "beerAnimation"
anims/beerAnimation = SubResource( 12 )
[node name="ItemStar" parent="Cylinder" instance=ExtResource( 2 )]
transform = Transform( 0.319264, 0, 0, 0, 0.319264, 0, 0, 0, 0.319264, 0, 0.437919, 0 )
[gd_scene load_steps=9 format=2] [gd_scene load_steps=11 format=2]
[ext_resource path="res://entities/items/item.gd" type="Script" id=1] [ext_resource path="res://entities/items/item.gd" type="Script" id=1]
[ext_resource path="res://entities/vfx/Item.tscn" type="PackedScene" id=2]
[sub_resource type="Shader" id=1] [sub_resource type="Shader" id=1]
resource_name = "Shader Nodetree" resource_name = "Shader Nodetree"
...@@ -365,12 +366,54 @@ surfaces/2 = { ...@@ -365,12 +366,54 @@ surfaces/2 = {
"vertex_count": 372 "vertex_count": 372
} }
[sub_resource type="Animation" id=8]
resource_name = "hotdogAnimation"
length = 2.0
loop = true
tracks/0/type = "transform"
tracks/0/path = NodePath(".")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = PoolRealArray( )
tracks/1/type = "value"
tracks/1/path = NodePath(".:translation")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0, 1, 2 ),
"transitions": PoolRealArray( 1, 1, 1 ),
"update": 0,
"values": [ Vector3( 0, 0.13317, 0 ), Vector3( 0, 0.322228, 0 ), Vector3( 0, 0.13317, 0 ) ]
}
tracks/2/type = "value"
tracks/2/path = NodePath(".:rotation_degrees")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0, 2 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Vector3( 21.544, -90, -3.68531e-06 ), Vector3( 21.544, 270, 0 ) ]
}
[node name="hot_dog" type="Spatial"] [node name="hot_dog" type="Spatial"]
script = ExtResource( 1 ) script = ExtResource( 1 )
[node name="Food Island002" type="MeshInstance" parent="."] [node name="Cylinder" type="MeshInstance" parent="."]
transform = Transform( -1.62921e-07, 0, -1, 0, 1, 0, 1, 0, -1.62921e-07, 0, 0, 0 ) transform = Transform( -0.872223, -0.179608, -0.454937, -1.00905e-08, 0.930136, -0.367216, 0.489108, -0.320294, -0.811286, 0, 0.196944, 0 )
mesh = SubResource( 7 ) mesh = SubResource( 7 )
material/0 = null material/0 = null
material/1 = null material/1 = null
material/2 = null material/2 = null
[node name="AnimationPlayer" type="AnimationPlayer" parent="Cylinder"]
autoplay = "hotdogAnimation"
anims/hotdogAnimation = SubResource( 8 )
[node name="ItemStar" parent="Cylinder" instance=ExtResource( 2 )]
File added
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/heal.wav-0106b3ec1d0d39dd323787691d545751.sample"
[deps]
source_file="res://entities/sfx/heal.wav"
dest_files=[ "res://.import/heal.wav-0106b3ec1d0d39dd323787691d545751.sample" ]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop=false
compress/mode=0
[gd_scene load_steps=3 format=2]
[ext_resource path="res://entities/sfx/heal.wav" type="AudioStream" id=1]
[ext_resource path="res://entities/sfx/sfx.gd" type="Script" id=2]
[node name="healSfx" type="AudioStreamPlayer3D"]
stream = ExtResource( 1 )
autoplay = true
script = ExtResource( 2 )
[gd_scene load_steps=10 format=2]
[ext_resource path="res://entities/vfx/plus.png" type="Texture" id=1]
[ext_resource path="res://entities/vfx/vfx.gd" type="Script" id=2]
[sub_resource type="SpatialMaterial" id=1]
flags_transparent = true
flags_unshaded = true
vertex_color_use_as_albedo = true
params_billboard_mode = 1
albedo_texture = ExtResource( 1 )
[sub_resource type="Gradient" id=2]
colors = PoolColorArray( 0.13092, 0.698242, 0.262778, 1, 0.218678, 0.948242, 0.0481529, 1 )
[sub_resource type="GradientTexture" id=3]
gradient = SubResource( 2 )
width = 1024
[sub_resource type="Curve" id=4]
_data = [ Vector2( 0, 0 ), 0.0, 0.0, 0, 0, Vector2( 0.253165, 1 ), 0.0, 0.0, 0, 0, Vector2( 1, 0.0113636 ), -1.49713, 0.0, 0, 0 ]
[sub_resource type="CurveTexture" id=5]
width = 128
curve = SubResource( 4 )
[sub_resource type="ParticlesMaterial" id=6]
emission_shape = 1
emission_sphere_radius = 1.0
spread = 90.0
gravity = Vector3( 0, 0, 0 )
initial_velocity = 1.0
scale_curve = SubResource( 5 )
color_ramp = SubResource( 3 )
[sub_resource type="QuadMesh" id=7]
size = Vector2( 0.25, 0.25 )
[node name="Heal" type="Particles"]
transform = Transform( -4.88762e-08, 0.3, 0, -0.3, -4.88762e-08, 0, 0, 0, 0.3, 0, 0.85, 0 )
material_override = SubResource( 1 )
emitting = false
amount = 10
lifetime = 0.5
one_shot = true
local_coords = false
process_material = SubResource( 6 )
draw_pass_1 = SubResource( 7 )
script = ExtResource( 2 )
[gd_scene load_steps=9 format=2]
[ext_resource path="res://entities/vfx/star.png" type="Texture" id=1]
[sub_resource type="SpatialMaterial" id=1]
flags_transparent = true
flags_unshaded = true
vertex_color_use_as_albedo = true
params_billboard_mode = 1
albedo_texture = ExtResource( 1 )
[sub_resource type="Gradient" id=2]
offsets = PoolRealArray( 0.451852, 1 )
colors = PoolColorArray( 0.955078, 0.711951, 0.0261154, 1, 0.927734, 0.92428, 0.0434875, 1 )
[sub_resource type="GradientTexture" id=3]
gradient = SubResource( 2 )
[sub_resource type="Curve" id=4]
max_value = 0.5
_data = [ Vector2( 0, 0.5 ), 0.0, 0.0, 0, 0, Vector2( 0.835443, 0.346591 ), -0.746909, -0.746909, 0, 0, Vector2( 1, 0 ), -3.43381, 0.0, 0, 0 ]
[sub_resource type="CurveTexture" id=5]
width = 128
curve = SubResource( 4 )
[sub_resource type="ParticlesMaterial" id=6]
emission_shape = 1
emission_sphere_radius = 1.0
direction = Vector3( 0, 1, 0 )
spread = 40.0
gravity = Vector3( 0, -2, 0 )
initial_velocity = 5.0
initial_velocity_random = 0.25
scale = 0.2
scale_curve = SubResource( 5 )
color_ramp = SubResource( 3 )
[sub_resource type="QuadMesh" id=7]
size = Vector2( 0.2, 0.2 )
[node name="ItemStar" type="Particles"]
transform = Transform( 0.319264, 0, 0, 0, 0.319264, 0, 0, 0, 0.319264, 0, 0, 0 )
material_override = SubResource( 1 )
amount = 5
randomness = 0.5
visibility_aabb = AABB( -4, -3.44923, -4, 8, 6.89846, 8 )
local_coords = false
process_material = SubResource( 6 )
draw_pass_1 = SubResource( 7 )
client/entities/vfx/plus.png

7.26 KiB

[remap]
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/plus.png-b3680ffdbad3375cbc1cf9eac37f6a39.s3tc.stex"
path.etc2="res://.import/plus.png-b3680ffdbad3375cbc1cf9eac37f6a39.etc2.stex"
metadata={
"imported_formats": [ "s3tc", "etc2" ],
"vram_texture": true
}
[deps]
source_file="res://entities/vfx/plus.png"
dest_files=[ "res://.import/plus.png-b3680ffdbad3375cbc1cf9eac37f6a39.s3tc.stex", "res://.import/plus.png-b3680ffdbad3375cbc1cf9eac37f6a39.etc2.stex" ]
[params]
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=true
flags/filter=true
flags/mipmaps=true
flags/anisotropic=false
flags/srgb=1
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0
client/entities/vfx/star.png

5.07 KiB

[remap]
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/star.png-7b039bb73b1d6bb5d025875607ed811d.s3tc.stex"
path.etc2="res://.import/star.png-7b039bb73b1d6bb5d025875607ed811d.etc2.stex"
metadata={
"imported_formats": [ "s3tc", "etc2" ],
"vram_texture": true
}
[deps]
source_file="res://entities/vfx/star.png"
dest_files=[ "res://.import/star.png-7b039bb73b1d6bb5d025875607ed811d.s3tc.stex", "res://.import/star.png-7b039bb73b1d6bb5d025875607ed811d.etc2.stex" ]
[params]
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=true
flags/filter=true
flags/mipmaps=true
flags/anisotropic=false
flags/srgb=1
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0
...@@ -4,7 +4,7 @@ extends Particles ...@@ -4,7 +4,7 @@ extends Particles
func _ready(): func _ready():
self.emitting = true self.emitting = true
var waitTimer = Timer.new() var waitTimer = Timer.new()
waitTimer.set_wait_time(1) waitTimer.set_wait_time(2)
waitTimer.set_one_shot(true) waitTimer.set_one_shot(true)
self.add_child(waitTimer) self.add_child(waitTimer)
waitTimer.start() waitTimer.start()
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment