private void AddCharacterSkills(CharacterSkills skills)
        {
            int counter = 0;

            foreach (SkillTab skillTab in skills.SkillTabs)
            {
                counter++;
                string name = "Perks (should not be displayed in Singleplayer)";
                switch (counter)
                {
                    case 1:
                        name = "Skill Page 1";
                        break;
                    case 2:
                        name = "Skill Page 2";
                        break;
                    case 3:
                        name = "Skill Page 3";
                        break;
                }

                TreeNode node = new TreeNode(name);

                foreach (Skill skill in skillTab.Skills)
                {
                    TreeNode subNode = new TreeNode(skill.Name);
                    subNode.ForeColor = Color.Red;
                    subNode.Nodes.Add("ID: " + skill.SkillID);
                    subNode.Nodes.Add("Learned: " + skill.Learned);
                    subNode.Nodes.Add("Level: " + skill.CurrentLevel + "/" + skill.MaxLevel);
                    subNode.Nodes.Add("Description: " + skill.Description);
                    subNode.Nodes.Add("Position: " + skill.Position.X + "," + skill.Position.Y);
                    subNode.Nodes.Add("Icon name: " + skill.IconName);
                    subNode.Nodes.Add("Required skill (ID): " + (skill.RequiredSkills.Length > 0 ? skill.RequiredSkills[0].ToString() : "none"));
                    subNode.Nodes.Add("Required skill (level): " + (skill.LevelsOfRequiredSkills.Length > 0 ? skill.LevelsOfRequiredSkills[0].ToString() : "none"));

                    node.Nodes.Add(subNode);
                }

                treeViewSkills.Nodes.Add(node);
            }
        }
Example #2
0
        public CharacterWrapper(UnitObject character, FileManager fileManager)
            : base(character, fileManager)
        {
            itemsTable = fileManager.GetDataTable("ITEMS");

            DataTable players = fileManager.GetDataTable("PLAYERS");

            DataRow[] playerRow = players.Select("code = " + character.UnitCode);

            if (playerRow.Length > 0)
            {
                int playerType = (int)playerRow[0]["unitType"];

                List <int> skillTabs = new List <int>();

                for (int counter = 1; counter < 8; counter++)
                {
                    int skillTab = (int)playerRow[0]["SkillTab" + counter];
                    if (skillTab >= 0)
                    {
                        skillTabs.Add(skillTab);
                    }
                }

                unitType = playerType - 3;

                characterSkills = new CharacterSkills(character, fileManager, skillTabs.ToArray());
            }

            characterClass     = GetCharacterClass(character);
            characterGameMode  = new CharacterGameMode(character, fileManager);
            characterValues    = new CharacterValues(character, fileManager);
            gender             = characterClass.ToString().EndsWith("_Male") ? Gender.Male : Gender.Female;
            weaponSlots        = new WeaponSlots(character, fileManager);
            characterInventory = new CharacterInventory(character, fileManager);

            if (characterClass == CharacterClass.Engineer_Male || characterClass == CharacterClass.Engineer_Female)
            {
                //drone = new EngineerDrone(character, fileManager);
            }
        }
Example #3
0
        public CharacterWrapper(UnitObject character, FileManager fileManager)
            : base(character, fileManager)
        {
            itemsTable = fileManager.GetDataTable("ITEMS");

            DataTable players = fileManager.GetDataTable("PLAYERS");
            DataRow[] playerRow = players.Select("code = " + character.UnitCode);

            if (playerRow.Length > 0)
            {
                int playerType = (int)playerRow[0]["unitType"];

                List<int> skillTabs = new List<int>();

                for (int counter = 1; counter < 8; counter++)
                {
                    int skillTab = (int)playerRow[0]["SkillTab" + counter];
                    if (skillTab >= 0)
                    {
                        skillTabs.Add(skillTab);
                    }
                }

                unitType = playerType - 3;

                characterSkills = new CharacterSkills(character, fileManager, skillTabs.ToArray());
            }

            characterClass = GetCharacterClass(character);
            characterGameMode = new CharacterGameMode(character, fileManager);
            characterValues = new CharacterValues(character, fileManager);
            gender = characterClass.ToString().EndsWith("_Male") ? Gender.Male : Gender.Female;
            weaponSlots = new WeaponSlots(character, fileManager);
            characterInventory = new CharacterInventory(character, fileManager);

            if (characterClass == CharacterClass.Engineer_Male || characterClass == CharacterClass.Engineer_Female)
            {
                //drone = new EngineerDrone(character, fileManager);
            }
        }
        private void AddGeneralSkills(CharacterSkills skills)
        {
            TreeNode general = new TreeNode("General skills (bugged for Ressurection -> where do all those extra skills come from?)");

            foreach (Skill skill in skills.GeneralSkills.Skills)
            {
                TreeNode subNode = new TreeNode(skill.Name);
                subNode.ForeColor = Color.Red;
                subNode.Nodes.Add("ID: " + skill.SkillID);
                subNode.Nodes.Add("Learned: " + skill.Learned);
                subNode.Nodes.Add("Level: " + skill.CurrentLevel + "/" + skill.MaxLevel);
                subNode.Nodes.Add("Description: " + skill.Description);
                subNode.Nodes.Add("Position: " + skill.Position.X + "," + skill.Position.Y);
                subNode.Nodes.Add("Icon name: " + skill.IconName);
                subNode.Nodes.Add("Required skill (ID): " + (skill.RequiredSkills.Length > 0 ? skill.RequiredSkills[0].ToString() : "none"));
                subNode.Nodes.Add("Required skill (level): " + (skill.LevelsOfRequiredSkills.Length > 0 ? skill.LevelsOfRequiredSkills[0].ToString() : "none"));
                general.Nodes.Add(subNode);
            }

            treeViewSkills.Nodes.Add(general);
        }