2026-01-23 23:44:21 +08:00
|
|
|
@tool
|
|
|
|
|
extends Weapon
|
|
|
|
|
|
|
|
|
|
var acids: Array[String] = ["AcidS", "AcidN", "AcidCl", "AcidP", "AcidC"]
|
|
|
|
|
|
|
|
|
|
func update(to: int, origin: Dictionary, _entity: EntityBase):
|
2026-01-23 23:51:46 +08:00
|
|
|
origin["atk"] += 0.075 * to * soulLevel
|
2026-01-23 23:44:21 +08:00
|
|
|
origin["c-atk"] *= soulLevel
|
|
|
|
|
origin["cl-atkspeed"] *= soulLevel
|
|
|
|
|
origin["cl-speed"] *= soulLevel
|
|
|
|
|
origin["n-atk"] *= soulLevel
|
|
|
|
|
origin["p-offset"] *= soulLevel
|
|
|
|
|
origin["s-count-max"] *= soulLevel
|
2026-01-23 23:51:46 +08:00
|
|
|
origin["weakatk"] = 0.05 * soulLevel
|
2026-01-23 23:44:21 +08:00
|
|
|
return origin
|
|
|
|
|
func attack(entity: EntityBase):
|
2026-01-24 07:53:06 +08:00
|
|
|
var acid = MathTool.randomChoiceFrom(acids)
|
2026-01-23 23:44:21 +08:00
|
|
|
for bullet in BulletBase.generate(
|
2026-01-24 07:53:06 +08:00
|
|
|
ComponentManager.getBullet(acid),
|
2026-01-23 23:44:21 +08:00
|
|
|
entity,
|
|
|
|
|
entity.findWeaponAnchor("normal"),
|
2026-01-24 07:53:06 +08:00
|
|
|
(get_global_mouse_position() - entity.findWeaponAnchor("normal")).angle(),
|
|
|
|
|
true,
|
|
|
|
|
acid == "AcidC"
|
2026-01-23 23:44:21 +08:00
|
|
|
):
|
|
|
|
|
if bullet is AcidBulletBase:
|
|
|
|
|
if bullet.acidType == AcidBulletBase.AcidType.STRONG:
|
|
|
|
|
bullet.baseDamage = readStore("atk")
|
|
|
|
|
else:
|
|
|
|
|
bullet.baseDamage = readStore("weakatk")
|
|
|
|
|
if bullet is AcidS:
|
|
|
|
|
bullet.arg1 = readStore("s-count-max")
|
|
|
|
|
if bullet is AcidN:
|
|
|
|
|
bullet.arg1 = readStore("n-atk")
|
|
|
|
|
if bullet is AcidCl:
|
|
|
|
|
bullet.arg1 = readStore("cl-speed")
|
|
|
|
|
bullet.arg2 = readStore("cl-atkspeed")
|
|
|
|
|
if bullet is AcidP:
|
|
|
|
|
bullet.arg1 = readStore("p-offset")
|
2026-01-24 07:53:06 +08:00
|
|
|
bullet.arg2 = EntityTool.findClosetEntity(get_global_mouse_position(), get_tree(), !entity.isPlayer(), entity.isPlayer())
|
2026-01-23 23:44:21 +08:00
|
|
|
if bullet is AcidC:
|
2026-01-24 07:53:06 +08:00
|
|
|
pass
|