mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 04:30:44 +01:00
Adds friendly commendations (#51217)
* with message * remove message, neaten up
This commit is contained in:
@@ -183,6 +183,7 @@
|
||||
body += "<A href='?_src_=holder;[HrefToken()];tdome2=[REF(M)]'>Thunderdome 2</A> | "
|
||||
body += "<A href='?_src_=holder;[HrefToken()];tdomeadmin=[REF(M)]'>Thunderdome Admin</A> | "
|
||||
body += "<A href='?_src_=holder;[HrefToken()];tdomeobserve=[REF(M)]'>Thunderdome Observer</A> | "
|
||||
body += "<A href='?_src_=holder;[HrefToken()];admincommend=[REF(M)]'>Commend Behavior</A> | "
|
||||
|
||||
body += "<br>"
|
||||
body += "</body></html>"
|
||||
|
||||
@@ -2251,6 +2251,15 @@
|
||||
var/datum/poll_question/poll = locate(href_list["submitoptionpoll"]) in GLOB.polls
|
||||
poll_option_parse_href(href_list, poll, option)
|
||||
|
||||
else if(href_list["admincommend"])
|
||||
if(!SSticker.IsRoundInProgress())
|
||||
to_chat(usr, "<span class='warning'>The round must be in progress to use this!</span>")
|
||||
return
|
||||
var/mob/heart_recepient = locate(href_list["admincommend"])
|
||||
if(tgalert(usr, "Are you sure you'd like to anonymously commend [heart_recepient.ckey]? NOTE: This is logged, please use this sparingly and only for actual kind behavior, not as a reward for your friends.", "<3?", "Yes", "No") == "No")
|
||||
return
|
||||
usr.nominate_heart(heart_recepient)
|
||||
|
||||
/datum/admins/proc/HandleCMode()
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
@@ -687,3 +687,34 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
|
||||
return founds
|
||||
|
||||
return msg
|
||||
|
||||
/proc/get_mob_by_name(msg)
|
||||
//This is a list of words which are ignored by the parser when comparing message contents for names. MUST BE IN LOWER CASE!
|
||||
var/list/ignored_words = list("unknown","the","a","an","of","monkey","alien","as", "i")
|
||||
|
||||
//explode the input msg into a list
|
||||
var/list/msglist = splittext(msg, " ")
|
||||
|
||||
//who might fit the shoe
|
||||
var/list/potential_hits = list()
|
||||
|
||||
for(var/i in GLOB.mob_list)
|
||||
var/mob/M = i
|
||||
var/list/nameWords = list()
|
||||
if(!M.mind)
|
||||
continue
|
||||
|
||||
for(var/string in splittext(lowertext(M.real_name), " "))
|
||||
if(!(string in ignored_words))
|
||||
nameWords += string
|
||||
for(var/string in splittext(lowertext(M.name), " "))
|
||||
if(!(string in ignored_words))
|
||||
nameWords += string
|
||||
|
||||
for(var/string in nameWords)
|
||||
testing("Name word [string]")
|
||||
if(string in msglist)
|
||||
potential_hits += M
|
||||
break
|
||||
|
||||
return potential_hits
|
||||
|
||||
Reference in New Issue
Block a user