## StatusInstance — 运行时状态实例（平铺数组元素）
## 权威来源：combat_mechanics_depth.md §3.2.5
extends RefCounted
class_name StatusInstance

var entity_id:          int             = -1
var status_type_id:     int             = 0
var stacks:             int             = 1
var remaining_duration: float           = 0.0
var tick_accumulator:   float           = 0.0
var owner_id:           int             = -1   # Root Source（击杀归属）
var type_def:           StatusTypeDef   = null

func setup(entity: int, typedef: StatusTypeDef, stacks_count: int, dur: float, source: int) -> void:
	entity_id          = entity
	status_type_id     = typedef.id if typedef else 0
	type_def           = typedef
	stacks             = max(1, stacks_count)
	remaining_duration = dur
	tick_accumulator   = 0.0
	owner_id           = source
