Merge branch 'dynamicport'

This commit is contained in:
keronshb
2021-10-09 00:28:30 -04:00
76 changed files with 2349 additions and 3077 deletions
-40
View File
@@ -435,18 +435,7 @@
for(var/datum/dynamic_ruleset/roundstart/rule in GLOB.dynamic_forced_roundstart_ruleset)
dat += {"<A href='?src=[REF(src)];[HrefToken()];f_dynamic_roundstart_remove=\ref[rule]'>-> [rule.name] <-</A><br>"}
dat += "<A href='?src=[REF(src)];[HrefToken()];f_dynamic_roundstart_clear=1'>(Clear Rulesets)</A><br>"
dat += "<A href='?src=[REF(src)];[HrefToken()];f_dynamic_storyteller=1'>(Force Storyteller)</A><br>"
if (GLOB.dynamic_forced_storyteller)
var/datum/dynamic_storyteller/S = GLOB.dynamic_forced_storyteller
dat += "<A href='?src=[REF(src)];[HrefToken()];f_dynamic_storyteller_clear=1'>-> [initial(S.name)] <-</A><br>"
dat += "<A href='?src=[REF(src)];[HrefToken()];f_dynamic_options=1'>(Dynamic mode options)</A><br>"
else if (SSticker.IsRoundInProgress())
dat += "<A href='?src=[REF(src)];[HrefToken()];f_dynamic_latejoin=1'>(Force Next Latejoin Ruleset)</A><br>"
if (SSticker && SSticker.mode && istype(SSticker.mode,/datum/game_mode/dynamic))
var/datum/game_mode/dynamic/mode = SSticker.mode
if (mode.forced_latejoin_rule)
dat += {"<A href='?src=[REF(src)];[HrefToken()];f_dynamic_latejoin_clear=1'>-> [mode.forced_latejoin_rule.name] <-</A><br>"}
dat += "<A href='?src=[REF(src)];[HrefToken()];f_dynamic_midround=1'>(Execute Midround Ruleset!)</A><br>"
dat += "<hr/>"
if(SSticker.IsRoundInProgress())
dat += "<a href='?src=[REF(src)];[HrefToken()];gamemode_panel=1'>(Game Mode Panel)</a><BR>"
@@ -711,20 +700,6 @@
log_admin("[key_name(usr)] set the pre-game delay to [DisplayTimeText(newtime)].")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Delay Game Start") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/toggledynamicvote()
set category = "Server"
set desc="Switches between secret/extended and dynamic voting"
set name="Toggle Dynamic Vote"
var/prev_dynamic_voting = CONFIG_GET(flag/dynamic_voting)
CONFIG_SET(flag/dynamic_voting,!prev_dynamic_voting)
if (!prev_dynamic_voting)
to_chat(world, "<B>Vote is now between dynamic storytellers.</B>")
else
to_chat(world, "<B>Vote is now between extended and secret.</B>")
log_admin("[key_name(usr)] [prev_dynamic_voting ? "disabled" : "enabled"] dynamic voting.")
message_admins("<span class='adminnotice'>[key_name_admin(usr)] toggled dynamic voting.</span>")
SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Dynamic Voting", "[prev_dynamic_voting ? "Disabled" : "Enabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/unprison(mob/M in GLOB.mob_list)
set category = "Admin"
set name = "Unprison"
@@ -941,27 +916,12 @@
<b>No stacking:</b> - Option is <a href='?src=[REF(src)];[HrefToken()];f_dynamic_no_stacking=1'> <b>[GLOB.dynamic_no_stacking ? "ON" : "OFF"]</b></a>.
<br/>Unless the threat goes above [GLOB.dynamic_stacking_limit], only one "round-ender" ruleset will be drafted. <br/>
<br/>
<b>Classic secret mode:</b> - Option is <a href='?src=[REF(src)];[HrefToken()];f_dynamic_classic_secret=1'> <b>[GLOB.dynamic_classic_secret ? "ON" : "OFF"]</b></a>.
<br/>Only one roundstart ruleset will be drafted. Only traitors and minor roles will latespawn. <br/>
<br/>
<br/>
<b>Forced threat level:</b> Current value : <a href='?src=[REF(src)];[HrefToken()];f_dynamic_forced_threat=1'><b>[GLOB.dynamic_forced_threat_level]</b></a>.
<br/>The value threat is set to if it is higher than -1.<br/>
<br/>
<b>High population limit:</b> Current value : <a href='?src=[REF(src)];[HrefToken()];f_dynamic_high_pop_limit=1'><b>[GLOB.dynamic_high_pop_limit]</b></a>.
<br/>The threshold at which "high population override" will be in effect. <br/>
<br/>
<b>Stacking threeshold:</b> Current value : <a href='?src=[REF(src)];[HrefToken()];f_dynamic_stacking_limit=1'><b>[GLOB.dynamic_stacking_limit]</b></a>.
<br/>The threshold at which "round-ender" rulesets will stack. A value higher than 100 ensure this never happens. <br/>
<h3>Advanced parameters</h3>
Curve centre: <A href='?src=[REF(src)];[HrefToken()];f_dynamic_roundstart_centre=1'>-> [GLOB.dynamic_curve_centre] <-</A><br>
Curve width: <A href='?src=[REF(src)];[HrefToken()];f_dynamic_roundstart_width=1'>-> [GLOB.dynamic_curve_width] <-</A><br>
Latejoin injection delay:<br>
Minimum: <A href='?src=[REF(src)];[HrefToken()];f_dynamic_roundstart_latejoin_min=1'>-> [GLOB.dynamic_latejoin_delay_min / 60 / 10] <-</A> Minutes<br>
Maximum: <A href='?src=[REF(src)];[HrefToken()];f_dynamic_roundstart_latejoin_max=1'>-> [GLOB.dynamic_latejoin_delay_max / 60 / 10] <-</A> Minutes<br>
Midround injection delay:<br>
Minimum: <A href='?src=[REF(src)];[HrefToken()];f_dynamic_roundstart_midround_min=1'>-> [GLOB.dynamic_midround_delay_min / 60 / 10] <-</A> Minutes<br>
Maximum: <A href='?src=[REF(src)];[HrefToken()];f_dynamic_roundstart_midround_max=1'>-> [GLOB.dynamic_midround_delay_max / 60 / 10] <-</A> Minutes<br>
"}
user << browse(dat, "window=dyn_mode_options;size=900x650")
+4 -3
View File
@@ -135,7 +135,6 @@ GLOBAL_PROTECT(admin_verbs_server)
/client/proc/everyone_random,
/datum/admins/proc/toggleAI,
/datum/admins/proc/toggleMulticam, //CIT
/datum/admins/proc/toggledynamicvote, //CIT
/client/proc/cmd_admin_delete, /*delete an instance/object/mob/etc*/
/client/proc/cmd_debug_del_all,
/client/proc/toggle_random_events,
@@ -190,9 +189,11 @@ GLOBAL_PROTECT(admin_verbs_debug)
// /client/proc/validate_cards,
// /client/proc/test_cardpack_distribution,
// /client/proc/print_cards,
// #ifdef TESTING
#ifdef TESTING
// /client/proc/check_missing_sprites,
// #endif
// /client/proc/export_dynamic_json,
/client/proc/run_dynamic_simulations,
#endif
/datum/admins/proc/create_or_modify_area,
/datum/admins/proc/fixcorruption,
#ifdef EXTOOLS_REFERENCE_TRACKING
+1 -1
View File
@@ -77,7 +77,7 @@ GLOBAL_VAR(antag_prototypes)
return common_commands
/datum/mind/proc/get_special_statuses()
var/list/result = list()
var/list/result = LAZYCOPY(special_statuses)
if(!current)
result += "<span class='bad'>No body!</span>"
if(current && HAS_TRAIT(current, TRAIT_MINDSHIELD))
+8 -234
View File
@@ -1375,15 +1375,13 @@
else if(href_list["f_dynamic_roundstart"])
if(!check_rights(R_ADMIN))
return
if(SSticker && SSticker.mode)
return alert(usr, "The game has already started.", null, null, null, null)
if(GLOB.master_mode != "dynamic")
return alert(usr, "The game mode has to be dynamic mode.", null, null, null, null)
if(SSticker?.mode)
return tgui_alert(usr, "The game has already started.")
var/roundstart_rules = list()
for (var/rule in subtypesof(/datum/dynamic_ruleset/roundstart))
var/datum/dynamic_ruleset/roundstart/newrule = new rule()
roundstart_rules[newrule.name] = newrule
var/added_rule = input(usr,"What ruleset do you want to force? This will bypass threat level and population restrictions.", "Rigging Roundstart", null) as null|anything in roundstart_rules
var/added_rule = input(usr,"What ruleset do you want to force? This will bypass threat level and population restrictions.", "Rigging Roundstart", null) as null|anything in sortList(roundstart_rules)
if (added_rule)
GLOB.dynamic_forced_roundstart_ruleset += roundstart_rules[added_rule]
log_admin("[key_name(usr)] set [added_rule] to be a forced roundstart ruleset.")
@@ -1407,201 +1405,18 @@
log_admin("[key_name(usr)] removed [rule] from the forced roundstart rulesets.")
message_admins("[key_name(usr)] removed [rule] from the forced roundstart rulesets.", 1)
else if(href_list["f_dynamic_storyteller"])
if(!check_rights(R_ADMIN))
return
if(SSticker && SSticker.mode)
return alert(usr, "The game has already started.", null, null, null, null)
if(GLOB.master_mode != "dynamic")
return alert(usr, "The game mode has to be dynamic mode.", null, null, null, null)
var/list/choices = list()
for(var/T in config.storyteller_cache)
var/datum/dynamic_storyteller/S = T
choices[initial(S.name)] = T
var/choice = choices[input("Select storyteller:", "Storyteller", "Classic") as null|anything in choices]
if(choice)
GLOB.dynamic_forced_storyteller = choice
log_admin("[key_name(usr)] forced the storyteller to [GLOB.dynamic_forced_storyteller].")
message_admins("[key_name(usr)] forced the storyteller to [GLOB.dynamic_forced_storyteller].")
Game()
else if(href_list["f_dynamic_storyteller_clear"])
if(!check_rights(R_ADMIN))
return
GLOB.dynamic_forced_storyteller = null
Game()
log_admin("[key_name(usr)] cleared the forced storyteller. The mode will pick one as normal.")
message_admins("[key_name(usr)] cleared the forced storyteller. The mode will pick one as normal.", 1)
else if(href_list["f_dynamic_latejoin"])
if(!check_rights(R_ADMIN))
return
if(!SSticker || !SSticker.mode)
return alert(usr, "The game must start first.", null, null, null, null)
if(GLOB.master_mode != "dynamic")
return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null)
var/latejoin_rules = list()
for (var/rule in subtypesof(/datum/dynamic_ruleset/latejoin))
var/datum/dynamic_ruleset/latejoin/newrule = new rule()
latejoin_rules[newrule.name] = newrule
var/added_rule = input(usr,"What ruleset do you want to force upon the next latejoiner? This will bypass threat level and population restrictions.", "Rigging Latejoin", null) as null|anything in latejoin_rules
if (added_rule)
var/datum/game_mode/dynamic/mode = SSticker.mode
mode.forced_latejoin_rule = latejoin_rules[added_rule]
log_admin("[key_name(usr)] set [added_rule] to proc on the next latejoin.")
message_admins("[key_name(usr)] set [added_rule] to proc on the next latejoin.", 1)
Game()
else if(href_list["f_dynamic_latejoin_clear"])
if(!check_rights(R_ADMIN))
return
if (SSticker && SSticker.mode && istype(SSticker.mode,/datum/game_mode/dynamic))
var/datum/game_mode/dynamic/mode = SSticker.mode
mode.forced_latejoin_rule = null
Game()
log_admin("[key_name(usr)] cleared the forced latejoin ruleset.")
message_admins("[key_name(usr)] cleared the forced latejoin ruleset.", 1)
else if(href_list["f_dynamic_midround"])
if(!check_rights(R_ADMIN))
return
if(!SSticker || !SSticker.mode)
return alert(usr, "The game must start first.", null, null, null, null)
if(GLOB.master_mode != "dynamic")
return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null)
var/midround_rules = list()
for (var/rule in subtypesof(/datum/dynamic_ruleset/midround))
var/datum/dynamic_ruleset/midround/newrule = new rule()
midround_rules[newrule.name] = rule
var/added_rule = input(usr,"What ruleset do you want to force right now? This will bypass threat level and population restrictions.", "Execute Ruleset", null) as null|anything in midround_rules
if (added_rule)
var/datum/game_mode/dynamic/mode = SSticker.mode
log_admin("[key_name(usr)] executed the [added_rule] ruleset.")
message_admins("[key_name(usr)] executed the [added_rule] ruleset.", 1)
mode.picking_specific_rule(midround_rules[added_rule],1)
else if (href_list["f_dynamic_options"])
if(!check_rights(R_ADMIN))
return
if(SSticker && SSticker.mode)
return alert(usr, "The game has already started.", null, null, null, null)
if(GLOB.master_mode != "dynamic")
return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null)
if(SSticker?.mode)
return tgui_alert(usr, "The game has already started.")
dynamic_mode_options(usr)
else if(href_list["f_dynamic_roundstart_centre"])
if(!check_rights(R_ADMIN))
return
if(SSticker && SSticker.mode)
return alert(usr, "The game has already started.", null, null, null, null)
if(GLOB.master_mode != "dynamic")
return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null)
var/new_centre = input(usr,"Change the centre of the dynamic mode threat curve. A negative value will give a more peaceful round ; a positive value, a round with higher threat. Any number is allowed. This is adjusted by dynamic voting.", "Change curve centre", null) as num
log_admin("[key_name(usr)] changed the distribution curve center to [new_centre].")
message_admins("[key_name(usr)] changed the distribution curve center to [new_centre]", 1)
GLOB.dynamic_curve_centre = new_centre
dynamic_mode_options(usr)
else if(href_list["f_dynamic_roundstart_width"])
if(!check_rights(R_ADMIN))
return
if(SSticker && SSticker.mode)
return alert(usr, "The game has already started.", null, null, null, null)
if(GLOB.master_mode != "dynamic")
return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null)
var/new_width = input(usr,"Change the width of the dynamic mode threat curve. A higher value will favour extreme rounds ; a lower value, a round closer to the average. Any Number between 0.5 and 4 are allowed.", "Change curve width", null) as num
if (new_width < 0.5 || new_width > 4)
return alert(usr, "Only values between 0.5 and +2.5 are allowed.", null, null, null, null)
log_admin("[key_name(usr)] changed the distribution curve width to [new_width].")
message_admins("[key_name(usr)] changed the distribution curve width to [new_width]", 1)
GLOB.dynamic_curve_width = new_width
dynamic_mode_options(usr)
else if(href_list["f_dynamic_roundstart_latejoin_min"])
if(!check_rights(R_ADMIN))
return
if(SSticker && SSticker.mode)
return alert(usr, "The game has already started.", null, null, null, null)
if(GLOB.master_mode != "dynamic")
return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null)
var/new_min = input(usr,"Change the minimum delay of latejoin injection in minutes.", "Change latejoin injection delay minimum", null) as num
if(new_min <= 0)
return alert(usr, "The minimum can't be zero or lower.", null, null, null, null)
if((new_min MINUTES) > GLOB.dynamic_latejoin_delay_max)
return alert(usr, "The minimum must be lower than the maximum.", null, null, null, null)
log_admin("[key_name(usr)] changed the latejoin injection minimum delay to [new_min] minutes.")
message_admins("[key_name(usr)] changed the latejoin injection minimum delay to [new_min] minutes", 1)
GLOB.dynamic_latejoin_delay_min = (new_min MINUTES)
dynamic_mode_options(usr)
else if(href_list["f_dynamic_roundstart_latejoin_max"])
if(!check_rights(R_ADMIN))
return
if(SSticker && SSticker.mode)
return alert(usr, "The game has already started.", null, null, null, null)
if(GLOB.master_mode != "dynamic")
return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null)
var/new_max = input(usr,"Change the maximum delay of latejoin injection in minutes.", "Change latejoin injection delay maximum", null) as num
if(new_max <= 0)
return alert(usr, "The maximum can't be zero or lower.", null, null, null, null)
if((new_max MINUTES) < GLOB.dynamic_latejoin_delay_min)
return alert(usr, "The maximum must be higher than the minimum.", null, null, null, null)
log_admin("[key_name(usr)] changed the latejoin injection maximum delay to [new_max] minutes.")
message_admins("[key_name(usr)] changed the latejoin injection maximum delay to [new_max] minutes", 1)
GLOB.dynamic_latejoin_delay_max = (new_max MINUTES)
dynamic_mode_options(usr)
else if(href_list["f_dynamic_roundstart_midround_min"])
if(!check_rights(R_ADMIN))
return
if(SSticker && SSticker.mode)
return alert(usr, "The game has already started.", null, null, null, null)
if(GLOB.master_mode != "dynamic")
return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null)
var/new_min = input(usr,"Change the minimum delay of midround injection in minutes.", "Change midround injection delay minimum", null) as num
if(new_min <= 0)
return alert(usr, "The minimum can't be zero or lower.", null, null, null, null)
if((new_min MINUTES) > GLOB.dynamic_midround_delay_max)
return alert(usr, "The minimum must be lower than the maximum.", null, null, null, null)
log_admin("[key_name(usr)] changed the midround injection minimum delay to [new_min] minutes.")
message_admins("[key_name(usr)] changed the midround injection minimum delay to [new_min] minutes", 1)
GLOB.dynamic_midround_delay_min = (new_min MINUTES)
dynamic_mode_options(usr)
else if(href_list["f_dynamic_roundstart_midround_max"])
if(!check_rights(R_ADMIN))
return
if(SSticker && SSticker.mode)
return alert(usr, "The game has already started.", null, null, null, null)
if(GLOB.master_mode != "dynamic")
return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null)
var/new_max = input(usr,"Change the maximum delay of midround injection in minutes.", "Change midround injection delay maximum", null) as num
if(new_max <= 0)
return alert(usr, "The maximum can't be zero or lower.", null, null, null, null)
if((new_max MINUTES) > GLOB.dynamic_midround_delay_max)
return alert(usr, "The maximum must be higher than the minimum.", null, null, null, null)
log_admin("[key_name(usr)] changed the midround injection maximum delay to [new_max] minutes.")
message_admins("[key_name(usr)] changed the midround injection maximum delay to [new_max] minutes", 1)
GLOB.dynamic_midround_delay_max = (new_max MINUTES)
dynamic_mode_options(usr)
else if(href_list["f_dynamic_force_extended"])
if(!check_rights(R_ADMIN))
return
if(GLOB.master_mode != "dynamic")
return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null)
GLOB.dynamic_forced_extended = !GLOB.dynamic_forced_extended
log_admin("[key_name(usr)] set 'forced_extended' to [GLOB.dynamic_forced_extended].")
message_admins("[key_name(usr)] set 'forced_extended' to [GLOB.dynamic_forced_extended].")
@@ -1611,70 +1426,29 @@
if(!check_rights(R_ADMIN))
return
if(GLOB.master_mode != "dynamic")
return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null)
GLOB.dynamic_no_stacking = !GLOB.dynamic_no_stacking
log_admin("[key_name(usr)] set 'no_stacking' to [GLOB.dynamic_no_stacking].")
message_admins("[key_name(usr)] set 'no_stacking' to [GLOB.dynamic_no_stacking].")
dynamic_mode_options(usr)
else if(href_list["f_dynamic_classic_secret"])
if(!check_rights(R_ADMIN))
return
if(GLOB.master_mode != "dynamic")
return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null)
GLOB.dynamic_classic_secret = !GLOB.dynamic_classic_secret
log_admin("[key_name(usr)] set 'classic_secret' to [GLOB.dynamic_classic_secret].")
message_admins("[key_name(usr)] set 'classic_secret' to [GLOB.dynamic_classic_secret].")
dynamic_mode_options(usr)
else if(href_list["f_dynamic_stacking_limit"])
if(!check_rights(R_ADMIN))
return
if(GLOB.master_mode != "dynamic")
return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null)
GLOB.dynamic_stacking_limit = input(usr,"Change the threat limit at which round-endings rulesets will start to stack.", "Change stacking limit", null) as num
log_admin("[key_name(usr)] set 'stacking_limit' to [GLOB.dynamic_stacking_limit].")
message_admins("[key_name(usr)] set 'stacking_limit' to [GLOB.dynamic_stacking_limit].")
dynamic_mode_options(usr)
else if(href_list["f_dynamic_high_pop_limit"])
if(!check_rights(R_ADMIN))
return
if(SSticker && SSticker.mode)
return alert(usr, "The game has already started.", null, null, null, null)
if(GLOB.master_mode != "dynamic")
return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null)
var/new_value = input(usr, "Enter the high-pop override threshold for dynamic mode.", "High pop override") as num
if (new_value < 0)
return alert(usr, "Only positive values allowed!", null, null, null, null)
GLOB.dynamic_high_pop_limit = new_value
log_admin("[key_name(usr)] set 'high_pop_limit' to [GLOB.dynamic_high_pop_limit].")
message_admins("[key_name(usr)] set 'high_pop_limit' to [GLOB.dynamic_high_pop_limit].")
dynamic_mode_options(usr)
else if(href_list["f_dynamic_forced_threat"])
if(!check_rights(R_ADMIN))
return
if(SSticker && SSticker.mode)
return alert(usr, "The game has already started.", null, null, null, null)
if(GLOB.master_mode != "dynamic")
return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null)
if(SSticker?.mode)
return tgui_alert(usr, "The game has already started.")
var/new_value = input(usr, "Enter the forced threat level for dynamic mode.", "Forced threat level") as num
if (new_value > 100)
return alert(usr, "The value must be be under 100.", null, null, null, null)
return tgui_alert(usr, "The value must be be under 100.")
GLOB.dynamic_forced_threat_level = new_value
log_admin("[key_name(usr)] set 'forced_threat_level' to [GLOB.dynamic_forced_threat_level].")
@@ -55,9 +55,15 @@ GLOBAL_LIST_EMPTY(antagonists)
/datum/antagonist/proc/specialization(datum/mind/new_owner)
return src
///Called by the transfer_to() mind proc after the mind (mind.current and new_character.mind) has moved but before the player (key and client) is transfered.
/datum/antagonist/proc/on_body_transfer(mob/living/old_body, mob/living/new_body)
SHOULD_CALL_PARENT(TRUE)
remove_innate_effects(old_body)
if(old_body.stat != DEAD && !LAZYLEN(old_body.mind?.antag_datums))
old_body.remove_from_current_living_antags()
apply_innate_effects(new_body)
if(new_body.stat != DEAD)
new_body.add_to_current_living_antags()
//This handles the application of antag huds/special abilities
/datum/antagonist/proc/apply_innate_effects(mob/living/mob_override)
@@ -94,8 +100,9 @@ GLOBAL_LIST_EMPTY(antagonists)
/datum/antagonist/proc/create_team(datum/team/team)
return
//Proc called when the datum is given to a mind.
///Called by the add_antag_datum() mind proc after the instanced datum is added to the mind's antag_datums list.
/datum/antagonist/proc/on_gain()
SHOULD_CALL_PARENT(TRUE)
set waitfor = FALSE
if(!(owner?.current))
return
@@ -113,6 +120,8 @@ GLOBAL_LIST_EMPTY(antagonists)
if(istype(M))
M.name = "[name] Training"
owner.current.AddComponent(/datum/component/activity)
if(owner.current.stat != DEAD)
owner.current.add_to_current_living_antags()
SEND_SIGNAL(owner.current, COMSIG_MOB_ANTAG_ON_GAIN, src)
/datum/antagonist/proc/is_banned(mob/M)
@@ -131,13 +140,17 @@ GLOBAL_LIST_EMPTY(antagonists)
owner.current.ghostize(0)
C.transfer_ckey(owner.current, FALSE)
///Called by the remove_antag_datum() and remove_all_antag_datums() mind procs for the antag datum to handle its own removal and deletion.
/datum/antagonist/proc/on_removal()
SHOULD_CALL_PARENT(TRUE)
remove_innate_effects()
clear_antag_moodies()
if(owner)
LAZYREMOVE(owner.antag_datums, src)
for(var/A in skill_modifiers)
owner.remove_skill_modifier(GET_SKILL_MOD_ID(A, type))
if(!LAZYLEN(owner.antag_datums))
owner.current.remove_from_current_living_antags()
if(!silent && owner.current)
farewell()
var/datum/team/team = get_team()
@@ -94,15 +94,6 @@ GLOBAL_VAR_INIT(war_declared, FALSE)
if(board.moved)
to_chat(user, "The shuttle has already been moved! You have forfeit the right to declare war.")
return FALSE
if(istype(SSticker.mode, /datum/game_mode/dynamic))
var/datum/game_mode/dynamic/mode = SSticker.mode
if(!(mode.storyteller.flags & WAROPS_ALWAYS_ALLOWED))
if(mode.threat_level < CONFIG_GET(number/dynamic_warops_requirement))
to_chat(user, "Due to the dynamic space in which the station resides, you are too deep into Nanotrasen territory to reasonably go loud.")
return FALSE
else if(mode.threat < CONFIG_GET(number/dynamic_warops_cost))
to_chat(user, "Due to recent threats on the station, Nanotrasen is looking too closely for a war declaration to be wise.")
return FALSE
return TRUE
/obj/item/nuclear_challenge/clownops
+156 -19
View File
@@ -1,3 +1,5 @@
#define DECONVERTER_STATION_WIN "gamemode_station_win"
#define DECONVERTER_REVS_WIN "gamemode_revs_win"
//How often to check for promotion possibility
#define HEAD_UPDATE_PERIOD 300
@@ -10,6 +12,11 @@
threat = 2
var/hud_type = "rev"
var/datum/team/revolution/rev_team
///when this antagonist is being de-antagged, this is why
var/deconversion_reason
/// What message should the player receive when they are being demoted, and the revolution has won?
var/victory_message = "The revolution has overpowered the command staff! Viva la revolution! Execute any head of staff and security should you find them alive."
/datum/antagonist/rev/can_be_owned(datum/mind/new_owner)
. = ..()
@@ -201,7 +208,22 @@
new_rev.silent = FALSE
to_chat(old_owner, "<span class='userdanger'>Revolution has been disappointed of your leader traits! You are a regular revolutionary now!</span>")
/// Checks if the revolution succeeded, and lets them know.
/datum/antagonist/rev/proc/announce_victorious()
. = rev_team.check_rev_victory()
if (!.)
return
to_chat(owner, "<span class='deconversion_message bold'>[victory_message]</span>")
var/policy = get_policy(ROLE_REV_SUCCESSFUL)
if (policy)
to_chat(owner, policy)
/datum/antagonist/rev/farewell()
if (announce_victorious())
return
if(ishuman(owner.current))
owner.current.visible_message("<span class='deconversion_message'>[owner.current] looks like [owner.current.p_theyve()] just remembered [owner.current.p_their()] real allegiance!</span>", null, null, null, owner.current)
to_chat(owner, "<span class='userdanger'>You are no longer a brainwashed revolutionary! Your memory is hazy from the time you were a rebel... You don't seem to be able to recall the names of your comrades, not even your leaders...</span>")
@@ -210,15 +232,17 @@
to_chat(owner, "<span class='userdanger'>The frame's firmware detects and deletes your neural reprogramming! You remember nothing of your time spent reprogrammed, you can't even remember the names or identities of anyone involved...</span>")
/datum/antagonist/rev/head/farewell()
if((ishuman(owner.current) || ismonkey(owner.current)))
if (announce_victorious() || deconversion_reason == DECONVERTER_STATION_WIN)
return
if((ishuman(owner.current)))
if(owner.current.stat != DEAD)
owner.current.visible_message("<span class='deconversion_message'>[owner.current] looks like [owner.current.p_theyve()] just remembered [owner.current.p_their()] real allegiance!</span>", null, null, null, owner.current)
owner.current.visible_message(span_deconversion_message("[owner.current] looks like [owner.current.p_theyve()] just remembered [owner.current.p_their()] real allegiance!"), null, null, null, owner.current)
to_chat(owner, "<span class ='deconversion_message bold'>You have given up your cause of overthrowing the command staff. You are no longer a Head Revolutionary.</span>")
else
to_chat(owner, "<span class ='deconversion_message bold'>The sweet release of death. You are no longer a Head Revolutionary.</span>")
else if(issilicon(owner.current))
owner.current.visible_message("<span class='deconversion_message'>The frame beeps contentedly, suppressing the disloyal personality traits from the MMI before initalizing it.</span>", null, null, null, owner.current)
to_chat(owner, "<span class='userdanger'>The frame's firmware detects and suppresses your unwanted personality traits! You feel more content with the leadership around these parts.</span>")
owner.current.visible_message(span_deconversion_message("The frame beeps contentedly, suppressing the disloyal personality traits from the MMI before initalizing it."), null, null, null, owner.current)
to_chat(owner, span_userdanger("The frame's firmware detects and suppresses your unwanted personality traits! You feel more content with the leadership around these parts."))
//blunt trauma deconversions call this through species.dm spec_attacked_by()
/datum/antagonist/rev/proc/remove_revolutionary(borged, deconverter)
@@ -226,13 +250,14 @@
if(borged)
message_admins("[ADMIN_LOOKUPFLW(owner.current)] has been borged while being a [name]")
owner.special_role = null
if(iscarbon(owner.current))
if(iscarbon(owner.current) && deconverter != DECONVERTER_REVS_WIN)
var/mob/living/carbon/C = owner.current
C.Unconscious(100)
deconversion_reason = deconverter
owner.remove_antag_datum(type)
/datum/antagonist/rev/head/remove_revolutionary(borged,deconverter)
if(borged || deconverter == "gamemode")
if(borged || deconverter == DECONVERTER_STATION_WIN || deconverter == DECONVERTER_REVS_WIN)
. = ..()
/datum/antagonist/rev/head/equip_rev()
@@ -262,6 +287,21 @@
S.Insert(H, special = FALSE, drop_if_replaced = FALSE)
to_chat(H, "Your eyes have been implanted with a cybernetic security HUD which will help you keep track of who is mindshield-implanted, and therefore unable to be recruited.")
/// "Enemy of the Revolutionary", given to heads and security when the revolution wins
/datum/antagonist/revolution_enemy
name = "Enemy of the Revolution"
show_in_antagpanel = FALSE
/datum/antagonist/revolution_enemy/on_gain()
owner.special_role = "revolution enemy"
var/datum/objective/survive/survive = new /datum/objective/survive
survive.owner = owner
survive.explanation_text = "The station has been overrun by revolutionaries, stay alive until the end."
objectives += survive
return ..()
/datum/team/revolution
name = "Revolution"
var/max_headrevs = 3
@@ -314,6 +354,100 @@
ex_headrevs = get_antag_minds(/datum/antagonist/rev/head, TRUE)
ex_revs = get_antag_minds(/datum/antagonist/rev, TRUE)
/// Checks if revs have won
/datum/team/revolution/proc/check_rev_victory()
for(var/datum/objective/mutiny/objective in objectives)
if(!(objective.check_completion()))
return FALSE
return TRUE
/// Checks if heads have won
/datum/team/revolution/proc/check_heads_victory()
for(var/datum/mind/rev_mind in head_revolutionaries())
var/turf/rev_turf = get_turf(rev_mind.current)
if(!considered_afk(rev_mind) && considered_alive(rev_mind) && is_station_level(rev_turf.z))
if(ishuman(rev_mind.current))
return FALSE
return TRUE
/// Updates the state of the world depending on if revs won or loss.
/// Returns who won, at which case this method should no longer be called.
/// If revs_win_injection_amount is passed, then that amount of threat will be added if the revs win.
/datum/team/revolution/proc/process_victory(revs_win_injection_amount)
if (check_rev_victory())
. = REVOLUTION_VICTORY
else if (check_heads_victory())
. = STATION_VICTORY
else
return
SSshuttle.clearHostileEnvironment(src)
save_members()
// Remove everyone as a revolutionary
for (var/_rev_mind in members)
var/datum/mind/rev_mind = _rev_mind
if (rev_mind.has_antag_datum(/datum/antagonist/rev))
var/datum/antagonist/rev/rev_antag = rev_mind.has_antag_datum(/datum/antagonist/rev)
rev_antag.remove_revolutionary(FALSE, . == STATION_VICTORY ? DECONVERTER_STATION_WIN : DECONVERTER_REVS_WIN)
LAZYADD(rev_mind.special_statuses, "<span class='bad'>Former [(rev_mind in ex_headrevs) ? "head revolutionary" : "revolutionary"]</span>")
if (. == STATION_VICTORY)
// If the revolution was quelled, make rev heads unable to be revived through pods
for (var/_rev_head_mind in ex_revs)
var/datum/mind/rev_head_mind = _rev_head_mind
var/mob/living/carbon/rev_head_body = rev_head_mind.current
if(istype(rev_head_body) && rev_head_body.stat == DEAD)
rev_head_body.makeUncloneable()
priority_announce("It appears the mutiny has been quelled. Please return yourself and your incapacitated colleagues to work. \
We have remotely blacklisted the head revolutionaries in your medical records to prevent accidental revival.", null, 'sound/announcer/classic/attention.ogg', null, "Central Command Loyalty Monitoring Division")
else
for (var/_player in GLOB.player_list)
var/mob/player = _player
var/datum/mind/mind = player.mind
if (isnull(mind))
continue
if (!(mind.assigned_role in GLOB.command_positions + GLOB.security_positions))
continue
var/mob/living/carbon/target_body = mind.current
mind.add_antag_datum(/datum/antagonist/revolution_enemy)
if (!istype(target_body))
continue
if (target_body.stat == DEAD)
target_body.makeUncloneable()
else
mind.announce_objectives()
for (var/job_name in GLOB.command_positions + GLOB.security_positions)
var/datum/job/job = SSjob.GetJob(job_name)
job.allow_bureaucratic_error = FALSE
job.total_positions = 0
if (revs_win_injection_amount)
var/datum/game_mode/dynamic/dynamic = SSticker.mode
dynamic.create_threat(revs_win_injection_amount)
dynamic.threat_log += "[worldtime2text()]: Revolution victory. Added [revs_win_injection_amount] threat."
priority_announce("A recent assessment of your station has marked your station as a severe risk area for high ranking Nanotrasen officials. \
For the safety of our staff, we have blacklisted your station for new employment of security and command. \
[pick(world.file2list("strings/anti_union_propaganda.txt"))]", null, 'sound/announcer/classic/attention.ogg', null, "Central Command Loyalty Monitoring Division")
/// Mutates the ticker to report that the revs have won
/datum/team/revolution/proc/round_result(finished)
if (finished == REVOLUTION_VICTORY)
SSticker.mode_result = "win - heads killed"
SSticker.news_report = REVS_WIN
else if (finished == STATION_VICTORY)
SSticker.mode_result = "loss - rev heads killed"
SSticker.news_report = REVS_LOSE
/datum/team/revolution/roundend_report()
if(!members.len && !ex_headrevs.len)
return
@@ -322,18 +456,6 @@
result += "<div class='panel redborder'>"
var/num_revs = 0
var/num_survivors = 0
for(var/mob/living/carbon/survivor in GLOB.alive_mob_list)
if(survivor.ckey)
num_survivors++
if(survivor.mind)
if(is_revolutionary(survivor))
num_revs++
if(num_survivors)
result += "Command's Approval Rating: <B>[100 - round((num_revs/num_survivors)*100, 0.1)]%</B><br>"
var/list/targets = list()
var/list/datum/mind/headrevs
var/list/datum/mind/revs
@@ -346,10 +468,22 @@
revs = ex_revs
else
revs = get_antag_minds(/datum/antagonist/rev, TRUE)
var/num_revs = 0
var/num_survivors = 0
for(var/mob/living/carbon/survivor in GLOB.alive_mob_list)
if(survivor.ckey)
num_survivors += 1
if ((survivor.mind in revs) || (survivor.mind in headrevs))
num_revs += 1
if(num_survivors)
result += "Command's Approval Rating: <B>[100 - round((num_revs/num_survivors)*100, 0.1)]%</B><br>"
if(headrevs.len)
var/list/headrev_part = list()
headrev_part += "<span class='header'>The head revolutionaries were:</span>"
headrev_part += printplayerlist(headrevs,TRUE)
headrev_part += printplayerlist(headrevs, !check_rev_victory())
result += headrev_part.Join("<br>")
if(revs.len)
@@ -408,3 +542,6 @@
/datum/team/revolution/is_gamemode_hero()
return SSticker.mode.name == "revolution"
#undef DECONVERTER_STATION_WIN
#undef DECONVERTER_REVS_WIN
@@ -3,7 +3,6 @@
typepath = /datum/round_event/ghost_role/slaughter
weight = 1 //Very rare
max_occurrences = 1
gamemode_blacklist = list("dynamic")
earliest_start = 1 HOURS
min_players = 20
@@ -5,6 +5,7 @@
max_occurrences = 1 //Only once okay fam
earliest_start = 30 MINUTES
min_players = 35
dynamic_should_hijack = TRUE
/datum/round_event/spawn_swarmer
@@ -28,17 +28,11 @@
/datum/traitor_class/human/forge_single_objective(datum/antagonist/traitor/T)
.=1
var/assassin_prob = 50
var/is_dynamic = FALSE
var/datum/game_mode/dynamic/mode
if(istype(SSticker.mode,/datum/game_mode/dynamic))
mode = SSticker.mode
is_dynamic = TRUE
assassin_prob = max(0,mode.threat_level-20)
if(prob(assassin_prob))
if(is_dynamic)
var/threat_spent = CONFIG_GET(number/dynamic_assassinate_cost)
mode.spend_threat(threat_spent)
mode.log_threat("[T.owner.name] added [threat_spent] on an assassination target.")
var/list/active_ais = active_ais()
if(active_ais.len && prob(100/GLOB.joined_player_list.len))
var/datum/objective/destroy/destroy_objective = new
@@ -46,17 +46,13 @@
traitor_kind.on_process(src)
/proc/get_random_traitor_kind(var/list/blacklist = list())
var/chaos_weight = 0
if(istype(SSticker.mode,/datum/game_mode/dynamic))
var/datum/game_mode/dynamic/mode = SSticker.mode
chaos_weight = (mode.threat - 50)/50
var/list/weights = list()
for(var/C in GLOB.traitor_classes)
if(!(C in blacklist))
var/datum/traitor_class/class = GLOB.traitor_classes[C]
if(class.min_players > length(GLOB.joined_player_list))
continue
var/weight = LOGISTIC_FUNCTION(1.5*class.weight,chaos_weight,class.chaos,0)
var/weight = LOGISTIC_FUNCTION(1.5*class.weight,0,class.chaos,0)
weights[C] = weight * 1000
var/choice = pickweight(weights, 0)
if(!choice)
+17 -2
View File
@@ -1,3 +1,5 @@
#define RANDOM_EVENT_ADMIN_INTERVENTION_TIME 10
//this datum is used by the events controller to dictate how it selects events
/datum/round_event_control
var/name //The human-readable name of the event
@@ -27,6 +29,9 @@
var/triggering //admin cancellation
/// Whether or not dynamic should hijack this event
var/dynamic_should_hijack = FALSE
/datum/round_event_control/New()
if(config && !wizardevent) // Magic is unaffected by configs
earliest_start = CEILING(earliest_start * CONFIG_GET(number/events_min_time_mul), 1)
@@ -53,6 +58,11 @@
return FALSE
if(holidayID && (!SSevents.holidays || !SSevents.holidays[holidayID]))
return FALSE
var/datum/game_mode/dynamic/dynamic = SSticker.mode
if (istype(dynamic) && dynamic_should_hijack && dynamic.random_event_hijacked != HIJACKED_NOTHING)
return FALSE
return TRUE
/datum/round_event_control/wizard/canSpawnEvent(var/players_amt, var/gamemode)
@@ -62,14 +72,19 @@
return can_be_midround_wizard && ..()
return ..()
/datum/round_event_control/proc/preRunEvent()
if(!ispath(typepath, /datum/round_event))
return EVENT_CANT_RUN
if (SEND_GLOBAL_SIGNAL(COMSIG_GLOB_PRE_RANDOM_EVENT, src) & CANCEL_PRE_RANDOM_EVENT)
return EVENT_INTERRUPTED
triggering = TRUE
if (alert_observers)
message_admins("Random Event triggering in 30 seconds: [name] (<a href='?src=[REF(src)];cancel=1'>CANCEL</a>)")
sleep(300)
message_admins("Random Event triggering in [RANDOM_EVENT_ADMIN_INTERVENTION_TIME] seconds: [name] (<a href='?src=[REF(src)];cancel=1'>CANCEL</a>)")
sleep(RANDOM_EVENT_ADMIN_INTERVENTION_TIME SECONDS)
var/gamemode = SSticker.mode.config_tag
var/players_amt = get_active_player_count(alive_check = TRUE, afk_check = TRUE, human_check = TRUE)
if(!canSpawnEvent(players_amt, gamemode))
+1 -1
View File
@@ -4,7 +4,7 @@
weight = 10
max_occurrences = 1
min_players = 30
gamemode_blacklist = list("nuclear","wizard","revolution","dynamic")
dynamic_should_hijack = TRUE
/datum/round_event/ghost_role/abductor
minimum_required = 2
+1 -1
View File
@@ -2,9 +2,9 @@
name = "Alien Infestation"
typepath = /datum/round_event/ghost_role/alien_infestation
weight = 5
gamemode_blacklist = list("dynamic")
min_players = 25
max_occurrences = 1
dynamic_should_hijack = TRUE
/datum/round_event/ghost_role/alien_infestation
announceWhen = 400
+1 -2
View File
@@ -6,8 +6,7 @@
earliest_start = 40 MINUTES
min_players = 35
gamemode_blacklist = list("blob","dynamic") //Just in case a blob survives that long
dynamic_should_hijack = TRUE
/datum/round_event/ghost_role/blob
announceWhen = -1
-1
View File
@@ -4,7 +4,6 @@
max_occurrences = 1
min_players = 20
earliest_start = 30 MINUTES //deadchat sink, lets not even consider it early on.
gamemode_blacklist = list("nuclear")
/datum/round_event/ghost_role/fugitives
minimum_required = 1
+1 -1
View File
@@ -3,7 +3,7 @@
typepath = /datum/round_event/ghost_role/nightmare
max_occurrences = 1
min_players = 20
gamemode_blacklist = list("dynamic")
dynamic_should_hijack = TRUE
/datum/round_event/ghost_role/nightmare
minimum_required = 1
+1
View File
@@ -3,6 +3,7 @@
typepath = /datum/round_event/ghost_role/operative
weight = 0 //Admin only
max_occurrences = 1
dynamic_should_hijack = TRUE
/datum/round_event/ghost_role/operative
minimum_required = 1
+26 -39
View File
@@ -5,7 +5,7 @@
max_occurrences = 1
min_players = 10
earliest_start = 30 MINUTES
gamemode_blacklist = list("nuclear")
dynamic_should_hijack = TRUE
#define PIRATES_ROGUES "Rogues"
// #define PIRATES_SILVERSCALES "Silverscales"
@@ -17,19 +17,18 @@
return ..()
/datum/round_event/pirates
startWhen = 60 //2 minutes to answer
var/datum/comm_message/threat_msg
/datum/round_event/pirates/start()
send_pirate_threat()
/proc/send_pirate_threat()
var/pirate_type = PIRATES_ROGUES //pick(PIRATES_ROGUES, PIRATES_SILVERSCALES, PIRATES_DUTCHMAN)
var/datum/comm_message/threat_msg = new
var/payoff = 0
var/payoff_min = 1000
var/paid_off = FALSE
var/pirate_type
var/payoff_min = 10000
var/ship_template
var/ship_name = "Space Privateers Association"
var/shuttle_spawned = FALSE
/datum/round_event/pirates/setup()
pirate_type = PIRATES_ROGUES //pick(PIRATES_ROGUES, PIRATES_SILVERSCALES, PIRATES_DUTCHMAN)
var/initial_send_time = world.time
var/response_max_time = 2 MINUTES
switch(pirate_type)
if(PIRATES_ROGUES)
ship_name = pick(strings(PIRATE_NAMES_FILE, "rogue_names"))
@@ -38,11 +37,7 @@
// if(PIRATES_DUTCHMAN)
// ship_name = "Flying Dutchman"
/datum/round_event/pirates/announce(fake)
priority_announce("Incoming subspace communication. Secure channel opened at all communication consoles.", "Incoming Message", "commandreport")
if(fake)
return
threat_msg = new
var/datum/bank_account/D = SSeconomy.get_dep_account(ACCOUNT_CAR)
if(D)
payoff = max(payoff_min, FLOOR(D.account_balance * 0.80, 1000))
@@ -62,35 +57,27 @@
// threat_msg.title = "Business proposition"
// threat_msg.content = "Ahoy! This be the [ship_name]. Cough up [payoff] credits or you'll walk the plank."
// threat_msg.possible_answers = list("We'll pay.","We will not be extorted.")
threat_msg.answer_callback = CALLBACK(src,.proc/answered)
threat_msg.answer_callback = CALLBACK(GLOBAL_PROC, .proc/pirates_answered, threat_msg, payoff, ship_name, initial_send_time, response_max_time, ship_template)
addtimer(CALLBACK(GLOBAL_PROC, .proc/spawn_pirates, threat_msg, ship_template, FALSE), response_max_time)
SScommunications.send_message(threat_msg,unique = TRUE)
/datum/round_event/pirates/proc/answered()
if(threat_msg?.answered == 1)
/proc/pirates_answered(datum/comm_message/threat_msg, payoff, ship_name, initial_send_time, response_max_time, ship_template)
if(world.time > initial_send_time + response_max_time)
priority_announce("Too late to beg for mercy!",sender_override = ship_name)
return
if(threat_msg && threat_msg.answered == 1)
var/datum/bank_account/D = SSeconomy.get_dep_account(ACCOUNT_CAR)
if(D)
if(D.adjust_money(-payoff))
priority_announce("Thanks for the credits, landlubbers.",sender_override = ship_name)
paid_off = TRUE
return
else
priority_announce("Trying to cheat us? You'll regret this!",sender_override = ship_name)
else if(threat_msg?.answered == 2)
priority_announce("You won't pay? Fine then, we'll take those credits by force!",sender_override = ship_name)
if(!shuttle_spawned)
spawn_shuttle()
else
priority_announce("Too late to beg for mercy!",sender_override = ship_name)
spawn_pirates(threat_msg, ship_template, TRUE)
/datum/round_event/pirates/start()
if(threat_msg && !threat_msg.answered)
threat_msg.possible_answers = list("Too late")
threat_msg.answered = 1
if(!paid_off && !shuttle_spawned)
spawn_shuttle()
/datum/round_event/pirates/proc/spawn_shuttle()
shuttle_spawned = TRUE
/proc/spawn_pirates(datum/comm_message/threat_msg, ship_template, skip_answer_check)
if(!skip_answer_check && threat_msg?.answered == 1)
return
var/list/candidates = pollGhostCandidates("Do you wish to be considered for pirate crew?", ROLE_TRAITOR)
shuffle_inplace(candidates)
@@ -109,12 +96,12 @@
for(var/turf/A in ship.get_affected_turfs(T))
for(var/obj/effect/mob_spawn/human/pirate/spawner in A)
if(candidates.len > 0)
var/mob/M = candidates[1]
spawner.create(M.ckey)
candidates -= M
announce_to_ghosts(M)
var/mob/our_candidate = candidates[1]
spawner.create(our_candidate.ckey)
candidates -= our_candidate
notify_ghosts("The pirate ship has an object of interest: [our_candidate]!", source=our_candidate, action=NOTIFY_ORBIT, header="Something's Interesting!")
else
announce_to_ghosts(spawner)
notify_ghosts("The pirate ship has an object of interest: [spawner]!", source=spawner, action=NOTIFY_ORBIT, header="Something's Interesting!")
priority_announce("Unidentified armed ship detected near the station.")
+1
View File
@@ -4,6 +4,7 @@
weight = 8
max_occurrences = 1
min_players = 20
dynamic_should_hijack = TRUE
/datum/round_event/ghost_role/space_dragon
minimum_required = 1
+1
View File
@@ -5,6 +5,7 @@
weight = 10
earliest_start = 20 MINUTES
min_players = 15
dynamic_should_hijack = TRUE
/datum/round_event/ghost_role/space_ninja
minimum_required = 1
+3
View File
@@ -63,6 +63,9 @@
var/list/mind_traits // Traits added to the mind of the mob assigned this job
var/list/blacklisted_quirks //list of quirk typepaths blacklisted.
/// Should this job be allowed to be picked for the bureaucratic error event?
var/allow_bureaucratic_error = TRUE
var/display_order = JOB_DISPLAY_ORDER_DEFAULT
//If a job complies with dresscodes, loadout items will not be equipped instead of the job's outfit, instead placing the items into the player's backpack.
+1
View File
@@ -14,6 +14,7 @@
exp_type = EXP_TYPE_CREW
exp_type_department = EXP_TYPE_SILICON
display_order = JOB_DISPLAY_ORDER_AI
allow_bureaucratic_error = FALSE
var/do_special_check = TRUE
threat = 5
considered_combat_role = TRUE
+1 -1
View File
@@ -13,7 +13,7 @@ INITIALIZE_IMMEDIATE(/mob/dead)
stack_trace("Warning: [src]([type]) initialized multiple times!")
flags_1 |= INITIALIZED_1
tag = "mob_[next_mob_id++]"
GLOB.mob_list += src
add_to_mob_list()
prepare_huds()
@@ -33,6 +33,13 @@
. = ..()
GLOB.new_player_list += src
/mob/dead/new_player/Destroy()
GLOB.new_player_list -= src
return ..()
/mob/dead/new_player/prepare_huds()
return
@@ -391,7 +398,7 @@
var/id_max = text2num(href_list["maxid"])
if( (id_max - id_min) > 100 ) //Basic exploit prevention
//(protip, this stops no exploits)
//(protip, this stops no exploits)
to_chat(usr, "The option ID difference is too big. Please contact administration or the database admin.")
return
+1 -1
View File
@@ -123,7 +123,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
animate(src, pixel_y = 2, time = 10, loop = -1)
GLOB.dead_mob_list += src
add_to_dead_mob_list()
for(var/v in GLOB.active_alternate_appearances)
if(!v)
+4 -4
View File
@@ -64,8 +64,8 @@
brainmob.container = src
if(!(newbrain.organ_flags & ORGAN_FAILING)) // the brain organ hasn't been beaten to death.
brainmob.stat = CONSCIOUS //we manually revive the brain mob
GLOB.dead_mob_list -= brainmob
GLOB.alive_mob_list += brainmob
brainmob.remove_from_dead_mob_list()
brainmob.add_to_alive_mob_list()
brainmob.reset_perspective()
brain = newbrain
@@ -102,8 +102,8 @@
brainmob.stat = DEAD
brainmob.emp_damage = 0
brainmob.reset_perspective() //so the brainmob follows the brain organ instead of the mmi. And to update our vision
GLOB.alive_mob_list -= brainmob //Get outta here
GLOB.dead_mob_list += brainmob
brainmob.remove_from_alive_mob_list() //Get outta here
brainmob.add_to_dead_mob_list()
brain.brainmob = brainmob //Set the brain to use the brainmob
brainmob = null //Set mmi brainmob var to null
if(user)
+2 -2
View File
@@ -159,8 +159,8 @@ GLOBAL_VAR(posibrain_notify_cooldown)
to_chat(brainmob, welcome_message)
brainmob.mind.assigned_role = new_role
brainmob.stat = CONSCIOUS
GLOB.dead_mob_list -= brainmob
GLOB.alive_mob_list += brainmob
brainmob.remove_from_dead_mob_list()
brainmob.add_to_alive_mob_list()
visible_message(new_mob_message)
check_success()
+2 -2
View File
@@ -65,9 +65,9 @@
I.on_mob_death(src, gibbed)
if(mind)
mind.store_memory("Time of death: [tod]", 0)
GLOB.alive_mob_list -= src
remove_from_alive_mob_list()
if(!gibbed)
GLOB.dead_mob_list += src
add_to_dead_mob_list()
if(ckey)
var/datum/preferences/P = GLOB.preferences_datums[ckey]
if(P)
+6 -6
View File
@@ -589,8 +589,8 @@
if(full_heal)
fully_heal(admin_revive)
if(stat == DEAD && can_be_revived()) //in some cases you can't revive (e.g. no brain)
GLOB.dead_mob_list -= src
GLOB.alive_mob_list += src
remove_from_dead_mob_list()
add_to_alive_mob_list()
suiciding = 0
stat = UNCONSCIOUS //the mob starts unconscious,
if(!eye_blind)
@@ -1289,11 +1289,11 @@
return FALSE
if(NAMEOF(src, stat))
if((stat == DEAD) && (var_value < DEAD))//Bringing the dead back to life
GLOB.dead_mob_list -= src
GLOB.alive_mob_list += src
remove_from_dead_mob_list()
add_to_alive_mob_list()
if((stat < DEAD) && (var_value == DEAD))//Kill he
GLOB.alive_mob_list -= src
GLOB.dead_mob_list += src
remove_from_alive_mob_list()
add_to_dead_mob_list()
if(NAMEOF(src, health)) //this doesn't work. gotta use procs instead.
return FALSE
. = ..()
+1 -1
View File
@@ -7,6 +7,6 @@
clear_fullscreens()
//New pAI's get a brand new mind to prevent meta stuff from their previous life. This new mind causes problems down the line if it's not deleted here.
GLOB.alive_mob_list -= src
remove_from_alive_mob_list()
ghostize()
qdel(src)
@@ -95,8 +95,8 @@
if(mmi.brainmob)
if(mmi.brainmob.stat == DEAD)
mmi.brainmob.stat = CONSCIOUS
GLOB.dead_mob_list -= mmi.brainmob
GLOB.alive_mob_list += mmi.brainmob
mmi.brainmob.remove_from_dead_mob_list()
mmi.brainmob.add_to_alive_mob_list()
mind.transfer_to(mmi.brainmob)
mmi.update_icon()
else
+1 -1
View File
@@ -1,5 +1,5 @@
/mob/Login()
GLOB.player_list |= src
add_to_player_list()
lastKnownIP = client.address
computer_id = client.computer_id
log_access("Mob Login: [key_name(src)] was assigned to a [type]")
+1 -1
View File
@@ -3,7 +3,7 @@
log_message("[key_name(src)] is no longer owning mob [src]([src.type])", LOG_OWNERSHIP)
SStgui.on_logout(src)
unset_machine()
GLOB.player_list -= src
remove_from_player_list()
..()
+6 -8
View File
@@ -1,9 +1,8 @@
/mob/Destroy()//This makes sure that mobs with clients/keys are not just deleted from the game.
GLOB.mob_list -= src
GLOB.dead_mob_list -= src
GLOB.alive_mob_list -= src
remove_from_mob_list()
remove_from_dead_mob_list()
remove_from_alive_mob_list()
GLOB.all_clockwork_mobs -= src
GLOB.mob_directory -= tag
focus = null
LAssailant = null
movespeed_modification = null
@@ -22,12 +21,11 @@
return QDEL_HINT_HARDDEL
/mob/Initialize()
GLOB.mob_list += src
GLOB.mob_directory[tag] = src
add_to_mob_list()
if(stat == DEAD)
GLOB.dead_mob_list += src
add_to_dead_mob_list()
else
GLOB.alive_mob_list += src
add_to_alive_mob_list()
set_focus(src)
prepare_huds()
for(var/v in GLOB.active_alternate_appearances)
+3
View File
@@ -180,3 +180,6 @@
///Override for sound_environments. If this is set the user will always hear a specific type of reverb (Instead of the area defined reverb)
var/sound_environment_override = SOUND_ENVIRONMENT_NONE
/// A mock client, provided by tests and friends
var/datum/client_interface/mock_client
+119
View File
@@ -0,0 +1,119 @@
///Adds the mob reference to the list and directory of all mobs. Called on Initialize().
/mob/proc/add_to_mob_list()
GLOB.mob_list |= src
GLOB.mob_directory[tag] = src
///Removes the mob reference from the list and directory of all mobs. Called on Destroy().
/mob/proc/remove_from_mob_list()
GLOB.mob_list -= src
GLOB.mob_directory -= tag
///Adds the mob reference to the list of all mobs alive. If mob is cliented, it adds it to the list of all living player-mobs.
/mob/proc/add_to_alive_mob_list()
GLOB.alive_mob_list |= src
if(client)
add_to_current_living_players()
///Removes the mob reference from the list of all mobs alive. If mob is cliented, it removes it from the list of all living player-mobs.
/mob/proc/remove_from_alive_mob_list()
GLOB.alive_mob_list -= src
if(client)
remove_from_current_living_players()
///Adds the mob reference to the list of all the dead mobs. If mob is cliented, it adds it to the list of all dead player-mobs.
/mob/proc/add_to_dead_mob_list()
GLOB.dead_mob_list |= src
if(client)
add_to_current_dead_players()
///Remvoes the mob reference from list of all the dead mobs. If mob is cliented, it adds it to the list of all dead player-mobs.
/mob/proc/remove_from_dead_mob_list()
GLOB.dead_mob_list -= src
if(client)
remove_from_current_dead_players()
///Adds the cliented mob reference to the list of all player-mobs, besides to either the of dead or alive player-mob lists, as appropriate. Called on Login().
/mob/proc/add_to_player_list()
SHOULD_CALL_PARENT(TRUE)
GLOB.player_list |= src
if(!SSticker?.mode)
return
if(stat == DEAD)
add_to_current_dead_players()
else
add_to_current_living_players()
///Removes the mob reference from the list of all player-mobs, besides from either the of dead or alive player-mob lists, as appropriate. Called on Logout().
/mob/proc/remove_from_player_list()
SHOULD_CALL_PARENT(TRUE)
GLOB.player_list -= src
if(!SSticker?.mode)
return
if(stat == DEAD)
remove_from_current_dead_players()
else
remove_from_current_living_players()
///Adds the cliented mob reference to either the list of dead player-mobs or to the list of observers, depending on how they joined the game.
/mob/proc/add_to_current_dead_players()
if(!SSticker?.mode)
return
SSticker.mode.current_players[CURRENT_DEAD_PLAYERS] |= src
/mob/dead/observer/add_to_current_dead_players()
if(!SSticker?.mode)
return
if(started_as_observer)
SSticker.mode.current_players[CURRENT_OBSERVERS] |= src
return
return ..()
/mob/dead/new_player/add_to_current_dead_players()
return
///Removes the mob reference from either the list of dead player-mobs or from the list of observers, depending on how they joined the game.
/mob/proc/remove_from_current_dead_players()
if(!SSticker?.mode)
return
SSticker.mode.current_players[CURRENT_DEAD_PLAYERS] -= src
/mob/dead/observer/remove_from_current_dead_players()
if(!SSticker?.mode)
return
if(started_as_observer)
SSticker.mode.current_players[CURRENT_OBSERVERS] -= src
return
return ..()
///Adds the cliented mob reference to the list of living player-mobs. If the mob is an antag, it adds it to the list of living antag player-mobs.
/mob/proc/add_to_current_living_players()
if(!SSticker?.mode)
return
SSticker.mode.current_players[CURRENT_LIVING_PLAYERS] |= src
if(mind && (mind.special_role || length(mind.antag_datums)))
add_to_current_living_antags()
///Removes the mob reference from the list of living player-mobs. If the mob is an antag, it removes it from the list of living antag player-mobs.
/mob/proc/remove_from_current_living_players()
if(!SSticker?.mode)
return
SSticker.mode.current_players[CURRENT_LIVING_PLAYERS] -= src
if(LAZYLEN(mind?.antag_datums))
remove_from_current_living_antags()
///Adds the cliented mob reference to the list of living antag player-mobs.
/mob/proc/add_to_current_living_antags()
if(!SSticker?.mode)
return
SSticker.mode.current_players[CURRENT_LIVING_ANTAGS] |= src
///Removes the mob reference from the list of living antag player-mobs.
/mob/proc/remove_from_current_living_antags()
if(!SSticker?.mode)
return
SSticker.mode.current_players[CURRENT_LIVING_ANTAGS] -= src
+2 -1
View File
@@ -57,8 +57,9 @@
// #include "crayons.dm"
// #include "create_and_destroy.dm"
// #include "designs.dm"
// #include "dynamic_ruleset_sanity.dm"
#include "dynamic_ruleset_sanity.dm"
// #include "egg_glands.dm"
// #include "dynamic_ruleset_sanity.dm"
// #include "emoting.dm"
// #include "food_edibility_check.dm"
// #include "greyscale_config.dm"
@@ -0,0 +1,36 @@
/// Verifies that roundstart dynamic rulesets are setup properly without external configuration.
/datum/unit_test/dynamic_roundstart_ruleset_sanity
/datum/unit_test/dynamic_roundstart_ruleset_sanity/Run()
for (var/_ruleset in subtypesof(/datum/dynamic_ruleset/roundstart))
var/datum/dynamic_ruleset/roundstart/ruleset = _ruleset
var/has_scaling_cost = initial(ruleset.scaling_cost)
var/is_lone = initial(ruleset.flags) & (LONE_RULESET | HIGH_IMPACT_RULESET)
if (has_scaling_cost && is_lone)
Fail("[ruleset] has a scaling_cost, but is also a lone/highlander ruleset.")
else if (!has_scaling_cost && !is_lone)
Fail("[ruleset] has no scaling cost, but is also not a lone/highlander ruleset.")
/// Verifies that dynamic rulesets have unique antag_flag.
/datum/unit_test/dynamic_unique_antag_flags
/datum/unit_test/dynamic_unique_antag_flags/Run()
var/list/known_antag_flags = list()
for (var/datum/dynamic_ruleset/ruleset as anything in subtypesof(/datum/dynamic_ruleset))
if (isnull(initial(ruleset.antag_datum)))
continue
var/antag_flag = initial(ruleset.antag_flag)
if (isnull(antag_flag))
Fail("[ruleset] has a null antag_flag!")
continue
if (antag_flag in known_antag_flags)
Fail("[ruleset] has a non-unique antag_flag [antag_flag] (used by [known_antag_flags[antag_flag]])!")
continue
known_antag_flags[antag_flag] = ruleset