Example #1
0
        private static void PrintCaughtCreatureAbilities(caughtcreature caughtCreature)
        {
            Console.WriteLine("     Moves:");

            List <ability> cAbilities = new List <ability>();

            caughtCreature.caughtcreature_ability.ToList().ForEach(x => cAbilities.Add(x.ability));

            for (int i = 0; i < 4; i++)
            {
                if (i < cAbilities.Count)
                {
                    string physical = cAbilities[i].IsPhysical ? "Physical" : "Non-Physical";
                    string effect   = cAbilities[i].EffectName == null ? "NONE" : cAbilities[i].EffectName;

                    Console.WriteLine(
                        "       " + cAbilities[i].AbilityName + "" +
                        "     DMG:" + cAbilities[i].Damage + "  ACC:" + cAbilities[i].Accuracy
                        + "  Physical? => " + physical
                        + "   Effect: " + effect);
                }
                else
                {
                    Console.WriteLine("       --------");
                }
            }
        }
Example #2
0
        private static void PrintCaughtCreatureEvolutions(caughtcreature caughtCreature)
        {
            Console.WriteLine("\n    Possible Evolutions: " + caughtCreature.creature.creature_evolution.ToList().Count);

            caughtCreature.creature.creature_evolution.ToList().
            ForEach(e => Console.WriteLine("            \"" + e.EvolutionName + "\" - lvl " + e.EvolutionLevel));
        }
Example #3
0
        private static void PrintCaughtCreatureDescription(caughtcreature caughtCreature)
        {
            string types = "";

            caughtCreature.creature.type.ToList().ForEach(n => types += n.TypeName + ",");

            List <string> ct = new List <string>();

            caughtCreature.creature.type.ToList().ForEach(r => ct.Add(r.TypeName));

            types = types.Remove(types.Length - 1);

            string gender = caughtCreature.Sex ? "Male" : "Female";

            Console.WriteLine(
                "\n  Creature Name: " + caughtCreature.CreatureName + "   => Type: " + types
                +
                "\n\n        Creature Level: " + caughtCreature.XP.XPToLevel()
                + "\n        Creature XP: " + caughtCreature.XP
                + "\n\n        Nick Name: " + caughtCreature.NickName
                + "\n\n        Creature Description: " + caughtCreature.creature.Description
                + "\n        Creature height: " + caughtCreature.creature.Height + " cm"
                + "\n        Creature weight: " + caughtCreature.creature.Weight + " kg"
                + "\n        Creature Gender: " + gender
                + "\n");
        }
Example #4
0
        private static void PrintCaughtCreatureStats(caughtcreature caughtCreature)
        {
            int level = caughtCreature.XP.XPToLevel();
            int maxHP = caughtCreature.creature.Health * level;



            Console.WriteLine("\n\n     Stats:");
            Console.WriteLine("            HP: " + (caughtCreature.CurrentHealth) + "/" + maxHP);
            Console.WriteLine("           STR: " + caughtCreature.creature.Strenght * level);
            Console.WriteLine("           AGI: " + caughtCreature.creature.Agility * level);
            Console.WriteLine("           INT: " + caughtCreature.creature.Intelligence * level);
            Console.WriteLine("\n");
        }
Example #5
0
        public static void assignRandomCreatures(int idGreaterThan)
        {
            List <account> accs = new List <account>();



            using (creaturesEntities db = new creaturesEntities())
            {
                accs = db.account.Where(a => a.AccountID > idGreaterThan).ToList();

                foreach (account acc in accs)
                {
                    List <trainer> trainers = new List <trainer>();

                    trainers = acc.trainer.ToList();

                    foreach (var tra in trainers)
                    {
                        Console.WriteLine("Adding creatures to trainer: " + tra.TrainerName + " ACC ID: " + tra.AccountId);

                        int amountOfCreatures = rnd.Next(1, 7);

                        for (int i = 0; i < amountOfCreatures; i++)
                        {
                            creature rndCreature;

                            rndCreature = db.creature.ToList()[rnd.Next(db.creature.Count())];

                            string nickName = creatureNamess[rnd.Next(creatureNamess.Length)];

                            caughtcreature cc = new caughtcreature()
                            {
                                CreatureName  = rndCreature.CreatureName,
                                TrainerName   = tra.TrainerName,
                                XP            = rnd.Next(1000000),
                                NickName      = rnd.Next(10) > 5 ? nickName : null,
                                Sex           = rnd.Next(2) == 0 ? false : true,
                                CurrentHealth = 0
                            };

                            cc.CurrentHealth = rndCreature.Health * cc.XP.XPToLevel();

                            while (true)
                            {
                                creature_evolution sub = db.creature.Find(cc.CreatureName).creature_evolution1.FirstOrDefault();

                                if (sub != null && cc.XP.XPToLevel() <
                                    db.creature.Find(sub.CreatureName).creature_evolution.FirstOrDefault().EvolutionLevel)
                                {
                                    cc.CreatureName = sub.CreatureName;
                                }
                                else
                                {
                                    break;
                                }
                            }

                            while (true)
                            {
                                if (db.creature.Find(cc.CreatureName).creature_evolution.Count() > 0 && cc.XP.XPToLevel() >
                                    db.creature.Find(cc.CreatureName).creature_evolution.FirstOrDefault().EvolutionLevel)
                                {
                                    cc.CreatureName = db.creature.Find(cc.CreatureName).creature_evolution.FirstOrDefault().EvolutionName;
                                }
                                else
                                {
                                    break;
                                }
                            }
                            tra.caughtcreature.Add(cc);

                            Console.WriteLine("Creature added to trainer: " + tra.TrainerName + " ACC ID: " + tra.AccountId + "  Creature: " + cc.CreatureName);
                        }
                        db.SaveChanges();
                        Console.WriteLine("...");
                    }
                }
            }
        }