예제 #1
0
        // Token: 0x06000026 RID: 38 RVA: 0x00002E0C File Offset: 0x0000100C
        public static void TryAttachFire(this Thing t, float fireSize)
        {
            if (t.Map == null)
            {
                return;
            }
            if (!t.Spawned)
            {
                return;
            }
            if (!t.CanEverAttachFire())
            {
                return;
            }
            if (t.HasAttachment(ThingDefOf.GreenFire))
            {
                return;
            }
            Fire fire = (Fire)ThingMaker.MakeThing(ThingDefOf.GreenFire, null);

            fire.fireSize = fireSize;
            fire.AttachTo(t);
            GenSpawn.Spawn(fire, t.Position, t.Map, Rot4.North, WipeMode.Vanish, false);
            if (t is Pawn pawn)
            {
                pawn.jobs.StopAll(false);
                pawn.records.Increment(RecordDefOf.TimesOnFire);
            }
        }
예제 #2
0
        public static void TryAttachFire(Pawn t, float fireSize)
        {
            Fire fire = (Fire)ThingMaker.MakeThing(ThingDefOf.Fire, null);

            fire.fireSize = fireSize;
            fire.AttachTo(t);
            GenSpawn.Spawn(fire, t.Position, t.Map, Rot4.North, WipeMode.Vanish, false);
            // t.jobs.StopAll(false, true);
            t.records.Increment(RecordDefOf.TimesOnFire);
            //t.mindState.mentalStateHandler.TryStartMentalState(DefDatabase<MentalStateDef>.GetNamed("AB_LavaPanicFlee", true), null, true, false, null, false);
        }
예제 #3
0
 public override void DoDamage(IntVec3 pos)
 {
     base.DoDamage(pos);
     try
     {
         if (pos != this.launcher.Position && this.launcher.Map != null && GenGrid.InBounds(pos, this.launcher.Map))
         {
             var list = this.launcher.Map.thingGrid.ThingsListAt(pos);
             for (int num = list.Count - 1; num >= 0; num--)
             {
                 if (list[num].def != this.def && list[num] != this.launcher && list[num].def != ThingDefOf.Fire && (!(list[num] is Mote) && (!(list[num] is Filth))))
                 {
                     if (!list.Where(x => x.def == ThingDefOf.Fire).Any())
                     {
                         CompAttachBase compAttachBase = list[num].TryGetComp <CompAttachBase>();
                         Fire           obj            = (Fire)ThingMaker.MakeThing(ThingDefOf.Fire);
                         obj.fireSize = 1f;
                         GenSpawn.Spawn(obj, list[num].Position, list[num].Map, Rot4.North);
                         if (compAttachBase != null)
                         {
                             obj.AttachTo(list[num]);
                             Pawn pawn = list[num] as Pawn;
                             if (pawn != null)
                             {
                                 pawn.jobs.StopAll();
                                 pawn.records.Increment(RecordDefOf.TimesOnFire);
                             }
                         }
                     }
                     this.customImpact = true;
                     base.Impact(list[num]);
                     this.customImpact = false;
                 }
             }
         }
     }
     catch { };
 }
예제 #4
0
        public static bool TryAttachFire(Thing t, float fireSize)
        {
            if (!t.CanEverAttachFire() || t.HasAttachment(ThingDefOf.Fire))
            {
                return(false);
            }
            Fire fire = (Fire)ThingMaker.MakeThing(ThingDefOf.Fire);

            fire.fireSize = fireSize;
            fire.AttachTo(t);
            GenSpawn.Spawn(fire, t.Position, t.Map, Rot4.North);
            if (!(t is Pawn pawn))
            {
                return(false);
            }
            Verse.AI.Pawn_JobTracker jobs = pawn.jobs;
            if (jobs != null)
            {
                jobs.StopAll();
            }
            pawn.records.Increment(RecordDefOf.TimesOnFire);
            return(false);
        }