2026-04-03 18:29:14 +08:00
|
|
|
@tool
|
|
|
|
|
extends Weapon
|
|
|
|
|
|
2026-04-03 19:24:27 +08:00
|
|
|
func update(to: int, origin: Dictionary, _entity: EntityBase):
|
2026-05-08 16:31:11 +08:00
|
|
|
origin["atk"] += 3 * to * soulLevel
|
2026-04-03 19:24:27 +08:00
|
|
|
origin["rate1"] *= soulLevel
|
2026-05-08 16:34:28 +08:00
|
|
|
origin["rate2"] += 0.1 * (soulLevel - 1)
|
2026-04-03 19:24:27 +08:00
|
|
|
return origin
|
2026-04-05 07:50:24 +08:00
|
|
|
func checkAttack(entity: EntityBase) -> bool:
|
2026-05-08 16:18:13 +08:00
|
|
|
return len(entity.getOrCreateCycleTimer("parry", 2000, 100).bullets) > 2
|
2026-04-03 18:29:14 +08:00
|
|
|
func attack(entity: EntityBase):
|
2026-04-05 07:44:04 +08:00
|
|
|
var parryCounter = entity.getOrCreateCycleTimer("parry", 2000, 100)
|
2026-04-03 18:29:14 +08:00
|
|
|
for bullet in BulletBase.generate(
|
|
|
|
|
ComponentManager.getBullet("Wuwei"),
|
|
|
|
|
entity,
|
|
|
|
|
entity.position,
|
|
|
|
|
entity.position.angle_to_point(get_global_mouse_position())
|
|
|
|
|
):
|
|
|
|
|
if bullet is WuweiBullet:
|
|
|
|
|
bullet.baseDamage = readStore("atk")
|
2026-04-03 19:24:27 +08:00
|
|
|
bullet.baseDamage *= max(-0.99, readStore("rate1") * (entity.fields[FieldStore.Entity.MAX_HEALTH] - entity.health)) + 1
|
2026-05-08 16:18:13 +08:00
|
|
|
bullet.rate2 = readStore("rate2")
|
|
|
|
|
for bulle in parryCounter.bullets.slice(0, 3):
|
2026-04-05 07:44:04 +08:00
|
|
|
if bulle is ParryBallBullet:
|
|
|
|
|
bulle.tryDestroy()
|
2026-04-05 07:50:24 +08:00
|
|
|
parryCounter.forceFilter()
|
2026-04-03 18:29:14 +08:00
|
|
|
return true
|