mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 15:01:53 +08:00
feat(武器): 增强酸风武器功能并优化代码
- 为磷酸子弹添加追踪功能 - 移除碳酸子弹的散射效果 - 增加硫酸子弹的最大溅射数量 - 优化变量类型声明 - 更新武器描述文本以反映新功能
This commit is contained in:
@@ -7,9 +7,9 @@ enum AcidType {
|
||||
}
|
||||
@export var acidType: AcidType = AcidType.STRONG
|
||||
|
||||
var arg1: float = 0
|
||||
var arg2: float = 0
|
||||
var arg3: float = 0
|
||||
var arg1 = 0
|
||||
var arg2 = 0
|
||||
var arg3 = 0
|
||||
|
||||
func register():
|
||||
scale.y *= MathTool.randomChoiceFrom([-1, 1])
|
||||
|
||||
@@ -2,4 +2,8 @@ extends AcidBulletBase
|
||||
class_name AcidP
|
||||
|
||||
func succeedToHit(_dmg: float, entity: EntityBase):
|
||||
entity.fields[FieldStore.Entity.OFFSET_SHOOT] = clamp(entity.fields[FieldStore.Entity.OFFSET_SHOOT] + arg1, 0, INF)
|
||||
entity.fields[FieldStore.Entity.OFFSET_SHOOT] = clamp(entity.fields[FieldStore.Entity.OFFSET_SHOOT] + arg1, 0, INF)
|
||||
func ai():
|
||||
super.ai()
|
||||
if is_instance_valid(arg2):
|
||||
PresetBulletAI.trace(self, arg2.position, 0.01)
|
||||
|
||||
@@ -14,11 +14,14 @@ func update(to: int, origin: Dictionary, _entity: EntityBase):
|
||||
origin["weakatk"] = 0.05 * soulLevel
|
||||
return origin
|
||||
func attack(entity: EntityBase):
|
||||
var acid = MathTool.randomChoiceFrom(acids)
|
||||
for bullet in BulletBase.generate(
|
||||
ComponentManager.getBullet(MathTool.randomChoiceFrom(acids)),
|
||||
ComponentManager.getBullet(acid),
|
||||
entity,
|
||||
entity.findWeaponAnchor("normal"),
|
||||
(get_global_mouse_position() - entity.findWeaponAnchor("normal")).angle()
|
||||
(get_global_mouse_position() - entity.findWeaponAnchor("normal")).angle(),
|
||||
true,
|
||||
acid == "AcidC"
|
||||
):
|
||||
if bullet is AcidBulletBase:
|
||||
if bullet.acidType == AcidBulletBase.AcidType.STRONG:
|
||||
@@ -34,5 +37,6 @@ func attack(entity: EntityBase):
|
||||
bullet.arg2 = readStore("cl-atkspeed")
|
||||
if bullet is AcidP:
|
||||
bullet.arg1 = readStore("p-offset")
|
||||
bullet.arg2 = EntityTool.findClosetEntity(get_global_mouse_position(), get_tree(), !entity.isPlayer(), entity.isPlayer())
|
||||
if bullet is AcidC:
|
||||
bullet.rotation += deg_to_rad(randf_range(-1, 1) * 15)
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user