Merge pull request #9603 from Ghommie/Ghommie-cit267
Unmodularize lavaknights and emags.
This commit is contained in:
@@ -80,6 +80,7 @@
|
||||
righthand_file = 'icons/mob/inhands/equipment/idcards_righthand.dmi'
|
||||
item_flags = NO_MAT_REDEMPTION | NOBLUDGEON
|
||||
var/prox_check = TRUE //If the emag requires you to be in range
|
||||
var/uses = 15
|
||||
|
||||
/obj/item/card/emag/bluespace
|
||||
name = "bluespace cryptographic sequencer"
|
||||
@@ -110,6 +111,37 @@
|
||||
user.visible_message("<span class='warning'>[src] fizzles and sparks. It seems like it's out of charges.</span>")
|
||||
playsound(src, 'sound/effects/light_flicker.ogg', 100, 1)
|
||||
|
||||
/obj/item/card/emag/examine(mob/user)
|
||||
. = ..()
|
||||
to_chat(user, "<span class='notice'>It has <b>[uses ? uses : "no"]</b> charges left.</span>")
|
||||
|
||||
/obj/item/card/emag/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/emagrecharge))
|
||||
var/obj/item/emagrecharge/ER = W
|
||||
if(ER.uses)
|
||||
uses += ER.uses
|
||||
to_chat(user, "<span class='notice'>You have added [ER.uses] charges to [src]. It now has [uses] charges.</span>")
|
||||
playsound(src, "sparks", 100, 1)
|
||||
ER.uses = 0
|
||||
else
|
||||
to_chat(user, "<span class='warning'>[ER] has no charges left.</span>")
|
||||
return
|
||||
. = ..()
|
||||
|
||||
/obj/item/emagrecharge
|
||||
name = "electromagnet charging device"
|
||||
desc = "A small cell with two prongs lazily jabbed into it. It looks like it's made for charging the small batteries found in electromagnetic devices, sadly this can't be recharged like a normal cell."
|
||||
icon = 'icons/obj/module.dmi'
|
||||
icon_state = "cell_mini"
|
||||
item_flags = NOBLUDGEON
|
||||
var/uses = 5 //Dictates how many charges the device adds to compatible items
|
||||
|
||||
/obj/item/emagrecharge/examine(mob/user)
|
||||
. = ..()
|
||||
if(uses)
|
||||
to_chat(user, "<span class='notice'>It can add up to [uses] charges to compatible devices</span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>It has a small, red, blinking light coming from inside of it. It's spent.</span>")
|
||||
|
||||
/obj/item/card/emagfake
|
||||
desc = "It's a card with a magnetic strip attached to some circuitry. Closer inspection shows that this card is a poorly made replica, with a \"DonkCo\" logo stamped on the back."
|
||||
@@ -451,3 +483,58 @@ update_label("John Doe", "Clowny")
|
||||
name = "APC Access ID"
|
||||
desc = "A special ID card that allows access to APC terminals."
|
||||
access = list(ACCESS_ENGINE_EQUIP)
|
||||
|
||||
//Polychromatic Knight Badge
|
||||
|
||||
/obj/item/card/id/knight
|
||||
var/id_color = "#00FF00" //defaults to green
|
||||
name = "knight badge"
|
||||
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) ? "knight badge" : "[newname]'s Knight Badge"][(!newjob) ? "" : " ([newjob])"]"
|
||||
return
|
||||
|
||||
name = "[(!registered_name) ? "knight badge" : "[registered_name]'s Knight Badge"][(!assignment) ? "" : " ([assignment])"]"
|
||||
|
||||
/obj/item/card/id/knight/update_icon()
|
||||
var/mutable_appearance/id_overlay = mutable_appearance(icon, "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, "<span class='warning'>You can't do that right now!</span>")
|
||||
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",id_color) as color|null
|
||||
if(!in_range(src, user) || !energy_color_input)
|
||||
return
|
||||
if(user.incapacitated() || !istype(user))
|
||||
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
|
||||
return
|
||||
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, "<span class='notice'>Alt-click to recolor it.</span>")
|
||||
|
||||
/obj/item/card/id/knight/blue
|
||||
id_color = "#0000FF"
|
||||
|
||||
/obj/item/card/id/knight/captain
|
||||
id_color = "#FFD700"
|
||||
Reference in New Issue
Block a user