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:
Atermonera
2022-01-15 23:52:00 -08:00
committed by GitHub
parent ae7f147ea5
commit cff34e64a1
47 changed files with 232 additions and 126 deletions

View File

@@ -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)