From af5110c43e791c7351b6d2cdd7b7ebac04fa8a25 Mon Sep 17 00:00:00 2001 From: Jack Edge Date: Thu, 23 Jun 2016 00:48:09 +0100 Subject: [PATCH] Tip of the round --- code/controllers/subsystem/ticker.dm | 28 +++++++++++++++++-------- code/modules/admin/verbs/randomverbs.dm | 17 ++++++++------- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 17fb9f71624..855059c2188 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -36,6 +36,7 @@ var/datum/subsystem/ticker/ticker var/triai = 0 //Global holder for Triumvirate var/tipped = 0 //Did we broadcast the tip of the day yet? + var/selected_tip // What will be the tip of the day? var/timeLeft = 1200 //pregame timer @@ -88,8 +89,8 @@ var/datum/subsystem/ticker/ticker timeLeft -= wait if(timeLeft <= 300 && !tipped) - send_random_tip() - tipped = 1 + send_tip_of_the_round() + tipped = TRUE if(timeLeft <= 0) current_state = GAME_STATE_SETTING_UP @@ -447,13 +448,21 @@ var/datum/subsystem/ticker/ticker return 1 -/datum/subsystem/ticker/proc/send_random_tip() - var/list/randomtips = file2list("config/tips.txt") - var/list/memetips = file2list("config/sillytips.txt") - if(randomtips.len && prob(95)) - world << "Tip of the round: [html_encode(pick(randomtips))]" - else if(memetips.len) - world << "Tip of the round: [html_encode(pick(memetips))]" +/datum/subsystem/ticker/proc/send_tip_of_the_round() + var/m + if(selected_tip) + m = selected_tip + else + var/list/randomtips = file2list("config/tips.txt") + var/list/memetips = file2list("config/sillytips.txt") + if(randomtips.len && prob(95)) + m = pick(randomtips) + else if(memetips.len) + m = pick(memetips) + + if(m) + world << "Tip of the round: \ + [html_encode(m)]" /datum/subsystem/ticker/proc/check_queue() if(!queued_players.len || !config.hard_popcap) @@ -525,6 +534,7 @@ var/datum/subsystem/ticker/ticker triai = ticker.triai tipped = ticker.tipped + selected_tip = ticker.selected_tip timeLeft = ticker.timeLeft diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 5b307cda2f0..795ad9c968b 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -1064,7 +1064,7 @@ var/list/datum/outfit/custom_outfits = list() //Admin created outfits message_admins("Mass polymorph started by [who_did_it] is complete.") /client/proc/show_tip() - set category = "Fun" + set category = "Admin" set name = "Show Tip" set desc = "Sends a tip (that you specify) to all players. After all \ you're the experienced player here." @@ -1076,13 +1076,16 @@ var/list/datum/outfit/custom_outfits = list() //Admin created outfits if(!input) return - if(ticker) - ticker.tipped = TRUE + if(!ticker) + return - world << "Tip of the round: \ - [html_encode(input)]" + ticker.selected_tip = input - message_admins("[key_name_admin(usr)] sent \"[input]\" as the \ - Tip of the Round.") + // If we've already tipped, then send it straight away. + if(ticker.tipped) + ticker.send_tip_of_the_round() + + + message_admins("[key_name_admin(usr)] sent a tip of the round.") log_admin("[key_name(usr)] sent \"[input]\" as the Tip of the Round.") feedback_add_details("admin_verb","TIP")