Esempio n. 1
0
        private void UpdateSickStateOnVisitingHealthcare(uint citizenId, ushort buildingId, ref TCitizen citizen)
        {
            var citizenAge = CitizenProxy.GetAge(ref citizen);

            if ((citizenAge == Citizen.AgeGroup.Child || citizenAge == Citizen.AgeGroup.Teen) && BuildingMgr.IsBuildingAIOfType <ChildcareAI>(buildingId) ||
                citizenAge == Citizen.AgeGroup.Senior && BuildingMgr.IsBuildingAIOfType <EldercareAI>(buildingId))
            {
                if (CitizenProxy.GetHealth(ref citizen) > Random.GetRandomValue(100u))
                {
                    Log.Debug(LogCategory.State, TimeInfo.Now, $"{GetCitizenDesc(citizenId, ref citizen)} was sick, but got healed in a child or elder care building");
                    CitizenProxy.SetSick(ref citizen, isSick: false);
                }
            }
        }