1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-27 22:41:56 +08:00

refactor(ChainGun): 调整武器属性和子弹生成逻辑

修改ChainGun的数值属性和子弹生成方式,新增split参数控制子弹间距
调整BossBar的样式和位置,删除未使用的shader文件
This commit is contained in:
2025-09-23 22:29:22 +08:00
parent 9fa9564093
commit de7dd468fe
7 changed files with 60 additions and 39 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ displayName = "公鸡"
process_mode = 4
[node name="ChainGun" parent="weaponStore" index="0" instance=ExtResource("3_inwol")]
offset_bottom = 330.0
offset_bottom = 352.0
[node name="PurpleCrystal" parent="weaponStore" index="1" instance=ExtResource("3_ms5sq")]
debugRebuild = false
+45 -8
View File
@@ -1,14 +1,47 @@
[gd_scene load_steps=5 format=3 uid="uid://ofpg5s3j7esv"]
[gd_scene load_steps=9 format=3 uid="uid://ofpg5s3j7esv"]
[ext_resource type="Script" path="res://scripts/Statemachine/BossBar.gd" id="1_hkj6o"]
[ext_resource type="PackedScene" uid="uid://d1ulrvupa76ap" path="res://components/UI/ColorBar.tscn" id="1_uxey7"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_0aktd"]
bg_color = Color(0, 0, 0, 0.5)
corner_radius_top_left = 15
corner_radius_top_right = 15
corner_radius_bottom_right = 15
corner_radius_bottom_left = 15
corner_detail = 1
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_gor8g"]
bg_color = Color(1, 0, 0, 0.5)
corner_radius_top_left = 15
corner_radius_top_right = 15
corner_radius_bottom_right = 15
corner_radius_bottom_left = 15
corner_detail = 1
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_g3ag3"]
bg_color = Color(0, 1, 0, 0.5)
corner_radius_top_left = 15
corner_radius_top_right = 15
corner_radius_bottom_right = 15
corner_radius_bottom_left = 15
corner_detail = 1
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_bua1u"]
bg_color = Color(1, 1, 1, 1)
corner_radius_top_left = 15
corner_radius_top_right = 15
corner_radius_bottom_right = 15
corner_radius_bottom_left = 15
corner_detail = 1
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_ar00p"]
content_margin_left = 10.0
[sub_resource type="LabelSettings" id="LabelSettings_esyuk"]
font_size = 12
font_color = Color(0, 0, 0, 1)
outline_size = 2
[node name="BossBar" type="Control"]
layout_mode = 3
@@ -23,16 +56,20 @@ script = ExtResource("1_hkj6o")
unique_name_in_owner = true
layout_mode = 1
anchors_preset = -1
anchor_left = 0.2
anchor_top = 1.0
anchor_right = 0.8
anchor_bottom = 1.0
offset_top = -65.0
anchor_left = 0.3
anchor_top = 0.95
anchor_right = 0.7
anchor_bottom = 0.95
offset_top = -30.0
offset_right = 0.0
offset_bottom = -40.0
offset_bottom = 0.0
grow_horizontal = 2
grow_vertical = 0
grow_vertical = 2
currentValue = 0.0
backBox = SubResource("StyleBoxFlat_0aktd")
middleBox1 = SubResource("StyleBoxFlat_gor8g")
middleBox2 = SubResource("StyleBoxFlat_g3ag3")
frontBox = SubResource("StyleBoxFlat_bua1u")
[node name="panel" type="PanelContainer" parent="health"]
layout_mode = 1
+9 -6
View File
@@ -10,16 +10,19 @@ avatarTexture = ExtResource("2_ghn43")
displayName = "链式机枪"
costBeachball = 400
store = {
"atk": 5,
"count": 1
"atk": 7,
"count": 1,
"split": 20
}
storeType = {
"atk": 1,
"count": 1
"count": 1,
"split": 1
}
descriptionTemplate = "发射$count个[b]微型水晶[/b],可造成$atk点伤害。"
descriptionTemplate = "以$split单位的间隔发射$count个[b]微型水晶[/b],可造成$atk点伤害。"
needEnergy = 1.0
cooldown = 66.0
cooldown = 50.0
debugRebuild = true
[node name="avatar" parent="container/info" index="0"]
texture = ExtResource("2_ghn43")
@@ -34,4 +37,4 @@ text = "400"
displayName = "链式机枪"
[node name="description" parent="container" index="2"]
text = "[center]发射[color=cyan]2[/color]→[color=yellow]2[/color]个[b]微型水晶[/b],可造成[color=cyan]5[/color]→[color=yellow]7[/color]点伤害。[/center]"
text = "[center]以[color=cyan]20[/color]→[color=yellow]0[/color]单位的间隔发射[color=cyan]1[/color]→[color=yellow]1[/color]个[b]微型水晶[/b],可造成[color=cyan]7[/color]→[color=yellow]9[/color]点伤害。[/center]"
+2 -1
View File
@@ -1,6 +1,7 @@
extends BulletBase
var count: int = 1
var splits: float = 10.0
@onready var anchor: Node2D = $"%anchor"
@@ -9,6 +10,6 @@ func spawn():
for i in BulletBase.generate(ComponentManager.getBullet("PurpleCrystalSmall"), launcher, anchor.global_position, rotation):
i.damage = damage
var dir = Vector2.from_angle(i.rotation).rotated(deg_to_rad(-90))
i.global_position += dir * (count - j * 2) * 20 / 2
i.global_position += dir * (count - j * 2) * splits / 2
func ai():
PresetBulletAI.lockLauncher(self, launcher, true)
+3 -1
View File
@@ -3,9 +3,11 @@ extends Weapon
func update(to, origin, _entity):
origin["atk"] += 2 * to * soulLevel
origin["count"] += 0.25 * to * soulLevel
origin["count"] = 1 * soulLevel
origin["split"] /= 1 + 0.05 * to * soulLevel
return origin
func attack(entity: EntityBase):
for i in BulletBase.generate(ComponentManager.getBullet("ChainGun"), entity, entity.texture.global_position, (get_global_mouse_position() - entity.texture.global_position).angle()):
i.damage = readStore("atk")
i.count = floor(readStore("count"))
i.split = readStore("split")
-13
View File
@@ -1,13 +0,0 @@
shader_type canvas_item;
uniform float inner:hint_range(0.0, 1.0, 0.01)=0.5;
uniform float outer:hint_range(0.0, 1.0, 0.01)=0.75;
uniform float alpha:hint_range(0.0, 1.0, 0.1)=0.5;
void fragment() {
vec2 center=vec2(0.5);
float dist=distance(UV,center)*2.0;
if(dist<inner){
COLOR.a*=alpha;
}else{
COLOR.a*=float(inner<dist&&dist<outer);
}
}
-9
View File
@@ -1,9 +0,0 @@
shader_type canvas_item;
uniform vec4 color:source_color;
uniform float mixProgress:hint_range(0.0, 1.0, 0.01)=0.5;
void fragment() {
float maxDistance=0.5;
float dist=distance(UV,vec2(0.5));
vec4 mixed=vec4(color.rgb,smoothstep(0,1,(maxDistance-dist)/maxDistance));
COLOR=mix(COLOR,mixed,mixProgress);
}