コード例 #1
0
        static void Main(string[] args)
        {
            string buster = "Buster damage = +10";

            string zSaber = "Zsaber damage = +20";

            Megaman mega = new Megaman();

            Zero zero = new Zero();


            Console.WriteLine();
            Console.WriteLine("MEGAMAN AND ZERO ATTRIBUTES");
            Console.WriteLine();
            Console.WriteLine();

            Console.WriteLine(mega.Attack());
            Console.WriteLine();
            Console.WriteLine($"{buster}");
            Console.WriteLine();
            Console.WriteLine(mega.Run());
            Console.WriteLine();
            Console.WriteLine(mega.Jump());

            Console.WriteLine();
            Console.WriteLine();

            Console.WriteLine(zero.Attack());
            Console.WriteLine();
            Console.WriteLine($"{zSaber}");
            Console.WriteLine();
            Console.WriteLine(zero.Run());
            Console.WriteLine();
            Console.WriteLine(zero.Jump());
        }
コード例 #2
0
        public void MegamanComChipNivel2NaoTemAlteracaoNoAtaque()
        {
            var megaman = new Megaman();
            var bot     = new Bot();

            megaman.Atacar(bot);

            Assert.AreEqual(94, bot.Vida);
        }
コード例 #3
0
        public void MegamanComChipNivel1TemAtaque5()
        {
            var megaman = new Megaman(Chip.Nivel1);
            var bot     = new Bot();

            megaman.Atacar(bot);

            Assert.AreEqual(95, bot.Vida);
        }
コード例 #4
0
        public void MegamanTemEhCriadoCom6DeAtaque()
        {
            var megaman = new Megaman();
            var bot     = new Bot();

            megaman.Atacar(bot);

            Assert.AreEqual(94, bot.Vida);
        }
コード例 #5
0
        public void RushNaoCausaDanoDeCombateEmMegaman()
        {
            var rush    = new Rush();
            var megaman = new Megaman();

            rush.Atacar(megaman);

            Assert.AreEqual(100, megaman.Vida);
        }
コード例 #6
0
        public void MegamanToString()
        {
            var megaman = new Megaman();

            Assert.AreEqual(
                "Vida: 100, Ataque: 6, Defesa: 0",
                megaman.ToString()
                );
        }
コード例 #7
0
        public void MegamanComCanhaoDePlasmaTemAtaque8()
        {
            var megaman = new Megaman();
            var bot     = new Bot();

            megaman.EquiparUpgrade(new CanhaoDePlasma());
            megaman.Atacar(bot);

            Assert.AreEqual(92, bot.Vida);
        }
コード例 #8
0
        public void MegamanTemMenosDe30DeVidaCausa9NoAtaque()
        {
            var megaman = new Megaman();
            var bot     = new Bot();

            megaman.ReceberAtaque(71);
            megaman.Atacar(bot);

            Assert.AreEqual(91, bot.Vida);
        }
コード例 #9
0
        static void Main(string[] args)
        {
            Megaman megaman = new Megaman();

            Console.WriteLine($"{megaman.personagem} {megaman.Correr()}");

            Zero zero = new Zero();

            Console.WriteLine($"{zero.personagem} {zero.Correr()}");
        }
コード例 #10
0
        static void Main(string[] args)
        {
            Megaman jogador = new Megaman();

            Zero jogador2 = new Zero();

            Console.WriteLine($"MEGAMAN - {jogador.Correr()}");
            Console.WriteLine($"ZERO - {jogador2.Correr()}");
            Console.WriteLine($"MEGAMAN - {jogador.Pular()}");
            Console.WriteLine($"ZERO - {jogador2.Pular()}");
        }
コード例 #11
0
        public void MegamanComCanhaoDePlasmaEMenosDe30DeVidaCausa11DeDano()
        {
            var megaman = new Megaman();
            var bot     = new Bot();

            megaman.EquiparUpgrade(new CanhaoDePlasma());
            megaman.ReceberAtaque(71);
            megaman.Atacar(bot);

            Assert.AreEqual(89, bot.Vida);
        }
コード例 #12
0
        public void MegamanToStringComMenosDe30DeVida()
        {
            var megaman = new Megaman();

            megaman.ReceberAtaque(71);

            Assert.AreEqual(
                "Vida: 29, Ataque: 6, Defesa: 0",
                megaman.ToString()
                );
        }
コード例 #13
0
ファイル: RushTest.cs プロジェクト: LucasKauer/crescer-2016-1
        public void RushEquipandoMegamanConcede3DeDefesa()
        {
            var rush    = new Rush();
            var megaman = new Megaman();
            var bot     = new Bot();

            megaman.EquiparUpgrade(rush);
            bot.Atacar(megaman);

            Assert.AreEqual(98, megaman.Vida);
        }
コード例 #14
0
ファイル: RushTest.cs プロジェクト: LucasKauer/crescer-2016-1
        public void RushComEscudoDeEnergiaConcede3DeDefesa()
        {
            var rush    = new Rush();
            var megaman = new Megaman();
            var bot     = new Bot();

            rush.EquiparUpgrade(new EscudoDeEnergia());
            megaman.EquiparUpgrade(rush);
            bot.Atacar(megaman);

            Assert.AreEqual(98, megaman.Vida);
        }
コード例 #15
0
ファイル: RushTest.cs プロジェクト: LucasKauer/crescer-2016-1
        public void RushEquipandoMegamanConcede4DeAtaque()
        {
            var rush    = new Rush();
            var megaman = new Megaman();
            var bot     = new Bot();

            megaman.EquiparUpgrade(rush);

            megaman.Atacar(bot);

            Assert.AreEqual(90, bot.Vida);
        }
コード例 #16
0
        protected override void LoadContent()
        {
            base.LoadContent();

            this.CustomDrawing += ChainOfResponsibilityGame_CustomDrawing;

            this.character = new Megaman(Content.Load <Texture2D>("Megaman"), new Vector2(40, 100));

            this.normalCharger = new NormalCharger(character);
            this.ultraCharger  = new UltraCharger(character);

            this.normalCharger.Next = this.ultraCharger;
        }
コード例 #17
0
ファイル: RushTest.cs プロジェクト: LucasKauer/crescer-2016-1
        public void RushComCanhaoDePlasmaConcede6DeAtaque()
        {
            var rush    = new Rush();
            var megaman = new Megaman();
            var bot     = new Bot();

            rush.EquiparUpgrade(new CanhaoDePlasma());

            megaman.EquiparUpgrade(rush);
            megaman.Atacar(bot);

            Assert.AreEqual(88, bot.Vida);
        }
コード例 #18
0
        static void Main(string[] args)
        {
            Megaman mega = new Megaman();

            Console.WriteLine("MegaMan");
            mega.Correr();
            mega.Pular();


            Zero zero = new Zero();

            Console.WriteLine("Zero");
            zero.Correr();
            zero.Pular();
        }
コード例 #19
0
 public MegamanLargeState(Megaman megaman)
 {
     this.megaman = megaman;
 }
コード例 #20
0
 // Use this for initialization
 void Start()
 {
     mov    = GameObject.FindGameObjectWithTag("MovingPlat").GetComponent <MovingPlat>();
     player = gameObject.GetComponentInParent <Megaman>();
 }
コード例 #21
0
 public MegamanIdleState(Megaman megaman)
     : base(megaman)
 {
 }
コード例 #22
0
ファイル: HealthDisplay.cs プロジェクト: tgray6/Megaman
 private void Awake()
 {
     megaman = FindObjectOfType <Megaman>();
 }
コード例 #23
0
        static void Main(string[] args)
        {
            Megaman X = new Megaman();

            X.Correr();
        }
コード例 #24
0
 public MegamanFalconState(Megaman megaman)
 {
     this.megaman = megaman;
 }
コード例 #25
0
 public MegamanActionStateMachine(Megaman megaman)
 {
     this.megaman = megaman;
 }
コード例 #26
0
ファイル: MainGameForm.cs プロジェクト: cuongledn99/uit-war
        private void ProcessData(SocketData data)
        {
            switch (data.Command)
            {
            case (int)SocketCommand.START_GAME:
                this.Invoke((MethodInvoker)(() =>
                {
                    btMegaman.Show();
                    btKnight.Show();
                    btHulk.Show();
                    btHealingSpell.Show();
                    timer1.Start();
                    timer_increase_money.Start();
                }));
                break;

            case (int)SocketCommand.NOTIFY:
                MessageBox.Show(data.Message);
                break;

            case (int)SocketCommand.NEW_GAME:
                break;

            case (int)SocketCommand.SEND_POINT:
                //use,no care
                this.Invoke((MethodInvoker)(() =>
                {
                    if (data.Current == CurrentItem.SpellHeal)
                    {
                        Spell spell = null;
                        switch (data.Current)
                        {
                        case CurrentItem.SpellHeal:
                            spell = new Heal(!Const.currentTeam);
                            break;
                        }
                        //set current location of spell received
                        spell.CurrentLocation = data.Point;
                        //add spell to list spell
                        Const.listSpells.Add(spell);
                    }
                    else
                    {
                        Trop trop = null;
                        switch (data.Current)
                        {
                        case CurrentItem.Knight:
                            trop = new Knight(!Const.currentTeam);
                            break;

                        case CurrentItem.Megaman:
                            trop = new Megaman(!Const.currentTeam);
                            break;

                        case CurrentItem.Hulk:
                            trop = new Hulk(!Const.currentTeam);
                            break;
                        }
                        //set current location of trop received
                        trop.CurrentLocation = data.Point;
                        //add trop to list trop
                        Const.listTrops.Add(trop);
                    }
                }));
                break;

            case (int)SocketCommand.UNDO:
                break;

            case (int)SocketCommand.END_GAME:
                this.Invoke((MethodInvoker)(() =>
                {
                    timer1.Stop();
                    timer_increase_money.Stop();
                    MessageBox.Show("You lose");
                    this.Close();
                    Program.login.Show();
                }));
                break;

            case (int)SocketCommand.QUIT:
                this.Invoke((MethodInvoker)(() =>
                {
                    MessageBox.Show("Đối thủ đã thoát");
                    //SocketManager.CloseConnection();
                    this.Close();
                    Program.login.Show();

                    //Program.main = null;
                }));
                break;

            default:
                break;
            }

            Listen();
        }
コード例 #27
0
ファイル: MainGameForm.cs プロジェクト: cuongledn99/uit-war
        private void Form1_MouseClick(object sender, MouseEventArgs e)
        {
            //drop spell
            if (currentItem == CurrentItem.SpellHeal)
            {
                Spell spell = null;
                switch (currentItem)
                {
                case CurrentItem.SpellHeal:
                    spell = new Heal(Const.currentTeam);
                    break;
                }
                if (availableMoney >= spell.Price)
                {
                    //decrease available money
                    availableMoney -= spell.Price;
                    UpdateMoney();
                    spell.CurrentLocation = new Point(e.X - 23, e.Y - 23);
                    //send current spell type and its position to rival
                    Program.socket.Send(new SocketData((int)SocketCommand.SEND_POINT, currentItem, spell.CurrentLocation));
                    //add spell to list spell
                    Const.listSpells.Add(spell);
                }
            }
            //drop trop
            else
            {
                //set curren trop type
                Trop trop = null;
                switch (currentItem)
                {
                case CurrentItem.Knight:
                    trop = new Knight(Const.currentTeam);
                    break;

                case CurrentItem.Megaman:
                    trop = new Megaman(Const.currentTeam);
                    break;

                case CurrentItem.Hulk:
                    trop = new Hulk(Const.currentTeam);
                    break;
                }
                //set trop location base on clicked point
                //only allow drop trop at specific location
                //and enough money
                try
                {
                    if (((e.Y >= 124 && e.Y <= 211) || (e.Y >= 307 && e.Y <= 374) || (e.Y >= 476 && e.Y <= 541)) &&
                        (Const.currentTeam ? e.X < 365 : e.X > 430) &&
                        availableMoney >= trop.Price)
                    {
                        //decrease available money
                        availableMoney -= trop.Price;
                        UpdateMoney();
                        //lane 1
                        if (e.Y >= 124 && e.Y <= 211)
                        {
                            trop.CurrentLocation = new Point(e.X, 111);
                        }
                        //lane 2
                        else if (e.Y >= 307 && e.Y <= 374)
                        {
                            trop.CurrentLocation = new Point(e.X, 275);
                        }
                        //lane 3
                        else if (e.Y >= 476 && e.Y <= 541)
                        {
                            trop.CurrentLocation = new Point(e.X, 444);
                        }
                        //send current trop type and its position to rival
                        Program.socket.Send(new SocketData((int)SocketCommand.SEND_POINT, currentItem, trop.CurrentLocation));
                        //add trop to listTrops
                        Const.listTrops.Add(trop);
                    }
                }
                catch { }
                //MessageBox.Show(e.X + "-" + e.Y);
            }
            //MessageBox.Show(e.X + "-" + e.Y);
        }
コード例 #28
0
 public BlockNormalState(Block block, Megaman megaman)
 {
     this.block = block;
     this.megaman = megaman;
 }
コード例 #29
0
 public BlockCollidingState(Block block, Megaman megaman)
 {
     this.block = block;
     this.megaman = megaman;
     initialPosition = new Vector2();
 }
コード例 #30
0
 // Start is called before the first frame update
 void Start()
 {
     player = GameObject.FindGameObjectWithTag("Player").GetComponent <Megaman>();
 }
コード例 #31
0
 void Start()
 {
     megaman = gameObject.GetComponentInParent <Megaman>();
 }
コード例 #32
0
 public MegamanFallingState(Megaman megaman)
     : base(megaman, ActionState.Falling)
 {
 }
コード例 #33
0
 public MegamanJumpingState(Megaman megaman)
     : base(megaman)
 {
 }
コード例 #34
0
 public BlockStateMachine(Block block, Megaman megaman)
 {
     this.block = block;
     this.megaman = megaman;
 }
コード例 #35
0
 public MegamanActionState(Megaman megaman, ActionState defaultNextActionState)
     : this(megaman)
 {
     this.defaultNextActionState = defaultNextActionState;
     nextActionState = defaultNextActionState;
 }
コード例 #36
0
 public MegamanSmallState(Megaman megaman)
 {
     this.megaman = megaman;
 }
コード例 #37
0
 public MegamanZeroState(Megaman megaman)
 {
     this.megaman = megaman;
 }
コード例 #38
0
 public MegamanRunningState(Megaman megaman)
     : base(megaman)
 {
 }
コード例 #39
0
 public MegamanPowerUpStateMachine(Megaman megaman)
 {
     this.megaman = megaman;
     states = new Dictionary<MegamanState, IMegamanPowerUpState>();
 }