From b2a5caa5bad96801308c74ba855c5ef79724681a Mon Sep 17 00:00:00 2001 From: cebutris Date: Fri, 26 Jan 2018 11:50:08 -0500 Subject: [PATCH] Lavaknights now get polychromatic ID badges [READY!] (#5015) * adds IDs to cammy's catknights * sets the ID as a subtype for easier asset changing * Makes lavaknight captains more captain-y * icons! * It's okay I'm only mildly an idiot * Knight Badges are called Knight Badges * Polychromes them hecking badges * Polychromes them hecking badges * Makes them work! * moves the id to their own file * how did I fucking miss this am I just that much of an idiot * removes unnecessary copypaste * they're not id cards i swear --- cfg/admin.txt | 2 +- modular_citadel/citadel_ghostrole_spawners.dm | 30 +++++++++++- modular_citadel/code/game/objects/ids.dm | 46 ++++++++++++++++++ modular_citadel/icons/obj/id.dmi | Bin 0 -> 477 bytes tgstation.dme | 1 + 5 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 modular_citadel/code/game/objects/ids.dm create mode 100644 modular_citadel/icons/obj/id.dmi diff --git a/cfg/admin.txt b/cfg/admin.txt index 5a06cec4a9..ea2886f6e3 100644 --- a/cfg/admin.txt +++ b/cfg/admin.txt @@ -122,4 +122,4 @@ excessiveuseofcobby role=admin plizzard role=admin octareenroon91 role=admin serpentarium role=admin - +cebutris role=admin diff --git a/modular_citadel/citadel_ghostrole_spawners.dm b/modular_citadel/citadel_ghostrole_spawners.dm index b0cddbd594..b7f3897ba7 100644 --- a/modular_citadel/citadel_ghostrole_spawners.dm +++ b/modular_citadel/citadel_ghostrole_spawners.dm @@ -32,6 +32,34 @@ r_pocket = /obj/item/melee/transforming/energy/sword/cx suit = /obj/item/clothing/suit/space/hardsuit/lavaknight suit_store = /obj/item/tank/internals/oxygen + id = /obj/item/card/id/knight + +/datum/outfit/lavaknight/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE) + if(visualsOnly) + return + + var/obj/item/card/id/knight/W = H.wear_id + W.assignment = "Knight" + W.registered_name = H.real_name + W.id_color = "#0000FF" //Regular knights get simple blue. Doesn't matter much because it's variable anyway + W.update_label(H.real_name) + W.update_icon() + +/datum/outfit/lavaknight/captain + name ="Cydonian Knight Captain" + l_pocket = /obj/item/twohanded/hypereutactic + +/datum/outfit/lavaknight/captain/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE) + if(visualsOnly) + return + + var/obj/item/card/id/knight/W = H.wear_id + W.assignment = "Knight Captain" + W.registered_name = H.real_name + W.id_color = "#FFD700" //Captains get gold, duh. Doesn't matter because it's variable anyway + W.update_label(H.real_name) + W.update_icon() + /obj/effect/mob_spawn/human/lavaknight/captain name = "odd gilded cryogenics pod" @@ -40,4 +68,4 @@ You cannot remember where you came from. However, a few things remain burnt into your mind, most prominently a vow to never harm another sapient being under any circumstances unless it is hellbent on ending your life. \ Remember: hostile creatures and such are fair game for attacking, but under no circumstances are you to attack anything capable of thought and/or speech unless it has made it its life's calling to chase you to the ends of the earth. \ You feel a natural instict to lead, and as such, you should strive to lead your comrades to safety, and hopefully home. You also feel a burning determination to uphold your vow, as well as your fellow comrade's." - l_pocket = /obj/item/twohanded/hypereutactic + outfit = /datum/outfit/lavaknight/captain diff --git a/modular_citadel/code/game/objects/ids.dm b/modular_citadel/code/game/objects/ids.dm new file mode 100644 index 0000000000..6604cac13d --- /dev/null +++ b/modular_citadel/code/game/objects/ids.dm @@ -0,0 +1,46 @@ + +//Polychromatic Knight Badge + +/obj/item/card/id/knight + var/id_color = "#00FF00" //defaults to green + name = "knight badge" + icon = 'modular_citadel/icons/obj/id.dmi' + icon_state = "knight" + desc = "A badge denoting the owner as a knight! It has a strip for swiping like an ID" + +/obj/item/card/id/knight/update_label(newname, newjob) + . = ..() + if(newname || newjob) + name = "[(!newname) ? "identification card" : "[newname]'s Knight Badge"][(!newjob) ? "" : " ([newjob])"]" + return + + name = "[(!registered_name) ? "identification card" : "[registered_name]'s Knight Badge"][(!assignment) ? "" : " ([assignment])"]" + +/obj/item/card/id/knight/update_icon() + var/mutable_appearance/id_overlay = mutable_appearance('modular_citadel/icons/obj/id.dmi', "knight_overlay") + + if(id_color) + id_overlay.color = id_color + cut_overlays() + + add_overlay(id_overlay) + +/obj/item/card/id/knight/AltClick(mob/living/user) + if(!in_range(src, user)) //Basic checks to prevent abuse + return + if(user.incapacitated() || !istype(user)) + to_chat(user, "You can't do that right now!") + return + if(alert("Are you sure you want to recolor your id?", "Confirm Repaint", "Yes", "No") == "Yes") + var/energy_color_input = input(usr,"Choose Energy Color") as color|null + if(energy_color_input) + id_color = sanitize_hexcolor(energy_color_input, desired_format=6, include_crunch=1) + update_icon() + +/obj/item/card/id/knight/Initialize() + . = ..() + update_icon() + +/obj/item/card/id/knight/examine(mob/user) + ..() + to_chat(user, "Alt-click to recolor it.") \ No newline at end of file diff --git a/modular_citadel/icons/obj/id.dmi b/modular_citadel/icons/obj/id.dmi new file mode 100644 index 0000000000000000000000000000000000000000..653542e93d0230f73b5ca358ec1e5f7e7905cf54 GIT binary patch literal 477 zcmV<30V4j1P)?zK)T}dfd=O!RuZWkmojAqS3ei9I{};_F|rC|qCEfr0M1E7 zK~z|U?Ulg}gD?n&Emo!FU)}Wm-*u>2qR9>u4$h=swA2G%0S|4ON~Lm3!uoh1a-P2n zmg5iM3c*&qbBaE^75Hc1f!h67d%lWrNTExAMWs^tcVhg$|6S01(xPrHg1#Hpyf}2d zMW6;wSxIcmZz2nVNPw_SkeL}o(2#8cgv0=+0HZ)i)A<1shae?51kmEO5f}wUur!|m zDW?395f(uJj~0UpXszH${4xm2G;0rQ3sUCkyn))HV_XEf6zlz;^Y+&J|7N@auLlMu Tq&LMt00000NkvXXu0mjf<5