mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
feat(UI): 优化技能图标视觉效果并调整UI布局
- 为技能图标添加粒子效果,在冷却完成时显示 - 调整冷却进度条的着色器参数,改进视觉效果 - 修改默认游戏难度为MASTER - 重构UI布局,将技能图标整合到能量条容器中 - 调整实体升级公式,使用平方根计算难度加成
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://ufl4kek8hrmt"]
|
||||
[gd_scene load_steps=12 format=3 uid="uid://ufl4kek8hrmt"]
|
||||
|
||||
[ext_resource type="Shader" path="res://shaders/CooldownProgress.gdshader" id="1_jaivk"]
|
||||
[ext_resource type="Script" path="res://scripts/Statemachine/SkillIcon.gd" id="1_l7say"]
|
||||
[ext_resource type="Texture2D" uid="uid://cp4ypuarjoshp" path="res://resources/skillIcons/purple-crystal.png" id="2_hh1bl"]
|
||||
[ext_resource type="Texture2D" uid="uid://chqmaeivt84b5" path="res://components/UI/attackstar.svg" id="4_50rim"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_3fyf3"]
|
||||
shader = ExtResource("1_jaivk")
|
||||
shader_parameter/progress = 0.55
|
||||
shader_parameter/backAlpha = 0.25
|
||||
shader_parameter/backAlpha = 0.1
|
||||
shader_parameter/edgeHeight = 0.05
|
||||
shader_parameter/edgeColor = Color(1, 1, 1, 1)
|
||||
shader_parameter/trailHeight = 0.3
|
||||
shader_parameter/trailAlpha = 0.5
|
||||
shader_parameter/trailColor = Color(1, 1, 1, 0.5)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_a60wd"]
|
||||
content_margin_left = 5.0
|
||||
@@ -23,7 +25,29 @@ corner_radius_top_right = 20
|
||||
corner_radius_bottom_right = 20
|
||||
corner_radius_bottom_left = 20
|
||||
|
||||
[sub_resource type="Curve" id="Curve_rgp6n"]
|
||||
_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(0.504673, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
|
||||
point_count = 3
|
||||
|
||||
[sub_resource type="CurveTexture" id="CurveTexture_qk3pj"]
|
||||
curve = SubResource("Curve_rgp6n")
|
||||
|
||||
[sub_resource type="Curve" id="Curve_h7g2c"]
|
||||
max_value = 2.0
|
||||
_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(1, 2), 0.0, 0.0, 0, 0]
|
||||
point_count = 2
|
||||
|
||||
[sub_resource type="CurveTexture" id="CurveTexture_05v0d"]
|
||||
curve = SubResource("Curve_h7g2c")
|
||||
|
||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_7cgpa"]
|
||||
particle_flag_disable_z = true
|
||||
gravity = Vector3(0, 0, 0)
|
||||
scale_curve = SubResource("CurveTexture_05v0d")
|
||||
alpha_curve = SubResource("CurveTexture_qk3pj")
|
||||
|
||||
[node name="SkillIconBase" type="PanelContainer"]
|
||||
texture_filter = 2
|
||||
material = SubResource("ShaderMaterial_3fyf3")
|
||||
custom_minimum_size = Vector2(40, 40)
|
||||
offset_right = 30.0
|
||||
@@ -38,3 +62,12 @@ layout_mode = 2
|
||||
texture = ExtResource("2_hh1bl")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="particle" type="GPUParticles2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(20, 20)
|
||||
emitting = false
|
||||
amount = 1
|
||||
process_material = SubResource("ParticleProcessMaterial_7cgpa")
|
||||
texture = ExtResource("4_50rim")
|
||||
one_shot = true
|
||||
|
||||
+19
-23
@@ -14,6 +14,8 @@
|
||||
[ext_resource type="PackedScene" uid="uid://dekcqdhrjs07u" path="res://components/Scenes/FullscreenPanels/Weapon.tscn" id="13_bmc24"]
|
||||
[ext_resource type="PackedScene" uid="uid://w2o3klbsssq3" path="res://components/Scenes/FullscreenPanels/Thanks.tscn" id="14_gp8lx"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_12otr"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_kp2r0"]
|
||||
bg_color = Color(0, 0, 0, 0.5)
|
||||
|
||||
@@ -118,8 +120,6 @@ _data = {
|
||||
"show": SubResource("Animation_2xajo")
|
||||
}
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_12otr"]
|
||||
|
||||
[node name="UI" type="CanvasLayer"]
|
||||
process_mode = 3
|
||||
script = ExtResource("1_f00a6")
|
||||
@@ -193,16 +193,29 @@ grow_horizontal = 0
|
||||
grow_vertical = 2
|
||||
theme_override_styles/panel = ExtResource("5_3hym1")
|
||||
|
||||
[node name="container" type="VBoxContainer" parent="root/energy"]
|
||||
[node name="wrapper" type="HBoxContainer" parent="root/energy"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 10
|
||||
|
||||
[node name="skills" type="PanelContainer" parent="root/energy/wrapper"]
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_12otr")
|
||||
|
||||
[node name="skillContainer" type="VBoxContainer" parent="root/energy/wrapper/skills"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="container" type="VBoxContainer" parent="root/energy/wrapper"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 10
|
||||
alignment = 1
|
||||
|
||||
[node name="energy" type="HBoxContainer" parent="root/energy/container"]
|
||||
[node name="energy" type="HBoxContainer" parent="root/energy/wrapper/container"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="icon" type="TextureRect" parent="root/energy/container/energy"]
|
||||
[node name="icon" type="TextureRect" parent="root/energy/wrapper/container/energy"]
|
||||
custom_minimum_size = Vector2(16, 16)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
@@ -210,7 +223,7 @@ size_flags_vertical = 4
|
||||
texture = ExtResource("7_2om12")
|
||||
expand_mode = 1
|
||||
|
||||
[node name="percent" parent="root/energy/container" instance=ExtResource("8_f4j2b")]
|
||||
[node name="percent" parent="root/energy/wrapper/container" instance=ExtResource("8_f4j2b")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
@@ -249,23 +262,6 @@ libraries = {
|
||||
"": SubResource("AnimationLibrary_37e4s")
|
||||
}
|
||||
|
||||
[node name="skills" type="PanelContainer" parent="root"]
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.97
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.97
|
||||
anchor_bottom = 0.5
|
||||
offset_left = 0.399902
|
||||
offset_right = 0.399902
|
||||
grow_horizontal = 0
|
||||
grow_vertical = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_12otr")
|
||||
|
||||
[node name="skillContainer" type="VBoxContainer" parent="root/skills"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
|
||||
[node name="itemCollect" type="VBoxContainer" parent="root"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 1
|
||||
|
||||
@@ -161,8 +161,8 @@ func _physics_process(_delta: float) -> void:
|
||||
|
||||
# 通用方法
|
||||
func applyLevel():
|
||||
fields[FieldStore.Entity.MAX_HEALTH] *= (1 + GameRule.entityHealthIncreasePerWave * (GameRule.difficulty + 1)) ** level
|
||||
fields[FieldStore.Entity.DAMAGE_MULTIPILER] *= (1 + GameRule.entityDamageIncreasePerWave * (GameRule.difficulty + 1)) ** level
|
||||
fields[FieldStore.Entity.MAX_HEALTH] *= (1 + GameRule.entityHealthIncreasePerWave * sqrt(GameRule.difficulty + 1)) ** level
|
||||
fields[FieldStore.Entity.DAMAGE_MULTIPILER] *= (1 + GameRule.entityDamageIncreasePerWave * sqrt(GameRule.difficulty + 1)) ** level
|
||||
func displace(direction: Vector2, isSprinting: bool = false):
|
||||
return (direction if isSprinting else direction.normalized()) * fields.get(FieldStore.Entity.MOVEMENT_SPEED) * 400 * abs(animatree.get("parameters/blend_position"))
|
||||
func move(direction: Vector2, isSprinting: bool = false):
|
||||
@@ -255,7 +255,7 @@ func tryDie(by: BulletBase):
|
||||
var item = drops[drop]
|
||||
var count = ceil(randf_range(dropCounts[drop].x, dropCounts[drop].y))
|
||||
for i in range(count):
|
||||
ItemDropped.generate(item, count, position + MathTool.randv2_range(GameRule.itemDroppedSpawnOffset))
|
||||
ItemDropped.generate(item, 1, position + MathTool.randv2_range(GameRule.itemDroppedSpawnOffset))
|
||||
if MathTool.rate(
|
||||
GameRule.appleDropRate +
|
||||
by.launcher.fields.get(FieldStore.Entity.DROP_APPLE_RATE) +
|
||||
|
||||
@@ -4,6 +4,10 @@ class_name SkillIcon
|
||||
@export var weapon: Weapon = null;
|
||||
|
||||
@onready var textureRect: TextureRect = $"%texture"
|
||||
@onready var particle: GPUParticles2D = $"%particle"
|
||||
|
||||
var showed: bool = false
|
||||
|
||||
func _ready():
|
||||
material = material.duplicate()
|
||||
func _physics_process(_delta):
|
||||
@@ -11,3 +15,9 @@ func _physics_process(_delta):
|
||||
textureRect.texture = weapon.avatarTexture
|
||||
var progress = min(weapon.cooldownTimer.timeSinceLastStart() / weapon.cooldownTimer.cooldown, UIState.player.energy / weapon.needEnergy)
|
||||
material.set_shader_parameter("progress", progress)
|
||||
if progress >= 1:
|
||||
if !showed:
|
||||
showed = true
|
||||
particle.emitting = true
|
||||
else:
|
||||
showed = false
|
||||
|
||||
@@ -9,7 +9,7 @@ enum Difficulty {
|
||||
MASTER,
|
||||
}
|
||||
static var deadReasons: Array = JsonTool.parseJson("res://resources/constants/deadReasons.json")
|
||||
static var difficulty: Difficulty = Difficulty.NORMAL # 难度倍数,可以写小数
|
||||
static var difficulty: Difficulty = Difficulty.MASTER # 难度倍数,可以写小数
|
||||
static var allowFriendlyFire: bool = false # 是否允许友军伤害
|
||||
static var bulletSpeedMultiplier: float = 1 # 子弹速度倍率
|
||||
static var damageOffset: float = MathTool.percent(20) # 伤害随机浮动比例
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
shader_type canvas_item;
|
||||
uniform float progress:hint_range(-0.0, 2.0, 0.01)=0.5;
|
||||
uniform float backAlpha:hint_range(0.0, 1.0, 0.01)=0.25;
|
||||
uniform float backAlpha:hint_range(0.0, 1.0, 0.01)=0.1;
|
||||
uniform float edgeHeight:hint_range(0.0, 1.0, 0.01)=0.05;
|
||||
uniform vec4 edgeColor:source_color;
|
||||
uniform float trailHeight:hint_range(0.0, 1.0, 0.01)=0.3;
|
||||
uniform float trailAlpha:hint_range(0.0, 1.0, 0.01)=0.5;
|
||||
uniform vec4 trailColor:source_color;
|
||||
void fragment() {
|
||||
if(UV.y>=1.0-progress){
|
||||
if(1.0-progress+trailHeight-UV.y>0.0){
|
||||
float dist=distance(UV.y,1.0-progress);
|
||||
COLOR=vec4(1);
|
||||
COLOR.a=(trailHeight-dist)/trailHeight*trailAlpha;
|
||||
COLOR=mix(COLOR,trailColor*vec4(1,1,1,(trailHeight-dist)/trailHeight),1);
|
||||
}else{
|
||||
COLOR.a*=backAlpha;
|
||||
}
|
||||
}else if(distance(UV.y,1.0-progress)<edgeHeight){
|
||||
COLOR=vec4(1.0);
|
||||
COLOR=edgeColor;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user