From 233fee6667c852baf12e13add598882588949880 Mon Sep 17 00:00:00 2001 From: Jack Edge Date: Tue, 21 Jun 2016 20:01:50 +0100 Subject: [PATCH 1/2] Fun->Show Tip verb added :cl: coiax rscadd: Our administrators, here at /tg/, don't get enough credit for their wealth of experience and knowledge. Now they get the chance to share that with you by giving out custom tips! /:cl: - Show Tip verb, asks for input, then outputs it to all players in exactly the format that tips are displayed in. Also supresses the automatic tip if given before it's sent out. --- code/modules/admin/admin_verbs.dm | 3 ++- code/modules/admin/verbs/randomverbs.dm | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 088c3713073..aeeb64fed24 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -97,7 +97,8 @@ var/list/admin_verbs_fun = list( /client/proc/toggle_nuke, /client/proc/mass_zombie_infection, /client/proc/mass_zombie_cure, - /client/proc/polymorph_all + /client/proc/polymorph_all, + /client/proc/show_tip ) var/list/admin_verbs_spawn = list( /datum/admins/proc/spawn_atom, /*allows us to spawn instances*/ diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 546dd4548d2..5b307cda2f0 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -1062,3 +1062,27 @@ var/list/datum/outfit/custom_outfits = list() //Admin created outfits wabbajack(M) message_admins("Mass polymorph started by [who_did_it] is complete.") + +/client/proc/show_tip() + set category = "Fun" + set name = "Show Tip" + set desc = "Sends a tip (that you specify) to all players. After all \ + you're the experienced player here." + + if(!holder) + return + + var/input = input(usr, "Please specify your tip that you want to send to the players.", "Tip", "") as message|null + if(!input) + return + + if(ticker) + ticker.tipped = TRUE + + world << "Tip of the round: \ + [html_encode(input)]" + + message_admins("[key_name_admin(usr)] sent \"[input]\" as the \ + Tip of the Round.") + log_admin("[key_name(usr)] sent \"[input]\" as the Tip of the Round.") + feedback_add_details("admin_verb","TIP") From af5110c43e791c7351b6d2cdd7b7ebac04fa8a25 Mon Sep 17 00:00:00 2001 From: Jack Edge Date: Thu, 23 Jun 2016 00:48:09 +0100 Subject: [PATCH 2/2] 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")