伤害跳字
parent
7ce41603a9
commit
2d21dba415
@ -0,0 +1,17 @@
|
||||
[gd_resource type="Resource" script_class="AttackCfg" load_steps=2 format=3 uid="uid://cae3dxpuqfcux"]
|
||||
|
||||
[ext_resource type="Script" path="res://script/config/attack_cfg.gd" id="1_lveis"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_lveis")
|
||||
damage_rate = 1.0
|
||||
break_level = 2
|
||||
stun_attack = 10.0
|
||||
hit_back_speed = 3.0
|
||||
hit_back_duration = 0.05
|
||||
hit_up_speed = 1.0
|
||||
hit_up_duration = 0.05
|
||||
pause_time = 0.1
|
||||
is_floating = false
|
||||
is_hit_down = false
|
||||
is_rebound = false
|
||||
@ -0,0 +1,11 @@
|
||||
[gd_resource type="Resource" script_class="ShieldCfg" load_steps=2 format=3 uid="uid://h1curvk64vm3"]
|
||||
|
||||
[ext_resource type="Script" path="res://script/config/shield_cfg.gd" id="1_vkw85"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_vkw85")
|
||||
shield_max = 0.0
|
||||
recover_speed = 0.0
|
||||
recover_cd = 0.0
|
||||
break_level_on = 0
|
||||
break_level_off = 0
|
||||
@ -0,0 +1,250 @@
|
||||
[gd_scene load_steps=10 format=3 uid="uid://cxyly5ithpv5i"]
|
||||
|
||||
[ext_resource type="Script" path="res://script/ui/headbar/hit_text.gd" id="1_re03i"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_b5roo"]
|
||||
length = 0.001
|
||||
|
||||
[sub_resource type="Animation" id="Animation_c3cdy"]
|
||||
resource_name = "stage1"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Label:scale")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.1, 0.2),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0.5, 0.5), Vector2(1.5, 1.5), Vector2(1, 1)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Label:modulate")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 0.1),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 0.254902), Color(1, 1, 1, 1)]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("Label:position")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_varcj"]
|
||||
resource_name = "stage2_2"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Label:position")
|
||||
tracks/0/interp = 2
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.3, 0.6),
|
||||
"transitions": PackedFloat32Array(0.554784, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0), Vector2(-20, -50), Vector2(-40, -10)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Label:modulate")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 0.2, 0.6),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_08vmk"]
|
||||
resource_name = "stage2"
|
||||
length = 0.6
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Label:position")
|
||||
tracks/0/interp = 2
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.3, 0.6),
|
||||
"transitions": PackedFloat32Array(0.554784, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0), Vector2(20, -50), Vector2(40, -10)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Label:modulate")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 0.2, 0.6),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_g6jg6"]
|
||||
resource_name = "stage2_3"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Label:position")
|
||||
tracks/0/interp = 2
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.3, 0.6),
|
||||
"transitions": PackedFloat32Array(0.554784, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0), Vector2(-20, -40), Vector2(-40, -10)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Label:modulate")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 0.2, 0.6),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_ygxcf"]
|
||||
resource_name = "stage2_4"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Label:position")
|
||||
tracks/0/interp = 2
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.3, 0.6),
|
||||
"transitions": PackedFloat32Array(0.554784, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0), Vector2(20, -40), Vector2(40, -10)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Label:modulate")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 0.2, 0.6),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_eut3s"]
|
||||
resource_name = "stage3"
|
||||
length = 0.6
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Label:scale")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.1, 0.2),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0.5, 0.5), Vector2(1.5, 1.5), Vector2(1, 1)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Label:modulate")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 0.1, 0.3, 0.6),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 0.254902), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("Label:position")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0, 0.3, 0.6),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, -20), Vector2(0, -20), Vector2(0, -50)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_wrgpl"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_b5roo"),
|
||||
"stage1": SubResource("Animation_c3cdy"),
|
||||
"stage2_1": SubResource("Animation_08vmk"),
|
||||
"stage2_2": SubResource("Animation_varcj"),
|
||||
"stage2_3": SubResource("Animation_g6jg6"),
|
||||
"stage2_4": SubResource("Animation_ygxcf"),
|
||||
"stage3": SubResource("Animation_eut3s")
|
||||
}
|
||||
|
||||
[node name="HitText" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -30.0
|
||||
offset_top = -15.0
|
||||
offset_right = 30.0
|
||||
offset_bottom = 15.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
pivot_offset = Vector2(20, 20)
|
||||
script = ExtResource("1_re03i")
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
unique_name_in_owner = true
|
||||
modulate = Color(1, 1, 1, 0.254902)
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -30.0
|
||||
offset_top = -35.0
|
||||
offset_right = 29.9996
|
||||
offset_bottom = -4.99996
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
scale = Vector2(0.5, 0.5)
|
||||
pivot_offset = Vector2(30, 15)
|
||||
text = "123"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_wrgpl")
|
||||
}
|
||||
|
||||
[connection signal="animation_finished" from="AnimationPlayer" to="." method="_on_animation_player_animation_finished"]
|
||||
@ -0,0 +1,33 @@
|
||||
extends Control
|
||||
class_name HitText
|
||||
|
||||
@onready var animation = %AnimationPlayer as AnimationPlayer
|
||||
@onready var label = %Label as Label
|
||||
|
||||
var damage_cache : float
|
||||
var is_close : bool
|
||||
|
||||
func show_hit_damage(damage:float):
|
||||
if is_close:
|
||||
print("正在使用已关闭的hit_text")
|
||||
damage_cache += damage
|
||||
label.text = "%d" % damage_cache
|
||||
animation.seek(0)
|
||||
animation.play("stage1")
|
||||
|
||||
func show_hit_text(text_set:String):
|
||||
if is_close:
|
||||
print("正在使用已关闭的hit_text")
|
||||
is_close = true
|
||||
label.text = text_set
|
||||
animation.play("stage3")
|
||||
|
||||
func _on_animation_player_animation_finished(anim_name):
|
||||
match anim_name:
|
||||
"stage1":
|
||||
is_close = true
|
||||
animation.play("stage2_%d"%randi_range(1,4))
|
||||
"stage2_1","stage2_2","stage2_3","stage2_4":
|
||||
queue_free()
|
||||
"stage3":
|
||||
queue_free()
|
||||
Loading…
Reference in New Issue