public string GetRandomObject() { GenericLootDropItemString obj = dropTable.PickLootDropItem(); //Debug.Log(obj.item); return(obj.item); }
void ModifyDropTableProbabilites() { for (int i = 0; i < dropTable.lootDropItems.Count; i++) { GenericLootDropItemString drop = dropTable.lootDropItems[i]; if (drop.probabilityWeight >= MAX_PROBABILITY_WEIGHT) { drop.probabilityWeight = MAX_PROBABILITY_WEIGHT; continue; } else { drop.probabilityWeight += ProbabilityScale; } } dropTable.ValidateTable(); }
// TODO: change this hardcoded shit void ResetDropTableProbabilites() { for (int i = 0; i < dropTable.lootDropItems.Count; i++) { GenericLootDropItemString drop = dropTable.lootDropItems[i]; if (drop.item == "Banana") { drop.probabilityWeight = 70; } else if (drop.item == "Sock") { drop.probabilityWeight = 50; } else if (drop.item == "Slipper") { drop.probabilityWeight = 50; } else if (drop.item == "Newspaper") { drop.probabilityWeight = 35; } else if (drop.item == "Bottle") { drop.probabilityWeight = 25; } else if (drop.item == "Flowerpot") { drop.probabilityWeight = 20; } else if (drop.item == "Microwave") { drop.probabilityWeight = 4; } } dropTable.ValidateTable(); }