mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +01:00
Allow collaring foxes. Migrate collars to new attack chain. (#32188)
* Allow collaring foxes. Migrate collars to new attack chain. * Apply suggestions from CRUNCH review Co-authored-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com> Signed-off-by: Alan <alfalfascout@users.noreply.github.com> --------- Signed-off-by: Alan <alfalfascout@users.noreply.github.com> Co-authored-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com>
This commit is contained in:
@@ -6,24 +6,28 @@
|
||||
var/original_name
|
||||
var/original_real_name
|
||||
var/obj/item/card/id/access_id
|
||||
new_attack_chain = TRUE
|
||||
|
||||
/obj/item/petcollar/Destroy()
|
||||
QDEL_NULL(access_id)
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
return ..()
|
||||
|
||||
/obj/item/petcollar/attack_self__legacy__attackchain(mob/user)
|
||||
/obj/item/petcollar/activate_self(mob/user)
|
||||
if(..())
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
var/option = "Change Name"
|
||||
if(access_id)
|
||||
option = tgui_input_list(user, "What do you want to do?", "[src]", list("Change Name", "Remove ID"))
|
||||
if(QDELETED(src) || !Adjacent(user))
|
||||
return
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
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]"
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
if("Remove ID")
|
||||
if(access_id)
|
||||
user.visible_message(SPAN_WARNING("[user] starts unclipping [access_id] from [src]."))
|
||||
@@ -32,17 +36,19 @@
|
||||
access_id.forceMove(get_turf(user))
|
||||
user.put_in_hands(access_id)
|
||||
access_id = null
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
/obj/item/petcollar/attackby__legacy__attackchain(obj/item/card/id/W, mob/user, params)
|
||||
if(!istype(W))
|
||||
/obj/item/petcollar/item_interaction(mob/living/user, obj/item/card/id/tool, list/modifiers)
|
||||
if(!istype(tool))
|
||||
return ..()
|
||||
if(access_id)
|
||||
to_chat(user, SPAN_WARNING("There is already \a [access_id] clipped onto [src]."))
|
||||
return ..()
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
user.drop_item()
|
||||
W.forceMove(src)
|
||||
access_id = W
|
||||
to_chat(user, SPAN_NOTICE("[W] clips onto [src] snugly."))
|
||||
tool.forceMove(src)
|
||||
access_id = tool
|
||||
to_chat(user, SPAN_NOTICE("[tool] clips onto [src] snugly."))
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
/obj/item/petcollar/GetAccess()
|
||||
return access_id ? access_id.GetAccess() : ..()
|
||||
|
||||
Reference in New Issue
Block a user