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

feat(武器系统): 添加核弹武器及相关资源

实现核弹武器功能,包括:
- 添加核弹控制器武器脚本和场景
- 实现核弹子弹逻辑和爆炸效果
- 添加相关图片、音效资源
- 更新角色武器库包含核弹
- 调整武器名称颜色配置
This commit is contained in:
2025-09-20 22:17:09 +08:00
parent 57979e1cd6
commit e89e4f21e6
16 changed files with 411 additions and 16 deletions
+52
View File
@@ -0,0 +1,52 @@
[gd_scene load_steps=7 format=3 uid="uid://6aetx86j5ue"]
[ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_dpea6"]
[ext_resource type="Texture2D" uid="uid://gs6jd1qxkl74" path="res://resources/bullets/nuclear-bomb/bomb.png" id="2_1kyo5"]
[ext_resource type="Script" path="res://scripts/Contents/Bullets/NuclearBomb.gd" id="2_f85ek"]
[sub_resource type="SpriteFrames" id="SpriteFrames_mku0w"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("2_1kyo5")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[sub_resource type="LabelSettings" id="LabelSettings_asfas"]
font_size = 30
font_color = Color(1, 0, 0, 1)
outline_size = 1
outline_color = Color(1, 0, 0, 1)
[sub_resource type="CircleShape2D" id="CircleShape2D_nhppq"]
radius = 1000.0
[node name="NuclearBomb" instance=ExtResource("1_dpea6")]
script = ExtResource("2_f85ek")
displayName = "核弹"
damage = 500.0
autoDestroyOnHitMap = false
[node name="texture" parent="." index="0"]
sprite_frames = SubResource("SpriteFrames_mku0w")
[node name="anchor" type="Node2D" parent="texture" index="1"]
unique_name_in_owner = true
[node name="label" type="Label" parent="texture/anchor" index="0"]
unique_name_in_owner = true
offset_left = -200.0
offset_top = -25.0
offset_right = 200.0
offset_bottom = 25.0
text = "NUCLEAR WARNING %.1f"
label_settings = SubResource("LabelSettings_asfas")
horizontal_alignment = 1
vertical_alignment = 1
[node name="hitbox" parent="." index="1"]
visible = false
shape = SubResource("CircleShape2D_nhppq")
+9 -7
View File
@@ -1,4 +1,4 @@
[gd_scene load_steps=17 format=3 uid="uid://bm7ymrri6pykb"]
[gd_scene load_steps=18 format=3 uid="uid://bm7ymrri6pykb"]
[ext_resource type="PackedScene" uid="uid://cvogxi7mktumf" path="res://components/Abstracts/EntityBase.tscn" id="1_e5pl8"]
[ext_resource type="Script" path="res://scripts/Contents/Characters/Rooster.gd" id="2_oqdqd"]
@@ -6,6 +6,7 @@
[ext_resource type="AudioStream" uid="uid://dclinyhu256xi" path="res://resources/sounds/effect/Low Whoosh.mp3" id="3_4syso"]
[ext_resource type="Texture2D" uid="uid://ci2ik43ce82uy" path="res://resources/characters/cock/rooster-b.svg" id="3_b0fgx"]
[ext_resource type="PackedScene" uid="uid://c0n3igy4hucrg" path="res://components/Weapons/PurpleCrystal.tscn" id="3_ms5sq"]
[ext_resource type="PackedScene" uid="uid://b2qhes4apaxsj" path="res://components/Weapons/NuclearBomb.tscn" id="3_rgjda"]
[ext_resource type="AudioStream" uid="uid://cdrevrq7n6yqa" path="res://resources/sounds/effect/Boing.mp3" id="4_66s6c"]
[ext_resource type="AudioStream" uid="uid://benyec5bqni0b" path="res://resources/sounds/effect/Chomp.wav" id="4_k0yme"]
[ext_resource type="PackedScene" uid="uid://wl8u5m52708w" path="res://components/Weapons/LGBT.tscn" id="4_pb8qn"]
@@ -47,17 +48,18 @@ displayName = "公鸡"
[node name="weaponStore" parent="." index="0"]
process_mode = 4
[node name="PurpleCrystal" parent="weaponStore" index="0" instance=ExtResource("3_ms5sq")]
[node name="NuclearBomb" parent="weaponStore" index="0" instance=ExtResource("3_rgjda")]
offset_bottom = 315.0
[node name="PurpleCrystal" parent="weaponStore" index="1" instance=ExtResource("3_ms5sq")]
debugRebuild = false
[node name="VectorStar" parent="weaponStore" index="1" instance=ExtResource("6_fvy5n")]
[node name="VectorStar" parent="weaponStore" index="2" instance=ExtResource("6_fvy5n")]
debugRebuild = false
[node name="LGBT" parent="weaponStore" index="2" instance=ExtResource("4_pb8qn")]
debugRebuild = false
[node name="LGBT" parent="weaponStore" index="3" instance=ExtResource("4_pb8qn")]
[node name="BigLaser" parent="weaponStore" index="3" instance=ExtResource("4_plqwu")]
debugRebuild = false
[node name="BigLaser" parent="weaponStore" index="4" instance=ExtResource("4_plqwu")]
[node name="sprint" parent="sounds" index="0"]
stream = ExtResource("4_66s6c")
+132
View File
@@ -0,0 +1,132 @@
[gd_scene load_steps=21 format=3 uid="uid://8lxfkx47fn2c"]
[ext_resource type="PackedScene" uid="uid://bcvuuy2m0pke0" path="res://components/Abstracts/EffectBase.tscn" id="1_qngiw"]
[ext_resource type="AudioStream" uid="uid://b6lss67etwrl" path="res://resources/sounds/effect/nuclear-explosion.mp3" id="2_8nbe8"]
[ext_resource type="Texture2D" uid="uid://dspkfcx4po7fg" path="res://resources/bullets/nuclear-bomb/0.png" id="2_tt1c0"]
[sub_resource type="Curve" id="Curve_dhavk"]
_data = [Vector2(0.498403, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_afnd6"]
curve = SubResource("Curve_dhavk")
[sub_resource type="Gradient" id="Gradient_gan5i"]
colors = PackedColorArray(1, 0.801445, 0.486847, 1, 1, 0.432907, 0, 1)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_suafd"]
gradient = SubResource("Gradient_gan5i")
[sub_resource type="Gradient" id="Gradient_utkbn"]
offsets = PackedFloat32Array(0.140351, 1)
colors = PackedColorArray(1, 1, 1, 1, 1, 0, 0, 1)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_vjiyn"]
gradient = SubResource("Gradient_utkbn")
[sub_resource type="Curve" id="Curve_c6aew"]
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_8kws8"]
curve = SubResource("Curve_c6aew")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_vcrr6"]
particle_flag_disable_z = true
emission_shape = 1
emission_sphere_radius = 50.0
spread = 30.0
initial_velocity_min = -600.0
initial_velocity_max = 600.0
gravity = Vector3(0, -400, 0)
scale_min = 3.0
scale_max = 8.0
scale_curve = SubResource("CurveTexture_8kws8")
color_ramp = SubResource("GradientTexture1D_vjiyn")
color_initial_ramp = SubResource("GradientTexture1D_suafd")
alpha_curve = SubResource("CurveTexture_afnd6")
[sub_resource type="Curve" id="Curve_7vus7"]
_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(0.15016, 1), 0.0, 0.0, 0, 0, Vector2(0.597444, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 4
[sub_resource type="CurveTexture" id="CurveTexture_21hv7"]
curve = SubResource("Curve_7vus7")
[sub_resource type="Curve" id="Curve_hq40d"]
max_value = 2.0
_data = [Vector2(0, 0), 0.0, 10.0, 0, 1, Vector2(0.1, 1), 0.0, 1.11111, 0, 0, Vector2(1, 2), 1.11111, 0.0, 1, 0]
point_count = 3
[sub_resource type="CurveTexture" id="CurveTexture_pbcyu"]
curve = SubResource("Curve_hq40d")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_rqn5f"]
particle_flag_disable_z = true
direction = Vector3(0, -1, 0)
spread = 0.0
gravity = Vector3(0, 0, 0)
scale_curve = SubResource("CurveTexture_pbcyu")
alpha_curve = SubResource("CurveTexture_21hv7")
[sub_resource type="Animation" id="Animation_4yw4a"]
length = 0.001
tracks/0/type = "bezier"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("%stage/../ground:modulate:a")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"handle_modes": PackedInt32Array(0),
"points": PackedFloat32Array(1, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(0)
}
[sub_resource type="Animation" id="Animation_hwbhp"]
length = 5.0
step = 0.1
tracks/0/type = "bezier"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("%stage/../ground:modulate:a")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"handle_modes": PackedInt32Array(0, 0),
"points": PackedFloat32Array(1, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(2.5, 5)
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_ii4iw"]
_data = {
"RESET": SubResource("Animation_4yw4a"),
"spawn": SubResource("Animation_hwbhp")
}
[node name="NuclearExplosion" instance=ExtResource("1_qngiw")]
spawnSound = "spawn"
spawnAnimation = "spawn"
[node name="spawn" parent="sounds" index="0"]
stream = ExtResource("2_8nbe8")
volume_db = 15.0
[node name="ground" type="GPUParticles2D" parent="." index="1"]
amount = 5000
process_material = SubResource("ParticleProcessMaterial_vcrr6")
lifetime = 2.0
local_coords = true
[node name="particles" parent="." index="2"]
amount = 1
process_material = SubResource("ParticleProcessMaterial_rqn5f")
texture = ExtResource("2_tt1c0")
lifetime = 5.0
explosiveness = 0.0
local_coords = true
[node name="animator" parent="stage" index="0"]
libraries = {
"": SubResource("AnimationLibrary_ii4iw")
}
+8 -8
View File
@@ -3,10 +3,10 @@
[ext_resource type="Theme" uid="uid://bje5cd08dyok7" path="res://themes/bigTextAndBold.tres" id="2_y8dft"]
[ext_resource type="Script" path="res://scripts/Statemachine/WeaponName.gd" id="3_g750e"]
[sub_resource type="LabelSettings" id="LabelSettings_83mpy"]
[sub_resource type="LabelSettings" id="LabelSettings_4ul7t"]
font_size = 12
[sub_resource type="LabelSettings" id="LabelSettings_gcoja"]
[sub_resource type="LabelSettings" id="LabelSettings_hsrds"]
font_size = 12
[node name="WeaponName" type="HBoxContainer"]
@@ -23,9 +23,9 @@ qualityColorMap = {
}
typeTopicColorMap = {
0: Color(1, 1, 1, 1),
1: Color(1, 0, 0, 1),
2: Color(0, 1, 1, 1),
3: Color(0.851563, 0, 1, 1)
1: Color(0, 0.708754, 1, 1),
2: Color(1, 0.232016, 0, 1),
3: Color(0.707984, 0, 1, 1)
}
soulLevelColorMap = {
0: Color(1, 1, 1, 1),
@@ -41,14 +41,14 @@ unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 0
text = "[普通]"
label_settings = SubResource("LabelSettings_83mpy")
label_settings = SubResource("LabelSettings_4ul7t")
[node name="label" type="RichTextLabel" parent="."]
unique_name_in_owner = true
layout_mode = 2
theme = ExtResource("2_y8dft")
bbcode_enabled = true
text = "[b][color=ffffffff]归一[/color] · 未命名武器[/b]"
text = "[b][color=8cff78ff]归一[/color] · 未命名武器[/b]"
fit_content = true
autowrap_mode = 0
@@ -67,4 +67,4 @@ unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 8
text = "[冲击]"
label_settings = SubResource("LabelSettings_gcoja")
label_settings = SubResource("LabelSettings_hsrds")
+47
View File
@@ -0,0 +1,47 @@
[gd_scene load_steps=4 format=3 uid="uid://b2qhes4apaxsj"]
[ext_resource type="PackedScene" uid="uid://ckq2cq6m23hq3" path="res://components/Abstracts/WeaponCardBase.tscn" id="1_k4t0h"]
[ext_resource type="Texture2D" uid="uid://cp57lmeohvo3o" path="res://resources/weapons/nuclear-bomb.png" id="2_5nh8i"]
[ext_resource type="Script" path="res://scripts/Contents/Weapons/NuclearBomb.gd" id="2_hscw2"]
[node name="NuclearBomb" instance=ExtResource("1_k4t0h")]
script = ExtResource("2_hscw2")
avatarTexture = ExtResource("2_5nh8i")
displayName = "核弹控制器"
quality = 4
typeTopic = 2
costBeachball = 100
store = {
"atk": 20,
"radius": 1000.0
}
storeType = {
"atk": 1,
"radius": 1
}
descriptionTemplate = "倒计时10秒后对半径$radius范围的实体造成$atk点[b]无差别伤害[/b]。"
needEnergy = 200.0
cooldown = 1000.0
[node name="avatar" parent="container/info" index="0"]
texture = ExtResource("2_5nh8i")
[node name="energy" parent="container/info/infos/energyInfo" index="1"]
text = "200.0"
[node name="beachball" parent="container/info/infos/beachballInfo" index="1"]
text = "100"
[node name="name" parent="container/info" index="2"]
displayName = "核弹控制器"
quality = 4
typeTopic = 2
typeTopicColorMap = {
0: Color(1, 1, 1, 1),
1: Color(0, 0.708754, 1, 1),
2: Color(1, 0.274813, 0, 1),
3: Color(0.707984, 0, 1, 1)
}
[node name="description" parent="container" index="2"]
text = "[center]倒计时10秒后对半径[color=cyan]1000[/color]→[color=yellow]1020[/color]范围的实体造成[color=cyan]20[/color]→[color=yellow]45[/color]点[b]无差别伤害[/b]。[/center]"
Binary file not shown.

After

Width:  |  Height:  |  Size: 388 KiB

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dspkfcx4po7fg"
path="res://.godot/imported/0.png-ccf5d669448e80d26947166692757dc9.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/bullets/nuclear-bomb/0.png"
dest_files=["res://.godot/imported/0.png-ccf5d669448e80d26947166692757dc9.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://gs6jd1qxkl74"
path="res://.godot/imported/bomb.png-e45477d7f903b980872a60b4c6c75032.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/bullets/nuclear-bomb/bomb.png"
dest_files=["res://.godot/imported/bomb.png-e45477d7f903b980872a60b4c6c75032.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.
@@ -0,0 +1,19 @@
[remap]
importer="mp3"
type="AudioStreamMP3"
uid="uid://b6lss67etwrl"
path="res://.godot/imported/nuclear-explosion.mp3-8001c7112ea10e259f62b834d09c29bc.mp3str"
[deps]
source_file="res://resources/sounds/effect/nuclear-explosion.mp3"
dest_files=["res://.godot/imported/nuclear-explosion.mp3-8001c7112ea10e259f62b834d09c29bc.mp3str"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4
Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

+34
View File
@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cp57lmeohvo3o"
path="res://.godot/imported/nuclear-bomb.png-2660cbb1c305b4b221bab92491fd819f.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/weapons/nuclear-bomb.png"
dest_files=["res://.godot/imported/nuclear-bomb.png-2660cbb1c305b4b221bab92491fd819f.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
+23
View File
@@ -0,0 +1,23 @@
extends BulletBase
class_name NuclearBomb
@onready var label: Label = $"%label"
@onready var anchor: Node2D = $"%anchor"
var countdown = 10000
var radius = 500
func spawn():
hitbox.disabled = true
hitbox.shape.radius = radius
anchor.global_rotation = 0
func ai():
speed *= 0.99
PresetBulletAI.forward(self, rotation)
label.text = "NUCLEAR WARNING %.1f" % ((countdown - timeLived()) / 1000)
if timeLived() > countdown:
tryDestroy()
func destroy(_b):
EffectController.create(preload("res://components/Effects/NuclearExplosion.tscn"), global_position).shot()
hitbox.disabled = false
await TickTool.frame(5)
+14
View File
@@ -0,0 +1,14 @@
@tool
extends Weapon
func update(to: int, origin: Dictionary, _entity: EntityBase):
origin["atk"] += 25 * to * soulLevel
origin["radius"] += 20 * to * soulLevel
return origin
func attack(entity: EntityBase):
var weaponPos = entity.findWeaponAnchor("normal")
for j in BulletBase.generate(preload("res://components/Bullets/NuclearBomb.tscn"), entity, weaponPos, weaponPos.angle_to_point(get_global_mouse_position())):
var bullet: NuclearBomb = j
bullet.damage = readStore("atk")
bullet.radius = readStore("radius")
return true
+5 -1
View File
@@ -3,9 +3,11 @@ class_name EffectController
@export var oneShot: bool = true
@export var spawnSound: String = ""
@export var spawnAnimation: String = ""
@onready var particles: GPUParticles2D = $"%particles"
@onready var sounds = $"%sounds"
@onready var sounds: Node2D = $"%sounds"
@onready var animator: AnimationPlayer = $"%animator"
func _ready():
particles.emitting = false
@@ -13,6 +15,8 @@ func _ready():
var sound = sounds.get_node_or_null(spawnSound)
if sound and sound.stream:
sound.play()
if spawnAnimation:
animator.play(spawnAnimation)
func shot():
var cloned = particles.duplicate() as GPUParticles2D
cloned.emitting = true