Example #1
0
        public void DistributeLoot(Enemy e, FormState state)
        {
            if (e.Name.Contains("Pot of"))
            {
                _lh.GetRecipeDrop(state.dungeonTiers[state.DungeonType],
                                  state.DungeonType,
                                  state.Player.Loot.Recipes,
                                  state.Random);
            }
            else if (e.Name.Contains("Minion"))
            {
                state.Player.Wallet.MinionShards += (5 * state.DungeonType + 1);
            }
            else
            {
                if (state.DungeonType != DungeonType.FINAL)
                {
                    var loot  = _lh.GetEnemyDrop(e.Name, state.Random, state.dungeonTiers[state.DungeonType]);
                    var eLoot = state.Player.Loot.EnemyLoot; // make pointer to list so we can check it easily
                    var l     = eLoot.Find(x => x.GetName().Equals(loot.GetName()));

                    if (l == null)
                    {
                        eLoot.Add(loot);
                    }
                    else
                    {
                        l.Quantity += loot.Quantity;
                    }
                }
            }
        }