Events can now strike all areas instead of few select ones

This commit is contained in:
alex-gh
2014-04-20 14:04:15 +02:00
parent 51d3876405
commit 8a9130026a
2 changed files with 25 additions and 4 deletions
+23 -3
View File
@@ -69,6 +69,8 @@ var/scheduledEvent = null
/datum/event/proc/findEventArea() //Here's a nice proc to use to find an area for your event to land in!
var/area/candidate = null
var/list/safe_areas = list(
/area/turret_protected/ai,
/area/turret_protected/ai_upload,
@@ -83,13 +85,31 @@ var/scheduledEvent = null
/area/shuttle/escape_pod5/station,
/area/shuttle/mining/station,
/area/shuttle/transport1/station,
/area/shuttle/specops/station)
/area/shuttle/specops/station,
/area/shuttle/prison/station,
/area/shuttle/administration/station
)
//These are needed because /area/engine has to be removed from the list, but we still want these areas to get fucked up.
var/list/danger_areas = list(
/area/engine/break_room,
/area/engine/chiefs_office)
//Need to locate() as it's just a list of paths.
return locate(pick((the_station_areas - safe_areas) + danger_areas))
var/list/event_areas = list()
for (var/areapath in the_station_areas)
event_areas += typesof(areapath)
for (var/areapath in safe_areas)
event_areas -= typesof(areapath)
for (var/areapath in danger_areas)
event_areas += typesof(areapath)
while (event_areas.len > 0)
var/list/event_turfs = null
candidate = locate(pick_n_take(event_areas))
event_turfs = get_area_turfs(candidate)
if (event_turfs.len > 0)
break
return candidate