Esempio n. 1
0
    public void CreatePickups(ILootDropper lootDropper)
    {
        List <IPickup> possiblePickups       = lootDropper.GetPickups();
        float          currentLootValueTotal = lootDropper.GetChallengeRating() * HostHandler.I.currentHost.lootValueMultiplier;
        bool           canAfford             = true;

        while (canAfford)
        {
            canAfford = false;
            if (possiblePickups.Count == 0)
            {
                continue;
            }
            IPickup pickup = possiblePickups[UnityEngine.Random.Range(0, possiblePickups.Count)];
            if (pickup.GetLootValue() > currentLootValueTotal)
            {
                continue;
            }
            canAfford              = true;
            currentLootValueTotal -= pickup.GetLootValue();
            possiblePickups.Remove(pickup);
            CreatePickup(lootDropper.GetTransform().parent, pickup);
        }
    }
Esempio n. 2
0
 public void DropLoot(ILootDropper lootDropper)
 {
     lootDropper.onLootDrop.Invoke(lootDropper);
     CreatePickups(lootDropper);
 }
Esempio n. 3
0
 public void InitLootDropper(ILootDropper lootDropper)
 {
     lootDropper.onLootDrop = new LootDropEvent();
 }