/// <summary> /// Ends the hit. Deals damage to the target, if hit was successful. Resets aggro if necessary. /// </summary> private void HitFinished() { // hit animation performed if (Status == AttackStatus.Hit) { // deal damage int damageDealt = damage; // add damage boost from weapon if is player if (_enemyController == null) { Equipable equippedItem = InventoryManager.Instance.CurrentlyEquippedItem; if (equippedItem) { InventoryManager.Instance.CurrentlyEquippedItemButton.IncreaseUses(); damageDealt += equippedItem.DamageBoost; } } _target.Hit(damageDealt, out int targetHealth, _enemyController); if (targetHealth <= 0) { StopAttack(); } } // end hit Status = AttackStatus.None; if (resetAfterHit) { // reset aggro independent of (un-)successful hit _target = null; } }
public void Equip(Item item) { Equipable equip = (Equipable)item; if (equip.GetMainType() == 1) { equipment.SetPrimary(equip); } else if (equip.GetMainType() == 2) { equipment.SetSecondary(equip); } else { equipment.SetArmor(equip); } }
public EquipmentSlots() { primaryWeapon = new Equipable(); secondaryWeapon = new Equipable(); armor = new Equipable(); }
public void RemoveArmor() { armor = new Equipable(); }
public void RemoveSecondary() { secondaryWeapon = new Equipable(); }
public void RemovePrimary() { primaryWeapon = new Equipable(); }
public void SetArmor(Equipable item) { armor = item; }
public void SetSecondary(Equipable item) { secondaryWeapon = item; }
public void SetPrimary(Equipable item) { primaryWeapon = item; }