diff --git a/1.3/Assemblies/VFECore.dll b/1.3/Assemblies/VFECore.dll index b7e33b8d..fa0f4e20 100644 Binary files a/1.3/Assemblies/VFECore.dll and b/1.3/Assemblies/VFECore.dll differ diff --git a/Source/VFECore/AnimalBehaviours/Pawn classes/Pawn_SwallowWhole.cs b/Source/VFECore/AnimalBehaviours/Pawn classes/Pawn_SwallowWhole.cs index 57d409ed..f0b6e75d 100644 --- a/Source/VFECore/AnimalBehaviours/Pawn classes/Pawn_SwallowWhole.cs +++ b/Source/VFECore/AnimalBehaviours/Pawn classes/Pawn_SwallowWhole.cs @@ -15,11 +15,28 @@ public class Pawn_SwallowWhole : Pawn, IThingHolder CompSwallowWhole comp = null; + + public CompSwallowWhole Comp + { + get + { + if (this.comp != null) + { + return this.comp; + } + this.comp = this.TryGetComp(); + return this.comp; + + + } + } + + public Pawn_SwallowWhole() { //Constructor initializes the pawn container and the comp this.innerContainer = new ThingOwner(this, false, LookMode.Deep); - comp = this.TryGetComp(); + comp = Comp; } public override void ExposeData() @@ -62,18 +79,18 @@ public void DestroyContents() public override void Destroy(DestroyMode mode = DestroyMode.Vanish) { - if (this.Map != null && comp.Props.createFilthWhenKilled) + if (this.Map != null && Comp.Props.createFilthWhenKilled) { EjectContents(); for (int i = 0; i < 20; i++) { IntVec3 c; CellFinder.TryFindRandomReachableCellNear(this.Position, this.Map, 2, TraverseParms.For(TraverseMode.NoPassClosedDoors, Danger.Deadly, false), null, null, out c); - FilthMaker.TryMakeFilth(c, this.Map, comp.Props.filthToMake); + FilthMaker.TryMakeFilth(c, this.Map, Comp.Props.filthToMake); } - if (comp.Props.playSoundWhenKilled) { - SoundDef.Named(comp.Props.soundToPlay).PlayOneShot(new TargetInfo(this.Position, this.Map, false)); + if (Comp.Props.playSoundWhenKilled) { + SoundDef.Named(Comp.Props.soundToPlay).PlayOneShot(new TargetInfo(this.Position, this.Map, false)); } } @@ -83,19 +100,19 @@ public override void Destroy(DestroyMode mode = DestroyMode.Vanish) public override void Kill(DamageInfo? dinfo, Hediff exactCulprit = null) { - if (this.Map != null && comp.Props.createFilthWhenKilled) + if (this.Map != null && Comp.Props.createFilthWhenKilled) { EjectContents(); for (int i = 0; i < 20; i++) { IntVec3 c; CellFinder.TryFindRandomReachableCellNear(this.Position, this.Map, 2, TraverseParms.For(TraverseMode.NoPassClosedDoors, Danger.Deadly, false), null, null, out c); - FilthMaker.TryMakeFilth(c, this.Map, comp.Props.filthToMake); + FilthMaker.TryMakeFilth(c, this.Map, Comp.Props.filthToMake); } - if (comp.Props.playSoundWhenKilled) + if (Comp.Props.playSoundWhenKilled) { - SoundDef.Named(comp.Props.soundToPlay).PlayOneShot(new TargetInfo(this.Position, this.Map, false)); + SoundDef.Named(Comp.Props.soundToPlay).PlayOneShot(new TargetInfo(this.Position, this.Map, false)); } } @@ -139,10 +156,10 @@ public virtual bool TryAcceptThing(Thing thing, bool allowSpecialEffects = true) public override void TickRare() { base.TickRare(); - if (innerContainer.Count >= comp.Props.stomachCapacity) + if (innerContainer.Count >= Comp.Props.stomachCapacity) { tickCounter++; - if (tickCounter > comp.Props.digestionPeriod) + if (tickCounter > Comp.Props.digestionPeriod) { foreach (Thing thing in innerContainer) { @@ -174,9 +191,9 @@ public override string GetInspectString() { string stomachContents = ""; - if (innerContainer.Count >= comp.Props.stomachCapacity) + if (innerContainer.Count >= Comp.Props.stomachCapacity) { - stomachContents += "\n" + "VEF_StomachContents".Translate(innerContainer.Count) + "VEF_DigestionTime".Translate(((comp.Props.digestionPeriod - tickCounter) * 250).ToStringTicksToPeriod(true, false, true, true)); + stomachContents += "\n" + "VEF_StomachContents".Translate(innerContainer.Count) + "VEF_DigestionTime".Translate(((Comp.Props.digestionPeriod - tickCounter) * 250).ToStringTicksToPeriod(true, false, true, true)); } else stomachContents += "\n" + "VEF_StomachContents".Translate(innerContainer.Count); diff --git a/Source/VFECore/ItemProcessor/Building/Building_ItemProcessor.cs b/Source/VFECore/ItemProcessor/Building/Building_ItemProcessor.cs index d57bb7c3..249f6e6a 100644 --- a/Source/VFECore/ItemProcessor/Building/Building_ItemProcessor.cs +++ b/Source/VFECore/ItemProcessor/Building/Building_ItemProcessor.cs @@ -1370,7 +1370,7 @@ public override void TickRare() { float currentTempInMap = this.Position.GetTemperature(this.Map); CombinationDef thisCombinationRecipe = DefDatabase.GetNamed(thisRecipe); - if ((currentTempInMap > compItemProcessor.Props.maxAccelerationTemp) || (currentTempInMap < compItemProcessor.Props.minAccelerationTemp)) + if ((currentTempInMap > compItemProcessor.Props.minAccelerationTemp) && (currentTempInMap < compItemProcessor.Props.maxAccelerationTemp)) { this.days = thisCombinationRecipe.singleTimeIfNotQualityIncreasing * compItemProcessor.Props.accelerationFactor; diff --git a/Source/VFECore/Plants/Harmony/Plant_PlantCollected.cs b/Source/VFECore/Plants/Harmony/Plant_PlantCollected.cs index 123bba8e..77a7ab9d 100644 --- a/Source/VFECore/Plants/Harmony/Plant_PlantCollected.cs +++ b/Source/VFECore/Plants/Harmony/Plant_PlantCollected.cs @@ -25,13 +25,13 @@ public static void AddSecondaryOutput(Plant __instance, Pawn by) { float statValue = by.GetStatValue(StatDefOf.PlantHarvestYield); - if (!(by.RaceProps.Humanlike && !__instance.Blighted && Rand.Value > statValue)) + if (!(by.RaceProps.Humanlike && !__instance.Blighted && __instance.CanYieldNow() && Rand.Value > statValue)) { int num = extension.outPutAmount; if (statValue > 1f) { - num = GenMath.RoundRandom((float)num * statValue); + num = GenMath.RoundRandom((float)num * statValue * __instance.Growth); } if (num > 0) {