Example #1
0
 /// <summary>
 /// This constructor takes a statsType and mod(double) and makes it into a stat
 /// </summary>
 /// <param name="st">Stat to be modded</param>
 /// <param name="timeout">How many rounds before the effect is removed -1 is perminent, 1 is one round and is 0 done</param>
 /// <param name="perturn">Flag if the mod is added per turn or once</param>
 /// <param name="reset">Does the stat reset after the effect is over</param>
 /// <param name="name">Optional name of the parent</param>
 public effect(stat st, int timeout, bool perturn, bool reset, String name = " ", bodypart.ClassPartTypes effectedpart = bodypart.ClassPartTypes.NULL)
 {
     Timeout = timeout;
     PerminentTimeout = timeout;
     effectedStat = st;
     Perturn = perturn;
     ParentName = name;
     ResetStat = reset;
     TotalMod = 0;
     EffectPart = effectedpart;
 }
Example #2
0
        /// <summary>
        /// Constructor
        /// </summary>
        public creature(bodypart h, bodypart b, bodypart l, bodypart a1, string name = " ")
        {
            myStats = new Stats();
            Mastery = new mastery();
            effects = new List<effect>();
            Abilities = new List<ability>();
            AllAbilities = new Dictionary<ability, bool>();

            //TODO Update the generic body parts as it is changed!!!
            BodyParts = new Dictionary<slots, bodypart>();
            AddBodyPart(h,slots.Head);
            AddBodyPart(b,slots.Body);
            AddBodyPart(l,slots.Legs);
            AddBodyPart(a1, slots.Accessory1);
            Accessory2Locked = true;
            Name = name;
        }
Example #3
0
        static void Test1()
        {
            creature testCreature1 = new creature("Proteus");
            testCreature1.PrintStats();
            mastery tempM = new mastery();
            tempM.SetClassMastery(bodypart.ClassTypes.ColdBlooded, 10, 10, 10, 10);
            tempM.SetClassMastery(bodypart.ClassTypes.Invertebrate, 10, 10, 10, 10);
            tempM.SetClassMastery(bodypart.ClassTypes.WarmBlooded, 10, 10, 10, 10);

            testCreature1.Mastery = tempM;

            bodypart head1 = new bodypart(bodypart.ClassTypes.Invertebrate, bodypart.PartTypes.Head, "test head1", 5, 3, 1, 2, 6);
            head1.AddAbility(new ability("bite!", new List<effect>() { new effect(Stats.statsType.CURRENT_HEALTH, -10, 1, true, false) }, false, false, new mastery(), new Stats(10, 10, 10, 10, 10)));
            bodypart Body1 = new bodypart(bodypart.ClassTypes.ColdBlooded, bodypart.PartTypes.Body, "Body 1", 2, 4, 5, 7, 8);
            bodypart Legs1 = new bodypart(bodypart.ClassTypes.ColdBlooded, bodypart.PartTypes.Legs, "Legs 1", 1, 3, 5, 3, 9);
            bodypart Accessory1 = new bodypart(bodypart.ClassTypes.ColdBlooded, bodypart.PartTypes.Accessory, "Accessory 1", 4, 1, 2, 1, 7);

            testCreature1.AddBodyPart(head1, creature.slots.Head);
            testCreature1.AddBodyPart(Body1, creature.slots.Body);
            testCreature1.AddBodyPart(Legs1, creature.slots.Legs);
            testCreature1.AddBodyPart(Accessory1, creature.slots.Accessory1);

            testCreature1.PrintBodyParts();
            testCreature1.PrintStats();
            testCreature1.PrintEffects();

            bodypart Accessory2 = new bodypart(bodypart.ClassTypes.ColdBlooded, bodypart.PartTypes.Accessory, "Body 1", 4, 1, 2, 1, 0);

            testCreature1.AddBodyPart(Accessory2, creature.slots.Accessory1);
            testCreature1.PrintStats();
            testCreature1.PrintAbilities();
        }
Example #4
0
        static void BeginingCombatSim()
        {
            bodypart head1 = new bodypart(bodypart.ClassTypes.Invertebrate, bodypart.PartTypes.Head, "test head1", 400, 3, 100, 2, 6);
            head1.AddAbility(new ability("bite!", new List<effect>() { new effect(Stats.statsType.DAMAGE, 10, 2, true, false) }, false, false, new mastery(), new Stats(10, 10, 10, 10, 10)));
            bodypart Body1 = new bodypart(bodypart.ClassTypes.ColdBlooded, bodypart.PartTypes.Body, "Body 1", 2, 4, 5, 7, 8);
            bodypart Legs1 = new bodypart(bodypart.ClassTypes.ColdBlooded, bodypart.PartTypes.Legs, "Legs 1", 1, 3, 5, 3, 9);
            bodypart Accessory1 = new bodypart(bodypart.ClassTypes.ColdBlooded, bodypart.PartTypes.Accessory, "Accessory 1", 4, 1, 2, 1, 7);

            bodypart head2 = new bodypart(bodypart.ClassTypes.Invertebrate, bodypart.PartTypes.Head, "test head1", 5, 3, 1, 2, 6);
            head2.AddAbility(new ability("bite!", new List<effect>() { new effect(Stats.statsType.DAMAGE, 10, 3, true, false) }, false, false, new mastery(), new Stats(10, 10, 10, 10, 10)));
            bodypart Body2 = new bodypart(bodypart.ClassTypes.ColdBlooded, bodypart.PartTypes.Body, "Body 1", 2, 4, 5, 7, 8);
            bodypart Legs2 = new bodypart(bodypart.ClassTypes.ColdBlooded, bodypart.PartTypes.Legs, "Legs 1", 1, 3, 5, 3, 9);
            bodypart Accessory2 = new bodypart(bodypart.ClassTypes.ColdBlooded, bodypart.PartTypes.Accessory, "Accessory 1", 4, 1, 2, 1, 7);

            creature Proteus = new creature(head1, Body1, Legs1, Accessory1, "Proteus");
            creature Enemy1 = new creature(head2, Body2, Legs2, Accessory2, "Enemy");

            Proteus.combatPrint();
            Enemy1.combatPrint();

            for (int i = 0; i < 10; i++)
            {
                Proteus.effectStep();
                Enemy1.effectStep();
                Proteus.useAbilityOn(Enemy1, "bite!");
                Enemy1.combatPrint();
            }
        }
Example #5
0
 /// <summary>
 /// This constructor takes a statsType and mod(double) and makes it into a stat
 /// </summary>
 /// <param name="type">Type for the stat to be modded</param>
 /// <param name="mod">The mod for a stat</param>
 /// <param name="timeout">How many rounds before the effect is removed -1 is perminent, 1 is one round and is 0 done</param>
 /// <param name="perturn">Flag if the mod is added per turn or once</param>
 /// <param name="reset">Does the stat reset after the effect is over</param>
 /// <param name="name">Optional name of the parent</param>
 public effect(Stats.statsType type, double mod, int timeout, bool perturn, bool reset, String name = " ", bodypart.ClassPartTypes effectpart = bodypart.ClassPartTypes.NULL)
     : this(new stat(mod, type), timeout, perturn, reset, name)
 {
 }
Example #6
0
 public creature(bodypart h, bodypart b, bodypart l, bodypart a1, bodypart a2, string name= " ")
     : this(h, b, l, a1, name)
 {
     this.Accessory2Locked = false;
     AddBodyPart(a2, slots.Accessory2);
 }
Example #7
0
        public String AddBodyPart(bodypart b, slots slot)
        {
            if (slot == slots.Accessory2 && Accessory2Locked)//Accessory slot 2 is intitially locked
                return "Accessory 2 slot is Locked.";

            this.RemoveBodyPart(slot); //Removes the body part and all residule effects
            this.BodyParts[slot] = b; //put the part in it's new place

            this.UpdateAbilities();

            return b.Name + "has been added.";
        }