示例#1
0
 public override void AddNameProperty(ObjectPropertyList list)
 {
     if (PlantProps.Bright(Hue))
     {
         list.Add(1060839, PlantProps.Color(Hue));
     }
     else
     {
         list.Add(1060838, PlantProps.Color(Hue));
     }
 }
示例#2
0
 public override void AddNameProperty(ObjectPropertyList list)
 {
     if (!PlantProps.Bright(Hue))
     {
         list.Add(1061917, PlantProps.Color(Hue) + "\t" + PlantProps.PlantName(SeedType));             // ~1_COLOR~ ~2_TYPE~ seed
     }
     else
     {
         list.Add(1061918, PlantProps.Color(Hue) + "\t" + PlantProps.PlantName(SeedType));             // bright ~1_COLOR~ ~2_TYPE~ seed
     }
 }
 public override void AddNameProperty(ObjectPropertyList list)
 {
     if (m_SeedType == -9)
     {
         list.Add(1060830, Waterlvl);
     }
     else if (Stage < 7 && !Named)
     {
         string plantname = Waterlvl + "\t" + Health + "\t" + PlantProps.Color(SeedColor) + "\t" + PlantProps.Stages(Stage);
         if (PlantProps.Bright(SeedColor))
         {
             list.Add(1060832, plantname);
         }
         else
         {
             list.Add(1060831, plantname);
         }
     }
     else if (Stage < 7 && Named)
     {
         string plantname = Waterlvl + "\t" + Health + "\t" + PlantProps.Color(SeedColor) + "\t" + PlantProps.PlantName(SeedType) + "\t" + PlantProps.Stages(Stage);
         if (PlantProps.Bright(SeedColor))
         {
             list.Add(1061887, plantname);
         }
         else
         {
             list.Add(1061888, plantname);
         }
     }
     else
     {
         if (PlantProps.Bright(SeedColor))
         {
             list.Add(1061892, Health + "\t" + PlantProps.Color(SeedColor) + "\t" + PlantProps.PlantName(SeedType));
         }
         else
         {
             list.Add(1061890, Health + "\t" + PlantProps.Color(SeedColor) + "\t" + PlantProps.PlantName(SeedType));
         }
     }
 }
        public virtual bool CheckHealth(FullPlantBowl pot)
        {
            bool healthy = true;

            if (pot.Hits > 0)
            {
                //--------Check for cure against insects and for posion--------
                if ((pot.GPP - pot.Insect) == 0)
                {
                    pot.GPP    = 0;
                    pot.Insect = 0;
                }
                else if ((pot.GPP - pot.Insect) < 0)
                {
                    pot.Insect = pot.Insect - pot.GPP;
                    pot.GPP    = 0;
                    healthy    = false;
                }
                else
                {
                    pot.Poison = pot.Poison + (pot.GPP - pot.Insect);
                    pot.GPP    = 0;
                    pot.Insect = 0;
                }
                //--------Check for cure against fungi and for disease--------
                if ((pot.GCP - pot.Funghi) == 0)
                {
                    pot.GCP    = 0;
                    pot.Funghi = 0;
                }
                else if ((pot.GCP - pot.Funghi) < 0)
                {
                    pot.Funghi = pot.Funghi - pot.GPP;
                    pot.GCP    = 0;
                    healthy    = false;
                }
                else
                {
                    pot.Disease = pot.Disease + (pot.GCP - pot.Funghi);
                    pot.GCP     = 0;
                    pot.Funghi  = 0;
                }
                //--------Check for cure against disease and poison with heal potions-----
                if ((pot.GHP - pot.Disease) == 0)
                {
                    pot.GHP     = 0;
                    pot.Disease = pot.Disease;
                }
                else if ((pot.GHP - pot.Disease) < 0)
                {
                    pot.Disease = pot.Disease - pot.GHP;
                    if (pot.Disease > 2)
                    {
                        pot.Disease = 2;
                    }
                    pot.GHP = 0;
                    healthy = false;
                }
                else
                {
                    pot.GHP     = pot.GHP - pot.Disease;
                    pot.Disease = pot.Disease;
                }
                if ((pot.GHP - pot.Poison) == 0)
                {
                    pot.GHP    = 0;
                    pot.Poison = pot.Poison;
                }
                else if ((pot.GCP - pot.Poison) < 0)
                {
                    pot.Poison = pot.Poison - pot.GHP;
                    if (pot.Poison > 2)
                    {
                        pot.Poison = 2;
                    }
                    pot.GHP = 0;
                    healthy = false;
                }
                else
                {
                    pot.GHP    = pot.GHP - pot.Poison;
                    pot.Poison = pot.Poison;
                }
                //--------Check for healthy plant and add strength potions and heal------
                if (healthy)
                {
                    pot.Max  = pot.Max + (pot.GSP * 2);
                    pot.Hits = pot.Hits + (pot.GHP * 5);
                    pot.GSP  = 0;
                    pot.GHP  = 0;
                }
                else
                {
                    pot.Max  = pot.Max + (pot.GSP * 1);
                    pot.Hits = pot.Hits + (pot.GHP * 3);
                    pot.GSP  = 0;
                    pot.GHP  = 0;
                }

                if (pot.Funghi > 0)
                {
                    pot.Hits = pot.Hits - (5 * pot.Funghi);              // Lose 5 hitpoints per level of funghi
                }
                if (pot.Insect > 0)
                {
                    pot.Hits = pot.Hits - (5 * pot.Insect);              // Lose 5 hitpoints per level of insect infestation
                }
                if (pot.Poison > 0)
                {
                    pot.Hits = pot.Hits - (7 * pot.Poison);              // Lose 7 hitpoints per level of poison
                }
                if (pot.Disease > 0)
                {
                    pot.Hits = pot.Hits - (15 * pot.Disease);              // Lose 15 hitpoints per level of disease
                }
                if (pot.Water < 0)
                {
                    pot.Hits = pot.Hits - (pot.Water * -5);              // Lose 5 hitpoints per level of dihydration
                }
                if (pot.Hits < 1)
                {
                    pot.Grown = 1;
                    return(false);
                }

                if (pot.Funghi == 0)
                {
                    if (Utility.RandomMinMax((pot.Water * 3), 20) > 13) // 35% chance of fungi. Chances of fungi are greater if water level is high
                    {
                        pot.Funghi++;                                   //Plant get a fungi infestation
                    }
                }
                else
                {
                    pot.Funghi = 2;
                }

                if (pot.Insect == 0)
                {
                    if (Utility.RandomMinMax((pot.Water * 3), 20) > (PlantProps.Bright(pot.SeedColor) ? 12 : 14)) //30% Chance non bright colors, 40% bright colors. Chances of insects are greater if water level is high
                    {
                        pot.Insect++;                                                                             //Plant get an insect infestation
                    }
                }
                else
                {
                    pot.Insect = 2;
                }
                if (PlantProps.FatPlant(pot.SeedType))
                {
                    if (Utility.RandomDouble() > 0.30)
                    {
                        pot.Water--;
                    }
                }
                else
                {
                    pot.Water--;
                }
                return(true);
            }
            else
            {
                pot.Grown = 1;
                return(false);
            }
        }