Merge pull request #112 from surftheseawing/null_checks

Null checks
This commit is contained in:
GDLW
2023-05-14 11:53:03 +02:00
committed by GitHub
96 changed files with 488 additions and 673 deletions
+8 -8
View File
@@ -28,8 +28,8 @@
fatness += amount_to_change
fatness = max(fatness, MINIMUM_FATNESS_LEVEL) //It would be a little silly if someone got negative fat.
if(client.prefs.max_weight)
fatness = min(fatness, (client.prefs.max_weight - 1))
if(client?.prefs?.max_weight)
fatness = min(fatness, (client?.prefs?.max_weight - 1))
return TRUE
@@ -48,27 +48,27 @@
switch(type_of_fattening)
if(FATTENING_TYPE_ITEM)
if(!client.prefs.weight_gain_items)
if(!client?.prefs?.weight_gain_items)
return FALSE
if(FATTENING_TYPE_FOOD)
if(!client.prefs.weight_gain_food)
if(!client?.prefs?.weight_gain_food)
return FALSE
if(FATTENING_TYPE_CHEM)
if(!client.prefs.weight_gain_chems)
if(!client?.prefs?.weight_gain_chems)
return FALSE
if(FATTENING_TYPE_WEAPON)
if(!client.prefs.weight_gain_weapons)
if(!client?.prefs?.weight_gain_weapons)
return FALSE
if(FATTENING_TYPE_MAGIC)
if(!client.prefs.weight_gain_magic)
if(!client?.prefs?.weight_gain_magic)
return FALSE
if(FATTENING_TYPE_VIRUS)
if(!client.prefs.weight_gain_viruses)
if(!client?.prefs?.weight_gain_viruses)
return FALSE
if(FATTENING_TYPE_WEIGHT_LOSS)
+1 -1
View File
@@ -5,7 +5,7 @@
/mob/living/simple_animal/hostile/feed/AttackingTarget()
. = ..()
var/mob/living/carbon/L = target
if(L.client.prefs.weight_gain_weapons)
if(L.client?.prefs?.weight_gain_weapons)
if(L.reagents)
if(!L.is_mouth_covered(head_only = 1))
L.reagents.add_reagent(food_fed, food_per_feeding)
@@ -5,7 +5,7 @@
var/turf/source = get_turf(user)
var/sound/noise = sound(gs13_get_sfx(noise_name))
for(var/mob/living/M in get_hearers_in_view(3, source))
if ((pref_toggle == 0) || (M.client && M.client.prefs.cit_toggles & pref_toggle))
if ((pref_toggle == 0) || (M.client && M.client?.prefs?.cit_toggles & pref_toggle))
M.playsound_local(source, noise_name, 50, 1, S = noise)
/datum/emote/living/proc/reduce_fullness(var/mob/living/user, fullness_amount) // fullness_amount should be between 5 and 20 for balance and below 80 for functionality
+4 -4
View File
@@ -456,7 +456,7 @@
if(!M.key || !M.client || (ignore_category && GLOB.poll_ignore[ignore_category] && (M.ckey in GLOB.poll_ignore[ignore_category])))
continue
if(be_special_flag)
if(!(M.client.prefs) || !(be_special_flag in M.client.prefs.be_special))
if(!(M.client.prefs) || !(be_special_flag in M.client?.prefs?.be_special))
continue
if(gametypeCheck)
if(!gametypeCheck.age_check(M.client))
@@ -504,7 +504,7 @@
var/mob/living/carbon/human/new_character = new//The mob being spawned.
SSjob.SendToLateJoin(new_character)
G_found.client.prefs.copy_to(new_character)
G_found.client?.prefs?.copy_to(new_character)
new_character.dna.update_dna_identity()
G_found.transfer_ckey(new_character, FALSE)
@@ -538,8 +538,8 @@
return
var/displayed_rank = rank
if(character.client && character.client.prefs && character.client.prefs.alt_titles_preferences[rank])
displayed_rank = character.client.prefs.alt_titles_preferences[rank]
if(character.client && character.client.prefs && character.client?.prefs?.alt_titles_preferences[rank])
displayed_rank = character.client?.prefs?.alt_titles_preferences[rank]
var/obj/machinery/announcement_system/announcer = pick(GLOB.announcement_systems)
announcer.announce("ARRIVAL", character.real_name, rank, displayed_rank, list()) //make the list empty to make it announce it in common
+2 -2
View File
@@ -33,7 +33,7 @@
for(var/mob/M in GLOB.player_list)
if(!isnewplayer(M) && M.can_hear())
to_chat(M, announcement)
if(M.client.prefs.toggles & SOUND_ANNOUNCEMENTS)
if(M.client?.prefs?.toggles & SOUND_ANNOUNCEMENTS)
SEND_SOUND(M, s)
/proc/print_command_report(text = "", title = null, announce=TRUE)
@@ -56,7 +56,7 @@
for(var/mob/M in GLOB.player_list)
if(!isnewplayer(M) && M.can_hear())
to_chat(M, "<span class='big bold'><font color = red>[html_encode(title)]</font color><BR>[html_encode(message)]</span><BR>")
if(M.client.prefs.toggles & SOUND_ANNOUNCEMENTS)
if(M.client?.prefs?.toggles & SOUND_ANNOUNCEMENTS)
if(alert)
SEND_SOUND(M, sound('sound/misc/notice1.ogg'))
else
+6 -6
View File
@@ -54,7 +54,7 @@
locked = !locked
to_chat(usr, "<span class='notice'>Action button \"[name]\" [locked ? "" : "un"]locked.</span>")
if(id && usr.client) //try to (un)remember position
usr.client.prefs.action_buttons_screen_locs["[name]_[id]"] = locked ? moved : null
usr.client?.prefs?.action_buttons_screen_locs["[name]_[id]"] = locked ? moved : null
return TRUE
if(usr.next_click > world.time)
return
@@ -89,7 +89,7 @@
locked = !locked
to_chat(usr, "<span class='notice'>Action button \"[name]\" [locked ? "" : "un"]locked.</span>")
if(id && usr.client) //try to (un)remember position
usr.client.prefs.action_buttons_screen_locs["[name]_[id]"] = locked ? moved : null
usr.client?.prefs?.action_buttons_screen_locs["[name]_[id]"] = locked ? moved : null
return TRUE
if(modifiers["alt"])
for(var/V in usr.actions)
@@ -97,12 +97,12 @@
var/obj/screen/movable/action_button/B = A.button
B.moved = FALSE
if(B.id && usr.client)
usr.client.prefs.action_buttons_screen_locs["[B.name]_[B.id]"] = null
B.locked = usr.client.prefs.buttons_locked
locked = usr.client.prefs.buttons_locked
usr.client?.prefs?.action_buttons_screen_locs["[B.name]_[B.id]"] = null
B.locked = usr.client?.prefs?.buttons_locked
locked = usr.client?.prefs?.buttons_locked
moved = FALSE
if(id && usr.client)
usr.client.prefs.action_buttons_screen_locs["[name]_[id]"] = null
usr.client?.prefs?.action_buttons_screen_locs["[name]_[id]"] = null
usr.update_action_buttons(TRUE)
to_chat(usr, "<span class='notice'>Action button positions have been reset.</span>")
return TRUE
+1 -1
View File
@@ -89,7 +89,7 @@
if(!.)
return
var/mob/screenmob = viewmob || mymob
if(!screenmob.client.prefs.ghost_hud)
if(!screenmob.client?.prefs?.ghost_hud)
screenmob.client.screen -= static_inventory
else
screenmob.client.screen += static_inventory
+2 -2
View File
@@ -70,12 +70,12 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
if (!ui_style)
// will fall back to the default if any of these are null
ui_style = ui_style2icon(owner.client && owner.client.prefs && owner.client.prefs.UI_style)
ui_style = ui_style2icon(owner.client && owner.client.prefs && owner.client?.prefs?.UI_style)
hide_actions_toggle = new
hide_actions_toggle.InitialiseIcon(src)
if(mymob.client)
hide_actions_toggle.locked = mymob.client.prefs.buttons_locked
hide_actions_toggle.locked = mymob.client?.prefs?.buttons_locked
hand_slots = list()
+1 -1
View File
@@ -85,7 +85,7 @@
owner.overlay_fullscreen("see_through_darkness", /obj/screen/fullscreen/see_through_darkness)
var/widescreenlayout = FALSE //CIT CHANGE - adds support for different hud layouts depending on widescreen pref
if(owner.client && owner.client.prefs && owner.client.prefs.widescreenpref) //CIT CHANGE - ditto
if(owner.client && owner.client.prefs && owner.client?.prefs?.widescreenpref) //CIT CHANGE - ditto
widescreenlayout = FALSE // CIT CHANGE - ditto
var/obj/screen/using
+1 -1
View File
@@ -51,7 +51,7 @@
blend_mode = BLEND_OVERLAY
/obj/screen/plane_master/game_world/backdrop(mob/mymob)
if(istype(mymob) && mymob.client && mymob.client.prefs && mymob.client.prefs.ambientocclusion)
if(istype(mymob) && mymob.client && mymob.client.prefs && mymob.client?.prefs?.ambientocclusion)
add_filter("ambient_occlusion", 0, AMBIENT_OCCLUSION)
else
remove_filter("ambient_occlusion")
+1 -1
View File
@@ -247,7 +247,7 @@
usr.a_intent_change(INTENT_HOTKEY_RIGHT)
/obj/screen/act_intent/segmented/Click(location, control, params)
if(usr.client.prefs.toggles & INTENT_STYLE)
if(usr.client?.prefs?.toggles & INTENT_STYLE)
var/_x = text2num(params2list(params)["icon-x"])
var/_y = text2num(params2list(params)["icon-y"])
+1 -1
View File
@@ -50,7 +50,7 @@
if(user.client)
if(IsAdminGhost(user))
attack_ai(user)
else if(user.client.prefs.inquisitive_ghost)
else if(user.client?.prefs?.inquisitive_ghost)
user.examinate(src)
return FALSE
+11 -11
View File
@@ -111,13 +111,13 @@ SUBSYSTEM_DEF(job)
if(job.required_playtime_remaining(player.client))
JobDebug("FOC player not enough xp, Player: [player]")
continue
if(flag && (!(flag in player.client.prefs.be_special)))
if(flag && (!(flag in player.client?.prefs?.be_special)))
JobDebug("FOC flag failed, Player: [player], Flag: [flag], ")
continue
if(player.mind && job.title in player.mind.restricted_roles)
JobDebug("FOC incompatible with antagonist role, Player: [player]")
continue
if(player.client.prefs.GetJobDepartment(job, level) & job.flag)
if(player.client?.prefs?.GetJobDepartment(job, level) & job.flag)
JobDebug("FOC pass, Player: [player], Level:[level]")
candidates += player
return candidates
@@ -333,7 +333,7 @@ SUBSYSTEM_DEF(job)
continue
// If the player wants that job on this level, then try give it to him.
if(player.client.prefs.GetJobDepartment(job, level) & job.flag)
if(player.client?.prefs?.GetJobDepartment(job, level) & job.flag)
// If the job isn't filled
if((job.current_positions < job.spawn_positions) || job.spawn_positions == -1)
JobDebug("DO pass, Player: [player], Level:[level], Job:[job.title]")
@@ -360,17 +360,17 @@ SUBSYSTEM_DEF(job)
/datum/controller/subsystem/job/proc/HandleUnassigned(mob/dead/new_player/player)
if(PopcapReached())
RejectPlayer(player)
else if(player.client.prefs.joblessrole == BEOVERFLOW)
else if(player.client?.prefs?.joblessrole == BEOVERFLOW)
var/allowed_to_be_a_loser = !jobban_isbanned(player, SSjob.overflow_role)
if(QDELETED(player) || !allowed_to_be_a_loser)
RejectPlayer(player)
else
if(!AssignRole(player, SSjob.overflow_role))
RejectPlayer(player)
else if(player.client.prefs.joblessrole == BERANDOMJOB)
else if(player.client?.prefs?.joblessrole == BERANDOMJOB)
if(!GiveRandomJob(player))
RejectPlayer(player)
else if(player.client.prefs.joblessrole == RETURNTOLOBBY)
else if(player.client?.prefs?.joblessrole == RETURNTOLOBBY)
RejectPlayer(player)
else //Something gone wrong if we got here.
var/message = "DO: [player] fell through handling unassigned"
@@ -441,8 +441,8 @@ SUBSYSTEM_DEF(job)
//Flavortext
var/display_rank = rank
if(M.client && M.client.prefs && M.client.prefs.alt_titles_preferences[rank])
display_rank = M.client.prefs.alt_titles_preferences[rank]
if(M.client && M.client.prefs && M.client?.prefs?.alt_titles_preferences[rank])
display_rank = M.client?.prefs?.alt_titles_preferences[rank]
to_chat(M, "<b>You are the [display_rank].</b>")
@@ -522,11 +522,11 @@ SUBSYSTEM_DEF(job)
if(job.required_playtime_remaining(player.client))
young++
continue
if(player.client.prefs.GetJobDepartment(job, 1) & job.flag)
if(player.client?.prefs?.GetJobDepartment(job, 1) & job.flag)
high++
else if(player.client.prefs.GetJobDepartment(job, 2) & job.flag)
else if(player.client?.prefs?.GetJobDepartment(job, 2) & job.flag)
medium++
else if(player.client.prefs.GetJobDepartment(job, 3) & job.flag)
else if(player.client?.prefs?.GetJobDepartment(job, 3) & job.flag)
low++
else never++ //not selected
SSblackbox.record_feedback("nested tally", "job_preferences", high, list("[job.title]", "high"))
+2 -2
View File
@@ -37,7 +37,7 @@ SUBSYSTEM_DEF(jukeboxes)
for(var/mob/M in GLOB.player_list)
if(!M.client)
continue
if(!(M.client.prefs.toggles & SOUND_INSTRUMENTS))
if(!(M.client?.prefs?.toggles & SOUND_INSTRUMENTS))
continue
M.playsound_local(M, null, 100, channel = youvegotafreejukebox[2], S = song_to_init)
@@ -105,7 +105,7 @@ SUBSYSTEM_DEF(jukeboxes)
for(var/mob/M in GLOB.player_list)
if(!M.client)
continue
if(!(M.client.prefs.toggles & SOUND_INSTRUMENTS) || !M.can_hear())
if(!(M.client?.prefs?.toggles & SOUND_INSTRUMENTS) || !M.can_hear())
M.stop_sound_channel(jukeinfo[2])
continue
+1 -1
View File
@@ -146,7 +146,7 @@ SUBSYSTEM_DEF(pai)
for(var/mob/dead/observer/G in GLOB.player_list)
if(!G.key || !G.client)
continue
if(!(ROLE_PAI in G.client.prefs.be_special))
if(!(ROLE_PAI in G.client?.prefs?.be_special))
continue
to_chat(G, "<span class='ghostalert'>[user] is requesting a pAI personality! Use the pAI button to submit yourself as one.</span>")
addtimer(CALLBACK(src, .proc/spam_again), spam_delay)
+2 -2
View File
@@ -66,8 +66,8 @@
M.actions += src
if(M.client)
M.client.screen += button
button.locked = M.client.prefs.buttons_locked || button.id ? M.client.prefs.action_buttons_screen_locs["[name]_[button.id]"] : FALSE //even if it's not defaultly locked we should remember we locked it before
button.moved = button.id ? M.client.prefs.action_buttons_screen_locs["[name]_[button.id]"] : FALSE
button.locked = M.client?.prefs?.buttons_locked || button.id ? M.client?.prefs?.action_buttons_screen_locs["[name]_[button.id]"] : FALSE //even if it's not defaultly locked we should remember we locked it before
button.moved = button.id ? M.client?.prefs?.action_buttons_screen_locs["[name]_[button.id]"] : FALSE
M.update_action_buttons()
else
Remove(owner)
+2 -2
View File
@@ -143,7 +143,7 @@
return
if (src.client)
if(client.prefs.muted & MUTE_IC)
if(client?.prefs?.muted & MUTE_IC)
to_chat(src, "You cannot send IC messages (muted).")
return
if (!(ignore_spam || forced) && src.client.handle_spam_prevention(message,MUTE_IC))
@@ -152,7 +152,7 @@
friend_talk(message)
/mob/camera/imaginary_friend/Hear(message, atom/movable/speaker, datum/language/message_language, raw_message, radio_freq, list/spans, message_mode, atom/movable/source)
if (client?.prefs.chat_on_map && (client.prefs.see_chat_non_mob || ismob(speaker)))
if (client?.prefs.chat_on_map && (client?.prefs?.see_chat_non_mob || ismob(speaker)))
create_chat_message(speaker, message_language, raw_message, spans, message_mode)
to_chat(src, compose_message(speaker, message_language, raw_message, radio_freq, spans, message_mode, FALSE, source))
+2 -2
View File
@@ -87,9 +87,9 @@ GLOBAL_LIST_EMPTY(mobs_with_editable_flavor_text) //et tu, hacky code
examineTabOutput += "[L.name] "
examineTabOutput += "([L.dna.custom_species ? L.dna.custom_species : L.dna.species.name])"
/* if(L.client.prefs.pins) //character has pins
/* if(L.client?.prefs?.pins) //character has pins
var/P = ""
for(P in L.client.prefs.pins)
for(P in L.client?.prefs?.pins)
examineTabOutput += "[icon2html('hyperstation/icons/chat/pins.dmi', world, P)]" //show pins!
*/
examineTabOutput += "</center>"
+1 -1
View File
@@ -64,7 +64,7 @@
if(!M.client || isnewplayer(M))
continue
var/T = get_turf(user)
if(M.stat == DEAD && M.client && (M.client.prefs.chat_toggles & CHAT_GHOSTSIGHT) && !(M in viewers(T, null)) && (user.client)) //SKYRAT CHANGE - only user controlled mobs show their emotes to all-seeing ghosts, to reduce chat spam
if(M.stat == DEAD && M.client && (M.client?.prefs?.chat_toggles & CHAT_GHOSTSIGHT) && !(M in viewers(T, null)) && (user.client)) //SKYRAT CHANGE - only user controlled mobs show their emotes to all-seeing ghosts, to reduce chat spam
M.show_message(msg)
if(emote_type == EMOTE_AUDIBLE)
+2 -2
View File
@@ -138,7 +138,7 @@
if(isliving(new_character)) //New humans and such are by default enabled arousal. Let's always use the new mind's prefs.
var/mob/living/L = new_character
if(L.client && L.client.prefs)
L.canbearoused = L.client.prefs.arousable //Technically this should make taking over a character mean the body gain the new minds setting...
L.canbearoused = L.client?.prefs?.arousable //Technically this should make taking over a character mean the body gain the new minds setting...
L.update_arousal_hud() //Removes the old icon
hide_ckey = current.client?.prefs?.hide_ckey
@@ -290,7 +290,7 @@
var/obj/item/uplink_loc
if(traitor_mob.client && traitor_mob.client.prefs)
switch(traitor_mob.client.prefs.uplink_spawn_loc)
switch(traitor_mob.client?.prefs?.uplink_spawn_loc)
if(UPLINK_PDA)
uplink_loc = PDA
if(!uplink_loc)
+2 -2
View File
@@ -454,11 +454,11 @@ GLOBAL_LIST_EMPTY(teleportlocs)
return
// Ambience goes down here -- make sure to list each area separately for ease of adding things in later, thanks! Note: areas adjacent to each other should have the same sounds to prevent cutoff when possible.- LastyScratch
if(L.client && !L.client.ambience_playing && L.client.prefs.toggles & SOUND_SHIP_AMBIENCE)
if(L.client && !L.client.ambience_playing && L.client?.prefs?.toggles & SOUND_SHIP_AMBIENCE)
L.client.ambience_playing = 1
SEND_SOUND(L, sound('sound/ambience/shipambience.ogg', repeat = 1, wait = 0, volume = 35, channel = CHANNEL_BUZZ))
if(!(L.client && (L.client.prefs.toggles & SOUND_AMBIENCE)))
if(!(L.client && (L.client?.prefs?.toggles & SOUND_AMBIENCE)))
return //General ambience check is below the ship ambience so one can play without the other
if(prob(35))
@@ -202,7 +202,7 @@
// Convert to HUMAN (along with ID and PDA)
if (!am_valid)
H.set_species(/datum/species/human)
H.real_name = H.client.prefs.custom_names["human"]
H.real_name = H.client?.prefs?.custom_names["human"]
var/obj/item/card/id/ID = H.wear_id?.GetID()
if(ID)
ID.registered_name = H.real_name
+1 -1
View File
@@ -69,7 +69,7 @@ GLOBAL_VAR(changeling_team_objective_type) //If this is not null, we hand our th
if(changelings.len >= changelingcap) //Caps number of latejoin antagonists
return
if(changelings.len <= (changelingcap - 2) || prob(100 - (csc * 2)))
if(ROLE_CHANGELING in character.client.prefs.be_special)
if(ROLE_CHANGELING in character.client?.prefs?.be_special)
if(!jobban_isbanned(character, ROLE_CHANGELING) && !QDELETED(character) && !jobban_isbanned(character, ROLE_SYNDICATE) && !QDELETED(character))
if(age_check(character.client))
if(!(character.job in restricted_jobs))
@@ -68,7 +68,7 @@
..()
return
if(changelings.len <= (changelingcap - 2) || prob(100 / (csc * 4)))
if(ROLE_CHANGELING in character.client.prefs.be_special)
if(ROLE_CHANGELING in character.client?.prefs?.be_special)
if(!jobban_isbanned(character, ROLE_CHANGELING) && !QDELETED(character) && !jobban_isbanned(character, ROLE_SYNDICATE) && !QDELETED(character))
if(age_check(character.client))
if(!(character.job in restricted_jobs))
@@ -194,7 +194,7 @@
if(P.mind.special_role) // We really don't want to give antag to an antag.
candidates.Remove(P)
continue
if (!(antag_flag in P.client.prefs.be_special) || jobban_isbanned(P.ckey, list(antag_flag, ROLE_SYNDICATE)) || (antag_flag_override && jobban_isbanned(P.ckey, list(antag_flag_override, ROLE_SYNDICATE))))//are they willing and not antag-banned?
if (!(antag_flag in P.client?.prefs?.be_special) || jobban_isbanned(P.ckey, list(antag_flag, ROLE_SYNDICATE)) || (antag_flag_override && jobban_isbanned(P.ckey, list(antag_flag_override, ROLE_SYNDICATE))))//are they willing and not antag-banned?
candidates.Remove(P)
continue
@@ -214,7 +214,7 @@
if(P.mind.special_role || P.mind.antag_datums?.len > 0) // Are they an antag already?
candidates.Remove(P)
continue
if (!(antag_flag in P.client.prefs.be_special) || jobban_isbanned(P.ckey, list(antag_flag, ROLE_SYNDICATE)) || (antag_flag_override && jobban_isbanned(P.ckey, list(antag_flag_override, ROLE_SYNDICATE))))//are they willing and not antag-banned?
if (!(antag_flag in P.client?.prefs?.be_special) || jobban_isbanned(P.ckey, list(antag_flag, ROLE_SYNDICATE)) || (antag_flag_override && jobban_isbanned(P.ckey, list(antag_flag_override, ROLE_SYNDICATE))))//are they willing and not antag-banned?
candidates.Remove(P)
continue
if ((exclusive_roles.len > 0) && !(P.mind.assigned_role in exclusive_roles)) // Is the rule exclusive to their job?
@@ -224,4 +224,4 @@
/// Do your checks if the ruleset is ready to be executed here.
/// Should ignore certain checks if forced is TRUE
/datum/dynamic_ruleset/roundstart/ready(forced = FALSE)
return ..()
return ..()
@@ -82,7 +82,7 @@
if(!mode.check_age(M.client, minimum_required_age))
trimmed_list.Remove(M)
continue
if (!(antag_name in M.client.prefs.be_special) || jobban_isbanned(M.ckey, list(antag_name, ROLE_SYNDICATE)))//are they willing and not antag-banned?
if (!(antag_name in M.client?.prefs?.be_special) || jobban_isbanned(M.ckey, list(antag_name, ROLE_SYNDICATE)))//are they willing and not antag-banned?
trimmed_list.Remove(M)
continue
if (M.mind)
@@ -12,7 +12,7 @@
if(!mode.check_age(P.client, minimum_required_age))
candidates.Remove(P)
continue
if (!(antag_flag in P.client.prefs.be_special) || jobban_isbanned(P.ckey, list(antag_flag, ROLE_SYNDICATE)) || (antag_flag_override && jobban_isbanned(P.ckey, list(antag_flag_override))))//are they willing and not antag-banned?
if (!(antag_flag in P.client?.prefs?.be_special) || jobban_isbanned(P.ckey, list(antag_flag, ROLE_SYNDICATE)) || (antag_flag_override && jobban_isbanned(P.ckey, list(antag_flag_override))))//are they willing and not antag-banned?
candidates.Remove(P)
continue
if (P.mind.assigned_role in restricted_roles) // Does their job allow for it?
@@ -52,7 +52,7 @@
if(!mode.check_age(M.client, minimum_required_age))
trimmed_list.Remove(M)
continue
if (!(antag_name in M.client.prefs.be_special) || jobban_isbanned(M.ckey, list(antag_name, ROLE_SYNDICATE)))//are they willing and not antag-banned?
if (!(antag_name in M.client?.prefs?.be_special) || jobban_isbanned(M.ckey, list(antag_name, ROLE_SYNDICATE)))//are they willing and not antag-banned?
trimmed_list.Remove(M)
continue
if (M.mind)
@@ -77,11 +77,11 @@
trimmed_list.Remove(M)
continue
if(antag_flag_override)
if(!(antag_flag_override in M.client.prefs.be_special) || jobban_isbanned(M.ckey, antag_flag_override))
if(!(antag_flag_override in M.client?.prefs?.be_special) || jobban_isbanned(M.ckey, antag_flag_override))
trimmed_list.Remove(M)
continue
else
if(!(antag_flag in M.client.prefs.be_special) || jobban_isbanned(M.ckey, antag_flag))
if(!(antag_flag in M.client?.prefs?.be_special) || jobban_isbanned(M.ckey, antag_flag))
trimmed_list.Remove(M)
continue
return trimmed_list
@@ -257,7 +257,7 @@
if(issilicon(player)) // Your assigned role doesn't change when you are turned into a silicon.
living_players -= player
continue
if(player.client.prefs.allow_midround_antag == 0) //Do they have midround traitor prefs enabled? If not, trim.
if(player.client?.prefs?.allow_midround_antag == 0) //Do they have midround traitor prefs enabled? If not, trim.
living_players -= player
continue
if(is_centcom_level(player.z))
@@ -361,7 +361,7 @@
if(!mode.check_age(M.client, minimum_required_age))
trimmed_list.Remove(M)
continue
if (!(antag_name in M.client.prefs.be_special) || jobban_isbanned(M.ckey, list(antag_name, ROLE_SYNDICATE)))//are they willing and not antag-banned?
if (!(antag_name in M.client?.prefs?.be_special) || jobban_isbanned(M.ckey, list(antag_name, ROLE_SYNDICATE)))//are they willing and not antag-banned?
trimmed_list.Remove(M)
continue
if (M.mind)
@@ -378,7 +378,7 @@
/datum/dynamic_ruleset/midround/autotraitor/lewd/ready()
for(var/mob/living/target in living_players)
if(target.client.prefs.noncon)
if(target.client?.prefs?.noncon)
targets += target
if(lewd_candidates.len)
@@ -94,7 +94,7 @@
var/list/mob/living/carbon/human/targets = list()
for(var/mob/dead/new_player/target in GLOB.player_list)
if(target.client.prefs.noncon)
if(target.client?.prefs?.noncon)
targets += target
if(candidates.len)
+3 -3
View File
@@ -152,7 +152,7 @@
var/list/antag_candidates = list()
for(var/mob/living/carbon/human/H in living_crew)
if(H.client && H.client.prefs.allow_midround_antag)
if(H.client && H.client?.prefs?.allow_midround_antag)
antag_candidates += H
if(!antag_candidates)
@@ -359,7 +359,7 @@
for(var/mob/dead/new_player/player in players)
if(player.client && player.ready == PLAYER_READY_TO_PLAY)
if(role in player.client.prefs.be_special)
if(role in player.client?.prefs?.be_special)
if(!jobban_isbanned(player, ROLE_SYNDICATE) && !QDELETED(player) && !jobban_isbanned(player, role) && !QDELETED(player)) //Nodrak/Carn: Antag Job-bans
if(age_check(player.client)) //Must be older than the minimum age
candidates += player.mind // Get a list of all the people who want to be the antagonist for this round
@@ -373,7 +373,7 @@
if(candidates.len < recommended_enemies)
for(var/mob/dead/new_player/player in players)
if(player.client && player.ready == PLAYER_READY_TO_PLAY)
if(!(role in player.client.prefs.be_special)) // We don't have enough people who want to be antagonist, make a separate list of people who don't want to be one
if(!(role in player.client?.prefs?.be_special)) // We don't have enough people who want to be antagonist, make a separate list of people who don't want to be one
if(!jobban_isbanned(player, ROLE_SYNDICATE) && !QDELETED(player) && !jobban_isbanned(player, role) && !QDELETED(player) ) //Nodrak/Carn: Antag Job-bans
drafted += player.mind
+2 -2
View File
@@ -84,7 +84,7 @@
if((SSticker.mode.traitors.len + pre_traitors.len) >= traitorcap) //Upper cap for number of latejoin antagonists
return
if((SSticker.mode.traitors.len + pre_traitors.len) <= (traitorcap - 2) || prob(100 / (tsc * 2)))
if(antag_flag in character.client.prefs.be_special)
if(antag_flag in character.client?.prefs?.be_special)
if(!jobban_isbanned(character, ROLE_TRAITOR) && !QDELETED(character) && !jobban_isbanned(character, ROLE_SYNDICATE) && !QDELETED(character))
if(age_check(character.client))
if(!(character.job in restricted_jobs))
@@ -96,4 +96,4 @@
/datum/game_mode/traitor/generate_report()
return "Although more specific threats are commonplace, you should always remain vigilant for Syndicate agents aboard your station. Syndicate communications have implied that many \
GATO employees are Syndicate agents with hidden memories that may be activated at a moment's notice, so it's possible that these agents might not even know their positions."
GATO employees are Syndicate agents with hidden memories that may be activated at a moment's notice, so it's possible that these agents might not even know their positions."
+1 -1
View File
@@ -402,7 +402,7 @@
//Do the resize on ejection. The clone pod seems to do a lot of matrix transforms the way size code does, so we will handle our resize after.
mob_occupant.previous_size = 1 //Set the previous size to default so the resize properly set health and speed.
mob_occupant.custom_body_size = size //mob_occupant.client.prefs.body_size
mob_occupant.custom_body_size = size //mob_occupant.client?.prefs?.body_size
mob_occupant.resize(mob_occupant.custom_body_size * 0.01)
occupant = null
+1 -1
View File
@@ -433,7 +433,7 @@
. = ..()
if(active)
for(var/mob/living/M in range(10,src))
if(!M.client || !(M.client.prefs.toggles & SOUND_INSTRUMENTS))
if(!M.client || !(M.client?.prefs?.toggles & SOUND_INSTRUMENTS))
continue
if(!(M in rangers))
rangers += M
@@ -171,12 +171,12 @@
// Cut out mobs with clients who are admins and have radio chatter disabled.
for(var/mob/R in receive)
if (R.client && R.client.holder && !(R.client.prefs.chat_toggles & CHAT_RADIO))
if (R.client && R.client.holder && !(R.client?.prefs?.chat_toggles & CHAT_RADIO))
receive -= R
// Add observers who have ghost radio enabled.
for(var/mob/dead/observer/M in GLOB.player_list)
if(M.client && (M.client.prefs.chat_toggles & CHAT_GHOSTRADIO))
if(M.client && (M.client?.prefs?.chat_toggles & CHAT_GHOSTRADIO))
receive |= M
// Render the message and have everybody hear it.
+2 -2
View File
@@ -787,8 +787,8 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
openToolTip(user,src,params,title = name,content = "[desc]<br><b>Force:</b> [force_string]",theme = "")
/obj/item/MouseEntered(location, control, params)
if((item_flags & IN_INVENTORY) && usr.client.prefs.enable_tips && !QDELETED(src))
var/timedelay = usr.client.prefs.tip_delay/100
if((item_flags & IN_INVENTORY) && usr.client?.prefs?.enable_tips && !QDELETED(src))
var/timedelay = usr.client?.prefs?.tip_delay/100
var/user = usr
tip_timer = addtimer(CALLBACK(src, .proc/openTip, location, control, params, user), timedelay, TIMER_STOPPABLE)//timer takes delay in deciseconds, but the pref is in milliseconds. dividing by 100 converts it.
+4 -4
View File
@@ -164,8 +164,8 @@ GLOBAL_LIST_EMPTY(PDAs)
if(equipped)
return
if(user.client)
background_color = user.client.prefs.pda_color
switch(user.client.prefs.pda_style)
background_color = user.client?.prefs?.pda_color
switch(user.client?.prefs?.pda_style)
if(MONO)
font_index = MODE_MONO
font_mode = FONT_MONO
@@ -181,7 +181,7 @@ GLOBAL_LIST_EMPTY(PDAs)
else
font_index = MODE_MONO
font_mode = FONT_MONO
var/pref_skin = GLOB.pda_reskins[user.client.prefs.pda_skin]
var/pref_skin = GLOB.pda_reskins[user.client?.prefs?.pda_skin]
if(icon != pref_skin)
icon = pref_skin
update_icon(FALSE, TRUE)
@@ -778,7 +778,7 @@ GLOBAL_LIST_EMPTY(PDAs)
// Show it to ghosts
var/ghost_message = "<span class='name'>[owner] </span><span class='game say'>PDA Message</span> --> <span class='name'>[target_text]</span>: <span class='message'>[signal.format_message(TRUE)]</span>"
for(var/mob/M in GLOB.player_list)
if(isobserver(M) && M.client && (M.client.prefs.chat_toggles & CHAT_GHOSTPDA))
if(isobserver(M) && M.client && (M.client?.prefs?.chat_toggles & CHAT_GHOSTPDA))
to_chat(M, "[FOLLOW_LINK(M, user)] [ghost_message]")
// Log in the talk log
user.log_talk(message, LOG_PDA, tag="PDA: [initial(name)] to [target_text]")
@@ -78,7 +78,7 @@
if(!iscarbon(target))
return
var/voracious = TRUE
if(!target.client || !(target.client.prefs.cit_toggles & MEDIHOUND_SLEEPER) || !hound.client || !(hound.client.prefs.cit_toggles & MEDIHOUND_SLEEPER))
if(!target.client || !(target.client?.prefs?.cit_toggles & MEDIHOUND_SLEEPER) || !hound.client || !(hound.client?.prefs?.cit_toggles & MEDIHOUND_SLEEPER))
voracious = FALSE
if(target.buckled)
to_chat(user, "<span class='warning'>The user is buckled and can not be put into your [src].</span>")
@@ -121,7 +121,7 @@
if(user.a_intent == INTENT_HELP)
return
var/voracious = TRUE
if(!user.client || !(user.client.prefs.cit_toggles & MEDIHOUND_SLEEPER) || !hound.client || !(hound.client.prefs.cit_toggles & MEDIHOUND_SLEEPER))
if(!user.client || !(user.client?.prefs?.cit_toggles & MEDIHOUND_SLEEPER) || !hound.client || !(hound.client?.prefs?.cit_toggles & MEDIHOUND_SLEEPER))
voracious = FALSE
user.visible_message("<span class='notice'>You see [voracious ? "[user] struggling against the expanded material of [hound]'s gut!" : "and hear [user] pounding against something inside of [hound]'s [src.name]!"]</span>", \
"<span class='notice'>[voracious ? "You start struggling inside of [src]'s tight, flexible confines," : "You start pounding against the metallic walls of [src],"] trying to trigger the release... (this will take about [DisplayTimeText(breakout_time)].)</span>", \
@@ -136,11 +136,11 @@
var/list/targets = target && hound ? list(target) : contents
if(hound)
//hound.setClickCooldown(50) Not needed?
if(!hound.client || !(hound.client.prefs.cit_toggles & MEDIHOUND_SLEEPER))
if(!hound.client || !(hound.client?.prefs?.cit_toggles & MEDIHOUND_SLEEPER))
voracious = FALSE
else
for(var/mob/M in targets)
if(!M.client || !(M.client.prefs.cit_toggles & MEDIHOUND_SLEEPER))
if(!M.client || !(M.client?.prefs?.cit_toggles & MEDIHOUND_SLEEPER))
voracious = FALSE
if(length(targets))
if(hound)
@@ -263,7 +263,7 @@
patient_laststat = patient.stat
prociconupdate = TRUE
if(!patient.client || !(patient.client.prefs.cit_toggles & MEDIHOUND_SLEEPER) || !hound.client || !(hound.client.prefs.cit_toggles & MEDIHOUND_SLEEPER))
if(!patient.client || !(patient.client?.prefs?.cit_toggles & MEDIHOUND_SLEEPER) || !hound.client || !(hound.client?.prefs?.cit_toggles & MEDIHOUND_SLEEPER))
hound.sleeper_nv = TRUE
else
hound.sleeper_nv = FALSE
@@ -288,7 +288,7 @@
hound.sleeper_g = 1
patient_laststat = patient.stat
if(!patient.client || !(patient.client.prefs.cit_toggles & MEDIHOUND_SLEEPER) || !hound.client || !(hound.client.prefs.cit_toggles & MEDIHOUND_SLEEPER))
if(!patient.client || !(patient.client?.prefs?.cit_toggles & MEDIHOUND_SLEEPER) || !hound.client || !(hound.client?.prefs?.cit_toggles & MEDIHOUND_SLEEPER))
hound.sleeper_nv = TRUE
else
hound.sleeper_nv = FALSE
@@ -345,7 +345,7 @@
var/turf/source = get_turf(hound)
LAZYCLEARLIST(hearing_mobs)
for(var/mob/H in get_hearers_in_view(3, source))
if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES))
if(!H.client || !(H.client?.prefs?.cit_toggles & DIGESTION_NOISES))
continue
LAZYADD(hearing_mobs, H)
last_hearcheck = world.time
@@ -389,7 +389,7 @@
var/turf/source = get_turf(hound)
LAZYCLEARLIST(hearing_mobs)
for(var/mob/H in get_hearers_in_view(3, source))
if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES))
if(!H.client || !(H.client?.prefs?.cit_toggles & DIGESTION_NOISES))
continue
LAZYADD(hearing_mobs, H)
last_hearcheck = world.time
+1 -1
View File
@@ -81,7 +81,7 @@
body = new mob_type(T)
var/mob/ghostie = mind.get_ghost(TRUE)
if(ghostie.client && ghostie.client.prefs)
ghostie.client.prefs.copy_to(body)
ghostie.client?.prefs?.copy_to(body)
mind.transfer_to(body)
else
body.forceMove(T)
+1 -1
View File
@@ -67,7 +67,7 @@
if((world.time - MUSICIAN_HEARCHECK_MINDELAY) > last_hearcheck)
LAZYCLEARLIST(hearing_mobs)
for(var/mob/M in get_hearers_in_view(15, source))
if(!M.client || !(M.client.prefs.toggles & SOUND_INSTRUMENTS))
if(!M.client || !(M.client?.prefs?.toggles & SOUND_INSTRUMENTS))
continue
LAZYADD(hearing_mobs, M)
last_hearcheck = world.time
+1 -1
View File
@@ -104,7 +104,7 @@
if(M.client)
body += "| <A href='?_src_=holder;[HrefToken()];sendtoprison=[REF(M)]'>Prison</A> | "
body += "\ <A href='?_src_=holder;[HrefToken()];sendbacktolobby=[REF(M)]'>Send back to Lobby</A> | "
var/muted = M.client.prefs.muted
var/muted = M.client?.prefs?.muted
body += "<br><b>Mute: </b> "
body += "\[<A href='?_src_=holder;[HrefToken()];mute=[M.ckey];mute_type=[MUTE_IC]'><font color='[(muted & MUTE_IC)?"red":"blue"]'>IC</font></a> | "
body += "<A href='?_src_=holder;[HrefToken()];mute=[M.ckey];mute_type=[MUTE_OOC]'><font color='[(muted & MUTE_OOC)?"red":"blue"]'>OOC</font></a> | "
+1 -1
View File
@@ -743,7 +743,7 @@
if (length(players))
var/mob/chosen = players[1]
if (chosen.client)
chosen.client.prefs.copy_to(spawnedMob)
chosen.client?.prefs?.copy_to(spawnedMob)
spawnedMob.key = chosen.key
players -= chosen
if (ishuman(spawnedMob) && ispath(humanoutfit, /datum/outfit))
+1 -1
View File
@@ -142,7 +142,7 @@
if(SOUND_EMITTER_GLOBAL)
hearing_mobs = GLOB.player_list.Copy()
for(var/mob/M in hearing_mobs)
if(M.client.prefs.toggles & SOUND_MIDI)
if(M.client?.prefs?.toggles & SOUND_MIDI)
M.playsound_local(M, sound_file, sound_volume, FALSE, channel = CHANNEL_ADMIN, pressure_affected = FALSE)
if(user)
log_admin("[ADMIN_LOOKUPFLW(user)] activated a sound emitter with file \"[sound_file]\" at [AREACOORD(src)]")
+1 -1
View File
@@ -26,7 +26,7 @@
for (var/mob/M in GLOB.player_list)
if(isnewplayer(M))
continue
if (M.stat == DEAD || (M.client && M.client.holder && (M.client.prefs.chat_toggles & CHAT_DEAD))) //admins can toggle deadchat on and off. This is a proc in admin.dm and is only give to Administrators and above
if (M.stat == DEAD || (M.client && M.client.holder && (M.client?.prefs?.chat_toggles & CHAT_DEAD))) //admins can toggle deadchat on and off. This is a proc in admin.dm and is only give to Administrators and above
to_chat(M, rendered)
SSblackbox.record_feedback("tally", "admin_verb", 1, "Dsay") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
+2 -2
View File
@@ -32,7 +32,7 @@
/datum/admins/proc/isReadytoRumble(mob/living/carbon/human/applicant, targetrole, onstation = TRUE, conscious = TRUE)
if(applicant.mind.special_role)
return FALSE
if(!(targetrole in applicant.client.prefs.be_special))
if(!(targetrole in applicant.client?.prefs?.be_special))
return FALSE
if(onstation)
var/turf/T = get_turf(applicant)
@@ -412,7 +412,7 @@
//Spawn the body
var/mob/living/carbon/human/ERTOperative = new ertemplate.mobtype(spawnloc)
chosen_candidate.client.prefs.copy_to(ERTOperative)
chosen_candidate.client?.prefs?.copy_to(ERTOperative)
ERTOperative.key = chosen_candidate.key
if(ertemplate.enforce_human || ERTOperative.dna.species.dangerous_existence) // Don't want any exploding plasmemes
+1 -1
View File
@@ -33,7 +33,7 @@
message_admins("[key_name_admin(src)] played sound [S]")
for(var/mob/M in GLOB.player_list)
if(M.client.prefs.toggles & SOUND_MIDI)
if(M.client?.prefs?.toggles & SOUND_MIDI)
var/user_vol = M.client.chatOutput.adminMusicVolume
if(user_vol)
admin_sound.volume = vol * (user_vol / 100)
+1 -1
View File
@@ -11,7 +11,7 @@
return
log_prayer("[src.key]/([src.name]): [msg]")
if(usr.client)
if(usr.client.prefs.muted & MUTE_PRAY)
if(usr.client?.prefs?.muted & MUTE_PRAY)
to_chat(usr, "<span class='danger'>You cannot pray (muted).</span>")
return
if(src.client.handle_spam_prevention(msg,MUTE_PRAY))
+1 -1
View File
@@ -288,7 +288,7 @@
for(var/mob/M in GLOB.player_list)
if(M.stat != DEAD)
continue //we are not dead!
if(!(ROLE_ALIEN in M.client.prefs.be_special))
if(!(ROLE_ALIEN in M.client?.prefs?.be_special))
continue //we don't want to be an alium
if(M.client.is_afk())
continue //we are afk
@@ -181,7 +181,7 @@ GLOBAL_LIST_EMPTY(antagonists)
/datum/antagonist/proc/enabled_in_preferences(datum/mind/M)
if(job_rank)
if(M.current && M.current.client && (job_rank in M.current.client.prefs.be_special))
if(M.current && M.current.client && (job_rank in M.current.client?.prefs?.be_special))
return TRUE
else
return FALSE
@@ -192,7 +192,7 @@ GLOBAL_LIST_EMPTY(blob_nodes)
return
if (src.client)
if(client.prefs.muted & MUTE_IC)
if(client?.prefs?.muted & MUTE_IC)
to_chat(src, "You cannot send IC messages (muted).")
return
if (src.client.handle_spam_prevention(message,MUTE_IC))
@@ -80,7 +80,7 @@
/mob/camera/eminence/say(message, bubble_type, var/list/spans = list(), sanitize = TRUE, datum/language/language = null, ignore_spam = FALSE, forced = null)
if(client)
if(client.prefs.muted & MUTE_IC)
if(client?.prefs?.muted & MUTE_IC)
to_chat(src, "You cannot send IC messages (muted).")
return
if(client.handle_spam_prevention(message,MUTE_IC))
@@ -286,7 +286,7 @@
var/list/datum/mind/promotable = list()
for(var/datum/mind/khrushchev in non_heads)
if(khrushchev.current && !khrushchev.current.incapacitated() && !khrushchev.current.restrained() && khrushchev.current.client && khrushchev.current.stat != DEAD)
if(ROLE_REV in khrushchev.current.client.prefs.be_special)
if(ROLE_REV in khrushchev.current.client?.prefs?.be_special)
promotable += khrushchev
if(promotable.len)
var/datum/mind/new_leader = pick(promotable)
@@ -383,7 +383,7 @@
if(IsAdminGhost(user))
attack_ai(user)
return FALSE
else if(user.client.prefs.inquisitive_ghost)
else if(user.client?.prefs?.inquisitive_ghost)
user.examinate(src)
return FALSE
return FALSE
+1 -1
View File
@@ -1025,7 +1025,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += "<b>Widescreen:</b> <a href='?_src_=prefs;preference=widescreenpref'>[widescreenpref ? "Enabled ([CONFIG_GET(string/default_view)])" : "Disabled (15x15)"]</a><br>"
dat += "<b>Auto stand:</b> <a href='?_src_=prefs;preference=autostand'>[autostand ? "Enabled" : "Disabled"]</a><br>"
dat += "<b>Screen Shake:</b> <a href='?_src_=prefs;preference=screenshake'>[(screenshake==100) ? "Full" : ((screenshake==0) ? "None" : "[screenshake]")]</a><br>"
if (user && user.client && !user.client.prefs.screenshake==0)
if (user && user.client && !user.client?.prefs?.screenshake==0)
dat += "<b>Damage Screen Shake:</b> <a href='?_src_=prefs;preference=damagescreenshake'>[(damagescreenshake==1) ? "On" : ((damagescreenshake==0) ? "Off" : "Only when down")]</a><br>"
//GS13
+66 -66
View File
@@ -16,8 +16,8 @@
set name = "Game Preferences"
set category = "Preferences"
set desc = "Open Game Preferences Window"
usr.client.prefs.current_tab = 1
usr.client.prefs.ShowChoices(usr)
usr.client?.prefs?.current_tab = 1
usr.client?.prefs?.ShowChoices(usr)
//toggles
/datum/verbs/menu/Settings/Ghost/chatterbox
@@ -27,10 +27,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Ghost/chatterbox, toggle_ghost_ears)(
set name = "Show/Hide GhostEars"
set category = "Preferences"
set desc = "See All Speech"
usr.client.prefs.chat_toggles ^= CHAT_GHOSTEARS
to_chat(usr, "As a ghost, you will now [(usr.client.prefs.chat_toggles & CHAT_GHOSTEARS) ? "see all speech in the world" : "only see speech from nearby mobs"].")
usr.client.prefs.save_preferences()
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost Ears", "[usr.client.prefs.chat_toggles & CHAT_GHOSTEARS ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
usr.client?.prefs?.chat_toggles ^= CHAT_GHOSTEARS
to_chat(usr, "As a ghost, you will now [(usr.client?.prefs?.chat_toggles & CHAT_GHOSTEARS) ? "see all speech in the world" : "only see speech from nearby mobs"].")
usr.client?.prefs?.save_preferences()
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost Ears", "[usr.client?.prefs?.chat_toggles & CHAT_GHOSTEARS ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/verbs/menu/Settings/Ghost/chatterbox/toggle_ghost_ears/Get_checked(client/C)
return C.prefs.chat_toggles & CHAT_GHOSTEARS
@@ -38,10 +38,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Ghost/chatterbox, toggle_ghost_sight)
set name = "Show/Hide GhostSight"
set category = "Preferences"
set desc = "See All Emotes"
usr.client.prefs.chat_toggles ^= CHAT_GHOSTSIGHT
to_chat(usr, "As a ghost, you will now [(usr.client.prefs.chat_toggles & CHAT_GHOSTSIGHT) ? "see all emotes in the world" : "only see emotes from nearby mobs"].")
usr.client.prefs.save_preferences()
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost Sight", "[usr.client.prefs.chat_toggles & CHAT_GHOSTSIGHT ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
usr.client?.prefs?.chat_toggles ^= CHAT_GHOSTSIGHT
to_chat(usr, "As a ghost, you will now [(usr.client?.prefs?.chat_toggles & CHAT_GHOSTSIGHT) ? "see all emotes in the world" : "only see emotes from nearby mobs"].")
usr.client?.prefs?.save_preferences()
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost Sight", "[usr.client?.prefs?.chat_toggles & CHAT_GHOSTSIGHT ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/verbs/menu/Settings/Ghost/chatterbox/toggle_ghost_sight/Get_checked(client/C)
return C.prefs.chat_toggles & CHAT_GHOSTSIGHT
@@ -49,10 +49,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Ghost/chatterbox, toggle_ghost_whispe
set name = "Show/Hide GhostWhispers"
set category = "Preferences"
set desc = "See All Whispers"
usr.client.prefs.chat_toggles ^= CHAT_GHOSTWHISPER
to_chat(usr, "As a ghost, you will now [(usr.client.prefs.chat_toggles & CHAT_GHOSTWHISPER) ? "see all whispers in the world" : "only see whispers from nearby mobs"].")
usr.client.prefs.save_preferences()
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost Whispers", "[usr.client.prefs.chat_toggles & CHAT_GHOSTWHISPER ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
usr.client?.prefs?.chat_toggles ^= CHAT_GHOSTWHISPER
to_chat(usr, "As a ghost, you will now [(usr.client?.prefs?.chat_toggles & CHAT_GHOSTWHISPER) ? "see all whispers in the world" : "only see whispers from nearby mobs"].")
usr.client?.prefs?.save_preferences()
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost Whispers", "[usr.client?.prefs?.chat_toggles & CHAT_GHOSTWHISPER ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/verbs/menu/Settings/Ghost/chatterbox/toggle_ghost_whispers/Get_checked(client/C)
return C.prefs.chat_toggles & CHAT_GHOSTWHISPER
@@ -62,10 +62,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Ghost/chatterbox, toggle_ghost_radio)
set name = "Show/Hide GhostRadio"
set category = "Preferences"
set desc = "See All Radio Chatter"
usr.client.prefs.chat_toggles ^= CHAT_GHOSTRADIO
to_chat(usr, "As a ghost, you will now [(usr.client.prefs.chat_toggles & CHAT_GHOSTRADIO) ? "see radio chatter" : "not see radio chatter"].")
usr.client.prefs.save_preferences()
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost Radio", "[usr.client.prefs.chat_toggles & CHAT_GHOSTRADIO ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! //social experiment, increase the generation whenever you copypaste this shamelessly GENERATION 1
usr.client?.prefs?.chat_toggles ^= CHAT_GHOSTRADIO
to_chat(usr, "As a ghost, you will now [(usr.client?.prefs?.chat_toggles & CHAT_GHOSTRADIO) ? "see radio chatter" : "not see radio chatter"].")
usr.client?.prefs?.save_preferences()
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost Radio", "[usr.client?.prefs?.chat_toggles & CHAT_GHOSTRADIO ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! //social experiment, increase the generation whenever you copypaste this shamelessly GENERATION 1
/datum/verbs/menu/Settings/Ghost/chatterbox/toggle_ghost_radio/Get_checked(client/C)
return C.prefs.chat_toggles & CHAT_GHOSTRADIO
@@ -73,10 +73,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Ghost/chatterbox, toggle_ghost_pda)()
set name = "Show/Hide GhostPDA"
set category = "Preferences"
set desc = "See All PDA Messages"
usr.client.prefs.chat_toggles ^= CHAT_GHOSTPDA
to_chat(usr, "As a ghost, you will now [(usr.client.prefs.chat_toggles & CHAT_GHOSTPDA) ? "see all pda messages in the world" : "only see pda messages from nearby mobs"].")
usr.client.prefs.save_preferences()
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost PDA", "[usr.client.prefs.chat_toggles & CHAT_GHOSTPDA ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
usr.client?.prefs?.chat_toggles ^= CHAT_GHOSTPDA
to_chat(usr, "As a ghost, you will now [(usr.client?.prefs?.chat_toggles & CHAT_GHOSTPDA) ? "see all pda messages in the world" : "only see pda messages from nearby mobs"].")
usr.client?.prefs?.save_preferences()
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost PDA", "[usr.client?.prefs?.chat_toggles & CHAT_GHOSTPDA ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/verbs/menu/Settings/Ghost/chatterbox/toggle_ghost_pda/Get_checked(client/C)
return C.prefs.chat_toggles & CHAT_GHOSTPDA
@@ -88,10 +88,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Ghost/chatterbox/Events, toggle_death
set name = "Toggle Deathrattle"
set category = "Preferences"
set desc = "Death"
usr.client.prefs.toggles ^= DISABLE_DEATHRATTLE
usr.client.prefs.save_preferences()
to_chat(usr, "You will [(usr.client.prefs.toggles & DISABLE_DEATHRATTLE) ? "no longer" : "now"] get messages when a sentient mob dies.")
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Deathrattle", "[!(usr.client.prefs.toggles & DISABLE_DEATHRATTLE) ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, maybe you should spend some time reading the comments.
usr.client?.prefs?.toggles ^= DISABLE_DEATHRATTLE
usr.client?.prefs?.save_preferences()
to_chat(usr, "You will [(usr.client?.prefs?.toggles & DISABLE_DEATHRATTLE) ? "no longer" : "now"] get messages when a sentient mob dies.")
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Deathrattle", "[!(usr.client?.prefs?.toggles & DISABLE_DEATHRATTLE) ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, maybe you should spend some time reading the comments.
/datum/verbs/menu/Settings/Ghost/chatterbox/Events/toggle_deathrattle/Get_checked(client/C)
return !(C.prefs.toggles & DISABLE_DEATHRATTLE)
@@ -99,10 +99,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Ghost/chatterbox/Events, toggle_arriv
set name = "Toggle Arrivalrattle"
set category = "Preferences"
set desc = "New Player Arrival"
usr.client.prefs.toggles ^= DISABLE_ARRIVALRATTLE
to_chat(usr, "You will [(usr.client.prefs.toggles & DISABLE_ARRIVALRATTLE) ? "no longer" : "now"] get messages when someone joins the station.")
usr.client.prefs.save_preferences()
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Arrivalrattle", "[!(usr.client.prefs.toggles & DISABLE_ARRIVALRATTLE) ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, maybe you should rethink where your life went so wrong.
usr.client?.prefs?.toggles ^= DISABLE_ARRIVALRATTLE
to_chat(usr, "You will [(usr.client?.prefs?.toggles & DISABLE_ARRIVALRATTLE) ? "no longer" : "now"] get messages when someone joins the station.")
usr.client?.prefs?.save_preferences()
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Arrivalrattle", "[!(usr.client?.prefs?.toggles & DISABLE_ARRIVALRATTLE) ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, maybe you should rethink where your life went so wrong.
/datum/verbs/menu/Settings/Ghost/chatterbox/Events/toggle_arrivalrattle/Get_checked(client/C)
return !(C.prefs.toggles & DISABLE_ARRIVALRATTLE)
@@ -110,10 +110,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Ghost, togglemidroundantag)()
set name = "Toggle Midround Antagonist"
set category = "Preferences"
set desc = "Midround Antagonist"
usr.client.prefs.toggles ^= MIDROUND_ANTAG
usr.client.prefs.save_preferences()
to_chat(usr, "You will [(usr.client.prefs.toggles & MIDROUND_ANTAG) ? "now" : "no longer"] be considered for midround antagonist positions.")
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Midround Antag", "[usr.client.prefs.toggles & MIDROUND_ANTAG ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
usr.client?.prefs?.toggles ^= MIDROUND_ANTAG
usr.client?.prefs?.save_preferences()
to_chat(usr, "You will [(usr.client?.prefs?.toggles & MIDROUND_ANTAG) ? "now" : "no longer"] be considered for midround antagonist positions.")
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Midround Antag", "[usr.client?.prefs?.toggles & MIDROUND_ANTAG ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/verbs/menu/Settings/Ghost/togglemidroundantag/Get_checked(client/C)
return C.prefs.toggles & MIDROUND_ANTAG
@@ -121,16 +121,16 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, toggletitlemusic)()
set name = "Hear/Silence Lobby Music"
set category = "Preferences"
set desc = "Hear Music In Lobby"
usr.client.prefs.toggles ^= SOUND_LOBBY
usr.client.prefs.save_preferences()
if(usr.client.prefs.toggles & SOUND_LOBBY)
usr.client?.prefs?.toggles ^= SOUND_LOBBY
usr.client?.prefs?.save_preferences()
if(usr.client?.prefs?.toggles & SOUND_LOBBY)
to_chat(usr, "You will now hear music in the game lobby.")
if(isnewplayer(usr))
usr.client.playtitlemusic()
else
to_chat(usr, "You will no longer hear music in the game lobby.")
usr.stop_sound_channel(CHANNEL_LOBBYMUSIC)
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Lobby Music", "[usr.client.prefs.toggles & SOUND_LOBBY ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Lobby Music", "[usr.client?.prefs?.toggles & SOUND_LOBBY ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/verbs/menu/Settings/Sound/toggletitlemusic/Get_checked(client/C)
return C.prefs.toggles & SOUND_LOBBY
@@ -139,9 +139,9 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, togglemidis)()
set name = "Hear/Silence Midis"
set category = "Preferences"
set desc = "Hear Admin Triggered Sounds (Midis)"
usr.client.prefs.toggles ^= SOUND_MIDI
usr.client.prefs.save_preferences()
if(usr.client.prefs.toggles & SOUND_MIDI)
usr.client?.prefs?.toggles ^= SOUND_MIDI
usr.client?.prefs?.save_preferences()
if(usr.client?.prefs?.toggles & SOUND_MIDI)
to_chat(usr, "You will now hear any sounds uploaded by admins.")
else
to_chat(usr, "You will no longer hear sounds uploaded by admins")
@@ -149,7 +149,7 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, togglemidis)()
var/client/C = usr.client
if(C && C.chatOutput && !C.chatOutput.broken && C.chatOutput.loaded)
C.chatOutput.stopMusic()
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Hearing Midis", "[usr.client.prefs.toggles & SOUND_MIDI ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Hearing Midis", "[usr.client?.prefs?.toggles & SOUND_MIDI ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/verbs/menu/Settings/Sound/togglemidis/Get_checked(client/C)
return C.prefs.toggles & SOUND_MIDI
@@ -158,13 +158,13 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, toggle_instruments)()
set name = "Hear/Silence Instruments"
set category = "Preferences"
set desc = "Hear In-game Instruments"
usr.client.prefs.toggles ^= SOUND_INSTRUMENTS
usr.client.prefs.save_preferences()
if(usr.client.prefs.toggles & SOUND_INSTRUMENTS)
usr.client?.prefs?.toggles ^= SOUND_INSTRUMENTS
usr.client?.prefs?.save_preferences()
if(usr.client?.prefs?.toggles & SOUND_INSTRUMENTS)
to_chat(usr, "You will now hear people playing musical instruments.")
else
to_chat(usr, "You will no longer hear musical instruments.")
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Instruments", "[usr.client.prefs.toggles & SOUND_INSTRUMENTS ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Instruments", "[usr.client?.prefs?.toggles & SOUND_INSTRUMENTS ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/verbs/menu/Settings/Sound/toggle_instruments/Get_checked(client/C)
return C.prefs.toggles & SOUND_INSTRUMENTS
@@ -173,15 +173,15 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, Toggle_Soundscape)()
set name = "Hear/Silence Ambience"
set category = "Preferences"
set desc = "Hear Ambient Sound Effects"
usr.client.prefs.toggles ^= SOUND_AMBIENCE
usr.client.prefs.save_preferences()
if(usr.client.prefs.toggles & SOUND_AMBIENCE)
usr.client?.prefs?.toggles ^= SOUND_AMBIENCE
usr.client?.prefs?.save_preferences()
if(usr.client?.prefs?.toggles & SOUND_AMBIENCE)
to_chat(usr, "You will now hear ambient sounds.")
else
to_chat(usr, "You will no longer hear ambient sounds.")
usr.stop_sound_channel(CHANNEL_AMBIENCE)
usr.stop_sound_channel(CHANNEL_BUZZ)
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ambience", "[usr.client.prefs.toggles & SOUND_AMBIENCE ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ambience", "[usr.client?.prefs?.toggles & SOUND_AMBIENCE ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/verbs/menu/Settings/Sound/Toggle_Soundscape/Get_checked(client/C)
return C.prefs.toggles & SOUND_AMBIENCE
@@ -190,15 +190,15 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, toggle_ship_ambience)()
set name = "Hear/Silence Ship Ambience"
set category = "Preferences"
set desc = "Hear Ship Ambience Roar"
usr.client.prefs.toggles ^= SOUND_SHIP_AMBIENCE
usr.client.prefs.save_preferences()
if(usr.client.prefs.toggles & SOUND_SHIP_AMBIENCE)
usr.client?.prefs?.toggles ^= SOUND_SHIP_AMBIENCE
usr.client?.prefs?.save_preferences()
if(usr.client?.prefs?.toggles & SOUND_SHIP_AMBIENCE)
to_chat(usr, "You will now hear ship ambience.")
else
to_chat(usr, "You will no longer hear ship ambience.")
usr.stop_sound_channel(CHANNEL_BUZZ)
usr.client.ambience_playing = 0
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ship Ambience", "[usr.client.prefs.toggles & SOUND_SHIP_AMBIENCE ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, I bet you read this comment expecting to see the same thing :^)
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ship Ambience", "[usr.client?.prefs?.toggles & SOUND_SHIP_AMBIENCE ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, I bet you read this comment expecting to see the same thing :^)
/datum/verbs/menu/Settings/Sound/toggle_ship_ambience/Get_checked(client/C)
return C.prefs.toggles & SOUND_SHIP_AMBIENCE
@@ -207,10 +207,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, toggle_announcement_sound)()
set name = "Hear/Silence Announcements"
set category = "Preferences"
set desc = "Hear Announcement Sound"
usr.client.prefs.toggles ^= SOUND_ANNOUNCEMENTS
to_chat(usr, "You will now [(usr.client.prefs.toggles & SOUND_ANNOUNCEMENTS) ? "hear announcement sounds" : "no longer hear announcements"].")
usr.client.prefs.save_preferences()
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Announcement Sound", "[usr.client.prefs.toggles & SOUND_ANNOUNCEMENTS ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
usr.client?.prefs?.toggles ^= SOUND_ANNOUNCEMENTS
to_chat(usr, "You will now [(usr.client?.prefs?.toggles & SOUND_ANNOUNCEMENTS) ? "hear announcement sounds" : "no longer hear announcements"].")
usr.client?.prefs?.save_preferences()
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Announcement Sound", "[usr.client?.prefs?.toggles & SOUND_ANNOUNCEMENTS ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/verbs/menu/Settings/Sound/toggle_announcement_sound/Get_checked(client/C)
return C.prefs.toggles & SOUND_ANNOUNCEMENTS
@@ -219,13 +219,13 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, toggleprayersounds)()
set name = "Hear/Silence Prayer Sounds"
set category = "Preferences"
set desc = "Hear Prayer Sounds"
usr.client.prefs.toggles ^= SOUND_PRAYERS
usr.client.prefs.save_preferences()
if(usr.client.prefs.toggles & SOUND_PRAYERS)
usr.client?.prefs?.toggles ^= SOUND_PRAYERS
usr.client?.prefs?.save_preferences()
if(usr.client?.prefs?.toggles & SOUND_PRAYERS)
to_chat(usr, "You will now hear prayer sounds.")
else
to_chat(usr, "You will no longer prayer sounds.")
SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Prayer Sounds", "[usr.client.prefs.toggles & SOUND_PRAYERS ? "Enabled" : "Disabled"]"))
SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Prayer Sounds", "[usr.client?.prefs?.toggles & SOUND_PRAYERS ? "Enabled" : "Disabled"]"))
/datum/verbs/menu/Settings/Sound/toggleprayersounds/Get_checked(client/C)
return C.prefs.toggles & SOUND_PRAYERS
@@ -244,10 +244,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings, listen_ooc)()
set name = "Show/Hide OOC"
set category = "Preferences"
set desc = "Show OOC Chat"
usr.client.prefs.chat_toggles ^= CHAT_OOC
usr.client.prefs.save_preferences()
to_chat(usr, "You will [(usr.client.prefs.chat_toggles & CHAT_OOC) ? "now" : "no longer"] see messages on the OOC channel.")
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Seeing OOC", "[usr.client.prefs.chat_toggles & CHAT_OOC ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
usr.client?.prefs?.chat_toggles ^= CHAT_OOC
usr.client?.prefs?.save_preferences()
to_chat(usr, "You will [(usr.client?.prefs?.chat_toggles & CHAT_OOC) ? "now" : "no longer"] see messages on the OOC channel.")
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Seeing OOC", "[usr.client?.prefs?.chat_toggles & CHAT_OOC ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/verbs/menu/Settings/listen_ooc/Get_checked(client/C)
return C.prefs.chat_toggles & CHAT_OOC
+3 -3
View File
@@ -433,8 +433,8 @@
if(glass_colour_type && ishuman(user))
var/mob/living/carbon/human/H = user
if(H.client?.prefs && src == H.glasses)
H.client.prefs.uses_glasses_colour = !H.client.prefs.uses_glasses_colour
if(H.client.prefs.uses_glasses_colour)
H.client?.prefs?.uses_glasses_colour = !H.client?.prefs?.uses_glasses_colour
if(H.client?.prefs?.uses_glasses_colour)
to_chat(H, "You will now see glasses colors.")
else
to_chat(H, "You will no longer see glasses colors.")
@@ -453,7 +453,7 @@
/mob/living/carbon/human/proc/update_glasses_color(obj/item/clothing/glasses/G, glasses_equipped)
if(client && client.prefs.uses_glasses_colour && glasses_equipped)
if(client && client?.prefs?.uses_glasses_colour && glasses_equipped)
add_client_colour(G.glass_colour_type)
else
remove_client_colour(G.glass_colour_type)
+1 -1
View File
@@ -25,7 +25,7 @@
sender_override = "GATO Meteorology Division")
for(var/V in GLOB.player_list)
var/mob/M = V
if((M.client.prefs.toggles & SOUND_MIDI) && is_station_level(M.z))
if((M.client?.prefs?.toggles & SOUND_MIDI) && is_station_level(M.z))
M.playsound_local(M, pick('sound/ambience/aurora_caelus_new.ogg','sound/ambience/aurora_caelus.ogg'), 40, FALSE, pressure_affected = FALSE) //ogg is "The Fire is Gone" by Heaven Pierce Her, used in the videogame ULTRAKILL. All respects and credits to the equivalent artists who worked on it.
start_checking()
+1 -1
View File
@@ -39,7 +39,7 @@ Captain
throw EXCEPTION("[H.nameless ? "Captain" : "Captain [H.real_name]"] ([H.x],[H.y],[H.z]) has no client.")
return
var/displayed_rank = H.client.prefs.alt_titles_preferences[title]
var/displayed_rank = H.client?.prefs?.alt_titles_preferences[title]
if(!displayed_rank) //Default to Captain
displayed_rank = "Captain"
@@ -39,12 +39,12 @@ Chaplain
return
var/new_religion = "Christianity"
if(M.client && M.client.prefs.custom_names["religion"])
new_religion = M.client.prefs.custom_names["religion"]
if(M.client && M.client?.prefs?.custom_names["religion"])
new_religion = M.client?.prefs?.custom_names["religion"]
var/new_deity = "Space Jesus"
if(M.client && M.client.prefs.custom_names["deity"])
new_deity = M.client.prefs.custom_names["deity"]
if(M.client && M.client?.prefs?.custom_names["deity"])
new_deity = M.client?.prefs?.custom_names["deity"]
B.deity_name = new_deity
+2 -2
View File
@@ -227,7 +227,7 @@ GLOBAL_LIST_INIT(available_depts, list(SEC_DEPT_ENGINEERING, SEC_DEPT_MEDICAL, S
// Assign department security
var/department
if(M && M.client && M.client.prefs)
department = M.client.prefs.prefered_security_department
department = M.client?.prefs?.prefered_security_department
if(!LAZYLEN(GLOB.available_depts) || department == "None")
return
else if(department in GLOB.available_depts)
@@ -387,7 +387,7 @@ Junior Security Officer
// Assign department security
var/department
if(M && M.client && M.client.prefs)
department = M.client.prefs.prefered_security_department
department = M.client?.prefs?.prefered_security_department
if(!LAZYLEN(GLOB.available_depts) || department == "None")
return
else if(department in GLOB.available_depts)
+2 -2
View File
@@ -37,8 +37,8 @@
postfix = "soon"
to_chat(src, "Please set up your character and select \"Ready\". The game will start [postfix].")
if(client.prefs.path) //Hyper edit: notify of a newer preference version
var/savefile/S = new /savefile(client.prefs.path)
if(client?.prefs?.path) //Hyper edit: notify of a newer preference version
var/savefile/S = new /savefile(client?.prefs?.path)
if(S)
S.cd = "/"
var/slot
+13 -13
View File
@@ -32,7 +32,7 @@
return
/mob/dead/new_player/proc/new_player_panel()
var/output = "<center><p>Welcome, <b>[client ? client.prefs.real_name : "Unknown User"]</b></p>"
var/output = "<center><p>Welcome, <b>[client ? client?.prefs?.real_name : "Unknown User"]</b></p>"
output += "<p><a href='byond://?src=[REF(src)];show_preferences=1'>Setup Character</a></p>"
if(SSticker.current_state <= GAME_STATE_PREGAME)
@@ -93,7 +93,7 @@
relevant_cap = max(hpc, epc)
if(href_list["show_preferences"])
client.prefs.ShowChoices(src)
client?.prefs?.ShowChoices(src)
return 1
if(href_list["ready"])
@@ -122,7 +122,7 @@
LateChoices()
return
// if(client.prefs.real_name in client.pastcharacters) //if character has been spawned before
// if(client?.prefs?.real_name in client.pastcharacters) //if character has been spawned before
// to_chat(usr, "<span class='notice'>You have played that character before this round, please select a new one!</span>")
// return
@@ -183,7 +183,7 @@
if(!ready && href_list["preference"])
if(client)
client.prefs.process_link(src, href_list)
client?.prefs?.process_link(src, href_list)
else if(!href_list["late_join"])
new_player_panel()
@@ -303,7 +303,7 @@
observer.client = client
observer.set_ghost_appearance()
if(observer.client && observer.client.prefs)
observer.real_name = observer.client.prefs.real_name
observer.real_name = observer.client?.prefs?.real_name
observer.name = observer.real_name
observer.client.init_verbs()
observer.update_icon()
@@ -346,11 +346,11 @@
if(jobban_isbanned(src,rank))
return JOB_UNAVAILABLE_BANNED
if(job.whitelist_type) //whitelisting
if(job.whitelist_type == "roleplay" && !client.prefs.roleplayroles)
if(job.whitelist_type == "roleplay" && !client?.prefs?.roleplayroles)
return JOB_UNAVAILABLE_WHITELIST
if(job.whitelist_type == "important" && !client.prefs.importantroles)
if(job.whitelist_type == "important" && !client?.prefs?.importantroles)
return JOB_UNAVAILABLE_WHITELIST
if(job.whitelist_type == "silly" && !client.prefs.sillyroles)
if(job.whitelist_type == "silly" && !client?.prefs?.sillyroles)
return JOB_UNAVAILABLE_WHITELIST
if(QDELETED(src))
return JOB_UNAVAILABLE_GENERIC
@@ -554,8 +554,8 @@
jobline += "<a class='[position_class]' style='display:block;width:170px' href='byond://?src=[REF(src)];SelectedJob=[job.title]'><font color='lime'><b>[job.title] ([job.current_positions])</b></font></a>"
else
jobline += "<a class='[position_class]' style='display:block;width:170px' href='byond://?src=[REF(src)];SelectedJob=[job.title]'>[job.title] ([job.current_positions])</a>"
if(client && client.prefs && client.prefs.alt_titles_preferences[job.title])
jobline += "<br><span style='color:#BBBBBB; font-style: italic;'>(as [client.prefs.alt_titles_preferences[job.title]])</span>"
if(client && client.prefs && client?.prefs?.alt_titles_preferences[job.title])
jobline += "<br><span style='color:#BBBBBB; font-style: italic;'>(as [client?.prefs?.alt_titles_preferences[job.title]])</span>"
dat += jobline
categorizedJobs[jobcat]["jobs"] -= job
@@ -588,9 +588,9 @@
if(QDELETED(src))
return
if(frn)
client.prefs.random_character()
client.prefs.real_name = client.prefs.pref_species.random_name(gender,1)
client.prefs.copy_to(H)
client?.prefs?.random_character()
client?.prefs?.real_name = client?.prefs?.pref_species.random_name(gender,1)
client?.prefs?.copy_to(H)
H.dna.update_dna_identity()
if(mind)
+5 -5
View File
@@ -3,16 +3,16 @@
if(!. || !client)
return FALSE
ghost_accs = client.prefs.ghost_accs
ghost_others = client.prefs.ghost_others
ghost_accs = client?.prefs?.ghost_accs
ghost_others = client?.prefs?.ghost_others
var/preferred_form = null
if(IsAdminGhost(src))
has_unlimited_silicon_privilege = 1
if(client.prefs.unlock_content)
preferred_form = client.prefs.ghost_form
ghost_orbit = client.prefs.ghost_orbit
if(client?.prefs?.unlock_content)
preferred_form = client?.prefs?.ghost_form
ghost_orbit = client?.prefs?.ghost_orbit
var/turf/T = get_turf(src)
if (isturf(T))
+24 -24
View File
@@ -175,8 +175,8 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
/mob/dead/observer/update_icon(new_form)
. = ..()
if(client) //We update our preferences in case they changed right before update_icon was called.
ghost_accs = client.prefs.ghost_accs
ghost_others = client.prefs.ghost_others
ghost_accs = client?.prefs?.ghost_accs
ghost_others = client?.prefs?.ghost_others
if(hair_overlay)
cut_overlay(hair_overlay)
@@ -268,9 +268,9 @@ Works together with spawning an observer, noted above.
var/mob/dead/observer/ghost = new(get_turf(src), src) // Transfer safety to observer spawning proc.
SStgui.on_transfer(src, ghost) // Transfer NanoUIs.
ghost.can_reenter_corpse = can_reenter_corpse
if (client && client.prefs && client.prefs.auto_ooc)
if (!(client.prefs.chat_toggles & CHAT_OOC))
client.prefs.chat_toggles ^= CHAT_OOC
if (client && client.prefs && client?.prefs?.auto_ooc)
if (!(client?.prefs?.chat_toggles & CHAT_OOC))
client?.prefs?.chat_toggles ^= CHAT_OOC
transfer_ckey(ghost, FALSE)
ghost.AddElement(/datum/element/ghost_role_eligibility,penalize) // technically already run earlier, but this adds the penalty
// needs to be done AFTER the ckey transfer, too
@@ -378,8 +378,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(source)
var/obj/screen/alert/A = throw_alert("[REF(source)]_notify_cloning", /obj/screen/alert/notify_cloning)
if(A)
if(client && client.prefs && client.prefs.UI_style)
A.icon = ui_style2icon(client.prefs.UI_style)
if(client && client.prefs && client?.prefs?.UI_style)
A.icon = ui_style2icon(client?.prefs?.UI_style)
A.desc = message
var/old_layer = source.layer
var/old_plane = source.plane
@@ -506,7 +506,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
set name = "View Range"
set desc = "Change your view range."
var/max_view = client.prefs.unlock_content ? GHOST_MAX_VIEW_RANGE_MEMBER : GHOST_MAX_VIEW_RANGE_DEFAULT
var/max_view = client?.prefs?.unlock_content ? GHOST_MAX_VIEW_RANGE_MEMBER : GHOST_MAX_VIEW_RANGE_DEFAULT
if(client.view == CONFIG_GET(string/default_view))
var/list/views = list()
for(var/i in 7 to max_view)
@@ -520,7 +520,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
/mob/dead/observer/verb/add_view_range(input as num)
set name = "Add View Range"
set hidden = TRUE
var/max_view = client.prefs.unlock_content ? GHOST_MAX_VIEW_RANGE_MEMBER : GHOST_MAX_VIEW_RANGE_DEFAULT
var/max_view = client?.prefs?.unlock_content ? GHOST_MAX_VIEW_RANGE_MEMBER : GHOST_MAX_VIEW_RANGE_DEFAULT
if(input)
client.rescale_view(input, 15, (max_view*2)+1)
@@ -573,7 +573,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
/mob/dead/observer/update_sight()
if(client)
ghost_others = client.prefs.ghost_others //A quick update just in case this setting was changed right before calling the proc
ghost_others = client?.prefs?.ghost_others //A quick update just in case this setting was changed right before calling the proc
if (!ghostvision)
see_invisible = SEE_INVISIBLE_LIVING
@@ -601,11 +601,11 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
client.images -= GLOB.ghost_images_default
if(GHOST_OTHERS_SIMPLE)
client.images -= GLOB.ghost_images_simple
lastsetting = client.prefs.ghost_others
lastsetting = client?.prefs?.ghost_others
if(!ghostvision)
return
if(client.prefs.ghost_others != GHOST_OTHERS_THEIR_SETTING)
switch(client.prefs.ghost_others)
if(client?.prefs?.ghost_others != GHOST_OTHERS_THEIR_SETTING)
switch(client?.prefs?.ghost_others)
if(GHOST_OTHERS_DEFAULT_SPRITE)
client.images |= (GLOB.ghost_images_default-ghostimage_default)
if(GHOST_OTHERS_SIMPLE)
@@ -741,23 +741,23 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
set_ghost_appearance()
if(client && client.prefs)
deadchat_name = client.prefs.real_name
deadchat_name = client?.prefs?.real_name
/mob/dead/observer/proc/set_ghost_appearance()
if((!client) || (!client.prefs))
return
if(client.prefs.be_random_name)
client.prefs.real_name = random_unique_name(gender)
if(client.prefs.be_random_body)
client.prefs.random_character(gender)
if(client?.prefs?.be_random_name)
client?.prefs?.real_name = random_unique_name(gender)
if(client?.prefs?.be_random_body)
client?.prefs?.random_character(gender)
if(HAIR in client.prefs.pref_species.species_traits)
hair_style = client.prefs.hair_style
hair_color = brighten_color(client.prefs.hair_color)
if(FACEHAIR in client.prefs.pref_species.species_traits)
facial_hair_style = client.prefs.facial_hair_style
facial_hair_color = brighten_color(client.prefs.facial_hair_color)
if(HAIR in client?.prefs?.pref_species.species_traits)
hair_style = client?.prefs?.hair_style
hair_color = brighten_color(client?.prefs?.hair_color)
if(FACEHAIR in client?.prefs?.pref_species.species_traits)
facial_hair_style = client?.prefs?.facial_hair_style
facial_hair_color = brighten_color(client?.prefs?.facial_hair_color)
update_icon()
+1 -1
View File
@@ -34,7 +34,7 @@
to_follow = V.source
var/link = FOLLOW_LINK(src, to_follow)
// Create map text prior to modifying message for goonchat
if (client?.prefs.chat_on_map && (client.prefs.see_chat_non_mob || ismob(speaker)))
if (client?.prefs.chat_on_map && (client?.prefs?.see_chat_non_mob || ismob(speaker)))
create_chat_message(speaker, message_language, raw_message, spans, message_mode)
// Recompose the message, because it's scrambled by default
message = compose_message(speaker, message_language, raw_message, radio_freq, spans, message_mode, FALSE, source)
+159 -345
View File
@@ -313,7 +313,7 @@ GLOBAL_LIST_EMPTY(roundstart_races)
C.canbearoused = FALSE
else
if(C.client)
C.canbearoused = C.client.prefs.arousable
C.canbearoused = C.client?.prefs?.arousable
if(ishuman(C))
var/mob/living/carbon/human/H = C
if(NOGENITALS in H.dna.species.species_traits)
@@ -1249,356 +1249,170 @@ GLOBAL_LIST_EMPTY(roundstart_races)
//LIFE//
////////
///datum/species/proc/handle_digestion(mob/living/carbon/human/H)
// if(HAS_TRAIT(src, TRAIT_NOHUNGER))
// return //hunger is for BABIES
/datum/species/proc/update_body_size(mob/living/carbon/human/H, size_change)
if (!H)
return
/* //The fucking TRAIT_FAT mutation is the dumbest shit ever. It makes the code so difficult to work with
if(HAS_TRAIT(H, TRAIT_FAT))//I share your pain, past coder.
if(H.fatness < FATNESS_LEVEL_FAT)//this is a mess, indeed.
to_chat(H, "<span class='notice'>You feel fit again!</span>")//GS13 Added a whole bunch of new fatness traits. Truly I am a masochist
REMOVE_TRAIT(H, TRAIT_FAT, OBESITY)
H.update_body()
H.update_inv_w_uniform()
H.update_inv_wear_suit()
else if(H.fatness >= FATNESS_LEVEL_OBESE)
to_chat(H, "<span class='danger'>You feel even plumper!</span>")
REMOVE_TRAIT(H, TRAIT_FAT, OBESITY)
ADD_TRAIT(H, TRAIT_OBESE, OBESITY)
H.update_body()
H.update_inv_w_uniform()
H.update_inv_wear_suit()
else if(HAS_TRAIT(H, TRAIT_OBESE))
if(H.fatness < FATNESS_LEVEL_OBESE)
to_chat(H, "<span class='notice'>You feel like you've lost weight!</span>")
REMOVE_TRAIT(H, TRAIT_OBESE, OBESITY)
ADD_TRAIT(H, TRAIT_FAT, OBESITY)
H.update_body()
H.update_inv_w_uniform()
H.update_inv_wear_suit()
else if(H.fatness >= FATNESS_LEVEL_MORBIDLY_OBESE)
to_chat(H, "<span class='danger'>You feel a lot fatter than before</span>")
REMOVE_TRAIT(H, TRAIT_OBESE, OBESITY)
ADD_TRAIT(H, TRAIT_MORBIDLYOBESE, OBESITY)
H.update_body()
H.update_inv_w_uniform()
H.update_inv_wear_suit()
else if(HAS_TRAIT(H, TRAIT_MORBIDLYOBESE))
if(H.fatness < FATNESS_LEVEL_MORBIDLY_OBESE)
to_chat(H, "<span class='notice'>You feel a bit less fat!</span>")
REMOVE_TRAIT(H, TRAIT_MORBIDLYOBESE, OBESITY)
ADD_TRAIT(H, TRAIT_OBESE, OBESITY)
H.update_body()
H.update_inv_w_uniform()
H.update_inv_wear_suit()
else if(H.fatness >= FATNESS_LEVEL_IMMOBILE)
to_chat(H, "<span class='danger'>You feel your fat belly rubbing on the floor!</span>")
REMOVE_TRAIT(H, TRAIT_MORBIDLYOBESE, OBESITY)
ADD_TRAIT(H, TRAIT_IMMOBILE, OBESITY)
H.update_body()
H.update_inv_w_uniform()
H.update_inv_wear_suit()
else if(HAS_TRAIT(H, TRAIT_IMMOBILE))
if(H.fatness < FATNESS_LEVEL_IMMOBILE)
to_chat(H, "<span class='notice'>You feel less restrained by your fat!</span>")
REMOVE_TRAIT(H, TRAIT_IMMOBILE, OBESITY)
ADD_TRAIT(H, TRAIT_MORBIDLYOBESE, OBESITY)
H.update_body()
H.update_inv_w_uniform()
H.update_inv_wear_suit()
else if(H.fatness >= FATNESS_LEVEL_BLOB)
to_chat(H, "<span class='danger'>You feel like you've become a mountain of fat!</span>")
REMOVE_TRAIT(H, TRAIT_IMMOBILE, OBESITY)
ADD_TRAIT(H, TRAIT_BLOB, OBESITY)
H.update_body()
H.update_inv_w_uniform()
H.update_inv_wear_suit()
else if(HAS_TRAIT(H, TRAIT_BLOB))
if(H.fatness < FATNESS_LEVEL_BLOB)
to_chat(H, "<span class='notice'>You feel like you've regained some mobility!</span>")
REMOVE_TRAIT(H, TRAIT_BLOB, OBESITY)
ADD_TRAIT(H, TRAIT_IMMOBILE, OBESITY)
H.update_body()
H.update_inv_w_uniform()
H.update_inv_wear_suit()
var/obj/item/organ/genital/anus/anus = H.getorganslot("anus")
var/obj/item/organ/genital/belly/belly = H.getorganslot("belly")
var/obj/item/organ/genital/breasts/breasts = H.getorganslot("breasts")
update_genital_size(anus, size_change)
update_genital_size(belly, size_change)
update_breasts_size(breasts, size_change)
H.genital_override = TRUE
H.update_body()
H.update_inv_w_uniform()
H.update_inv_wear_suit()
/datum/species/proc/update_genital_size(obj/item/organ/genital/G, size_change)
if (!G)
return
G.size = G.size + size_change
G.update()
/datum/species/proc/update_breasts_size(obj/item/organ/genital/breasts/G, size_change)
if (!G)
return
G.cached_size = G.cached_size + size_change
G.update()
/datum/species/proc/handle_fatness_trait(mob/living/carbon/human/H, trait, trait_lose, trait_gain, fatness_lose, fatness_gain, chat_lose, chat_gain)
if(H.fatness < fatness_lose)
if (chat_lose)
to_chat(H, chat_lose)
if (trait)
REMOVE_TRAIT(H, trait, OBESITY)
if (trait_lose)
ADD_TRAIT(H, trait_lose, OBESITY)
update_body_size(H, -1)
else if(H.fatness >= fatness_gain)
if (chat_gain)
to_chat(H, chat_gain)
if (trait)
REMOVE_TRAIT(H, trait, OBESITY)
if (trait_gain)
ADD_TRAIT(H, trait_gain, OBESITY)
update_body_size(H, 1)
/datum/species/proc/handle_fatness(mob/living/carbon/human/H)
if(HAS_TRAIT(H, TRAIT_BLOB))
handle_fatness_trait(
H,
TRAIT_BLOB,
TRAIT_IMMOBILE,
null,
FATNESS_LEVEL_BLOB,
INFINITY,
"<span class='notice'>You feel like you've regained some mobility!</span>",
null)
return
if(HAS_TRAIT(H, TRAIT_IMMOBILE))
handle_fatness_trait(
H,
TRAIT_IMMOBILE,
TRAIT_BARELYMOBILE,
TRAIT_BLOB,
FATNESS_LEVEL_IMMOBILE,
FATNESS_LEVEL_BLOB,
"<span class='notice'>You feel less restrained by your fat!</span>",
"<span class='danger'>You feel like you've become a mountain of fat!</span>")
return
if(HAS_TRAIT(H, TRAIT_BARELYMOBILE))
handle_fatness_trait(
H,
TRAIT_BARELYMOBILE,
TRAIT_EXTREMELYOBESE,
TRAIT_IMMOBILE,
FATNESS_LEVEL_BARELYMOBILE,
FATNESS_LEVEL_IMMOBILE,
"<span class='notice'>You feel less restrained by your fat!</span>",
"<span class='danger'>You feel belly smush against the floor!</span>")
return
if(HAS_TRAIT(H, TRAIT_EXTREMELYOBESE))
handle_fatness_trait(
H,
TRAIT_EXTREMELYOBESE,
TRAIT_MORBIDLYOBESE,
TRAIT_BARELYMOBILE,
FATNESS_LEVEL_EXTREMELY_OBESE,
FATNESS_LEVEL_BARELYMOBILE,
"<span class='notice'>You feel less restrained by your fat!</span>",
"<span class='danger'>You feel like you can barely move!</span>")
return
if(HAS_TRAIT(H, TRAIT_MORBIDLYOBESE))
handle_fatness_trait(
H,
TRAIT_MORBIDLYOBESE,
TRAIT_OBESE,
TRAIT_EXTREMELYOBESE,
FATNESS_LEVEL_MORBIDLY_OBESE,
FATNESS_LEVEL_EXTREMELY_OBESE,
"<span class='notice'>You feel a bit less fat!</span>",
"<span class='danger'>You feel your belly rest heavily on your lap!</span>")
return
if(HAS_TRAIT(H, TRAIT_OBESE))
handle_fatness_trait(
H,
TRAIT_OBESE,
TRAIT_VERYFAT,
TRAIT_MORBIDLYOBESE,
FATNESS_LEVEL_OBESE,
FATNESS_LEVEL_MORBIDLY_OBESE,
"<span class='notice'>You feel like you've lost weight!</span>",
"<span class='danger'>Your thighs begin to rub against each other.</span>")
return
if(HAS_TRAIT(H, TRAIT_VERYFAT))
handle_fatness_trait(
H,
TRAIT_VERYFAT,
TRAIT_FATTER,
TRAIT_OBESE,
FATNESS_LEVEL_VERYFAT,
FATNESS_LEVEL_OBESE,
"<span class='notice'>You feel like you've lost weight!</span>",
"<span class='danger'>You feel like you're starting to get really heavy.</span>")
return
if(HAS_TRAIT(H, TRAIT_FATTER))
handle_fatness_trait(
H,
TRAIT_FATTER,
TRAIT_FAT,
TRAIT_VERYFAT,
FATNESS_LEVEL_FATTER,
FATNESS_LEVEL_VERYFAT,
"<span class='notice'>You feel like you've lost weight!</span>",
"<span class='danger'>Your clothes creak quietly!</span>")
return
if(HAS_TRAIT(H, TRAIT_FAT))
handle_fatness_trait(
H,
TRAIT_FAT,
null,
TRAIT_FATTER,
FATNESS_LEVEL_FAT,
FATNESS_LEVEL_FATTER,
"<span class='notice'>You feel fit again!</span>",
"<span class='danger'>You feel even plumper!</span>")
else
if(H.fatness >= FATNESS_LEVEL_FAT)
to_chat(H, "<span class='danger'>You suddenly feel blubbery!</span>")
ADD_TRAIT(H, TRAIT_FAT, OBESITY)
H.update_body()
H.update_inv_w_uniform()
H.update_inv_wear_suit()
*/
handle_fatness_trait(
H,
null,
null,
TRAIT_FAT,
0,
FATNESS_LEVEL_FAT,
null,
"<span class='danger'>You suddenly feel blubbery!</span>")
/datum/species/proc/handle_digestion(mob/living/carbon/human/H)
var/obj/item/organ/genital/anus/B = H.getorganslot("anus")
var/obj/item/organ/genital/belly/C = H.getorganslot("belly")
var/obj/item/organ/genital/breasts/D = H.getorganslot("breasts")
if(HAS_TRAIT(src, TRAIT_NOHUNGER))
return //hunger is for BABIES
//The fucking TRAIT_FAT mutation is the dumbest shit ever. It makes the code so difficult to work with
//gonna attempt to categorize these a bit to not make them a TINY bit less of an eyesore
if(HAS_TRAIT(H, TRAIT_FAT))//I share your pain, past coder.
if(H.fatness < FATNESS_LEVEL_FAT) //WEIGHT LOSS
to_chat(H, "<span class='notice'>You feel fit again!</span>")
REMOVE_TRAIT(H, TRAIT_FAT, OBESITY)
B.size = B.size - 1
B.update()
C.size = 0
C.update()
D.cached_size = D.cached_size - 1
D.update()
H.genital_override = TRUE
H.update_body()
H.update_inv_w_uniform()
H.update_inv_wear_suit()
else if(H.fatness >= FATNESS_LEVEL_FATTER) //WEIGHT GAIN
to_chat(H, "<span class='danger'>You feel even plumper!</span>")
REMOVE_TRAIT(H, TRAIT_FAT, OBESITY)
ADD_TRAIT(H, TRAIT_FATTER, OBESITY)
B.size = B.size + 1
B.update()
C.size = C.size + 1
C.update()
D.cached_size = D.cached_size + 1
D.update()
H.genital_override = TRUE
H.update_body()
H.update_inv_w_uniform()
H.update_inv_wear_suit()
else if(HAS_TRAIT(H, TRAIT_FATTER)) //WEIGHT LOSS
if(H.fatness < FATNESS_LEVEL_FATTER)
to_chat(H, "<span class='notice'>You feel like you've lost weight!</span>")
REMOVE_TRAIT(H, TRAIT_FATTER, OBESITY)
ADD_TRAIT(H, TRAIT_FAT, OBESITY)
B.size = B.size - 1
B.update()
C.size = C.size - 1
C.update()
D.cached_size = D.cached_size - 1
D.update()
H.genital_override = TRUE
H.update_body()
H.update_inv_w_uniform()
H.update_inv_wear_suit()
else if(H.fatness >= FATNESS_LEVEL_VERYFAT) //WEIGHT GAIN
to_chat(H, "<span class='danger'>Your clothes creak quietly!</span>")
REMOVE_TRAIT(H, TRAIT_FATTER, OBESITY)
ADD_TRAIT(H, TRAIT_VERYFAT, OBESITY)
B.size = B.size + 1
B.update()
C.size = C.size + 1
C.update()
D.cached_size = D.cached_size + 1
D.update()
H.genital_override = TRUE
H.update_body()
H.update_inv_w_uniform()
H.update_inv_wear_suit()
else if(HAS_TRAIT(H, TRAIT_VERYFAT)) //WEIGHT LOSS
if(H.fatness < FATNESS_LEVEL_VERYFAT)
to_chat(H, "<span class='notice'>You feel like you've lost weight!</span>")
REMOVE_TRAIT(H, TRAIT_VERYFAT, OBESITY)
ADD_TRAIT(H, TRAIT_FATTER, OBESITY)
B.size = B.size - 1
B.update()
C.size = C.size - 1
C.update()
D.cached_size = D.cached_size - 1
D.update()
H.genital_override = TRUE
H.update_body()
H.update_inv_w_uniform()
H.update_inv_wear_suit()
else if(H.fatness >= FATNESS_LEVEL_OBESE) //WEIGHT GAIN
to_chat(H, "<span class='danger'>You feel like you're starting to get really heavy.</span>")
REMOVE_TRAIT(H, TRAIT_VERYFAT, OBESITY)
ADD_TRAIT(H, TRAIT_OBESE, OBESITY)
B.size = B.size + 1
B.update()
C.size = C.size + 1
C.update()
D.cached_size = D.cached_size + 1
D.update()
H.genital_override = TRUE
H.update_body()
H.update_inv_w_uniform()
H.update_inv_wear_suit()
else if(HAS_TRAIT(H, TRAIT_OBESE)) //WEIGHT LOSS
if(H.fatness < FATNESS_LEVEL_OBESE)
to_chat(H, "<span class='notice'>You feel like you've lost weight!</span>")
REMOVE_TRAIT(H, TRAIT_OBESE, OBESITY)
ADD_TRAIT(H, TRAIT_VERYFAT, OBESITY)
B.size = B.size - 1
B.update()
C.size = C.size - 1
C.update()
D.cached_size = D.cached_size - 1
D.update()
H.genital_override = TRUE
H.update_body()
H.update_inv_w_uniform()
H.update_inv_wear_suit()
else if(H.fatness >= FATNESS_LEVEL_MORBIDLY_OBESE) //WEIGHT GAIN
to_chat(H, "<span class='danger'>Your thighs begin to rub against each other.</span>")
REMOVE_TRAIT(H, TRAIT_OBESE, OBESITY)
ADD_TRAIT(H, TRAIT_MORBIDLYOBESE, OBESITY)
B.size = B.size + 1
B.update()
C.size = C.size + 1
C.update()
D.cached_size = D.cached_size + 1
D.update()
H.genital_override = TRUE
H.update_body()
H.update_inv_w_uniform()
H.update_inv_wear_suit()
else if(HAS_TRAIT(H, TRAIT_MORBIDLYOBESE)) //WEIGHT LOSS
if(H.fatness < FATNESS_LEVEL_MORBIDLY_OBESE)
to_chat(H, "<span class='notice'>You feel a bit less fat!</span>")
REMOVE_TRAIT(H, TRAIT_MORBIDLYOBESE, OBESITY)
ADD_TRAIT(H, TRAIT_OBESE, OBESITY)
B.size = B.size - 1
B.update()
C.size = C.size - 1
C.update()
D.cached_size = D.cached_size - 1
D.update()
H.genital_override = TRUE
H.update_body()
H.update_inv_w_uniform()
H.update_inv_wear_suit()
else if(H.fatness >= FATNESS_LEVEL_EXTREMELY_OBESE) //WEIGHT GAIN
to_chat(H, "<span class='danger'>You feel your belly rest heavily on your lap!</span>")
REMOVE_TRAIT(H, TRAIT_MORBIDLYOBESE, OBESITY)
ADD_TRAIT(H, TRAIT_EXTREMELYOBESE, OBESITY)
B.size = B.size + 1
B.update()
C.size = C.size + 1
C.update()
D.cached_size = D.cached_size + 1
D.update()
H.genital_override = TRUE
H.update_body()
H.update_inv_w_uniform()
H.update_inv_wear_suit()
else if(HAS_TRAIT(H, TRAIT_EXTREMELYOBESE)) //WEIGHT LOS
if(H.fatness < FATNESS_LEVEL_EXTREMELY_OBESE)
to_chat(H, "<span class='notice'>You feel less restrained by your fat!</span>")
REMOVE_TRAIT(H, TRAIT_EXTREMELYOBESE, OBESITY)
ADD_TRAIT(H, TRAIT_MORBIDLYOBESE, OBESITY)
B.size = B.size - 1
B.update()
C.size = C.size - 1
C.update()
D.cached_size = D.cached_size - 1
D.update()
H.genital_override = TRUE
H.update_body()
H.update_inv_w_uniform()
H.update_inv_wear_suit()
else if(H.fatness >= FATNESS_LEVEL_BARELYMOBILE) //WEIGHT GAIN
to_chat(H, "<span class='danger'>You feel like you can barely move!</span>")
REMOVE_TRAIT(H, TRAIT_EXTREMELYOBESE, OBESITY)
ADD_TRAIT(H, TRAIT_BARELYMOBILE, OBESITY)
B.size = B.size + 1
B.update()
C.size = C.size + 1
C.update()
D.cached_size = D.cached_size + 1
D.update()
H.genital_override = TRUE
H.update_body()
H.update_inv_w_uniform()
H.update_inv_wear_suit()
else if(HAS_TRAIT(H, TRAIT_BARELYMOBILE)) //WEIGHT LOSS
if(H.fatness < FATNESS_LEVEL_BARELYMOBILE)
to_chat(H, "<span class='notice'>You feel less restrained by your fat!</span>")
REMOVE_TRAIT(H, TRAIT_BARELYMOBILE, OBESITY)
ADD_TRAIT(H, TRAIT_EXTREMELYOBESE, OBESITY)
B.size = B.size - 1
B.update()
C.size = C.size - 1
C.update()
D.cached_size = D.cached_size - 1
D.update()
H.genital_override = TRUE
H.update_body()
H.update_inv_w_uniform()
H.update_inv_wear_suit()
else if(H.fatness >= FATNESS_LEVEL_IMMOBILE) //WEIGHT GAIN
to_chat(H, "<span class='danger'>You feel belly smush against the floor!</span>")
REMOVE_TRAIT(H, TRAIT_BARELYMOBILE, OBESITY)
ADD_TRAIT(H, TRAIT_IMMOBILE, OBESITY)
B.size = B.size + 1
B.update()
C.size = C.size + 1
C.update()
D.cached_size = D.cached_size + 1
D.update()
H.genital_override = TRUE
H.update_body()
H.update_inv_w_uniform()
H.update_inv_wear_suit()
else if(HAS_TRAIT(H, TRAIT_IMMOBILE)) //WEIGHT LOSS
if(H.fatness < FATNESS_LEVEL_IMMOBILE)
to_chat(H, "<span class='notice'>You feel less restrained by your fat!</span>")
REMOVE_TRAIT(H, TRAIT_IMMOBILE, OBESITY)
ADD_TRAIT(H, TRAIT_BARELYMOBILE, OBESITY)
B.size = B.size - 1
B.update()
C.size = C.size - 1
C.update()
D.cached_size = D.cached_size - 1
D.update()
H.genital_override = TRUE
H.update_body()
H.update_inv_w_uniform()
H.update_inv_wear_suit()
else if(H.fatness > FATNESS_LEVEL_BLOB) //WEIGHT GAIN
to_chat(H, "<span class='danger'>You feel like you've become a mountain of fat!</span>")
REMOVE_TRAIT(H, TRAIT_IMMOBILE, OBESITY)
ADD_TRAIT(H, TRAIT_BLOB, OBESITY)
B.size = B.size + 1
B.update()
C.size = C.size + 1
C.update()
D.cached_size = D.cached_size + 1
D.update()
H.genital_override = TRUE
H.update_body()
H.update_inv_w_uniform()
H.update_inv_wear_suit()
else if(HAS_TRAIT(H, TRAIT_BLOB)) //WEIGHT LOSS
if(H.fatness < FATNESS_LEVEL_BLOB)
to_chat(H, "<span class='notice'>You feel like you've regained some mobility!</span>")
REMOVE_TRAIT(H, TRAIT_BLOB, OBESITY)
ADD_TRAIT(H, TRAIT_IMMOBILE, OBESITY)
B.size = B.size - 1
B.update()
C.size = C.size - 1
C.update()
D.cached_size = D.cached_size - 1
D.update()
H.genital_override = TRUE
H.update_body()
H.update_inv_w_uniform()
H.update_inv_wear_suit()
else
if(H.fatness >= FATNESS_LEVEL_FAT) //WEIGHT GAIN
to_chat(H, "<span class='danger'>You suddenly feel blubbery!</span>")
ADD_TRAIT(H, TRAIT_FAT, OBESITY)
B.size = B.size + 1
B.update()
C.size = C.size + 1
C.update()
D.cached_size = D.cached_size + 1
D.update()
H.genital_override = TRUE
H.update_body()
H.update_inv_w_uniform()
H.update_inv_wear_suit()
handle_fatness(H) // GS13
// nutrition decrease and satiety
if (H.nutrition > 0 && H.stat != DEAD && !HAS_TRAIT(H, TRAIT_NOHUNGER))
@@ -21,7 +21,7 @@
if(ishuman(C))
var/mob/living/carbon/human/H = C
if(!H.dna.features["moth_wings"])
H.dna.features["moth_wings"] = "[(H.client && H.client.prefs && LAZYLEN(H.client.prefs.features) && H.client.prefs.features["moth_wings"]) ? H.client.prefs.features["moth_wings"] : "Plain"]"
H.dna.features["moth_wings"] = "[(H.client && H.client.prefs && LAZYLEN(H.client?.prefs?.features) && H.client?.prefs?.features["moth_wings"]) ? H.client?.prefs?.features["moth_wings"] : "Plain"]"
handle_mutant_bodyparts(H)
/datum/species/moth/random_name(gender,unique,lastname)
@@ -25,7 +25,7 @@
log_whisper("[src.name]/[src.key] : [message]")
if (src.client)
if (src.client.prefs.muted & MUTE_IC)
if (src.client?.prefs?.muted & MUTE_IC)
to_chat(src, "<span class='danger'>You cannot whisper (muted).</span>")
return
@@ -54,7 +54,7 @@
var/list/listening_dead = list()
for(var/mob/M in GLOB.player_list)
if(M.stat == DEAD && M.client && ((M.client.prefs.chat_toggles & CHAT_GHOSTWHISPER) || (get_dist(M, src) <= 7)))
if(M.stat == DEAD && M.client && ((M.client?.prefs?.chat_toggles & CHAT_GHOSTWHISPER) || (get_dist(M, src) <= 7)))
listening_dead |= M
var/list/listening = get_hearers_in_view(1, src)
+4 -4
View File
@@ -91,7 +91,7 @@
//Second link in a breath chain, calls check_breath()
/mob/living/carbon/proc/breathe()
var/obj/item/organ/lungs = getorganslot(ORGAN_SLOT_LUNGS)
if(reagents.has_reagent(/datum/reagent/toxin/lexorin))
if(reagents?.has_reagent(/datum/reagent/toxin/lexorin))
return
if(istype(loc, /obj/machinery/atmospherics/components/unary/cryo_cell))
return
@@ -167,7 +167,7 @@
//CRIT
if(!breath || (breath.total_moles() == 0) || !lungs)
if(reagents.has_reagent(/datum/reagent/medicine/epinephrine) && lungs)
if(reagents?.has_reagent(/datum/reagent/medicine/epinephrine) && lungs)
return
adjustOxyLoss(1)
@@ -389,7 +389,7 @@
return
// No decay if formaldehyde in corpse or when the corpse is charred
if(reagents.has_reagent(/datum/reagent/toxin/formaldehyde, 15) || HAS_TRAIT(src, TRAIT_HUSK))
if(reagents?.has_reagent(/datum/reagent/toxin/formaldehyde, 15) || HAS_TRAIT(src, TRAIT_HUSK))
return
// Also no decay if corpse chilled or not organic/undead
@@ -432,7 +432,7 @@
if(O)
O.on_life()
else
if(reagents.has_reagent(/datum/reagent/toxin/formaldehyde, 1)) // No organ decay if the body contains formaldehyde.
if(reagents?.has_reagent(/datum/reagent/toxin/formaldehyde, 1)) // No organ decay if the body contains formaldehyde.
return
for(var/V in internal_organs)
var/obj/item/organ/O = V
+1 -1
View File
@@ -410,7 +410,7 @@
return FALSE
else if(QDELETED(user))
return FALSE
else if(user.client && user.client.prefs.muted & MUTE_IC)
else if(user.client && user.client?.prefs?.muted & MUTE_IC)
to_chat(user, "You cannot send IC messages (muted).")
return FALSE
else if(!params)
+1 -1
View File
@@ -1105,7 +1105,7 @@
if(client)
client.move_delay = world.time + movement_delay()
lying_prev = lying
if(canmove && !intentionalresting && iscarbon(src) && client && client.prefs && client.prefs.autostand)//CIT CHANGE - adds autostanding as a preference
if(canmove && !intentionalresting && iscarbon(src) && client && client.prefs && client?.prefs?.autostand)//CIT CHANGE - adds autostanding as a preference
addtimer(CALLBACK(src, .proc/resist_a_rest, TRUE), 0) //CIT CHANGE - ditto
return canmove
+5 -5
View File
@@ -249,7 +249,7 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
deaf_message = "<span class='notice'>You can't hear yourself!</span>"
deaf_type = 2 // Since you should be able to hear yourself without looking
// Create map text prior to modifying message for goonchat
if (client?.prefs.chat_on_map && stat != UNCONSCIOUS && (client.prefs.see_chat_non_mob || ismob(speaker)) && can_hear())
if (client?.prefs.chat_on_map && stat != UNCONSCIOUS && (client?.prefs?.see_chat_non_mob || ismob(speaker)) && can_hear())
create_chat_message(speaker, message_language, raw_message, spans, message_mode)
if (client?.prefs.radiosounds && stat != UNCONSCIOUS && can_hear() && radio_freq)
playsound_local(src,'sound/voice/radio.ogg', 30, 0)
@@ -281,9 +281,9 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
if(!M.client || !client) //client is so that ghosts don't have to listen to mice
continue
if(get_dist(M, source) > 7 || M.z != z) //they're out of range of normal hearing
if(eavesdropping_modes[message_mode] && !(M.client.prefs.chat_toggles & CHAT_GHOSTWHISPER)) //they're whispering and we have hearing whispers at any range off
if(eavesdropping_modes[message_mode] && !(M.client?.prefs?.chat_toggles & CHAT_GHOSTWHISPER)) //they're whispering and we have hearing whispers at any range off
continue
if(!(M.client.prefs.chat_toggles & CHAT_GHOSTEARS)) //they're talking normally and we have hearing at any range off
if(!(M.client?.prefs?.chat_toggles & CHAT_GHOSTEARS)) //they're talking normally and we have hearing at any range off
continue
listening |= M
the_dead[M] = TRUE
@@ -306,7 +306,7 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
//speech bubble
var/list/speech_bubble_recipients = list()
for(var/mob/M in listening)
if(M.client && !M.client.prefs.chat_on_map)
if(M.client && !M.client?.prefs?.chat_on_map)
speech_bubble_recipients.Add(M.client)
var/image/I = image('icons/mob/talk.dmi', src, "[bubble_type][say_test(message)]", FLY_LAYER)
I.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA
@@ -321,7 +321,7 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
/mob/living/proc/can_speak_basic(message, ignore_spam = FALSE) //Check BEFORE handling of xeno and ling channels
if(client)
if(client.prefs.muted & MUTE_IC)
if(client?.prefs?.muted & MUTE_IC)
to_chat(src, "<span class='danger'>You cannot speak in IC (muted).</span>")
return 0
if(!ignore_spam && client.handle_spam_prevention(message,MUTE_IC))
+1 -1
View File
@@ -830,7 +830,7 @@
jobpart = "Unknown"
var/rendered = "<i><span class='game say'>[start]<span class='name'>[hrefpart][namepart] ([jobpart])</a> </span><span class='message'>[treated_message]</span></span></i>"
if (client?.prefs.chat_on_map && (client.prefs.see_chat_non_mob || ismob(speaker)))
if (client?.prefs.chat_on_map && (client?.prefs?.see_chat_non_mob || ismob(speaker)))
create_chat_message(speaker, message_language, raw_message, spans, message_mode)
show_message(rendered, MSG_AUDIBLE)
+1 -1
View File
@@ -151,7 +151,7 @@
if(!only_listener)
// Play voice for all mobs in the z level
for(var/mob/M in GLOB.player_list)
if(M.client && M.can_hear() && (M.client.prefs.toggles & SOUND_ANNOUNCEMENTS))
if(M.client && M.can_hear() && (M.client?.prefs?.toggles & SOUND_ANNOUNCEMENTS))
var/turf/T = get_turf(M)
if(T.z == z_level)
SEND_SOUND(M, voice)
+1 -1
View File
@@ -13,7 +13,7 @@
create_mob_hud()
if(hud_used)
hud_used.show_hud(hud_used.hud_version)
hud_used.update_ui_style(ui_style2icon(client.prefs.UI_style))
hud_used.update_ui_style(ui_style2icon(client?.prefs?.UI_style))
next_move = 1
+6 -6
View File
@@ -488,13 +488,13 @@ mob/visible_message(message, self_message, blind_message, vision_distance = DEFA
if(!ckey)
return
SEND_SIGNAL(new_mob, COMSIG_MOB_PRE_PLAYER_CHANGE, new_mob, src)
if (client && client.prefs && client.prefs.auto_ooc)
if (client.prefs.chat_toggles & CHAT_OOC && isliving(new_mob))
client.prefs.chat_toggles ^= CHAT_OOC
if (!(client.prefs.chat_toggles & CHAT_OOC) && isdead(new_mob))
client.prefs.chat_toggles ^= CHAT_OOC
if (client && client.prefs && client?.prefs?.auto_ooc)
if (client?.prefs?.chat_toggles & CHAT_OOC && isliving(new_mob))
client?.prefs?.chat_toggles ^= CHAT_OOC
if (!(client?.prefs?.chat_toggles & CHAT_OOC) && isdead(new_mob))
client?.prefs?.chat_toggles ^= CHAT_OOC
new_mob.ckey = ckey
new_mob.client.init_verbs()
new_mob.client?.init_verbs()
if(send_signal)
SEND_SIGNAL(src, COMSIG_MOB_KEY_CHANGE, new_mob, src)
return TRUE
+2 -2
View File
@@ -401,8 +401,8 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
if(source)
var/obj/screen/alert/notify_action/A = O.throw_alert("[REF(source)]_notify_action", /obj/screen/alert/notify_action)
if(A)
if(O.client.prefs && O.client.prefs.UI_style)
A.icon = ui_style2icon(O.client.prefs.UI_style)
if(O.client.prefs && O.client?.prefs?.UI_style)
A.icon = ui_style2icon(O.client?.prefs?.UI_style)
A.desc = message
A.action = action
A.target = source
+1 -1
View File
@@ -90,7 +90,7 @@
if (src.client)
if(src.client.prefs.muted & MUTE_DEADCHAT)
if(src.client?.prefs?.muted & MUTE_DEADCHAT)
to_chat(src, "<span class='danger'>You cannot talk in deadchat (muted).</span>")
return
+3 -3
View File
@@ -36,7 +36,7 @@ proc/get_top_level_mob(var/mob/S)
if(jobban_isbanned(user, "emote"))
to_chat(user, "You cannot send subtle emotes (banned).")
return FALSE
else if(user.client && user.client.prefs.muted & MUTE_IC)
else if(user.client && user.client?.prefs?.muted & MUTE_IC)
to_chat(user, "You cannot send IC messages (muted).")
return FALSE
else if(!params)
@@ -69,7 +69,7 @@ proc/get_top_level_mob(var/mob/S)
if(!M.client || isnewplayer(M))
continue
var/T = get_turf(src)
if(M.stat == DEAD && M.client && (M.client.prefs.chat_toggles & CHAT_GHOSTSIGHT) && !(M in viewers(T, null)))
if(M.stat == DEAD && M.client && (M.client?.prefs?.chat_toggles & CHAT_GHOSTSIGHT) && !(M in viewers(T, null)))
M.show_message(message)
if(emote_type == EMOTE_AUDIBLE)
@@ -100,7 +100,7 @@ proc/get_top_level_mob(var/mob/S)
if(jobban_isbanned(user, "emote"))
to_chat(user, "You cannot send subtle emotes (banned).")
return FALSE
else if(user.client && user.client.prefs.muted & MUTE_IC)
else if(user.client && user.client?.prefs?.muted & MUTE_IC)
to_chat(user, "You cannot send IC messages (muted).")
return FALSE
else if(!params)
+1 -1
View File
@@ -316,7 +316,7 @@
on_mob.forceMove(scanning)
for(var/i in 1 to light_beam_distance)
scanning = get_step(scanning, scandir)
if(scanning.opacity || scanning.has_opaque_atom)
if(scanning?.opacity || scanning?.has_opaque_atom)
stop = TRUE
var/obj/effect/abstract/eye_lighting/L = LAZYACCESS(eye_lighting, i)
if(stop)
+5 -5
View File
@@ -107,7 +107,7 @@
// Remove titlebar and resize handles for a fancy window
var/have_title_bar
if(user.client.prefs.tgui_fancy)
if(user.client?.prefs?.tgui_fancy)
have_title_bar = "titlebar=0;can_resize=0;"
else
have_title_bar = "titlebar=1;can_resize=1;"
@@ -219,8 +219,8 @@
"screen" = ui_screen,
"style" = style,
"interface" = interface,
"fancy" = user.client.prefs.tgui_fancy,
"locked" = user.client.prefs.tgui_lock && !custom_browser_id,
"fancy" = user.client?.prefs?.tgui_fancy,
"locked" = user.client?.prefs?.tgui_lock && !custom_browser_id,
"observer" = isobserver(user),
"window" = window_id,
// NOTE: Intentional \ref usage; tgui datums can't/shouldn't
@@ -269,9 +269,9 @@
if("tgui:link")
user << link(params["url"])
if("tgui:fancy")
user.client.prefs.tgui_fancy = TRUE
user.client?.prefs?.tgui_fancy = TRUE
if("tgui:nofrills")
user.client.prefs.tgui_fancy = FALSE
user.client?.prefs?.tgui_fancy = FALSE
else
update_status(push = FALSE) // Update the window state.
if(src_object.ui_act(action, params, src, state)) // Call ui_act() on the src_object.
+2 -2
View File
@@ -108,8 +108,8 @@ Notes:
/proc/openToolTip(mob/user = null, atom/movable/tip_src = null, params = null,title = "",content = "",theme = "")
if(istype(user))
if(user.client && user.client.tooltips)
if(!theme && user.client.prefs && user.client.prefs.UI_style)
theme = lowertext(user.client.prefs.UI_style)
if(!theme && user.client.prefs && user.client?.prefs?.UI_style)
theme = lowertext(user.client?.prefs?.UI_style)
if(!theme)
theme = "default"
user.client.tooltips.show(tip_src, params,title,content,theme)
@@ -34,7 +34,7 @@
sender_override = "GATO Meteorology Division")
for(var/V in GLOB.player_list)
var/mob/M = V
if((M.client.prefs.toggles & SOUND_MIDI) && is_station_level(M.z))
if((M.client?.prefs?.toggles & SOUND_MIDI) && is_station_level(M.z))
M.playsound_local(M, 'hyperstation/sound/ambience/embrace.ogg', 40, FALSE, pressure_affected = FALSE)
/*
"Sappheiros - Embrace" is under a Creative Commons license (CC BY 3.0)
+2 -2
View File
@@ -128,7 +128,7 @@ GLOBAL_LIST_INIT(hyper_special_roles, list(
candidates += applicant
for(var/mob/living/carbon/human/target in GLOB.player_list)
if(target.client.prefs.noncon)
if(target.client?.prefs?.noncon)
if(!(target.job in temp.restricted_jobs))
targets += target
@@ -212,7 +212,7 @@ GLOBAL_LIST_INIT(hyper_special_roles, list(
var/list/datum/mind/owners = get_owners()
for(var/datum/mind/candidate in SSticker.minds)
if (!(candidate in owners) && ishuman(candidate.current) && (candidate.current.client))
if(candidate.current.client.prefs.noncon == 1)
if(candidate.current.client?.prefs?.noncon == 1)
targets += candidate
if(targets.len > 0)
target = pick(targets)
@@ -30,7 +30,7 @@ related to the antag that could be a datum
var/obj/screen/inventory/inv_box
var/widescreenlayout = FALSE //adds support for different hud layouts depending on widescreen pref
if(owner.client && owner.client.prefs && owner.client.prefs.widescreenpref)
if(owner.client && owner.client.prefs && owner.client?.prefs?.widescreenpref)
widescreenlayout = FALSE
//CRAFTING
+2 -2
View File
@@ -6,10 +6,10 @@ mob/proc/checkloadappearance()
to_chat(H, "<span class='boldannounce'>This ghost role allows you to select your loaded character's appearance. Make sure you have your ID in your ID slot, if you have one.</span>")
if(alert(H, "Would you like to load your currently loaded character's appearance?", "This can only be done up until 90s after you spawn.", "Yes", "No") == "Yes" && world.time <= (H.time_initialized + 900))
if(alert(H, "You should only load a character that has not currently died in the round. Do you accept this?", "Warning", "Yes", "No") == "Yes" && world.time <= (H.time_initialized + 900))
H.client.prefs.copy_to(H)
H.client?.prefs?.copy_to(H)
if (H.custom_body_size) //Do they have a custom size set?
H.resize(H.custom_body_size * 0.01)
H.real_name = H.client.prefs.real_name
H.real_name = H.client?.prefs?.real_name
H.mind.name = H.real_name //Makes sure to change their mind name to their real name.
SSquirks.AssignQuirks(H, H.client, TRUE, FALSE, H.job, FALSE)//This Assigns the selected character's quirks
H.dna.update_dna_identity() //This makes sure their DNA is updated.
+11 -11
View File
@@ -13,22 +13,22 @@
/datum/quirk/cum_plus/add()
var/mob/living/carbon/M = quirk_holder
if(M.getorganslot("testicles"))
var/obj/item/organ/genital/testicles/T = M.getorganslot("testicles")
T.fluid_mult = 1.5 //Base is 1
T.fluid_max_volume = 5
if(M?.getorganslot("testicles"))
var/obj/item/organ/genital/testicles/T = M?.getorganslot("testicles")
T?.fluid_mult = 1.5 //Base is 1
T?.fluid_max_volume = 5
/datum/quirk/cum_plus/remove()
var/mob/living/carbon/M = quirk_holder
if(quirk_holder.getorganslot("testicles"))
var/obj/item/organ/genital/testicles/T = M.getorganslot("testicles")
T.fluid_mult = 1 //Base is 1
T.fluid_max_volume = 3 //Base is 3
var/obj/item/organ/genital/testicles/T = M?.getorganslot("testicles")
T?.fluid_mult = 1 //Base is 1
T?.fluid_max_volume = 3 //Base is 3
/datum/quirk/cum_plus/on_process()
var/mob/living/carbon/M = quirk_holder //If you get balls later, then this will still proc
if(M.getorganslot("testicles"))
var/obj/item/organ/genital/testicles/T = M.getorganslot("testicles")
if(T.fluid_max_volume <= 5 || T.fluid_mult <= 0.2) //INVALID EXPRESSION?
T.fluid_mult = 1.5 //Base is 0.133
T.fluid_max_volume = 5
var/obj/item/organ/genital/testicles/T = M?.getorganslot("testicles")
if(T?.fluid_max_volume <= 5 || T?.fluid_mult <= 0.2) //INVALID EXPRESSION?
T?.fluid_mult = 1.5 //Base is 0.133
T?.fluid_max_volume = 5
@@ -8,7 +8,7 @@
var/list/queued_to_equip = list() //Items that will equip onto the player
. = list() //Items that will be stored into the player's backpack, handled by EquipRank()
for(var/i in the_mob.client.prefs.chosen_gear) //Prepare the player's loadout gear
for(var/i in the_mob.client?.prefs?.chosen_gear) //Prepare the player's loadout gear
var/datum/gear/G = i
G = GLOB.loadout_items[slot_to_string(initial(G.category))][initial(G.name)]
if(!G)
@@ -180,8 +180,8 @@
set category = "IC"
set name = "Toggle Lewdchem"
set desc = "Allows you to toggle if you'd like lewd flavour messages."
client.prefs.lewdchem = !(client.prefs.lewdchem)
to_chat(usr, "You [(client.prefs.lewdchem?"will":"no longer")] receive lewdchem messages.")
client?.prefs?.lewdchem = !(client?.prefs?.lewdchem)
to_chat(usr, "You [(client?.prefs?.lewdchem?"will":"no longer")] receive lewdchem messages.")
/datum/status_effect/chem/enthrall
id = "enthrall"
@@ -49,7 +49,7 @@
if(force >= 15)
shake_camera(user, ((force - 10) * 0.01 + 1), ((force - 10) * 0.01))
if(M.client)
switch (M.client.prefs.damagescreenshake)
switch (M.client?.prefs?.damagescreenshake)
if (1)
shake_camera(M, ((force - 10) * 0.015 + 1), ((force - 10) * 0.015))
if (2)
@@ -1,6 +1,6 @@
/datum/controller/subsystem/ticker/proc/generate_crew_objectives()
for(var/datum/mind/crewMind in SSticker.minds)
if(prob(5) && !issilicon(crewMind.current) && !jobban_isbanned(crewMind, "Syndicate") && GLOB.miscreants_allowed && ROLE_MISCREANT in crewMind.current.client.prefs.be_special)
if(prob(5) && !issilicon(crewMind.current) && !jobban_isbanned(crewMind, "Syndicate") && GLOB.miscreants_allowed && ROLE_MISCREANT in crewMind.current.client?.prefs?.be_special)
generate_miscreant_objectives(crewMind)
else
if(CONFIG_GET(flag/allow_crew_objectives))
@@ -7,7 +7,7 @@
return
if(!crewMind.assigned_role)
return
if(!(ROLE_MISCREANT in crewMind.current.client.prefs.be_special))
if(!(ROLE_MISCREANT in crewMind.current.client?.prefs?.be_special))
return
if(jobban_isbanned(crewMind, "Syndicate"))
return
@@ -2,10 +2,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, toggleeatingnoise)()
set name = "Toggle Eating Noises"
set category = "Preferences"
set desc = "Hear Eating noises"
usr.client.prefs.cit_toggles ^= EATING_NOISES
usr.client.prefs.save_preferences()
usr.client?.prefs?.cit_toggles ^= EATING_NOISES
usr.client?.prefs?.save_preferences()
usr.stop_sound_channel(CHANNEL_PRED)
to_chat(usr, "You will [(usr.client.prefs.cit_toggles & EATING_NOISES) ? "now" : "no longer"] hear eating noises.")
to_chat(usr, "You will [(usr.client?.prefs?.cit_toggles & EATING_NOISES) ? "now" : "no longer"] hear eating noises.")
/datum/verbs/menu/Settings/Sound/toggleeatingnoise/Get_checked(client/C)
return C.prefs.cit_toggles & EATING_NOISES
@@ -13,10 +13,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, toggledigestionnoise)()
set name = "Toggle Digestion Noises"
set category = "Preferences"
set desc = "Hear digestive noises"
usr.client.prefs.cit_toggles ^= DIGESTION_NOISES
usr.client.prefs.save_preferences()
usr.client?.prefs?.cit_toggles ^= DIGESTION_NOISES
usr.client?.prefs?.save_preferences()
usr.stop_sound_channel(CHANNEL_DIGEST)
to_chat(usr, "You will [(usr.client.prefs.cit_toggles & DIGESTION_NOISES) ? "now" : "no longer"] hear digestion noises.")
to_chat(usr, "You will [(usr.client?.prefs?.cit_toggles & DIGESTION_NOISES) ? "now" : "no longer"] hear digestion noises.")
/datum/verbs/menu/Settings/Sound/toggledigestionnoise/Get_checked(client/C)
return C.prefs.cit_toggles & DIGESTION_NOISES
@@ -24,10 +24,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, toggleburpingnoise)()
set name = "Toggle Burping Noises"
set category = "Preferences"
set desc = "Hear Burping noises"
usr.client.prefs.cit_toggles ^= BURPING_NOISES
usr.client.prefs.save_preferences()
usr.client?.prefs?.cit_toggles ^= BURPING_NOISES
usr.client?.prefs?.save_preferences()
usr.stop_sound_channel(CHANNEL_BURP)
to_chat(usr, "You will [(usr.client.prefs.cit_toggles & BURPING_NOISES) ? "now" : "no longer"] hear burping noises.")
to_chat(usr, "You will [(usr.client?.prefs?.cit_toggles & BURPING_NOISES) ? "now" : "no longer"] hear burping noises.")
/datum/verbs/menu/Settings/Sound/toggleburpingnoise/Get_checked(client/C)
return C.prefs.cit_toggles & BURPING_NOISES
@@ -35,10 +35,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, togglefartingnoise)()
set name = "Toggle Farting Noises"
set category = "Preferences"
set desc = "Hear Farting noises"
usr.client.prefs.cit_toggles ^= FARTING_NOISES
usr.client.prefs.save_preferences()
usr.client?.prefs?.cit_toggles ^= FARTING_NOISES
usr.client?.prefs?.save_preferences()
usr.stop_sound_channel(CHANNEL_FART)
to_chat(usr, "You will [(usr.client.prefs.cit_toggles & FARTING_NOISES) ? "now" : "no longer"] hear farting noises.")
to_chat(usr, "You will [(usr.client?.prefs?.cit_toggles & FARTING_NOISES) ? "now" : "no longer"] hear farting noises.")
/datum/verbs/menu/Settings/Sound/togglefartingnoise/Get_checked(client/C)
return C.prefs.cit_toggles & FARTING_NOISES
@@ -46,12 +46,12 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, togglehoundsleeper)()
set name = "Toggle Voracious Hound Sleepers"
set category = "Preferences"
set desc = "Toggles Voracious MediHound Sleepers"
usr.client.prefs.cit_toggles ^= MEDIHOUND_SLEEPER
usr.client.prefs.save_preferences()
if(usr.client.prefs.cit_toggles & MEDIHOUND_SLEEPER)
usr.client?.prefs?.cit_toggles ^= MEDIHOUND_SLEEPER
usr.client?.prefs?.save_preferences()
if(usr.client?.prefs?.cit_toggles & MEDIHOUND_SLEEPER)
to_chat(usr, "You have opted in for voracious medihound sleepers.")
else
to_chat(usr, "Medihound sleepers will no longer be voracious when you're involved.")
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle MediHound Sleeper", "[usr.client.prefs.cit_toggles & MEDIHOUND_SLEEPER ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle MediHound Sleeper", "[usr.client?.prefs?.cit_toggles & MEDIHOUND_SLEEPER ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/verbs/menu/Settings/Sound/togglehoundsleeper/Get_checked(client/C)
return C.prefs.cit_toggles & MEDIHOUND_SLEEPER
@@ -51,7 +51,7 @@
set name = "Rest"
set category = "IC"
if(client && client.prefs && client.prefs.autostand)
if(client && client.prefs && client?.prefs?.autostand)
intentionalresting = !intentionalresting
to_chat(src, "<span class='notice'>You are now attempting to [intentionalresting ? "[!resting ? "lay down and ": ""]stay down" : "[resting ? "get up and ": ""]stay up"].</span>")
if(intentionalresting && !resting)
@@ -132,4 +132,4 @@
/mob/living/proc/update_hud_sprint_bar()
if(hud_used && hud_used.sprint_buffer)
hud_used.sprint_buffer.update_to_mob(src)
*/
*/
@@ -157,8 +157,9 @@
return ..()
/obj/belly/proc/Remove(mob/living/owner)
owner.vore_organs -= src
owner = null
if(owner)
owner.vore_organs -= src
owner = null
// Called whenever an atom enters this belly
/obj/belly/Entered(var/atom/movable/thing,var/atom/OldLoc)
@@ -173,7 +174,7 @@
var/turf/source = get_turf(owner)
var/sound/eating = sound(GLOB.vore_sounds[vore_sound])
for(var/mob/living/M in get_hearers_in_view(3, source))
if(M.client && M.client.prefs.cit_toggles & EATING_NOISES)
if(M.client && M.client?.prefs?.cit_toggles & EATING_NOISES)
M.playsound_local(source, vore_sound, 50, 1, S = eating)
recent_sound = (world.time + 20 SECONDS)
@@ -213,7 +214,7 @@
var/turf/source = get_turf(owner)
var/sound/releasement = sound(GLOB.release_sounds[release_sound])
for(var/mob/living/M in get_hearers_in_view(2, source))
if(M.client && (M.client.prefs.cit_toggles & EATING_NOISES))
if(M.client && (M.client?.prefs?.cit_toggles & EATING_NOISES))
M.playsound_local(source, release_sound, 50, 1, S = releasement)
//Clean up our own business
@@ -241,7 +242,7 @@
var/turf/source = get_turf(owner)
var/sound/releasement = sound(GLOB.release_sounds[release_sound])
for(var/mob/living/H in get_hearers_in_view(2, source))
if(H.client && (H.client.prefs.cit_toggles & EATING_NOISES))
if(H.client && (H.client?.prefs?.cit_toggles & EATING_NOISES))
H.playsound_local(source, release_sound, 50, 1, S = releasement)
if(istype(M,/mob/living))
@@ -322,7 +323,7 @@
var/turf/source = get_turf(owner)
var/sound/eating = sound(GLOB.vore_sounds[vore_sound])
for(var/mob/living/M in get_hearers_in_view(3, source))
if(M.client && M.client.prefs.cit_toggles & EATING_NOISES)
if(M.client && M.client?.prefs?.cit_toggles & EATING_NOISES)
M.playsound_local(source, vore_sound, 50, 1, S = eating)
owner.updateVRPanel()
@@ -534,17 +535,17 @@
if(is_wet)
for(var/mob/living/M in get_hearers_in_view(3, source))
if(M.client && M.client.prefs.cit_toggles & EATING_NOISES)
if(M.client && M.client?.prefs?.cit_toggles & EATING_NOISES)
M.playsound_local(source, "struggle_sound", 50, 1, S = struggle_snuggle)
else
for(var/mob/living/M in get_hearers_in_view(3, source))
if(M.client && M.client.prefs.cit_toggles & EATING_NOISES)
if(M.client && M.client?.prefs?.cit_toggles & EATING_NOISES)
M.playsound_local(source, "rustle", 50, 1, S = struggle_rustle)
var/list/watching = hearers(3, owner)
for(var/mob/living/M in watching)
if(M.client && (M.client.prefs.cit_toggles & EATING_NOISES)) //Might as well censor the normies here too.
if(M.client && (M.client?.prefs?.cit_toggles & EATING_NOISES)) //Might as well censor the normies here too.
M.show_message(struggle_outer_message, MSG_VISUAL) // visible
to_chat(R,struggle_user_message)
@@ -35,7 +35,7 @@
if(!M.client)
continue
M.stop_sound_channel(CHANNEL_PREYLOOP) // sanity just in case
if(M.client.prefs.cit_toggles & DIGESTION_NOISES)
if(M.client?.prefs?.cit_toggles & DIGESTION_NOISES)
var/sound/preyloop = sound('sound/vore/prey/loop.ogg', repeat = TRUE)
M.playsound_local(get_turf(src),preyloop, 80,0, channel = CHANNEL_PREYLOOP)
M.next_preyloop = (world.time + 52 SECONDS)
@@ -73,7 +73,7 @@
if((world.time - NORMIE_HEARCHECK) > last_hearcheck)
LAZYCLEARLIST(hearing_mobs)
for(var/mob/living/H in get_hearers_in_view(3, source))
if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES))
if(!H.client || !(H.client?.prefs?.cit_toggles & DIGESTION_NOISES))
continue
LAZYADD(hearing_mobs, H)
last_hearcheck = world.time
@@ -121,7 +121,7 @@
if((world.time - NORMIE_HEARCHECK) > last_hearcheck)
LAZYCLEARLIST(hearing_mobs)
for(var/mob/living/H in get_hearers_in_view(3, source))
if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES))
if(!H.client || !(H.client?.prefs?.cit_toggles & DIGESTION_NOISES))
continue
LAZYADD(hearing_mobs, H)
last_hearcheck = world.time
@@ -156,7 +156,7 @@
if((world.time - NORMIE_HEARCHECK) > last_hearcheck)
LAZYCLEARLIST(hearing_mobs)
for(var/mob/living/H in get_hearers_in_view(3, source))
if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES))
if(!H.client || !(H.client?.prefs?.cit_toggles & DIGESTION_NOISES))
continue
LAZYADD(hearing_mobs, H)
last_hearcheck = world.time
@@ -180,7 +180,7 @@
if((world.time - NORMIE_HEARCHECK) > last_hearcheck)
LAZYCLEARLIST(hearing_mobs)
for(var/mob/living/H in get_hearers_in_view(3, source))
if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES))
if(!H.client || !(H.client?.prefs?.cit_toggles & DIGESTION_NOISES))
continue
LAZYADD(hearing_mobs, H)
last_hearcheck = world.time
@@ -200,7 +200,7 @@
if((world.time - NORMIE_HEARCHECK) > last_hearcheck)
LAZYCLEARLIST(hearing_mobs)
for(var/mob/living/H in get_hearers_in_view(3, source))
if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES))
if(!H.client || !(H.client?.prefs?.cit_toggles & DIGESTION_NOISES))
continue
LAZYADD(hearing_mobs, H)
last_hearcheck = world.time
@@ -242,7 +242,7 @@
if((world.time - NORMIE_HEARCHECK) > last_hearcheck)
LAZYCLEARLIST(hearing_mobs)
for(var/mob/living/H in get_hearers_in_view(3, source))
if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES))
if(!H.client || !(H.client?.prefs?.cit_toggles & DIGESTION_NOISES))
continue
LAZYADD(hearing_mobs, H)
last_hearcheck = world.time
@@ -275,7 +275,7 @@
if((world.time - NORMIE_HEARCHECK) > last_hearcheck)
LAZYCLEARLIST(hearing_mobs)
for(var/mob/living/H in get_hearers_in_view(3, source))
if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES))
if(!H.client || !(H.client?.prefs?.cit_toggles & DIGESTION_NOISES))
continue
LAZYADD(hearing_mobs, H)
last_hearcheck = world.time
@@ -85,10 +85,10 @@ GLOBAL_LIST_EMPTY(vore_preferences_datums)
/datum/vore_preferences/proc/load_vore()
if(!client || !client_ckey)
return 0 //No client, how can we save?
if(!client.prefs || !client.prefs.default_slot)
if(!client.prefs || !client?.prefs?.default_slot)
return 0 //Need to know what character to load!
slot = client.prefs.default_slot
slot = client?.prefs?.default_slot
load_path(client_ckey,slot)