mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
feat(角色): 更新KukeMC角色资源与逻辑
添加KukeMC角色的新动画资源(pico-a.svg, pico-b.svg, pico-c.svg, pico-d.svg) 调整角色基础属性和技能逻辑: - 增加百分比生命值计算方法 - 修改攻击冷却时间和治疗机制 - 优化子弹生成逻辑 - 更新角色纹理和动画帧 - 调整碰撞框大小和位置
This commit is contained in:
@@ -4,7 +4,7 @@ class_name KukeChild
|
||||
var masterMine: KukeMC
|
||||
|
||||
func register():
|
||||
fields[FieldStore.Entity.MAX_HEALTH] = 20
|
||||
fields[FieldStore.Entity.MAX_HEALTH] = 30
|
||||
fields[FieldStore.Entity.MOVEMENT_SPEED] = 0.35
|
||||
attackCooldownMap[0] = 100
|
||||
attackCooldownMap[1] = 8000
|
||||
@@ -22,4 +22,4 @@ func attack(type):
|
||||
BulletBase.generate(ComponentManager.getBullet("HeavyCrystal"), self, findWeaponAnchor("normal"), position.angle_to_point(currentFocusedBoss.position))
|
||||
func kill():
|
||||
if is_instance_valid(masterMine):
|
||||
masterMine.tryHeal(100)
|
||||
masterMine.tryHeal(percentHealth(0.05))
|
||||
|
||||
@@ -3,27 +3,29 @@ class_name KukeMC
|
||||
|
||||
var canSummon: bool = true
|
||||
|
||||
func spawn():
|
||||
texture.play("walk")
|
||||
func register():
|
||||
fields[FieldStore.Entity.MAX_HEALTH] = 3500
|
||||
fields[FieldStore.Entity.MOVEMENT_SPEED] = 0.5
|
||||
attackCooldownMap[0] = 2000
|
||||
attackCooldownMap[1] = 5000
|
||||
attackCooldownMap[0] = 4000
|
||||
attackCooldownMap[1] = 4000
|
||||
attackCooldownMap[2] = 20000
|
||||
attackCooldownMap[3] = 2000
|
||||
attackCooldownMap[3] = 8000
|
||||
inventory[ItemStore.ItemType.APPLE] = INF
|
||||
healthChanged.connect(
|
||||
func(h):
|
||||
if h < fields[FieldStore.Entity.MAX_HEALTH] * 0.25:
|
||||
func(_h):
|
||||
if getHealthPercent() < 0.25:
|
||||
canSummon = false
|
||||
for child in EntityTool.findEntityByClass("KukeChild", get_tree()):
|
||||
if child.masterMine == self:
|
||||
child.tryKill()
|
||||
tryHeal(200)
|
||||
tryHeal(percentHealth(0.1))
|
||||
)
|
||||
func ai():
|
||||
PresetEntityAI.follow(self, currentFocusedBoss, 500)
|
||||
for i in len(attackCooldownMap.keys()):
|
||||
tryAttack(i)
|
||||
tryAttack(i, i in [0])
|
||||
func attack(type):
|
||||
if type == 0:
|
||||
for i in randi_range(8, 16):
|
||||
@@ -32,18 +34,18 @@ func attack(type):
|
||||
if bullet is BulletBase:
|
||||
bullet.baseDamage *= 0.5
|
||||
await TickTool.millseconds(randi_range(10, 50))
|
||||
elif type == 1 and health < fields[FieldStore.Entity.MAX_HEALTH] * 0.5 and canSummon:
|
||||
elif type == 1 and getHealthPercent() < 0.5 and canSummon:
|
||||
for i in randi_range(1, 2):
|
||||
var child = EntityBase.generate(ComponentManager.getCharacter("KukeChild"), position + MathTool.sampleInCircle(500))
|
||||
child.currentFocusedBoss = currentFocusedBoss
|
||||
child.masterMine = self
|
||||
elif type == 2:
|
||||
var countOfBullet = randi_range(40, 50)
|
||||
var countOfBranch = randi_range(1, 3)
|
||||
for bulletIndex in countOfBullet:
|
||||
for branchIndex in countOfBranch:
|
||||
var bulletCount = randi_range(20, 40)
|
||||
var branchCount = randi_range(1, 3)
|
||||
for bulletIndex in bulletCount:
|
||||
for branchIndex in branchCount:
|
||||
fields[FieldStore.Entity.OFFSET_SHOOT] = 0
|
||||
for bullet in BulletBase.generate(ComponentManager.getBullet("PurpleCrystal"), self, findWeaponAnchor("normal"), deg_to_rad(360.0 / countOfBullet * bulletIndex + 360.0 / countOfBranch * branchIndex)):
|
||||
for bullet in BulletBase.generate(ComponentManager.getBullet("PurpleCrystal"), self, findWeaponAnchor("normal"), deg_to_rad(360.0 / bulletCount * bulletIndex + 360.0 / branchCount * branchIndex)):
|
||||
if bullet is BulletBase:
|
||||
bullet.baseDamage *= 0.5
|
||||
await TickTool.millseconds(100)
|
||||
|
||||
Reference in New Issue
Block a user