2026-01-25 19:32:02 +08:00
|
|
|
@tool
|
|
|
|
|
extends Weapon
|
|
|
|
|
|
|
|
|
|
func update(to: int, origin: Dictionary, _entity: EntityBase):
|
2026-03-07 09:08:39 +08:00
|
|
|
origin["atk"] += 1 * to * soulLevel
|
|
|
|
|
origin["fireatk"] += 0.5 * to * soulLevel
|
2026-03-14 07:21:42 +08:00
|
|
|
origin["max-n"] += 2 * (soulLevel - 1)
|
|
|
|
|
origin["count"] *= soulLevel
|
2026-03-07 09:08:39 +08:00
|
|
|
return origin
|
2026-03-14 07:21:42 +08:00
|
|
|
func checkAttack(entity: EntityBase) -> bool:
|
2026-04-11 11:05:59 +08:00
|
|
|
return entity.hasItem({ItemStore.ItemType.BASKETBALL: 1.0 / readStore("count")}) || entity.isEnergyEnough(5)
|
2026-01-25 19:32:02 +08:00
|
|
|
func attack(entity: EntityBase):
|
2026-04-11 11:05:59 +08:00
|
|
|
if !entity.useItem({ItemStore.ItemType.BASKETBALL: 1.0 / readStore("count")}):
|
|
|
|
|
entity.useEnergy(5)
|
2026-03-07 09:27:42 +08:00
|
|
|
for bullet in BulletBase.generate(
|
|
|
|
|
ComponentManager.getBullet("OxygenFire"),
|
|
|
|
|
entity,
|
|
|
|
|
entity.findWeaponAnchor("normal"),
|
|
|
|
|
entity.position.angle_to_point(get_global_mouse_position()),
|
|
|
|
|
):
|
|
|
|
|
if bullet is OxygenFire:
|
|
|
|
|
bullet.baseDamage = readStore("fireatk")
|
|
|
|
|
if MathTool.rate(0.1):
|
|
|
|
|
for i in randi_range(readStore("min-n"), readStore("max-n")):
|
|
|
|
|
for n in BulletBase.generate(
|
|
|
|
|
ComponentManager.getBullet("AcidN"),
|
|
|
|
|
entity,
|
|
|
|
|
bullet.position,
|
|
|
|
|
0,
|
|
|
|
|
):
|
|
|
|
|
if n is AcidN:
|
|
|
|
|
n.baseDamage = readStore("atk")
|
|
|
|
|
n.storm = bullet
|
2026-03-07 09:08:39 +08:00
|
|
|
return true
|