public static bool GetStats() { ConsoleBuffer.ObteBuffer().PrintBackground(); Item[] bagitem = Program.ObteJuego().pl.GetGemas(); int modh = 0; int moda = 0; int modd = 0; for (int i = 0; i < bagitem.Length; i++) { if (bagitem[i] != null && bagitem[i].GetType() == typeof(ItemGema)) { ItemGema gema = (ItemGema)bagitem[i]; modh += gema.ModifierHp(); moda += gema.ModifierAtt(); modd += gema.ModifierDef(); } } ItemWeapon weapon = Program.ObteJuego().pl.GetWeapon(); if (weapon != null) { modh += weapon.ModifierHp(); moda += weapon.ModifierAtt(); modd += weapon.ModifierDef(); } ItemArmor armor = Program.ObteJuego().pl.GetArmor(); if (armor != null) { modh += armor.ModifierHp(); moda += armor.ModifierAtt(); modd += armor.ModifierDef(); } ConsoleBuffer.ObteBuffer().Print(1, 0, "STATS"); ConsoleBuffer.ObteBuffer().Print(2, 3, "Nvl. " + Program.ObteJuego().pl.GetLevel() + " Exp. " + Program.ObteJuego().pl.Experiencia); if (modh == 0) { ConsoleBuffer.ObteBuffer().Print(2, 5, "VIDA (HP)-> " + Program.ObteJuego().pl.GetHealth() + "/" + Program.ObteJuego().pl.GetMHealth() + " --> Capacidad de aguante"); } else { ConsoleBuffer.ObteBuffer().Print(2, 5, "VIDA (HP)-> " + Program.ObteJuego().pl.GetHealth() + "/" + Program.ObteJuego().pl.GetMHealth() + "+(" + modh + ") --> Capacidad de aguante"); } if (moda == 0) { ConsoleBuffer.ObteBuffer().Print(2, 7, "ATAQUE (Att)-> " + Program.ObteJuego().pl.GetFlatAtt() + " --> Daño que inflinges"); } else { ConsoleBuffer.ObteBuffer().Print(2, 7, "ATAQUE (Att)-> " + Program.ObteJuego().pl.GetFlatAtt() + "+(" + moda + ") --> Daño que inflinges"); } if (modd == 0) { ConsoleBuffer.ObteBuffer().Print(2, 9, "DEFENSA (Def)-> " + Program.ObteJuego().pl.GetFlatDef() + " --> Daño que reduces"); } else { ConsoleBuffer.ObteBuffer().Print(2, 9, "DEFENSA (Def)-> " + Program.ObteJuego().pl.GetFlatDef() + "+(" + modd + ") --> Daño que reduces"); } ConsoleBuffer.ObteBuffer().Print(2, 13, "MANA (mana) -> " + Program.ObteJuego().pl.GetMana() + "/" + Program.ObteJuego().pl.GetManaM()); ConsoleBuffer.ObteBuffer().Print(2, 15, "Velocidad (Vel.) -> " + Program.ObteJuego().pl.GetSpeed()); ConsoleBuffer.ObteBuffer().SmallMap(); ConsoleBuffer.ObteBuffer().PrintScreen(); Console.ReadKey(); return(true); }
public static bool LookAtBag() { Item[] bag = Program.pl.GetBag(); for (int i = 0; i < bag.Length; i++) { int ii = i; int x = 0; if (ii >= 5) { ii -= 5; x = 1; } if (bag[i] != null) { if (bag[i].GetType() == typeof(ItemArmor)) { ItemArmor equipo = (ItemArmor)bag[i]; Program.buffer.Print(1 + 50 * x, 2 + ii * 3, equipo.GetName()); string texto = ""; if (equipo.ModifierHp() < 0) { texto += "HP(" + equipo.ModifierHp() + ") "; } else { texto += "HP(+" + equipo.ModifierHp() + ") "; } if (equipo.ModifierDef() < 0) { texto += "DEF(" + equipo.ModifierDef() + ") "; } else { texto += "DEF(+" + equipo.ModifierDef() + ") "; } if (equipo.GetAvoidPercInt() < 0) { texto += "DEF PROB.(" + equipo.GetAvoidPercInt() + ")"; } else { texto += "DEF PROB.(+" + equipo.GetAvoidPercInt() + ")"; } Program.buffer.Print(5 + 50 * x, 3 + ii * 3, texto); } else if (bag[i].GetType() == typeof(ItemWeapon)) { ItemWeapon equipo = (ItemWeapon)bag[i]; Program.buffer.Print(1 + 50 * x, 2 + ii * 3, equipo.GetName()); string texto = ""; if (equipo.ModifierAtt() < 0) { texto += "ATT(" + equipo.ModifierAtt() + ") "; } else { texto += "ATT(+" + equipo.ModifierAtt() + ") "; } if (equipo.ModifierAttM() < 0) { texto += "ATT M.(" + equipo.ModifierAttM() + ") "; } else { texto += "ATT M.(+" + equipo.ModifierAttM() + ") "; } if (equipo.GetHitPercInt() < 0) { texto += "ATT PROB.(" + equipo.GetHitPercInt() + ")"; } else { texto += "ATT PROB.(+" + equipo.GetHitPercInt() + ")"; } Program.buffer.Print(5 + 50 * x, 3 + ii * 3, texto); } else if (bag[i].GetType() == typeof(ItemGema)) { ItemGema equipo = (ItemGema)bag[i]; Program.buffer.Print(1 + 50 * x, 2 + ii * 3, equipo.GetName()); string texto = ""; if (equipo.ModifierHp() < 0) { texto += "HP(" + equipo.ModifierHp() + ") "; } else { texto += "HP(+" + equipo.ModifierHp() + ") "; } if (equipo.ModifierAttM() < 0) { texto += "ATT M.(" + equipo.ModifierAttM() + ") "; } else { texto += "ATT M.(+" + equipo.ModifierAttM() + ") "; } if (equipo.ModifierManaM() < 0) { texto += "MANA M.(" + equipo.ModifierManaM() + ")"; } else { texto += "MANA M.(+" + equipo.ModifierManaM() + ")"; } Program.buffer.Print(5 + 50 * x, 3 + ii * 3, texto); } else if (bag[i].GetType() == typeof(ItemPocion)) { ItemPocion consumable = (ItemPocion)bag[i]; Program.buffer.Print(1 + 50 * x, 2 + ii * 3, consumable.GetName()); if (consumable.GetPocionType() == ItemPocion.PocionType.hp) { Program.buffer.Print(1 + 50 * x, 3 + ii * 3, " +" + consumable.GetFlatCant().ToString() + "% HP"); } else { Program.buffer.Print(1 + 50 * x, 3 + ii * 3, " +" + consumable.GetFlatCant().ToString() + "% Mana"); } } else { Program.buffer.Print(1 + 50 * x, 2 + ii * 3, bag[i].GetName()); } } } Program.buffer.PrintBackground(); Program.buffer.Print(1, Program.buffer.height - 2, "Pulsa cualquier boton para salir"); Program.buffer.Print(1, 0, "MOCHILA"); Program.SmallMap(); Program.buffer.PrintScreen(); Console.ReadKey(); return(true); }