private bool checkCost(Gladiator gladiator, Item item, SlotStuff slotStuff) { uint newCost = gladiator.stuff.getCostAllStuff() + item.cost - gladiator.stuff.getCostItem(slotStuff); // Le total actuel de l'équipement + coût nouveau item - l'item qui sera ramplacé if (newCost > MAX_COST_STUFF) { return false; } return true; }
public bool addItem(Item item, SlotStuff slotStuff) { CheckIfGladiatorCanEquip check = new CheckIfGladiatorCanEquip(); if (check.canEquip(this, item, slotStuff)) { this._stuff.addItem(slotStuff, item); return true; } return false; }
private bool checkSlot(Item item, SlotStuff slotStuff) { switch (item.typeStuff) { case TypeStuff.ARMOR: return this.equipArmorOnSlot(slotStuff); case TypeStuff.WEAPON: return this.equipWeaponOnSlot(slotStuff); } return false; }
public bool isFilet(SlotStuff slotStuff) { return (this._stuff.isFilet(slotStuff)); }
public uint chanceParry(SlotStuff slotStuff) { return this._stuff.getTotalValueOfStatsForOnePiece(TypeStats.CHANCE_PARRY, slotStuff); }
public uint chanceHit(SlotStuff slotStuff) { uint chance = this._stuff.getTotalValueOfStatsForOnePiece(TypeStats.CHANCE_HIT, slotStuff); if (this.isFilet(slotStuff)) { this._stuff.deleteItem(slotStuff); } return this._debuff.decreaseAttack(chance); }
private bool equipWeaponOnSlot(SlotStuff slotStuff) { return (slotStuff == SlotStuff.WEAPON_LEFT_HAND || slotStuff == SlotStuff.WEAPON_RIGHT_HAND); }
private bool equipArmorOnSlot(SlotStuff slotStuff) { return (slotStuff == SlotStuff.ARMOR_HEAD || slotStuff == SlotStuff.SHIELD); }
public bool isFilet(SlotStuff slotStuff) { return (this.hasItem(slotStuff) && this._items[slotStuff].id == (uint)ListWeapon.FILET); }
public bool canEquip(Gladiator gladiator, Item item, SlotStuff slotStuff) { return this.checkSlot(item, slotStuff) && this.checkCost(gladiator, item, slotStuff); }
public bool hasItem(SlotStuff slotStuff) { return this._items.ContainsKey(slotStuff); }
public uint getTotalValueOfStatsForOnePiece(TypeStats typeStats, SlotStuff slotStuff) { return (this.hasItem(slotStuff)) ? this._items[slotStuff].getTotalStats(typeStats) : 0; }
public uint getCostItem(SlotStuff slotStuff) { return (this.hasItem(slotStuff)) ? this._items[slotStuff].cost : 0; }
public void deleteItem(SlotStuff slotStuff) { if (this.hasItem(slotStuff)) { this._items.Remove(slotStuff); } }
public void addItem(SlotStuff slotStuff, Item item) { this._items.Add(slotStuff, item); }