Example #1
0
        public int GetPlantLabelFullGrown(PlantHueInfo hueInfo)
        {
            if (m_PlantLabelFullGrown != -1)
            {
                return(m_PlantLabelFullGrown);
            }

            if (m_ContainsPlant)
            {
                return(hueInfo.IsBright() ? 1061891 : 1061889); // a ~1_HEALTH~ [bright] ~2_COLOR~ ~3_NAME~
            }
            else
            {
                return(hueInfo.IsBright() ? 1061892 : 1061890); // a ~1_HEALTH~ [bright] ~2_COLOR~ ~3_NAME~ plant
            }
        }
Example #2
0
        public int GetPlantLabelPlant(PlantHueInfo hueInfo)
        {
            if (m_PlantLabelPlant != -1)
            {
                return(m_PlantLabelPlant);
            }

            if (m_ContainsPlant)
            {
                return(hueInfo.IsBright() ? 1060832 : 1060831); // a ~1_val~ of ~2_val~ dirt with a ~3_val~ [bright] ~4_val~ ~5_val~
            }
            else
            {
                return(hueInfo.IsBright() ? 1061887 : 1061888); // a ~1_val~ of ~2_val~ dirt with a ~3_val~ [bright] ~4_val~ ~5_val~ ~6_val~
            }
        }
Example #3
0
        public int GetSeedLabelPlural(PlantHueInfo hueInfo)
        {
            if (m_SeedLabelPlural != -1)
            {
                return(m_SeedLabelPlural);
            }

            return(hueInfo.IsBright() ? 1113493 : 1113492); // ~1_amount~ [bright] ~2_color~ ~3_type~ seeds
        }
Example #4
0
        public int GetSeedLabel(PlantHueInfo hueInfo)
        {
            if (m_SeedLabel != -1)
            {
                return(m_SeedLabel);
            }

            return(hueInfo.IsBright() ? 1061918 : 1061917); // [bright] ~1_COLOR~ ~2_TYPE~ seed
        }
Example #5
0
        public int GetPlantLabelDecorative(PlantHueInfo hueInfo)
        {
            if (m_PlantLabelDecorative != -1)
            {
                return(m_PlantLabelDecorative);
            }

            return(hueInfo.IsBright() ? 1074267 : 1070973); // a decorative [bright] ~1_COLOR~ ~2_TYPE~
        }
Example #6
0
        public int GetPlantLabelSeed(PlantHueInfo hueInfo)
        {
            if (m_PlantLabelSeed != -1)
            {
                return(m_PlantLabelSeed);
            }

            return(hueInfo.IsBright() ? 1061887 : 1061888); // a ~1_val~ of ~2_val~ dirt with a ~3_val~ [bright] ~4_val~ ~5_val~ ~6_val~
        }
Example #7
0
        private int GetLabel(out string args)
        {
            PlantTypeInfo typeInfo = PlantTypeInfo.GetInfo(m_PlantType);
            PlantHueInfo  hueInfo  = PlantHueInfo.GetInfo(m_PlantHue);

            int title;

            if (m_ShowType || typeInfo.PlantCategory == PlantCategory.Default)
            {
                title = hueInfo.Name;
            }
            else
            {
                title = (int)typeInfo.PlantCategory;
            }

            if (Amount == 1)
            {
                if (m_ShowType)
                {
                    args = String.Format("#{0}\t#{1}", title, typeInfo.Name);
                    return(typeInfo.GetSeedLabel(hueInfo));
                }
                else
                {
                    args = String.Format("#{0}", title);
                    return(hueInfo.IsBright() ? 1060839 : 1060838); // [bright] ~1_val~ seed
                }
            }
            else
            {
                if (m_ShowType)
                {
                    args = String.Format("{0}\t#{1}\t#{2}", Amount, title, typeInfo.Name);
                    return(typeInfo.GetSeedLabelPlural(hueInfo));
                }
                else
                {
                    args = String.Format("{0}\t#{1}", Amount, title);
                    return(hueInfo.IsBright() ? 1113491 : 1113490); // ~1_amount~ [bright] ~2_val~ seeds
                }
            }
        }
        private void UpdateMaladies()
        {
            double infestationChance = 0.30 - StrengthPotion * 0.075 + (Water - 2) * 0.10;

            PlantTypeInfo typeInfo = PlantTypeInfo.GetInfo(m_Plant.PlantType);

            if (typeInfo.Flowery)
            {
                infestationChance += 0.10;
            }

            if (PlantHueInfo.IsBright(m_Plant.PlantHue))
            {
                infestationChance += 0.10;
            }

            if (Utility.RandomDouble() < infestationChance)
            {
                Infestation++;
            }


            double fungusChance = 0.15 - StrengthPotion * 0.075 + (Water - 2) * 0.10;

            if (Utility.RandomDouble() < fungusChance)
            {
                Fungus++;
            }

            if (Water > 2 || Utility.RandomDouble() < 0.9)
            {
                Water--;
            }

            if (PoisonPotion > 0)
            {
                Poison      += PoisonPotion;
                PoisonPotion = 0;
            }

            if (CurePotion > 0)
            {
                Disease   += CurePotion;
                CurePotion = 0;
            }

            StrengthPotion = 0;
        }
Example #9
0
        public override void AddNameProperty(ObjectPropertyList list)
        {
            if (m_PlantStatus >= PlantStatus.DeadTwigs)
            {
                base.AddNameProperty(list);
            }
            else if (m_PlantStatus < PlantStatus.Seed)
            {
                string args;

                if (ShowContainerType)
                {
                    args = String.Format("#{0}\t#{1}", GetLocalizedContainerType(), m_PlantSystem.GetLocalizedDirtStatus());
                }
                else
                {
                    args = String.Format("#{0}", m_PlantSystem.GetLocalizedDirtStatus());
                }

                list.Add(1060830, args); // a ~1_val~ of ~2_val~ dirt
            }
            else
            {
                PlantTypeInfo typeInfo = PlantTypeInfo.GetInfo(m_PlantType);
                PlantHueInfo  hueInfo  = PlantHueInfo.GetInfo(m_PlantHue);

                if (m_PlantStatus >= PlantStatus.DecorativePlant)
                {
                    list.Add(typeInfo.GetPlantLabelDecorative(hueInfo), String.Format("#{0}\t#{1}", hueInfo.Name, typeInfo.Name));
                }
                else if (m_PlantStatus >= PlantStatus.FullGrownPlant)
                {
                    list.Add(typeInfo.GetPlantLabelFullGrown(hueInfo), String.Format("#{0}\t#{1}\t#{2}", m_PlantSystem.GetLocalizedHealth(), hueInfo.Name, typeInfo.Name));
                }
                else
                {
                    string args;

                    if (ShowContainerType)
                    {
                        args = String.Format("#{0}\t#{1}\t#{2}", GetLocalizedContainerType(), m_PlantSystem.GetLocalizedDirtStatus(), m_PlantSystem.GetLocalizedHealth());
                    }
                    else
                    {
                        args = String.Format("#{0}\t#{1}", m_PlantSystem.GetLocalizedDirtStatus(), m_PlantSystem.GetLocalizedHealth());
                    }

                    if (m_ShowType)
                    {
                        args += String.Format("\t#{0}\t#{1}\t#{2}", hueInfo.Name, typeInfo.Name, GetLocalizedPlantStatus());

                        if (m_PlantStatus == PlantStatus.Plant)
                        {
                            list.Add(typeInfo.GetPlantLabelPlant(hueInfo), args);
                        }
                        else
                        {
                            list.Add(typeInfo.GetPlantLabelSeed(hueInfo), args);
                        }
                    }
                    else
                    {
                        args += String.Format("\t#{0}\t#{1}", (typeInfo.PlantCategory == PlantCategory.Default) ? hueInfo.Name : (int)typeInfo.PlantCategory, GetLocalizedPlantStatus());

                        list.Add(hueInfo.IsBright() ? 1060832 : 1060831, args); // a ~1_val~ of ~2_val~ dirt with a ~3_val~ [bright] ~4_val~ ~5_val~
                    }
                }
            }
        }