Ejemplo n.º 1
0
   public Client(
 int id,
 string lastName,
 string firstName,
 string middleName,
 DateTime birthDay,
 Gender sex,
 string country,
 string city,
 float height,
 float weight,
 HairColors hairColor,
 EyesColors eyesColor
 )
   {
       ID = id;
         LastName = lastName;
         FirstName = firstName;
         MiddleName = middleName;
         BirthDay = birthDay;
         Sex = sex;
         Country = country;
         City = city;
         Height = height;
         Weight = weight;
         HairColor = hairColor;
         EyesColor = eyesColor;
         ZodiacSing = DatingAgency.ZodiacSing.GetZodiacSing(BirthDay);
   }
Ejemplo n.º 2
0
        public Character()
        {
            _class = CharacterEnums.CharacterClass.Explorer;
            _race = CharacterEnums.CharacterRace.Human;
            _gender = CharacterEnums.Genders.Female;
            _skinColor = CharacterEnums.SkinColors.Fair;
            _skinType = CharacterEnums.SkinType.Flesh;
            _hairColor = CharacterEnums.HairColors.Black;
            _eyeColor = CharacterEnums.EyeColors.Brown;
            _build = CharacterEnums.BodyBuild.Medium;

            _koCount = new Tuple<int, DateTime>(0, DateTime.Now);
            _actionState = CharacterActionState.None;
            _stanceState = CharacterStanceState.Standing;

            _primaryLanguage = CharacterEnums.Languages.Common;
            KnownLanguages = new HashSet<Languages>();
            KnownLanguages.Add(_primaryLanguage);

            FirstName = "";
            LastName = "";
            Description = "";
            Age = 17;   //Do we want an age? And are we going to advance it every in game year?  We'll need a birthdate for this.
            Weight = 180; //pounds or kilos?
            Height = 70;  //inches or centimeters?
            Location = "A1";
            InCombat = false;
            LastCombatTime = DateTime.MinValue.ToUniversalTime();
            IsNPC = false;
            Leveled = false;
            MainHand = "WIELD_RIGHT";
            NextLevelExperience = 300;
            Level = 1;
            Experience = 0;
            PointsToSpend = 0;

            Inventory = new Inventory();
            Equipment = new Equipment();
            Bonuses = new StatBonuses();

            Inventory.playerID = this.ID;
            Equipment.playerID = this.ID;

            Attributes = new Dictionary<string, Attribute>();

            Attributes.Add("Hitpoints", new Attribute(150, "Hitpoints", 150, 0.1, 1));
            Attributes.Add("Dexterity", new Attribute(10, "Dexterity", 5, 0, 1));
            Attributes.Add("Strength", new Attribute(10, "Strength", 5, 0, 1));
            Attributes.Add("Intelligence", new Attribute(10, "Intelligence", 5, 0, 1));
            Attributes.Add("Endurance", new Attribute(10, "Endurance", 5, 0, 1));
            Attributes.Add("Charisma", new Attribute(10, "Charisma", 5, 0, 1));

            SubAttributes = new Dictionary<string, double>();

            SubAttributes.Add("Agility", 1);
            SubAttributes.Add("Toughness", 1);
            SubAttributes.Add("Cunning", 1);
            SubAttributes.Add("Wisdom", 1);
            SubAttributes.Add("Leadership", 1);
        }
Ejemplo n.º 3
0
        public Character()
        {
            _class     = CharacterEnums.CharacterClass.Explorer;
            _race      = CharacterEnums.CharacterRace.Human;
            _gender    = CharacterEnums.Genders.Female;
            _skinColor = CharacterEnums.SkinColors.Fair;
            _skinType  = CharacterEnums.SkinType.Flesh;
            _hairColor = CharacterEnums.HairColors.Black;
            _eyeColor  = CharacterEnums.EyeColors.Brown;
            _build     = CharacterEnums.BodyBuild.Medium;

            _koCount     = new Tuple <int, DateTime>(0, DateTime.Now);
            _actionState = CharacterActionState.None;
            _stanceState = CharacterStanceState.Standing;

            _primaryLanguage = CharacterEnums.Languages.Common;
            KnownLanguages   = new HashSet <Languages>();
            KnownLanguages.Add(_primaryLanguage);

            FirstName           = "";
            LastName            = "";
            Description         = "";
            Age                 = 17;  //Do we want an age? And are we going to advance it every in game year?  We'll need a birthdate for this.
            Weight              = 180; //pounds or kilos?
            Height              = 70;  //inches or centimeters?
            Location            = "A1";
            InCombat            = false;
            LastCombatTime      = DateTime.MinValue.ToUniversalTime();
            IsNPC               = false;
            Leveled             = false;
            MainHand            = "WIELD_RIGHT";
            NextLevelExperience = 300;
            Level               = 1;
            Experience          = 0;
            PointsToSpend       = 0;

            Inventory = new Inventory();
            Equipment = new Equipment();
            Bonuses   = new StatBonuses();

            Inventory.playerID = this.ID;
            Equipment.playerID = this.ID;

            Attributes = new Dictionary <string, Attribute>();

            Attributes.Add("Hitpoints", new Attribute(150, "Hitpoints", 150, 0.1, 1));
            Attributes.Add("Dexterity", new Attribute(10, "Dexterity", 5, 0, 1));
            Attributes.Add("Strength", new Attribute(10, "Strength", 5, 0, 1));
            Attributes.Add("Intelligence", new Attribute(10, "Intelligence", 5, 0, 1));
            Attributes.Add("Endurance", new Attribute(10, "Endurance", 5, 0, 1));
            Attributes.Add("Charisma", new Attribute(10, "Charisma", 5, 0, 1));

            SubAttributes = new Dictionary <string, double>();

            SubAttributes.Add("Agility", 1);
            SubAttributes.Add("Toughness", 1);
            SubAttributes.Add("Cunning", 1);
            SubAttributes.Add("Wisdom", 1);
            SubAttributes.Add("Leadership", 1);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Deep copy constructor
        /// </summary>
        /// <param name="copy"></param>
        public Character(Character copy)   //copy constructor
        {
            _class       = copy._class;
            _race        = copy._race;
            _gender      = copy._gender;
            _skinColor   = copy._skinColor;
            _skinType    = copy._skinType;
            _hairColor   = copy._hairColor;
            _eyeColor    = copy._eyeColor;
            _build       = copy._build;
            _koCount     = new Tuple <int, DateTime>(0, DateTime.Now);
            _actionState = CharacterActionState.None;
            _stanceState = CharacterStanceState.Standing;

            _primaryLanguage = copy._primaryLanguage;
            KnownLanguages   = new HashSet <Languages>();
            foreach (CharacterEnums.Languages lang in copy.KnownLanguages)
            {
                KnownLanguages.Add(lang);
            }

            FirstName           = copy.FirstName;
            LastName            = copy.LastName;
            Description         = copy.Description;
            Age                 = copy.Age;    //Do we want an age? And are we going to advance it every in game year?  Players could be 400+ years old rather quick.
            Weight              = copy.Weight; //pounds or kilos?
            Height              = copy.Height; //inches or centimeters?
            Location            = "A1";
            InCombat            = false;
            LastCombatTime      = DateTime.MinValue.ToUniversalTime();
            IsNPC               = false;
            Leveled             = false;
            NextLevelExperience = 300;
            Level               = 1;
            Experience          = 0;
            PointsToSpend       = 0;
            MainHand            = "WIELD_RIGHT";


            Attributes = new Dictionary <string, Attribute>();

            foreach (KeyValuePair <string, Attribute> attrib in copy.Attributes)
            {
                Attributes.Add(attrib.Key, attrib.Value);
            }

            SubAttributes = new Dictionary <string, double>();

            foreach (KeyValuePair <string, double> subAttrib in copy.SubAttributes)
            {
                SubAttributes.Add(subAttrib.Key, subAttrib.Value);
            }

            Inventory = new Inventory();


            this.Save();
        }
        public bool Equals(DestinyCharacterCustomization input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Personality == input.Personality ||
                     (Personality.Equals(input.Personality))
                     ) &&
                 (
                     Face == input.Face ||
                     (Face.Equals(input.Face))
                 ) &&
                 (
                     SkinColor == input.SkinColor ||
                     (SkinColor.Equals(input.SkinColor))
                 ) &&
                 (
                     LipColor == input.LipColor ||
                     (LipColor.Equals(input.LipColor))
                 ) &&
                 (
                     EyeColor == input.EyeColor ||
                     (EyeColor.Equals(input.EyeColor))
                 ) &&
                 (
                     HairColors == input.HairColors ||
                     (HairColors != null && HairColors.SequenceEqual(input.HairColors))
                 ) &&
                 (
                     FeatureColors == input.FeatureColors ||
                     (FeatureColors != null && FeatureColors.SequenceEqual(input.FeatureColors))
                 ) &&
                 (
                     DecalColor == input.DecalColor ||
                     (DecalColor.Equals(input.DecalColor))
                 ) &&
                 (
                     WearHelmet == input.WearHelmet ||
                     (WearHelmet != null && WearHelmet.Equals(input.WearHelmet))
                 ) &&
                 (
                     HairIndex == input.HairIndex ||
                     (HairIndex.Equals(input.HairIndex))
                 ) &&
                 (
                     FeatureIndex == input.FeatureIndex ||
                     (FeatureIndex.Equals(input.FeatureIndex))
                 ) &&
                 (
                     DecalIndex == input.DecalIndex ||
                     (DecalIndex.Equals(input.DecalIndex))
                 ));
        }
Ejemplo n.º 6
0
        public Character(CharacterRace race, CharacterClass characterClass, Genders gender, Languages language, SkinColors skinColor, SkinType skinType, HairColors hairColor, EyeColors eyeColor, BodyBuild build)
        {
            _class     = characterClass;
            _race      = race;
            _gender    = gender;
            _skinColor = skinColor;
            _skinType  = skinType;
            _hairColor = hairColor;
            _eyeColor  = eyeColor;
            _build     = build;

            _koCount     = new Tuple <int, DateTime>(0, DateTime.Now);
            _actionState = CharacterActionState.None;
            _stanceState = CharacterStanceState.Standing;

            _primaryLanguage = language;
            KnownLanguages   = new HashSet <Languages>();
            KnownLanguages.Add(_primaryLanguage);

            FirstName           = "";
            LastName            = "";
            Description         = "";
            Age                 = 17;     //Do we want an age? And are we going to advance it every in game year?
            Weight              = 180.0d; //pounds or kilos?
            Height              = 70.0d;  //inches or centimeters?
            Location            = "A1";
            InCombat            = false;
            LastCombatTime      = DateTime.MinValue.ToUniversalTime();
            IsNPC               = false;
            Leveled             = false;
            MainHand            = "WIELD_RIGHT";
            NextLevelExperience = 300;
            Level               = 1;
            Experience          = 0;
            PointsToSpend       = 0;

            Inventory = new Inventory();
            Bonuses   = new StatBonuses();

            Attributes = new Dictionary <string, Attribute>();

            Attributes.Add("Hitpoints", new Attribute(150, "Hitpoints", 150, 0.1, 1));
            Attributes.Add("Dexterity", new Attribute(10, "Dexterity", 5, 0, 1));
            Attributes.Add("Strength", new Attribute(10, "Strength", 5, 0, 1));
            Attributes.Add("Intelligence", new Attribute(10, "Intelligence", 5, 0, 1));
            Attributes.Add("Endurance", new Attribute(10, "Endurance", 5, 0, 1));
            Attributes.Add("Charisma", new Attribute(10, "Charisma", 5, 0, 1));

            SubAttributes = new Dictionary <string, double>();

            SubAttributes.Add("Agility", 1);
            SubAttributes.Add("Toughness", 1);
            SubAttributes.Add("Cunning", 1);
            SubAttributes.Add("Wisdom", 1);
            SubAttributes.Add("Leadership", 1);
        }
Ejemplo n.º 7
0
 public bool DeepEquals(DestinyCharacterCustomization?other)
 {
     return(other is not null &&
            Personality == other.Personality &&
            Face == other.Face &&
            SkinColor == other.SkinColor &&
            LipColor == other.LipColor &&
            EyeColor == other.EyeColor &&
            HairColors.DeepEqualsListNaive(other.HairColors) &&
            FeatureColors.DeepEqualsListNaive(other.FeatureColors) &&
            DecalColor == other.DecalColor &&
            WearHelmet == other.WearHelmet &&
            HairIndex == other.HairIndex &&
            FeatureIndex == other.FeatureIndex &&
            DecalIndex == other.DecalIndex);
 }
            public void GenerateBodyStats()
            {
                height             = UnityEngine.Random.Range(60f, 80f);
                heightScale        = height / defaultHeight * height / defaultHeight;
                inverseHeightScale = 1 / heightScale;
                baseWeight         = heightScale * defaultBaseWeight;

                // Random BF % to determine starting total weight
                float percentBodyFat = UnityEngine.Random.Range(12f, 30f) / 100;

                fatWeight = baseWeight / (1 - percentBodyFat) - baseWeight;

                int bodyTypeCount = Enum.GetNames(typeof(BodyTypes)).Length;
                int randomType    = UnityEngine.Random.Range(0, bodyTypeCount);

                bodyType = (BodyTypes)randomType;

                randomType = UnityEngine.Random.Range(0, Enum.GetNames(typeof(EyeColors)).Length);
                eyeColor   = (EyeColors)randomType;

                randomType = UnityEngine.Random.Range(0, Enum.GetNames(typeof(HairColors)).Length);
                hairColor  = (HairColors)randomType;
                hairLength = UnityEngine.Random.Range(3, 24);
            }
Ejemplo n.º 9
0
Archivo: NPC.cs Proyecto: vadian/Novus
        public void Load(string id)
        {
            MongoUtils.MongoData.ConnectToDatabase();
            MongoDatabase   characterDB         = MongoUtils.MongoData.GetDatabase("Characters");
            MongoCollection characterCollection = characterDB.GetCollection <BsonDocument>("NPCCharacters");
            IMongoQuery     query = Query.EQ("_id", ObjectId.Parse(id));
            BsonDocument    found = characterCollection.FindOneAs <BsonDocument>(query);

            ID                = found["_id"].AsObjectId.ToString();
            FirstName         = found["FirstName"].AsString.CamelCaseWord();
            LastName          = found["LastName"].AsString.CamelCaseWord();
            _class            = (CharacterClass)Enum.Parse(typeof(CharacterClass), found["Class"].AsString.CamelCaseWord());
            _race             = (CharacterRace)Enum.Parse(typeof(CharacterRace), found["Race"].AsString.CamelCaseWord());
            _gender           = (Genders)Enum.Parse(typeof(Genders), found["Gender"].AsString.CamelCaseWord());
            _skinType         = (SkinType)Enum.Parse(typeof(SkinType), found["SkinType"].AsString.CamelCaseWord());
            _skinColor        = (SkinColors)Enum.Parse(typeof(SkinColors), found["SkinColor"].AsString.CamelCaseWord());
            _skinType         = (SkinType)Enum.Parse(typeof(SkinType), found["SkinType"].AsString.CamelCaseWord());
            _hairColor        = (HairColors)Enum.Parse(typeof(HairColors), found["HairColor"].AsString.CamelCaseWord());
            _eyeColor         = (EyeColors)Enum.Parse(typeof(EyeColors), found["EyeColor"].AsString.CamelCaseWord());
            _stanceState      = (CharacterStanceState)Enum.Parse(typeof(CharacterStanceState), found["StanceState"].AsString.CamelCaseWord());
            _actionState      = (CharacterActionState)Enum.Parse(typeof(CharacterActionState), found["ActionState"].AsString.CamelCaseWord());
            Description       = found["Description"].AsString;
            Location          = found["Location"].AsString;
            Height            = found["Height"].AsDouble;
            Weight            = found["Weight"].AsDouble;
            IsNPC             = found["IsNPC"].AsBoolean;
            MobTypeID         = found["MobTypeID"].AsInt32;
            NextAiAction      = found["NextAiAction"].ToUniversalTime();
            InCombat          = found["InCombat"].AsBoolean;
            LastCombatTime    = found["LastCombatTime"].ToUniversalTime();
            CurrentTarget     = found["CurrentTarget"].AsString != "" ? found["CurrentTarget"].AsString : null;
            LastTarget        = found["LastTarget"].AsString != "" ? found["LastTarget"].AsString : null;
            Fsm.state         = Fsm.GetStateFromName(found["AiState"].AsString);
            Fsm.previousState = Fsm.GetStateFromName(found["previousAiState"].AsString);
            Fsm.globalState   = Fsm.GetStateFromName(found["AiGlobalState"].AsString);
            Experience        = found["Experience"].AsInt64;
            Level             = found["Level"].AsInt32;
            Title             = found.Contains("Title") ? found["Title"].AsString : "";
            KillerID          = found.Contains("KillerID") ? found["KillerID"].AsString : "";

            //if you just use var instead of casting it like this you will be in a world of pain and suffering when dealing with subdocuments.
            BsonArray    playerAttributes = found["Attributes"].AsBsonArray;
            BsonArray    xpTracker        = found["XpTracker"].AsBsonArray;
            BsonDocument triggers         = found["Triggers"].AsBsonDocument;
            BsonArray    bonusesList      = null;

            if (found.Contains("Bonuses"))
            {
                bonusesList = found["Bonuses"].AsBsonArray;
            }

            if (playerAttributes != null)
            {
                foreach (BsonDocument attrib in playerAttributes)
                {
                    if (!this.Attributes.ContainsKey(attrib["Name"].ToString()))
                    {
                        Attribute tempAttrib = new Attribute();
                        tempAttrib.Name      = attrib["Name"].ToString();
                        tempAttrib.Value     = attrib["Value"].AsDouble;
                        tempAttrib.Max       = attrib["Max"].AsDouble;
                        tempAttrib.RegenRate = attrib["RegenRate"].AsDouble;


                        this.Attributes.Add(tempAttrib.Name, tempAttrib);
                    }
                    else
                    {
                        this.Attributes[attrib["Name"].ToString()].Max       = attrib["Max"].AsDouble;
                        this.Attributes[attrib["Name"].ToString()].Value     = attrib["Value"].AsDouble;
                        this.Attributes[attrib["Name"].ToString()].RegenRate = attrib["RegenRate"].AsDouble;
                    }
                }
            }

            if (xpTracker != null && xpTracker.Count > 0)
            {
                foreach (BsonDocument track in xpTracker)
                {
                    //we just newed this up so it should always have to be refilled
                    damageTracker.Add(track["ID"].AsString, track["Value"].AsDouble);
                }
            }

            ITrigger trigger = new GeneralTrigger(triggers, "NPC");

            Triggers.Add(trigger);

            if (bonusesList != null && bonusesList.Count > 0)
            {
                Bonuses.LoadFromBson(bonusesList);
            }
        }
Ejemplo n.º 10
0
		public Character(CharacterRace race, CharacterClass characterClass, Genders gender, Languages language, SkinColors skinColor, SkinType skinType, HairColors hairColor, EyeColors eyeColor, BodyBuild build) {
			Class = characterClass;
			Race = race;
			Gender = gender;
            SkinColor = skinColor;
            SkinType = skinType;
            HairColor = hairColor;
            EyeColor = eyeColor;
            Build = build;

			_koCount = new Tuple<int, DateTime>(0, DateTime.Now);
			_actionState = CharacterActionState.None;
			_stanceState = CharacterStanceState.Standing;
            
            _primaryLanguage = language;
            KnownLanguages = new HashSet<Languages>();
            KnownLanguages.Add(_primaryLanguage);

			FirstName = "";
			LastName = "";
			Description = "";
			Age = 17;   //Do we want an age? And are we going to advance it every in game year?
			Weight = 180.0d; //pounds or kilos?
			Height = 70.0d;  //inches or centimeters?
			Location = "A1000";
			InCombat = false;
			LastCombatTime = DateTime.MinValue.ToUniversalTime();
            IsNPC = false;
            Leveled = false;
            MainHand = "WIELD_RIGHT";
            NextLevelExperience = 300;
            Level = 1;
            Experience = 0;
            PointsToSpend = 0;

            Inventory = new Inventory();
			Equipment = new Equipment();
			Bonuses = new Dictionary<BonusTypes, Bonus>();
            StatBonus = new StatBonuses();
			StatBonus.Bonuses = Bonuses;

			Inventory.playerID = Id;
			Equipment.playerID = Id;

			Attributes = new List<Attribute>();

			Attributes.Add(new Attribute(150, "Hitpoints", 150, 0.1, 1));
			Attributes.Add(new Attribute(10, "Dexterity", 5, 0, 1));
			Attributes.Add(new Attribute(10, "Strength", 5, 0, 1));
			Attributes.Add(new Attribute(10, "Intelligence", 5, 0, 1));
			Attributes.Add( new Attribute(10, "Endurance", 5, 0, 1));
			Attributes.Add(new Attribute(10, "Charisma", 5, 0, 1));

			SubAttributes = new Dictionary<string, double>();

			SubAttributes.Add("Agility", 1);
			SubAttributes.Add("Toughness", 1);
			SubAttributes.Add("Cunning", 1);
			SubAttributes.Add("Wisdom", 1);
			SubAttributes.Add("Leadership", 1);
		}
Ejemplo n.º 11
0
 public void Update(DestinyCharacterCustomization?other)
 {
     if (other is null)
     {
         return;
     }
     if (Personality != other.Personality)
     {
         Personality = other.Personality;
         OnPropertyChanged(nameof(Personality));
     }
     if (Face != other.Face)
     {
         Face = other.Face;
         OnPropertyChanged(nameof(Face));
     }
     if (SkinColor != other.SkinColor)
     {
         SkinColor = other.SkinColor;
         OnPropertyChanged(nameof(SkinColor));
     }
     if (LipColor != other.LipColor)
     {
         LipColor = other.LipColor;
         OnPropertyChanged(nameof(LipColor));
     }
     if (EyeColor != other.EyeColor)
     {
         EyeColor = other.EyeColor;
         OnPropertyChanged(nameof(EyeColor));
     }
     if (!HairColors.DeepEqualsListNaive(other.HairColors))
     {
         HairColors = other.HairColors;
         OnPropertyChanged(nameof(HairColors));
     }
     if (!FeatureColors.DeepEqualsListNaive(other.FeatureColors))
     {
         FeatureColors = other.FeatureColors;
         OnPropertyChanged(nameof(FeatureColors));
     }
     if (DecalColor != other.DecalColor)
     {
         DecalColor = other.DecalColor;
         OnPropertyChanged(nameof(DecalColor));
     }
     if (WearHelmet != other.WearHelmet)
     {
         WearHelmet = other.WearHelmet;
         OnPropertyChanged(nameof(WearHelmet));
     }
     if (HairIndex != other.HairIndex)
     {
         HairIndex = other.HairIndex;
         OnPropertyChanged(nameof(HairIndex));
     }
     if (FeatureIndex != other.FeatureIndex)
     {
         FeatureIndex = other.FeatureIndex;
         OnPropertyChanged(nameof(FeatureIndex));
     }
     if (DecalIndex != other.DecalIndex)
     {
         DecalIndex = other.DecalIndex;
         OnPropertyChanged(nameof(DecalIndex));
     }
 }
Ejemplo n.º 12
0
        public void Load(string id)
        {
            MongoUtils.MongoData.ConnectToDatabase();
            MongoDatabase characterDB = MongoUtils.MongoData.GetDatabase("Characters");
            MongoCollection characterCollection = characterDB.GetCollection<BsonDocument>("PlayerCharacter");
            IMongoQuery query = Query.EQ("_id", ObjectId.Parse(id));
            BsonDocument found = characterCollection.FindOneAs<BsonDocument>(query);

            ID = found["_id"].AsObjectId.ToString();
            FirstName = found["FirstName"].AsString.CamelCaseWord();
            LastName = found["LastName"].AsString.CamelCaseWord();
            _class = (CharacterClass)Enum.Parse(typeof(CharacterClass), found["Class"].AsString.CamelCaseWord());
            _race = (CharacterRace)Enum.Parse(typeof(CharacterRace), found["Race"].AsString.CamelCaseWord());
            _gender = (Genders)Enum.Parse(typeof(Genders), found["Gender"].AsString.CamelCaseWord());
            _skinType = (SkinType)Enum.Parse(typeof(SkinType), found["SkinType"].AsString.CamelCaseWord());
            _skinColor = (SkinColors)Enum.Parse(typeof(SkinColors), found["SkinColor"].AsString.CamelCaseWord());
            _skinType = (SkinType)Enum.Parse(typeof(SkinType), found["SkinType"].AsString.CamelCaseWord());
            _hairColor = (HairColors)Enum.Parse(typeof(HairColors), found["HairColor"].AsString.CamelCaseWord());
            _eyeColor = (EyeColors)Enum.Parse(typeof(EyeColors), found["EyeColor"].AsString.CamelCaseWord());
            Height = found["Height"].AsDouble;
            Weight = found["Weight"].AsDouble;
            _stanceState = (CharacterStanceState)Enum.Parse(typeof(CharacterStanceState), found["StanceState"].AsString.CamelCaseWord());
            _actionState = (CharacterActionState)Enum.Parse(typeof(CharacterActionState), found["ActionState"].AsString.CamelCaseWord());
            Description = found["Description"].AsString;
            Location = found["Location"].AsString;
            Password = found["Password"].AsString;
            IsNPC = found["IsNPC"].AsBoolean;
            Experience = found["Experience"].AsInt64;
            NextLevelExperience = found["NextLevelExperience"].AsInt64;
            Level = found["Level"].AsInt32;
            Leveled = found["Leveled"].AsBoolean;
            PointsToSpend = found["PointsToSpend"].AsInt32;
            MainHand = found["MainHand"].AsString != "" ? found["MainHand"].AsString : null;
            Title = found.Contains("Title") ? found["Title"].AsString : "";
            KillerID = found.Contains("KillerID") ? found["KillerID"].AsString : "";

            BsonArray playerAttributes = found["Attributes"].AsBsonArray;
            BsonArray inventoryList = found["Inventory"].AsBsonArray;
            BsonArray equipmentList = found["Equipment"].AsBsonArray;
            BsonArray bonusesList = found["Bonuses"].AsBsonArray;

            if (playerAttributes != null) {
                foreach (BsonDocument attrib in playerAttributes) {

                    if (!this.Attributes.ContainsKey(attrib["Name"].ToString())) {
                        Attribute tempAttrib = new Attribute();
                        tempAttrib.Name = attrib["Name"].ToString();
                        tempAttrib.Value = attrib["Value"].AsDouble;
                        tempAttrib.Max = attrib["Max"].AsDouble ;
                        tempAttrib.RegenRate = attrib["RegenRate"].AsDouble;
                        tempAttrib.Rank = attrib["Rank"].AsInt32;

                        this.Attributes.Add(tempAttrib.Name, tempAttrib);
                    }
                    else {
                        this.Attributes[attrib["Name"].ToString()].Max = attrib["Max"].AsDouble;
                        this.Attributes[attrib["Name"].ToString()].Value = attrib["Value"].AsDouble;
                        this.Attributes[attrib["Name"].ToString()].RegenRate = attrib["RegenRate"].AsDouble;
                        this.Attributes[attrib["Name"].ToString()].Rank = attrib["Rank"].AsInt32;
                    }
                }
            }

            if (inventoryList.Count > 0) {
                foreach (BsonDocument item in inventoryList) {
                    Items.Iitem fullItem = Items.Items.GetByID(item["_id"].AsObjectId.ToString());
                    if (!Inventory.inventory.Contains(fullItem)) {
                        Inventory.AddItemToInventory(fullItem);
                    }
                }
            }

            if (equipmentList.Count > 0) {
                foreach (BsonDocument item in equipmentList) {
                    Items.Iitem fullItem = Items.Items.GetByID(item["_id"].AsObjectId.ToString());
                    if (!Equipment.equipped.ContainsKey(fullItem.WornOn)) {
                        Equipment.EquipItem(fullItem, this.Inventory);
                    }
                }
            }

            if (bonusesList.Count > 0) {
                Bonuses.LoadFromBson(bonusesList);
            }
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Deep copy constructor
        /// </summary>
        /// <param name="copy"></param>
        public Character(Character copy)
        {
            //copy constructor
            _class = copy._class;
            _race = copy._race;
            _gender = copy._gender;
            _skinColor = copy._skinColor;
            _skinType = copy._skinType;
            _hairColor = copy._hairColor;
            _eyeColor = copy._eyeColor;
            _build = copy._build;
            _koCount = new Tuple<int, DateTime>(0, DateTime.Now);
            _actionState = CharacterActionState.None;
            _stanceState = CharacterStanceState.Standing;

            _primaryLanguage = copy._primaryLanguage;
            KnownLanguages = new HashSet<Languages>();
            foreach (CharacterEnums.Languages lang in copy.KnownLanguages) {
                KnownLanguages.Add(lang);
            }

            FirstName = copy.FirstName;
            LastName = copy.LastName;
            Description = copy.Description;
            Age = copy.Age;   //Do we want an age? And are we going to advance it every in game year?  Players could be 400+ years old rather quick.
            Weight = copy.Weight; //pounds or kilos?
            Height = copy.Height;  //inches or centimeters?
            Location = "A1";
            InCombat = false;
            LastCombatTime = DateTime.MinValue.ToUniversalTime();
            IsNPC = false;
            Leveled = false;
            NextLevelExperience = 300;
            Level = 1;
            Experience = 0;
            PointsToSpend = 0;
            MainHand = "WIELD_RIGHT";

            Attributes = new Dictionary<string, Attribute>();

            foreach (KeyValuePair<string, Attribute> attrib in copy.Attributes){
                Attributes.Add(attrib.Key, attrib.Value);
            }

            SubAttributes = new Dictionary<string, double>();

            foreach (KeyValuePair<string, double> subAttrib in copy.SubAttributes) {
                SubAttributes.Add(subAttrib.Key, subAttrib.Value);
            }

            Inventory = new Inventory();

            this.Save();
        }
Ejemplo n.º 14
0
        public void Load(string id)
        {
            MongoUtils.MongoData.ConnectToDatabase();
            MongoDatabase   characterDB         = MongoUtils.MongoData.GetDatabase("Characters");
            MongoCollection characterCollection = characterDB.GetCollection <BsonDocument>("PlayerCharacter");
            IMongoQuery     query = Query.EQ("_id", ObjectId.Parse(id));
            BsonDocument    found = characterCollection.FindOneAs <BsonDocument>(query);

            ID                  = found["_id"].AsObjectId.ToString();
            FirstName           = found["FirstName"].AsString.CamelCaseWord();
            LastName            = found["LastName"].AsString.CamelCaseWord();
            _class              = (CharacterClass)Enum.Parse(typeof(CharacterClass), found["Class"].AsString.CamelCaseWord());
            _race               = (CharacterRace)Enum.Parse(typeof(CharacterRace), found["Race"].AsString.CamelCaseWord());
            _gender             = (Genders)Enum.Parse(typeof(Genders), found["Gender"].AsString.CamelCaseWord());
            _skinType           = (SkinType)Enum.Parse(typeof(SkinType), found["SkinType"].AsString.CamelCaseWord());
            _skinColor          = (SkinColors)Enum.Parse(typeof(SkinColors), found["SkinColor"].AsString.CamelCaseWord());
            _skinType           = (SkinType)Enum.Parse(typeof(SkinType), found["SkinType"].AsString.CamelCaseWord());
            _hairColor          = (HairColors)Enum.Parse(typeof(HairColors), found["HairColor"].AsString.CamelCaseWord());
            _eyeColor           = (EyeColors)Enum.Parse(typeof(EyeColors), found["EyeColor"].AsString.CamelCaseWord());
            Height              = found["Height"].AsDouble;
            Weight              = found["Weight"].AsDouble;
            _stanceState        = (CharacterStanceState)Enum.Parse(typeof(CharacterStanceState), found["StanceState"].AsString.CamelCaseWord());
            _actionState        = (CharacterActionState)Enum.Parse(typeof(CharacterActionState), found["ActionState"].AsString.CamelCaseWord());
            Description         = found["Description"].AsString;
            Location            = found["Location"].AsString;
            Password            = found["Password"].AsString;
            IsNPC               = found["IsNPC"].AsBoolean;
            Experience          = found["Experience"].AsInt64;
            NextLevelExperience = found["NextLevelExperience"].AsInt64;
            Level               = found["Level"].AsInt32;
            Leveled             = found["Leveled"].AsBoolean;
            PointsToSpend       = found["PointsToSpend"].AsInt32;
            MainHand            = found["MainHand"].AsString != "" ? found["MainHand"].AsString : null;
            Title               = found.Contains("Title") ? found["Title"].AsString : "";
            KillerID            = found.Contains("KillerID") ? found["KillerID"].AsString : "";

            BsonArray playerAttributes = found["Attributes"].AsBsonArray;
            BsonArray inventoryList    = found["Inventory"].AsBsonArray;
            BsonArray equipmentList    = found["Equipment"].AsBsonArray;
            BsonArray bonusesList      = found["Bonuses"].AsBsonArray;

            if (playerAttributes != null)
            {
                foreach (BsonDocument attrib in playerAttributes)
                {
                    if (!this.Attributes.ContainsKey(attrib["Name"].ToString()))
                    {
                        Attribute tempAttrib = new Attribute();
                        tempAttrib.Name      = attrib["Name"].ToString();
                        tempAttrib.Value     = attrib["Value"].AsDouble;
                        tempAttrib.Max       = attrib["Max"].AsDouble;
                        tempAttrib.RegenRate = attrib["RegenRate"].AsDouble;
                        tempAttrib.Rank      = attrib["Rank"].AsInt32;

                        this.Attributes.Add(tempAttrib.Name, tempAttrib);
                    }
                    else
                    {
                        this.Attributes[attrib["Name"].ToString()].Max       = attrib["Max"].AsDouble;
                        this.Attributes[attrib["Name"].ToString()].Value     = attrib["Value"].AsDouble;
                        this.Attributes[attrib["Name"].ToString()].RegenRate = attrib["RegenRate"].AsDouble;
                        this.Attributes[attrib["Name"].ToString()].Rank      = attrib["Rank"].AsInt32;
                    }
                }
            }

            if (inventoryList.Count > 0)
            {
                foreach (BsonDocument item in inventoryList)
                {
                    Items.Iitem fullItem = Items.Items.GetByID(item["_id"].AsObjectId.ToString());
                    if (!Inventory.inventory.Contains(fullItem))
                    {
                        Inventory.AddItemToInventory(fullItem);
                    }
                }
            }

            if (equipmentList.Count > 0)
            {
                foreach (BsonDocument item in equipmentList)
                {
                    Items.Iitem fullItem = Items.Items.GetByID(item["_id"].AsObjectId.ToString());
                    if (!Equipment.equipped.ContainsKey(fullItem.WornOn))
                    {
                        Equipment.EquipItem(fullItem, this.Inventory);
                    }
                }
            }

            if (bonusesList.Count > 0)
            {
                Bonuses.LoadFromBson(bonusesList);
            }
        }
Ejemplo n.º 15
0
		public async void Load(ObjectId id) {
			var characterCollection = MongoUtils.MongoData.GetCollection<NPC>("Characters", "NPCCharacters");
			var found = await MongoUtils.MongoData.RetrieveObjectAsync<NPC>(characterCollection, n => n.Id == id);
            
			Id = found.Id;
			FirstName = found.FirstName.CamelCaseWord();
			LastName = found.LastName.CamelCaseWord();
            _class = found.Class;
            _race = found.Race;
            _gender = found.Gender;
            _skinType = found.SkinType;
            _skinColor = found.SkinColor;
            _hairColor = found.HairColor;
            _eyeColor = found.EyeColor;
			_stanceState = found.StanceState;
			_actionState = found.ActionState;
			Description = found.Description;
			Location = found.Location;
			Height = found.Height;
			Weight = found.Weight;
			IsNPC = found.IsNPC;
			MobTypeID = found.MobTypeID;
			NextAiAction = found.NextAiAction.ToUniversalTime();
			InCombat = found.InCombat;
			LastCombatTime = found.LastCombatTime.ToUniversalTime();
			CurrentTarget = found.CurrentTarget;
			LastTarget = found.LastTarget;
			Fsm.state = Fsm.GetStateFromName(found.AiState);
			Fsm.previousState = Fsm.GetStateFromName(found.PreviousAiState);
			Fsm.globalState = Fsm.GetStateFromName(found.AiGlobalState);
			Experience = found.Experience;
            Level = found.Level;
            Title = found.Title;
			KillerID = found.KillerID;

			Attributes = found.Attributes;
			XpTracker = found.XpTracker;
			Triggers = found.Triggers;
			Quests = found.Quests;
			Bonuses = found.Bonuses;
			StatBonus.Bonuses = Bonuses;
			
			//if (playerAttributes != null) {
			//	foreach (BsonDocument attrib in playerAttributes) {

			//		if (!this.Attributes.ContainsKey(attrib["Name"].ToString())) {
			//			Attribute tempAttrib = new Attribute();
			//			tempAttrib.Name = attrib["Name"].ToString();
			//			tempAttrib.Value = attrib["Value"].AsDouble;
			//			tempAttrib.Max = attrib["Max"].AsDouble;
			//			tempAttrib.RegenRate = attrib["RegenRate"].AsDouble;


			//			this.Attributes.Add(tempAttrib.Name, tempAttrib);
			//		}
			//		else {
			//			this.Attributes[attrib["Name"].ToString()].Max = attrib["Max"].AsDouble;
			//			this.Attributes[attrib["Name"].ToString()].Value = attrib["Value"].AsDouble;
			//			this.Attributes[attrib["Name"].ToString()].RegenRate = attrib["RegenRate"].AsDouble;
			//		}
			//	}
			//}

			//if (xpTracker != null && xpTracker.Count > 0) {
			//	foreach (BsonDocument track in xpTracker) {
			//		//we just newed this up so it should always have to be refilled
			//		damageTracker.Add(track["ID"].AsString, track["Value"].AsDouble);
			//	}
			//}

			//foreach (BsonDocument triggerdoc in triggers) {
			//	ITrigger trigger = new GeneralTrigger(triggerdoc, TriggerType.NPC);
			//	Triggers.Add(trigger);
			//}

			//if (questIds != null) {
			//	foreach (BsonDocument questDoc in questIds) {
			//		Dictionary<string, int> playerSteps = new Dictionary<string, int>();

			//		if (questDoc.Contains("PlayerIDs")) {
			//			foreach (var playerStep in questDoc["PlayerIDs"].AsBsonArray) {
			//				playerSteps.Add(playerStep["PlayerID"].AsString, playerStep["Step"].AsInt32);
			//			}
			//		}

			//		var quest = new Quests.Quest(questDoc["QuestID"].AsString, playerSteps);

			//		if (questDoc.Contains("AutoPlayers")) {
			//			foreach (var autoID in questDoc["AutoPlayers"].AsBsonArray) {
			//				quest.AutoProcessPlayer.Enqueue(autoID.AsString);
			//			}
			//		}
					
			//		Quests.Add(quest);
			//	}
			//}

			//if (bonusesList != null && bonusesList.Count > 0) {
			//	Bonuses.LoadFromBson(bonusesList);
			//}

			Inventory.playerID = Id;
			Equipment.playerID = Id;
		}
Ejemplo n.º 16
0
Archivo: NPC.cs Proyecto: vadian/Novus
        public NPC(CharacterRace race, CharacterClass characterClass, Genders gender, Languages language, SkinColors skinColor, SkinType skinType, HairColors hairColor, EyeColors eyeColor, BodyBuild build)
        {
            Messages = new Queue <string>();

            Fsm       = AI.FSM.GetInstance();
            Fsm.state = Fsm.GetStateFromName("Wander");

            _class     = characterClass;
            _race      = race;
            _gender    = gender;
            _skinColor = skinColor;
            _skinType  = skinType;
            _hairColor = hairColor;
            _eyeColor  = eyeColor;
            _build     = build;

            _koCount     = new Tuple <int, DateTime>(0, DateTime.Now);
            _actionState = CharacterActionState.None;
            _stanceState = CharacterStanceState.Standing;

            _primaryLanguage = language;
            KnownLanguages   = new HashSet <Languages>();
            KnownLanguages.Add(_primaryLanguage);

            Inventory     = new Inventory();
            damageTracker = new Dictionary <string, double>();
            Triggers      = new List <ITrigger>();
            Bonuses       = new StatBonuses();

            FirstName           = "";
            LastName            = "";
            Description         = "";
            Age                 = 17;     //Do we want an age? And are we going to advance it every in game year?  Players could be 400+ years old rather quick.
            Weight              = 180.0d; //pounds or kilos?
            Height              = 70.0d;  //inches or centimeters?
            Location            = "A0";
            InCombat            = false;
            LastCombatTime      = DateTime.MinValue.ToUniversalTime();
            IsNPC               = true;
            Leveled             = false;
            MainHand            = "WIELD_RIGHT";
            NextLevelExperience = 300;
            Level               = 1;
            Experience          = 0;
            PointsToSpend       = 0;
            IsMob               = false;

            Inventory = new Inventory();
            Equipment = new Equipment();

            Inventory.playerID = this.ID;
            Equipment.playerID = this.ID;

            Attributes = new Dictionary <string, Attribute>();

            Attributes.Add("Hitpoints", new Attribute(200.0d, "Hitpoints", 200.0d, 0.2d, 1));
            Attributes.Add("Dexterity", new Attribute(10.0d, "Dexterity", 10.0d, 0.0d, 1));
            Attributes.Add("Strength", new Attribute(10.0d, "Strength", 10.0d, 0.0d, 1));
            Attributes.Add("Intelligence", new Attribute(10.0d, "Intelligence", 10.0d, 0.0d, 1));
            Attributes.Add("Endurance", new Attribute(10.0d, "Endurance", 10.0d, 0.0d, 1));
            Attributes.Add("Charisma", new Attribute(10.0d, "Charisma", 10.0d, 0.0d, 1));

            SubAttributes = new Dictionary <string, double>();

            SubAttributes.Add("Agility", 10.0d);
            SubAttributes.Add("Toughness", 10.0d);
            SubAttributes.Add("Cunning", 10.0d);
            SubAttributes.Add("Wisdom", 10.0d);
            SubAttributes.Add("Leadership", 10.0d);
        }
Ejemplo n.º 17
0
Archivo: NPC.cs Proyecto: vadian/Novus
        public void Load(string id)
        {
            MongoUtils.MongoData.ConnectToDatabase();
            MongoDatabase characterDB = MongoUtils.MongoData.GetDatabase("Characters");
            MongoCollection characterCollection = characterDB.GetCollection<BsonDocument>("NPCCharacters");
            IMongoQuery query = Query.EQ("_id", ObjectId.Parse(id));
            BsonDocument found = characterCollection.FindOneAs<BsonDocument>(query);

            ID = found["_id"].AsObjectId.ToString();
            FirstName = found["FirstName"].AsString.CamelCaseWord();
            LastName = found["LastName"].AsString.CamelCaseWord();
            _class = (CharacterClass)Enum.Parse(typeof(CharacterClass), found["Class"].AsString.CamelCaseWord());
            _race = (CharacterRace)Enum.Parse(typeof(CharacterRace), found["Race"].AsString.CamelCaseWord());
            _gender = (Genders)Enum.Parse(typeof(Genders), found["Gender"].AsString.CamelCaseWord());
            _skinType = (SkinType)Enum.Parse(typeof(SkinType), found["SkinType"].AsString.CamelCaseWord());
            _skinColor = (SkinColors)Enum.Parse(typeof(SkinColors), found["SkinColor"].AsString.CamelCaseWord());
            _skinType = (SkinType)Enum.Parse(typeof(SkinType), found["SkinType"].AsString.CamelCaseWord());
            _hairColor = (HairColors)Enum.Parse(typeof(HairColors), found["HairColor"].AsString.CamelCaseWord());
            _eyeColor = (EyeColors)Enum.Parse(typeof(EyeColors), found["EyeColor"].AsString.CamelCaseWord());
            _stanceState = (CharacterStanceState)Enum.Parse(typeof(CharacterStanceState), found["StanceState"].AsString.CamelCaseWord());
            _actionState = (CharacterActionState)Enum.Parse(typeof(CharacterActionState), found["ActionState"].AsString.CamelCaseWord());
            Description = found["Description"].AsString;
            Location = found["Location"].AsString;
            Height = found["Height"].AsDouble;
            Weight = found["Weight"].AsDouble;
            IsNPC = found["IsNPC"].AsBoolean;
            MobTypeID = found["MobTypeID"].AsInt32;
            NextAiAction = found["NextAiAction"].ToUniversalTime();
            InCombat = found["InCombat"].AsBoolean;
            LastCombatTime = found["LastCombatTime"].ToUniversalTime();
            CurrentTarget = found["CurrentTarget"].AsString != "" ? found["CurrentTarget"].AsString : null;
            LastTarget = found["LastTarget"].AsString != "" ? found["LastTarget"].AsString : null;
            Fsm.state = Fsm.GetStateFromName(found["AiState"].AsString);
            Fsm.previousState = Fsm.GetStateFromName(found["previousAiState"].AsString);
            Fsm.globalState = Fsm.GetStateFromName(found["AiGlobalState"].AsString);
            Experience = found["Experience"].AsInt64;
            Level = found["Level"].AsInt32;
            Title = found.Contains("Title") ? found["Title"].AsString : "";
            KillerID = found.Contains("KillerID") ? found["KillerID"].AsString : "";

            //if you just use var instead of casting it like this you will be in a world of pain and suffering when dealing with subdocuments.
            BsonArray playerAttributes = found["Attributes"].AsBsonArray;
            BsonArray xpTracker = found["XpTracker"].AsBsonArray;
            BsonDocument triggers = found["Triggers"].AsBsonDocument;
            BsonArray bonusesList = null;
            if (found.Contains("Bonuses")) {
                bonusesList = found["Bonuses"].AsBsonArray;
            }

            if (playerAttributes != null) {
                foreach (BsonDocument attrib in playerAttributes) {

                    if (!this.Attributes.ContainsKey(attrib["Name"].ToString())) {
                        Attribute tempAttrib = new Attribute();
                        tempAttrib.Name = attrib["Name"].ToString();
                        tempAttrib.Value = attrib["Value"].AsDouble;
                        tempAttrib.Max = attrib["Max"].AsDouble;
                        tempAttrib.RegenRate = attrib["RegenRate"].AsDouble;

                        this.Attributes.Add(tempAttrib.Name, tempAttrib);
                    }
                    else {
                        this.Attributes[attrib["Name"].ToString()].Max = attrib["Max"].AsDouble;
                        this.Attributes[attrib["Name"].ToString()].Value = attrib["Value"].AsDouble;
                        this.Attributes[attrib["Name"].ToString()].RegenRate = attrib["RegenRate"].AsDouble;
                    }
                }
            }

            if (xpTracker != null && xpTracker.Count > 0) {
                foreach (BsonDocument track in xpTracker) {
                    //we just newed this up so it should always have to be refilled
                    damageTracker.Add(track["ID"].AsString, track["Value"].AsDouble);
                }
            }

            ITrigger trigger = new GeneralTrigger(triggers, "NPC");
            Triggers.Add(trigger);

            if (bonusesList != null && bonusesList.Count > 0) {
                Bonuses.LoadFromBson(bonusesList);
            }
        }
Ejemplo n.º 18
0
Archivo: NPC.cs Proyecto: vadian/Novus
        public NPC(CharacterRace race, CharacterClass characterClass, Genders gender, Languages language, SkinColors skinColor, SkinType skinType, HairColors hairColor, EyeColors eyeColor, BodyBuild build)
        {
            Messages = new Queue<string>();

            Fsm = AI.FSM.GetInstance();
            Fsm.state = Fsm.GetStateFromName("Wander");

            _class = characterClass;
            _race = race;
            _gender = gender;
            _skinColor = skinColor;
            _skinType = skinType;
            _hairColor = hairColor;
            _eyeColor = eyeColor;
            _build = build;

            _koCount = new Tuple<int, DateTime>(0, DateTime.Now);
            _actionState = CharacterActionState.None;
            _stanceState = CharacterStanceState.Standing;

            _primaryLanguage = language;
            KnownLanguages = new HashSet<Languages>();
            KnownLanguages.Add(_primaryLanguage);

            Inventory = new Inventory();
            damageTracker = new Dictionary<string, double>();
            Triggers = new List<ITrigger>();
            Bonuses = new StatBonuses();

            FirstName = "";
            LastName = "";
            Description = "";
            Age = 17;   //Do we want an age? And are we going to advance it every in game year?  Players could be 400+ years old rather quick.
            Weight = 180.0d; //pounds or kilos?
            Height = 70.0d;  //inches or centimeters?
            Location = "A0";
            InCombat = false;
            LastCombatTime = DateTime.MinValue.ToUniversalTime();
            IsNPC = true;
            Leveled = false;
            MainHand = "WIELD_RIGHT";
            NextLevelExperience = 300;
            Level = 1;
            Experience = 0;
            PointsToSpend = 0;
            IsMob = false;

            Inventory = new Inventory();
            Equipment = new Equipment();

            Inventory.playerID = this.ID;
            Equipment.playerID = this.ID;

            Attributes = new Dictionary<string, Attribute>();

            Attributes.Add("Hitpoints", new Attribute(200.0d, "Hitpoints", 200.0d, 0.2d, 1));
            Attributes.Add("Dexterity", new Attribute(10.0d, "Dexterity", 10.0d, 0.0d, 1));
            Attributes.Add("Strength", new Attribute(10.0d, "Strength", 10.0d, 0.0d, 1));
            Attributes.Add("Intelligence", new Attribute(10.0d, "Intelligence", 10.0d, 0.0d, 1));
            Attributes.Add("Endurance", new Attribute(10.0d, "Endurance", 10.0d, 0.0d, 1));
            Attributes.Add("Charisma", new Attribute(10.0d, "Charisma", 10.0d, 0.0d, 1));

            SubAttributes = new Dictionary<string, double>();

            SubAttributes.Add("Agility", 10.0d);
            SubAttributes.Add("Toughness", 10.0d);
            SubAttributes.Add("Cunning", 10.0d);
            SubAttributes.Add("Wisdom", 10.0d);
            SubAttributes.Add("Leadership", 10.0d);
        }