class_name EmitContext extends RefCounted ## Everything an emitter is allowed to see. Keeping this narrow is what lets a ## unit test fire a boss pattern into a bare [BulletPool] with no world at all. var pool: BulletPool ## Where the shots come from (the emitting actor's position). var origin := Vector2.ZERO ## Nearest live player, used by aimed emitters. Falls back to [member origin] ## plus a down vector when nobody is alive. var target := Vector2.ZERO var has_target := false ## Ticks since the emitting actor entered its current phase. var local_tick := 0 ## How many times this emitter has fired in this phase. Drives spin/step. var shot_index := 0 var rng: RandomNumberGenerator func aim_angle() -> float: if not has_target: return PI * 0.5 return (target - origin).angle()