Beispiel #1
0
        public ItemTypeList GetConsumeList()
        {
            ItemTypeList food = new ItemTypeList();

            // First, add CONSUME list
            foreach (ItemType it in Consume)
            {
                if (it.Rations > 0)
                {
                    food.Add(it);
                }
            }

            // Then, add all other items person can eat
            foreach (ItemType it in Man.Food)
            {
                if (it.Rations > 0 && !food.Contains(it))
                {
                    food.Add(it);
                }
            }

            return(food);
        }
Beispiel #2
0
        public ItemTypeList GetBurnList()
        {
            ItemTypeList burn = new ItemTypeList();

            // First, add BURN list
            foreach (ItemType it in Burn)
            {
                if (it.Burn)
                {
                    burn.Add(it);
                }
            }

            // Then, add all other items
            foreach (ItemType it in ItemType.List)
            {
                if (it.Burn && !burn.Contains(it))
                {
                    burn.Add(it);
                }
            }

            return(burn);
        }
Beispiel #3
0
 public ItemTypeListOrder()
 {
     this.What = new ItemTypeList();
 }
Beispiel #4
0
        public static void WriteSkillReport(SkillType st)
        {
            string s = st.ToString(lng) + " :";

            if (lng == Lang.En)
            {
                if (st.DescriptionEn != "")
                {
                    s += " " + st.DescriptionEn;
                }

                if (st.BasedOn != null)
                {
                    s += " This skill requires " + st.BasedOn.FullNameEn +
                         " [" + st.BasedOn.Name + "] to study.";
                }

                if (st.Special)
                {
                    s += " This is a special skill,";
                    if (st.BasedOn == null)
                    {
                        s += " it can't be learned by other persons.";
                    }
                    else
                    {
                        s += " a person can learn it only from team leader.";
                    }
                }

                // Production
                ItemTypeList products = new ItemTypeList();
                foreach (ItemType it in ItemType.List)
                {
                    if (it.ProduceSkill != null && it.ProduceSkill.Type == st)
                    {
                        products.Add(it);
                    }
                }
                if (products.Count > 0)
                {
                    s += " A person with this skill may PRODUCE " +
                         products.ToString(lng);
                }

                // Installation
                ItemTypeList installs = new ItemTypeList();
                foreach (ItemType it in ItemType.List)
                {
                    if (it.InstallSkill != null && it.InstallSkill.Type == st)
                    {
                        installs.Add(it);
                    }
                }
                if (installs.Count > 0)
                {
                    s += " A person with this skill can INSTALL and UNINSTALL " +
                         installs.ToString(lng);
                }

                // Building
                BuildingTypeList buildings = new BuildingTypeList();
                foreach (ItemType it in installs)
                {
                    foreach (BuildingType bt in BuildingType.List)
                    {
                        if (!bt.NoBuild && bt.Materials.Count > 0 && bt.Materials[0].Type == it)
                        {
                            buildings.Add(bt);
                        }
                    }
                }
                if (buildings.Count > 0)
                {
                    s += " It allows to BUILD: " + buildings.ToString(lng);
                }

                // Driving
                buildings.Clear();
                foreach (BuildingType bt in BuildingType.List)
                {
                    if (bt.DriveSkill != null && bt.DriveSkill.Type == st)
                    {
                        buildings.Add(bt);
                    }
                }
                if (buildings.Count > 0)
                {
                    s += " A person with this skill can DRIVE " + buildings.ToString(Lang.En);
                }
            }
            else
            {
                if (st.DescriptionRu != "")
                {
                    s += " " + st.DescriptionRu;
                }

                if (st.BasedOn != null)
                {
                    s += " Для изучения необходим навык " +
                         st.BasedOn.ToString(lng) + ".";
                }

                if (st.Special)
                {
                    s += " Это специальный навык,";
                    if (st.BasedOn == null)
                    {
                        s += " другие персонажи не могут получить его.";
                    }
                    else
                    {
                        s += " который можно получить только под руководством бригадира.";
                    }
                }

                // Production
                ItemTypeList products = new ItemTypeList();
                foreach (ItemType it in ItemType.List)
                {
                    if (it.ProduceSkill != null && it.ProduceSkill.Type == st)
                    {
                        products.Add(it);
                    }
                }
                if (products.Count > 0)
                {
                    s += " Навык позволяет производить предметы: " +
                         products.ToString(lng);
                }

                // Installation
                ItemTypeList installs = new ItemTypeList();
                foreach (ItemType it in ItemType.List)
                {
                    if (it.InstallSkill != null && it.InstallSkill.Type == st)
                    {
                        installs.Add(it);
                    }
                }
                if (installs.Count > 0)
                {
                    s += " Навык позволяет монтировать и демонтировать предметы: " +
                         installs.ToString(lng);
                }

                // Building
                BuildingTypeList buildings = new BuildingTypeList();
                foreach (ItemType it in installs)
                {
                    foreach (BuildingType bt in BuildingType.List)
                    {
                        if (!bt.NoBuild && bt.Materials.Count > 0 && bt.Materials[0].Type == it)
                        {
                            buildings.Add(bt);
                        }
                    }
                }
                if (buildings.Count > 0)
                {
                    s += " С его помощью могут быть построены: " + buildings.ToString(lng);
                }

                // Driving
                buildings.Clear();
                foreach (BuildingType bt in BuildingType.List)
                {
                    if (bt.DriveSkill != null && bt.DriveSkill.Type == st)
                    {
                        buildings.Add(bt);
                    }
                }
                if (buildings.Count > 0)
                {
                    s += " Навык позволяет водить машины: " +
                         buildings.ToString(lng);
                }
            }

            Write(s);
            Write("");
        }