1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-27 22:41:56 +08:00

refactor(武器系统): 调整水晶武器伤害计算和子弹行为

重构蓝水晶和紫水晶武器的伤害计算方式,将蓝水晶的基础伤害从3降至2
移除紫水晶子弹的分裂和折射功能,将其逻辑移至BulletBase基类
更新相关场景文件中的显示文本和配置参数
调整角色初始武器配置,移除无用音效资源
This commit is contained in:
2025-12-13 10:55:02 +08:00
parent 698b5a5618
commit 33b2b16b70
7 changed files with 47 additions and 43 deletions
+20 -4
View File
@@ -35,6 +35,7 @@ var isChildRefract: bool = false
var initialSpeed: float = 0
var initialDamage: float = 0
var speedScale: float = 1
var scene: PackedScene = null
func _ready():
initialSpeed = speed
@@ -163,10 +164,24 @@ func succeedToHit(_dmg: float, _entity: EntityBase):
pass
func register():
pass
func split(_index: int, _total: int, _lastBullet: float):
pass
func refract(_entity: EntityBase, _index: int, _total: int, _lastBullet: float):
pass
func split(index: int, total: int, _lastBullet: float):
BulletBase.generate(
scene,
launcher,
position,
rotation + deg_to_rad(360.0 / total * index),
true,
isChildRefract
)
func refract(entity: EntityBase, _index: int, _total: int, _lastBullet: float):
BulletBase.generate(
scene,
launcher,
position,
position.angle_to_point(entity.position) if is_instance_valid(entity) else randf_range(0, deg_to_rad(360)),
isChildSplit,
true
)
static func generate(
bullet: PackedScene,
@@ -187,6 +202,7 @@ static func generate(
instance.isChildRefract = asChildRefract
instance.launcher = launchBy
instance.position = spawnPosition
instance.scene = bullet
instance.rotation = spawnRotation + deg_to_rad(launchBy.fields.get(FieldStore.Entity.OFFSET_SHOOT) * randf_range(-1, 1) * int(!ignoreOffset))
if addToWorld:
WorldManager.rootNode.call_deferred("add_child", instance)