Beispiel #1
0
 public LoadoutValidator(Skill skill, Attribute attribute, Rank rank, List <CharacterMerit> characterMerits, int extraMeritPoints, Loadout loadout)
 {
     _skill            = skill;
     _attribute        = attribute;
     _rank             = rank;
     _merits           = characterMerits;
     _extraMeritPoints = extraMeritPoints;
     _loadout          = loadout;
 }
 public MeritsValidator(Skill skill, Attribute attribute, Rank rank, string species, List <CharacterMerit> merits, int extraPoints)
 {
     _skill       = skill;
     _attribute   = attribute;
     _rank        = rank;
     _species     = species;
     _merits      = merits;
     _extraPoints = extraPoints;
 }
Beispiel #3
0
 public static void Update(this Attribute originalAttribute, Attribute newAttribute)
 {
     originalAttribute.Intelligence = newAttribute.Intelligence;
     originalAttribute.Willpower    = newAttribute.Willpower;
     originalAttribute.Dexterity    = newAttribute.Dexterity;
     originalAttribute.Charisma     = newAttribute.Charisma;
     originalAttribute.Wits         = newAttribute.Wits;
     originalAttribute.Strength     = newAttribute.Strength;
     originalAttribute.Stamina      = newAttribute.Stamina;
 }
 public SkillsAndAttributesValidator(Skill skill, Attribute attribute, Rank rank)
 {
     _skill     = skill;
     _attribute = attribute;
     _rank      = rank;
 }
Beispiel #5
0
 public bool UpdateAttribute(Attribute attribute)
 {
     _dbcontext.Attributes.Update(attribute);
     _dbcontext.SaveChanges();
     return(true);
 }
        public static int GetLoadoutStartingXp(Rank rank, Attribute attribute, List <CharacterMerit> characterMerits, int extraMeritPoints, bool isMainLoadout)
        {
            var startingXp = 0;

            switch (rank)
            {
            case Rank.Undefined:
                startingXp = 0;
                break;

            case Rank.Newblood:
                startingXp = 15;
                break;

            case Rank.Recruit:
                startingXp = 22;
                break;

            case Rank.Scarred:
                startingXp = 29;
                break;

            case Rank.Veteran:
                startingXp = 38;
                break;

            case Rank.Lieutenant:
                startingXp = 49;
                break;

            case Rank.Captain:
                startingXp = 54;
                break;

            case Rank.General:
                startingXp = 59;
                break;

            case Rank.Commander:
                startingXp = 64;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            startingXp += (attribute.Charisma - 1);

            // One Last Surprise
            if (characterMerits.Any(m => m.MeritKey == MeritKey.ItemOneLastSurprise4))
            {
                startingXp += 4;
            }
            else if (characterMerits.Any(m => m.MeritKey == MeritKey.ItemOneLastSurprise3))
            {
                startingXp += 3;
            }
            else if (characterMerits.Any(m => m.MeritKey == MeritKey.ItemOneLastSurprise2))
            {
                startingXp += 2;
            }
            else if (characterMerits.Any(m => m.MeritKey == MeritKey.ItemOneLastSurprise1))
            {
                startingXp += 1;
            }

            startingXp -= extraMeritPoints;

            if (!isMainLoadout)
            {
                // Ensure that XP is always rounded up to the nearest point instead of down
                startingXp = startingXp % 2 == 1 ? (startingXp / 2) + 1 : startingXp / 2;
            }

            return(startingXp);
        }