mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-06-02 17:31:55 +08:00
4f6225747a
- 修改Wave.gd中data的赋值逻辑,始终使用WAVE_JUSTJOKE - 调整Kernyr角色的攻击冷却时间从1000增加到2000 - 更换Kernyr角色的贴图资源 - 新增A-Tree.tscn场景文件,包含武器和属性配置
39 lines
1.1 KiB
GDScript
39 lines
1.1 KiB
GDScript
extends EntityBase
|
|
class_name Kernyr
|
|
|
|
var attack1Angle = 0
|
|
var attack0State = 0
|
|
|
|
func register():
|
|
fields[FieldStore.Entity.MAX_HEALTH] = 2000
|
|
fields[FieldStore.Entity.OFFSET_SHOOT] = 20
|
|
attackCooldownMap[0] = 2000
|
|
attackCooldownMap[1] = 100
|
|
attackCooldownMap[2] = 1000
|
|
func ai():
|
|
tryAttack(0)
|
|
tryAttack(1)
|
|
tryAttack(2)
|
|
func attack(type: int):
|
|
if type == 0:
|
|
var states = [
|
|
Vector2(-1, 1),
|
|
Vector2(1, 1),
|
|
Vector2(1, -1),
|
|
Vector2(-1, -1)
|
|
]
|
|
await sprintTo(currentFocusedBoss.position + 400 * states[attack0State % len(states)], 0.1)
|
|
attack0State += 1
|
|
BulletBase.generate(ComponentManager.getBullet("HeavyCrystal"), self , findWeaponAnchor("normal"), position.angle_to_point(currentFocusedBoss.position))
|
|
elif type == 1:
|
|
BulletBase.generate(
|
|
ComponentManager.getBullet("Yangyi"),
|
|
self ,
|
|
position,
|
|
attack1Angle
|
|
)
|
|
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)))
|