Support persistent residents with normal resurrection and closer companions
Core tests / core (push) Successful in 2m54s
Core tests / core (push) Successful in 2m54s
This commit is contained in:
@@ -92,3 +92,15 @@ test('unverified bridge death fails safe without erasing identity',async()=>{
|
||||
await applyAuthoritativeAleEvent(store,'player.snapshot',{roster:true,observedAt:100,characterGuids:[123]});
|
||||
assert.equal(store.state.bots.filter(b=>b.status==='online').length,0);
|
||||
});
|
||||
|
||||
test('normal resurrection mode preserves memories and identity across death and later snapshot',async()=>{
|
||||
const store=new Store();store.state.settings.hardcore.enabled=false;
|
||||
const bot=store.state.bots.find(b=>b.id==='bot-6');
|
||||
bot.memories.push({id:'keep',text:'My companion',importance:8,source:'observation',at:new Date().toISOString()});
|
||||
const payload={name:bot.name,isBot:true,characterGuid:99,accountId:2,healthPct:0};
|
||||
await applyAuthoritativeAleEvent(store,'player.killed-by-creature',payload);
|
||||
assert.notEqual(store.state.bots.find(b=>b.id===bot.id).status,'dead');
|
||||
await applyAuthoritativeAleEvent(store,'player.snapshot',{...payload,healthPct:100});
|
||||
const revived=store.state.bots.find(b=>b.id===bot.id);
|
||||
assert.equal(revived.death,undefined);assert.ok(revived.memories.some(m=>m.id==='keep'));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user