1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 06:51:54 +08:00
Files
Dog-Lynx-And-HCN/scripts/Contents/Weapons/BlueCrystal.gd
T

19 lines
820 B
GDScript
Raw Normal View History

@tool
extends Weapon
func update(to: int, origin: Dictionary, _entity: EntityBase):
origin["atk"] += 2 * to * soulLevel
origin["count"] = 1 + 1 * soulLevel
return origin
func attack(entity: EntityBase):
for i in BulletBase.generate(ComponentManager.getBullet("BlueCrystal"), entity, entity.findWeaponAnchor("normal"), deg_to_rad(randf_range(0, 360))):
if i is BlueCrystalBullet:
i.tracer = EntityTool.findClosetEntity(get_global_mouse_position(), get_tree(), !entity.isPlayer(), entity.isPlayer())
i.baseDamage = readStore("atk")
for index in readStore("count"):
for j in BulletBase.generate(ComponentManager.getBullet("Diamond2"), entity, i.position, deg_to_rad(360.0 / readStore("count") * index)):
if j is Diamond2Bullet:
j.baseDamage = readStore("atk")
j.parent = i
return true