Skip to content

Commit

Permalink
Infection Gamemode Announcement Fix (#3986)
Browse files Browse the repository at this point in the history
# About the pull request

Special announcement for infection gamemode for each map. Small touches
to gamemode code

# Explain why it's good for the game

Infection gamemode currently has a placeholder of a bad announcement,
this brings it more inline with other gamemodes (COUGH Distress Signal
COUGH) and fixes the gamemode code...a bit.

# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog
:cl:
add: Infection gamemode announcement fixed and adjusts for each map,
like Distress Signal
code: elements of distress signal post_setup code moved to parent to be
called by all gamemodes
/:cl:

---------

Co-authored-by: harryob <[email protected]>
  • Loading branch information
Ben10083 and harryob authored Jul 25, 2023
1 parent 06d6d05 commit 9df18f7
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 12 deletions.
5 changes: 5 additions & 0 deletions code/datums/emergency_calls/emergency_call.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
var/list/datum/emergency_call/all_calls = list() //initialized at round start and stores the datums.
var/datum/emergency_call/picked_calls[] = list() //Which distress calls are currently active

/datum/game_mode/proc/ares_online()
var/name = "ARES Online"
var/input = "ARES. Online. Good morning, marines."
shipwide_ai_announcement(input, name, 'sound/AI/ares_online.ogg')

//The distress call parent. Cannot be called itself due to "name" being a filtered target.
/datum/emergency_call
var/name = "name"
Expand Down
4 changes: 4 additions & 0 deletions code/datums/map_config.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
var/shuttles = list()

var/announce_text = ""
var/infection_announce_text = ""

var/squads_max_num = 4

Expand Down Expand Up @@ -339,6 +340,9 @@
if(json["announce_text"])
announce_text = json["announce_text"]

if(json["infection_announce_text"])
infection_announce_text = json["infection_announce_text"]

if(json["weather_holder"])
weather_holder = text2path(json["weather_holder"])
if(!weather_holder)
Expand Down
7 changes: 0 additions & 7 deletions code/game/gamemodes/colonialmarines/colonialmarines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@
if(SSmapping.configs[GROUND_MAP].environment_traits[ZTRAIT_BASIC_RT])
flags_round_type |= MODE_BASIC_RT

round_time_lobby = world.time

addtimer(CALLBACK(src, PROC_REF(ares_online)), 5 SECONDS)
addtimer(CALLBACK(src, PROC_REF(map_announcement)), 20 SECONDS)

Expand All @@ -143,11 +141,6 @@
var/monkey_to_spawn = pick(monkey_types)
new monkey_to_spawn(T)

/datum/game_mode/colonialmarines/proc/ares_online()
var/name = "ARES Online"
var/input = "ARES. Online. Good morning, marines."
shipwide_ai_announcement(input, name, 'sound/AI/ares_online.ogg')

/datum/game_mode/colonialmarines/proc/map_announcement()
if(SSmapping.configs[GROUND_MAP].announce_text)
var/rendered_announce_text = replacetext(SSmapping.configs[GROUND_MAP].announce_text, "###SHIPNAME###", MAIN_SHIP_NAME)
Expand Down
14 changes: 11 additions & 3 deletions code/game/gamemodes/extended/infection.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,25 @@
initialize_post_marine_gear_list()
for(var/mob/new_player/np in GLOB.new_player_list)
np.new_player_panel_proc()
spawn(50)
marine_announcement("We've lost contact with the Weyland-Yutani's research facility, [name]. The [MAIN_SHIP_NAME] has been dispatched to assist.", "[MAIN_SHIP_NAME]")

addtimer(CALLBACK(src, PROC_REF(ares_online)), 5 SECONDS)
addtimer(CALLBACK(src, PROC_REF(map_announcement)), 20 SECONDS)
return ..()

/datum/game_mode/infection/proc/map_announcement()
if(SSmapping.configs[GROUND_MAP].infection_announce_text)
var/rendered_announce_text = replacetext(SSmapping.configs[GROUND_MAP].infection_announce_text, "###SHIPNAME###", MAIN_SHIP_NAME)
marine_announcement(rendered_announce_text, "[MAIN_SHIP_NAME]")
else if(SSmapping.configs[GROUND_MAP].announce_text) //if we missed a infection text for above, or just don't need a special one, we just use default announcement
var/rendered_announce_text = replacetext(SSmapping.configs[GROUND_MAP].announce_text, "###SHIPNAME###", MAIN_SHIP_NAME)
marine_announcement(rendered_announce_text, "[MAIN_SHIP_NAME]")

/datum/game_mode/infection/proc/initialize_post_survivor_list()
if(synth_survivor)
transform_survivor(synth_survivor, TRUE)
for(var/datum/mind/survivor in survivors)
if(transform_survivor(survivor) == 1)
survivors -= survivor
tell_survivor_story()

/datum/game_mode/infection/can_start()
initialize_starting_survivor_list()
Expand Down
5 changes: 3 additions & 2 deletions code/game/gamemodes/game_mode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,18 @@ var/global/cas_tracking_id_increment = 0 //this var used to assign unique tracki

for(var/mob/new_player/np in GLOB.new_player_list)
np.new_player_panel_proc()
round_time_lobby = world.time
log_game("Round started at [time2text(world.realtime)]")
if(SSticker.mode)
log_game("Game mode set to [SSticker.mode]")
log_game("Server IP: [world.internet_address]:[world.port]")
return 1
return TRUE


///process()
///Called by the gameticker
/datum/game_mode/process()
return 0
return FALSE


/datum/game_mode/proc/check_finished() //to be called by ticker
Expand Down

0 comments on commit 9df18f7

Please sign in to comment.