private static void ConfigureApparelFilter(ExtendedOutfit outfit, Func <ThingDef, bool> filter)
 {
     outfit.filter.SetDisallowAll();
     outfit.filter.SetAllow(SpecialThingFilterDefOf.AllowDeadmansApparel, false);
     foreach (var current in DefDatabase <ThingDef> .AllDefs.Where(filter))
     {
         outfit.filter.SetAllow(current, true);
     }
 }
예제 #2
0
 private static void ApplyTaintedScoring(Pawn pawn, Apparel apparel, ExtendedOutfit outfit, ref float score)
 {
     if (!outfit.PenalizeTaintedApparel || !apparel.WornByCorpse ||
         !ThoughtUtility.CanGetThought_NewTemp(pawn, ThoughtDefOf.DeadMansApparel))
     {
         return;
     }
     #if DEBUG
     Log.Message("OutfitManager: Penalizing tainted apparel", true);
     #endif
     score -= TaintedApparelScorePenalty;
     if (score > 0f)
     {
         score *= TaintedApparelScoreFactor;
     }
 }
        private static void ConfigureStatPriorities(DefaultOutfits outfitName, ExtendedOutfit outfit)
        {
            switch (outfitName)
            {
            case DefaultOutfits.Anything:
            case DefaultOutfits.Worker:
            case DefaultOutfits.Nudist:
                outfit.SetDefaultStatPriorities(DefaultWorkTypePriorities.BaseWorkerStatPriorities);
                break;

            case DefaultOutfits.Doctor:
                outfit.SetDefaultStatPriorities(DefaultWorkTypePriorities.DoctorWorkTypeStatPriorities);
                break;

            case DefaultOutfits.Warden:
                outfit.SetDefaultStatPriorities(DefaultWorkTypePriorities.WardenWorkTypeStatPriorities);
                break;

            case DefaultOutfits.Handler:
                outfit.SetDefaultStatPriorities(DefaultWorkTypePriorities.HandlingWorkTypeStatPriorities);
                break;

            case DefaultOutfits.Cook:
                outfit.SetDefaultStatPriorities(DefaultWorkTypePriorities.CookingWorkTypeStatPriorities);
                break;

            case DefaultOutfits.Hunter:
                outfit.SetDefaultStatPriorities(DefaultWorkTypePriorities.HuntingWorkTypeStatPriorities);
                break;

            case DefaultOutfits.Builder:
                outfit.SetDefaultStatPriorities(DefaultWorkTypePriorities.ConstructionWorkTypeStatPriorities);
                break;

            case DefaultOutfits.Grower:
                outfit.SetDefaultStatPriorities(DefaultWorkTypePriorities.GrowingWorkTypeStatPriorities);
                break;

            case DefaultOutfits.Miner:
                outfit.SetDefaultStatPriorities(DefaultWorkTypePriorities.MiningWorkTypeStatPriorities);
                break;

            case DefaultOutfits.Smith:
                outfit.SetDefaultStatPriorities(DefaultWorkTypePriorities.SmithingWorkTypeStatPriorities);
                break;

            case DefaultOutfits.Tailor:
                outfit.SetDefaultStatPriorities(DefaultWorkTypePriorities.TailoringWorkTypeStatPriorities);
                break;

            case DefaultOutfits.Artist:
                outfit.SetDefaultStatPriorities(DefaultWorkTypePriorities.ArtWorkTypeStatPriorities);
                break;

            case DefaultOutfits.Crafter:
                outfit.SetDefaultStatPriorities(DefaultWorkTypePriorities.CraftingWorkTypeStatPriorities);
                break;

            case DefaultOutfits.Hauler:
                outfit.SetDefaultStatPriorities(DefaultWorkTypePriorities.HaulingWorkTypeStatPriorities);
                break;

            case DefaultOutfits.Cleaner:
                outfit.SetDefaultStatPriorities(DefaultWorkTypePriorities.CleaningWorkTypeStatPriorities);
                break;

            case DefaultOutfits.Researcher:
                outfit.SetDefaultStatPriorities(DefaultWorkTypePriorities.ResearchWorkTypeStatPriorities);
                break;

            case DefaultOutfits.Brawler:
                outfit.SetDefaultStatPriorities(DefaultWorkTypePriorities.BrawlerStatPriorities);
                break;

            case DefaultOutfits.Soldier:
                outfit.SetDefaultStatPriorities(DefaultWorkTypePriorities.SoldierStatPriorities);
                break;

            default:
                throw new ArgumentOutOfRangeException(message: "Unexpected default outfit", null);
            }
        }