1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-06-11 22:27:12 +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
+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,