Skip to content

Commit

Permalink
Medal pinning fixup + new medical/engi medals (#2108)
Browse files Browse the repository at this point in the history
* Re-adds medal code I accidentally removed (#76992)

## About The Pull Request

In
tgstation/tgstation@79c57e3
, I snapped all of the medal awarding code out of existence, as I
thought I moved it all over to attach, which I did

But I forgot to move the... rest of it over. The attacking part. Very
foolish of me.

I re-added it into pre-attack, gave accessories `nobludgeon`, and
generally cleaned it up a bit.

## Why It's Good For The Game

Accidentally removing code is bad

## Changelog

:cl: Melbert
fix: Once again you can award people medals. 
/:cl:

* The Medal Epilogue: Engineering (And Medical) Now Gets Them Too (#78461)

## About The Pull Request

**Credits to @CoiledLamb for the awesome sprites in this PR!**

CE 🤝 CMO

Finally, the last department to receive their own medal box, the
engineering department. The saga is complete, we can go home now.

Adds two types of medals: 1. For assisting the station in a crisis, the
"emergency services award" 2. For showing your atmospheric prowess with
a project, the "atmospheric mastery award"

To me, those two awards symbolize the best engineering (and medical) has
to offer. On the one hand, assisting the station and its crew in a
calamity, and on the other hand just absolutely flexing your atmos
knowledge on your boss.

CEs now have a lockbox in their locker with 3 emergency service medals
and 1 atmospheric mastery medal, and CMOs get 3 emergency services
medals in their lockbox.

3 emergency service medals may seem like a lot, but remember that
assisting the station is often done in a team and not alone. An
engineering/medical department who can work together in a crisis really
demonstrates how robust they are.

As for the atmos mastery medal, well...
### THERE CAN ONLY BE ONE !

<details>
<summary>Pictures</summary>


![image](https://github.com/tgstation/tgstation/assets/47710522/d3237b6a-df4e-44f6-90e0-4eed3202b351)
Upper row: emergency services award, engineering
Middle row: atmospheric mastery award
Lower row: emergency services award, medical


![image](https://github.com/tgstation/tgstation/assets/47710522/27543c0e-e77b-46ec-8c79-3f56c0940271)

![image](https://github.com/tgstation/tgstation/assets/47710522/7b3c0a6c-2c47-4e0f-af3f-b9d0037c19d4)

![image](https://github.com/tgstation/tgstation/assets/47710522/ae5bbeb3-42af-4b52-ae02-aa48480c8fd5)

Sprites without funky byond scaling


![image](https://github.com/tgstation/tgstation/assets/47710522/eab183dd-18c5-4e21-ad83-ee4bed7733b6)

![image](https://github.com/tgstation/tgstation/assets/47710522/66a85894-8163-40e7-bc91-b5c27e75b943)

</details>

## Why It's Good For The Game

medals are cute and awesome, i think you can agree
## Changelog
:cl: distributivgesetz, CoiledLamb
add: Added two new awards specifically for engineering and medical: The
"Emergency Services Award" and the "Atmospheric Mastery Award". CEs get
3 Emergency Services Awards and 1 Atmospheric Mastery Award and CMOs get
3 Emergency Services Awards.
/:cl:

---------

Co-authored-by: MrMelbert <[email protected]>
Co-authored-by: distributivgesetz <[email protected]>
  • Loading branch information
3 people authored Jun 7, 2024
1 parent d9299bf commit af805ae
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 39 deletions.
12 changes: 12 additions & 0 deletions code/game/objects/items/storage/lockbox.dm
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@
/obj/item/storage/lockbox/medal/med/PopulateContents()
new /obj/item/clothing/accessory/medal/med_medal(src)
new /obj/item/clothing/accessory/medal/med_medal2(src)
for(var/i in 1 to 3)
new /obj/item/clothing/accessory/medal/silver/emergency_services/medical(src)

/obj/item/storage/lockbox/medal/sec/PopulateContents()
for(var/i in 1 to 3)
Expand Down Expand Up @@ -217,6 +219,16 @@
for(var/i in 1 to 3)
new /obj/item/clothing/accessory/medal/plasma/nobel_science(src)

/obj/item/storage/lockbox/medal/engineering
name = "engineering medal box"
desc = "A locked box used to store awards to be given to members of the engineering department."
req_access = list(ACCESS_CE)

/obj/item/storage/lockbox/medal/engineering/PopulateContents()
for(var/i in 1 to 3)
new /obj/item/clothing/accessory/medal/silver/emergency_services/engineering(src)
new /obj/item/clothing/accessory/medal/silver/elder_atmosian(src)

/obj/item/storage/lockbox/order
name = "order lockbox"
desc = "A box used to secure small cargo orders from being looted by those who didn't order it. Yeah, cargo tech, that means you."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
new /obj/item/holosign_creator/atmos(src)
new /obj/item/assembly/flash/handheld(src)
new /obj/item/door_remote/chief_engineer(src)

new /obj/item/storage/lockbox/medal/engineering(src)
new /obj/item/circuitboard/machine/techfab/department/engineering(src)
new /obj/item/extinguisher/advanced(src)
new /obj/item/storage/photo_album/ce(src)
Expand Down
5 changes: 0 additions & 5 deletions code/modules/clothing/under/_under.dm
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,6 @@
/obj/item/clothing/under/proc/attach_accessory(obj/item/clothing/accessory/accessory, mob/living/user, attach_message = TRUE)
if(!istype(accessory))
return
if(length(attached_accessories) >= max_number_of_accessories)
if(user)
balloon_alert(user, "too many accessories!")
return

if(!accessory.can_attach_accessory(src, user))
return
if(user && !user.temporarilyRemoveItemFromInventory(accessory))
Expand Down
6 changes: 6 additions & 0 deletions code/modules/clothing/under/accessories/_accessories.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
inhand_icon_state = "" //no inhands
slot_flags = NONE
w_class = WEIGHT_CLASS_SMALL
item_flags = NOBLUDGEON
/// Whether or not the accessory displays through suits and the like.
var/above_suit = TRUE
/// TRUE if shown as a small icon in corner, FALSE if overlayed
Expand Down Expand Up @@ -46,6 +47,11 @@
attach_to.balloon_alert(user, "can't attach there!")
return FALSE

if(length(attach_to.attached_accessories) >= attach_to.max_number_of_accessories)
if(user)
attach_to.balloon_alert(user, "too many accessories!")
return FALSE

return TRUE

/**
Expand Down
132 changes: 99 additions & 33 deletions code/modules/clothing/under/accessories/medals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,48 +7,88 @@
/// Sprite used for medalbox
var/medaltype = "medal"
/// Has this been use for a commendation?
var/commended = FALSE

// If someone adds SHOULD_NOT_SLEEP anywhere up the chain, this will need to be reworked
/obj/item/clothing/accessory/medal/attach(obj/item/clothing/under/attach_to, mob/living/attacher)
if(isnull(attacher))
// Do normal attach
return ..()

var/mob/living/distinguished = attach_to.loc
if(!istype(distinguished) || distinguished == attacher)
// Do normal attach
return ..()
var/commendation_message
/// Who was first given this medal
var/awarded_to
/// Who gave out this medal
var/awarder

/// Callback for do_after to check if we can still be pinned
/obj/item/clothing/accessory/medal/proc/pin_checks(mob/living/pinner, mob/living/carbon/human/pinning_on)
if(QDELETED(src) || QDELETED(pinner) || QDELETED(pinning_on))
return FALSE
if(!pinner.is_holding(src) || !pinner.Adjacent(pinning_on))
return FALSE
var/obj/item/clothing/under/pinning_on_uniform = pinning_on.w_uniform
if(!istype(pinning_on_uniform) || !can_attach_accessory(pinning_on_uniform, pinner))
return FALSE
return TRUE

// Do a do_after before we attach, and allow us to include a commendation message.
attacher.visible_message(
span_notice("[attacher] is trying to pin [src] on [distinguished]'s chest."),
/obj/item/clothing/accessory/medal/pre_attack(atom/target, mob/living/user, params)
. = ..()
if(.)
return
if(!ishuman(target) || target == user)
return

. = TRUE // no attack chain please

var/mob/living/carbon/human/distinguished = target
var/obj/item/clothing/under/distinguished_uniform = distinguished.w_uniform
if(!istype(distinguished_uniform))
distinguished.balloon_alert(user, "no uniform to pin on!")
return .
if(!can_attach_accessory(distinguished_uniform, user))
// Check handles feedback messages and etc
return .

user.visible_message(
span_notice("[user] tries to pin [src] on [distinguished]'s chest."),
span_notice("You try to pin [src] on [distinguished]'s chest."),
)

var/input
if(!commended)
input = tgui_input_text(attacher, "Reason for this commendation? It will be recorded by Nanotrasen.", "Commendation", max_length = 140)
commendation_message = tgui_input_text(user, "Reason for this commendation? It will be recorded by Nanotrasen.", "Commendation", max_length = 140)
if(!commendation_message || !pin_checks(user, distinguished))
return .
if(!do_after(user, 2 SECONDS, distinguished, extra_checks = CALLBACK(src, PROC_REF(pin_checks), user, distinguished)))
return .

if(distinguished_uniform.attach_accessory(src, user))
user.visible_message(
span_notice("[user] pins [src] on [distinguished]'s chest."),
span_notice("You pin [src] on [distinguished]'s chest."),
)
else
user.visible_message(
span_warning("[user] fails to pin [src] on [distinguished]'s chest, seemingly unable to part with it."),
span_warning("You fail to pin [src] on [distinguished]'s chest."),
)

return .

if(!do_after(attacher, 2 SECONDS, distinguished))
return FALSE
/obj/item/clothing/accessory/medal/attach(obj/item/clothing/under/attach_to, mob/living/attacher)
var/mob/living/distinguished = attach_to.loc
if(isnull(attacher) || !istype(distinguished) || distinguished == attacher || awarded_to)
// You can't be awarded by nothing, you can't award yourself, and you can't be awarded someone else's medal
return ..()

attacher.visible_message(
span_notice("[attacher] pins [src] on [distinguished]'s chest."),
span_notice("You pin [src] on [distinguished]'s chest."),
)
if(!input)
return FALSE
awarder = attacher.real_name
awarded_to = distinguished.real_name

update_appearance(UPDATE_DESC)
add_memory_in_range(distinguished, 7, /datum/memory/received_medal, protagonist = distinguished, deuteragonist = attacher, medal_type = src, medal_text = commendation_message)
distinguished.log_message("was given the following commendation by <b>[key_name(attacher)]</b>: [commendation_message]", LOG_GAME, color = "green")
message_admins("<b>[key_name_admin(distinguished)]</b> was given the following commendation by <b>[key_name_admin(attacher)]</b>: [commendation_message]")
GLOB.commendations += "[awarder] awarded <b>[awarded_to]</b> the <span class='medaltext'>[name]</span>! \n- [commendation_message]"
SSblackbox.record_feedback("associative", "commendation", 1, list("commender" = "[awarder]", "commendee" = "[awarded_to]", "medal" = "[src]", "reason" = commendation_message))

commended = TRUE
SSblackbox.record_feedback("associative", "commendation", 1, list("commender" = "[attacher.real_name]", "commendee" = "[distinguished.real_name]", "medal" = "[src]", "reason" = input))
GLOB.commendations += "[attacher.real_name] awarded <b>[distinguished.real_name]</b> the <span class='medaltext'>[name]</span>! \n- [input]"
desc += "<br>The inscription reads: [input] - [attacher.real_name]"
distinguished.log_message("was given the following commendation by <b>[key_name(attacher)]</b>: [input]", LOG_GAME, color = "green")
message_admins("<b>[key_name_admin(distinguished)]</b> was given the following commendation by <b>[key_name_admin(attacher)]</b>: [input]")
add_memory_in_range(distinguished, 7, /datum/memory/received_medal, protagonist = distinguished, deuteragonist = attacher, medal_type = src, medal_text = input)
return ..()

/obj/item/clothing/accessory/medal/update_desc(updates)
. = ..()
if(commendation_message && awarded_to && awarder)
desc += span_info("<br>The inscription reads: [commendation_message] - Awarded to [awarded_to] by [awarder]")

/obj/item/clothing/accessory/medal/conduct
name = "distinguished conduct medal"
desc = "A bronze medal awarded for distinguished conduct. Whilst a great honor, this is the most basic award given by Nanotrasen. It is often awarded by a captain to a member of his crew."
Expand Down Expand Up @@ -138,3 +178,29 @@
/obj/item/clothing/accessory/medal/plasma/nobel_science
name = "nobel sciences award"
desc = "A plasma medal which represents significant contributions to the field of science or engineering."

/obj/item/clothing/accessory/medal/silver/emergency_services
name = "emergency services award"
desc = "A silver medal awarded to the outstanding emergency service workers of Nanotrasen, those who work tirelessly together through adversity to keep their crew safe and breathing in the harsh environments of outer space."
icon_state = "emergencyservices"

/// Flavor text that is appended to the description.
var/insignia_desc = null

/obj/item/clothing/accessory/medal/silver/emergency_services/Initialize(mapload)
. = ..()
if(istext(insignia_desc))
desc += " [insignia_desc]"

/obj/item/clothing/accessory/medal/silver/emergency_services/engineering
icon_state = "emergencyservices_engi"
insignia_desc = "The back of the medal bears an orange wrench."

/obj/item/clothing/accessory/medal/silver/emergency_services/medical
icon_state = "emergencyservices_med"
insignia_desc = "The back of the medal bears a dark blue cross."

/obj/item/clothing/accessory/medal/silver/elder_atmosian
name = "atmospheric mastery award"
desc = "Often referred to as the \"elder atmosian\" award, this medal is awarded to the exemplary scientists and technicians who push the boundaries and demonstrate mastery of atmospherics."
icon_state = "elderatmosian"
Binary file modified icons/mob/clothing/accessories.dmi
Binary file not shown.
Binary file modified icons/obj/clothing/accessories.dmi
Binary file not shown.

0 comments on commit af805ae

Please sign in to comment.