Esempio n. 1
0
        private void SetAbilities(AceCreatureObject aco)
        {
            Strength     = new CreatureAbility(Enum.Ability.Strength);
            Endurance    = new CreatureAbility(Enum.Ability.Endurance);
            Coordination = new CreatureAbility(Enum.Ability.Coordination);
            Quickness    = new CreatureAbility(Enum.Ability.Quickness);
            Focus        = new CreatureAbility(Enum.Ability.Focus);
            Self         = new CreatureAbility(Enum.Ability.Self);

            // TODO: Real regen rates?
            Health  = new CreatureVital(aco, Enum.Ability.Health, .5);
            Stamina = new CreatureVital(aco, Enum.Ability.Stamina, 1.0);
            Mana    = new CreatureVital(aco, Enum.Ability.Mana, .7);

            Strength.Base     = aco.Strength;
            Endurance.Base    = aco.Endurance;
            Coordination.Base = aco.Coordination;
            Quickness.Base    = aco.Quickness;
            Focus.Base        = aco.Focus;
            Self.Base         = aco.Self;

            // recalculate the base value as the abilities end/will have an influence on those
            Health.Base  = aco.Health - Health.UnbuffedValue;
            Stamina.Base = aco.Stamina - Stamina.UnbuffedValue;
            Mana.Base    = aco.Mana - Mana.UnbuffedValue;

            Health.Current  = Health.MaxValue;
            Stamina.Current = Stamina.MaxValue;
            Mana.Current    = Mana.MaxValue;

            abilities.Add(Enum.Ability.Strength, Strength);
            abilities.Add(Enum.Ability.Endurance, Endurance);
            abilities.Add(Enum.Ability.Coordination, Coordination);
            abilities.Add(Enum.Ability.Quickness, Quickness);
            abilities.Add(Enum.Ability.Focus, Focus);
            abilities.Add(Enum.Ability.Self, Self);

            abilities.Add(Enum.Ability.Health, Health);
            abilities.Add(Enum.Ability.Stamina, Stamina);
            abilities.Add(Enum.Ability.Mana, Mana);

            Abilities = new ReadOnlyDictionary <Enum.Ability, CreatureAbility>(abilities);

            IsAlive = true;
        }
Esempio n. 2
0
        private Character()
        {
            StrengthAbility     = new CreatureAbility(Enum.Ability.Strength);
            EnduranceAbility    = new CreatureAbility(Enum.Ability.Endurance);
            CoordinationAbility = new CreatureAbility(Enum.Ability.Coordination);
            QuicknessAbility    = new CreatureAbility(Enum.Ability.Quickness);
            FocusAbility        = new CreatureAbility(Enum.Ability.Focus);
            SelfAbility         = new CreatureAbility(Enum.Ability.Self);

            // TODO: Real regen rates?
            Health  = new CreatureVital(this, Enum.Ability.Health, .5);
            Stamina = new CreatureVital(this, Enum.Ability.Stamina, 1.0);
            Mana    = new CreatureVital(this, Enum.Ability.Mana, .7);

            abilities.Add(Enum.Ability.Strength, StrengthAbility);
            abilities.Add(Enum.Ability.Endurance, EnduranceAbility);
            abilities.Add(Enum.Ability.Coordination, CoordinationAbility);
            abilities.Add(Enum.Ability.Quickness, QuicknessAbility);
            abilities.Add(Enum.Ability.Focus, FocusAbility);
            abilities.Add(Enum.Ability.Self, SelfAbility);

            abilities.Add(Enum.Ability.Health, Health);
            abilities.Add(Enum.Ability.Stamina, Stamina);
            abilities.Add(Enum.Ability.Mana, Mana);

            Abilities = new ReadOnlyDictionary <Enum.Ability, CreatureAbility>(abilities);

            // initialize properties collections to reasonable defaults
            InitializeProperties(typeof(Character));

            friends = new List <Friend>();
            Friends = new ReadOnlyCollection <Friend>(friends);

            InitializeCharacterOptions();
            CharacterOptions = new ReadOnlyDictionary <CharacterOption, bool>(characterOptions);

            // initialize the blank character positions
            InitializeCharacterPositions();
            Positions = new ReadOnlyDictionary <PositionType, Position>(positions);
        }