mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-31 08:21:54 +08:00
feat(武器/特效): 新增扶桑元神武器及爆炸特效
添加扶桑元神武器相关资源及功能实现,包括: - 新增武器图标、描述和属性配置 - 实现格挡子弹并生成乾坤剑的逻辑 - 添加符咒爆炸特效及相关动画资源 - 调整乾坤剑伤害值和生成位置 - 优化武器特效控制器支持纹理动画
This commit is contained in:
@@ -3,9 +3,13 @@ class_name ParrierBullet
|
||||
|
||||
@export var parryRate: float = 1
|
||||
|
||||
var parryiedTimes: int = 0
|
||||
var maxParryTimes: int = 1
|
||||
|
||||
func hitBullet(bullet: BulletBase): # 当前子弹与其他子弹相撞
|
||||
if BulletTool.canDamage(bullet, launcher): # 其他子弹可以使当前子弹的发射者受伤吗?
|
||||
if MathTool.rate(parryRate):
|
||||
if parryiedTimes < maxParryTimes && MathTool.rate(parryRate): # 一个刀光最多格挡多少个敌方子弹?
|
||||
parryiedTimes += 1
|
||||
# 生成格挡特效
|
||||
var eff = EffectController.create(ComponentManager.getEffect("Parry"), position + (bullet.position - position).normalized() * 150) # 从子弹位置,面向其他子弹的方向前进150
|
||||
eff.modulate = bullet.modulate.blend(bullet.texture.modulate)
|
||||
|
||||
@@ -20,6 +20,6 @@ func succeedToHit(_dmg: float, entity: EntityBase): # 当撞到敌人时
|
||||
0
|
||||
):
|
||||
if bullet is QKSwordBullet:
|
||||
bullet.position = entity.texture.global_position + MathTool.sampleInRing(50, 200)
|
||||
bullet.position = entity.texture.global_position + MathTool.sampleInRing(200, 500)
|
||||
bullet.tracer = entity
|
||||
bullet.look_at(entity.getTrackingAnchor()) # 生成的乾坤剑面向敌人
|
||||
|
||||
@@ -3,11 +3,15 @@ class_name QKSwordBullet
|
||||
|
||||
var tracer: EntityBase
|
||||
var attackedTracer: bool = false
|
||||
var spawnSpeed: float = 1
|
||||
|
||||
func register():
|
||||
spawnSpeed = randf_range(0.25, 1.75)
|
||||
animator.speed_scale = spawnSpeed
|
||||
func ai():
|
||||
if is_instance_valid(tracer) && !attackedTracer:
|
||||
look_at(tracer.getTrackingAnchor())
|
||||
if timeLived() > 1000:
|
||||
if timeLived() > 1000 / spawnSpeed:
|
||||
PresetBulletAI.forward(self , rotation) # 前进
|
||||
hitbox.disabled = false
|
||||
else:
|
||||
@@ -16,6 +20,6 @@ func succeedToHit(_dmg: float, entity: EntityBase):
|
||||
if entity == tracer:
|
||||
attackedTracer = true # 只需要命中一次目标就不需要继续前进了
|
||||
EffectController.create(
|
||||
ComponentManager.getEffect("CatBoom"),
|
||||
ComponentManager.getEffect("FooExplosion"),
|
||||
entity.texture.global_position
|
||||
).shot()
|
||||
|
||||
Reference in New Issue
Block a user