Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix issues from first playtest #62

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion code/datums/config/config_types/config_game_world.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
/decl/config/toggle/on/cult_ghostwriter,
/decl/config/toggle/allow_holidays,
/decl/config/toggle/humans_need_surnames,
/decl/config/toggle/roundstart_level_generation
/decl/config/toggle/roundstart_level_generation,
/decl/config/toggle/lights_start_on
)

/decl/config/num/exterior_ambient_light
Expand Down Expand Up @@ -125,3 +126,7 @@
/decl/config/toggle/roundstart_level_generation
uid = "roundstart_level_generation"
desc = "Enable/Disable random level generation. Will behave strangely if turned off with a map that expects it on."

/decl/config/toggle/lights_start_on
uid = "lights_start_on"
desc = "If true, most lightswitches start on by default. Otherwise, they start off."
4 changes: 2 additions & 2 deletions code/datums/inventory_slots/slots/slot_shoes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
var/blood_color
for(var/foot_tag in list(BP_L_FOOT, BP_R_FOOT))
var/obj/item/organ/external/stomper = GET_EXTERNAL_ORGAN(user, foot_tag)
if(stomper && stomper.coating)
if(stomper && stomper.coating?.total_volume)
blood_color = stomper.coating.get_color()
break
if(blood_color)
Expand All @@ -38,7 +38,7 @@
return "[pronouns.He] [pronouns.is] wearing [_holding.get_examine_line()] on [pronouns.his] feet."
for(var/bp in list(BP_L_FOOT, BP_R_FOOT))
var/obj/item/organ/external/E = GET_EXTERNAL_ORGAN(owner, bp)
if(E && E.coating)
if(E && E.coating?.total_volume)
if(user == owner)
return "There's <font color='[E.coating.get_color()]'>something on your feet</font>!"
return "There's <font color='[E.coating.get_color()]'>something on [pronouns.his] feet</font>!"
9 changes: 9 additions & 0 deletions code/game/machinery/alarm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,15 @@
for(var/g in decls_repository.get_decl_paths_of_subtype(/decl/material/gas))
if(!env_info.important_gasses[g])
trace_gas += g
// not everything in these lists is a subtype of /decl/material/gas, so:
for(var/dangerous_gas in env_info.dangerous_gasses)
if(env_info.important_gasses[dangerous_gas] || !env_info.dangerous_gasses[dangerous_gas])
continue
trace_gas |= dangerous_gas
for(var/filtered_gas in env_info.filter_gasses)
if(env_info.important_gasses[filtered_gas])
continue
trace_gas |= filtered_gas

queue_icon_update()

Expand Down
4 changes: 3 additions & 1 deletion code/game/machinery/lightswitch.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
z_flags = ZMM_MANGLE_PLANES
layer = ABOVE_WINDOW_LAYER

var/on = 0
var/on = null // if null, takes from config option on init
var/area/connected_area = null
var/other_area = null

Expand Down Expand Up @@ -42,6 +42,8 @@

/obj/machinery/light_switch/LateInitialize()
. = ..()
if(isnull(on))
on = get_config_value(/decl/config/toggle/lights_start_on)
connected_area?.set_lightswitch(on)
update_icon()

Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/__item.dm
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.

/obj/item/proc/get_examine_name()
. = name
if(coating)
if(coating?.total_volume)
. = SPAN_WARNING("<font color='[coating.get_color()]'>stained</font> [.]")
if(gender == PLURAL)
. = "some [.]"
Expand Down
4 changes: 2 additions & 2 deletions code/modules/chat_filter/_chat_filter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var/global/list/chat_modifiers_in_use
var/list/all_filters = decls_repository.get_decls_of_type(/decl/chat_filter)
for(var/filtertype in all_filters)
var/decl/chat_filter/chat_filter = all_filters[filtertype]
if(!chat_filter.disabled && chat_filter.filter_category != chat_filter.type)
if(!chat_filter.disabled)
if(chat_filter.can_deny_message)
global.chat_blockers_in_use += chat_filter
if(chat_filter.can_modify_message)
Expand All @@ -31,10 +31,10 @@ var/global/list/chat_modifiers_in_use
. = chat_filter.replace(., match)

/decl/chat_filter
abstract_type = /decl/chat_filter
var/name
var/disabled
var/summary
var/filter_category = /decl/chat_filter
var/can_modify_message = FALSE
var/can_deny_message = FALSE

Expand Down
5 changes: 3 additions & 2 deletions code/modules/chat_filter/_chat_filter_regex.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/decl/chat_filter/regexp
filter_category = /decl/chat_filter/regexp
abstract_type = /decl/chat_filter/regexp
var/regex/filter_regex

/decl/chat_filter/regexp/match(var/message)
. = filter_regex && findtext(message, filter_regex)
filter_regex.index = 0 // we use the global flag, so we need to reset this for every match or else repeat messages will break
. = filter_regex && filter_regex.Find(message)
10 changes: 5 additions & 5 deletions code/modules/chat_filter/filter_markdown.dm
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
/decl/chat_filter/regexp/markdown
filter_category = /decl/chat_filter/regexp/markdown
abstract_type = /decl/chat_filter/regexp/markdown
can_modify_message = TRUE
var/format_char
var/format_replace_proc

/decl/chat_filter/regexp/markdown/Initialize()
. = ..()
filter_regex = regex("([format_char])(.+?)([format_char])", "g")
filter_regex = regex("([REGEX_QUOTE(format_char)])(.+?)([REGEX_QUOTE(format_char)])", "g")

/decl/chat_filter/regexp/markdown/replace(var/message, var/match)
. = filter_regex.Replace(message, format_replace_proc)

/proc/chatFilterRegexBold(full_match, prefix_char, message_body, suffix_char)
. = "<b>[message_body]</b>"
. = "<b>[trim(message_body)]</b>"

/decl/chat_filter/regexp/markdown/bold
name = "Bold"
summary = "Applies <b>bold</b> to speech and emote text that is surrounded by *asterisks*."
format_char = "\\*"
format_char = "*"
format_replace_proc = /proc/chatFilterRegexBold

/proc/chatFilterRegexItalic(full_match, prefix_char, message_body, suffix_char)
. = "<i>[message_body]</i>"
. = "<i>[trim(message_body)]</i>"

/decl/chat_filter/regexp/markdown/italic
name = "Italics"
Expand Down
22 changes: 7 additions & 15 deletions code/modules/emotes/emote_mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@
if(!message || !emoter)
return

message = html_decode(message)

name_anchor = findtext(message, anchor_char)
if(name_anchor > 0) // User supplied emote with visible_emote token (default ^)
pretext = copytext(message, 1, name_anchor)
Expand All @@ -139,11 +137,7 @@
if(end_char != " ")
pretext += " "

// Grab the last character of the emote message.
end_char = copytext(subtext, length(subtext), length(subtext) + 1)
if(!(end_char in list(".", "?", "!", "\"", "-", "~"))) // gotta include ~ for all you fucking weebs
// No punctuation supplied. Tack a period on the end.
subtext += "."
handle_autopunctuation(subtext)

// Add a space to the subtext, unless it begins with an apostrophe or comma.
if(subtext != ".")
Expand All @@ -153,12 +147,9 @@
if(start_char != "," && start_char != "'")
subtext = " " + subtext

pretext = capitalize(html_encode(pretext))
nametext = html_encode(nametext)
subtext = html_encode(subtext)
// Store the player's name in a nice bold, naturalement
nametext = "<B>[emoter]</B>"
return pretext + nametext + subtext
return capitalize(pretext) + nametext + subtext

/mob/proc/custom_emote(var/m_type = VISIBLE_MESSAGE, var/message = null)

Expand All @@ -171,15 +162,16 @@
else
input = message

if(input)
message = format_emote(src, message)
else
if(!input)
return

message = trim(html_encode(message))
message = filter_modify_message(message)
message = format_emote(src, message)

if (message)
log_emote("[name]/[key] : [message]")
//do not show NPC animal emotes to ghosts, it turns into hellscape
message = filter_modify_message(message)
var/check_ghosts = client ? /datum/client_preference/ghost_sight : null
if(m_type == VISIBLE_MESSAGE)
visible_message(message, checkghosts = check_ghosts)
Expand Down
6 changes: 3 additions & 3 deletions code/modules/mob/living/carbon/human/examine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
criminal = R.get_criminalStatus()

msg += "<span class = 'deptradio'>Criminal status:</span> <a href='?src=\ref[src];criminal=1'>\[[criminal]\]</a>\n"
msg += "<span class = 'deptradio'>Security records:</span> <a href='?src=\ref[src];secrecord=`'>\[View\]</a>\n"
msg += "<span class = 'deptradio'>Security records:</span> <a href='?src=\ref[src];secrecord=1'>\[View\]</a>\n"

if(hasHUD(user, HUD_MEDICAL))
var/perpname = "wot"
Expand All @@ -223,7 +223,7 @@
medical = R.get_status()

msg += "<span class = 'deptradio'>Physical status:</span> <a href='?src=\ref[src];medical=1'>\[[medical]\]</a>\n"
msg += "<span class = 'deptradio'>Medical records:</span> <a href='?src=\ref[src];medrecord=`'>\[View\]</a>\n"
msg += "<span class = 'deptradio'>Medical records:</span> <a href='?src=\ref[src];medrecord=1'>\[View\]</a>\n"

// Show IC/OOC info if available.
if(comments_record_id)
Expand Down Expand Up @@ -270,7 +270,7 @@
/mob/living/carbon/human/getHUDsource(hudtype)
var/obj/item/clothing/glasses/G = get_equipped_item(slot_glasses_str)
if(!istype(G))
return
return ..()
if(G.glasses_hud_type & hudtype)
return G
if(G.hud && (G.hud.glasses_hud_type & hudtype))
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
machine = null

CLEAR_HUD_ALERTS(src) // These will be set again in the various update procs below.
handle_hud_glasses() // Clear HUD overlay images. Done early so that organs, etc. can add them back.

//Handle temperature/pressure differences between body and environment
handle_environment(loc.return_air())
Expand Down Expand Up @@ -540,7 +541,6 @@

/mob/living/proc/handle_hud_icons()
handle_hud_icons_health()
handle_hud_glasses()

/mob/living/proc/handle_hud_icons_health()
return
Expand Down
19 changes: 4 additions & 15 deletions code/modules/mob/living/say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,6 @@
returns[2] = null
return returns

/mob/living/proc/format_say_message(var/message = null)
if(!message)
return

message = html_decode(message)

var/end_char = copytext_char(message, -1)
if(!(end_char in list(".", "?", "!", "-", "~")))
message += "."

return html_encode(message)

/mob/living/proc/handle_mob_specific_speech(message, message_mode, verb = "says", decl/language/speaking)
SHOULD_CALL_PARENT(TRUE)
return FALSE
Expand Down Expand Up @@ -142,7 +130,8 @@
else
message = copytext_char(message, 3)

message = trim_left(message)
// trim pre-language-parsing so we can get language and radio keys
message = trim(message)

//parse the language code and consume it
if(!speaking)
Expand Down Expand Up @@ -177,10 +166,10 @@
else
verb = say_quote(message, speaking)

message = trim_left(message)
message = trim(html_encode(message)) // trim again post-language-parsing
message = handle_autohiss(message, speaking)
message = format_say_message(message)
message = filter_modify_message(message)
message = handle_autopunctuation(message)

if(speaking && !speaking.can_be_spoken_properly_by(src))
message = speaking.muddle(message)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/observer/eye/freelook/life.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/mob/observer/eye/freelook/Life()
. = ..()
..()
// If we lost our client, reset the list of visible chunks so they update properly on return
if(. && owner == src && !client)
if(owner == src && !client)
visibleChunks.Cut()
/*else if(owner && !owner.client)
visibleChunks.Cut()*/
4 changes: 2 additions & 2 deletions code/modules/mob/observer/ghost/ghost.dm
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ Works together with spawning an observer, noted above.

/mob/observer/ghost/Life()

. = ..()
if(!. || !loc || !client)
..()
if(!loc || !client)
return FALSE

handle_hud_glasses()
Expand Down
9 changes: 9 additions & 0 deletions code/modules/mob/say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,12 @@ var/global/list/special_channel_keys = list(
var/obj/item/mask = get_equipped_item(slot_wear_mask_str)
if(istype(mask, /obj/item/clothing/mask/muzzle) || istype(mask, /obj/item/sealant))
. = mask

/// Adds punctuation to an emote or speech message automatically.
/mob/proc/handle_autopunctuation(message)
if(!message)
return
var/end_char = copytext_char(trim_right(strip_html_properly(message)), -1)
if(!(end_char in list(".", "?", "!", "-", "~")))
message += "."
return message
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
LAZYADD(., /decl/interaction_handler/remove_id/modular_computer)
LAZYADD(., /decl/interaction_handler/remove_pen/modular_computer)
LAZYADD(., /decl/interaction_handler/emergency_shutdown)
LAZYADD(., /decl/interaction_handler/remove_chargestick)

//
// Remove ID
Expand All @@ -149,7 +150,8 @@
. = ..()
if(.)
var/datum/extension/assembly/assembly = get_extension(target, /datum/extension/assembly)
. = !!(assembly?.get_component(PART_CARD))
var/obj/item/stock_parts/computer/card_slot/card_slot = assembly?.get_component(PART_CARD)
return !!card_slot?.stored_card

/decl/interaction_handler/remove_id/modular_computer/invoked(atom/target, mob/user, obj/item/prop)
var/datum/extension/assembly/assembly = get_extension(target, /datum/extension/assembly)
Expand Down Expand Up @@ -186,4 +188,26 @@
return !isnull(assembly) && assembly.enabled

/decl/interaction_handler/emergency_shutdown/invoked(obj/item/modular_computer/target, mob/user, obj/item/prop)
target.emergency_shutdown()
target.emergency_shutdown()

//
// Remove Charge-stick
//
/decl/interaction_handler/remove_chargestick
name = "Remove Chargestick"
icon = 'icons/screen/radial.dmi'
icon_state = "radial_eject"
expected_target_type = /obj/item/modular_computer

/decl/interaction_handler/remove_chargestick/is_possible(atom/target, mob/user, obj/item/prop)
. = ..()
if(!.)
return .
var/datum/extension/assembly/assembly = get_extension(target, /datum/extension/assembly)
var/obj/item/stock_parts/computer/charge_stick_slot/mstick_slot = assembly.get_component(PART_MSTICK)
return !!mstick_slot?.stored_stick

/decl/interaction_handler/remove_chargestick/invoked(atom/target, mob/user, obj/item/prop)
var/datum/extension/assembly/assembly = get_extension(target, /datum/extension/assembly)
var/obj/item/stock_parts/computer/charge_stick_slot/mstick_slot = assembly.get_component(PART_MSTICK)
mstick_slot.eject_stick(user)
4 changes: 2 additions & 2 deletions maps/tether/atoms/areas.dm
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,8 @@
icon_state = "shuttle2"
base_turf = /turf/floor/natural/barren

/area/shuttle/escape/centcom
name = "\improper Emergency Shuttle CentCom"
/area/shuttle/tram
name = "\improper Orange Line Tram"
icon_state = "shuttle"

/area/shuttle/specops/centcom
Expand Down
Loading
Loading