mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
feat(战斗系统): 调整能量块攻击逻辑和扫帚子弹属性
- 为扫帚子弹添加基础伤害属性并调整碰撞盒位置 - 扩展能量块攻击冷却时间配置,增加多种攻击类型 - 重构攻击逻辑,支持多类型攻击和互斥控制 - 优化子弹生成逻辑,根据类型执行不同行为
This commit is contained in:
@@ -242,6 +242,7 @@ size = Vector2(259.81308, 36.189156)
|
||||
script = ExtResource("2_23nu4")
|
||||
displayName = "扫帚"
|
||||
speed = 15.0
|
||||
baseDamage = 20.0
|
||||
motionType = 0
|
||||
penerate = 1.0
|
||||
autoSpawnAnimation = true
|
||||
@@ -268,8 +269,8 @@ local_coords = true
|
||||
process_material = SubResource("ParticleProcessMaterial_h2e5u")
|
||||
|
||||
[node name="hitbox" parent="." index="1" unique_id=175349408 node_paths=PackedStringArray("target")]
|
||||
position = Vector2(439.70004, 16.243788)
|
||||
rotation = -3.1046665
|
||||
position = Vector2(0.3503607, 439.99988)
|
||||
rotation = -1.5715926
|
||||
scale = Vector2(2, 2)
|
||||
shape = SubResource("RectangleShape2D_ccsa1")
|
||||
script = ExtResource("3_ihf3m")
|
||||
|
||||
@@ -7,16 +7,22 @@ func register():
|
||||
func(damage: float, bullet: BulletBase, _crit: bool):
|
||||
bullet.launcher.storeEnergy(damage)
|
||||
)
|
||||
attackCooldownMap[0] = 0
|
||||
attackCooldownMap[1] = 3000
|
||||
attackCooldownMap[0] = 6000
|
||||
attackCooldownMap[1] = 10000
|
||||
attackCooldownMap[2] = 4000
|
||||
attackCooldownMap[3] = 8000
|
||||
attackCooldownMap[4] = 3000
|
||||
attackCooldownMap[5] = 2000
|
||||
attackCooldownMap[6] = 5000
|
||||
attackMutexes = [1, 4]
|
||||
func ai():
|
||||
tryAttack(0)
|
||||
tryAttack(1)
|
||||
for i in 7:
|
||||
tryAttack(i, [1, 3])
|
||||
func attack(type: int):
|
||||
if type == 0:
|
||||
BulletBase.generate(ComponentManager.getBullet("SwingSword"), self , getTrackingAnchor(), getTrackingAnchor().angle_to_point(currentFocusedPosition))
|
||||
elif type == 5:
|
||||
var track = getTrackingAnchor()
|
||||
var bullet = BulletTool.findClosetBulletCanDamage(track, get_tree(), self , 200)
|
||||
if is_instance_valid(bullet):
|
||||
BulletBase.generate(ComponentManager.getBullet("Parrier"), self , track, track.angle_to_point(bullet.position))
|
||||
elif type == 1:
|
||||
BulletBase.generate(ComponentManager.getBullet("SwingSword"), self , getTrackingAnchor(), getTrackingAnchor().angle_to_point(currentFocusedPosition))
|
||||
|
||||
Reference in New Issue
Block a user