1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 06:51:54 +08:00

feat(战斗系统): 实现实体格挡效果并增强武器伤害配置

添加ParryEntity效果,用于实体格挡时的视觉表现
修改Tree武器攻击逻辑,增加基础伤害配置
优化Parrier子弹格挡逻辑,修正效果生成位置
This commit is contained in:
2026-03-28 12:25:45 +08:00
parent d9a8af529a
commit 7c1cdc05d4
5 changed files with 74 additions and 4 deletions
+4 -4
View File
@@ -23,11 +23,11 @@ func spawn():
func succeedToHit(_dmg: float, entity: EntityBase):
if parryiedTimes < maxParryTimes:
parryiedTimes += 1
var eff = EffectController.create(ComponentManager.getEffect("Parry"), entity.position)
eff.rotation = position.angle_to_point(entity.position)
var effSpawn = entity.texture.global_position
var eff = EffectController.create(ComponentManager.getEffect("ParryEntity"), effSpawn)
eff.rotation = position.angle_to_point(effSpawn)
eff.shot()
launcher.impluse((position - entity.position).normalized() * 600)
entity.impluse((entity.position - position).normalized() * 600)
entity.impluse((effSpawn - position).normalized() * 600)
func hitBullet(bullet: BulletBase): # 当前子弹与其他子弹相撞
if BulletTool.canDamage(bullet, launcher): # 其他子弹可以使当前子弹的发射者受伤吗?
if parryiedTimes < maxParryTimes && MathTool.rate(parryRate): # 一个刀光最多格挡多少个敌方子弹?
+5
View File
@@ -0,0 +1,5 @@
extends ParryEffect
class_name ParryEntityEffect
func beforeShot():
CameraManager.shake(100, 200)
@@ -0,0 +1 @@
uid://btj8sxcc0m28q
+1
View File
@@ -19,4 +19,5 @@ func attack(entity: EntityBase):
bullet.maxParryTimes = readStore("count")
bullet.maxBallCount = readStore("max")
bullet.reflectRate = readStore("rate")
bullet.baseDamage = readStore("atk")
return true