mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
feat(角色): 更新熊角色资源与攻击逻辑
添加新的熊角色贴图和遮罩资源 实现新的攻击类型7并调整现有攻击逻辑 优化动画和碰撞体设置 移除旧的SVG资源文件
This commit is contained in:
@@ -25,6 +25,8 @@ func spawn():
|
||||
await TickTool.millseconds(2500)
|
||||
points.emitting = true
|
||||
func setColor(color: Color):
|
||||
track.material.set_shader_parameter("color", color)
|
||||
var result = Color(color)
|
||||
result.a = 0
|
||||
track.material.set_shader_parameter("color", result)
|
||||
sword.modulate = color
|
||||
points.process_material.color = color
|
||||
points.process_material.color = color
|
||||
|
||||
@@ -13,11 +13,12 @@ func register():
|
||||
attackCooldownMap[4] = 4500
|
||||
attackCooldownMap[5] = 5500
|
||||
attackCooldownMap[6] = 10000
|
||||
sprintMultiplier = 60
|
||||
attackCooldownMap[7] = 9000
|
||||
sprintMultiplier = 80
|
||||
func spawn():
|
||||
texture.play("walk")
|
||||
func ai():
|
||||
PresetEntityAI.follow(self, currentFocusedBoss, 200)
|
||||
PresetEntityAI.follow(self, currentFocusedBoss, 400)
|
||||
for i in len(attackCooldownMap.keys()):
|
||||
tryAttack(i)
|
||||
func attack(type):
|
||||
@@ -61,10 +62,9 @@ func attack(type):
|
||||
return false
|
||||
elif type == 5:
|
||||
playSound("attack5")
|
||||
var target = currentFocusedBoss.position
|
||||
var count = randi_range(10, 15)
|
||||
for i in range(count):
|
||||
for bullet in BulletBase.generate(preload("res://components/Bullets/BossAttack/Bear/LightGun.tscn"), self, target, 0):
|
||||
for bullet in BulletBase.generate(preload("res://components/Bullets/BossAttack/Bear/LightGun.tscn"), self, currentFocusedBoss.position, 0):
|
||||
bullet.rotation = deg_to_rad(360.0 / count * i)
|
||||
await TickTool.millseconds(1670.0 / count)
|
||||
return false
|
||||
@@ -72,10 +72,23 @@ func attack(type):
|
||||
playSound("attack6")
|
||||
for i in 16:
|
||||
for bullet in BulletBase.generate(preload("res://components/Bullets/BossAttack/Bear/LightGun.tscn"), self, currentFocusedBoss.position, 0):
|
||||
bullet.position += MathTool.randv2_range(300)
|
||||
bullet.look_at(currentFocusedBoss.position)
|
||||
bullet.position += MathTool.randv2_range(600)
|
||||
bullet.look_at(currentFocusedBoss.position + MathTool.randv2_range(50))
|
||||
await TickTool.millseconds(100)
|
||||
return false
|
||||
elif type == 7:
|
||||
playSound("attack7")
|
||||
var angle = deg_to_rad(70)
|
||||
for j in 4:
|
||||
var initAngle = randf_range(0, 360)
|
||||
for i in 16:
|
||||
for bullet in BulletBase.generate(preload("res://components/Bullets/BossAttack/Bear/LightGun.tscn"), self, currentFocusedBoss.position, 0):
|
||||
bullet.rotation_degrees += initAngle
|
||||
bullet.rotation -= angle / 2
|
||||
bullet.rotation += angle / 16 * i
|
||||
bullet.look_at(currentFocusedBoss.position)
|
||||
await TickTool.millseconds(1000)
|
||||
return false
|
||||
return true
|
||||
func sprint():
|
||||
move(Vector2(sign((currentFocusedBoss.position - position).x * sprintMultiplier), 0), true)
|
||||
|
||||
Reference in New Issue
Block a user