mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-27 22:41:56 +08:00
1910f10e9a
为CyberCat角色添加新的攻击类型3,发射BlockWall子弹 修改子弹资源为长条形并调整碰撞形状 实现子弹命中后的击退效果
29 lines
1016 B
GDScript
29 lines
1016 B
GDScript
extends EntityBase
|
|
class_name CyberCatEntity
|
|
|
|
func register():
|
|
fields[FieldStore.Entity.MAX_HEALTH] = 1500
|
|
fields[FieldStore.Entity.OFFSET_SHOOT] = 0
|
|
fields[FieldStore.Entity.MOVEMENT_SPEED] = 0.2
|
|
attackCooldownMap[0] = 6000
|
|
attackCooldownMap[1] = 10000
|
|
attackCooldownMap[2] = 100
|
|
attackCooldownMap[3] = 200
|
|
func ai():
|
|
PresetEntityAI.follow(self , currentFocusedBoss)
|
|
for i in 3:
|
|
tryAttack(i)
|
|
PresetEntityAI.distanceAttack(self , currentFocusedBoss, 1000, INF, 3)
|
|
func attack(type: int):
|
|
if type == 0:
|
|
BulletBase.generate(ComponentManager.getBullet("Bengbeng"), self , position, 0)
|
|
elif type == 1:
|
|
heal(percentHealth(0.05))
|
|
elif type == 2:
|
|
BulletBase.generate(ComponentManager.getBullet("SCBlock"), self , position, 0)
|
|
elif type == 3:
|
|
for bullet in BulletBase.generate(ComponentManager.getBullet("BlockWall"), self , currentFocusedBoss.hurtbox.global_position, 0):
|
|
if bullet is BlockWallBullet:
|
|
bullet.look_at(position)
|
|
bullet.position -= Vector2.from_angle(bullet.rotation) * 100
|