Esempio n. 1
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 AddCharacterStats(CharacterValues values)
        {
            TreeNode characterValues = new TreeNode("Character stats");

            TreeNode accuracy = new TreeNode("Accuracy: " + values.Accuracy);
            accuracy.ForeColor = Color.Red;
            TreeNode strength = new TreeNode("Strength: " + values.Strength);
            strength.ForeColor = Color.Red;
            TreeNode stamina = new TreeNode("Stamina: " + values.Stamina);
            stamina.ForeColor = Color.Red;
            TreeNode willpower = new TreeNode("Willpower: " + values.Willpower);
            willpower.ForeColor = Color.Red;
            TreeNode availableAttributePoints = new TreeNode("Available attribute points: " + values.AttributePoints);
            availableAttributePoints.ForeColor = Color.Red;
            TreeNode availableSkillPoints = new TreeNode("Available skill points: " + values.SkillPoints);
            availableSkillPoints.ForeColor = Color.Red;
            TreeNode experiencePoints = new TreeNode("Experience points: " + values.Experience);
            experiencePoints.ForeColor = Color.Red;
            TreeNode achievementPoints = new TreeNode("Achievement points: " + values.AchievementPointsCur);
            achievementPoints.ForeColor = Color.Red;

            characterValues.Nodes.Add(accuracy);
            characterValues.Nodes.Add(strength);
            characterValues.Nodes.Add(stamina);
            characterValues.Nodes.Add(willpower);
            characterValues.Nodes.Add(availableAttributePoints);
            characterValues.Nodes.Add(availableSkillPoints);
            characterValues.Nodes.Add(experiencePoints);
            characterValues.Nodes.Add(achievementPoints);

            treeViewSkills.Nodes.Add(characterValues);
        }