public void UseItem() { if (mochila.GetIndex() != -1) { if (this.mochila.items[mochila.GetIndex()] is Potion && mochila.GetIndex() <= mochila.items.Count - 1) { AddTurns(); } else if (this.mochila.items[mochila.GetIndex()] is Armadura && mochila.GetIndex() <= mochila.items.Count - 1) { armadura = new Armadura(); } else if (this.mochila.items[mochila.GetIndex()] is Espada && mochila.GetIndex() <= mochila.items.Count - 1) { espada = new Espada(); } this.mochila.UseItem(); } }
public bool TryAdd(Cosa item) { if (items.Count < 10 || item is Moneda) { if (item is Moneda) { this.AddCoins(); return(true); } else { items.Add(item); return(true); } } else { return(false); } }
public bool UseItem() { if (this.ItemIndex != -1) { Cosa objeto = items[this.ItemIndex]; if (objeto is Moneda) { AddCoins(); Borra(); return(true); } else if (objeto is Potion) { Borra(); return(true); } else if (objeto is Espada) { Borra(); return(true); } else if (objeto is Armadura) { Borra(); return(true); } else { this.ItemIndex = -1; return(false); } } else { return(false); } }
public void PutArmor() { this.objeto = new Armadura(); }
public void PutSword() { this.objeto = new Espada(); }
public void PutPotion() { this.objeto = new Potion(); }
public void PutCoin() { this.objeto = new Moneda(); }
public Celda() { this.valor = TipoCelda.Empty; this.shadow = true; this.objeto = null; }
public void RemoveCoin() { this.objeto = null; }