Exemple #1
0
        private Character AddCharacterToField(int x, int y, string name, CardinalDirection facing, string faction)
        {
            Character character = new Character();

            character.Level             = 1;
            character.Name              = name;
            character.InitiativeGain    = Game.Randomizer.Next(20, 81);
            character.ActionPointsStart = 1;
            character.Facing            = facing;
            character.Faction           = faction;

            character.AddProperty <Live>();
            CharacterProperty live = character.GetProperty <Live>();

            live.BaseMaxValue    = 9;
            live.LevelMultiplier = 1;
            live.CurrentValue    = live.GetMaxValueAtLevel(character.Level);

            Game.Field.Cells[x, y].Character = character;
            Game.Field.Characters.Add(character);

            return(character);
        }
Exemple #2
0
        public float GetPropertyMax <T>() where T : CharacterProperty
        {
            CharacterProperty property = Properties.OfType <T>().SingleOrDefault();

            return(property?.GetMaxValueAtLevel(Level) ?? 0);
        }
Exemple #3
0
        public void SetPropertyValue <T>(int newValue) where T : CharacterProperty
        {
            CharacterProperty property = Properties.OfType <T>().SingleOrDefault();

            property.CurrentValue = newValue;
        }
Exemple #4
0
        public float GetPropertyValue <T>() where T : CharacterProperty
        {
            CharacterProperty property = Properties.OfType <T>().SingleOrDefault();

            return(property?.CurrentValue ?? 0);
        }