Add social feed, cooperative parties, guild goals, and operations recovery
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import {bondEvidence,socialEntry,communityTick} from './community';
|
||||
import { z } from 'zod';
|
||||
import { queueAleCommand } from './ale-store';
|
||||
import { luaString } from './ale';
|
||||
@@ -145,14 +146,10 @@ async function remember(store:StateStore,botId:string,request:ConversationReques
|
||||
if(peer){
|
||||
peer.memories.push({id:request.id,text:`I said to ${bot.name}: "${request.message.slice(0,180)}" They replied: "${reply.slice(0,180)}"`,importance:6,source:'observation',at:new Date().toISOString()});
|
||||
peer.memories=peer.memories.slice(-100);
|
||||
for(const [from,to] of [[bot,peer],[peer,bot]]){
|
||||
const existing=from.relationships.find(r=>r.targetId===to.id);
|
||||
if(existing)existing.note='We have spoken together in person.';
|
||||
else from.relationships.push({targetId:to.id,affinity:0,note:'We have spoken together in person.'});
|
||||
from.relationships=from.relationships.slice(-100);
|
||||
}
|
||||
bondEvidence(state,request.id+':bond',bot,peer,'Shared a confirmed conversation.',1);
|
||||
}
|
||||
}
|
||||
socialEntry(state,{id:request.id,at:new Date().toISOString(),kind:'conversation',names:[request.speakerName,bot.name],text:`${request.speakerName}: ${request.message}\n${bot.name}: ${reply}`,status:'confirmed'});
|
||||
bot.simulationBand='foreground';
|
||||
realmEvent(state,'memory',`${bot.name} had a live conversation with ${request.speakerName}.`,bot.id);
|
||||
try{
|
||||
@@ -177,6 +174,7 @@ export async function runConversationTick(store:StateStore,db:D1Database,config:
|
||||
}
|
||||
}
|
||||
await cleanupConversations(db);
|
||||
await communityTick(store,db);
|
||||
const request=await leaseConversation(db);
|
||||
if(!request)return {ok:true,ran:false,reason:'No player conversation waiting'};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user