import { Container, Graphics } from 'pixi.js' import type { Entity } from '@/game/core/EntityManager' import type { TransformComp, ProjectileComp, RenderComp } from '@/game/components' import { getWorldContainer } from '@/game/rendering/WorldContext' export function createIcicle( entity: Entity, startX: number, startY: number, targetId: number, damage: number, ownerId: number, ): void { const container = new Container() const gfx = new Graphics() gfx.poly([0, -8, -3, 0, 0, 5, 3, 0]) gfx.fill({ color: 0xaaeeff }) gfx.poly([0, -8, -3, 0, 0, 5, 3, 0]) gfx.stroke({ color: 0x6ecbd5, width: 1 }) container.addChild(gfx) container.x = startX container.y = startY getWorldContainer().addChild(container) Object.assign(entity, { transform: { x: startX, y: startY, rotation: 0 } as TransformComp, projectile: { speed: 320, targetId, damage, damageType: 'magic', ownerId, hitRadius: 10, projectileType: 'icicle' } as ProjectileComp, render: { container, hpBar: null, label: null } as RenderComp, }) entity.tags.add('projectile') }