コード例 #1
0
ファイル: GameMath.cs プロジェクト: zerratar/Ravenfall-Legacy
    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);
        }
    }
コード例 #2
0
    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);
    }
コード例 #3
0
ファイル: GameMath.cs プロジェクト: Buliel/Ravenfall-Legacy
    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);
        }
    }
コード例 #4
0
ファイル: TownService.cs プロジェクト: zerratar/RavenNest
        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));
        }
コード例 #5
0
    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
        {
        }
    }
コード例 #6
0
    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);
    }
コード例 #7
0
 public TownHouseExpBonus(TownHouseSlotType slotType, float bonus)
 {
     SlotType = slotType;
     Bonus    = bonus;
 }
コード例 #8
0
 public void SetBonus(int slot, TownHouseSlotType slotType, float bonus)
 {
     expBonus[slot] = new TownHouseExpBonus(slotType, bonus);
 }