public void SetupValues() { VatProperties vatProps = def.TryGetModExtension <VatProperties>(); if (vatProps != null) { MaxCapacity = vatProps.maxCapacity; FermentationModifier = vatProps.fermentationModifier; } }
private Thing FindInputThing(Pawn pawn, Building_FermentingVat barrel) { Predicate <Thing> validator = (Thing x) => !x.IsForbidden(pawn) && pawn.CanReserve(x, 1, -1, null, false); ThingDef input_def = null; VatProperties vatProps = barrel.def.TryGetModExtension <VatProperties>(); if (vatProps != null) { input_def = vatProps.inputThingDef; } //Log.Message("input_def: " + input_def); return(GenClosest.ClosestThingReachable(pawn.Position, pawn.Map, ThingRequest.ForDef(input_def), PathEndMode.ClosestTouch, TraverseParms.For(pawn, Danger.Deadly, TraverseMode.ByPawn, false), 9999f, validator, null, 0, -1, false, RegionType.Set_Passable, false)); }