public static void TryAttachOccultFire(this Thing t, float fireSize) { if (t.CanEverAttachFire() && !t.HasAttachment(ThingDefOf.Fire)) // ThingDefOf.Fire { OccultFire obj = (OccultFire)ThingMaker.MakeThing(ThingDefOf.Fire); obj.fireSize = fireSize; obj.occult = true; // make occult fire obj.AttachTo(t); GenSpawn.Spawn(obj, t.Position, t.Map, Rot4.North); Pawn pawn = t as Pawn; if (pawn != null) { pawn.jobs.StopAll(); pawn.records.Increment(RecordDefOf.TimesOnFire); } } }