public void usaritem(string nombre, LcdLabel hp, ComboBox cbitem, Label dialog) { int heal; string fullhealth = s.getdata("select * from personaje", "HP"); switch (nombre) { case "Pomada": heal = 4; hp.Text = (int.Parse(hp.Text) + heal).ToString(); dialog.Text = "Uso pomada"; if (int.Parse(hp.Text) >= int.Parse(fullhealth)) { hp.Text = fullhealth; } break; case "Ciabatta™ chica de jamon": Stream stream = Properties.Resources.aet; sfx.playsound(stream); string ciabata = string.Format("update personaje set HP = (HP + '{0}'), ATK =(ATK + '{1}'), DEF = (DEF + '{2}')", 4, 1, 0); s.Exe(ciabata); dialog.Text = "Consumo una Ciabatta; mis musculos empiezan a crecer, mi mentalidad aumenta y\n mis agallas incrementan exageradamente"; hp.Text = s.getdata("select * from personaje", "HP"); break; } cbitem.Text = null; string remove = string.Format("delete from items where nombre = '{0}'", nombre); s.Exe(remove); s.populate(cbitem, "select * from items", "nombre"); }
void Enemyturn(int enemyatk, int myhp, int mydef, LcdLabel _HP, Label _log, string enemyname, TextBox enemyconmand, Timer timer1) { int quedecir = random.Next(0, 2); damage = Seleccionar(enemyname, quedecir).Item2 - mydef; _HP.Text = (int.Parse(_HP.Text) - damage).ToString(); readmessage("\n " + Seleccionar(enemyname, quedecir).Item1.ToString() + " " + damage + " de daño" + "\n", enemyconmand, timer1); if (myhp <= 0) { _log.Text += "El ataque me saco volando"; } }
public void recibiritem(string nombre, int cantidad, LcdLabel m4, LcdLabel shot, ComboBox cbitem) { switch (nombre) { case "Obtuve NATO": m4.Text = (int.Parse(m4.Text) + cantidad).ToString(); break; case "Obtuve Balas": shot.Text = (int.Parse(shot.Text) + cantidad).ToString(); break; case "Obtuve Ciabatta™": guardar("Ciabatta™ chica de jamon", 1); break; case "Obtuve Granada": guardar("Granada", 2); break; } s.populate(cbitem, "select * from items where Type = 1", "nombre"); }
private void InitializeComponent() { components = new System.ComponentModel.Container(); bOK = new System.Windows.Forms.Button(); bAddTime = new System.Windows.Forms.Button(); lBuy = new System.Windows.Forms.Label(); lCredits = new System.Windows.Forms.Label(); lcdClock = new LCDLabel.LcdLabel(); timerCredits = new System.Windows.Forms.Timer(components); SuspendLayout(); bOK.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; bOK.Image = Kiosk.Properties.Resources.ico_ok; bOK.Location = new System.Drawing.Point(146, 108); bOK.Name = "bOK"; bOK.Size = new System.Drawing.Size(48, 48); bOK.TabIndex = 0; bOK.UseVisualStyleBackColor = true; bOK.Click += new System.EventHandler(bOK_Click); bAddTime.Image = Kiosk.Properties.Resources.ico_add; bAddTime.Location = new System.Drawing.Point(90, 108); bAddTime.Name = "bAddTime"; bAddTime.Size = new System.Drawing.Size(48, 48); bAddTime.TabIndex = 1; bAddTime.UseVisualStyleBackColor = true; bAddTime.Click += new System.EventHandler(bAddTime_Click); lBuy.Dock = System.Windows.Forms.DockStyle.Top; lBuy.Font = new System.Drawing.Font("Microsoft Sans Serif", 16f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0); lBuy.Location = new System.Drawing.Point(0, 0); lBuy.Name = "lBuy"; lBuy.Size = new System.Drawing.Size(284, 36); lBuy.TabIndex = 10; lBuy.Text = "Buy Time"; lBuy.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; lCredits.Font = new System.Drawing.Font("Microsoft Sans Serif", 16f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0); lCredits.Location = new System.Drawing.Point(0, 64); lCredits.Name = "lCredits"; lCredits.Size = new System.Drawing.Size(284, 36); lCredits.TabIndex = 12; lCredits.Text = "Credits: 0"; lCredits.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; lcdClock.BackGround = System.Drawing.SystemColors.Control; lcdClock.BorderColor = System.Drawing.Color.Black; lcdClock.BorderSpace = 3; lcdClock.CharSpacing = 2; lcdClock.DotMatrix = LCDLabel.DotMatrix.mat5x7; lcdClock.LineSpacing = 2; lcdClock.Location = new System.Drawing.Point(99, 36); lcdClock.Name = "lcdClock"; lcdClock.NumberOfCharacters = 5; lcdClock.PixelHeight = 2; lcdClock.PixelOff = System.Drawing.Color.FromArgb(0, 170, 170, 170); lcdClock.PixelOn = System.Drawing.Color.Black; lcdClock.PixelShape = LCDLabel.PixelShape.Square; lcdClock.PixelSize = LCDLabel.PixelSize.pix2x2; lcdClock.PixelSpacing = 1; lcdClock.PixelWidth = 2; lcdClock.Size = new System.Drawing.Size(86, 28); lcdClock.TabIndex = 9; lcdClock.Text = "00:00"; lcdClock.TextLines = 1; timerCredits.Enabled = true; timerCredits.Tick += new System.EventHandler(timerCredits_Tick); base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; base.ClientSize = new System.Drawing.Size(284, 174); base.ControlBox = false; base.Controls.Add(lCredits); base.Controls.Add(lBuy); base.Controls.Add(lcdClock); base.Controls.Add(bOK); base.Controls.Add(bAddTime); base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; base.Name = "CreditManagerFull"; base.ShowIcon = false; base.ShowInTaskbar = false; base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; base.TopMost = true; ResumeLayout(false); }
void items(string nombre, int myatk, int enemyhp, int enemydef, Label _enemyhp, Label _log, Panel dialog, Panel cmd, TextBox mycommand, Timer timer1, ComboBox cbitem, LcdLabel myhp) { switch (nombre) { case "Granada": Stream stream = Properties.Resources.granada; sfx.playsound(stream); damage = 9 - enemydef; _enemyhp.Text = (int.Parse(_enemyhp.Text) - 9).ToString(); readmessage(("Sora lanza una granada: " + damage + " de daño" + "\n"), mycommand, timer1); break; case "Piedra": Stream piedra = Properties.Resources.piedra; sfx.playsound(piedra); damage = 3 - enemydef; _enemyhp.Text = (int.Parse(_enemyhp.Text) - 3).ToString(); readmessage(("Sora tira una piedra: " + damage + " de daño" + "\n"), mycommand, timer1); break; } _i.usaritem(cbitem.Text, myhp, cbitem, _log); string remove = string.Format("delete from items where nombre = '{0}'", nombre); s.Exe(remove); cbitem.Text = null; s.populate(cbitem, "select * from items", "nombre"); }
public void seleccion(string cmd, string weapon, int myhp, int myatk, int mydef, int enemyhp, int enemydef, int enemyatk, Label displayenemyhp, LcdLabel displayMyhp, Panel dialog, Label _log, Panel cmdlist, string enemyname, Timer _start, TextBox mycommand, string _item, ComboBox cbitem) { dialog.Enabled = false; int randomNumber = random.Next(myatk, (myatk + 1)); switch (cmd) { case "ATK": myATK(weapon, randomNumber, enemyhp, enemydef, displayenemyhp, _log, dialog, cmdlist, mycommand, _start, enemyname); break; case "DEF": _log.Text = "Me cubro con todo lo que puedo \n"; mydef = mydef + 2; break; case "NADA": _log.Text = "Me quedo parado en pleno combate \n"; break; case "USE": items(_item, myatk, enemyatk, enemydef, displayenemyhp, _log, dialog, cmdlist, mycommand, _start, cbitem, displayMyhp); break; } //parte donde ataca el enemigo int _enemyhp = int.Parse(displayenemyhp.Text); if (_enemyhp > 0) { Enemyturn(enemyatk, myhp, mydef, displayMyhp, _log, enemyname, mycommand, _start); } checkenemyhp(_enemyhp, _log, dialog, cmdlist, mycommand); }