Ejemplo n.º 1
0
        private void Update()
        {
            if (m_PlantStatus >= PlantStatus.DeadTwigs)
            {
                ItemID = 0x1B9D;
                Hue    = PlantHueInfo.GetInfo(m_PlantHue).Hue;
            }
            else if (m_PlantStatus >= PlantStatus.FullGrownPlant)
            {
                ItemID = PlantTypeInfo.GetInfo(m_PlantType).ItemID;
                Hue    = PlantHueInfo.GetInfo(m_PlantHue).Hue;
            }
            else if (m_PlantStatus >= PlantStatus.Plant)
            {
                ItemID = 0x1600;
                Hue    = 0;
            }
            else
            {
                ItemID = 0x1602;
                Hue    = 0;
            }

            InvalidateProperties();
        }
Ejemplo n.º 2
0
        public static bool BlocksMovement(Seed seed)
        {
            PlantTypeInfo info = PlantTypeInfo.GetInfo(seed.PlantType);
            ItemData      data = TileData.ItemTable[info.ItemID & TileData.MaxItemValue];

            TileFlag flags = data.Flags;

            return((flags & TileFlag.Impassable) > 0);
        }
Ejemplo n.º 3
0
        public override void AddNameProperty(ObjectPropertyList list)
        {
            if (m_PlantStatus >= PlantStatus.DecorativePlant)
            {
                base.AddNameProperty(list);
            }
            else if (m_PlantStatus >= PlantStatus.FullGrownPlant)
            {
                PlantHueInfo  hueInfo  = PlantHueInfo.GetInfo(m_PlantHue);
                PlantTypeInfo typeInfo = PlantTypeInfo.GetInfo(m_PlantType);
                string        args     = string.Format("#{0}\t#{1}\t#{2}", m_PlantSystem.GetLocalizedHealth(), hueInfo.Name, typeInfo.Name);

                if (typeInfo.ContainsPlant)
                {
                    // a ~1_HEALTH~ [bright] ~2_COLOR~ ~3_NAME~
                    list.Add(hueInfo.IsBright() ? 1061891 : 1061889, args);
                }
                else
                {
                    // a ~1_HEALTH~ [bright] ~2_COLOR~ ~3_NAME~ plant
                    list.Add(hueInfo.IsBright() ? 1061892 : 1061890, args);
                }
            }
            else if (m_PlantStatus >= PlantStatus.Seed)
            {
                PlantHueInfo hueInfo = PlantHueInfo.GetInfo(m_PlantHue);
                string       args    = string.Format("#{0}\t#{1}\t#{2}", m_PlantSystem.GetLocalizedDirtStatus(), m_PlantSystem.GetLocalizedHealth(), hueInfo.Name);

                if (m_ShowType)
                {
                    PlantTypeInfo typeInfo = PlantTypeInfo.GetInfo(m_PlantType);
                    args += "\t#" + typeInfo.Name.ToString();

                    if (typeInfo.ContainsPlant && m_PlantStatus == PlantStatus.Plant)
                    {
                        // a bowl of ~1_val~ dirt with a ~2_val~ [bright] ~3_val~ ~4_val~
                        list.Add(hueInfo.IsBright() ? 1060832 : 1060831, args);
                    }
                    else
                    {
                        // a bowl of ~1_val~ dirt with a ~2_val~ [bright] ~3_val~ ~4_val~ ~5_val~
                        list.Add(hueInfo.IsBright() ? 1061887 : 1061888, args + "\t#" + GetLocalizedPlantStatus().ToString());
                    }
                }
                else
                {
                    // a bowl of ~1_val~ dirt with a ~2_val~ [bright] ~3_val~ ~4_val~
                    list.Add(hueInfo.IsBright() ? 1060832 : 1060831, args + "\t#" + GetLocalizedPlantStatus().ToString());
                }
            }
            else
            {
                list.Add(1060830, "#" + m_PlantSystem.GetLocalizedDirtStatus());                 // a bowl of ~1_val~ dirt
            }
        }
Ejemplo n.º 4
0
        private void DrawPlant()
        {
            var status = m_Plant.PlantStatus;

            if (status < PlantStatus.FullGrownPlant)
            {
                AddImage(110, 85, 0x589);

                AddItem(122, 94, 0x914);
                AddItem(135, 94, 0x914);
                AddItem(120, 112, 0x914);
                AddItem(135, 112, 0x914);

                if (status >= PlantStatus.Stage2)
                {
                    AddItem(127, 112, 0xC62);
                }

                if (status is PlantStatus.Stage3 or PlantStatus.Stage4)
                {
                    AddItem(129, 85, 0xC7E);
                }

                if (status >= PlantStatus.Stage4)
                {
                    AddItem(121, 117, 0xC62);
                    AddItem(133, 117, 0xC62);
                }

                if (status >= PlantStatus.Stage5)
                {
                    AddItem(110, 100, 0xC62);
                    AddItem(140, 100, 0xC62);
                    AddItem(110, 130, 0xC62);
                    AddItem(140, 130, 0xC62);
                }

                if (status >= PlantStatus.Stage6)
                {
                    AddItem(105, 115, 0xC62);
                    AddItem(145, 115, 0xC62);
                    AddItem(125, 90, 0xC62);
                    AddItem(125, 135, 0xC62);
                }
            }
            else
            {
                var typeInfo = PlantTypeInfo.GetInfo(m_Plant.PlantType);
                var hueInfo  = PlantHueInfo.GetInfo(m_Plant.PlantHue);

                // The large images for these trees trigger a client crash, so use a smaller, generic tree.
                if (m_Plant.PlantType is PlantType.CypressTwisted or PlantType.CypressStraight)
                {
                    AddItem(130 + typeInfo.OffsetX, 96 + typeInfo.OffsetY, 0x0CCA, hueInfo.Hue);
                }
Ejemplo n.º 5
0
        private int GetLabel(out string args)
        {
            PlantHueInfo hueInfo = PlantHueInfo.GetInfo(this.m_PlantHue);

            int title = PlantTypeInfo.GetBonsaiTitle(this.m_PlantType);

            if (title == 0) // Not a bonsai
            {
                title = hueInfo.Name;
            }
            if (this.m_PlantType == PlantType.CocoaTree)
            {
                title = 1080529;
            }

            int label;

            if (this.Amount == 1)
            {
                label = this.m_ShowType ? 1061917 : 1060838; // ~1_COLOR~ ~2_TYPE~ seed : ~1_val~ seed
            }
            else
            {
                label = this.m_ShowType ? 1113492 : 1113490; // ~1_amount~ ~2_color~ ~3_type~ seeds : ~1_amount~ ~2_val~ seeds
            }
            if (hueInfo.IsBright())
            {
                ++label;
            }

            StringBuilder ab = new StringBuilder();

            if (this.Amount != 1)
            {
                ab.Append(this.Amount);
                ab.Append('\t');
            }

            ab.Append('#');
            ab.Append(title);

            if (this.m_ShowType)
            {
                PlantTypeInfo typeInfo = PlantTypeInfo.GetInfo(this.m_PlantType);

                ab.Append("\t#");
                ab.Append(typeInfo.Name);
            }

            args = ab.ToString();

            return(label);
        }
Ejemplo n.º 6
0
        private void UpdateMaladies()
        {
            if (!Plant.RequiresUpkeep)
            {
                return;
            }

            double infestationChance = 0.30 - StrengthPotion * 0.075 + (Water - 2) * 0.10;

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

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

            if (PlantHueInfo.IsBright(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;
        }
Ejemplo n.º 7
0
        public override LocalizedText GetNameProperty()
        {
            if (m_PlantStatus >= PlantStatus.DeadTwigs)
            {
                return(new LocalizedText(1027069));                  // twigs
            }
            else if (m_PlantStatus < PlantStatus.Seed)
            {
                string args = String.Format("#{0}\t#{1}", GetLocalizedContainerType(), m_PlantSystem.GetLocalizedDirtStatus());

                return(new LocalizedText(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)
                {
                    return(new LocalizedText(typeInfo.GetPlantLabelDecorative(hueInfo), String.Format("#{0}\t#{1}", hueInfo.Name, typeInfo.Name)));
                }
                else if (m_PlantStatus >= PlantStatus.FullGrownPlant)
                {
                    return(new LocalizedText(typeInfo.GetPlantLabelFullGrown(hueInfo), String.Format("#{0}\t#{1}\t#{2}", m_PlantSystem.GetLocalizedHealth(), hueInfo.Name, typeInfo.Name)));
                }
                else
                {
                    string args = String.Format("#{0}\t#{1}\t#{2}", GetLocalizedContainerType(), 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)
                        {
                            return(new LocalizedText(typeInfo.GetPlantLabelPlant(hueInfo), args));
                        }
                        else
                        {
                            return(new LocalizedText(typeInfo.GetPlantLabelSeed(hueInfo), args));
                        }
                    }
                    else
                    {
                        args += String.Format("\t#{0}\t#{1}", (typeInfo.PlantCategory == PlantCategory.Default) ? hueInfo.Name : (int)typeInfo.PlantCategory, GetLocalizedPlantStatus());

                        return(new LocalizedText(hueInfo.IsBright() ? 1060832 : 1060831, args));                          // a ~1_val~ of ~2_val~ dirt with a ~3_val~ [bright] ~4_val~ ~5_val~
                    }
                }
            }
        }
Ejemplo n.º 8
0
        public override void OnSingleClick(Mobile from)
        {
            if (m_PlantStatus >= PlantStatus.DeadTwigs)
            {
                base.OnSingleClick(from);
            }
            else if (m_PlantStatus >= PlantStatus.FullGrownPlant)
            {
                PlantTypeInfo typeInfo = PlantTypeInfo.GetInfo(m_PlantType);

                if (m_PlantStatus < PlantStatus.DecorativePlant)
                {
                    if (typeInfo.ContainsPlant)
                    {
                        LabelTo(from, string.Format("{0} {1} {2}", m_PlantSystem.GetLocalizedHealth(), PlantHue.ToString().ToLower(), PlantType.ToString().ToLower()));
                    }
                    else
                    {
                        LabelTo(from, string.Format("{0} bright {1} {2} plant", m_PlantSystem.GetLocalizedHealth(), PlantHue.ToString().ToLower(), PlantType.ToString().ToLower()));
                    }
                }
                else
                {
                    LabelTo(from, string.Format("Decorative {0} {1}", PlantHue.ToString().ToLower(), PlantType.ToString().ToLower()));
                }
            }
            else if (m_PlantStatus >= PlantStatus.Seed)
            {
                if (m_ShowType)
                {
                    PlantTypeInfo typeInfo = PlantTypeInfo.GetInfo(m_PlantType);

                    if (typeInfo.ContainsPlant && m_PlantStatus == PlantStatus.Plant)
                    {
                        LabelTo(from, string.Format("Bowl of {0} dirt with a {1} {2} {3}", m_PlantSystem.GetLocalizedDirtStatus().ToLower(), m_PlantSystem.GetLocalizedHealth().ToLower(), PlantHue.ToString().ToLower(), PlantType.ToString().ToLower()));
                    }
                    else
                    {
                        LabelTo(from, string.Format("Bowl of {0} dirt with a {1} {2} {3} {4}", m_PlantSystem.GetLocalizedDirtStatus().ToLower(), m_PlantSystem.GetLocalizedHealth().ToLower(), PlantHue.ToString().ToLower(), GetLocalizedPlantStatus().ToLower(), PlantType.ToString().ToLower()));
                    }
                }
                else
                {
                    LabelTo(from, string.Format("Bowl of {0} dirt with a {1} {2} {3}", m_PlantSystem.GetLocalizedDirtStatus().ToLower(), m_PlantSystem.GetLocalizedHealth().ToLower(), PlantHue.ToString().ToLower(), GetLocalizedPlantStatus().ToLower()));
                }
            }
            else
            {
                LabelTo(from, string.Format("Bowl of {0} dirt ", m_PlantSystem.GetLocalizedDirtStatus().ToLower()));
            }
        }
Ejemplo n.º 9
0
        public 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)
            {
                if (typeInfo.PlantCategory >= PlantCategory.Common && typeInfo.PlantCategory <= PlantCategory.Exotic)
                {
                    title = (int)typeInfo.PlantCategory;
                }
                else
                {
                    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
                }
            }
        }
Ejemplo n.º 10
0
        public bool BlocksMovement()
        {
            if (PlantStatus == PlantStatus.BowlOfDirt || PlantStatus == PlantStatus.DeadTwigs)
            {
                return(false);
            }

            PlantTypeInfo info = PlantTypeInfo.GetInfo(PlantType);
            ItemData      data = TileData.ItemTable[info.ItemID & TileData.MaxItemValue];

            TileFlag flags = data.Flags;

            return((flags & TileFlag.Impassable) > 0);
        }
Ejemplo n.º 11
0
        public override void AddNameProperty(ObjectPropertyList list)
        {
            PlantHueInfo hueInfo = PlantHueInfo.GetInfo(m_PlantHue);

            if (m_ShowType)
            {
                PlantTypeInfo typeInfo = PlantTypeInfo.GetInfo(m_PlantType);
                list.Add(hueInfo.IsBright() ? 1061918 : 1061917, "#" + hueInfo.Name.ToString() + "\t#" + typeInfo.Name.ToString());                 // [bright] ~1_COLOR~ ~2_TYPE~ seed
            }
            else
            {
                list.Add(hueInfo.IsBright() ? 1060839 : 1060838, "#" + hueInfo.Name.ToString());                 // [bright] ~1_val~ seed
            }
        }
Ejemplo n.º 12
0
        public override void OnSingleClick(Mobile from)
        {
            PlantHueInfo hueInfo = PlantHueInfo.GetInfo(m_PlantHue);

            if (m_ShowType)
            {
                PlantTypeInfo typeInfo = PlantTypeInfo.GetInfo(m_PlantType);
                LabelTo(from, hueInfo.IsBright() ? 1061918 : 1061917, String.Concat("#", hueInfo.Name.ToString(), "\t#", typeInfo.Name.ToString()));                     // [bright] ~1_COLOR~ ~2_TYPE~ seed
            }
            else
            {
                LabelTo(from, hueInfo.IsBright() ? 1060839 : 1060838, String.Concat("#", hueInfo.Name.ToString()));                     // [bright] ~1_val~ seed
            }
        }
Ejemplo n.º 13
0
        private void UpdateMaladies()
        {
            double infestationChance = 0.30 - this.StrengthPotion * 0.075 + (this.Water - 2) * 0.10;

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

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

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

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

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

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

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

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

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

            this.StrengthPotion = 0;
        }
Ejemplo n.º 14
0
 public override void OnSingleClick(Mobile from)
 {
     if (m_PlantStatus >= PlantStatus.DeadTwigs)
     {
         LabelTo(from, LabelNumber);
     }
     else if (m_PlantStatus >= PlantStatus.DecorativePlant)
     {
         LabelTo(from, 1061924);                   // a decorative plant
     }
     else if (m_PlantStatus >= PlantStatus.FullGrownPlant)
     {
         LabelTo(from, PlantTypeInfo.GetInfo(m_PlantType).Name);
     }
     else
     {
         LabelTo(from, 1029913);                   // plant bowl
     }
 }
Ejemplo n.º 15
0
        public override void AddNameProperty(ObjectPropertyList list)
        {
            PlantHueInfo hueInfo = PlantHueInfo.GetInfo(m_PlantHue);

            int title = PlantTypeInfo.GetBonsaiTitle(m_PlantType);

            if (title == 0)               // Not a bonsai
            {
                title = hueInfo.Name;
            }

            if (m_ShowType)
            {
                PlantTypeInfo typeInfo = PlantTypeInfo.GetInfo(m_PlantType);
                list.Add(hueInfo.IsBright() ? 1061918 : 1061917, String.Concat("#", title.ToString(), "\t#", typeInfo.Name.ToString()));                     // [bright] ~1_COLOR~ ~2_TYPE~ seed
            }
            else
            {
                list.Add(hueInfo.IsBright() ? 1060839 : 1060838, String.Concat("#", title.ToString()));                     // [bright] ~1_val~ seed
            }
        }
Ejemplo n.º 16
0
        private void DrawPlant()
        {
            PlantStatus status = m_Plant.PlantStatus;

            if (status < PlantStatus.FullGrownPlant)
            {
                AddImage(110, 85, 0x589);

                AddItem(122, 94, 0x914);
                AddItem(135, 94, 0x914);
                AddItem(120, 112, 0x914);
                AddItem(135, 112, 0x914);

                if (status >= PlantStatus.Stage2)
                {
                    AddItem(127, 112, 0xC62);
                }
                if (status == PlantStatus.Stage3 || status == PlantStatus.Stage4)
                {
                    AddItem(129, 85, 0xC7E);
                }
                if (status >= PlantStatus.Stage4)
                {
                    AddItem(121, 117, 0xC62);
                    AddItem(133, 117, 0xC62);
                }
                if (status >= PlantStatus.Stage5)
                {
                    AddItem(110, 100, 0xC62);
                    AddItem(140, 100, 0xC62);
                    AddItem(110, 130, 0xC62);
                    AddItem(140, 130, 0xC62);
                }
                if (status >= PlantStatus.Stage6)
                {
                    AddItem(105, 115, 0xC62);
                    AddItem(145, 115, 0xC62);
                    AddItem(125, 90, 0xC62);
                    AddItem(125, 135, 0xC62);
                }
            }
            else
            {
                PlantTypeInfo typeInfo = PlantTypeInfo.GetInfo(m_Plant.PlantType);
                PlantHueInfo  hueInfo  = PlantHueInfo.GetInfo(m_Plant.PlantHue);

                // The large images for these trees trigger a client crash, so use a smaller, generic tree.
                if (m_Plant.PlantType == PlantType.CypressTwisted || m_Plant.PlantType == PlantType.CypressStraight)
                {
                    AddItem(130 + typeInfo.OffsetX, 96 + typeInfo.OffsetY, 0x0CCA, hueInfo.Hue);
                }
                else
                {
                    AddItem(130 + typeInfo.OffsetX, 96 + typeInfo.OffsetY, typeInfo.ItemID, hueInfo.Hue);
                }
            }

            if (status != PlantStatus.BowlOfDirt)
            {
                int message = m_Plant.PlantSystem.GetLocalizedHealth();

                switch (m_Plant.PlantSystem.Health)
                {
                case PlantHealth.Dying:
                {
                    AddItem(92, 167, 0x1B9D);
                    AddItem(161, 167, 0x1B9D);

                    AddHtmlLocalized(136, 167, 42, 20, message, 0x00FC00, false, false);

                    break;
                }

                case PlantHealth.Wilted:
                {
                    AddItem(91, 164, 0x18E6);
                    AddItem(161, 164, 0x18E6);

                    AddHtmlLocalized(132, 167, 42, 20, message, 0x00C207, false, false);

                    break;
                }

                case PlantHealth.Healthy:
                {
                    AddItem(96, 168, 0xC61);
                    AddItem(162, 168, 0xC61);

                    AddHtmlLocalized(129, 167, 42, 20, message, 0x008200, false, false);

                    break;
                }

                case PlantHealth.Vibrant:
                {
                    AddItem(93, 162, 0x1A99);
                    AddItem(162, 162, 0x1A99);

                    AddHtmlLocalized(129, 167, 42, 20, message, 0x0083E0, false, false);

                    break;
                }
                }
            }
        }
Ejemplo n.º 17
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~
                    }
                }
            }
        }
Ejemplo n.º 18
0
        public override void AddNameProperty(ObjectPropertyList list)
        {
            if (m_PlantStatus >= PlantStatus.DeadTwigs)
            {
                base.AddNameProperty(list);
            }
            else if (m_PlantStatus >= PlantStatus.FullGrownPlant)
            {
                PlantHueInfo  hueInfo  = PlantHueInfo.GetInfo(m_PlantHue);
                PlantTypeInfo typeInfo = PlantTypeInfo.GetInfo(m_PlantType);

                int title = PlantTypeInfo.GetBonsaiTitle(m_PlantType);
                if (title == 0)                   // Not a bonsai
                {
                    title = hueInfo.Name;
                }

                if (m_PlantStatus < PlantStatus.DecorativePlant)
                {
                    if (m_PlantType == PlantType.SugarCanes)
                    {
                        string args = string.Format("#{0}", m_PlantSystem.GetLocalizedHealth());
                        list.Add(1094702, args);
                    }
                    else
                    {
                        string args = string.Format("#{0}\t#{1}\t#{2}", m_PlantSystem.GetLocalizedHealth(), title, typeInfo.Name);

                        if (typeInfo.ContainsPlant)
                        {
                            // a ~1_HEALTH~ [bright] ~2_COLOR~ ~3_NAME~
                            list.Add(hueInfo.IsBright() ? 1061891 : 1061889, args);
                        }
                        else
                        {
                            // a ~1_HEALTH~ [bright] ~2_COLOR~ ~3_NAME~ plant
                            list.Add(hueInfo.IsBright() ? 1061892 : 1061890, args);
                        }
                    }
                }
                else
                {
                    if (m_PlantType == PlantType.SugarCanes)
                    {
                        list.Add(1094703);
                    }
                    else if (title == 1080528)
                    {
                        // a decorative ~2_TYPE~
                        list.Add(1080539, string.Format("#{0}\t#{1}", title, typeInfo.Name));
                    }
                    else
                    {
                        // a decorative ~1_COLOR~ ~2_TYPE~ plant
                        list.Add(hueInfo.IsBright() ? 1074267 : 1070973, string.Format("#{0}\t#{1}", title, typeInfo.Name));
                    }
                }
            }
            else if (m_PlantStatus >= PlantStatus.Seed)
            {
                PlantHueInfo hueInfo = PlantHueInfo.GetInfo(m_PlantHue);

                int title = PlantTypeInfo.GetBonsaiTitle(m_PlantType);
                if (title == 0)                   // Not a bonsai
                {
                    title = hueInfo.Name;
                }

                string args = string.Format("#{0}\t#{1}\t#{2}", m_PlantSystem.GetLocalizedDirtStatus(), m_PlantSystem.GetLocalizedHealth(), title);

                // 7.0.12.0 cliloc change
                args = String.Concat("#1150435\t", args); // TODO: Change to plant container type when implemented

                if (m_ShowType)
                {
                    PlantTypeInfo typeInfo = PlantTypeInfo.GetInfo(m_PlantType);
                    args += "\t#" + typeInfo.Name.ToString();

                    if (typeInfo.ContainsPlant && m_PlantStatus == PlantStatus.Plant)
                    {
                        // a ~1_val~ of ~2_val~ dirt with a ~3_val~ [bright] ~4_val~ ~5_val~
                        list.Add(hueInfo.IsBright() ? 1060832 : 1060831, args);
                    }
                    else
                    {
                        // a ~1_val~ of ~2_val~ dirt with a ~3_val~ [bright] ~4_val~ ~5_val~ ~6_val~
                        list.Add(hueInfo.IsBright() ? 1061887 : 1061888, args + "\t#" + this.GetLocalizedPlantStatus().ToString());
                    }
                }
                else
                {
                    // a ~1_val~ of ~2_val~ dirt with a ~3_val~ [bright] ~4_val~ ~5_val~
                    list.Add(hueInfo.IsBright() ? 1060832 : 1060831, args + "\t#" + this.GetLocalizedPlantStatus().ToString());
                }
            }
            else
            {
                string args = "#" + m_PlantSystem.GetLocalizedDirtStatus();

                // 7.0.12.0 cliloc change
                args = String.Concat("#1150435\t", args); // TODO: Change to plant container type when implemented

                list.Add(1060830, args);                  // a ~1_val~ of ~2_val~ dirt
            }
        }