mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-27 22:41:56 +08:00
c80d3af6f9
新增狗、猫、鸡、MTY等角色的图片和动画资源,并调整部分角色的属性和动画逻辑。包括: - 添加狗角色的行走动画和图片资源 - 更新猫角色的行走动画和碰撞体 - 调整鸡角色的属性和动画帧 - 修改MTY角色的攻击冷却时间 - 更新彩虹糖的数值属性 - 优化链式机枪的攻击力属性 - 添加企鹅角色的多帧动画资源 - 更新熊角色的行走动画和面具资源 同时修复了部分角色的碰撞体大小和位置问题。
27 lines
789 B
GDScript
27 lines
789 B
GDScript
extends EntityBase
|
|
class_name MTY
|
|
|
|
func register():
|
|
fields[FieldStore.Entity.MAX_HEALTH] = 400
|
|
fields[FieldStore.Entity.MOVEMENT_SPEED] = 0.9
|
|
attackCooldownMap[0] = 1000
|
|
attackCooldownMap[1] = 250
|
|
sprintMultiplier = 5
|
|
func spawn():
|
|
texture.play("walk")
|
|
func ai():
|
|
PresetEntityAI.follow(self, currentFocusedBoss)
|
|
tryAttack(0)
|
|
tryAttack(1)
|
|
func attack(type: int):
|
|
if type == 0:
|
|
trySprint()
|
|
elif type == 1:
|
|
BulletBase.generate(ComponentManager.getBullet("MTYSprint"), self, position, 0)
|
|
return true
|
|
func sprint():
|
|
var target = BulletTool.findClosetBulletCanDamage(position, get_tree(), self)
|
|
if is_instance_valid(target):
|
|
var dir = (target.position - position).rotated(MathTool.randomChoiceFrom([-1, 1]) * deg_to_rad(90))
|
|
move(dir.normalized() * sprintMultiplier, true)
|