示例#1
0
 // Die by collision
 public static void OnCollisionEnter2D(string Obj)
 {
     Mermaid.OnCollisionEnter2D("Player");
     //ShellStart.OnCollisionEnter2D("shell");
     if (Obj.CompareTo("Blue") == 0)
     {
         Score.UpScore();
         Score.UpScore();
     }
     else if (Obj.CompareTo("Yellow") == 0)
     {
         Score.UpScore();
     }
     else if (Obj.CompareTo("Pearl") == 0)
     {
         Score.UpScore();
         Score.UpScore();
         Score.UpScore();
         Score.UpScore();
         Score.UpScore();
         Score.UpScore();
     }
     else if (Obj.CompareTo("Jelly") == 0)
     {
         Die();
     }
 }
示例#2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            Animal[] animals = new Animal[5];
            ISpeak[] Speaker = new ISpeak[4];

            Manticore ElPapi = new Manticore {
                Name = "ElPapi", Diet = "Blood and Bones", Lift = (1000 * 32.17), Intro = "I am ElPapi"
            };
            Mermaid KanyeBass = new Mermaid {
                Name = "KanyeBass", Diet = "FishSticks", IsIntelligent = false, Intro = "I love FishSticks"
            };
            Eagle Freedom = new Eagle {
                Name = "Freedom", HasFins = false, NumWings = 50, Lift = 1817, Diet = "Worms"
            };
            Rhino Rocksteady = new Rhino {
                Name = "Rocksteady", NumOfLegs = 4, Diet = "Meat and more meat", Intro = "I'm gonna crush those pesky ninja turtles"
            };
            Dragon Oenomaus = new Dragon {
                Name = "Oenomaus", IsIntelligent = true, Intro = "Im a DAWG BOWWWWWWW", Diet = "All meat baby", HasTeeth = true
            };

            Speaker[0] = ElPapi;
            Speaker[1] = KanyeBass;
            Speaker[2] = Rocksteady;
            Speaker[3] = Oenomaus;

            animals[0] = ElPapi;
            animals[1] = KanyeBass;
            animals[2] = Freedom;
            animals[3] = Rocksteady;
            animals[4] = Oenomaus;

            for (int i = 0; i < Speaker.Length; i++)
            {
                var speakers = Speaker[i];

                if (speakers is HasWings)
                {
                    var speakingWings = (HasWings)speakers;
                    speakingWings.ImFlying();
                }
                else if (speakers is NoWings)
                {
                    var grounded = (NoWings)speakers;
                    grounded.GroundBB();
                }
            }
            for (int i = 0; i < animals.Length; i++)
            {
                Console.WriteLine($"My name is {animals[i].Name} and I like to eat {animals[i].Diet}");
            }
        }
示例#3
0
        public void TestThatMermaidInheritsBehaviors()
        {
            Mermaid sesi = new Mermaid()
            {
                Name = "Sesi"
            };

            string input    = $"{sesi.Name} {sesi.IsAPet()}";
            string expected = $"{sesi.Name} Am I your pet?";

            Assert.Equal(expected, input);
        }
示例#4
0
    public static void ReturnSkill()
    {
        if (StatAll.stat[0, 0, Turns.order] == 2)
        {
            if (AttackSkill.skillnum == 1)
            {
                Mermaid.Skill_1_Area(target);
            }

            else if (AttackSkill.skillnum == 2)
            {
                Mermaid.Skill_2_Area(target);
            }
        }
    }
示例#5
0
    public void Target_all(int ID)
    {

        if (Attack.normal == true)
        {
           
            attack.SetActive(false);

            if (StatAll.stat[2, 2, Turns.order] >= StatAll.stat[4, 0, targetID[ID]])
            {
                StatAll.stat[3, 1, targetID[ID]] = StatAll.stat[3, 1, targetID[ID]] + (StatAll.stat[4, 0, targetID[ID]] - StatAll.stat[2, 2, Turns.order]);
                StatAll.stat[4, 0, targetID[ID]] = 0;
            }

            else
            {
                StatAll.stat[4, 0, targetID[ID]] = StatAll.stat[4, 0, targetID[ID]] - StatAll.stat[2, 2, Turns.order];
            }

        }

        else
        {
            if (StatAll.stat[0, 0, Turns.order] == 1)
            {
                Goblin.Skill_1(targetID[ID]);
            }

            if (StatAll.stat[0, 0, Turns.order] == 2)
            {
                if (AttackSkill.skillnum == 1)
                {
                    Mermaid.Skill_1(targetID[ID]);
                }

                else if (AttackSkill.skillnum == 2)
                {
                    Mermaid.Skill_2(targetID[ID]);
                }
            }

        }

        target.SetActive(false);
        targeting = false;     
    }
示例#6
0
文件: Program.cs 项目: mtncrawler/Zoo
        public static void Main(string[] args)
        {
            Console.WriteLine("Welcome to my World!");

            Vampire vampie = new Vampire {
                Name = "Drake", NumberOfBeatingHearts = 0
            };

            Console.WriteLine($"Vampire: {vampie.MyMotto()}");
            Console.WriteLine($"Vampire: {vampie.GoalInLife()}");
            Console.WriteLine();

            Mermaid merm = new Mermaid()
            {
                NumberOfGills = 4
            };

            Console.WriteLine($"Mermaid: Number of children = {merm.WhatAboutChildren()}");
            Console.WriteLine($"Mermaid: {merm.MyUniqueness()}");
            Console.WriteLine();

            Unicorn uni = new Unicorn();

            Console.WriteLine($"Unicorn: {uni.MagicalPower()}");
            Console.WriteLine($"Unicorn: I have {uni.HowManySpouses()} spouses.");
            Console.WriteLine($"Unicorn by interface: {uni.FlightCapability()}");
            Console.WriteLine($"Unicorn by interface: {uni.BirthPlace()}");
            Console.WriteLine();

            Centaur centie = new Centaur();

            Console.WriteLine($"Centaur: {centie.MagicalPower()}");
            Console.WriteLine($"Centaur by interface: {centie.BirthPlace()}");
            Console.WriteLine();

            Pegasus pegie = new Pegasus();

            Console.WriteLine($"Pegasus: {pegie.MagicalPower()}");
            Console.WriteLine($"Pegasus by interface: {pegie.FlightCapability()}");
            Console.WriteLine($"Pegasus by interface: {pegie.BirthPlace()}");
        }
示例#7
0
 public Ocean(int id)
 {
     Id          = id;
     ImageSource = "/Assets/FieldIcons/ocean.png";
     Monster     = new Mermaid(id);
 }
示例#8
0
        public void MermaidHasChildren()
        {
            Mermaid merm = new Mermaid();

            Assert.Equal("Hundreds!", merm.WhatAboutChildren());
        }
示例#9
0
        public void MermaidIsUnique()
        {
            Mermaid merm = new Mermaid();

            Assert.Equal("I can swim.I have arms.", merm.MyUniqueness());
        }