Consumable host: one initialiser for gear and running effects; tests pin overlap, lifetime, per-design cooldown, refit
Entity.Activate re-initialises the running consumable effects through the same InitializeBehaviors that initialises gear and ActivateConsumable, so a consumable active across deactivate/refit/activate retargets to the new items. ConsumableTests gains the stackable overlap/multiply, shared-entry detach, expiry-boundary, per-design cooldown and refit facts. StatResolverTests' expiry test builds its consumable through ItemManager.CreateInstance. Not yet built or run; verification follows in a later commit message. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
f79cf8b7a7
commit
29c5f7aba1
3 changed files with 109 additions and 11 deletions
|
|
@ -441,7 +441,7 @@ public sealed class StatResolverTests : IDisposable
|
|||
for (var i = 0; i < 20; i++)
|
||||
{
|
||||
var lot = items.Lots.Add(new Lot { Design = cache.RefOf<ItemData>(boosterData), Origin = new Attributed(), Quality = .5f, Roles = new List<RoleFill>() });
|
||||
var consumableItem = new ConsumableItem { Data = cache.RefOf<ItemData>(boosterData), Lot = lot };
|
||||
var consumableItem = Assert.IsType<ConsumableItem>(items.CreateInstance(lot));
|
||||
ship.ActivateConsumable(consumableItem);
|
||||
|
||||
// Duration is 0.01s; one 1-second tick expires it and drives Entity.Update's expiry branch.
|
||||
|
|
|
|||
Loading…
Reference in a new issue