Пример #1
0
        /// <summary>
        /// Creates a Bird type depending on type selected
        /// </summary>
        /// <param name="other"></param>
        /// <returns></returns>
        private Bird CreateTypeOfBirdFromBirdType()
        {
            if ((BirdType)animalTypeWithinSpecies == BirdType.Bullfinch)
            {
                Bullfinch bullfinch = new Bullfinch(animalName, animalAge, animalGender, birdInformation.BirdType, birdInformation.WhatToSing);

                return(bullfinch);
            }
            else if ((BirdType)animalTypeWithinSpecies == BirdType.Crow)
            {
                Crow crow = new Crow(animalName, animalAge, animalGender, birdInformation.BirdType, birdInformation.WhatSilverDoCrowsLike);

                return(crow);
            }
            else if ((BirdType)animalTypeWithinSpecies == BirdType.MarchSandpiper)
            {
                MarchSandpiper marchSandpiper = new MarchSandpiper(animalName, animalAge, animalGender, birdInformation.BirdType, birdInformation.WingSpan, birdInformation.Plumage);

                return(marchSandpiper);
            }
            else
            {
                WoodPecker woodpecker = new WoodPecker(animalName, animalAge, animalGender, birdInformation.BirdType, birdInformation.TypeOfBeak);

                return(woodpecker);
            }
        }
Пример #2
0
 private void Awake()
 {
     m_crow           = GetComponent <Crow>();
     m_obstaclesLayer = m_crow.ObstaclesLayer;
     m_poopImage      = FindObjectOfType <PoopImage>();
     m_frontOffset    = GetComponent <BoxCollider>().size.z * 0.8f;
 }
Пример #3
0
    void SpawnCrow()
    {
        DirtTile dirtTile = SelectTile();

        if (dirtTile != null)
        {
            if (dirtTile.hasCrow)
            {
                return;
            }

            Vector3 spawnPoint = new Vector3();
            if (spawnPointIndex == 0)
            {
                spawnPoint = spawnPoint01.position;
                spawnPointIndex++;
            }
            else if (spawnPointIndex == 1)
            {
                spawnPoint = spawnPoint02.position;
                spawnPointIndex++;
            }
            else if (spawnPointIndex == 2)
            {
                spawnPoint      = spawnPoint03.position;
                spawnPointIndex = 0;
            }
            GameObject go   = Instantiate(crowPrefab, spawnPoint, Quaternion.identity);
            Crow       crow = go.GetComponent <Crow>();
            crow.SetTarget(dirtTile);

            dirtTile.hasCrow = true;
        }
    }
Пример #4
0
        public static Bird CreateBird(BirdSpecies Species)
        {
            Bird animalObj = null;//Birdtype unknown at this time.

            //Lets determine users choice of animal.
            switch (Species)
            {
                case BirdSpecies.Crow:
                    animalObj = new Crow();
                    break;
                case BirdSpecies.Eagle:
                    animalObj = new Eagle();
                    break;
                case BirdSpecies.Penguin:
                    animalObj = new Penguin();
                    break;

                default:
                    Debug.Assert(false, "Not implemented");
                    break;
            }

            //Set animal category
            animalObj.Category = CategoryType.Bird;

            return animalObj;//Return created instance of object.
        }
Пример #5
0
        public SocketGuildChannel IsChannel(string input)
        {
            if (Context.Message.MentionedChannels.Count == 1)
            {
                var channel = Context.Message.MentionedChannels.ToList()[0];
                if (Crow.ClientCanSeeChannel(channel, Context.Guild))
                {
                    if (channel.GetType() == typeof(SocketTextChannel))
                    {
                        return(channel);
                    }
                    ReplyAsync($"Error - {channel.Name} is not a text channel.");
                    return(null);
                }

                ReplyAsync($"Error - Cannot send messages in channel {channel.Name}");
                return(null);
            }

            if (input.Length == 18 && IsDigits(input))
            {
                var channel = Context.Guild.GetChannel(ulong.Parse(input));
                if (channel != null)
                {
                    if (Crow.ClientCanSeeChannel(channel, Context.Guild))
                    {
                        return(channel);
                    }
                    ReplyAsync($"Error - Cannot send messages in channel {channel.Name}");
                    return(null);
                }
            }

            return(null);
        }
Пример #6
0
        public static Bird CreateBird(BirdSpecies Species)
        {
            Bird animalObj = null;//Birdtype unknown at this time.


            //Lets determine users choice of animal.
            switch (Species)
            {
            case BirdSpecies.Crow:
                animalObj = new Crow();
                break;

            case BirdSpecies.Eagle:
                animalObj = new Eagle();
                break;

            case BirdSpecies.Penguin:
                animalObj = new Penguin();
                break;

            default:
                Debug.Assert(false, "Not implemented");
                break;
            }

            //Set animal category
            animalObj.Category = CategoryType.Bird;

            return(animalObj);//Return created instance of object.
        }
Пример #7
0
        public void CrowCanProveInheritedFlyBehavior()
        {
            Crow newCrow = new Crow("Poe", 17, "black");

            string expected = "Poe flies with a Murder...";

            Assert.Equal(expected, newCrow.Fly());
        }
Пример #8
0
        public void CrowSpeakReturnsCawTest()
        {
            // Act
            Crow crow = new Crow();

            // Assert
            Assert.Equal("caw", crow.Speak());
        }
Пример #9
0
        public void CrowFeatherReturnsHeavyTest()
        {
            // Act
            Crow crow = new Crow();

            // Assert
            Assert.Equal("heavy", crow.FeatherType);
        }
Пример #10
0
        public void CrowIsAnAnimalTest()
        {
            // Act
            Animal crow = new Crow();

            // Assert
            Assert.Equal(2, crow.Legs);
        }
Пример #11
0
        public void CrowISpeakAlotTest()
        {
            // Act
            ISpeakAlot crow = new Crow();

            //Assert
            Assert.Equal("caw caw caw caw", crow.SpeaksAlot());
        }
Пример #12
0
    private void Awake()
    {
        m_crow           = GetComponent <Crow>();
        m_obstaclesLayer = m_crow.ObstaclesLayer;
        BoxCollider crowCollider = GetComponent <BoxCollider>();

        m_footOffset  = crowCollider.size.y * 0.5f - 0.05f;
        m_frontOffset = crowCollider.size.z * 0.8f;
    }
Пример #13
0
        public void PolymorphismWorks()
        {
            Lizard  testLizard  = new Lizard();
            Owl     testOwl     = new Owl();
            Penguin testPenguin = new Penguin();
            Crow    testCrow    = new Crow();

            Assert.IsAssignableFrom <Animals>(testLizard);
            Assert.Equal("Parliament", testOwl.GroupName());
            Assert.Equal("Murder", testCrow.GroupName());
            Assert.Equal("colony", testPenguin.GroupName());
        }
Пример #14
0
    // Start is called before the first frame update
    void Start()
    {
        for (int i = 0; i < flockSize; i++)
        {
            Vector3 initialPosition = new Vector3(
                Random.value * GetComponent <Collider2D>().bounds.size.x,
                Random.value * GetComponent <Collider2D>().bounds.size.y,
                Random.value - 0.5f);
            Crow boid = Instantiate(prefab, initialPosition, transform.rotation) as Crow;

            boid.maxForce = boid.maxForce * (1 + (Random.value * 0.1f));
            boid.maxSpeed = boid.maxSpeed * (1 + (Random.value * 0.1f));

            boid.transform.parent = transform;

            //boid.controller = this;
        }
    }
Пример #15
0
        public void CanInherit()
        {
            Bat      testBat     = new Bat();
            Crow     testCrow    = new Crow();
            Dolphin  testDolphin = new Dolphin();
            Owl      testOwl     = new Owl();
            Penguin  testPenguin = new Penguin();
            SeaOtter testOtter   = new SeaOtter();
            Snake    testSnake   = new Snake();

            Assert.False(testBat.Extinct);
            Assert.False(testCrow.WarmBlooded);
            Assert.True(testDolphin.LiveBirth);
            Assert.True(testOwl.LaysEggs);
            Assert.False(testPenguin.Dangerous);
            Assert.True(testOtter.HasLegs);
            Assert.True(testSnake.ForkedTongue);
        }
Пример #16
0
        public void InterfacesCanImplement()
        {
            Bat      testBat     = new Bat();
            Crow     testCrow    = new Crow();
            Dolphin  testDolphin = new Dolphin();
            Owl      testOwl     = new Owl();
            Penguin  testPenguin = new Penguin();
            SeaOtter testOtter   = new SeaOtter();
            Snake    testSnake   = new Snake();

            Assert.True(testBat.Fly());
            Assert.True(testCrow.Fly());
            Assert.True(testDolphin.Carnivore());
            Assert.True(testOwl.Fly());
            Assert.True(testPenguin.Carnivore());
            Assert.True(testOtter.Carnivore());
            Assert.True(testSnake.Carnivore());
            Assert.True(testOwl.Carnivore());
        }
Пример #17
0
        public async Task PrefixCommand(string prefix)
        {
            if (prefix.Length != 1)
            {
                await ReplyAsync($"Error - Incorrect parameter `{prefix}`. Only 1 character allowed.");

                return;
            }

            var guild = Crow.Instance.CrowContext.Guilds.Find(Context.Guild.Id.ToString());

            guild.CommandPrefix = prefix;
            Crow.Instance.CrowContext.Guilds.Update(guild);
            Crow.Instance.CrowContext.SaveChanges();
            await Crow.Log(new LogMessage(LogSeverity.Info, "Config",
                                          $"Changed prefix for {Context.Guild.Name} to {prefix}."));

            await ReplyAsync($"Successfully changed prefix to `{prefix}`");
        }
Пример #18
0
    // Use this for initialization
    public List <Crow> GetCrow()
    {
        used.Clear();
        for (int i = 0; i < 2; i++)
        {
            for (int j = 0; j < 3; j++)
            {
                Crow new_crow = new Crow(i, j);
                used.Add(new_crow);
            }
        }
        Crow fast_crow  = new Crow(3, 0);
        Crow fast_crow1 = new Crow(3, 2);
        Crow fast_crow2 = new Crow(3.5f, 1);

        used.Add(fast_crow);
        used.Add(fast_crow1);
        used.Add(fast_crow2);
        return(used);
    }
Пример #19
0
 void Update()
 {
     if (m_counter <= 0f)
     {
         GameObject go;
         if (m_pool.Request(out go))
         {
             float randAngle = Random.Range(0f, 360f);
             go.transform.position = m_camera.transform.position +
                                     new Vector3(Mathf.Sin(randAngle) * m_spawnDistance, 25f,
                                                 Mathf.Cos(randAngle) * m_spawnDistance);
             Crow crow = go.GetComponent <Crow>();
             go.GetComponent <CrowLand>().SetRotationToDestination();
             crow.SetPlayerToStageVector(m_playerToStage);
             crow.Init();
             m_counter = m_spawnInterval;
         }
     }
     else
     {
         m_counter -= Time.deltaTime;
     }
 }
Пример #20
0
        static void Main(string[] args)
        {
            Fish     newFish    = new Fish("Nemo", false, 4);
            Crow     newCrow    = new Crow("Poe", 14, "black");
            Owl      newOwl     = new Owl("Hedwig", 24);
            Leopard  newLeopard = new Leopard("Treecat", 11, true);
            Lion     newLion    = new Lion("Alex", 16);
            Hound    newHound   = new Hound("Sam", 10);
            Labrador newLab     = new Labrador("Bo", 12);

            Console.WriteLine(newFish.Swim());

            Console.WriteLine(newCrow.Fly());

            Console.WriteLine(newOwl.Sleep());

            Console.WriteLine(newLeopard.PetHuman());

            Console.WriteLine(newLion.Purr());

            Console.WriteLine(newHound.Poop());

            Console.WriteLine(newLab.Bark());
        }
Пример #21
0
 void onClearSplatting(object sender, Crow.MouseButtonEventArgs e)
 {
     CurrentState = State.ClearSplatting;
 }
Пример #22
0
 void onClearHM(object sender, Crow.MouseButtonEventArgs e)
 {
     CurrentState = State.ClearHM;
 }
Пример #23
0
 public CrowState_Idle()
 {
     mStateID = CrowStates.Idle;
     mCrow = GameObject.FindObjectOfType( typeof( Crow ) ) as Crow;
 }
Пример #24
0
        private static void SeedDb()
        {
            using var context = new AnimalContext();

            context.SavedChanges += (sender, args) =>
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine(
                    $"Saved {args.EntitiesSavedCount} changes for {((DbContext) sender)?.Database.GetConnectionString()}");
                Console.ForegroundColor = ConsoleColor.White;
            };

            context.Database.EnsureDeleted();
            context.Database.EnsureCreated();

            #region Seed TPT (Animal)

            var beaver1 = new Beaver
            {
                Name       = "SomeBeavers1",
                Age        = 27,
                Fluffiness = FluffinessEnum.VeryFluffy,
                Size       = 15,
                IpAddress  = IPAddress.Parse("127.0.0.1")
            };
            var beaver2 = new Beaver
            {
                Name       = "SomeBeavers2",
                Age        = 26,
                Fluffiness = FluffinessEnum.Fluffy,
                Size       = 14,
                IpAddress  = IPAddress.Parse("127.0.0.1")
            };
            var beaver3 = new Beaver
            {
                Name       = "SomeBeavers3",
                Age        = 25,
                Fluffiness = FluffinessEnum.NotFluffy,
                Size       = 13,
                IpAddress  = IPAddress.Parse("127.0.0.1")
            };
            var beaver4 = new Beaver
            {
                Name       = "SomeBeavers4",
                Age        = 24,
                Fluffiness = FluffinessEnum.Fluffy,
                Size       = 12,
                IpAddress  = IPAddress.Parse("127.0.0.1")
            };
            var beaver5 = new Beaver
            {
                Name       = "SomeBeavers5",
                Age        = 23,
                Fluffiness = FluffinessEnum.VeryFluffy,
                Size       = 11,
                IpAddress  = IPAddress.Parse("127.0.0.1")
            };

            var crow1 = new Crow
            {
                Name      = "Crowly",
                Age       = 5,
                Color     = "black",
                Size      = 1,
                IpAddress = IPAddress.Parse("127.0.0.1")
            };
            var crow2 = new Crow
            {
                Name      = "Crowly1",
                Age       = 5,
                Color     = "black",
                Size      = 1,
                IpAddress = IPAddress.Parse("127.0.0.1")
            };
            var crow3 = new Crow
            {
                Name      = "Crowly2",
                Age       = 22,
                Color     = "black",
                Size      = 4,
                IpAddress = IPAddress.Parse("127.0.0.1")
            };
            var crow4 = new Crow
            {
                Name      = "Crowly3",
                Age       = 50,
                Color     = "white",
                Size      = 10,
                IpAddress = IPAddress.Parse("127.0.0.1")
            };
            var crow5 = new Crow
            {
                Name      = "Crowly4",
                Age       = 5,
                Color     = "pink",
                Size      = 1,
                IpAddress = IPAddress.Parse("127.0.0.1")
            };

            var deer1 = new Deer
            {
                Name      = "Dasher",
                Age       = 1,
                Horns     = true,
                IpAddress = IPAddress.Parse("127.0.0.1")
            };
            var deer2 = new Deer
            {
                Name      = "Dancer",
                Age       = 2,
                Horns     = true,
                IpAddress = IPAddress.Parse("127.0.0.1")
            };
            var deer3 = new Deer
            {
                Name      = "Prancer",
                Age       = 1,
                Horns     = false,
                IpAddress = IPAddress.Parse("127.0.0.1")
            };
            var deer4 = new Deer
            {
                Name      = "Vixen",
                Age       = 1,
                Horns     = true,
                IpAddress = IPAddress.Parse("127.0.0.1")
            };
            var deer5 = new Deer
            {
                Name      = "Comet",
                Age       = 1,
                Horns     = true,
                IpAddress = IPAddress.Parse("127.0.0.1")
            };
            var deer6 = new Deer
            {
                Name      = "Cupid",
                Age       = 1,
                Horns     = false,
                IpAddress = IPAddress.Parse("127.0.0.1")
            };
            var deer7 = new Deer
            {
                Name      = "Donder ",
                Age       = 1,
                Horns     = true,
                IpAddress = IPAddress.Parse("127.0.0.1")
            };
            var deer8 = new Deer
            {
                Name      = "Blitzen",
                Age       = 1,
                Horns     = true,
                IpAddress = IPAddress.Parse("127.0.0.1")
            };

            context.Beavers.Add(beaver1);
            context.Beavers.Add(beaver2);
            context.Beavers.Add(beaver3);
            context.Beavers.Add(beaver4);
            context.Beavers.Add(beaver5);

            context.Crows.Add(crow1);
            context.Crows.Add(crow2);
            context.Crows.Add(crow3);
            context.Crows.Add(crow4);
            context.Crows.Add(crow5);

            context.Deers.Add(deer1);
            context.Deers.Add(deer2);
            context.Deers.Add(deer3);
            context.Deers.Add(deer4);
            context.Deers.Add(deer5);
            context.Deers.Add(deer6);
            context.Deers.Add(deer7);
            context.Deers.Add(deer8);

            #endregion

            #region Seed Many-to-many (Club)

            var club1 = new Club
            {
                Title   = "TreesWorshipers",
                Animals = new List <Animal> {
                    beaver1, beaver2, beaver3, beaver4, beaver5, crow4
                },
                Locations = new List <Location>
                {
                    new()
                    {
                        Address = "North America"
                    },
                    new()
                    {
                        Address = "Canada"
                    },
                    new()
                    {
                        Address = "Russia"
                    }
                }
            };

            var club2 = new Club
            {
                Title   = "CornLovers",
                Animals = new List <Animal> {
                    crow1, crow2, crow3, crow4, crow5
                },
                Locations = new List <Location>
                {
                    new()
                    {
                        Address = "Westeros"
                    }
                }
            };

            var club3 = new Club
            {
                Title   = "ChristmasTeam",
                Animals = new List <Animal>
                {
                    beaver1, beaver2, beaver3, beaver4, beaver5,
                    crow1, crow2, crow3, crow4, crow5,
                    deer1, deer2, deer3, deer4, deer5, deer6, deer7, deer8
                },
                Locations = new List <Location>
                {
                    new()
                    {
                        Address = "North Pole"
                    }
                }
            };

            context.Clubs.Add(club1);
            context.Clubs.Add(club2);
            context.Clubs.Add(club3);

            #endregion

            #region Seed Grades

            var grade1 = new Grade
            {
                TheGrade = 5,
                Club     = club1,
                Animal   = beaver1
            };
            var grade2 = new Grade
            {
                TheGrade = 4,
                Club     = club1,
                Animal   = beaver2
            };
            var grade3 = new Grade
            {
                TheGrade = 3,
                Club     = club1,
                Animal   = beaver3
            };
            var grade4 = new Grade
            {
                TheGrade = 3,
                Club     = club1,
                Animal   = beaver4
            };
            var grade5 = new Grade
            {
                TheGrade = 2,
                Club     = club1,
                Animal   = beaver5
            };
            var grade6 = new Grade
            {
                TheGrade = 1,
                Club     = club1,
                Animal   = crow4
            };
            var grade7 = new Grade
            {
                TheGrade = 5,
                Club     = club2,
                Animal   = crow1
            };
            var grade8 = new Grade
            {
                TheGrade = 4.5,
                Club     = club2,
                Animal   = crow2
            };
            var grade9 = new Grade
            {
                TheGrade = 2.1,
                Club     = club2,
                Animal   = crow3
            };
            var grade10 = new Grade
            {
                TheGrade = 4.3,
                Club     = club2,
                Animal   = crow4
            };

            var grade27 = new Grade
            {
                TheGrade = 4.5,
                Club     = club3,
                Animal   = beaver1
            };
            var grade26 = new Grade
            {
                TheGrade = 4.5,
                Club     = club3,
                Animal   = beaver2
            };
            var grade25 = new Grade
            {
                TheGrade = 4.5,
                Club     = club3,
                Animal   = beaver3
            };
            var grade24 = new Grade
            {
                TheGrade = 4.5,
                Club     = club3,
                Animal   = beaver4
            };
            var grade23 = new Grade
            {
                TheGrade = 4.5,
                Club     = club3,
                Animal   = beaver5
            };
            var grade22 = new Grade
            {
                TheGrade = 4.5,
                Club     = club3,
                Animal   = crow1
            };
            var grade21 = new Grade
            {
                TheGrade = 3.5,
                Club     = club3,
                Animal   = crow2
            };
            var grade20 = new Grade
            {
                TheGrade = 2.5,
                Club     = club3,
                Animal   = crow3
            };
            var grade19 = new Grade
            {
                TheGrade = 1.5,
                Club     = club3,
                Animal   = crow4
            };
            var grade28 = new Grade
            {
                TheGrade = 4.9,
                Club     = club3,
                Animal   = crow5
            };
            var grade11 = new Grade
            {
                TheGrade = 4.8,
                Club     = club3,
                Animal   = deer1
            };
            var grade12 = new Grade
            {
                TheGrade = 4.7,
                Club     = club3,
                Animal   = deer2
            };
            var grade13 = new Grade
            {
                TheGrade = 4.6,
                Club     = club3,
                Animal   = deer3
            };
            var grade14 = new Grade
            {
                TheGrade = 4.5,
                Club     = club3,
                Animal   = deer4
            };
            var grade15 = new Grade
            {
                TheGrade = 4.4,
                Club     = club3,
                Animal   = deer5
            };
            var grade16 = new Grade
            {
                TheGrade = 4.3,
                Club     = club3,
                Animal   = deer6
            };
            var grade17 = new Grade
            {
                TheGrade = 4.2,
                Club     = club3,
                Animal   = deer7
            };
            var grade18 = new Grade
            {
                TheGrade = 4.1,
                Club     = club3,
                Animal   = deer8
            };

            context.Grades.Add(grade1);
            context.Grades.Add(grade2);
            context.Grades.Add(grade3);
            context.Grades.Add(grade4);
            context.Grades.Add(grade5);
            context.Grades.Add(grade6);
            context.Grades.Add(grade7);
            context.Grades.Add(grade8);
            context.Grades.Add(grade9);
            context.Grades.Add(grade10);
            context.Grades.Add(grade11);
            context.Grades.Add(grade12);
            context.Grades.Add(grade13);
            context.Grades.Add(grade14);
            context.Grades.Add(grade15);
            context.Grades.Add(grade16);
            context.Grades.Add(grade17);
            context.Grades.Add(grade18);
            context.Grades.Add(grade19);
            context.Grades.Add(grade20);
            context.Grades.Add(grade21);
            context.Grades.Add(grade22);
            context.Grades.Add(grade23);
            context.Grades.Add(grade24);
            context.Grades.Add(grade25);
            context.Grades.Add(grade26);
            context.Grades.Add(grade27);
            context.Grades.Add(grade28);

            #endregion

            #region Seed Jobs

            var job1 = new Job
            {
                Title   = "Builder",
                Salary  = 1,
                Animals = new List <Animal>
                {
                    beaver1, beaver2, beaver3, beaver4, beaver5
                }
            };
            var job2 = new Job
            {
                Title   = "Messenger",
                Salary  = 10,
                Animals = new List <Animal>
                {
                    crow1, crow2, crow3, crow4
                }
            };
            var job3 = new Job
            {
                Title   = "Delivery",
                Salary  = 100,
                Animals = new List <Animal>
                {
                    deer1, deer2, deer3, deer4, deer5, deer6, deer7, deer8
                }
            };

            context.Jobs.Add(job1);
            context.Jobs.Add(job2);
            context.Jobs.Add(job3);

            #endregion

            #region Seed TPH (Food)

            var food1 = new NormalFood
            {
                Title  = "Elm",
                Animal = beaver1,
                Taste  = Taste.Normal
            };
            var food2 = new VeganFood
            {
                Title    = "Daphne laureola",
                Animal   = beaver2,
                Calories = 100
            };
            var food3 = new VeganFood
            {
                Title    = "Carpinus betulus",
                Animal   = beaver3,
                Calories = 1001
            };
            var food4 = new VeganFood
            {
                Title    = "Hornbeam",
                Animal   = beaver4,
                Calories = 101
            };
            var food5 = new NormalFood
            {
                Title  = "Pizza",
                Animal = beaver5,
                Taste  = Taste.Excellent
            };
            var food6 = new NormalFood
            {
                Title  = "Steak",
                Animal = crow1,
                Taste  = Taste.Excellent
            };
            var food7 = new NormalFood
            {
                Title  = "Meat",
                Animal = crow2,
                Taste  = Taste.Good
            };
            var food8 = new NormalFood
            {
                Title  = "Pizza",
                Animal = crow3,
                Taste  = Taste.VeryGood
            };
            var food9 = new VeganFood
            {
                Title    = "Corn",
                Animal   = crow4,
                Calories = 1
            };
            var food10 = new NormalFood
            {
                Title  = "Pizza",
                Animal = crow5,
                Taste  = Taste.Normal
            };
            var food11 = new VeganFood
            {
                Title    = "Pizza",
                Animal   = deer1,
                Calories = 10
            };
            var food12 = new VeganFood
            {
                Title    = "Pizza",
                Animal   = deer2,
                Calories = 10
            };
            var food13 = new VeganFood
            {
                Title    = "Pizza",
                Animal   = deer3,
                Calories = 10
            };
            var food14 = new VeganFood
            {
                Title    = "Pizza",
                Animal   = deer4,
                Calories = 10
            };
            var food15 = new VeganFood
            {
                Title    = "Pizza",
                Animal   = deer5,
                Calories = 10
            };
            var food16 = new VeganFood
            {
                Title    = "Pizza",
                Animal   = deer6,
                Calories = 10
            };
            var food17 = new NormalFood
            {
                Title  = "Elves",
                Animal = deer7,
                Taste  = Taste.Excellent
            };
            var food18 = new VeganFood
            {
                Title    = "Pizza",
                Animal   = deer8,
                Calories = 10
            };

            context.Food.Add(food1);
            context.Food.Add(food2);
            context.Food.Add(food3);
            context.Food.Add(food4);
            context.Food.Add(food5);
            context.Food.Add(food6);
            context.Food.Add(food7);
            context.Food.Add(food8);
            context.Food.Add(food9);
            context.Food.Add(food10);
            context.Food.Add(food11);
            context.Food.Add(food12);
            context.Food.Add(food13);
            context.Food.Add(food14);
            context.Food.Add(food15);
            context.Food.Add(food16);
            context.Food.Add(food17);
            context.Food.Add(food18);

            #endregion

            #region Seed Many-to-many old style (Drawback)

            var drawback1 = new Drawback
            {
                Title = "Crowdy",
                Foods = new List <Food>
                {
                    food1, food2, food3, food4, /*food5,*/ food6, food7, food8, food9, food10, food11, food12, food13,
                    food14, food15, food16, food17, food18
                },
                Clubs = new List <Club>
                {
                    club1, club2, club3
                },
                Consequence = new Consequence
                {
                    Name = "Nervousness"
                }
            };
            var drawback2 = new Drawback
            {
                Title = "Windy",
                Foods = new List <Food>
                {
                    food1, food2, food3, food4, food5, food6, food7, food8, food9, food10, food11, food12, food13,
                    food14, food15, food16, food17, food18
                },
                Clubs = new List <Club>
                {
                    club1, club2, club3
                },
                Consequence = new Consequence
                {
                    Name = "Teleportation to Land of Oz"
                }
            };
            var drawback3 = new Drawback
            {
                Title = "Soggy",
                Foods = new List <Food>
                {
                    food1, food2, food3, food4, food5, food6, food7, food8, food9, food10, food11, food12, food13,
                    food14, food15, food16, food17, food18
                },
                Clubs = new List <Club>
                {
                    club1, club2, club3
                },
                Consequence = new Consequence
                {
                    Name = "Wet clothes"
                }
            };
            var drawback4 = new Drawback
            {
                Title = "Hardy",
                Foods = new List <Food>
                {
                    food1, food2, food3, food4, food5, food6, food7, food8, food9, food10, food11, food12, food13,
                    food14, food15, food16, food17, food18
                },
                Clubs = new List <Club>
                {
                    club1, club2, club3
                },
                Consequence = new Consequence
                {
                    Name = "Sadness"
                }
            };

            context.Drawbacks.Add(drawback1);
            context.Drawbacks.Add(drawback2);
            context.Drawbacks.Add(drawback3);
            context.Drawbacks.Add(drawback4);

            var jobDrawback1 = new JobDrawback
            {
                Job      = job1,
                Drawback = drawback1
            };
            var jobDrawback2 = new JobDrawback
            {
                Job      = job1,
                Drawback = drawback2
            };
            var jobDrawback3 = new JobDrawback
            {
                Job      = job1,
                Drawback = drawback3
            };
            var jobDrawback4 = new JobDrawback
            {
                Job      = job1,
                Drawback = drawback4
            };
            var jobDrawback5 = new JobDrawback
            {
                Job      = job2,
                Drawback = drawback1
            };
            var jobDrawback6 = new JobDrawback
            {
                Job      = job2,
                Drawback = drawback2
            };
            var jobDrawback7 = new JobDrawback
            {
                Job      = job3,
                Drawback = drawback1
            };
            var jobDrawback8 = new JobDrawback
            {
                Job      = job3,
                Drawback = drawback2
            };

            context.JobDrawbacks.Add(jobDrawback1);
            context.JobDrawbacks.Add(jobDrawback2);
            context.JobDrawbacks.Add(jobDrawback3);
            context.JobDrawbacks.Add(jobDrawback4);
            context.JobDrawbacks.Add(jobDrawback5);
            context.JobDrawbacks.Add(jobDrawback6);
            context.JobDrawbacks.Add(jobDrawback7);
            context.JobDrawbacks.Add(jobDrawback8);

            #endregion

            context.SaveChanges();

            #region Seed Property Bags (Category, Product)

            var category1 = new Dictionary <string, object>
            {
                ["Name"]   = "Beverages",
                ["FoodId"] = food1.Id
            };

            context.Categories.Add(category1);

            context.SaveChanges();

            var product1 = new Dictionary <string, object>
            {
                ["Name"]       = "Product1",
                ["CategoryId"] = context.Categories.First()["Id"]
            };

            context.Products.Add(product1);

            #endregion

            #region Seed Persons

            var person1 = new Person
            {
                Name         = "BeaverPerson",
                AnimalsLoved = new List <Animal> {
                    beaver1, beaver2, beaver3, beaver4, beaver5
                },
                AnimalsHated = new List <Animal> {
                    deer1, deer2, deer3, deer4, deer5, deer6, deer7, deer8
                }
            };

            context.Persons.Add(person1);

            #endregion

            #region Seed Elves

            var elf1 = new Elf
            {
                Name = "Alabaster Snowball",
                Deer = deer1
            };
            var elf2 = new Elf
            {
                Name = "Bushy Evergreen",
                Deer = deer1
            };
            var elf3 = new Elf
            {
                Name = "Pepper Minstix",
                Deer = deer2
            };
            var elf4 = new Elf
            {
                Name = "Shinny Upatree",
                Deer = deer3
            };
            var elf5 = new Elf
            {
                Name = "Sugarplum Mary",
                Deer = deer4
            };
            var elf6 = new Elf
            {
                Name = "Wunorse Openslae",
                Deer = deer5
            };
            var elf7 = new Elf
            {
                Name = "Grinch",
                Deer = deer6
            };
            var elf8 = new Elf
            {
                Name = "Legolas",
                Deer = deer7
            };
            var elf9 = new Elf
            {
                Name = "Iorveth",
                Deer = deer8
            };

            context.Elves.Add(elf1);
            context.Elves.Add(elf2);
            context.Elves.Add(elf3);
            context.Elves.Add(elf4);
            context.Elves.Add(elf5);
            context.Elves.Add(elf6);
            context.Elves.Add(elf7);
            context.Elves.Add(elf8);
            context.Elves.Add(elf9);

            #endregion

            #region Seed AdditionaInfos

            var additionalInfo1 = new AdditionalInfo()
            {
                Clubs = new List <Club>()
                {
                    club1, club2, club3
                },
                Comment = "Best club ever"
            };
            var additionalInfo2 = new AdditionalInfo()
            {
                Clubs = new List <Club>()
                {
                    club1, club2
                },
                Comment = "Evolution club"
            };
            var additionalInfo3 = new AdditionalInfo()
            {
                Clubs = new List <Club>()
                {
                    club1
                },
                Comment = "Original club"
            };

            context.AdditionalInfos.Add(additionalInfo1);
            context.AdditionalInfos.Add(additionalInfo2);
            context.AdditionalInfos.Add(additionalInfo3);

            #endregion

            context.SaveChanges();

            context.Database.ExecuteSqlRaw(File.ReadAllText(".\\BD\\CreateTVF.sql"));
        }
Пример #25
0
 void Awake()
 {
     crow     = GetComponentInParent <Crow>();
     crowLife = GetComponentInParent <Life>();
 }
Пример #26
0
		void onBackToMainMenu (object sender, Crow.MouseButtonEventArgs e)
		{
			closeCurrentPuzzle ();
		}
Пример #27
0
 void onSaveSplatting(object sender, Crow.MouseButtonEventArgs e)
 {
     Texture.Save (splattingBrushShader.OutputTex, @"splat.png");
 }
Пример #28
0
 public CrowState_Eating()
 {
     mStateID = CrowStates.Eating;
     mCrow = GameObject.FindObjectOfType( typeof( Crow ) ) as Crow;
 }
Пример #29
0
 public CrowState_Dead()
 {
     mStateID = CrowStates.Dead;
     mCrow = GameObject.FindObjectOfType( typeof( Crow ) ) as Crow;
 }
Пример #30
0
 public CrowState_Fleeing()
 {
     mStateID = CrowStates.Fleeing;
     mCrow = GameObject.FindObjectOfType( typeof( Crow ) ) as Crow;
     mScarecrow = GameObject.FindObjectOfType( typeof( Scarecrow ) ) as Scarecrow;
     mSafePoints = GameObject.FindGameObjectsWithTag( "SafePoints" );
 }
Пример #31
0
    // Use this for initialization
    void Start()
    {
        mScarecrow 	= FindObjectOfType(typeof(Scarecrow)) as Scarecrow;
        mCrow		= FindObjectOfType(typeof(Crow)) as Crow;
        mCornStalks = FindObjectsOfType(typeof(CornStalk)) as CornStalk[];

        dialogMesh = FindObjectOfType(typeof(TextMesh)) as TextMesh;
        dialogMesh.renderer.enabled = false;
        dialogTimeDisplayed = 0f;
        lastDialogDay = 0;
        lastDialogLine = 0;

        batteryIcon = (Texture2D) Resources.Load("PowerIcon", typeof(Texture2D));

        batteryMeterColor = Color.green;
        hungerMeterColor = Color.green;
        stressMeterColor = Color.green;

        batteryMeterTexture = GetMeterTexture(batteryMeterColor);
        hungerMeterTexture = GetMeterTexture(hungerMeterColor);
        stressMeterTexture = GetMeterTexture(stressMeterColor);

        dnc = FindObjectOfType(typeof(DayNightCycle)) as DayNightCycle;

        crowKnownDead = false;
        robotKnownDead = false;
        cornKnownDead = false;

        crowDeadLines = new string[18];
        crowDeadLines[0] = "Oh God! What have I done!?";
        crowDeadLines[1] = "Filbert. I had named him Filbert.";
        crowDeadLines[2] = "What do I do now?";
        crowDeadLines[3] = "I'm so sorry Filbert. I'm so sorry...";
        crowDeadLines[4] = "I... don't know what to do...";
        crowDeadLines[5] = "Thought up a song for Filbert today.\nHe would have liked it, I think";
        crowDeadLines[6] = "Why did you have to die?";
        crowDeadLines[7] = "I miss you...";
        crowDeadLines[8] = "Was this all I was created for?";
        crowDeadLines[9] = "Where do I go from here?";
        crowDeadLines[10] = "Filbert... Filbert... where are you...";
        crowDeadLines[11] = "Where are you God?";
        crowDeadLines[12] = "Why am I here?";
        crowDeadLines[13] = "Life is meaningless...";
        crowDeadLines[14] = "The corn does not need me.";
        crowDeadLines[15] = "The corn does not want me.";
        crowDeadLines[16] = "I don't want this anymore.";
        crowDeadLines[17] = "What's the point?";

        audio.clip = kNormalMusic;
        audio.Play();

        menuTimer = 0f;
    }
Пример #32
0
 public CrowState_WaitingForStress()
 {
     mStateID = CrowStates.WaitingForStress;
     mCrow = GameObject.FindObjectOfType( typeof( Crow ) ) as Crow;
 }
Пример #33
0
 void onLoad(object sender, Crow.MouseButtonEventArgs e)
 {
     CurrentState = State.LoadMap;
 }
Пример #34
0
		void onButQuitClick (object sender, Crow.MouseButtonEventArgs e){
			closeGame ();

		}
Пример #35
0
 void onSaveHM(object sender, Crow.MouseButtonEventArgs e)
 {
     Texture.Save (hmGenerator.OutputTex, @"heightmap.png");
 }
Пример #36
0
        private static void SeedDb()
        {
            using var context = new AnimalContext();

            context.Database.Delete();
            context.Database.Create();

            #region Seed TPT (Animal)

            var beaver1 = new Beaver
            {
                Name       = "SomeBeavers1",
                Age        = 27,
                Fluffiness = FluffinessEnum.VeryFluffy,
                Size       = 15,
                IpAddress  = "127.0.0.1"
            };
            var beaver2 = new Beaver
            {
                Name       = "SomeBeavers2",
                Age        = 26,
                Fluffiness = FluffinessEnum.Fluffy,
                Size       = 14,
                IpAddress  = "127.0.0.1"
            };
            var beaver3 = new Beaver
            {
                Name       = "SomeBeavers3",
                Age        = 25,
                Fluffiness = FluffinessEnum.NotFluffy,
                Size       = 13,
                IpAddress  = "127.0.0.1"
            };
            var beaver4 = new Beaver
            {
                Name       = "SomeBeavers4",
                Age        = 24,
                Fluffiness = FluffinessEnum.Fluffy,
                Size       = 12,
                IpAddress  = "127.0.0.1"
            };
            var beaver5 = new Beaver
            {
                Name       = "SomeBeavers5",
                Age        = 23,
                Fluffiness = FluffinessEnum.VeryFluffy,
                Size       = 11,
                IpAddress  = "127.0.0.1"
            };

            var crow1 = new Crow
            {
                Name      = "Crowly",
                Age       = 5,
                Color     = "black",
                Size      = 1,
                IpAddress = "127.0.0.1"
            };
            var crow2 = new Crow
            {
                Name      = "Crowly1",
                Age       = 5,
                Color     = "black",
                Size      = 1,
                IpAddress = "127.0.0.1"
            };
            var crow3 = new Crow
            {
                Name      = "Crowly2",
                Age       = 22,
                Color     = "black",
                Size      = 4,
                IpAddress = "127.0.0.1"
            };
            var crow4 = new Crow
            {
                Name      = "Crowly3",
                Age       = 50,
                Color     = "white",
                Size      = 10,
                IpAddress = "127.0.0.1"
            };
            var crow5 = new Crow
            {
                Name      = "Crowly4",
                Age       = 5,
                Color     = "pink",
                Size      = 1,
                IpAddress = "127.0.0.1"
            };

            var deer1 = new Deer
            {
                Name      = "Dasher",
                Age       = 1,
                Horns     = true,
                IpAddress = "127.0.0.1"
            };
            var deer2 = new Deer
            {
                Name      = "Dancer",
                Age       = 2,
                Horns     = true,
                IpAddress = "127.0.0.1"
            };
            var deer3 = new Deer
            {
                Name      = "Prancer",
                Age       = 1,
                Horns     = false,
                IpAddress = "127.0.0.1"
            };
            var deer4 = new Deer
            {
                Name      = "Vixen",
                Age       = 1,
                Horns     = true,
                IpAddress = "127.0.0.1"
            };
            var deer5 = new Deer
            {
                Name      = "Comet",
                Age       = 1,
                Horns     = true,
                IpAddress = "127.0.0.1"
            };
            var deer6 = new Deer
            {
                Name      = "Cupid",
                Age       = 1,
                Horns     = false,
                IpAddress = "127.0.0.1"
            };
            var deer7 = new Deer
            {
                Name      = "Donder ",
                Age       = 1,
                Horns     = true,
                IpAddress = "127.0.0.1"
            };
            var deer8 = new Deer
            {
                Name      = "Blitzen",
                Age       = 1,
                Horns     = true,
                IpAddress = "127.0.0.1"
            };

            context.Beavers.Add(beaver1);
            context.Beavers.Add(beaver2);
            context.Beavers.Add(beaver3);
            context.Beavers.Add(beaver4);
            context.Beavers.Add(beaver5);

            context.Crows.Add(crow1);
            context.Crows.Add(crow2);
            context.Crows.Add(crow3);
            context.Crows.Add(crow4);
            context.Crows.Add(crow5);

            context.Deers.Add(deer1);
            context.Deers.Add(deer2);
            context.Deers.Add(deer3);
            context.Deers.Add(deer4);
            context.Deers.Add(deer5);
            context.Deers.Add(deer6);
            context.Deers.Add(deer7);
            context.Deers.Add(deer8);

            #endregion

            #region Seed Many-to-many (Club)

            var club1 = new Club
            {
                Title   = "TreesWorshipers",
                Animals = new List <Animal> {
                    beaver1, beaver2, beaver3, beaver4, beaver5, crow4
                },
                Locations = new List <Location>
                {
                    new()
                    {
                        Address            = "North America",
                        GeographicLocation = DbGeography.FromText("POINT(-122 47)")
                    },
                    new()
                    {
                        Address            = "Canada",
                        GeographicLocation = DbGeography.FromText("POINT(122 40)")
                    },
                    new()
                    {
                        Address            = "Russia",
                        GeographicLocation = DbGeography.FromText("POINT(1 1)")
                    }
                }
            };

            var club2 = new Club
            {
                Title   = "CornLovers",
                Animals = new List <Animal> {
                    crow1, crow2, crow3, crow4, crow5
                },
                Locations = new List <Location>
                {
                    new()
                    {
                        Address            = "Westeros",
                        GeographicLocation = DbGeography.FromText("POINT(00 00)")
                    }
                }
            };

            var club3 = new Club
            {
                Title   = "ChristmasTeam",
                Animals = new List <Animal>
                {
                    beaver1, beaver2, beaver3, beaver4, beaver5,
                    crow1, crow2, crow3, crow4, crow5,
                    deer1, deer2, deer3, deer4, deer5, deer6, deer7, deer8
                },
                Locations = new List <Location>
                {
                    new()
                    {
                        Address            = "North Pole",
                        GeographicLocation = DbGeography.FromText("POINT(9 9)")
                    }
                }
            };

            context.Clubs.Add(club1);
            context.Clubs.Add(club2);
            context.Clubs.Add(club3);

            #endregion

            #region Seed Grades

            var grade1 = new Grade
            {
                TheGrade = 5,
                Club     = club1,
                Animal   = beaver1
            };
            var grade2 = new Grade
            {
                TheGrade = 4,
                Club     = club1,
                Animal   = beaver2
            };
            var grade3 = new Grade
            {
                TheGrade = 3,
                Club     = club1,
                Animal   = beaver3
            };
            var grade4 = new Grade
            {
                TheGrade = 3,
                Club     = club1,
                Animal   = beaver4
            };
            var grade5 = new Grade
            {
                TheGrade = 2,
                Club     = club1,
                Animal   = beaver5
            };
            var grade6 = new Grade
            {
                TheGrade = 1,
                Club     = club1,
                Animal   = crow4
            };
            var grade7 = new Grade
            {
                TheGrade = 5,
                Club     = club2,
                Animal   = crow1
            };
            var grade8 = new Grade
            {
                TheGrade = 4.5,
                Club     = club2,
                Animal   = crow2
            };
            var grade9 = new Grade
            {
                TheGrade = 2.1,
                Club     = club2,
                Animal   = crow3
            };
            var grade10 = new Grade
            {
                TheGrade = 4.3,
                Club     = club2,
                Animal   = crow4
            };

            var grade27 = new Grade
            {
                TheGrade = 4.5,
                Club     = club3,
                Animal   = beaver1
            };
            var grade26 = new Grade
            {
                TheGrade = 4.5,
                Club     = club3,
                Animal   = beaver2
            };
            var grade25 = new Grade
            {
                TheGrade = 4.5,
                Club     = club3,
                Animal   = beaver3
            };
            var grade24 = new Grade
            {
                TheGrade = 4.5,
                Club     = club3,
                Animal   = beaver4
            };
            var grade23 = new Grade
            {
                TheGrade = 4.5,
                Club     = club3,
                Animal   = beaver5
            };
            var grade22 = new Grade
            {
                TheGrade = 4.5,
                Club     = club3,
                Animal   = crow1
            };
            var grade21 = new Grade
            {
                TheGrade = 3.5,
                Club     = club3,
                Animal   = crow2
            };
            var grade20 = new Grade
            {
                TheGrade = 2.5,
                Club     = club3,
                Animal   = crow3
            };
            var grade19 = new Grade
            {
                TheGrade = 1.5,
                Club     = club3,
                Animal   = crow4
            };
            var grade28 = new Grade
            {
                TheGrade = 4.9,
                Club     = club3,
                Animal   = crow5
            };
            var grade11 = new Grade
            {
                TheGrade = 4.8,
                Club     = club3,
                Animal   = deer1
            };
            var grade12 = new Grade
            {
                TheGrade = 4.7,
                Club     = club3,
                Animal   = deer2
            };
            var grade13 = new Grade
            {
                TheGrade = 4.6,
                Club     = club3,
                Animal   = deer3
            };
            var grade14 = new Grade
            {
                TheGrade = 4.5,
                Club     = club3,
                Animal   = deer4
            };
            var grade15 = new Grade
            {
                TheGrade = 4.4,
                Club     = club3,
                Animal   = deer5
            };
            var grade16 = new Grade
            {
                TheGrade = 4.3,
                Club     = club3,
                Animal   = deer6
            };
            var grade17 = new Grade
            {
                TheGrade = 4.2,
                Club     = club3,
                Animal   = deer7
            };
            var grade18 = new Grade
            {
                TheGrade = 4.1,
                Club     = club3,
                Animal   = deer8
            };

            context.Grades.Add(grade1);
            context.Grades.Add(grade2);
            context.Grades.Add(grade3);
            context.Grades.Add(grade4);
            context.Grades.Add(grade5);
            context.Grades.Add(grade6);
            context.Grades.Add(grade7);
            context.Grades.Add(grade8);
            context.Grades.Add(grade9);
            context.Grades.Add(grade10);
            context.Grades.Add(grade11);
            context.Grades.Add(grade12);
            context.Grades.Add(grade13);
            context.Grades.Add(grade14);
            context.Grades.Add(grade15);
            context.Grades.Add(grade16);
            context.Grades.Add(grade17);
            context.Grades.Add(grade18);
            context.Grades.Add(grade19);
            context.Grades.Add(grade20);
            context.Grades.Add(grade21);
            context.Grades.Add(grade22);
            context.Grades.Add(grade23);
            context.Grades.Add(grade24);
            context.Grades.Add(grade25);
            context.Grades.Add(grade26);
            context.Grades.Add(grade27);
            context.Grades.Add(grade28);

            #endregion

            #region Seed Jobs

            var job1 = new Job
            {
                Title   = "Builder",
                Salary  = 1,
                Animals = new List <Animal>
                {
                    beaver1, beaver2, beaver3, beaver4, beaver5
                }
            };
            var job2 = new Job
            {
                Title   = "Messenger",
                Salary  = 10,
                Animals = new List <Animal>
                {
                    crow1, crow2, crow3, crow4
                }
            };
            var job3 = new Job
            {
                Title   = "Delivery",
                Salary  = 100,
                Animals = new List <Animal>
                {
                    deer1, deer2, deer3, deer4, deer5, deer6, deer7, deer8
                }
            };

            context.Jobs.Add(job1);
            context.Jobs.Add(job2);
            context.Jobs.Add(job3);

            #endregion

            #region Seed TPH (Food)

            var food1 = new NormalFood
            {
                Title  = "Elm",
                Animal = beaver1,
                Taste  = Taste.Normal
            };
            var food2 = new VeganFood
            {
                Title    = "Daphne laureola",
                Animal   = beaver2,
                Calories = 100
            };
            var food3 = new VeganFood
            {
                Title    = "Carpinus betulus",
                Animal   = beaver3,
                Calories = 1001
            };
            var food4 = new VeganFood
            {
                Title    = "Hornbeam",
                Animal   = beaver4,
                Calories = 101
            };
            var food5 = new NormalFood
            {
                Title  = "Pizza",
                Animal = beaver5,
                Taste  = Taste.Excellent
            };
            var food6 = new NormalFood
            {
                Title  = "Steak",
                Animal = crow1,
                Taste  = Taste.Excellent
            };
            var food7 = new NormalFood
            {
                Title  = "Meat",
                Animal = crow2,
                Taste  = Taste.Good
            };
            var food8 = new NormalFood
            {
                Title  = "Pizza",
                Animal = crow3,
                Taste  = Taste.VeryGood
            };
            var food9 = new VeganFood
            {
                Title    = "Corn",
                Animal   = crow4,
                Calories = 1
            };
            var food10 = new NormalFood
            {
                Title  = "Pizza",
                Animal = crow5,
                Taste  = Taste.Normal
            };
            var food11 = new VeganFood
            {
                Title    = "Pizza",
                Animal   = deer1,
                Calories = 10
            };
            var food12 = new VeganFood
            {
                Title    = "Pizza",
                Animal   = deer2,
                Calories = 10
            };
            var food13 = new VeganFood
            {
                Title    = "Pizza",
                Animal   = deer3,
                Calories = 10
            };
            var food14 = new VeganFood
            {
                Title    = "Pizza",
                Animal   = deer4,
                Calories = 10
            };
            var food15 = new VeganFood
            {
                Title    = "Pizza",
                Animal   = deer5,
                Calories = 10
            };
            var food16 = new VeganFood
            {
                Title    = "Pizza",
                Animal   = deer6,
                Calories = 10
            };
            var food17 = new NormalFood
            {
                Title  = "Elves",
                Animal = deer7,
                Taste  = Taste.Excellent
            };
            var food18 = new VeganFood
            {
                Title    = "Pizza",
                Animal   = deer8,
                Calories = 10
            };

            context.Food.Add(food1);
            context.Food.Add(food2);
            context.Food.Add(food3);
            context.Food.Add(food4);
            context.Food.Add(food5);
            context.Food.Add(food6);
            context.Food.Add(food7);
            context.Food.Add(food8);
            context.Food.Add(food9);
            context.Food.Add(food10);
            context.Food.Add(food11);
            context.Food.Add(food12);
            context.Food.Add(food13);
            context.Food.Add(food14);
            context.Food.Add(food15);
            context.Food.Add(food16);
            context.Food.Add(food17);
            context.Food.Add(food18);

            #endregion

            #region Seed Many-to-many old style (Drawback)

            var drawback1 = new Drawback
            {
                Title = "Crowdy",
                Foods = new List <Food>
                {
                    food1, food2, food3, food4, /*food5,*/ food6, food7, food8, food9, food10, food11, food12, food13,
                    food14, food15, food16, food17, food18
                },
                Clubs = new List <Club>
                {
                    club1, club2, club3
                },
                Consequence = new Consequence
                {
                    Name = "Nervousness"
                },
                DrawbackDetail = new DrawbackDetails
                {
                    DateCreated = DateTime.Now,
                    Description = "the quality or state of being nervous"
                }
            };
            var drawback2 = new Drawback
            {
                Title = "Windy",
                Foods = new List <Food>
                {
                    food1, food2, food3, food4, food5, food6, food7, food8, food9, food10, food11, food12, food13,
                    food14, food15, food16, food17, food18
                },
                Clubs = new List <Club>
                {
                    club1, club2, club3
                },
                Consequence = new Consequence
                {
                    Name = "Teleportation to Land of Oz"
                },
                DrawbackDetail = new DrawbackDetails
                {
                    DateCreated = DateTime.Now,
                    Description = "hallucination"
                }
            };
            var drawback3 = new Drawback
            {
                Title = "Soggy",
                Foods = new List <Food>
                {
                    food1, food2, food3, food4, food5, food6, food7, food8, food9, food10, food11, food12, food13,
                    food14, food15, food16, food17, food18
                },
                Clubs = new List <Club>
                {
                    club1, club2, club3
                },
                Consequence = new Consequence
                {
                    Name = "Wet clothes"
                },
                DrawbackDetail = new DrawbackDetails
                {
                    DateCreated = DateTime.Now,
                    Description = "cold"
                }
            };
            var drawback4 = new Drawback
            {
                Title = "Hardy",
                Foods = new List <Food>
                {
                    food1, food2, food3, food4, food5, food6, food7, food8, food9, food10, food11, food12, food13,
                    food14, food15, food16, food17, food18
                },
                Clubs = new List <Club>
                {
                    club1, club2, club3
                },
                Consequence = new Consequence
                {
                    Name = "Sadness"
                },
                DrawbackDetail = new DrawbackDetails
                {
                    DateCreated = DateTime.Now,
                    Description = "the condition or quality of being sad"
                }
            };

            context.Drawbacks.Add(drawback1);
            context.Drawbacks.Add(drawback2);
            context.Drawbacks.Add(drawback3);
            context.Drawbacks.Add(drawback4);

            var jobDrawback1 = new JobDrawback
            {
                Job      = job1,
                Drawback = drawback1
            };
            var jobDrawback2 = new JobDrawback
            {
                Job      = job1,
                Drawback = drawback2
            };
            var jobDrawback3 = new JobDrawback
            {
                Job      = job1,
                Drawback = drawback3
            };
            var jobDrawback4 = new JobDrawback
            {
                Job      = job1,
                Drawback = drawback4
            };
            var jobDrawback5 = new JobDrawback
            {
                Job      = job2,
                Drawback = drawback1
            };
            var jobDrawback6 = new JobDrawback
            {
                Job      = job2,
                Drawback = drawback2
            };
            var jobDrawback7 = new JobDrawback
            {
                Job      = job3,
                Drawback = drawback1
            };
            var jobDrawback8 = new JobDrawback
            {
                Job      = job3,
                Drawback = drawback2
            };

            context.JobDrawbacks.Add(jobDrawback1);
            context.JobDrawbacks.Add(jobDrawback2);
            context.JobDrawbacks.Add(jobDrawback3);
            context.JobDrawbacks.Add(jobDrawback4);
            context.JobDrawbacks.Add(jobDrawback5);
            context.JobDrawbacks.Add(jobDrawback6);
            context.JobDrawbacks.Add(jobDrawback7);
            context.JobDrawbacks.Add(jobDrawback8);

            #endregion

            #region Seed Persons

            var person1 = new Person
            {
                Name         = "BeaverPerson",
                AnimalsLoved = new List <Animal> {
                    beaver1, beaver2, beaver3, beaver4, beaver5
                },
                AnimalsHated = new List <Animal> {
                    deer1, deer2, deer3, deer4, deer5, deer6, deer7, deer8
                }
            };

            context.Persons.Add(person1);

            #endregion

            context.SaveChanges();
        }
Пример #37
0
        static void Main(string[] args)
        {
            #region Intro
            Console.Beep(240, 250);
            Console.Beep(340, 220);
            Console.Beep(370, 220);
            Console.Beep(400, 220);
            Console.Beep(320, 260);


            Console.ForegroundColor = ConsoleColor.DarkYellow;



            Console.Title = "Beyond The Rainbow";
            Console.WriteLine("BEYOND THE RAINBOW");
            System.Threading.Thread.Sleep(3200);
            Console.WriteLine("Created by: Lance Vogel 2020");
            System.Threading.Thread.Sleep(3200);
            Console.Clear();
            Console.WriteLine("You wake up in the stale air of a warm bedroom. Dust floats in the last beams of the evening sun between a pair of torn curtains. Everything feels wrong...\n");
            System.Threading.Thread.Sleep(3000);
            #endregion

            #region Hero Selection
            //Weapons
            Weapon pitchfork = new Weapon("Pitchfork", 4, 6, 4, false, 0);
            Weapon axe       = new Weapon("Axe", 6, 8, 2, false, 0);
            Weapon teeth     = new Weapon("Claws and Fangs", 4, 6, 2, true, 5);
            //Lion teeth might need a bool instead of an int for chance to eat

            Console.WriteLine("You see three objects placed intentionally in front of the closed bedroom door: A clump of straw tied together with a green rope, an oil can with a heart drawn on with lipstick and a large chipped feline tooth. Which one do you pick up?");

            //Player List

            Player p1 = new Player("Strawman", 100, 100, 5, 7, pitchfork, Heroes.Strawman);
            Player p2 = new Player("Tinheart", 100, 100, 8, 6, axe, Heroes.Tinheart);
            Player p3 = new Player("Werelion", 100, 100, 5, 4, teeth, Heroes.Werelion);


            //Player [] playerChoice  = player;


            Player characterChoice = p1;
            bool   exit            = false;
            do
            {
                //Choose your hero
                Console.WriteLine("Choose an action:\n" +
                                  "S)traw\n" +
                                  "O)il\n" +
                                  "T)ooth \n" +

                                  "E)xit");

                //Catch the user choice
                ConsoleKey charChoice = Console.ReadKey(true).Key;
                Console.Clear();


                //8 TODO Build out the switch for the user choice
                switch (charChoice)
                {
                case ConsoleKey.S:
                    //INCLUDE PERSONAL MUSIC FOR EACH CHARACTER
                    Console.WriteLine("You feel a flood of thoughts and feelings pour over you . . .");
                    System.Threading.Thread.Sleep(1600);
                    Console.WriteLine("You thought you knew everything until something heavy landed on your head. Now it's as if you've been reset in your knowledge.\nWhen you look down at your arms they are no longer covered in flesh, but living, breathing straw.\nYou often strike true: +2 hit bonus.\nYour weapon is the pitchfork which keeps the crows away: +10 block to normal Crows");

                    Console.ReadLine();
                    exit = true;
                    break;

                case ConsoleKey.O:
                    Console.WriteLine("You feel love lost and deep despair . . .");
                    System.Threading.Thread.Sleep(1600);
                    Console.WriteLine("Your optimism was once full and you once knew what you stood for . . . until you decided to try the game of love. Now, none of that past enthusiasm means a thing. Your cold, hollow heart is encased in rusted tin.\n Your tin flesh boosts your armor: +3 to block and +10 maxlife .\nYour weapon is an axe");
                    characterChoice = p2;
                    Console.ReadLine();
                    exit = true;
                    break;

                case ConsoleKey.T:
                    Console.WriteLine("You feel shame from your overwhelming fear . . .");
                    System.Threading.Thread.Sleep(1600);
                    Console.WriteLine("You remember the fearlessness of your stride. There were no obstacles, just paths. Your confidence was unmatched. But then you failed to save someone. And the doubt in yourself grew and grew until it shattered any forward momentum in your life. You let out a roar in self-pity.\nYou often doubt yourself: -3 to hit bonus.\nBut when rage fills your blood, you fight with fangs and claws: Critical hits result in instant enemy consumption.");
                    characterChoice = p3;
                    Console.ReadLine();
                    exit = true;
                    break;

                case ConsoleKey.E:
                    Console.WriteLine("Game Over . . .");
                    Environment.Exit(0);
                    break;

                default:
                    Console.WriteLine("Choosing nothing is not an option");
                    break;
                }
            } while (!exit);
            #endregion

            #region Munchkin Riddle
            Console.Clear();
            Console.WriteLine("Though much weighs on you, you know one is for sure: You need to get out of this house.\nYou open the door and walk into a narrow hallway with oil paintings of munchkins on both walls. As you walk past them, you can feel their eyes following you.\nWhen you reach the end of the hall, a large painting of the munchkin mayor drops down in front you like a guilliotine, blocking the way . . .");
            Console.ReadLine();
            Console.Clear();

            Console.WriteLine("A booming voice from painting startles you: " + "MY TOWN IS USED TO YOUR KIND, PASSING THROUGH AS IF WE ARE SIMPLY BACKGROUND CHARACTERS IN YOUR OWN LITTLE ADVENTURE.\nWE ARE NOT HERE SIMPLY TO MAKE YOU SMILE AND THEN BE FORGOTTEN. WE MUNCHKINS NEVER FORGET.THE SELFFISHNESS OF OUTSIDERS TAINTS MY TRUST. ANSWER ME THIS, WHAT ARE YOU ABLE TO KEEP, EVEN AFTER GIVING IT TO SOMEONE?");
            do
            {
                Console.WriteLine("Choose an answer:\n" +
                                  "L)Your life\n" +
                                  "W)Your word\n" +
                                  "T)Your trust\n" +
                                  "E)Your time\n" +
                                  "M)Your money");

                ConsoleKey riddleOneChoice = Console.ReadKey(true).Key;
                Console.Clear();

                switch (riddleOneChoice)
                {
                case ConsoleKey.L:
                    //INCLUDE PERSONAL MUSIC FOR EACH CHARACTER
                    Console.WriteLine("Pain fills your body . . .");
                    System.Threading.Thread.Sleep(1600);
                    Console.WriteLine("ONCE YOUR LIFE IS GIVEN, IT IS GONE, NOT KEPT! -5 to Life");
                    Console.ReadLine();
                    Console.Clear();
                    //Add Damage to Health
                    characterChoice.Life -= 5;
                    exit = true;
                    break;

                case ConsoleKey.W:
                    Console.WriteLine("You feel better. . .");
                    System.Threading.Thread.Sleep(1600);
                    Console.WriteLine("THAT IS THE RIGHT ANSWER. MAY YOU HAVE THE STRENGTH AND INTEGRITY TO KEEP YOUR WORD FOR THE REST OF YOUR DAYS!");
                    Console.ReadLine();
                    Console.Clear();
                    exit = true;
                    break;

                case ConsoleKey.T:
                    Console.WriteLine("Pain fills your body . . .");
                    System.Threading.Thread.Sleep(1600);
                    Console.WriteLine("THE LIAR GIVES TRUST BUT DOES NOT KEEP IT. -5 to Health");
                    Console.ReadLine();
                    Console.Clear();
                    //Add damage to health
                    characterChoice.Life -= 5;
                    exit = true;
                    break;

                case ConsoleKey.E:
                    Console.WriteLine("Pain fills your body . . .");
                    System.Threading.Thread.Sleep(1600);
                    Console.WriteLine("TIME IS FLEETING AND NEVER KEPT. -5 to Health");
                    Console.ReadLine();
                    Console.Clear();
                    //Add damage to health
                    characterChoice.Life -= 5;
                    exit = true;
                    break;

                case ConsoleKey.M:
                    Console.WriteLine("Pain fills your body . . .");
                    System.Threading.Thread.Sleep(3200);
                    Console.WriteLine("MONEY CANNOT BE KEPT AFTER GIVING. -5 to Health");
                    Console.ReadLine();
                    Console.Clear();
                    //Add damage to health
                    characterChoice.Life -= 5;
                    exit = true;
                    break;

                default:
                    exit = false;
                    Console.WriteLine("YOU MUST CHOOSE!");
                    break;
                }
            } while (!exit);
            #endregion

            #region Conservatory Battle
            Console.WriteLine("The painting slides up and you continue on your way until you reach a consertatory. Two leafless bonsais sit on the windowsill.\nUpon closer viewing, you discern small ghastly faces carved into their trunks and small arm-like, grasping branches. You see a large bush with pink flowers in the corner. The sweet aroma of the healthy flowers contradicts the stale air you've experienced thus far. Upon getting closer to smell one, the bush begins to shake violently.\nSomething emerges . . .");

            Console.ReadLine();
            Console.Clear();

            Crow         c1 = new Crow("Crow", 10, 10, 1, 2, 1, 3, "Winged pest of the cornfields", 45, false);
            Crow         c2 = new Crow("Crow Fiend", 13, 13, 2, 3, 2, 5, "Scarred crow with high pitch caw that summons others", 51, true);
            FlyingMonkey m1 = new FlyingMonkey("Flying Monkey", 11, 11, 4, 1, 1, 5, "Terrifying monkey of the skies", 49);
            FlyingMonkey m2 = new FlyingMonkey("Flying Gorilla", 15, 15, 4, 2, 2, 6, "Massive flying ape with a tough hide", 51);

            Enemy[] enemies =
            {
                c1, c1, c1, c2, m1, m1, c2      //Higher chance of summoning weaker demon (imp)
                //Polymorphism in action with the demon objects in the Monster array
            };

            Enemy enemy = enemies[new Random().Next(enemies.Length)];  //new monster variable to pick random monster
                                                                       //from length of monsters (max monsters)
            Console.WriteLine("It's a " + enemy.Name + "!");
            bool battleExit = true;
            bool death      = true;
            do
            {
                Console.WriteLine("Choose an action:\n" +
                                  "A)ttack \n" +
                                  "P)layer Stats \n" +
                                  "M)onster Stats \n" +
                                  "E)xit");

                //Will need to split into three sections for each hero (p1,p2,p3)
                ConsoleKey userChoice = Console.ReadKey(true).Key;
                Console.Clear();

                //STRAWMAN BONUS VS CROWS
                if (characterChoice == p1 && enemy == c1)
                {
                    p1.Block += 10;
                }


                switch (userChoice)
                {
                case ConsoleKey.A:
                    Combat.DoBattle(characterChoice, enemy);

                    if (enemy.Life <= 0)
                    {
                        Console.WriteLine("You killed the {0}", enemy.Name);
                        System.Threading.Thread.Sleep(2000);
                        Console.Clear();
                        battleExit = false;
                    }

                    break;

                case ConsoleKey.P:
                    Console.WriteLine(characterChoice);
                    break;

                case ConsoleKey.M:
                    Console.WriteLine(enemy);       //Added Info when hit M
                    break;

                case ConsoleKey.E:
                    Console.WriteLine("Farewell...");
                    Environment.Exit(0);
                    break;

                default:
                    Console.WriteLine("Make a choice");
                    break;
                }

                if (characterChoice.Life <= 0)
                {
                    Console.WriteLine("You have been slain by the {0}!",
                                      enemy.Name);
                    Environment.Exit(0);
                }
                while (!battleExit && !death)
                {
                    ;
                }
            } while (battleExit);
            //Victory and progression
            #endregion
            Console.ForegroundColor = ConsoleColor.DarkYellow;
            #region Tortoise in the Kitchen
            Console.WriteLine("The beast lays dead at your feet. You turn from your fallen foe in the conservatory and begin descending down a flight of stairs. You end up in candlelit kitchen. The walls are a seemlingly cream color and the shadows of thick cobwebs swing in the candlelight. The window over the empty sink shows that it is completely dark outside which brings new feelings of isolation. You hear a crunch behind and when you turn around, you see a tortoise on the counter with a half eaten apple in front of it . . .");
            Console.ReadLine();
            Console.Clear();



            Console.WriteLine("Hmmm I'm Po. Could you do an ol' tortoise a favor and reach out that window and tell me the temperature outside(Fahrenheit)?");

            string celcs = Console.ReadLine();
            int    numb  = -1;
            if (!int.TryParse(celcs, out numb))
            {
                Console.WriteLine("Don't understand weather? mmmm");
            }

            else
            {
                int temper = int.Parse(celcs);

                int tempConvert = temper - 32 / (9 / 5);
                Console.WriteLine("So {0} degrees Celsius then. Hmmm. Too chilly for my liking. The tarantula who lives in the corner doesn't seem to mind, seeing as it's been hanging out in the bush under the window\nHumored a tortoise (+2 to health)", tempConvert);
                characterChoice.Life += 2;
            }

            Console.ReadLine();
            Console.Clear();
            //Change Converter
            Console.WriteLine("Not to get too personal, but hmmm how much money do you have on you? (example: 5.36, 8.50, 4, etc.)");


            string  userEntry = Console.ReadLine();
            decimal num;
            if (!Decimal.TryParse(userEntry, out num))
            {
                Console.WriteLine("Hmmm that is not quite what I was looking for . . .");
                Console.ReadLine();
                Console.Clear();
            }
            else
            {
                decimal dollars = Convert.ToDecimal(userEntry);
                int     quarters, dimes, nickels, pennies;

                quarters = (int)(dollars / .25m);
                dollars  = dollars % .25m;

                dimes   = (int)(dollars / .10m);
                dollars = dollars % .10m;


                nickels = (int)(dollars / .05m);
                dollars = dollars % .05m;

                pennies = (int)(dollars / .01m);

                Console.WriteLine($"Hmmm so {quarters} quarters, {dimes} dimes, {nickels} nickels, and {pennies} pennies. I love counting change. \nHumored a tortoise (+2 to health)");
                characterChoice.Life += 2;
                Console.ReadLine();
                Console.Clear();
            }


            DateTime turtleBirth = new DateTime(1902, 06, 15, 09, 56, 0);
            DateTime turtleNow   = DateTime.Now;
            TimeSpan turtleTime  = turtleNow.Subtract(turtleBirth);
            Console.WriteLine("Hmmm You told me quite a bit of personal information about yourself so hmmm it'd only be fair if I shared a bit of personal information with you. I was born June 15, 1902. As of today, I am {0} days and {1} hour{2} old.",
                              turtleTime.Days,
                              turtleTime.Hours,
                              turtleTime.Hours == 1 ? "" : "s");
            Console.ReadLine();
            Console.Clear();

            Console.WriteLine("Thank you for humoring an ol' tortoise. You're very very kind. I hope you find what you're looking for. Hmmm also who are you again and why are in this house?");

            Console.ReadLine();
            Console.Clear();

            Console.WriteLine("You leave the inquisitive tortoise on the counter and walk into the livng room. A mustard yellow floral couch sits in front of a small wooden coffee table. You can see a bright yellow door with a stenciled-in brick pattern beyond the living room. You have a deep apprehension to go out into the night. As you weigh your options, two legs covered in striped leggings unravel from under the couch and twist around each of your legs like pythons. A screech echos through the living room and a dark shadow forms in the wall. Something evil is here . . .");

            Console.ReadLine();
            Console.Clear();
            #endregion

            #region Living Room Witch Battle
            Witch      w1 = new Witch("Wicked Western Witch", 15, 15, 3, 3, 3, 6, "Only cruelty follows in her wake", 35);
            Witch      w2 = new Witch("Wicked Eastern Witch", 17, 17, 2, 3, 2, 4, "Less cruel than her western sister, but more durable", 25);
            WitchGuard g1 = new WitchGuard("Witch Guard", 13, 13, 4, 2, 2, 5, "Defender of Witch Tyranny", 35);
            WitchGuard g2 = new WitchGuard("Witch Honor Guard", 15, 15, 5, 2, 2, 6, "Heavily armored personal witch guard", 51);

            Enemy[] enemies2 =
            {
                w1, w1, w2, w2, g1, g1, g2
            };

            Enemy enemy2 = enemies2[new Random().Next(enemies2.Length)];

            Console.WriteLine("It's a " + enemy2.Name + "!");
            bool battle2Exit = false;
            bool death2      = true;
            do
            {
                Console.WriteLine("Choose an action:\n" +
                                  "A)ttack \n" +
                                  "P)layer Stats \n" +
                                  "M)onster Stats \n" +
                                  "E)xit");


                ConsoleKey userChoice = Console.ReadKey(true).Key;
                Console.Clear();

                switch (userChoice)
                {
                case ConsoleKey.A:
                    Combat.DoBattle(characterChoice, enemy2);
                    if (enemy2.Life <= 0)
                    {
                        Console.WriteLine("You killed the {0}", enemy2.Name);
                        System.Threading.Thread.Sleep(2000);
                        Console.Clear();
                        battle2Exit = true;
                    }

                    break;

                case ConsoleKey.P:
                    Console.WriteLine(characterChoice);
                    break;

                case ConsoleKey.M:
                    Console.WriteLine(enemy2);
                    break;

                case ConsoleKey.E:
                    Console.WriteLine("Farewell...");
                    Environment.Exit(0);
                    break;

                default:
                    Console.WriteLine("Make a choice");
                    break;
                }

                if (p1.Life <= 0)
                {
                    Console.WriteLine("You have been slain by the {0}!",
                                      enemy2.Name);
                    Console.ReadLine();
                    Console.WriteLine("Game Over");
                    Environment.Exit(0);
                }
                while (!battle2Exit && !death2)
                {
                    ;
                }
            } while (!battle2Exit);

            //Console.WriteLine();
            #endregion

            #region Tornado Cutscene
            Console.ForegroundColor = ConsoleColor.DarkYellow;
            Console.WriteLine("Enough is enough. You kick the now weakened serpentine legs away and march towards the door. You grab the door ice cold door knob and twist it. The door, though only wooden, feels like it weighs 500 lbs as you strain to pull it open enough to step through. There is only darkness beyond it. When you step out, you feel the humid air. Warm wind hits your face. It is silent at first, but then it begins to howl louder and louder until eventually it sounds like a train in speeding through your forehead. The tornado . . . It took you away and brought you back. It was the cause of so many things . . . people you loved were scattered away . . . your mind . . . shattered . . . were you ever really here or there?");

            Console.ReadLine();
            Console.Clear();
            Console.ForegroundColor = ConsoleColor.DarkYellow;
            Console.WriteLine("Then a familiar woman's voice silences the roaring wind and echos in your mind. . . ");
            Console.ReadLine();
            Console.WriteLine(". . . Dorothy.");
            Console.ReadLine();
            Console.WriteLine("Am I here or am I back there? Or am I . . . in between?");
            Console.ReadLine();
            Console.Clear();

            #endregion

            #region The Wonderful Wizard
            Console.WriteLine("As you seem to fall deeper into the windy darkness, a small green star in dark appears. The green glow grows brighter and brighter until you begin to discern human features. It's an old bearded man's face and he's smiling.");
            Console.ReadLine();
            Console.Clear();
            Console.WriteLine("Hello again. You seem lost? Was the wish I granted you not enough? Are you still not satisfied? It's upsetting helping people only to watch them return time and time again.\nLife is relative. Everything is always out of reach . . . beyond the rainbow. Will you ever be whole? This I do not know. But you do interest me. Are you ready for another step down the endless road? Or are you finally ready to let go?");

            Console.ReadLine();

            do
            {
                Console.WriteLine("Choose an answer:\n" +
                                  "L)et go and embrace the inevitable\n" +
                                  "F)ocus\n" +
                                  "A)ttack him\n"
                                  );

                ConsoleKey wizardChoice = Console.ReadKey(true).Key;
                Console.Clear();
                Console.ForegroundColor = ConsoleColor.DarkYellow;

                switch (wizardChoice)
                {
                case ConsoleKey.L:

                    Console.WriteLine("You feel lighter and lighter as you fall deeper and deeper away.");
                    Console.ReadLine();
                    Console.WriteLine("The man's head smiles and fades away . . .");
                    Console.ReadLine();
                    Console.Clear();
                    Console.WriteLine("Your last thoughts are wondering where you will wake up. . .");
                    System.Threading.Thread.Sleep(3200);
                    Console.WriteLine("The End . . .");
                    Console.ReadLine();
                    Environment.Exit(0);
                    break;

                case ConsoleKey.F:
                    Console.WriteLine("When you open your mouth, no words come out. Fear overwhelms you as the old man begins to smile. When he smiles in front of you, a familiarity grows . . . Dorothy . . . the yellow brick door. . . endless road . . . the wish. You were just like this before . . .");
                    Console.ReadLine();
                    Console.Clear();

                    Console.WriteLine("You were with her, before you met him. You were supposed to be better now. But your loss . . . doesn't change the fact that you had good in you at one time. Remembering this awakens your senses. You find your voice again . . .");
                    Console.ReadLine();
                    Console.Clear();
                    Console.ForegroundColor = ConsoleColor.Cyan;
                    Console.WriteLine("I may have lost my gift, but I have not lost my resolve. I hate that I'm back to where I started, but I know even though I'm back to where I started, I have good intentions. And I will strive to maintain my character, no matter what physical or emotional setbacks I may face.");
                    Console.ReadLine();
                    Console.Clear();

                    Console.WriteLine("The Wizard stares a you and you even see a tear roll down his cheek as he begins to shrink. No matter what he was, he is gone. You feel a warmth you once knew. And knowing this warmth a second time makes you all the more gracious. You still see darkness, but you swear you can hear the straining ropes of a hot air balloon. You feel closer and closer to where everything made sense. And it fills you with joy . . .");

                    Console.ReadLine();

                    System.Threading.Thread.Sleep(3200);
                    Console.WriteLine("The End");
                    Console.ReadLine();
                    break;

                case ConsoleKey.A:
                    Console.WriteLine("You glare at the old man's head. How dare he kick you when you are down. It matters not what he has given you. It's broken now. It's all broken. Your frustration takes over and you rush towards his menacing green face . . .");
                    Console.ReadLine();
                    Wizard z1 = new Wizard("Wonderful Wizard", 32, 32, 7, 4, 4, 12, "Is he a benevolent god or a prideful demon?", true);
                    Wizard z2 = new Wizard("Old man behind the curtain", 8, 8, 2, 1, 1, 3, "The liar himself. Pitiful.", false);

                    Enemy[] enemies3 = { z1, z1, z1, z1, z1, z1, z1, z1, z1, z1, z1, z2 };

                    Enemy enemy3 = enemies3[new Random().Next(enemies3.Length)];      //Rare chance to face weak true form

                    Console.WriteLine("It's a " + enemy3.Name + "!");
                    bool battle3Exit = false;
                    bool death3      = true;
                    do
                    {
                        Console.WriteLine("Choose an action:\n" +
                                          "A)ttack \n" +
                                          "P)layer Stats \n" +
                                          "M)onster Stats \n" +
                                          "E)xit");


                        ConsoleKey userChoice = Console.ReadKey(true).Key;
                        Console.Clear();

                        switch (userChoice)
                        {
                        case ConsoleKey.A:
                            Combat.DoBattle(characterChoice, enemy3);
                            if (enemy3.Life <= 0)
                            {
                                Console.WriteLine("You killed the {0}", enemy3.Name);
                                System.Threading.Thread.Sleep(2000);
                                Console.Clear();
                                battle3Exit = true;
                            }

                            break;

                        case ConsoleKey.P:
                            Console.WriteLine(characterChoice);
                            break;

                        case ConsoleKey.M:
                            Console.WriteLine(enemy3);
                            break;

                        case ConsoleKey.E:
                            Console.WriteLine("Farewell...");
                            Environment.Exit(0);
                            break;

                        default:
                            Console.WriteLine("Make a choice");
                            break;
                        }

                        if (p1.Life <= 0)
                        {
                            Console.WriteLine("Your existence has been vaporized by the {0}!",
                                              enemy3.Name);
                            Console.ReadLine();
                            Console.WriteLine("Game Over");
                            Environment.Exit(0);
                        }
                        while (!battle3Exit && !death3)
                        {
                            ;
                        }
                    } while (!battle3Exit);
                    Console.WriteLine("You watch as fear enters his face, mirroring your own.The old man screams and bellows smoke from his mouth, covering his features. Soon his cries are drowned out by the stormy wind. When the smoke clears you see. . .");
                    System.Threading.Thread.Sleep(5400);
                    Console.ForegroundColor = ConsoleColor.Green;
                    Console.WriteLine("yourself");
                    System.Threading.Thread.Sleep(3600);
                    Console.WriteLine("In a moment you are sent beaming through the universe, unimaginable energy flowing through your veins. You know you've lost something dear . . . but the exhilaration is too strong. You're an all powerful wizard now and so, you think. . . it matters not.");
                    System.Threading.Thread.Sleep(4000);
                    Console.WriteLine("The End");
                    Environment.Exit(0);
                    break;
                }
            } while (!exit);

            #endregion

            //Need to Do
            //Make Final Boss Fight Clean

            //Ideas for Additional Content
            //Add Dorothy as a hidden playable character who overwrites the current characterChoice
        }
Пример #38
0
		void onCutPuzzle (object sender, Crow.MouseButtonEventArgs e)
		{
			mainMenu.Visible = false;
			currentState = GameState.CutStart;
		}
Пример #39
0
 void Awake()
 {
     animator     = GetComponent <Animator>();
     crow         = GetComponentInParent <Crow>();
     crowMovement = GetComponentInParent <CrowMovement>();
 }
Пример #40
0
		void onImageClick (object sender, Crow.MouseButtonEventArgs e){			
			if (imgSelection == null) {
				imgSelection = CrowInterface.LoadInterface ("#Opuz2015.ui.ImageSelect.goml");
				imgSelection.DataSource = this;
			}
			imgSelection.Visible = true;
			mainMenu.Visible = false;
		}
Пример #41
0
        private void MainBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            // Determinar en Que pagina Estoy.
            // Tomar Desicion // CASE
            // Darle a Pagina Anterior.
            if (cbGetCases.Checked)
            {
                int Activity = 0;

                var WPDoc        = new HtmlAgilityPack.HtmlDocument();
                var doc          = ((MainForm)Application.OpenForms[0]).MainBrowser.Document;
                var renderedHtml = doc.GetElementsByTagName("HTML")[0].OuterHtml;
                WPDoc.LoadHtml(renderedHtml);

                var SearchBtn    = doc.GetElementById("ctl00$cphBody$cmdSearch");
                var CancelBtn    = doc.GetElementById("ctl00$cphBody$cmdClear");
                var ViewElements = doc.GetElementById("cphBody_cmbPageSize");

                if (SearchBtn != null && CancelBtn != null)
                {
                    Activity = 1;
                }

                if (ViewElements != null)
                {
                    if (ViewElements.OuterHtml.IndexOf("selected=\"selected\" value=\"All\">") > 0)
                    {
                        Activity = 3;
                    }
                    else
                    {
                        Activity = 2;
                    }
                }

                if (renderedHtml.Contains("Modify your search criteria by selecting the Search Criteria tab"))
                {
                    Activity = 4;
                }

                switch (Activity)
                {
                //ctl00$cphBody$gvSearch$ctl09$txtParameter: 01 / 01 / 2013
                //ctl00$cphBody$gvSearch$ctl10$txtParameter: 02 / 01 / 2013
                //ctl00$cphBody$gvSearch$ctl11$cmbParameterPostBack: 101
                //ctl00$cphBody$gvSearch$ctl12$cmbParameterNoPostBack: 146
                //ctl00$cphBody$gvSearch$ctl13$cmbParameterNoPostBack: 96

                case 1:
                {
                    var BeginDate = doc.GetElementById("cphBody_gvSearch_txtParameter_7");
                    var EndDate   = doc.GetElementById("cphBody_gvSearch_txtParameter_8");
                    var CourtType = doc.GetElementById("cphBody_gvSearch_cmbParameterPostBack_9");
                    CourtType.SetAttribute("Value", "101");
                    var CaseType = doc.GetElementById("cphBody_gvSearch_cmbParameterNoPostBack_10");
                    Thread.Sleep(2000);
                    // var SearchDate = GetMeDate();
                    SelectNewDayRange();
                    BeginDate.SetAttribute("Value", StartDay.ToString("MM/dd/yyyy"));
                    EndDate.SetAttribute("Value", EndDay.ToString("MM/dd/yyyy"));

                    CaseType.SetAttribute("Value", "146");

                    SearchBtn.InvokeMember("Click");
                    logclick("Search");
                    break;
                }

                case 2:
                {
                    ViewElements.SetAttribute("Value", "All");
                    ViewElements.InvokeMember("onChange");
                    // MainBrowser.Refresh(WebBrowserRefreshOption.Completely);
                    logclick("Search");
                    break;
                }

                case 3:
                {
                    PalmCaseInfoClass CInfo = new PalmCaseInfoClass();
                    CInfo.County = County;
                    // Tomar Casos en el Dia;
                    var CasosDiaStr = doc.GetElementById("cphBody_lblRecordsReturned");
                    if (CasosDiaStr != null)
                    {
                        CInfo.NumberOfCases = Convert.ToInt32(CasosDiaStr.InnerText);
                        var wrkint = CInfo.NumberOfCases;
                        if (wrkint == 200)
                        {
                            StartDay.AddDays(AdicionarDias * -1);
                            StartDay.AddDays(-1);
                            EndDay = StartDay;
                            EndDay.AddDays(AdicionarDias);
                            AdicionarDias = AdicionarDias - 3;
                            MainBrowser.Navigate("https://applications.mypalmbeachclerk.com/eCaseView/search.aspx");
                            logclick("Main Page");
                            break;
                        }
                        else
                        {
                            var casosxdia = wrkint / AdicionarDias;
                            var amplitud  = casosxdia * 3;
                            var cabe      = (200 - amplitud);
                            if (wrkint > cabe)
                            {
                                AdicionarDias++;
                            }
                        }
                    }

                    var TablaCasos   = WPDoc.GetElementbyId("cphBody_gvResults");
                    var CasesInfoRow = TablaCasos.Descendants("tr").ToList();
                    foreach (var Crow in CasesInfoRow)
                    {
                        if (!Crow.InnerText.Contains("Arrest Date"))
                        {
                            var      CasesInfoColumn = Crow.Descendants("td").ToList();
                            int      Num             = 0;
                            string[] AColInfo        = new string[7];
                            foreach (var Ccol in CasesInfoColumn)
                            {
                                AColInfo[Num] = Ccol.InnerText;
                                Num++;
                            }
                            pbICases WC = new pbICases();
                            WC.CaseNumber = AColInfo[0];
                            WC.Courts     = AColInfo[1];
                            WC.CaseType   = AColInfo[2];
                            try
                            {
                                WC.FileDate = Convert.ToDateTime(AColInfo[4]);
                            }
                            catch
                            {
                                WC.FileDate = Convert.ToDateTime("2008-01-01");
                            }

                            if (!string.IsNullOrEmpty(AColInfo[5]))
                            {
                                if (AColInfo[5].IndexOf(" V ") > 0)
                                {
                                    WC.PrimaryParty   = AColInfo[5].Substring(0, AColInfo[5].IndexOf(" V "));
                                    WC.SecondaryParty = AColInfo[5].Substring(AColInfo[5].IndexOf(" V ") + 3);
                                }
                                else
                                {
                                    WC.PrimaryParty   = AColInfo[5];
                                    WC.SecondaryParty = AColInfo[5];
                                }
                            }

                            WC.CaseStatus = AColInfo[6];

                            CInfo.ListaCasos.Add(WC);
                            CInfo.FileDate = WC.FileDate;
                        }
                    }

                    // Salvar en Async y Threadding.
                    SaveCases(CInfo);
                    // Slow the speed
                    Thread.Sleep(24000);


                    // cphBody_lbSearch  // Volver a la pantalla de Busqueda
                    //var SearchLink = doc.GetElementById("ctl00$cphBody$cmdSearch");
                    //SearchBtn.InvokeMember("Click");
                    MainBrowser.Navigate("https://applications.mypalmbeachclerk.com/eCaseView/search.aspx");
                    logclick("Main Page");
                    break;
                }

                case 4:
                {
                    MainBrowser.Navigate("https://applications.mypalmbeachclerk.com/eCaseView/search.aspx");
                    logclick("Main Page");
                    break;
                }
                }
            }
        }
Пример #42
0
 void Start()
 {
     crow = GetComponentInParent <Crow>();
     timeSinceSwitched = 0;
 }
Пример #43
0
 private float DistanceTo(Crow boid)
 {
     return(Vector3.Distance(boid.transform.position, Position));
 }
Пример #44
0
 public CrowState_FlyingToCorn()
 {
     mStateID = CrowStates.FlyingToCorn;
     mCrow = GameObject.FindObjectOfType( typeof( Crow ) ) as Crow;
 }
Пример #45
0
    // Update is called once per frame
    void Update()
    {
        horizontal = Input.GetAxis("Horizontal");
        vertical   = Input.GetAxis("Vertical");

        Vector2 move = new Vector2(horizontal, vertical);

        if (!Mathf.Approximately(move.x, 0.0f) || !Mathf.Approximately(move.y, 0.0f))
        {
            lookDirection.Set(move.x, move.y);
            lookDirection.Normalize();
        }

        animator.SetFloat("Look X", lookDirection.x);
        animator.SetFloat("Look Y", lookDirection.y);
        animator.SetFloat("Speed", move.magnitude);

        if (Input.GetKeyDown(KeyCode.C))
        {
            if (hasUnlimitedPower)
            {
                ThrowFireball();
            }
            if (!hasUnlimitedPower && ammoNumber > 0)
            {
                Launch();
            }
        }
        if (Input.GetKeyDown(KeyCode.F))
        {
            RaycastHit2D hit = Physics2D.Raycast(rigidbody2d.position + Vector2.up * 0.2f, lookDirection, 1.5f, LayerMask.GetMask("NPC"));
            if (hit.collider != null)
            {
                NPC         jambi  = hit.collider.GetComponent <NPC>();
                Crow        crow   = hit.collider.GetComponent <Crow>();
                ClosedChest chest  = hit.collider.GetComponent <ClosedChest>();
                WizardNPC   wizard = hit.collider.GetComponent <WizardNPC>();
                Sheep       sheep  = hit.collider.GetComponent <Sheep>();
                if (jambi != null)
                {
                    jambi.DisplayDialog(itemsClefs["cheese"]);
                }
                if (crow != null)
                {
                    crow.DeliverItem();
                }
                if (chest != null)
                {
                    chest.OpenChest();
                }
                if (wizard != null)
                {
                    wizard.DisplayDialog(isWorthy());
                }
                if (sheep != null)
                {
                    sheep.DeliverItem(itemsClefs["key"]);
                }
            }
        }
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            menuPause.SetActive(true);
        }

        if (hasFinishedTheGame)
        {
            float time = 10;
            time -= Time.deltaTime;
            if (time <= 0)
            {
                menuPause.SetActive(true);
            }
        }
    }
Пример #46
0
        static void Main(string[] args)
        {
            try
            {
                Car myObj1 = new Car();
                Car myObj2 = new Car();
                Console.WriteLine(myObj1.color);
                Console.WriteLine(myObj2.color);

                Vehicle Ford = new Vehicle();
                Ford.model = "Mustang";
                Ford.color = "blue";
                Ford.year  = 1969;

                Vehicle Opel = new Vehicle();
                Opel.model = "Astra";
                Opel.color = "white";
                Opel.year  = 2005;

                Console.WriteLine(Ford.model);
                Console.WriteLine(Opel.model);

                //Object Members
                Bike myBike = new Bike();
                myBike.fullThrottle();

                //Using constructor
                Truck Man = new Truck("Mustang", "Red", 1969);
                Console.WriteLine(Man.color + " " + Man.year + " " + Man.model);

                //Test for private access modifier
                TestForPrivateAccess myTest = new TestForPrivateAccess();
                Person testPerson           = new Person();
                Console.WriteLine("Not able to call the method myTest.model as it is a private variable in its class");
                Console.WriteLine(testPerson.Name);

                //Automatic properties
                Person myPerson = new Person();
                myPerson.Name = "Liam";
                Console.WriteLine(myPerson.Name);

                //Testing for inheritance
                Car myCar = new Car();

                myCar.honk();
                Console.WriteLine(myCar.brand + " " + myCar.modelName);

                //Testing for polymorphism
                Animal myAnimal = new Animal(); // Create a Animal object
                Animal myPig    = new Pig();    // Create a Pig object
                Animal myDog    = new Dog();    // Create a Dog object

                myAnimal.animalSound();
                myPig.animalSound();
                myDog.animalSound();

                //Testing for abstraction
                Crow myCrow = new Crow(); // Create a Pig object
                myCrow.birdSound();       // Call the abstract method
                myCrow.sleep();           // Call the regular method

                //Using Interface
                DemoClass myDemo = new DemoClass();
                myDemo.myMethod();
                myDemo.myOtherMethod();

                //Using enum in a switch condition
                Level myVar = Level.Medium;
                switch (myVar)
                {
                case Level.Low:
                    Console.WriteLine("Low level");
                    break;

                case Level.Medium:
                    Console.WriteLine("Medium level");
                    break;

                case Level.High:
                    Console.WriteLine("High level");
                    break;
                }

                //Writing to a file and reading it
                string writeText = "Hello World!";                  // Create a text string
                File.WriteAllText("filename.txt", writeText);       // Create a file and write the content of writeText to it

                string readText = File.ReadAllText("filename.txt"); // Read the contents of the file
                Console.WriteLine(readText);                        // Output the content

                //Testing for exceptions
                int[] myNumbers = { 1, 2, 3 };
                Console.WriteLine(myNumbers[10]);

                //Testing the throw keyword
                checkAge(15);
            }
            catch (Exception e)
            {
                Console.WriteLine("Something went wrong.");
            }

            finally
            {
                Console.WriteLine("The 'try catch' is finished.");
            }