mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-06-04 10:47:13 +08:00
feat(子弹): 新增狐狸爪子弹及其相关功能
添加FoxZhua子弹类型,包含追踪功能 修改FireScan子弹伤害计算方式为基于距离百分比 扩展BulletBase添加原始伤害和距离计算功能 更新Chick角色使用新子弹和调整攻击逻辑 调整Wave生成逻辑添加Boss检测功能 优化FirePot粒子效果和参数
This commit is contained in:
@@ -17,3 +17,5 @@ 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 lerpPosition(bullet: BulletBase, target: Vector2, speed: float):
|
||||
bullet.position = bullet.position.lerp(target, speed)
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
extends BulletBase
|
||||
class_name FireScan
|
||||
|
||||
func register():
|
||||
speed = 10
|
||||
damage = 20
|
||||
|
||||
func ai():
|
||||
PresetBulletAI.forward(self, rotation)
|
||||
damage = (1 - lifeDistancePercent()) * originalDamage
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
extends BulletBase
|
||||
|
||||
@export var canTrace: bool = true
|
||||
|
||||
func ai():
|
||||
if canTrace:
|
||||
PresetBulletAI.lerpPosition(self, launcher.currentFocusedBoss.getTrackingAnchor() - Vector2(0, 200), 0.1)
|
||||
@@ -0,0 +1 @@
|
||||
uid://e2doeocb745a
|
||||
@@ -10,15 +10,17 @@ func register():
|
||||
attackCooldownMap[1] = 12000
|
||||
attackCooldownMap[2] = 2000
|
||||
attackCooldownMap[3] = 3000
|
||||
attackCooldownMap[4] = 4000
|
||||
sprintMultiplier = 50
|
||||
func spawn():
|
||||
texture.play("walk")
|
||||
|
||||
func ai():
|
||||
tryAttack(4)
|
||||
PresetEntityAI.follow(self, currentFocusedBoss, 0)
|
||||
PresetEntityAI.distanceAttack(self, currentFocusedBoss, 0, 200, 2)
|
||||
PresetEntityAI.distanceAttack(self, currentFocusedBoss, 200, 700, 1)
|
||||
PresetEntityAI.distanceAction(self, currentFocusedBoss, 700, INF,
|
||||
PresetEntityAI.distanceAttack(self, currentFocusedBoss, 0, 500, 2)
|
||||
PresetEntityAI.distanceAttack(self, currentFocusedBoss, 500, 1000, 1)
|
||||
PresetEntityAI.distanceAction(self, currentFocusedBoss, 1000, INF,
|
||||
func():
|
||||
PresetEntityAI.weightAttack(self, [0, 3], [5, 1], func(index): return index == 3)
|
||||
)
|
||||
@@ -33,13 +35,15 @@ func attack(type):
|
||||
BulletBase.generate(ComponentManager.getBullet("ChickLaser"), self, texture.global_position, deg_to_rad(360.0 / laserCount * i))
|
||||
elif type == 2:
|
||||
var weaponPos = findWeaponAnchor("normal")
|
||||
var target = weaponPos.angle_to_point(currentFocusedBoss.position)
|
||||
var target = weaponPos.angle_to_point(currentFocusedBoss.getTrackingAnchor())
|
||||
firepot.global_rotation = target
|
||||
firepot.shot()
|
||||
BulletBase.generate(ComponentManager.getBullet("FireScan"), self, weaponPos, target)
|
||||
elif type == 3:
|
||||
BulletBase.generate(ComponentManager.getBullet("ChickSprint"), self, position, 0)
|
||||
trySprint()
|
||||
elif type == 4:
|
||||
BulletBase.generate(ComponentManager.getBullet("FoxZhua"), self, findWeaponAnchor("foot"), deg_to_rad(90))
|
||||
return true
|
||||
func sprint():
|
||||
move((currentFocusedBoss.position - position).normalized() * sprintMultiplier, true)
|
||||
|
||||
@@ -66,11 +66,19 @@ static func create(
|
||||
wave.to = to_
|
||||
wave.per = per_
|
||||
return wave
|
||||
static func hasBoss() -> bool:
|
||||
for wave in data:
|
||||
if canSpawn(wave):
|
||||
if wave.isBoss:
|
||||
return true
|
||||
return false
|
||||
static func canSpawn(wave: Wave) -> bool:
|
||||
return wave.from <= current and wave.to >= current and int(current - wave.from) % wave.per == 0
|
||||
static func entityCountOf(wave: Wave) -> int:
|
||||
if wave.from <= current and wave.to >= current and int(current - wave.from) % wave.per == 0:
|
||||
if canSpawn(wave):
|
||||
if wave.isBoss:
|
||||
return 1
|
||||
else:
|
||||
elif !hasBoss():
|
||||
return randi_range(ceil(wave.minCount), floor(wave.maxCount * (1 + GameRule.entityCountBoostPerWave * current)))
|
||||
return 0
|
||||
static func spawn() -> Array:
|
||||
|
||||
Reference in New Issue
Block a user