public override void Load(SerializationReader Reader) { this.village = HistoricEntity.Load(Reader, XRLCore.Core.Game.sultanHistory).GetCurrentSnapshot(); this.amount = Reader.ReadSingle(); this.faction = Factions.get(Reader.ReadString()); int countTales = Reader.ReadInt32(); this.historytales = new List <JournalVillageNote>(); List <JournalVillageNote> allnotes = JournalAPI.GetNotesForVillage(village.entity.id); for (int i = 0; i < countTales; i++) { string thissecretid = Reader.ReadString(); JournalVillageNote note = allnotes.FirstOrDefault(c => c.secretid == thissecretid); if (note != null) { this.historytales.Add(note); } } int counttales = Reader.ReadInt32(); this.tales = new List <string>(); for (int i = 0; i < counttales; i++) { this.tales.Add(Reader.ReadString()); } }
public override string GetStory(acegiak_RomanceChatNode node, HistoricEntitySnapshot entity) { if (Stat.Rnd2.NextDouble() < 0.5f) { var vars = new Dictionary <string, string>(); string storyTag = ((amount > 0) ? "<spice.eros.opinion.patriot.like.story.!random>" : "<spice.eros.opinion.patriot.dislike.story.!random>"); while (this.tales.Count < 5) { vars["*sacredThing*"] = randomGood(); vars["*profaneThing*"] = randomBad(); this.tales.Add(//" &K"+storyTag.Substring(1,storyTag.Count()-2)+"&y\n"+ acegiak_RomanceText.ExpandString( storyTag, entity, vars)); } return(tales[Stat.Rnd2.Next(tales.Count)]); } JournalVillageNote e = historytales[Stat.Rnd2.Next(historytales.Count)]; node.OnLeaveNode = delegate { e.Reveal(); }; return("<Did you know|I've heard that|There is a tale that says> " + e.GetDisplayText() + (amount > 0?" <Isn't that interesting?|It's so fascinating!|At least, that's what I heard.>":" <Isn't that terrible?|Isn't that horrible?|At least, that's what I heard.>")); }