Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XO can award distinguished conduct medals #5131

Closed
wants to merge 11 commits into from
13 changes: 9 additions & 4 deletions code/datums/medal_awards.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ GLOBAL_LIST_EMPTY(jelly_awards)

GLOBAL_LIST_INIT(human_medals, list(MARINE_CONDUCT_MEDAL, MARINE_BRONZE_HEART_MEDAL, MARINE_VALOR_MEDAL, MARINE_HEROISM_MEDAL))

/proc/give_medal_award(medal_location, as_admin = FALSE)
/proc/give_medal_award(medal_location, as_admin = FALSE, as_xo = FALSE)
if(as_admin && !check_rights(R_ADMIN))
as_admin = FALSE

Expand All @@ -52,8 +52,13 @@ GLOBAL_LIST_INIT(human_medals, list(MARINE_CONDUCT_MEDAL, MARINE_BRONZE_HEART_ME
if(!chosen_recipient)
return FALSE

var/list/medals_list = GLOB.human_medals
if(as_xo)
medals_list = list(MARINE_CONDUCT_MEDAL)

// Pick a medal
var/medal_type = tgui_input_list(usr, "What type of medal do you want to award?", "Medal Type", GLOB.human_medals)
var/medal_type = tgui_input_list(usr, "What type of medal do you want to award?", "Medal Type", medals_list)

if(!medal_type)
return FALSE

Expand Down Expand Up @@ -166,7 +171,7 @@ GLOBAL_LIST_INIT(human_medals, list(MARINE_CONDUCT_MEDAL, MARINE_BRONZE_HEART_ME
to_chat(user, SPAN_WARNING("You must have an authenticated ID Card to award medals."))
return

if(!((card.paygrade in GLOB.co_paygrades) || (card.paygrade in GLOB.highcom_paygrades)))
if(!((card.paygrade in GLOB.co_paygrades) || (card.paygrade in GLOB.highcom_paygrades) || (card.paygrade == PAY_SHORT_MO3)))
to_chat(user, SPAN_WARNING("Only a Senior Officer can award medals!"))
return

Expand All @@ -180,7 +185,7 @@ GLOBAL_LIST_INIT(human_medals, list(MARINE_CONDUCT_MEDAL, MARINE_BRONZE_HEART_ME
user.visible_message("ERROR: ID card not registered for [user.real_name] in USCM registry. Potential medal fraud detected.")
return

if(give_medal_award(get_turf(printer)))
if(give_medal_award(get_turf(printer), as_xo = card.paygrade == PAY_SHORT_MO3))
user.visible_message(SPAN_NOTICE("[printer] prints a medal."))

GLOBAL_LIST_INIT(xeno_medals, list(XENO_SLAUGHTER_MEDAL, XENO_RESILIENCE_MEDAL, XENO_SABOTAGE_MEDAL, XENO_PROLIFERATION_MEDAL, XENO_REJUVENATION_MEDAL))
Expand Down