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()); }
public void MegamanComChipNivel2NaoTemAlteracaoNoAtaque() { var megaman = new Megaman(); var bot = new Bot(); megaman.Atacar(bot); Assert.AreEqual(94, bot.Vida); }
public void MegamanComChipNivel1TemAtaque5() { var megaman = new Megaman(Chip.Nivel1); var bot = new Bot(); megaman.Atacar(bot); Assert.AreEqual(95, bot.Vida); }
public void MegamanTemEhCriadoCom6DeAtaque() { var megaman = new Megaman(); var bot = new Bot(); megaman.Atacar(bot); Assert.AreEqual(94, bot.Vida); }
public void RushNaoCausaDanoDeCombateEmMegaman() { var rush = new Rush(); var megaman = new Megaman(); rush.Atacar(megaman); Assert.AreEqual(100, megaman.Vida); }
public void MegamanToString() { var megaman = new Megaman(); Assert.AreEqual( "Vida: 100, Ataque: 6, Defesa: 0", megaman.ToString() ); }
public void MegamanComCanhaoDePlasmaTemAtaque8() { var megaman = new Megaman(); var bot = new Bot(); megaman.EquiparUpgrade(new CanhaoDePlasma()); megaman.Atacar(bot); Assert.AreEqual(92, bot.Vida); }
public void MegamanTemMenosDe30DeVidaCausa9NoAtaque() { var megaman = new Megaman(); var bot = new Bot(); megaman.ReceberAtaque(71); megaman.Atacar(bot); Assert.AreEqual(91, bot.Vida); }
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()}"); }
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()}"); }
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); }
public void MegamanToStringComMenosDe30DeVida() { var megaman = new Megaman(); megaman.ReceberAtaque(71); Assert.AreEqual( "Vida: 29, Ataque: 6, Defesa: 0", megaman.ToString() ); }
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); }
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); }
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); }
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; }
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); }
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(); }
public MegamanLargeState(Megaman megaman) { this.megaman = megaman; }
// Use this for initialization void Start() { mov = GameObject.FindGameObjectWithTag("MovingPlat").GetComponent <MovingPlat>(); player = gameObject.GetComponentInParent <Megaman>(); }
public MegamanIdleState(Megaman megaman) : base(megaman) { }
private void Awake() { megaman = FindObjectOfType <Megaman>(); }
static void Main(string[] args) { Megaman X = new Megaman(); X.Correr(); }
public MegamanFalconState(Megaman megaman) { this.megaman = megaman; }
public MegamanActionStateMachine(Megaman megaman) { this.megaman = megaman; }
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(); }
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); }
public BlockNormalState(Block block, Megaman megaman) { this.block = block; this.megaman = megaman; }
public BlockCollidingState(Block block, Megaman megaman) { this.block = block; this.megaman = megaman; initialPosition = new Vector2(); }
// Start is called before the first frame update void Start() { player = GameObject.FindGameObjectWithTag("Player").GetComponent <Megaman>(); }
void Start() { megaman = gameObject.GetComponentInParent <Megaman>(); }
public MegamanFallingState(Megaman megaman) : base(megaman, ActionState.Falling) { }
public MegamanJumpingState(Megaman megaman) : base(megaman) { }
public BlockStateMachine(Block block, Megaman megaman) { this.block = block; this.megaman = megaman; }
public MegamanActionState(Megaman megaman, ActionState defaultNextActionState) : this(megaman) { this.defaultNextActionState = defaultNextActionState; nextActionState = defaultNextActionState; }
public MegamanSmallState(Megaman megaman) { this.megaman = megaman; }
public MegamanZeroState(Megaman megaman) { this.megaman = megaman; }
public MegamanRunningState(Megaman megaman) : base(megaman) { }
public MegamanPowerUpStateMachine(Megaman megaman) { this.megaman = megaman; states = new Dictionary<MegamanState, IMegamanPowerUpState>(); }