public override void NeedInterval() { if (this.curLevelInt < 0f) { this.curLevelInt = 0f; } if (this.curLevelInt < 0.3f && NoPatron == true) { GainPatron(ChaosGods.Undivided, false); if (pawn.Faction == Faction.OfPlayer) { string label = "LetterPatronGained".Translate(); string text2 = "LetterPatronGained_Content".Translate(new object[] { this.pawn.LabelShort, this.Patron.ToString() }); Find.LetterStack.ReceiveLetter(label, text2, LetterType.BadNonUrgent, this.pawn, null); } } if (NoPatron == false) { if (curLevelInt > 0.3f) { curLevelInt = 0.3f; } if (Rand.Range(0f, 0.4f) > (this.pawn.needs.mood.CurLevel + this.CurLevel) && !this.pawn.InMentalState) { MentalStateDef mdef; switch (this.patronInfo.PatronName) { case "Khorne": { mdef = ChaosGodsUtilities.KhorneEffects(this.pawn, this); ChaosGodsUtilities.DoEffectOn(this.pawn, mdef); break; } case "Slaanesh": { mdef = ChaosGodsUtilities.SlaaneshEffects(this.pawn, this); ChaosGodsUtilities.DoEffectOn(this.pawn, mdef); break; } default: { break; } } } } if (curLevelInt > 1f) { curLevelInt = 0.99999f; } }
protected void ThrowPreacherMote(Pawn pawn) { // Log.Message("M1"); MoteBubble moteBubble2 = (MoteBubble)ThingMaker.MakeThing(ThingDefOf.Mote_Speech, null); moteBubble2.SetupMoteBubble(ChaosGodsUtilities.TryGetPreacherIcon(pawn), pawn); moteBubble2.Attach(pawn); GenSpawn.Spawn(moteBubble2, pawn.Position, pawn.Map); }
public static Texture2D TryGetPatronIcon(Pawn pawn) { Need_Soul soul; if ((soul = pawn.needs.TryGetNeed <Need_Soul>()) != null) { return(ChaosGodsUtilities.GetPatronIcon(soul.patronInfo.PatronName)); } return(new Texture2D(10, 10)); }