mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-15 20:52:07 +00:00
Adds event regions to GameMaster events (#8334)
* Configures gm events to be selectable by "region" * Configures event regions for existing events * Configures event selection to filter by region
This commit is contained in:
@@ -238,19 +238,17 @@ This actually tests if they have the same entries and values.
|
||||
//Pretends to pick an element based on its weight but really just seems to pick a random element.
|
||||
/proc/pickweight(list/L)
|
||||
var/total = 0
|
||||
var/item
|
||||
for (item in L)
|
||||
if (!L[item])
|
||||
for(var/item in L)
|
||||
if(!L[item])
|
||||
L[item] = 1
|
||||
total += L[item]
|
||||
|
||||
total = rand(1, total)
|
||||
for (item in L)
|
||||
total -=L [item]
|
||||
if (total <= 0)
|
||||
for(var/item in L)
|
||||
total -= L[item]
|
||||
if(total <= 0)
|
||||
return item
|
||||
|
||||
return null
|
||||
|
||||
//Pick a random element from the list and remove it from the list.
|
||||
/proc/pick_n_take(list/listfrom)
|
||||
|
||||
Reference in New Issue
Block a user