Ejemplo n.º 1
0
 public void Notify_EnteredNewCell()
 {
     if (Rand.Value < 0.05f)
     {
         this.TryDropFilth();
     }
     if (Rand.Value < 0.1f)
     {
         this.TryPickupFilth();
     }
     if (!this.pawn.RaceProps.Humanlike)
     {
         if (Rand.Value < PawnUtility.AnimalFilthChancePerCell(this.pawn.def, this.pawn.BodySize) && this.pawn.Position.GetTerrain(this.pawn.Map).acceptTerrainSourceFilth)
         {
             FilthMaker.MakeFilth(this.pawn.Position, this.pawn.Map, ThingDefOf.Filth_AnimalFilth, 1);
             FilthMonitor.Notify_FilthAnimalGenerated();
         }
     }
     else if (Rand.Value < PawnUtility.HumanFilthChancePerCell(this.pawn.def, this.pawn.BodySize) && this.pawn.Position.GetTerrain(this.pawn.Map).acceptTerrainSourceFilth)
     {
         ThingDef filth_Trash;
         if (this.lastTerrainFilthDef != null && Rand.Chance(0.66f))
         {
             filth_Trash = this.lastTerrainFilthDef;
         }
         else
         {
             filth_Trash = ThingDefOf.Filth_Trash;
         }
         FilthMaker.MakeFilth(this.pawn.Position, this.pawn.Map, filth_Trash, 1);
         FilthMonitor.Notify_FilthHumanGenerated();
     }
 }
 public void Notify_EnteredNewCell()
 {
     if (Rand.Value < 0.05f)
     {
         TryDropFilth();
     }
     if (Rand.Value < 0.1f)
     {
         TryPickupFilth();
     }
     if (!pawn.RaceProps.Humanlike)
     {
         if (Rand.Value < PawnUtility.AnimalFilthChancePerCell(pawn.def, pawn.BodySize) && FilthMaker.TryMakeFilth(pawn.Position, pawn.Map, ThingDefOf.Filth_AnimalFilth, 1, AdditionalFilthSourceFlags))
         {
             FilthMonitor.Notify_FilthAnimalGenerated();
         }
     }
     else if (Rand.Value < PawnUtility.HumanFilthChancePerCell(pawn.def, pawn.BodySize) && FilthMaker.TryMakeFilth(filthDef: (lastTerrainFilthDef == null || !Rand.Chance(0.66f)) ? ThingDefOf.Filth_Trash : lastTerrainFilthDef, c: pawn.Position, map: pawn.Map, count: 1, additionalFlags: AdditionalFilthSourceFlags))
     {
         FilthMonitor.Notify_FilthHumanGenerated();
     }
 }