コード例 #1
0
        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;
        }
コード例 #2
0
ファイル: Gladiator.cs プロジェクト: Eraac/TP-Gladiator
        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;
        }
コード例 #3
0
        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;
        }
コード例 #4
0
ファイル: Gladiator.cs プロジェクト: Eraac/TP-Gladiator
 public bool isFilet(SlotStuff slotStuff)
 {
     return (this._stuff.isFilet(slotStuff));
 }
コード例 #5
0
ファイル: Gladiator.cs プロジェクト: Eraac/TP-Gladiator
 public uint chanceParry(SlotStuff slotStuff)
 {
     return this._stuff.getTotalValueOfStatsForOnePiece(TypeStats.CHANCE_PARRY, slotStuff);
 }
コード例 #6
0
ファイル: Gladiator.cs プロジェクト: Eraac/TP-Gladiator
        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);
        }
コード例 #7
0
 private bool equipWeaponOnSlot(SlotStuff slotStuff)
 {
     return (slotStuff == SlotStuff.WEAPON_LEFT_HAND || slotStuff == SlotStuff.WEAPON_RIGHT_HAND);
 }
コード例 #8
0
 private bool equipArmorOnSlot(SlotStuff slotStuff)
 {
     return (slotStuff == SlotStuff.ARMOR_HEAD || slotStuff == SlotStuff.SHIELD);
 }
コード例 #9
0
ファイル: Stuff.cs プロジェクト: Eraac/TP-Gladiator
 public bool isFilet(SlotStuff slotStuff)
 {
     return (this.hasItem(slotStuff) && this._items[slotStuff].id == (uint)ListWeapon.FILET);
 }
コード例 #10
0
 public bool canEquip(Gladiator gladiator, Item item, SlotStuff slotStuff)
 {
     return this.checkSlot(item, slotStuff) && this.checkCost(gladiator, item, slotStuff);
 }
コード例 #11
0
ファイル: Stuff.cs プロジェクト: Eraac/TP-Gladiator
 public bool hasItem(SlotStuff slotStuff)
 {
     return this._items.ContainsKey(slotStuff);
 }
コード例 #12
0
ファイル: Stuff.cs プロジェクト: Eraac/TP-Gladiator
 public uint getTotalValueOfStatsForOnePiece(TypeStats typeStats, SlotStuff slotStuff)
 {
     return (this.hasItem(slotStuff)) ?
         this._items[slotStuff].getTotalStats(typeStats) : 0;
 }
コード例 #13
0
ファイル: Stuff.cs プロジェクト: Eraac/TP-Gladiator
 public uint getCostItem(SlotStuff slotStuff)
 {
     return (this.hasItem(slotStuff)) ? this._items[slotStuff].cost : 0;
 }
コード例 #14
0
ファイル: Stuff.cs プロジェクト: Eraac/TP-Gladiator
 public void deleteItem(SlotStuff slotStuff)
 {
     if (this.hasItem(slotStuff)) {
         this._items.Remove(slotStuff);
     }
 }
コード例 #15
0
ファイル: Stuff.cs プロジェクト: Eraac/TP-Gladiator
 public void addItem(SlotStuff slotStuff, Item item)
 {
     this._items.Add(slotStuff, item);
 }