Esempio n. 1
0
 // Token: 0x06000100 RID: 256 RVA: 0x0000A384 File Offset: 0x00008784
 public void HealContained()
 {
     if (this.Casket.ContainedThing != null)
     {
         Corpse corpse = this.Casket.ContainedThing as Corpse;
         Pawn   pawn;
         if (corpse != null)
         {
             pawn = corpse.InnerPawn;
         }
         else
         {
             pawn = (this.Casket.ContainedThing as Pawn);
         }
         if (pawn != null)
         {
             if (pawn.Dead)
             {
                 CompOsiris.Ressurrect(pawn, this.parent);
             }
             else
             {
                 pawn.health.Reset();
             }
             if (pawn.RaceProps.Humanlike)
             {
                 pawn.ageTracker.AgeBiologicalTicks = 90000000L;
                 if (Rand.Value < 0.65f)
                 {
                     pawn.needs.mood.thoughts.memories.TryGainMemory(ThoughtDef.Named("ReturnedFromTheDeadBad"), null);
                 }
                 else
                 {
                     pawn.needs.mood.thoughts.memories.TryGainMemory(ThoughtDef.Named("ReturnedFromTheDeadGood"), null);
                 }
             }
             else if (pawn.RaceProps.Animal)
             {
                 pawn.ageTracker.AgeBiologicalTicks = (long)(pawn.RaceProps.lifeStageAges[2].minAge * 3600000f);
             }
             pawn.health.AddHediff(HediffDef.Named("LuciferiumAddiction"), null, null);
             pawn.health.AddHediff(HediffDef.Named("LuciferiumHigh"), null, null);
         }
     }
 }
Esempio n. 2
0
        // Token: 0x060000FF RID: 255 RVA: 0x0000A24C File Offset: 0x0000864C
        public static void Ressurrect(Pawn pawn, Thing thing)
        {
            pawn.health.Reset();
            if (pawn.Corpse != null && pawn.Corpse.Spawned)
            {
                pawn.Corpse.DeSpawn();
            }
            CompOsiris.AddComponentsForResurrection(pawn);
            Type      typeFromHandle = typeof(Thing);
            FieldInfo field          = typeFromHandle.GetField("mapIndexOrState", BindingFlags.Instance | BindingFlags.NonPublic);

            field.SetValue(pawn, (SByte)(-1));
            CompOsiris.FixPawnRelationships(pawn);
            if (thing is HoloEmitter)
            {
                if (!pawn.Dead)
                {
                }
                if (pawn.Corpse.holdingOwner != null)
                {
                    pawn.Corpse.GetDirectlyHeldThings().TryTransferToContainer(pawn, pawn.Corpse.holdingOwner, true);
                }
                else if (pawn.Corpse.Spawned)
                {
                    GenSpawn.Spawn(pawn, pawn.Corpse.Position, pawn.Corpse.Map);
                }
                if (pawn.Corpse != null)
                {
                    pawn.Corpse.Destroy(0);
                }
            }
            else
            {
                GenSpawn.Spawn(pawn, thing.Position, thing.Map);
                Building_Casket building_Casket = thing as Building_Casket;
                if (building_Casket != null)
                {
                    building_Casket.GetDirectlyHeldThings().Clear();
                }
            }
        }