mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-31 08:21:54 +08:00
feat(战斗): 添加剑砍特效并重构火山子弹碰撞检测
- 新增剑砍音效及特效资源 - 为火山子弹添加命中时触发剑砍特效 - 使用FollowPosition组件重构碰撞检测逻辑 - 简化动画轨道和碰撞体配置
This commit is contained in:
@@ -9,16 +9,15 @@ var count: int = 0
|
||||
var dmg5: float = 0
|
||||
var splitAngle: float = 10
|
||||
|
||||
func register():
|
||||
setupCuttable(0.7)
|
||||
func ai():
|
||||
animator.speed_scale = launcher.fields.get(FieldStore.Entity.ATTACK_SPEED) * speedScale
|
||||
PresetBulletAI.lockLauncher(self, launcher, true)
|
||||
rotation = lerp_angle(
|
||||
rotation,
|
||||
position.angle_to_point(get_global_mouse_position()),
|
||||
rotates
|
||||
)
|
||||
func succeedToHit(_dmg: float, _entity: EntityBase):
|
||||
EffectController.create(ComponentManager.getEffect("SwordCut"), textureSword.global_position).shot()
|
||||
|
||||
func generateShadow():
|
||||
var startAngle = rotation - deg_to_rad(count * splitAngle / 2)
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
@tool
|
||||
extends Node2D
|
||||
|
||||
@export var target: Node2D
|
||||
@export var offsetPosition: Vector2 = Vector2.ZERO
|
||||
@export var offsetRotation: float = 0.0
|
||||
@export var enablePosition: bool = false
|
||||
@export var enableRotation: bool = false
|
||||
|
||||
func _process(_delta):
|
||||
if is_instance_valid(target):
|
||||
if enablePosition:
|
||||
global_position = target.global_position + offsetPosition
|
||||
if enableRotation:
|
||||
global_rotation = target.global_rotation + deg_to_rad(offsetRotation)
|
||||
@@ -0,0 +1 @@
|
||||
uid://ckc6guqib3rno
|
||||
Reference in New Issue
Block a user