Ejemplo n.º 1
0
        private void Boost(AbilityScoreSelection boost, string name, int value)
        {
            switch (boost)
            {
            case AbilityScoreSelection.Str:
                Str.Add(name, value);
                break;

            case AbilityScoreSelection.Dex:
                Dex.Add(name, value);
                break;

            case AbilityScoreSelection.Con:
                Con.Add(name, value);
                break;

            case AbilityScoreSelection.Wis:
                Wis.Add(name, value);
                break;

            case AbilityScoreSelection.Int:
                Int.Add(name, value);
                break;

            case AbilityScoreSelection.Cha:
                Cha.Add(name, value);
                break;
            }
        }
Ejemplo n.º 2
0
        //Adds stats of the new Entity to the Lists
        public void AddEntity(int[] stats, string[] traits)
        {
            ID.Add(next_ID);
            Alive.Add(next_ID);


            Str.Add(stats[0]);
            Agi.Add(stats[1]);
            Int.Add(stats[2]);

            //Behaviour.Add(traits);
            Behaviour.Add(traits);

            ////selects the corresponding Behaviour
            switch (traits[1])
            {
            case "Friendly": Friendlies.Add(next_ID); break;

            case "Hostile": Hostiles.Add(next_ID); break;

            case "Neutral": Neutrals.Add(next_ID); break;

            default: Console.WriteLine("Error, assuming Neutral"); Neutrals.Add(next_ID); break;
            }

            switch (traits[2])
            {
            case "Melee": AttackDamage.Add(stats[0] + stats[1]); break;

            case "Ranged": AttackDamage.Add(stats[1] + stats[2]); break;
            }

            next_ID++;
        }
Ejemplo n.º 3
0
        public void Inputs()
        {
            bool Inputcorrect = true;

            while (Inputcorrect)
            {
                Console.WriteLine("Syötä kokonais- tai desimaaliluku. Jos syöttö on jotain muuta, ohjelma suljetaan");
                if (double.TryParse(Console.ReadLine(), out double input))
                {
                    if ((input % 1) == 0)
                    {
                        Int.Add(Convert.ToInt32(input));
                    }
                    else
                    {
                        Double.Add(input);
                    }
                }
                else
                {
                    Inputcorrect = false;
                }
            }
        }