public override void Tick() { base.Tick(); if (this.OptionMorning) { if (Rand.RangeInclusive(6, 10) == GenLocalDate.HourInt(this.Map)) { if (!HeldSermon) { // Log.Message("starting morning sermon"); SermonUtility.ForceSermon(this); this.HeldSermon = true; } } } if (this.OptionEvening) { if (Rand.RangeInclusive(18, 22) == GenLocalDate.HourInt(this.Map)) { if (!HeldSermon) { SermonUtility.ForceSermon(this); this.HeldSermon = true; } } } if (GenLocalDate.HourInt(this.Map) == 1 || GenLocalDate.HourInt(this.Map) == 12) { this.HeldSermon = false; } }
public override void Tick() { base.Tick(); if (this.OptionMorning) { if (Rand.RangeInclusive(6, 10) == GenDate.HourInt) { if (!HeldSermon) { SermonUtility.ForceSermon(this); this.HeldSermon = true; } } } if (this.OptionMorning) { if (Rand.RangeInclusive(18, 22) == GenDate.HourInt) { if (!HeldSermon) { SermonUtility.ForceSermon(this); this.HeldSermon = true; } } } if (this.preacher.CurJob.def == CorruptionDefOfs.HoldSermon) { GetSermonFlock(this); } if (GenDate.HourInt == 1 || GenDate.HourInt == 12) { this.HeldSermon = false; } }
public static void DrawTempleCard(Rect rect, BuildingAltar altar) { GUI.BeginGroup(rect); Rect rect2 = new Rect(rect.x, rect.y + 20f, 250f, 55f); Text.Font = GameFont.Medium; Widgets.Label(rect2, altar.RoomName); Text.Font = GameFont.Small; Rect rect3 = rect2; rect3.y = rect2.yMax + 30f; rect3.width = 200f; rect3.height = 25f; Widgets.Label(rect3, "Preacher".Translate() + ": "); rect3.xMin = rect3.center.x + 10f; string label2 = PreacherLabel(altar); if (Widgets.ButtonText(rect3, label2, true, false, true)) { TempleCardUtility.OpenPreacherSelectMenu(altar); } Rect rect4 = rect3; rect4.y += 35f; rect4.width = 200f; if (Widgets.ButtonText(rect4, "RenameTemple".Translate(), true, false, true)) { Find.WindowStack.Add(new Dialog_RenameTemple(altar)); } Rect rectDebug1 = rect4; rectDebug1.y += 25f; if (DebugSettings.godMode) { if (Widgets.ButtonText(rectDebug1, "ForceSermonDebug".Translate(), true, false, true)) { SermonUtility.ForceSermon(altar); } Rect rectDebug2 = rectDebug1; rectDebug2.y += 25f; if (Widgets.ButtonText(rectDebug2, "ForceListenersDebug".Translate(), true, false, true)) { TempleCardUtility.ForceListenersTest(altar); } } Rect rect5 = rect4; rect5.x = rect4.xMax + 5f; rect5.width = 200f; rect5.y -= 20f; Widgets.CheckboxLabeled(rect5, "MorningSermons".Translate(), ref altar.OptionMorning, false); Rect rect6 = rect5; rect6.y += 20f; Widgets.CheckboxLabeled(rect6, "EveningSermons".Translate(), ref altar.OptionEvening, false); GUI.EndGroup(); }