Пример #1
0
        public static void ApplyAllyInteraction(IncidentDef def, StorytellerCompProperties_FactionInteraction fi)
        {
            StorytellerCompProperties_FactionInteraction comp;

            if (TryGetAllyInteraction(def, out comp))
            {
                comp.minDaysPassed        = fi.minDaysPassed;
                comp.baseIncidentsPerYear = fi.baseIncidentsPerYear;
                comp.minSpacingDays       = fi.minSpacingDays;
                comp.minDaysPassed        = fi.minDaysPassed;
            }
        }
Пример #2
0
 private static bool TryGetAllyInteraction(IncidentDef def, out StorytellerCompProperties_FactionInteraction comp)
 {
     if (Current.Game != null && Current.Game.storyteller != null)
     {
         StorytellerDef d = Current.Game.storyteller.def;
         foreach (StorytellerCompProperties c in d.comps)
         {
             comp = c as StorytellerCompProperties_FactionInteraction;
             if (comp != null && comp.incident == def)
             {
                 return(true);
             }
         }
     }
     comp = null;
     return(false);
 }