Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events #3070

Closed
wants to merge 10 commits into from
Closed

Events #3070

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions _maps/outpost/indie_space.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@
"dP" = (
/obj/structure/chair,
/obj/item/radio/intercom/directional/north,
/obj/effect/landmark/salesman,
/turf/open/floor/plasteel/patterned/cargo_one,
/area/outpost/vacant_rooms)
"dQ" = (
Expand Down
1 change: 1 addition & 0 deletions _maps/outpost/nanotrasen_asteroid.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -5935,6 +5935,7 @@
/obj/structure/closet/wall/directional/east{
name = "Storage Locker"
},
/obj/effect/landmark/salesman,
/turf/open/floor/carpet,
/area/outpost/hallway/central)
"vc" = (
Expand Down
1 change: 1 addition & 0 deletions _maps/outpost/nanotrasen_ice.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -3108,6 +3108,7 @@
},
/obj/machinery/light/broken/directional/north,
/obj/structure/chair/office,
/obj/effect/landmark/salesman,
/turf/open/floor/plasteel/patterned/ridged,
/area/outpost/vacant_rooms/shop)
"uE" = (
Expand Down
1 change: 0 additions & 1 deletion code/__DEFINES/admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
#define ADMIN_PUNISHMENT_GIB "Gib"
#define ADMIN_PUNISHMENT_BSA "Bluespace Artillery Device"
#define ADMIN_PUNISHMENT_FIREBALL "Fireball"
#define ADMIN_PUNISHMENT_ROD "Immovable Rod"
#define ADMIN_PUNISHMENT_SUPPLYPOD_QUICK "Supply Pod (Quick)"
#define ADMIN_PUNISHMENT_SUPPLYPOD "Supply Pod"
#define ADMIN_PUNISHMENT_MAZING "Puzzle"
Expand Down
20 changes: 3 additions & 17 deletions code/__DEFINES/role_preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,30 +40,16 @@
#define ROLE_INTERNAL_AFFAIRS "Internal Affairs Agent"
#define ROLE_FAMILIES "Familes Antagonists"
#define ROLE_BORER "borer"
#define ROLE_FRONTIERSMEN "Frontiersmen"

//Missing assignment means it's not a gamemode specific role, IT'S NOT A BUG OR ERROR.
//The gamemode specific ones are just so the gamemodes can query whether a player is old enough
//(in game days played) to play that role
GLOBAL_LIST_INIT(special_roles, list(
ROLE_TRAITOR = /datum/game_mode/traitor,
ROLE_BROTHER = /datum/game_mode/traitor/bros,
ROLE_OPERATIVE = /datum/game_mode/nuclear,
ROLE_CHANGELING = /datum/game_mode/changeling,
ROLE_WIZARD = /datum/game_mode/wizard,
ROLE_MALF,
ROLE_ALIEN,
ROLE_PAI,
ROLE_CULTIST = /datum/game_mode/cult,
ROLE_BLOB,
ROLE_NINJA,
ROLE_OBSESSED,
ROLE_SPACE_DRAGON,
ROLE_REVENANT,
ROLE_ABDUCTOR,
ROLE_DEVIL = /datum/game_mode/devil,
ROLE_INTERNAL_AFFAIRS = /datum/game_mode/traitor/internal_affairs,
ROLE_FRONTIERSMEN = /datum/antagonist/frontiersmen,
ROLE_ALIEN,
ROLE_SENTIENCE,
ROLE_BORER
))

//Job defines for what happens when you fail to qualify for any job during job selection
Expand Down
4 changes: 2 additions & 2 deletions code/__HELPERS/priority_announce.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

if(!sender_override)
if(title == "")
GLOB.news_network.SubmitArticle(text, "Central Command Update", "Station Announcements", null)
GLOB.news_network.SubmitArticle(text, "Outpost Update", "Station Announcements", null)
else
GLOB.news_network.SubmitArticle(title + "<br><br>" + text, "Central Command", "Station Announcements", null)
GLOB.news_network.SubmitArticle(title + "<br><br>" + text, "Outpost", "Station Announcements", null)

announcement += "<br><span class='alert'>[html_encode(text)]</span><br>"
announcement += "<br>"
Expand Down
3 changes: 2 additions & 1 deletion code/_globalvars/lists/mapping.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@ GLOBAL_LIST_EMPTY(secequipment) //sec equipment lockers that scale with the numb
GLOBAL_LIST_EMPTY(deathsquadspawn)
GLOBAL_LIST_EMPTY(emergencyresponseteamspawn)
GLOBAL_LIST_EMPTY(emergencyresponseteam_outpostspawn)
GLOBAL_LIST_EMPTY(salesman_landmarks)
GLOBAL_LIST_EMPTY(ruin_landmarks)
GLOBAL_LIST_EMPTY(stationroom_landmarks) //List of all spawns for stationrooms

//away missions
GLOBAL_LIST_EMPTY(vr_spawnpoints)

//used by jump-to-area etc. Updated by area/updateName()
//used by jump-to-area etc. Updated by area/updateName()
GLOBAL_LIST_EMPTY(sortedAreas)
/// An association from typepath to area instance. Only includes areas with `unique` set.
GLOBAL_LIST_EMPTY_TYPED(areas_by_type, /area)
Expand Down
9 changes: 9 additions & 0 deletions code/controllers/configuration/entries/game_options.dm
Original file line number Diff line number Diff line change
Expand Up @@ -431,3 +431,12 @@
max_val = 255
config_entry_value = 127
min_val = 127

/datum/config_entry/flag/should_events

/datum/config_entry/number/events_frequency_lower
config_entry_value = 3 MINUTES

/datum/config_entry/number/events_frequency_upper

config_entry_value = 7 MINUTES
40 changes: 24 additions & 16 deletions code/controllers/subsystem/events.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,39 @@ SUBSYSTEM_DEF(events)
init_order = INIT_ORDER_EVENTS
runlevels = RUNLEVEL_GAME

can_fire = FALSE

var/list/control = list() //list of all datum/round_event_control. Used for selecting events based on weight and occurrences.
var/list/running = list() //list of all existing /datum/round_event
///list of all datum/round_event_control. Used for selecting events based on weight and occurrences.
var/list/control = list()
///list of all existing /datum/round_event currently being run.
var/list/running = list()
///cache of currently running events, for lag checking.
var/list/currentrun = list()

var/scheduled = 0 //The next world.time that a naturally occuring random event can be selected.
var/frequency_lower = 1800 //3 minutes lower bound.
var/frequency_upper = 6000 //10 minutes upper bound. Basically an event will happen every 3 to 10 minutes.

var/list/holidays //List of all holidays occuring today or null if no holidays
///The next world.time that a naturally occuring random event can be selected.
var/scheduled = 0
///The lower bound for how soon another random event can be scheduled.
var/frequency_lower = 2.5 MINUTES
///The upper bound for how soon another random event can be scheduled.
var/frequency_upper = 7 MINUTES
///Will wizard events be included in the event pool?
var/wizardmode = FALSE
var/list/holidays

/datum/controller/subsystem/events/Initialize(time, zlevel)
can_fire = CONFIG_GET(flag/should_events)
for(var/type in typesof(/datum/round_event_control))
var/datum/round_event_control/E = new type()
if(!E.typepath)
continue //don't want this one! leave it for the garbage collector
control += E //add it to the list of all events (controls)
var/datum/round_event_control/event = new type()
if(!event.typepath)
continue //don't want this one! leave it for the garbage collector
control += event //add it to the list of all events (controls)

frequency_lower = CONFIG_GET(number/events_frequency_lower)
frequency_upper = CONFIG_GET(number/events_frequency_upper)

reschedule()
getHoliday()
return ..()


/datum/controller/subsystem/events/fire(resumed = 0)
/datum/controller/subsystem/events/fire(resumed = FALSE)
if(!resumed)
checkEvent() //only check these if we aren't resuming a paused fire
src.currentrun = running.Copy()
Expand Down Expand Up @@ -62,7 +70,7 @@ SUBSYSTEM_DEF(events)
return

var/gamemode = SSticker.mode.config_tag
var/players_amt = get_active_player_count(alive_check = 1, afk_check = 1, human_check = 1)
var/players_amt = get_active_player_count(alive_check = TRUE, afk_check = TRUE, human_check = TRUE)
// Only alive, non-AFK human players count towards this.

var/sum_of_weights = 0
Expand Down
5 changes: 3 additions & 2 deletions code/controllers/subsystem/mapping.dm
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ SUBSYSTEM_DEF(mapping)

#define CHECK_STRING_EXISTS(X) if(!istext(data[X])) { log_world("[##X] missing from json!"); continue; }
#define CHECK_LIST_EXISTS(X) if(!islist(data[X])) { log_world("[##X] missing from json!"); continue; }

/datum/controller/subsystem/mapping/proc/load_ship_templates()
maplist = list()
ship_purchase_list = list()
Expand Down Expand Up @@ -194,8 +195,8 @@ SUBSYSTEM_DEF(mapping)
if(islist(data["namelists"]))
S.name_categories = data["namelists"]

if(isnum(data[ "unique_ship_access" ] && data["unique_ship_access"]))
S.unique_ship_access = data[ "unique_ship_access" ]
if(isnum(data["unique_ship_access"]))
S.unique_ship_access = data["unique_ship_access"]

if(istext(data["description"]))
S.description = data["description"]
Expand Down
2 changes: 1 addition & 1 deletion code/datums/brain_damage/imaginary_friend.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

/datum/brain_trauma/special/imaginary_friend/proc/get_ghost()
set waitfor = FALSE
var/list/mob/dead/observer/candidates = pollCandidatesForMob("Do you want to play as [owner]'s imaginary friend?", ROLE_PAI, null, null, 75, friend, POLL_IGNORE_IMAGINARYFRIEND)
var/list/mob/dead/observer/candidates = pollCandidatesForMob("Do you want to play as [owner]'s imaginary friend?", null, null, null, 75, friend, POLL_IGNORE_IMAGINARYFRIEND)
if(LAZYLEN(candidates))
var/mob/dead/observer/C = pick(candidates)
friend.key = C.key
Expand Down
2 changes: 1 addition & 1 deletion code/datums/brain_damage/split_personality.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

/datum/brain_trauma/severe/split_personality/proc/get_ghost()
set waitfor = FALSE
var/list/mob/dead/observer/candidates = pollCandidatesForMob("Do you want to play as [owner]'s split personality?", ROLE_PAI, null, null, 75, stranger_backseat, POLL_IGNORE_SPLITPERSONALITY)
var/list/mob/dead/observer/candidates = pollCandidatesForMob("Do you want to play as [owner]'s split personality?", null, null, null, 75, stranger_backseat, POLL_IGNORE_SPLITPERSONALITY)
if(LAZYLEN(candidates))
var/mob/dead/observer/C = pick(candidates)
stranger_backseat.key = C.key
Expand Down
2 changes: 1 addition & 1 deletion code/datums/elements/_element.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
var/datum/element/ele = SSdcs.GetElement(arguments)
arguments[1] = src
if(ele.Attach(arglist(arguments)) == ELEMENT_INCOMPATIBLE)
CRASH("Incompatible [arguments[1]] assigned to a [type]! args: [json_encode(args)]")
message_admins("Incompatible [arguments[1]] assigned to a [type]! args: [json_encode(args)]")

/**
* Finds the singleton for the element type given and detaches it from src
Expand Down
1 change: 1 addition & 0 deletions code/datums/shuttles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@
/datum/map_template/shuttle/subshuttles
category = "subshuttles"
starting_funds = 0
unique_ship_access = FALSE

/datum/map_template/shuttle/subshuttles/pill
file_name = "independent_pill"
Expand Down
4 changes: 4 additions & 0 deletions code/game/objects/effects/landmarks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,10 @@ INITIALIZE_IMMEDIATE(/obj/effect/landmark/start/new_player)
name = "Emergency response team briefing officer spawn"
icon_state = "ert_brief_spawn"

/obj/effect/landmark/salesman
name = "Salesman spawn"
icon_state = "ert_spawn"

//ninja energy nets teleport victims here
/obj/effect/landmark/holding_facility
name = "Holding Facility"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/admin/fun_balloon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
bodies += M

var/question = "Would you like to be [group_name]?"
var/list/candidates = pollCandidatesForMobs(question, ROLE_PAI, null, FALSE, 100, bodies)
var/list/candidates = pollCandidatesForMobs(question, null, null, FALSE, 100, bodies)
while(LAZYLEN(candidates) && LAZYLEN(bodies))
var/mob/dead/observer/C = pick_n_take(candidates)
var/mob/living/body = pick_n_take(bodies)
Expand Down
81 changes: 7 additions & 74 deletions code/modules/admin/topic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,51 +64,6 @@
to_chat(usr, "<span class='danger'>Not until the round starts!</span>", confidential = TRUE)
return
switch(href_list["makeAntag"])
if("traitors")
if(src.makeTraitors())
message_admins("[key_name_admin(usr)] created traitors.")
log_admin("[key_name(usr)] created traitors.")
else
message_admins("[key_name_admin(usr)] tried to create traitors. Unfortunately, there were no candidates available.")
log_admin("[key_name(usr)] failed to create traitors.")
if("changelings")
if(src.makeChangelings())
message_admins("[key_name(usr)] created changelings.")
log_admin("[key_name(usr)] created changelings.")
else
message_admins("[key_name_admin(usr)] tried to create changelings. Unfortunately, there were no candidates available.")
log_admin("[key_name(usr)] failed to create changelings.")
if("cult")
if(src.makeCult())
message_admins("[key_name(usr)] started a cult.")
log_admin("[key_name(usr)] started a cult.")
else
message_admins("[key_name_admin(usr)] tried to start a cult. Unfortunately, there were no candidates available.")
log_admin("[key_name(usr)] failed to start a cult.")
if("wizard")
message_admins("[key_name(usr)] is creating a wizard...")
if(src.makeWizard())
message_admins("[key_name(usr)] created a wizard.")
log_admin("[key_name(usr)] created a wizard.")
else
message_admins("[key_name_admin(usr)] tried to create a wizard. Unfortunately, there were no candidates available.")
log_admin("[key_name(usr)] failed to create a wizard.")
if("nukeops")
message_admins("[key_name(usr)] is creating a nuke team...")
if(src.makeNukeTeam())
message_admins("[key_name(usr)] created a nuke team.")
log_admin("[key_name(usr)] created a nuke team.")
else
message_admins("[key_name_admin(usr)] tried to create a nuke team. Unfortunately, there were not enough candidates available.")
log_admin("[key_name(usr)] failed to create a nuke team.")
if("ninja")
message_admins("[key_name(usr)] spawned a ninja.")
log_admin("[key_name(usr)] spawned a ninja.")
src.makeSpaceNinja()
if("aliens")
message_admins("[key_name(usr)] started an alien infestation.")
log_admin("[key_name(usr)] started an alien infestation.")
src.makeAliens()
if("deathsquad")
message_admins("[key_name(usr)] is creating a death squad...")
if(src.makeDeathsquad())
Expand All @@ -117,13 +72,6 @@
else
message_admins("[key_name_admin(usr)] tried to create a death squad. Unfortunately, there were not enough candidates available.")
log_admin("[key_name(usr)] failed to create a death squad.")
if("blob")
var/strength = input("Set Blob Resource Gain Rate","Set Resource Rate",1) as num|null
if(!strength)
return
message_admins("[key_name(usr)] spawned a blob with base resource gain [strength].")
log_admin("[key_name(usr)] spawned a blob with base resource gain [strength].")
new/datum/round_event/ghost_role/blob(TRUE, strength)
if("centcom")
message_admins("[key_name(usr)] is creating a response team...")
if(src.makeEmergencyresponseteam())
Expand All @@ -132,21 +80,14 @@
else
message_admins("[key_name_admin(usr)] tried to create a response team. Unfortunately, there were not enough candidates available.")
log_admin("[key_name(usr)] failed to create a response team.")
if("abductors")
message_admins("[key_name(usr)] is creating an abductor team...")
if(src.makeAbductorTeam())
message_admins("[key_name(usr)] created an abductor team.")
log_admin("[key_name(usr)] created an abductor team.")
else
message_admins("[key_name_admin(usr)] tried to create an abductor team. Unfortunately there were not enough candidates available.")
log_admin("[key_name(usr)] failed to create an abductor team.")
if("revenant")
if(src.makeRevenant())
message_admins("[key_name(usr)] created a revenant.")
log_admin("[key_name(usr)] created a revenant.")
if("frontiersmen")
message_admins("[key_name(usr)] is creating frontiersmen...")
if(src.makeFrontiersmen())
message_admins("[key_name(usr)] created frontiersmen.")
log_admin("[key_name(usr)] created a frontiersmen.")
else
message_admins("[key_name_admin(usr)] tried to create a revenant. Unfortunately, there were no candidates available.")
log_admin("[key_name(usr)] failed to create a revenant.")
message_admins("[key_name_admin(usr)] tried to create frontiersmen. Unfortunately, there were not enough candidates available.")
log_admin("[key_name(usr)] failed to create frontiersmen")

else if(href_list["forceevent"])
if(!check_rights(R_FUN))
Expand Down Expand Up @@ -357,14 +298,6 @@
M.change_mob_type(/mob/living/simple_animal/parrot , null, null, delmob)
if("polyparrot")
M.change_mob_type(/mob/living/simple_animal/parrot/Polly , null, null, delmob)
if("constructjuggernaut")
M.change_mob_type(/mob/living/simple_animal/hostile/construct/juggernaut , null, null, delmob)
if("constructartificer")
M.change_mob_type(/mob/living/simple_animal/hostile/construct/artificer , null, null, delmob)
if("constructwraith")
M.change_mob_type(/mob/living/simple_animal/hostile/construct/wraith , null, null, delmob)
if("shade")
M.change_mob_type(/mob/living/simple_animal/shade , null, null, delmob)

else if(href_list["boot2"])
if(!check_rights(R_ADMIN))
Expand Down
Loading
Loading