From 2ec9ae5701bab4e37889009c8952733fea4547ef Mon Sep 17 00:00:00 2001 From: Geeves Date: Sat, 20 Jun 2020 10:34:07 +0200 Subject: [PATCH] Round End Summary Fixes (#9096) Added an admin verb that ends the round smoothly, displaying the end round card. Wizard learned spells are now properly displayed at round. Antags added to gamemodes they don't belong in, now properly update the gamemode's antag template, allowing their things to be displayed at round end. Fixed a typo in the apprentice pebble spawn-in calling it an 'artificer pebble' in deadchat. --- code/controllers/subsystems/ticker.dm | 7 +++++-- code/game/antagonist/antagonist_create.dm | 1 + code/game/antagonist/antagonist_print.dm | 12 ++++++++++++ code/game/antagonist/outsider/wizard.dm | 18 ------------------ code/modules/admin/admin_verbs.dm | 16 ++++++++++++++++ .../artifacts/items/apprentice_pebble.dm | 2 +- code/modules/spell_system/spells/spells.dm | 11 +++++------ .../geeves-wizard_roundend_report.yml | 9 +++++++++ 8 files changed, 49 insertions(+), 27 deletions(-) create mode 100644 html/changelogs/geeves-wizard_roundend_report.yml diff --git a/code/controllers/subsystems/ticker.dm b/code/controllers/subsystems/ticker.dm index d07cc90122a..de39a60b37a 100644 --- a/code/controllers/subsystems/ticker.dm +++ b/code/controllers/subsystems/ticker.dm @@ -155,7 +155,7 @@ var/datum/controller/subsystem/ticker/SSticker pregame_timeleft = 1 SECOND to_world("Reattempting gamemode selection.") -/datum/controller/subsystem/ticker/proc/game_tick() +/datum/controller/subsystem/ticker/proc/game_tick(var/force_end = FALSE) if(current_state != GAME_STATE_PLAYING) return 0 @@ -163,7 +163,10 @@ var/datum/controller/subsystem/ticker/SSticker var/game_finished = 0 var/mode_finished = 0 - if (config.continous_rounds) + if(force_end) + game_finished = TRUE + mode_finished = TRUE + else if(config.continous_rounds) game_finished = (emergency_shuttle.returned() || mode.station_was_nuked) mode_finished = (!post_game && mode.check_finished()) else diff --git a/code/game/antagonist/antagonist_create.dm b/code/game/antagonist/antagonist_create.dm index bbe78c33df4..4bcfd645feb 100644 --- a/code/game/antagonist/antagonist_create.dm +++ b/code/game/antagonist/antagonist_create.dm @@ -18,6 +18,7 @@ greet(target) if(!gag_announcement) announce_antagonist_spawn() + LAZYDISTINCTADD(SSticker.mode.antag_templates, src) /datum/antagonist/proc/create_default(var/mob/source) var/mob/living/M diff --git a/code/game/antagonist/antagonist_print.dm b/code/game/antagonist/antagonist_print.dm index c7ddf3519fd..8b73541a59c 100644 --- a/code/game/antagonist/antagonist_print.dm +++ b/code/game/antagonist/antagonist_print.dm @@ -6,6 +6,7 @@ var/text = "

The [current_antagonists.len == 1 ? "[role_text] was" : "[role_text_plural] were"]:" for(var/datum/mind/P in current_antagonists) text += print_player_full(P) + text += print_special_role_report(P) text += get_special_objective_text(P) if(P.ambitions) text += "
Their goals for today were:" @@ -48,6 +49,17 @@ text += "Fail." return text +/datum/antagonist/proc/print_special_role_report(var/datum/mind/ply) + var/text = "" + if(length(ply.learned_spells)) + text += "

[ply.name]'s spells were:
" + for(var/s in ply.learned_spells) + var/spell/spell = s + text += "[spell.name] - " + text += "Speed: [spell.spell_levels["speed"]] Power: [spell.spell_levels["power"]]" + text += "
" + return text + /datum/antagonist/proc/print_player_lite(var/datum/mind/ply) var/role = ply.assigned_role ? "\improper[ply.assigned_role]" : "\improper[ply.special_role]" var/text = "
[ply.name] as \a [role] (" diff --git a/code/game/antagonist/outsider/wizard.dm b/code/game/antagonist/outsider/wizard.dm index 71f9b24ffa9..973a1c4c6f8 100644 --- a/code/game/antagonist/outsider/wizard.dm +++ b/code/game/antagonist/outsider/wizard.dm @@ -100,24 +100,6 @@ var/datum/antagonist/wizard/wizards feedback_set_details("round_end_result","loss - wizard killed") to_world("The [(current_antagonists.len>1)?"[role_text_plural] have":"[role_text] has"] been killed by the crew! The Space Wizards Federation has been taught a lesson they will not soon forget!") -/datum/antagonist/wizard/print_player_summary() - ..() - for(var/p in current_antagonists) - var/datum/mind/player = p - var/text = "[player.name]'s spells were:" - if(!player.learned_spells || !player.learned_spells.len) - text += "
None!" - else - for(var/s in player.learned_spells) - var/spell/spell = s - text += "
[spell.name] - " - text += "Speed: [spell.spell_levels["speed"]] Power: [spell.spell_levels["power"]]" - if(player.ambitions) - text += "
Their goals for today were:" - text += "
'[player.ambitions]'" - text += "
" - to_world(text) - //To batch-remove wizard spells. Linked to mind.dm. /mob/proc/spellremove() diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 10a75164874..213bd8c8bc1 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -80,6 +80,7 @@ var/list/admin_verbs_admin = list( /client/proc/toggle_antagHUD_restrictions, /client/proc/allow_character_respawn, // Allows a ghost to respawn , /client/proc/allow_stationbound_reset, + /client/proc/end_round, /client/proc/event_manager_panel, /client/proc/empty_ai_core_toggle_latejoin, /client/proc/aooc, @@ -312,6 +313,7 @@ var/list/admin_verbs_hideable = list( /datum/admins/proc/toggleaban, /client/proc/create_poll, /client/proc/allow_stationbound_reset, + /client/proc/end_round, /client/proc/toggle_log_hrefs, /datum/admins/proc/immreboot, /client/proc/cmd_dev_bst, @@ -1166,6 +1168,20 @@ var/list/admin_verbs_cciaa = list( log_and_message_admins("admin-wiped [key_name_admin(target)]'s core.") target.do_wipe_core() +/client/proc/end_round() + set name = "End Round" + set desc = "This button will end the round." + set category = "Server" + + if(!check_rights(R_ADMIN)) + return + + if(alert(usr, "Are you sure you want to end the round?", "Confirm Round End", "No", "Yes") != "Yes") + return + + log_and_message_admins("has ended the round with the End Round button.") + SSticker.game_tick(TRUE) + /client/proc/restart_sql() set category = "Debug" set name = "Reconnect SQL" diff --git a/code/modules/spell_system/artifacts/items/apprentice_pebble.dm b/code/modules/spell_system/artifacts/items/apprentice_pebble.dm index 470bb7e69af..79a1ac2c580 100644 --- a/code/modules/spell_system/artifacts/items/apprentice_pebble.dm +++ b/code/modules/spell_system/artifacts/items/apprentice_pebble.dm @@ -13,7 +13,7 @@ SSghostroles.add_spawn_atom("apprentice", src) var/area/A = get_area(src) if(A) - say_dead_direct("An artificer pebble has been created in [A.name]! Spawn at it by using the ghost spawner menu in the ghost tab.") + say_dead_direct("A wizard apprentice pebble has been created in [A.name]! Spawn at it by using the ghost spawner menu in the ghost tab.") /obj/item/apprentice_pebble/Destroy() if(contract) diff --git a/code/modules/spell_system/spells/spells.dm b/code/modules/spell_system/spells/spells.dm index e02e44efecc..231ce1818a7 100644 --- a/code/modules/spell_system/spells/spells.dm +++ b/code/modules/spell_system/spells/spells.dm @@ -44,7 +44,9 @@ if(spell_master.type == master_type) LAZYADD(spell_list, spell_to_add) spell_master.add_spell(spell_to_add) - return 1 + if(mind) + LAZYDISTINCTADD(mind.learned_spells, spell_to_add) + return TRUE var/obj/screen/movable/spell_master/new_spell_master = new master_type //we're here because either we didn't find our type, or we have no spell masters to attach to if(client) @@ -56,11 +58,8 @@ spell_masters.Add(new_spell_master) LAZYADD(spell_list, spell_to_add) if(mind) - if(!mind.learned_spells) - mind.learned_spells = list() - mind.learned_spells += spell_to_add - - return 1 + LAZYDISTINCTADD(mind.learned_spells, spell_to_add) + return TRUE /mob/proc/remove_spell(var/spell/spell_to_remove) if(!spell_to_remove || !istype(spell_to_remove)) diff --git a/html/changelogs/geeves-wizard_roundend_report.yml b/html/changelogs/geeves-wizard_roundend_report.yml new file mode 100644 index 00000000000..3a54d54203c --- /dev/null +++ b/html/changelogs/geeves-wizard_roundend_report.yml @@ -0,0 +1,9 @@ +author: Geeves + +delete-after: True + +changes: + - admin: "Added an admin verb that ends the round smoothly, displaying the end round card." + - bugfix: "Wizard learned spells are now properly displayed at round." + - bugfix: "Antags added to gamemodes they don't belong in, now properly update the gamemode's antag template, allowing their things to be displayed at round end." + - bugfix: "Fixed a typo in the apprentice pebble spawn-in calling it an 'artificer pebble' in deadchat." \ No newline at end of file