Makes the pet collar not an accessory. Remake remake of the revert of the revert. (#19644)

* let's try this again

* who even named these variables

* Sirryan review

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

* removes as mob

Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com>
Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com>
This commit is contained in:
Coolrune206
2022-11-18 03:31:51 +10:00
committed by GitHub
parent 7dcd31990e
commit cbdbf60f57
10 changed files with 90 additions and 87 deletions
+4 -4
View File
@@ -1180,14 +1180,14 @@ GLOBAL_LIST_INIT(all_supply_groups, list(SUPPLY_EMERGENCY,SUPPLY_SECURITY,SUPPLY
name = "Corgi Crate"
cost = 50
containertype = /obj/structure/closet/critter/corgi
contains = list(/obj/item/clothing/accessory/petcollar)
contains = list(/obj/item/petcollar)
containername = "corgi crate"
/datum/supply_packs/organic/cat
name = "Cat Crate"
cost = 50 //Cats are worth as much as corgis.
containertype = /obj/structure/closet/critter/cat
contains = list(/obj/item/clothing/accessory/petcollar,
contains = list(/obj/item/petcollar,
/obj/item/toy/cattoy)
containername = "cat crate"
@@ -1195,14 +1195,14 @@ GLOBAL_LIST_INIT(all_supply_groups, list(SUPPLY_EMERGENCY,SUPPLY_SECURITY,SUPPLY
name = "Pug Crate"
cost = 50
containertype = /obj/structure/closet/critter/pug
contains = list(/obj/item/clothing/accessory/petcollar)
contains = list(/obj/item/petcollar)
containername = "pug crate"
/datum/supply_packs/organic/fox
name = "Fox Crate"
cost = 55 //Foxes are cool.
containertype = /obj/structure/closet/critter/fox
contains = list(/obj/item/clothing/accessory/petcollar)
contains = list(/obj/item/petcollar)
containername = "fox crate"
/datum/supply_packs/organic/butterfly
+2 -2
View File
@@ -1878,12 +1878,12 @@
icon_state = "crittercare"
icon_lightmask = "crittercare"
icon_panel = "drobe"
products = list(/obj/item/clothing/accessory/petcollar = 5, /obj/item/storage/firstaid/aquatic_kit/full =5, /obj/item/fish_eggs/goldfish = 5,
products = list(/obj/item/petcollar = 5, /obj/item/storage/firstaid/aquatic_kit/full = 5, /obj/item/fish_eggs/goldfish = 5,
/obj/item/fish_eggs/clownfish = 5, /obj/item/fish_eggs/shark = 5, /obj/item/fish_eggs/feederfish = 10,
/obj/item/fish_eggs/salmon = 5, /obj/item/fish_eggs/catfish = 5, /obj/item/fish_eggs/glofish = 5,
/obj/item/fish_eggs/electric_eel = 5, /obj/item/fish_eggs/shrimp = 10, /obj/item/toy/pet_rock = 5,
)
prices = list(/obj/item/clothing/accessory/petcollar = 50, /obj/item/storage/firstaid/aquatic_kit/full = 60, /obj/item/fish_eggs/goldfish = 10,
prices = list(/obj/item/petcollar = 50, /obj/item/storage/firstaid/aquatic_kit/full = 60, /obj/item/fish_eggs/goldfish = 10,
/obj/item/fish_eggs/clownfish = 10, /obj/item/fish_eggs/shark = 10, /obj/item/fish_eggs/feederfish = 5,
/obj/item/fish_eggs/salmon = 10, /obj/item/fish_eggs/catfish = 10, /obj/item/fish_eggs/glofish = 10,
/obj/item/fish_eggs/electric_eel = 10, /obj/item/fish_eggs/shrimp = 5, /obj/item/toy/pet_rock = 100,
+78
View File
@@ -5,6 +5,7 @@
/*
mouse_drag_pointer
Beach Ball
petcollar
*/
/obj/item/mouse_drag_pointer = MOUSE_ACTIVE_POINTER
@@ -22,3 +23,80 @@
throw_speed = 1
throw_range = 20
flags = CONDUCT
/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)
+1 -1
View File
@@ -1953,7 +1953,7 @@
P.universal_understand = TRUE
P.can_collar = TRUE
P.faction = list("neutral")
var/obj/item/clothing/accessory/petcollar/C = new
var/obj/item/petcollar/C = new
P.add_collar(C)
var/obj/item/card/id/I = H.wear_id
if(I)
@@ -662,81 +662,6 @@
item_state = "corset_blue"
item_color = "corset_blue"
/obj/item/clothing/accessory/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/clothing/accessory/petcollar/Destroy()
QDEL_NULL(access_id)
STOP_PROCESSING(SSobj, src)
return ..()
/obj/item/clothing/accessory/petcollar/attack_self(mob/user as mob)
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")
switch(option)
if("Change Name")
var/t = input(user, "Would you like to change the name on the tag?", "Name your new pet", tagname ? tagname : "Spot") as null|text
if(t)
tagname = copytext(sanitize(t), 1, MAX_NAME_LEN)
name = "[initial(name)] - [tagname]"
if("Remove ID")
if(access_id)
user.visible_message("<span class='warning'>[user] starts unclipping \the [access_id] from \the [src].</span>")
if(do_after(user, 50, target = user) && access_id)
user.visible_message("<span class='warning'>[user] unclips \the [access_id] from \the [src].</span>")
access_id.forceMove(get_turf(user))
user.put_in_hands(access_id)
access_id = null
/obj/item/clothing/accessory/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 \the [src]</span>")
user.drop_item()
W.forceMove(src)
access_id = W
to_chat(user, "<span class='notice'>\The [W] clips onto \the [src] snugly.</span>")
/obj/item/clothing/accessory/petcollar/GetAccess()
return access_id ? access_id.GetAccess() : ..()
/obj/item/clothing/accessory/petcollar/examine(mob/user)
. = ..()
if(access_id)
. += "There is [bicon(access_id)] \a [access_id] clipped onto it."
/obj/item/clothing/accessory/petcollar/equipped(mob/living/simple_animal/user)
if(istype(user))
START_PROCESSING(SSobj, src)
/obj/item/clothing/accessory/petcollar/dropped(mob/living/simple_animal/user)
..()
STOP_PROCESSING(SSobj, src)
/obj/item/clothing/accessory/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/t = get_area(M)
var/obj/item/radio/headset/a = new /obj/item/radio/headset(src)
if(istype(t, /area/syndicate_mothership) || istype(t, /area/shuttle/syndicate_elite))
//give the syndicats a bit of stealth
a.autosay("[M] has been vandalized in Space!", "[M]'s Death Alarm")
else
a.autosay("[M] has been vandalized in [t.name]!", "[M]'s Death Alarm")
qdel(a)
STOP_PROCESSING(SSobj, src)
/proc/english_accessory_list(obj/item/clothing/under/U)
if(!istype(U) || !U.accessories.len)
return
+1 -1
View File
@@ -72,7 +72,7 @@
if(61 to 62)
for(var/i in 1 to 5)
new /obj/item/clothing/head/kitty(src)
new /obj/item/clothing/accessory/petcollar(src)
new /obj/item/petcollar(src)
if(63 to 64)
for(var/i in 1 to rand(4, 7))
var/newcoin = pick(/obj/item/coin/silver, /obj/item/coin/silver, /obj/item/coin/silver, /obj/item/coin/iron, /obj/item/coin/iron, /obj/item/coin/iron, /obj/item/coin/gold, /obj/item/coin/diamond, /obj/item/coin/plasma, /obj/item/coin/uranium)
@@ -1,5 +1,5 @@
/mob/living/simple_animal/attackby(obj/item/O, mob/living/user)
if(can_collar && istype(O, /obj/item/clothing/accessory/petcollar) && !pcollar)
if(can_collar && istype(O, /obj/item/petcollar) && !pcollar)
add_collar(O, user)
return
else
@@ -72,7 +72,7 @@
/// Allows a mob to pass unbolted doors while hidden
var/pass_door_while_hidden = FALSE
var/obj/item/clothing/accessory/petcollar/pcollar = null
var/obj/item/petcollar/pcollar = null
var/collar_type //if the mob has collar sprites, define them.
var/unique_pet = FALSE // if the mob can be renamed
var/can_collar = FALSE // can add collar to mob or not
@@ -499,7 +499,7 @@
return FALSE
if(!can_collar)
return FALSE
if(!istype(I, /obj/item/clothing/accessory/petcollar))
if(!istype(I, /obj/item/petcollar))
return FALSE
return TRUE
@@ -608,7 +608,7 @@
SSidlenpcpool.idle_mobs_by_zlevel[old_z] -= src
toggle_ai(initial(AIStatus))
/mob/living/simple_animal/proc/add_collar(obj/item/clothing/accessory/petcollar/P, mob/user)
/mob/living/simple_animal/proc/add_collar(obj/item/petcollar/P, mob/user)
if(!istype(P) || QDELETED(P) || pcollar)
return
if(user && !user.unEquip(P))
Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 153 KiB

After

Width:  |  Height:  |  Size: 146 KiB