Beispiel #1
0
        public override IEnumerable <Thing> ButcherProducts(Pawn butcher, float efficiency)
        {
            foreach (var t in InnerPawn.ButcherProducts(butcher, efficiency))
            {
                yield return(t);
            }

            //Spread blood
            if (InnerPawn.RaceProps.BloodDef != null)
            {
                FilthMaker.MakeFilth(butcher.Position, butcher.Map, InnerPawn.RaceProps.BloodDef, InnerPawn.LabelIndefinite());
            }

            //Thought/tale for butchering humanlike
            if (InnerPawn.RaceProps.Humanlike)
            {
                butcher.needs.mood.thoughts.memories.TryGainMemory(ThoughtDefOf.ButcheredHumanlikeCorpse);
                foreach (var p in butcher.Map.mapPawns.SpawnedPawnsInFaction(butcher.Faction))
                {
                    if (p == butcher || p.needs == null || p.needs.mood == null || p.needs.mood.thoughts == null)
                    {
                        continue;
                    }
                    p.needs.mood.thoughts.memories.TryGainMemory(ThoughtDefOf.KnowButcheredHumanlikeCorpse);
                }
                TaleRecorder.RecordTale(TaleDefOf.ButcheredHumanlikeCorpse, butcher);
            }
        }
Beispiel #2
0
        public override IEnumerable <Thing> ButcherProducts(Pawn butcher, float efficiency)
        {
            using (IEnumerator <Thing> enumerator = InnerPawn.ButcherProducts(butcher, efficiency).GetEnumerator())
            {
                if (enumerator.MoveNext())
                {
                    Thing t = enumerator.Current;
                    yield return(t);

                    /*Error: Unable to find new state assignment for yield return*/;
                }
            }
            if (InnerPawn.RaceProps.BloodDef != null)
            {
                FilthMaker.MakeFilth(butcher.Position, butcher.Map, InnerPawn.RaceProps.BloodDef, InnerPawn.LabelIndefinite());
            }
            if (InnerPawn.RaceProps.Humanlike)
            {
                butcher.needs.mood.thoughts.memories.TryGainMemory(ThoughtDefOf.ButcheredHumanlikeCorpse);
                foreach (Pawn item in butcher.Map.mapPawns.SpawnedPawnsInFaction(butcher.Faction))
                {
                    if (item != butcher && item.needs != null && item.needs.mood != null && item.needs.mood.thoughts != null)
                    {
                        item.needs.mood.thoughts.memories.TryGainMemory(ThoughtDefOf.KnowButcheredHumanlikeCorpse);
                    }
                }
                TaleRecorder.RecordTale(TaleDefOf.ButcheredHumanlikeCorpse, butcher);
            }
            yield break;
IL_0232:
            /*Error near IL_0233: Unexpected return in MoveNext()*/;
        }
 public override IEnumerable <Thing> ButcherProducts(Pawn butcher, float efficiency)
 {
     foreach (Thing item in InnerPawn.ButcherProducts(butcher, efficiency))
     {
         yield return(item);
     }
     if (InnerPawn.RaceProps.BloodDef != null)
     {
         FilthMaker.TryMakeFilth(butcher.Position, butcher.Map, InnerPawn.RaceProps.BloodDef, InnerPawn.LabelIndefinite());
     }
     if (!InnerPawn.RaceProps.Humanlike)
     {
         yield break;
     }
     if (butcher.needs.mood != null)
     {
         butcher.needs.mood.thoughts.memories.TryGainMemory(ThoughtDefOf.ButcheredHumanlikeCorpse);
     }
     foreach (Pawn item2 in butcher.Map.mapPawns.SpawnedPawnsInFaction(butcher.Faction))
     {
         if (item2 != butcher && item2.needs != null && item2.needs.mood != null && item2.needs.mood.thoughts != null)
         {
             item2.needs.mood.thoughts.memories.TryGainMemory(ThoughtDefOf.KnowButcheredHumanlikeCorpse);
         }
     }
     TaleRecorder.RecordTale(TaleDefOf.ButcheredHumanlikeCorpse, butcher);
 }