Skip to content

Commit

Permalink
TGS Test Merge (#16087)
Browse files Browse the repository at this point in the history
  • Loading branch information
comfyorange committed Jun 29, 2024
2 parents 934aaee + a15dd26 commit b6d7e2b
Show file tree
Hide file tree
Showing 27 changed files with 385 additions and 143 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/chat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@
#define debug_world_log(msg) if (GLOB.Debug2) log_world("DEBUG: [msg]")
/// Adds a generic box around whatever message you're sending in chat. Really makes things stand out.
#define examine_block(str) ("<div class='examine_block'>" + str + "</div>")

#define EXAMINE_SECTION_BREAK "<hr>"
10 changes: 5 additions & 5 deletions code/__DEFINES/span.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@
#define span_alert(str) ("<span class='alert'>" + str + "</span>")
#define span_alertalien(str) ("<span class='alertalien'>" + str + "</span>")
#define span_alien(str) ("<span class='alien'>" + str + "</span>")
#define span_announce_body(str) ("<span class='announce_body'>" + str + "</span>")
#define span_announce_header(str) ("<span class='announce_header'>" + str + "</span>")
#define span_attack(str) ("<span class='attack'>" + str + "</span>")
#define span_avoidharm(str) ("<span class='avoidharms'>" + str + "</span>")
#define span_bad(str) ("<span class='bad'>" + str + "</span>")
#define span_big(str) ("<span class='big'>" + str + "</span>")
#define span_bigdeadsay(str) ("<span class='bigdeadsay'>" + str + "</span>")
#define span_binarysay(str) ("<span class='binarysay'>" + str + "</span>")
#define span_bold(str) ("<span class='bold'>" + str + "</span>")
#define span_boldannounce(str) ("<span class='boldannounce'>" + str + "</span>")
Expand All @@ -18,14 +21,12 @@
#define span_center(str) ("<span class='center'>" + str + "</span>")
#define span_centerbold(str) ("<span class='centerbold'>" + str + "</span>")
#define span_danger(str) ("<span class='danger'>" + str + "</span>")
#define span_bigdeadsay(str) ("<span class='bigdeadsay'>" + str + "</span>")
#define span_deadsay(str) ("<span class='deadsay'>" + str + "</span>")
#define span_tinydeadsay(str) ("<span class='tinydeadsay'>" + str + "</span>")
#define span_disarm(str) ("<span class='disarm'>" + str + "</span>")
#define span_debuginfo(str) ("<span class='debuginfo'>" + str + "</span>")
#define span_event_announcement(str) ("<span class='event_announcement'>" + str + "</span>")
#define span_game(str) ("<span class='game'>" + str + "</span>")
#define span_good(str) ("<span class='good'>" + str + "</span>")
#define span_green(str) ("<span class='green'>" + str + "</span>")
#define span_greenteamradio(str) ("<span class='greenteamradio'>" + str + "</span>")
#define span_greentext(str) ("<span class='greentext'>" + str + "</span>")
#define span_grippy(str) ("<span class='grippy'>" + str + "</span>")
Expand All @@ -51,6 +52,7 @@
#define span_nopositions(str) ("<span class='nopositions'>" + str + "</span>")
#define span_nicegreen(str) ("<span class='nicegreen'>" + str + "</span>")
#define span_notice(str) ("<span class='notice'>" + str + "</span>")
#define span_tinydeadsay(str) ("<span class='tinydeadsay'>" + str + "</span>")
#define span_tinynotice(str) ("<span class='tinynotice'>" + str + "</span>")
#define span_ooc(str) ("<span class='ooc'>" + str + "</span>")
#define span_ordercic(str) ("<span class='ordercic'>" + str + "</span>")
Expand All @@ -68,8 +70,6 @@
#define span_scannerburn(str) ("<span class='scannerburn'>" + str + "</span>")
#define span_scannerburnb(str) ("<span class='scannerburnb'>" + str + "</span>")
#define span_season_additional_info(str) ("<span class='season_additional_info'>" + str + "</span>")
#define span_announce_header(str) ("<span class='announce_header'>" + str + "</span>")
#define span_announce_body(str) ("<span class='announce_body'>" + str + "</span>")
#define span_seasons_announce(str) ("<span class='seasons_announce'>" + str + "</span>")
#define span_suicide(str) ("<span class='suicide'>" + str + "</span>")
#define span_tip(str) ("<span class='tip'>" + str + "</span>")
Expand Down
16 changes: 13 additions & 3 deletions code/__HELPERS/announce.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#define ANNOUNCEMENT_PRIORITY 2
#define ANNOUNCEMENT_COMMAND 3

// don't use any of these macros outside of here to keep the appearance of alerts consistent (unless you need to make them global for some reason)
// if you want to design a faction alert to use in a message or something, use assemble_alert()
// Do not use these macros outside of here (unless you absolutely have to or something), this is mainly to make sure they appear consistent
// The best way to use these for to_chats or something would be assemble_alert()

// a style for extra padding on alert titles
#define span_alert_header(str) ("<span class='alert_header'>" + str + "</span>")
Expand Down Expand Up @@ -68,7 +68,17 @@
* * receivers - a list of all players to send the message to. defaults to all humans, AIs and ghosts
* * playing_sound - optional, is this playing sound?
*/
/proc/priority_announce(message, title = "Announcement", subtitle = "", type = ANNOUNCEMENT_REGULAR, sound = 'sound/misc/notice2.ogg', channel_override = CHANNEL_ANNOUNCEMENTS, color_override, list/receivers = (GLOB.alive_human_list + GLOB.ai_list + GLOB.observer_list), playing_sound = TRUE)
/proc/priority_announce(
message,
title = "Announcement",
subtitle = "",
type = ANNOUNCEMENT_REGULAR,
sound = 'sound/misc/notice2.ogg',
channel_override = CHANNEL_ANNOUNCEMENTS,
color_override,
list/receivers = (GLOB.alive_human_list + GLOB.ai_list + GLOB.observer_list),
playing_sound = TRUE
)
if(!message)
return

Expand Down
82 changes: 82 additions & 0 deletions code/__HELPERS/ooc_announcement.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// These are local since they don't really need to be used anywhere else
#define span_ooc_announcement_text(str) ("<span class='ooc_announcement_text'>" + str + "</span>")
#define span_ooc_alert_subtitle(str) ("<span class='faction_alert_subtitle'>" + str + "</span>")
#define span_major_announcement_title(str) ("<span class='faction_alert_title'>" + str + "</span>")
/**
* Sends a div formatted chat box announcement
*
* Formatted like:
*
* " Server Announcement " (or sender_override)
*
* " Title "
*
* " Text "
*
* Arguments
* * text - required, the text to announce
* * title - optional, the title of the announcement.
* * players - optional, a list of all players to send the message to. defaults to the entire world
* * play_sound - if TRUE, play a sound with the announcement
* * sound_override - optional, override the default announcement sound
* * sender_override - optional, modifies the sender of the announcement
* * style - optional, is this an `ooc` (blue, used for admin announcements) or `game` (red, used for round-related announcements) announcement
* * encode_title - if TRUE, the title will be HTML encoded (escaped)
* * encode_text - if TRUE, the text will be HTML encoded (escaped)
*/
/proc/send_ooc_announcement(
text,
title = "",
players,
play_sound = TRUE,
sound_override = 'sound/misc/adm_announce.ogg',
sender_override = "Server Admin Announcement",
style = "ooc",
encode_title = TRUE,
encode_text = FALSE,
)
if(isnull(text))
return

var/list/announcement_strings = list()

if(encode_title && title && length(title) > 0)
title = html_encode(title)
if(encode_text)
text = html_encode(text)
if(!length(text))
return

announcement_strings += span_major_announcement_title(sender_override)
announcement_strings += span_ooc_alert_subtitle(title)
announcement_strings += span_ooc_announcement_text(text)
var/finalized_announcement = create_ooc_announcement_div(jointext(announcement_strings, ""), style)

if(islist(players))
for(var/mob/target in players)
to_chat(target, finalized_announcement)
if(play_sound)
SEND_SOUND(target, sound(sound_override))
else
to_chat(world, finalized_announcement)

if(!play_sound)
return

for(var/mob/player in GLOB.player_list)
SEND_SOUND(player, sound(sound_override))

/**
* Inserts a span styled message into an OOC alert style div
*
*
* Arguments
* * message - required, the message contents
* * style_override - required, set the div style
*/
/proc/create_ooc_announcement_div(message, style_override)
return "<div class='ooc_alert_[style_override]'>[message]</div>"

#undef span_ooc_announcement_text
#undef span_ooc_alert_subtitle
#undef span_major_announcement_title
2 changes: 1 addition & 1 deletion code/controllers/subsystem/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ SUBSYSTEM_DEF(ticker)
tip = pick(SSstrings.get_list_from_file("tips/meme"))

if(tip)
to_chat(world, "<br>[span_tip(examine_block("[html_encode(tip)]"))]<br>")
to_chat(world, examine_block("[span_tip("<big>Tip of the round:</big>")][EXAMINE_SECTION_BREAK][html_encode(tip)]"))


/datum/controller/subsystem/ticker/proc/check_queue()
Expand Down
6 changes: 3 additions & 3 deletions code/datums/elements/shrapnel_removal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@
span_notice("You fumble around figuring out how to use [removaltool]."))
if(!do_after(user, fumble_duration * (SKILL_MEDICAL_PRACTICED - skill), NONE, target, BUSY_ICON_UNSKILLED))
return
user.visible_message(span_notice("[user] starts searching for shrapnel in [target] with the [removaltool]."), span_notice("You start searching for shrapnel in [target] with the [removaltool]."))
if(!do_after(user, do_after_time, NONE, target, BUSY_ICON_MEDICAL))
user.visible_message(span_green("[user] starts searching for shrapnel in [target] with the [removaltool]."), span_green("You start searching for shrapnel in [target] with the [removaltool]."))
if(!do_after(user, do_after_time, NONE, target, BUSY_ICON_FRIENDLY, BUSY_ICON_MEDICAL))
to_chat(user, span_notice("You stop searching for shrapnel in [target]"))
return
remove_shrapnel(user, target, targetlimb, skill)
//iterates over the rest of the patient's limbs, attempting to remove shrapnel
for(targetlimb AS in target.limbs)
while(has_shrapnel(targetlimb))
if(!do_after(user, do_after_time, NONE, target, BUSY_ICON_MEDICAL))
if(!do_after(user, do_after_time, NONE, target, BUSY_ICON_FRIENDLY, BUSY_ICON_MEDICAL))
to_chat(user, span_notice("You stop searching for shrapnel in [target]"))
return
remove_shrapnel(user, target, targetlimb, skill)
Expand Down
20 changes: 13 additions & 7 deletions code/datums/gamemodes/campaign.dm
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,22 @@
log_game("[round_finished]\nGame mode: [name]\nRound time: [duration2text()]\nEnd round player population: [length(GLOB.clients)]\nTotal TGMC spawned: [GLOB.round_statistics.total_humans_created[FACTION_TERRAGOV]]\nTotal SOM spawned: [GLOB.round_statistics.total_humans_created[FACTION_SOM]]")

/datum/game_mode/hvh/campaign/end_round_fluff()
to_chat(world, span_round_header("Campaign concluded"))
to_chat(world, span_round_header("|[round_finished]|"))

var/announcement_body = ""
switch(round_finished)
if(MODE_COMBAT_PATROL_SOM_MINOR)
to_chat(world, span_round_body("Brave SOM forces are reporting decisive victories against the imperialist TerraGov forces across the planet, forcing their disorganised and chaotic retreat. \
With the planet now liberated, the Sons of Mars welcome the people of Palmaria into the light of a new day, ready to help them into a better future as brothers."))
announcement_body = "Brave SOM forces are reporting decisive victories against the imperialist TerraGov forces across the planet, forcing their disorganised and chaotic retreat. \
With the planet now liberated, the Sons of Mars welcome the people of Palmaria into the light of a new day, ready to help them into a better future as brothers."
if(MODE_COMBAT_PATROL_MARINE_MINOR)
to_chat(world, span_round_body("TGMC forces have routed the terrorist SOM forces across the planet, destroying their strongholds and returning possession of stolen property to their legitimate corporate owners. \
With the SOM threat removed, TerraGov peacekeeping forces begin to move in to ensure a rapid return to law and order, restoring stability, safety, and a guarantee of Palmaria's economic development to the benefit of all citizens."))
announcement_body = "TGMC forces have routed the terrorist SOM forces across the planet, destroying their strongholds and returning possession of stolen property to their legitimate corporate owners. \
With the SOM threat removed, TerraGov peacekeeping forces begin to move in to ensure a rapid return to law and order, restoring stability, safety, and a guarantee of Palmaria's economic development to the benefit of all citizens."

send_ooc_announcement(
sender_override = "Round Concluded",
title = round_finished,
text = announcement_body,
play_sound = FALSE,
style = "game"
)

var/sound/som_track
var/sound/tgmc_track
Expand Down
20 changes: 14 additions & 6 deletions code/datums/gamemodes/campaign/campaign_mission.dm
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,13 @@

///Intro when the mission is selected
/datum/campaign_mission/proc/play_selection_intro()
to_chat(world, span_round_header("|[name]|"))
to_chat(world, span_round_body("Next mission selected by [starting_faction] as [name] on the battlefield of [map_name]."))
for(var/mob/player AS in GLOB.player_list)
player.playsound_local(null, 'sound/ambience/votestart.ogg', 10, 1)
send_ooc_announcement(
sender_override = "Mission Starting",
title = name,
text = "Next mission is [name], selected by [starting_faction] on the battlefield of [map_name].",
sound_override = 'sound/ambience/votestart.ogg',
style = "game"
)

///Intro when the mission is started
/datum/campaign_mission/proc/play_start_intro()
Expand All @@ -365,8 +368,13 @@
/datum/campaign_mission/proc/play_outro()
log_game("[outcome]\nMission: [name]")

to_chat(world, span_round_header("[name] completed"))
to_chat(world, span_round_header("|[starting_faction] [outcome]|"))
send_ooc_announcement(
sender_override = "[name] Complete",
title = "[starting_faction] [outcome]",
text = "The engagement between [starting_faction] and [hostile_faction] on [map_name] has ended in a [starting_faction] [outcome]!",
play_sound = FALSE,
style = "game"
)

map_text_broadcast(starting_faction, outro_message[outcome][MISSION_STARTING_FACTION], op_name_starting)
map_text_broadcast(hostile_faction, outro_message[outcome][MISSION_HOSTILE_FACTION], op_name_hostile)
Expand Down
9 changes: 7 additions & 2 deletions code/datums/gamemodes/combat_patrol.dm
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,13 @@
log_game("[round_finished]\nGame mode: [name]\nRound time: [duration2text()]\nEnd round player population: [length(GLOB.clients)]\nTotal TGMC spawned: [GLOB.round_statistics.total_humans_created[FACTION_TERRAGOV]]\nTotal SOM spawned: [GLOB.round_statistics.total_humans_created[FACTION_SOM]]")

/datum/game_mode/hvh/combat_patrol/end_round_fluff()
to_chat(world, span_round_header("|[round_finished]|"))
to_chat(world, span_round_body("Thus ends the story of the brave men and women of both the TGMC and SOM, and their struggle on [SSmapping.configs[GROUND_MAP].map_name]."))
send_ooc_announcement(
sender_override = "Round Concluded",
title = round_finished,
text = "Thus ends the story of the brave men and women of the TerraGov Marine Corps and Sons of Mars, and their struggle on [SSmapping.configs[GROUND_MAP].map_name].",
play_sound = FALSE,
style = "game"
)

/datum/game_mode/hvh/combat_patrol/get_deploy_point_message(mob/living/user)
switch(user.faction)
Expand Down
9 changes: 6 additions & 3 deletions code/datums/gamemodes/hvh.dm
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,12 @@ Sensors indicate [num_som_delta || "no"] unknown lifeform signature[num_som_delt

for(var/i in GLOB.observer_list)
var/mob/M = i
to_chat(M, "<span class='announce_header'>Detailed Information</span>")
to_chat(M, {"<span class='announce_body'>[num_som] SOM alive.
[num_tgmc] Marine\s alive."})
to_chat(M, assemble_alert(
title = "Detailed Bioscan",
message = {"[num_som] SOM alive.
[num_tgmc] Marine\s alive."},
color_override = "orange"
))

message_admins("Bioscan - Marines: [num_tgmc] active TGMC personnel[tgmc_location ? " .Location:[tgmc_location]":""]")
message_admins("Bioscan - SOM: [num_som] active SOM personnel[som_location ? " .Location:[som_location]":""]")
Expand Down
12 changes: 8 additions & 4 deletions code/datums/gamemodes/infestation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,7 @@
[numHostsPlanet] human\s on the planet.
[numHostsShip] human\s on the ship.
[numHostsTransit] human\s in transit."},
color_override = "purple",
minor = TRUE
color_override = "purple"
))

message_admins("Bioscan - Humans: [numHostsPlanet] on the planet[hostLocationP ? ". Location:[hostLocationP]":""]. [numHostsShipr] on the ship.[hostLocationS ? " Location: [hostLocationS].":""]. [numHostsTransitr] in transit.")
Expand Down Expand Up @@ -218,8 +217,13 @@
log_game("[round_finished]\nGame mode: [name]\nRound time: [duration2text()]\nEnd round player population: [length(GLOB.clients)]\nTotal xenos spawned: [GLOB.round_statistics.total_xenos_created]\nTotal humans spawned: [GLOB.round_statistics.total_humans_created]")

/datum/game_mode/infestation/end_round_fluff()
. = ..()
to_chat(world, span_round_header("|[round_finished]|"))
send_ooc_announcement(
sender_override = "Round Concluded",
title = round_finished,
text = "Thus ends the story of the brave men and women of the TerraGov Marine Corps, and their struggle on [SSmapping.configs[GROUND_MAP].map_name]...",
play_sound = FALSE,
style = "game"
)

var/sound/xeno_track
var/sound/human_track
Expand Down
12 changes: 10 additions & 2 deletions code/game/atoms/_atom.dm
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,13 @@ directive is properly returned.

if(length(result))
for(var/i in 1 to (length(result) - 1))
result[i] += "\n"
if(result[i] != EXAMINE_SECTION_BREAK)
result[i] += "\n"
else
// remove repeated <hr's> and ones on the ends.
if((i == 1) || (i == length(result)) || (result[i - 1] == EXAMINE_SECTION_BREAK))
result.Cut(i, i + 1)
i--

to_chat(src, examine_block(span_infoplain(result.Join())))
SEND_SIGNAL(src, COMSIG_MOB_EXAMINATE, examinify)
Expand Down Expand Up @@ -349,16 +355,18 @@ directive is properly returned.
SHOULD_CALL_PARENT(TRUE)
var/examine_string = get_examine_string(user, thats = TRUE)
if(examine_string)
. = list("[examine_string].")
. = list("[examine_string].", EXAMINE_SECTION_BREAK)
else
. = list()

if(desc)
. += desc
if(user.can_use_codex() && SScodex.get_codex_entry(get_codex_value()))
. += EXAMINE_SECTION_BREAK
. += span_notice("The codex has <a href='?_src_=codex;show_examined_info=[REF(src)];show_to=[REF(user)]'>relevant information</a> available.")

if((get_dist(user,src) <= 2) && reagents)
. += EXAMINE_SECTION_BREAK
if(reagents.reagent_flags & TRANSPARENT)
. += "It contains:"
if(length(reagents.reagent_list)) // TODO: Implement scan_reagent and can_see_reagents() to show each individual reagent
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ GLOBAL_DATUM_INIT(welding_sparks_prepdoor, /mutable_appearance, mutable_appearan

/obj/item/examine(mob/user)
. = ..()
. += EXAMINE_SECTION_BREAK
. += "[gender == PLURAL ? "They are" : "It is"] a [weight_class_to_text(w_class)] item."

/obj/item/attack_ghost(mob/dead/observer/user)
Expand Down
Loading

0 comments on commit b6d7e2b

Please sign in to comment.