Exemplo n.º 1
0
 private static void AddPiety(Pawn pawn, PietyDef pietyDef, string reason = "")
 {
     if (pietyDef != null)
     {
         pawn.GetReligionComponent().PietyTracker.PietyNeed.Add(new Piety_Memory(pawn, pietyDef, reason));
     }
 }
Exemplo n.º 2
0
 public Piety(Pawn pawn, PietyDef def)
 {
     if (Scribe.mode == LoadSaveMode.Inactive)
     {
         this.pawn = pawn;
         this.def  = def;
     }
 }
        private Piety_Situational TryCreatePiety(PietyDef def)
        {
            if (!def.Worker.CurrentState(this.pawn).ActiveFor(def))
            {
                return((Piety_Situational)null);
            }
            Piety_Situational piety = new Piety_Situational(pawn, def);

            piety.RecalculateState();
            return(piety);
        }
Exemplo n.º 4
0
        public bool ActiveFor(PietyDef def)
        {
            if (!this.Active)
            {
                return(false);
            }
            int index = this.StageIndexFor(def);

            if (index >= 0)
            {
                return(def.Stages.ElementAt(index) != null);
            }
            return(false);
        }
Exemplo n.º 5
0
 private void ColoredRange(Rect r, PietyDef def)
 {
     if (def != null)
     {
         string l = GetRange(def, out Color color);
         GUI.color = color;
         Widgets.Label(r, l);
         GUI.color = Color.white;
     }
     else
     {
         Widgets.Label(r, "-");
     }
 }
Exemplo n.º 6
0
 public int StageIndexFor(PietyDef def)
 {
     return(Mathf.Min(this.StageIndex, def.Stages.Count() - 1));
 }
 public Piety_Situational(Pawn pawn, PietyDef def) : base(pawn, def)
 {
 }
Exemplo n.º 8
0
 private string GetRange(PietyDef def, out Color color)
 {
     color = def.Stages.First().PietyOffset >= 0 ? Color.green : Color.red;
     return($"{def.Stages.First().PietyOffset} {"Religion_To".Translate()} {def.Stages.Last().PietyOffset}");
 }
 public Piety_Memory(Pawn pawn, PietyDef def, string reason = "") : base(pawn, def)
 {
     this.reason = reason;
 }