public override void HealthMasterSet() { base.HealthMasterSet(); var Parent = RelatedPart.GetParent(); var Added = Spawn.ServerPrefab(BodyFatToInstantiate.gameObject).GameObject.GetComponent <BodyFat>(); BodyFats.Add(Added); Parent.Storage.ServerTryAdd(Added.gameObject); }
private IEnumerator DelayAddFat() { yield return(null); var Parent = RelatedPart.GetParent(); var Added = Spawn.ServerPrefab(BodyFatToInstantiate.gameObject).GameObject.GetComponent <BodyFat>(); BodyFats.Add(Added); Parent.Storage.ServerTryAdd(Added.gameObject); }
public override void ImplantPeriodicUpdate() { base.ImplantPeriodicUpdate(); //BloodContainer if (StomachContents.ReagentMixTotal > 0) { float ToDigest = DigesterAmountPerSecond * RelatedPart.TotalModified; if (StomachContents.ReagentMixTotal < ToDigest) { ToDigest = StomachContents.ReagentMixTotal; } var Digesting = StomachContents.TakeReagents(ToDigest); RelatedPart.BloodContainer.Add(Digesting); //healthMaster.NutrimentLevel += Digesting[Nutriment]; //What to do with non Digesting content, put back in stomach? } bool AllFat = true; foreach (var Fat in BodyFats) { if (Fat.IsFull == false) { AllFat = false; break; } } if (AllFat) { var Parent = RelatedPart.GetParent(); var Added = Spawn.ServerPrefab(BodyFatToInstantiate.gameObject).GameObject.GetComponent <BodyFat>(); BodyFats.Add(Added); Parent.Storage.ServerTryAdd(Added.gameObject); } }