mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
feat(战斗系统): 优化Kernyr角色的攻击逻辑和碰撞形状
- 将Yangyi子弹的碰撞形状从矩形改为圆形 - 为EntityBase添加攻击互斥状态管理 - 调整Kernyr的攻击冷却时间和互斥规则 - 重写Kernyr的AI攻击逻辑和特殊攻击2的实现
This commit is contained in:
@@ -7,16 +7,17 @@ var attack0State = 0
|
||||
func register():
|
||||
fields[FieldStore.Entity.MAX_HEALTH] = 2000
|
||||
fields[FieldStore.Entity.OFFSET_SHOOT] = 20
|
||||
attackCooldownMap[0] = 3000
|
||||
attackCooldownMap[0] = 2000
|
||||
attackCooldownMap[1] = 100
|
||||
attackCooldownMap[2] = 1000
|
||||
attackCooldownMap[2] = 10000
|
||||
attackMutexes = [2]
|
||||
func ai():
|
||||
tryAttack(0)
|
||||
tryAttack(1)
|
||||
tryAttack(2)
|
||||
# texture.position = Vector2.from_angle(deg_to_rad(timeLived() / 1000.0 * 360)) * 200
|
||||
for i in 3:
|
||||
tryAttack(i)
|
||||
func attack(type: int):
|
||||
if type == 0:
|
||||
for i in randi_range(7, 16):
|
||||
BulletBase.generate(ComponentManager.getBullet("Diamond"), self , position + MathTool.sampleInCircle(20), rotation + deg_to_rad(randf_range(-90, 90)))
|
||||
var states = [
|
||||
Vector2(-1, 1),
|
||||
Vector2(1, 1),
|
||||
@@ -35,5 +36,19 @@ func attack(type: int):
|
||||
)
|
||||
attack1Angle += deg_to_rad(360.0 / 20)
|
||||
elif type == 2:
|
||||
for i in randi_range(7, 16):
|
||||
BulletBase.generate(ComponentManager.getBullet("Diamond"), self , position + MathTool.sampleInCircle(20), rotation + deg_to_rad(randf_range(-90, 90)))
|
||||
var anchor = currentFocusedBoss.position
|
||||
var radius = 600
|
||||
await sprintTo(anchor + Vector2(0, -radius), 0.1)
|
||||
await TickTool.millseconds(2000)
|
||||
var count = 10.0
|
||||
for i in count:
|
||||
await sprintTo(anchor + Vector2.from_angle(deg_to_rad(i / count * 360.0 - 90)) * radius, 0.5)
|
||||
for bullet in BulletBase.generate(
|
||||
ComponentManager.getBullet("Yangyi"),
|
||||
self ,
|
||||
position,
|
||||
0
|
||||
):
|
||||
if bullet is YangyiBullet:
|
||||
bullet.look_at(anchor)
|
||||
await TickTool.millseconds(3000)
|
||||
|
||||
Reference in New Issue
Block a user