public static bool TryStartFireIn(IntVec3 c, Map map, float fireSize) { if (ChanceToStartFireIn(c, map) <= 0f) { return(false); } OccultFire obj = (OccultFire)ThingMaker.MakeThing(ThingDefOf.Fire); obj.fireSize = fireSize; // Log.Message((obj is Fire).ToString()); obj.occult = true; // make occult fire GenSpawn.Spawn(obj, c, map, Rot4.North); return(true); }
// reduce occult fire taken damage value private static bool Prefix(LocalTargetInfo ___currentTarget, Verb_BeatFire __instance, ref bool __result) { OccultFire fire = (OccultFire)___currentTarget.Thing; Pawn casterPawn = __instance.CasterPawn; if (casterPawn.stances.FullBodyBusy || fire.TicksSinceSpawn == 0) { __result = false; } fire.TakeDamage(new DamageInfo(DamageDefOf.Extinguish, (fire.occult? 24f : 32f), 0f, -1f, __instance.caster)); casterPawn.Drawer.Notify_MeleeAttackOn(fire); __result = true; return(false); }
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); } } }