Merge pull request #11231 from Arkatos1/Tips

Adds Tip of the round + Show Custom Tip admin verb + Give Random Tip OOC verb
This commit is contained in:
variableundefined
2019-04-16 19:43:55 +08:00
committed by GitHub
9 changed files with 303 additions and 0 deletions
+21
View File
@@ -28,6 +28,9 @@ var/round_start_time = 0
var/list/factions = list() // list of all factions
var/list/availablefactions = list() // list of factions with openings
var/tipped = FALSE //Did we broadcast the tip of the day yet?
var/selected_tip // What will be the tip of the day?
var/pregame_timeleft = 0
var/delay_end = 0 //if set to nonzero, the round will not restart on it's own
@@ -55,6 +58,10 @@ var/round_start_time = 0
if(going)
pregame_timeleft--
if(pregame_timeleft <= 60 && !tipped)
send_tip_of_the_round()
tipped = TRUE
if(pregame_timeleft <= 0)
current_state = GAME_STATE_SETTING_UP
Master.SetRunLevel(RUNLEVEL_SETUP)
@@ -376,6 +383,20 @@ var/round_start_time = 0
if(!istype(M,/mob/new_player))
to_chat(M, "Captainship not forced on anyone.")
/datum/controller/gameticker/proc/send_tip_of_the_round()
var/m
if(selected_tip)
m = selected_tip
else
var/list/randomtips = file2list("strings/tips.txt")
var/list/memetips = file2list("strings/sillytips.txt")
if(randomtips.len && prob(95))
m = pick(randomtips)
else if(memetips.len)
m = pick(memetips)
if(m)
to_chat(world, "<span class='purple'><b>Tip of the round: </b>[html_encode(m)]</span>")
/datum/controller/gameticker/proc/process()
if(current_state != GAME_STATE_PLAYING)
+16
View File
@@ -0,0 +1,16 @@
/client/verb/randomtip()
set category = "OOC"
set name = "Give Random Tip"
set desc = "Shows you a random tip"
var/m
var/list/randomtips = file2list("strings/tips.txt")
var/list/memetips = file2list("strings/sillytips.txt")
if(randomtips.len && prob(95))
m = pick(randomtips)
else if(memetips.len)
m = pick(memetips)
if(m)
to_chat(src, "<span class='purple'><b>Tip: </b>[html_encode(m)]</span>")
+1
View File
@@ -107,6 +107,7 @@ var/list/admin_verbs_event = list(
/client/proc/toggle_random_events,
/client/proc/toggle_random_events,
/client/proc/toggle_ert_calling,
/client/proc/show_tip,
/client/proc/cmd_admin_change_custom_event,
/client/proc/cmd_admin_custom_event_info,
/client/proc/cmd_view_custom_event_info,
+25
View File
@@ -1020,6 +1020,31 @@ Traitors and the like can also be revived with the previous role mostly intact.
log_admin("Admin [key_name(src)] has disabled ERT calling.")
message_admins("Admin [key_name_admin(usr)] has disabled ERT calling.", 1)
/client/proc/show_tip()
set category = "Admin"
set name = "Show Custom Tip"
set desc = "Sends a tip (that you specify) to all players. After all \
you're the experienced player here."
if(!check_rights(R_ADMIN))
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)
return
ticker.selected_tip = input
// 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.")
/client/proc/modify_goals()
set category = "Event"
set name = "Modify Station Goals"