Beispiel #1
0
			// Token: 0x060000D3 RID: 211 RVA: 0x00007AE0 File Offset: 0x00005CE0
			private static void CheckDRDrugDefinitions2()
			{
				List<string> newMSDRValues = new List<string>();
				if (DRSettings.MSDRValues2 != null && DRSettings.MSDRValues2.Count > 0)
				{
					foreach (string value in DRSettings.MSDRValues2)
					{
						string mal = MSDRUtility.HValuePart(value);
						if (MSDRUtility.MaladyUsed(mal))
						{
							int end = 1;
							if (value.EndsWith("2"))
							{
								end = 2;
							}
							string drug = MSDRUtility.DValuePart(value);
							if (DefDatabase<ThingDef>.GetNamed(drug, false) != null)
							{
								int t = MSDRUtility.TValuePart(value);
								bool b = MSDRUtility.BValuePart(value);
								string oldValue = MSDRUtility.ConvertToDRValue(t, mal, drug, b, end);
								GenCollection.AddDistinct<string>(newMSDRValues, oldValue);
							}
							else
							{
								string newValue = MSDRUtility.ConvertToDRValue(24, mal, null, true, end);
								GenCollection.AddDistinct<string>(newMSDRValues, newValue);
							}
						}
					}
				}
				DRSettings.MSDRValues2 = newMSDRValues;
			}
Beispiel #2
0
        // Token: 0x06000056 RID: 86 RVA: 0x000059CC File Offset: 0x00003BCC
        public static void SetDRValues(string m, string d, int t, bool b, int numof, List <string> master, out List <string> newMaster)
        {
            newMaster = new List <string>();
            string newValue = MSDRUtility.ConvertToDRValue(t, m, d, b, numof);

            if (master != null)
            {
                bool beenSet = false;
                if (master.Count > 0)
                {
                    foreach (string value in master)
                    {
                        string a   = MSDRUtility.HValuePart(value);
                        int    num = MSDRUtility.NumValuePart(value);
                        if (a != m)
                        {
                            GenCollection.AddDistinct <string>(newMaster, value);
                        }
                        else if (num != numof)
                        {
                            GenCollection.AddDistinct <string>(newMaster, value);
                        }
                        else
                        {
                            GenCollection.AddDistinct <string>(newMaster, newValue);
                            beenSet = true;
                        }
                    }
                }
                if (!beenSet)
                {
                    GenCollection.AddDistinct <string>(newMaster, newValue);
                }
            }
        }