Files
Paradise/code/game/objects/items/misc.dm
Henri215 dfb85e6460 Preparing for the summer: baseball and dodgeballs! (#19627)
* welcome to the space jam

* Apply suggestions from code review

Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>

* review suggestions

* conflict solve mistake

* Apply suggestions from code review

Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com>

* Update code/game/objects/items/sport.dm

Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com>

* wear suit check

Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>
Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com>
2022-11-25 22:50:17 -06:00

89 lines
3.0 KiB
Plaintext

//MISC items
//These items don't belong anywhere else, so they have this file.
//Current contents:
/*
mouse_drag_pointer
Beach Ball
petcollar
*/
/obj/item/mouse_drag_pointer = MOUSE_ACTIVE_POINTER
/obj/item/petcollar
name = "pet collar"
desc = "The latest fashion accessory for your favorite pets!"
icon_state = "petcollar"
item_color = "petcollar"
var/tagname = null
var/obj/item/card/id/access_id
/obj/item/petcollar/Destroy()
QDEL_NULL(access_id)
STOP_PROCESSING(SSobj, src)
return ..()
/obj/item/petcollar/attack_self(mob/user)
var/option = "Change Name"
if(access_id)
option = input(user, "What do you want to do?", "[src]", option) as null|anything in list("Change Name", "Remove ID")
if(QDELETED(src) || !Adjacent(user))
return
switch(option)
if("Change Name")
var/petname = input(user, "Would you like to change the name on the tag?", "Name your new pet", tagname ? tagname : "Spot") as null|text
if(petname && !QDELETED(src) && Adjacent(user))
tagname = copytext(sanitize(petname), 1, MAX_NAME_LEN)
name = "[initial(name)] - [tagname]"
if("Remove ID")
if(access_id)
user.visible_message("<span class='warning'>[user] starts unclipping [access_id] from [src].</span>")
if(do_after(user, 5 SECONDS, target = user) && access_id && !QDELETED(src) && Adjacent(user))
user.visible_message("<span class='warning'>[user] unclips [access_id] from [src].</span>")
access_id.forceMove(get_turf(user))
user.put_in_hands(access_id)
access_id = null
/obj/item/petcollar/attackby(obj/item/card/id/W, mob/user, params)
if(!istype(W))
return ..()
if(access_id)
to_chat(user, "<span class='warning'>There is already \a [access_id] clipped onto [src].</span>")
return ..()
user.drop_item()
W.forceMove(src)
access_id = W
to_chat(user, "<span class='notice'>[W] clips onto [src] snugly.</span>")
/obj/item/petcollar/GetAccess()
return access_id ? access_id.GetAccess() : ..()
/obj/item/petcollar/examine(mob/user)
. = ..()
if(access_id)
. += "There is [bicon(access_id)] \a [access_id] clipped onto it."
/obj/item/petcollar/equipped(mob/living/simple_animal/user)
if(istype(user))
START_PROCESSING(SSobj, src)
/obj/item/petcollar/dropped(mob/living/simple_animal/user)
..()
STOP_PROCESSING(SSobj, src)
/obj/item/petcollar/process()
var/mob/living/simple_animal/M = loc
// if it wasn't intentionally unequipped but isn't being worn, possibly gibbed
if(istype(M) && src == M.pcollar && M.stat != DEAD)
return
var/area/pet_death_area = get_area(M)
var/obj/item/radio/headset/pet_death_announcer = new /obj/item/radio/headset(src)
if(istype(pet_death_area, /area/syndicate_mothership) || istype(pet_death_area, /area/shuttle/syndicate_elite))
//give the syndicats a bit of stealth
pet_death_announcer.autosay("[M] has been vandalized in Space!", "[M]'s Death Alarm")
else
pet_death_announcer.autosay("[M] has been vandalized in [pet_death_area.name]!", "[M]'s Death Alarm")
qdel(pet_death_announcer)
STOP_PROCESSING(SSobj, src)