public static SkillStat GetSkillByHouseType(Skills stats, TownHouseSlotType type) { switch (type) { case TownHouseSlotType.Woodcutting: return(stats.Woodcutting); case TownHouseSlotType.Mining: return(stats.Mining); case TownHouseSlotType.Farming: return(stats.Farming); case TownHouseSlotType.Crafting: return(stats.Crafting); case TownHouseSlotType.Cooking: return(stats.Cooking); case TownHouseSlotType.Slayer: return(stats.Slayer); case TownHouseSlotType.Sailing: return(stats.Sailing); case TownHouseSlotType.Fishing: return(stats.Fishing); case TownHouseSlotType.Melee: return(stats.Health); case TownHouseSlotType.Healing: return(stats.Healing); case TownHouseSlotType.Magic: return(stats.Magic); case TownHouseSlotType.Ranged: return(stats.Ranged); default: return(stats.Mining); } }
internal void SetHouse(TownHouseSlot slot, TownHouseSlotType type) { if (slot == null || !slot) { return; } if (type == TownHouseSlotType.Empty) { SetHouseType(slot, TownHouseSlotType.Empty, null); return; } if (buildableTownHouses == null || buildableTownHouses.Length == 0) { return; } var house = buildableTownHouses.FirstOrDefault(x => x.Type == type); if (house == null || !house) { return; } SetHouseType(slot, type, house); }
public static SkillStat GetSkillByHouseType(Skills stats, TownHouseSlotType type) { switch (type) { case TownHouseSlotType.Woodcutting: return(stats.Woodcutting); case TownHouseSlotType.Mining: return(stats.Mining); case TownHouseSlotType.Farming: return(stats.Farming); case TownHouseSlotType.Crafting: return(stats.Crafting); case TownHouseSlotType.Cooking: return(stats.Cooking); case TownHouseSlotType.Slayer: return(stats.Slayer); case TownHouseSlotType.Sailing: return(stats.Sailing); case TownHouseSlotType.Fishing: return(stats.Fishing); #warning Use combat level instead of health for combat based town house slots case TownHouseSlotType.Melee: return(stats.Health); case TownHouseSlotType.Magic: return(stats.Magic); case TownHouseSlotType.Ranged: return(stats.Ranged); default: return(stats.Mining); } }
public float GetActiveBonus(TownHouseSlotType type) { var h = TownHouses.Where(x => x.Type == type && x.IsActive).ToList(); if (h.Count == 0) { return(0); } return(h.Sum(x => x.Bonus)); }
private void SetHouseType(TownHouseSlot slot, TownHouseSlotType type, TownHouse house) { try { slot.SetHouse(new VillageHouseInfo() { Slot = slot.Slot, Type = (int)type }, house); if (slots != null && slots.Length > 0) { info.UsedSlots = slots.Count(x => x != null && x.SlotType != TownHouseSlotType.Empty && x.SlotType != TownHouseSlotType.Undefined); } } catch { } }
internal void SetHouse(TownHouseSlot slot, TownHouseSlotType type) { if (slot == null || !slot || buildableTownHouses == null || buildableTownHouses.Length == 0) { return; } var house = buildableTownHouses.FirstOrDefault(x => x.Type == type); if (house == null || !house) { return; } slot.SetHouse(new VillageHouseInfo() { Slot = slot.Slot, Type = (int)type }, house); }
public TownHouseExpBonus(TownHouseSlotType slotType, float bonus) { SlotType = slotType; Bonus = bonus; }
public void SetBonus(int slot, TownHouseSlotType slotType, float bonus) { expBonus[slot] = new TownHouseExpBonus(slotType, bonus); }