1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 06:51:54 +08:00

feat: 添加新角色Kernyr和子弹Yangyi及相关资源

添加新角色Kernyr及其相关资源文件,包括角色脚本、场景和贴图
添加新子弹类型Yangyi及其相关资源文件,包括子弹脚本、场景和贴图
修改Wave.gd添加Kernyr作为测试波次
调整QKSword.gd和Parrier.gd的数值效果
扩展Bullet.gd的selfRotate方法支持仅旋转贴图
This commit is contained in:
2026-03-22 16:32:18 +08:00
parent 128e9d51ff
commit 733e8e5c0b
25 changed files with 498 additions and 4 deletions
+105
View File
@@ -0,0 +1,105 @@
[gd_scene load_steps=12 format=3 uid="uid://mo3t1r3ydrx4"]
[ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_i51w8"]
[ext_resource type="Script" uid="uid://c3ax35jdfjqox" path="res://scripts/Contents/Bullets/Yangyi.gd" id="2_sku1m"]
[ext_resource type="Texture2D" uid="uid://7hofo0ihj7sh" path="res://resources/bullets/yangyi/0.jpg" id="3_c3irh"]
[sub_resource type="SpriteFrames" id="SpriteFrames_peenw"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("3_c3irh")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[sub_resource type="Animation" id="Animation_c3irh"]
resource_name = "loop"
loop_mode = 1
step = 0.1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:rotation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [0.0, 6.283185307179586]
}
[sub_resource type="Animation" id="Animation_peenw"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:rotation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_x2cof"]
_data = {
&"RESET": SubResource("Animation_peenw"),
&"loop": SubResource("Animation_c3irh")
}
[sub_resource type="RectangleShape2D" id="RectangleShape2D_x2cof"]
size = Vector2(94, 94)
[sub_resource type="Curve" id="Curve_c3irh"]
_data = [Vector2(0, 0.8), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_peenw"]
curve = SubResource("Curve_c3irh")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_c3irh"]
particle_flag_disable_z = true
angle_min = 1.0728835e-05
angle_max = 360.00003
direction = Vector3(-1, 0, 0)
spread = 0.0
initial_velocity_min = 1500.0
initial_velocity_max = 1500.0
angular_velocity_min = -100.000015
angular_velocity_max = 99.999985
gravity = Vector3(0, 0, 0)
scale_min = 0.79999995
scale_max = 0.79999995
alpha_curve = SubResource("CurveTexture_peenw")
[node name="Yangyi" instance=ExtResource("1_i51w8")]
script = ExtResource("2_sku1m")
displayName = "超级导弹"
speed = 20.0
lifeTime = 3000.0
autoLoopAnimation = true
[node name="texture" parent="." index="0"]
scale = Vector2(0.15, 0.15)
sprite_frames = SubResource("SpriteFrames_peenw")
[node name="animator" parent="texture" index="0"]
libraries = {
&"": SubResource("AnimationLibrary_x2cof")
}
[node name="hitbox" parent="." index="1"]
shape = SubResource("RectangleShape2D_x2cof")
[node name="trail" type="GPUParticles2D" parent="." index="2"]
z_index = -1
scale = Vector2(0.15, 0.15)
texture = ExtResource("3_c3irh")
local_coords = true
process_material = SubResource("ParticleProcessMaterial_c3irh")
+33
View File
@@ -0,0 +1,33 @@
[gd_scene load_steps=5 format=3 uid="uid://47ek7kev66gj"]
[ext_resource type="PackedScene" uid="uid://cvogxi7mktumf" path="res://components/Abstracts/EntityBase.tscn" id="1_afsds"]
[ext_resource type="Script" uid="uid://m28dwfwmmhmh" path="res://scripts/Contents/Characters/Kernyr.gd" id="2_pixbe"]
[ext_resource type="Texture2D" uid="uid://5o6446vmerf5" path="res://resources/bullets/yangyi/cat.jpg" id="3_afsds"]
[sub_resource type="SpriteFrames" id="SpriteFrames_vkls3"]
animations = [{
"frames": [],
"loop": true,
"name": &"idle",
"speed": 5.0
}, {
"frames": [],
"loop": true,
"name": &"walk",
"speed": 5.0
}]
[node name="CyberCat" instance=ExtResource("1_afsds")]
script = ExtResource("2_pixbe")
displayName = "赛博猫猫🥵"
[node name="texture" parent="." index="3"]
sprite_frames = SubResource("SpriteFrames_vkls3")
[node name="staticBackground" parent="texture" index="0"]
position = Vector2(0, -10)
scale = Vector2(0.37199643, 0.37199643)
texture = ExtResource("3_afsds")
[node name="statebar" parent="." index="4"]
position = Vector2(0, -135)
+42
View File
@@ -0,0 +1,42 @@
[gd_scene load_steps=6 format=3 uid="uid://dt3xviil00bw4"]
[ext_resource type="PackedScene" uid="uid://cvogxi7mktumf" path="res://components/Abstracts/EntityBase.tscn" id="1_bha5j"]
[ext_resource type="Script" uid="uid://m28dwfwmmhmh" path="res://scripts/Contents/Characters/Kernyr.gd" id="2_vkls3"]
[ext_resource type="Texture2D" uid="uid://cts825oc08b7k" path="res://resources/bullets/yangyi/ppn.jpg" id="3_vkls3"]
[sub_resource type="SpriteFrames" id="SpriteFrames_vkls3"]
animations = [{
"frames": [],
"loop": true,
"name": &"idle",
"speed": 5.0
}, {
"frames": [],
"loop": true,
"name": &"walk",
"speed": 5.0
}]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_vkls3"]
size = Vector2(118, 98)
[node name="Kernyr" instance=ExtResource("1_bha5j")]
script = ExtResource("2_vkls3")
displayName = "口势咯"
drops = Array[int]([0, 1])
dropCounts = Array[Vector2]([Vector2(30, 50), Vector2(20, 40)])
appleCount = Vector2i(2, 5)
[node name="texture" parent="." index="3"]
sprite_frames = SubResource("SpriteFrames_vkls3")
[node name="staticBackground" parent="texture" index="0"]
position = Vector2(0, -10)
scale = Vector2(0.22162607, 0.22162607)
texture = ExtResource("3_vkls3")
[node name="hitbox" parent="texture/hurtbox" index="0"]
shape = SubResource("RectangleShape2D_vkls3")
[node name="statebar" parent="." index="4"]
position = Vector2(0, -135)
Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

+40
View File
@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://7hofo0ihj7sh"
path="res://.godot/imported/0.jpg-2e4177d745afe56f775937a532d5bff3.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/bullets/yangyi/0.jpg"
dest_files=["res://.godot/imported/0.jpg-2e4177d745afe56f775937a532d5bff3.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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: 22 KiB

+40
View File
@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://5o6446vmerf5"
path="res://.godot/imported/cat.jpg-3f490a751daf4c8cbc1b1268d56af751.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/bullets/yangyi/cat.jpg"
dest_files=["res://.godot/imported/cat.jpg-3f490a751daf4c8cbc1b1268d56af751.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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: 2.4 KiB

+40
View File
@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://0fou4dytgw01"
path="res://.godot/imported/js.jpg-d45bb0c55e41aeaf4193138583dfda4e.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/bullets/yangyi/js.jpg"
dest_files=["res://.godot/imported/js.jpg-d45bb0c55e41aeaf4193138583dfda4e.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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: 36 KiB

+40
View File
@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cts825oc08b7k"
path="res://.godot/imported/ppn.jpg-66ae0430ba9f1f851e293775a2ed4964.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/bullets/yangyi/ppn.jpg"
dest_files=["res://.godot/imported/ppn.jpg-66ae0430ba9f1f851e293775a2ed4964.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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: 54 KiB

+40
View File
@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cb57urlgnw2n4"
path="res://.godot/imported/world.jpg-870e37c1a831a60de74cadbfb157b1a0.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/bullets/yangyi/world.jpg"
dest_files=["res://.godot/imported/world.jpg-870e37c1a831a60de74cadbfb157b1a0.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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: 56 KiB

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b1aq0k7tf1p1"
path="res://.godot/imported/kernyr.jpg-d82cf548a25a07dbd282dd92971a45c3.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/characters/kernyr/kernyr.jpg"
dest_files=["res://.godot/imported/kernyr.jpg-d82cf548a25a07dbd282dd92971a45c3.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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: 20 KiB

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://d34vkibm8a5e7"
path="res://.godot/imported/koshino.jpg-1b7923f21558cad00dbaccc4d6ecc7c4.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/characters/kernyr/koshino.jpg"
dest_files=["res://.godot/imported/koshino.jpg-1b7923f21558cad00dbaccc4d6ecc7c4.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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
+3 -2
View File
@@ -15,7 +15,8 @@ static func trace(bullet: BulletBase, target: Vector2, speed: float):
)
static func faceToMouse(bullet: BulletBase):
bullet.rotation = bullet.position.angle_to_point(bullet.get_global_mouse_position())
static func selfRotate(bullet: BulletBase, speed: float):
bullet.rotation += deg_to_rad(speed)
static func selfRotate(bullet: BulletBase, speed: float, justTexture: bool = false):
var target: Node2D = bullet.texture as Node2D if justTexture else bullet as Node2D
target.rotation += deg_to_rad(speed)
static func lerpPosition(bullet: BulletBase, target: Vector2, speed: float):
bullet.position = bullet.position.lerp(target, speed)
+1
View File
@@ -28,6 +28,7 @@ func hitBullet(bullet: BulletBase): # 当前子弹与其他子弹相撞
eff.modulate = bullet.modulate.blend(bullet.texture.modulate)
eff.rotation = position.angle_to_point(bullet.position)
eff.shot()
CameraManager.shake(200, 250)
# 摧毁其他子弹
bullet.tryDestroy()
var cycler = launcher.getOrCreateCycleTimer("parry", 2000, 100)
+2 -1
View File
@@ -5,7 +5,7 @@ var tracer: EntityBase
var spawnSpeed: float = 1
func register():
spawnSpeed = randf_range(0.25, 1.75)
spawnSpeed = randf_range(0.75, 2)
animator.speed_scale = spawnSpeed
lifeTime /= spawnSpeed
func ai():
@@ -26,3 +26,4 @@ func succeedToHit(_dmg: float, entity: EntityBase):
var varians = randi_range(0, 2)
eff.texture.sprite_frames = load("res://resources/effects/FooExplosion/%d/%d.tres" % [varians, varians])
eff.shot()
CameraManager.shake(300, 500)
+5
View File
@@ -0,0 +1,5 @@
extends BulletBase
class_name YangyiBullet
func ai():
PresetBulletAI.forward(self , rotation)
+1
View File
@@ -0,0 +1 @@
uid://c3ax35jdfjqox
+21
View File
@@ -0,0 +1,21 @@
extends EntityBase
class_name Kernyr
func register():
fields[FieldStore.Entity.MAX_HEALTH] = 2000
fields[FieldStore.Entity.MOVEMENT_SPEED] = 0.1
fields[FieldStore.Entity.OFFSET_SHOOT] = 20
attackCooldownMap[0] = 300
func ai():
PresetEntityAI.follow(self , currentFocusedBoss)
tryAttack(0)
func attack(type: int):
if type == 0:
for bullet in BulletBase.generate(
ComponentManager.getBullet("Yangyi"),
self ,
position,
position.angle_to_point(currentFocusedBoss.position)
):
if bullet is YangyiBullet:
pass
@@ -0,0 +1 @@
uid://m28dwfwmmhmh
+4 -1
View File
@@ -46,8 +46,11 @@ static var WAVE_TESTBOSS_BEAR = [
static var WAVE_TESTBOSS_CHICK = [
Wave.create("Chick", 0, 0, true, 0, INF, 10),
]
static var WAVE_JUSTJOKE = [
Wave.create("Kernyr", 0, 0, true, 0, INF, 1),
]
static var WAVE_EMPTY = []
static var data = WAVE_NORMAL if WorldManager.isRelease() else WAVE_NORMAL
static var data = WAVE_NORMAL if WorldManager.isRelease() else WAVE_JUSTJOKE
static func create(
entity_: String,