@tool extends Weapon var roundBullets: Array[MagicMissleBullet] = [] func update(to: int, origin: Dictionary, _entity: EntityBase): origin["atk"] += 1 * to * soulLevel origin["cursor-m"] += 0.2 * to * soulLevel origin["missle-m"] += 0.02 * to * soulLevel origin["track"] += 1 * to * soulLevel origin["G"] *= 1.25 ** (soulLevel - 1) origin["count"] += 1 * (soulLevel - 1) return origin func loopStart(entity: EntityBase): for bullet in BulletBase.generate( ComponentManager.getBullet("MagicMissle"), entity, get_global_mouse_position() + Vector2.from_angle(randf_range(0, 2 * PI)) * readStore("track"), 0 ): if bullet is MagicMissleBullet: bullet.look_at(get_global_mouse_position()) bullet.rotation += PI / 2 bullet.speedV2 += Vector2.from_angle(bullet.rotation) * sqrt((readStore("G") * readStore("cursor-m") / readStore("track") ** 2) * readStore("track")) / 120 bullet.roundBullets = roundBullets bullet.baseDamage = readStore("atk") bullet.powerScale = readStore("count") roundBullets.append(bullet) return true func loopExit(_entity: EntityBase): for bullet in roundBullets: if is_instance_valid(bullet): bullet.accelerating = false roundBullets.clear()