Example #1
0
 public SmithRewardCalculator()
 {
     Groups = new RewardGroup[]
     {
         new RewardGroup(0, new RewardItem(1, SturdyShovel)),
         new RewardGroup(25, new RewardItem(1, SturdyPickaxe)),
         new RewardGroup(50, new RewardItem(45, SturdyShovel), new RewardItem(45, SturdyPickaxe), new RewardItem(10, MiningGloves, 1)),
         new RewardGroup(200, new RewardItem(45, GargoylesPickaxe), new RewardItem(45, ProspectorsTool), new RewardItem(10, MiningGloves, 3)),
         new RewardGroup(400, new RewardItem(2, GargoylesPickaxe), new RewardItem(2, ProspectorsTool), new RewardItem(1, PowderOfTemperament)),
         new RewardGroup(450, new RewardItem(9, PowderOfTemperament), new RewardItem(1, MiningGloves, 5)),
         new RewardGroup(500, new RewardItem(1, RunicHammer, 1)),
         new RewardGroup(550, new RewardItem(3, RunicHammer, 1), new RewardItem(2, RunicHammer, 2)),
         new RewardGroup(600, new RewardItem(1, RunicHammer, 2)),
         new RewardGroup(625, new RewardItem(3, RunicHammer, 2), new RewardItem(6, PowerScroll, 5), new RewardItem(1, ColoredAnvil)),
         new RewardGroup(650, new RewardItem(1, RunicHammer, 3)),
         new RewardGroup(675, new RewardItem(1, ColoredAnvil), new RewardItem(6, PowerScroll, 10), new RewardItem(3, RunicHammer, 3)),
         new RewardGroup(700, new RewardItem(1, RunicHammer, 4)),
         new RewardGroup(750, new RewardItem(1, AncientHammer, 10)),
         new RewardGroup(800, new RewardItem(1, PowerScroll, 15)),
         new RewardGroup(850, new RewardItem(1, AncientHammer, 15)),
         new RewardGroup(900, new RewardItem(1, PowerScroll, 20)),
         new RewardGroup(950, new RewardItem(1, RunicHammer, 5)),
         new RewardGroup(1000, new RewardItem(1, AncientHammer, 30)),
         new RewardGroup(1050, new RewardItem(1, RunicHammer, 6)),
         new RewardGroup(1100, new RewardItem(1, AncientHammer, 60)),
         new RewardGroup(1150, new RewardItem(1, RunicHammer, 7)),
         new RewardGroup(1200, new RewardItem(1, RunicHammer, 8))
     };
 }
Example #2
0
        public virtual RewardGroup LookupRewards(int points)
        {
            for (int i = m_Groups.Length - 1; i >= 1; --i)
            {
                RewardGroup group = m_Groups[i];

                if (points >= group.Points)
                {
                    return(group);
                }
            }

            return(m_Groups[0]);
        }
Example #3
0
 public TailorRewardCalculator()
 {
     Groups = new RewardGroup[]
     {
         new RewardGroup(0, new RewardItem(1, Cloth, 0)),
         new RewardGroup(50, new RewardItem(1, Cloth, 1)),
         new RewardGroup(100, new RewardItem(1, Cloth, 2)),
         new RewardGroup(150, new RewardItem(9, Cloth, 3), new RewardItem(1, Sandals)),
         new RewardGroup(200, new RewardItem(4, Cloth, 4), new RewardItem(1, Sandals)),
         new RewardGroup(300, new RewardItem(1, StretchedHide)),
         new RewardGroup(350, new RewardItem(1, RunicKit, 1)),
         new RewardGroup(400, new RewardItem(2, PowerScroll, 5), new RewardItem(3, Tapestry)),
         new RewardGroup(450, new RewardItem(1, BearRug)),
         new RewardGroup(500, new RewardItem(1, PowerScroll, 10)),
         new RewardGroup(550, new RewardItem(1, ClothingBlessDeed)),
         new RewardGroup(575, new RewardItem(1, PowerScroll, 15)),
         new RewardGroup(600, new RewardItem(1, RunicKit, 2)),
         new RewardGroup(650, new RewardItem(1, PowerScroll, 20)),
         new RewardGroup(700, new RewardItem(1, RunicKit, 3))
     };
 }
Example #4
0
        public override List <Item> ComputeRewards(bool full)
        {
            List <Item> list = new List <Item>();

            RewardGroup rewardGroup = SmithRewardCalculator.Instance.LookupRewards(SmithRewardCalculator.Instance.ComputePoints(this));

            if (rewardGroup != null)
            {
                if (full)
                {
                    for (int i = 0; i < rewardGroup.Items.Length; ++i)
                    {
                        Item item = rewardGroup.Items[i].Construct();

                        if (item != null)
                        {
                            list.Add(item);
                        }
                    }
                }
                else
                {
                    RewardItem rewardItem = rewardGroup.AcquireItem();

                    if (rewardItem != null)
                    {
                        Item item = rewardItem.Construct();

                        if (item != null)
                        {
                            list.Add(item);
                        }
                    }
                }
            }

            return(list);
        }