mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 20:47:10 +01:00
Merge pull request #3936 from Tastyfish/captain-ian
Improves pet collars
This commit is contained in:
@@ -317,22 +317,27 @@ In all, this is a lot like the monkey code. /N
|
||||
/mob/living/carbon/alien/humanoid/var/temperature_resistance = T0C+75
|
||||
|
||||
/mob/living/carbon/alien/humanoid/show_inv(mob/user as mob)
|
||||
|
||||
user.set_machine(src)
|
||||
var/dat = {"
|
||||
<B><HR><FONT size=3>[name]</FONT></B>
|
||||
<BR><HR>
|
||||
<BR><B>Left Hand:</B> <A href='?src=\ref[src];item=l_hand'>[(l_hand ? text("[]", l_hand) : "Nothing")]</A>
|
||||
<BR><B>Right Hand:</B> <A href='?src=\ref[src];item=r_hand'>[(r_hand ? text("[]", r_hand) : "Nothing")]</A>
|
||||
<BR><B>Head:</B> <A href='?src=\ref[src];item=head'>[(head ? text("[]", head) : "Nothing")]</A>
|
||||
<BR><B>(Exo)Suit:</B> <A href='?src=\ref[src];item=suit'>[(wear_suit ? text("[]", wear_suit) : "Nothing")]</A>
|
||||
<BR><A href='?src=\ref[src];item=pockets'>Empty Pouches</A>
|
||||
<BR><A href='?src=\ref[user];mach_close=mob[name]'>Close</A>
|
||||
<BR>"}
|
||||
user << browse(dat, text("window=mob[name];size=340x480"))
|
||||
onclose(user, "mob[name]")
|
||||
return
|
||||
|
||||
var/dat = {"<table>
|
||||
<tr><td><B>Left Hand:</B></td><td><A href='?src=\ref[src];item=[slot_l_hand]'>[(l_hand && !(l_hand.flags&ABSTRACT)) ? l_hand : "<font color=grey>Empty</font>"]</A></td></tr>
|
||||
<tr><td><B>Right Hand:</B></td><td><A href='?src=\ref[src];item=[slot_r_hand]'>[(r_hand && !(r_hand.flags&ABSTRACT)) ? r_hand : "<font color=grey>Empty</font>"]</A></td></tr>
|
||||
<tr><td> </td></tr>"}
|
||||
|
||||
dat += "<tr><td><B>Head:</B></td><td><A href='?src=\ref[src];item=[slot_head]'>[(head && !(head.flags&ABSTRACT)) ? head : "<font color=grey>Empty</font>"]</A></td></tr>"
|
||||
|
||||
dat += "<tr><td> </td></tr>"
|
||||
|
||||
dat += "<tr><td><B>Exosuit:</B></td><td><A href='?src=\ref[src];item=[slot_wear_suit]'>[(wear_suit && !(wear_suit.flags&ABSTRACT)) ? wear_suit : "<font color=grey>Empty</font>"]</A></td></tr>"
|
||||
dat += "<tr><td><B>Pouches:</B></td><td><A href='?src=\ref[src];item=pockets'>[((l_store && !(l_store.flags&ABSTRACT)) || (r_store && !(r_store.flags&ABSTRACT))) ? "Full" : "<font color=grey>Empty</font>"]</A>"
|
||||
|
||||
dat += {"</table>
|
||||
<A href='?src=\ref[user];mach_close=mob\ref[src]'>Close</A>
|
||||
"}
|
||||
|
||||
var/datum/browser/popup = new(user, "mob\ref[src]", "[src]", 440, 500)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
|
||||
/mob/living/carbon/alien/humanoid/canBeHandcuffed()
|
||||
return 1
|
||||
|
||||
@@ -237,15 +237,6 @@
|
||||
|
||||
|
||||
/mob/living/carbon/alien/larva/show_inv(mob/user as mob)
|
||||
|
||||
user.set_machine(src)
|
||||
var/dat = {"
|
||||
<B><HR><FONT size=3>[name]</FONT></B>
|
||||
<BR><HR><BR>
|
||||
<BR><A href='?src=\ref[user];mach_close=mob[name]'>Close</A>
|
||||
<BR>"}
|
||||
user << browse(dat, text("window=mob[name];size=340x480"))
|
||||
onclose(user, "mob[name]")
|
||||
return
|
||||
|
||||
/* Commented out because it's duplicated in life.dm
|
||||
|
||||
@@ -546,31 +546,34 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
|
||||
|
||||
/mob/living/carbon/show_inv(mob/user)
|
||||
user.set_machine(src)
|
||||
var/dat = {"
|
||||
<HR>
|
||||
<B><FONT size=3>[name]</FONT></B>
|
||||
<HR>
|
||||
<BR><B>Head:</B> <A href='?src=\ref[src];item=[slot_head]'> [(head && !(head.flags&ABSTRACT)) ? head : "Nothing"]</A>
|
||||
<BR><B>Mask:</B> <A href='?src=\ref[src];item=[slot_wear_mask]'> [(wear_mask && !(wear_mask.flags&ABSTRACT)) ? wear_mask : "Nothing"]</A>
|
||||
<BR><B>Left Hand:</B> <A href='?src=\ref[src];item=[slot_l_hand]'> [(l_hand && !(l_hand.flags&ABSTRACT)) ? l_hand : "Nothing"]</A>
|
||||
<BR><B>Right Hand:</B> <A href='?src=\ref[src];item=[slot_r_hand]'> [(r_hand && !(r_hand.flags&ABSTRACT)) ? r_hand : "Nothing"]</A>"}
|
||||
|
||||
dat += "<BR><B>Back:</B> <A href='?src=\ref[src];item=[slot_back]'>[back ? back : "Nothing"]</A>"
|
||||
|
||||
|
||||
var/dat = {"<table>
|
||||
<tr><td><B>Left Hand:</B></td><td><A href='?src=\ref[src];item=[slot_l_hand]'>[(l_hand && !(l_hand.flags&ABSTRACT)) ? l_hand : "<font color=grey>Empty</font>"]</A></td></tr>
|
||||
<tr><td><B>Right Hand:</B></td><td><A href='?src=\ref[src];item=[slot_r_hand]'>[(r_hand && !(r_hand.flags&ABSTRACT)) ? r_hand : "<font color=grey>Empty</font>"]</A></td></tr>
|
||||
<tr><td> </td></tr>"}
|
||||
|
||||
dat += "<tr><td><B>Back:</B></td><td><A href='?src=\ref[src];item=[slot_back]'>[(back && !(back.flags&ABSTRACT)) ? back : "<font color=grey>Empty</font>"]</A>"
|
||||
if(istype(wear_mask, /obj/item/clothing/mask) && istype(back, /obj/item/weapon/tank))
|
||||
dat += "<BR><A href='?src=\ref[src];internal=1'>[internal ? "Disable Internals" : "Set Internals"]</A>"
|
||||
dat += " <A href='?src=\ref[src];internal=[slot_back]'>[internal ? "Disable Internals" : "Set Internals"]</A>"
|
||||
|
||||
dat += "</td></tr><tr><td> </td></tr>"
|
||||
|
||||
dat += "<tr><td><B>Head:</B></td><td><A href='?src=\ref[src];item=[slot_head]'>[(head && !(head.flags&ABSTRACT)) ? head : "<font color=grey>Empty</font>"]</A></td></tr>"
|
||||
|
||||
dat += "<tr><td><B>Mask:</B></td><td><A href='?src=\ref[src];item=[slot_wear_mask]'>[(wear_mask && !(wear_mask.flags&ABSTRACT)) ? wear_mask : "<font color=grey>Empty</font>"]</A></td></tr>"
|
||||
|
||||
if(handcuffed)
|
||||
dat += "<BR><A href='?src=\ref[src];item=[slot_handcuffed]'>Handcuffed</A>"
|
||||
dat += "<tr><td><B>Handcuffed:</B> <A href='?src=\ref[src];item=[slot_handcuffed]'>Remove</A></td></tr>"
|
||||
if(legcuffed)
|
||||
dat += "<BR><A href='?src=\ref[src];item=[slot_legcuffed]'>Legcuffed</A>"
|
||||
dat += "<tr><td><A href='?src=\ref[src];item=[slot_legcuffed]'>Legcuffed</A></td></tr>"
|
||||
|
||||
dat += {"
|
||||
<BR>
|
||||
<BR><A href='?src=\ref[user];mach_close=mob\ref[src]'>Close</A>
|
||||
dat += {"</table>
|
||||
<A href='?src=\ref[user];mach_close=mob\ref[src]'>Close</A>
|
||||
"}
|
||||
user << browse(dat, "window=mob\ref[src];size=325x500")
|
||||
onclose(user, "mob\ref[src]")
|
||||
|
||||
var/datum/browser/popup = new(user, "mob\ref[src]", "[src]", 440, 500)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
|
||||
/mob/living/carbon/Topic(href, href_list)
|
||||
..()
|
||||
|
||||
@@ -839,15 +839,6 @@
|
||||
U.accessories -= A
|
||||
update_inv_w_uniform()
|
||||
|
||||
if (href_list["refresh"])
|
||||
if((machine)&&(in_range(src, usr)))
|
||||
show_inv(machine)
|
||||
|
||||
if (href_list["mach_close"])
|
||||
var/t1 = text("window=[]", href_list["mach_close"])
|
||||
unset_machine()
|
||||
src << browse(null, t1)
|
||||
|
||||
if (href_list["criminal"])
|
||||
if(hasHUD(usr,"security"))
|
||||
|
||||
@@ -1942,4 +1933,9 @@
|
||||
. = ..()
|
||||
|
||||
if(wear_id)
|
||||
. |= wear_id.GetAccess()
|
||||
. |= wear_id.GetAccess()
|
||||
if(istype(w_uniform, /obj/item/clothing/under))
|
||||
var/obj/item/clothing/under/U = w_uniform
|
||||
if(U.accessories)
|
||||
for(var/obj/item/clothing/accessory/A in U.accessories)
|
||||
. |= A.GetAccess()
|
||||
@@ -5,7 +5,7 @@
|
||||
icon_state = "cat2"
|
||||
icon_living = "cat2"
|
||||
icon_dead = "cat2_dead"
|
||||
icon_resting = "cat_rest"
|
||||
icon_resting = "cat2_rest"
|
||||
gender = MALE
|
||||
speak = list("Meow!", "Esp!", "Purr!", "HSSSSS")
|
||||
speak_emote = list("purrs", "meows")
|
||||
@@ -28,7 +28,8 @@
|
||||
desc = "GCAT"
|
||||
icon_state = "cat"
|
||||
icon_living = "cat"
|
||||
icon_dead = "cat2_dead"
|
||||
icon_dead = "cat_dead"
|
||||
icon_resting = "cat_rest"
|
||||
gender = FEMALE
|
||||
var/turns_since_scan = 0
|
||||
var/mob/living/simple_animal/mouse/movement_target
|
||||
|
||||
@@ -32,31 +32,6 @@
|
||||
..()
|
||||
regenerate_icons()
|
||||
|
||||
/mob/living/simple_animal/pet/corgi/handle_hud_icons()
|
||||
..()
|
||||
if(fire)
|
||||
if(fire_alert) fire.icon_state = "fire[fire_alert]" //fire_alert is either 0 if no alert, 1 for heat and 2 for cold.
|
||||
else fire.icon_state = "fire0"
|
||||
if(oxygen)
|
||||
if(oxygen_alert) oxygen.icon_state = "oxy1"
|
||||
else oxygen.icon_state = "oxy0"
|
||||
if(toxin)
|
||||
if(toxins_alert) toxin.icon_state = "tox1"
|
||||
else toxin.icon_state = "tox0"
|
||||
|
||||
/mob/living/simple_animal/pet/corgi/handle_hud_icons_health()
|
||||
..()
|
||||
if(healths)
|
||||
switch(health)
|
||||
if(30 to INFINITY) healths.icon_state = "health0"
|
||||
if(26 to 29) healths.icon_state = "health1"
|
||||
if(21 to 25) healths.icon_state = "health2"
|
||||
if(16 to 20) healths.icon_state = "health3"
|
||||
if(11 to 15) healths.icon_state = "health4"
|
||||
if(6 to 10) healths.icon_state = "health5"
|
||||
if(1 to 5) healths.icon_state = "health6"
|
||||
if(0) healths.icon_state = "health7"
|
||||
|
||||
/mob/living/simple_animal/pet/corgi/Life()
|
||||
. = ..()
|
||||
regenerate_icons()
|
||||
@@ -73,19 +48,21 @@
|
||||
user.set_machine(src)
|
||||
if(user.stat) return
|
||||
|
||||
var/dat = "<div align='center'><b>Inventory of [name]</b></div><p>"
|
||||
if(inventory_head)
|
||||
dat += "<br><b>Head:</b> [inventory_head] (<a href='?src=\ref[src];remove_inv=head'>Remove</a>)"
|
||||
else
|
||||
dat += "<br><b>Head:</b> <a href='?src=\ref[src];add_inv=head'>Nothing</a>"
|
||||
if(inventory_back)
|
||||
dat += "<br><b>Back:</b> [inventory_back] (<a href='?src=\ref[src];remove_inv=back'>Remove</a>)"
|
||||
else
|
||||
dat += "<br><b>Back:</b> <a href='?src=\ref[src];add_inv=back'>Nothing</a>"
|
||||
var/dat = {"<table>"}
|
||||
|
||||
user << browse(dat, text("window=mob[];size=325x500", real_name))
|
||||
onclose(user, "mob[real_name]")
|
||||
return
|
||||
dat += "<tr><td><B>Head:</B></td><td><A href='?src=\ref[src];[inventory_head?"remove_inv":"add_inv"]=head'>[(inventory_head && !(inventory_head.flags&ABSTRACT)) ? inventory_head : "<font color=grey>Empty</font>"]</A></td></tr>"
|
||||
dat += "<tr><td><B>Back:</B></td><td><A href='?src=\ref[src];[inventory_back?"remove_inv":"add_inv"]=back'>[(inventory_back && !(inventory_back.flags&ABSTRACT)) ? inventory_back : "<font color=grey>Empty</font>"]</A></td></tr>"
|
||||
if(can_collar)
|
||||
dat += "<tr><td> </td></tr>"
|
||||
dat += "<tr><td><B>Collar:</B></td><td><A href='?src=\ref[src];[collar?"remove_inv":"add_inv"]=collar'>[(collar && !(collar.flags&ABSTRACT)) ? collar : "<font color=grey>Empty</font>"]</A></td></tr>"
|
||||
|
||||
dat += {"</table>
|
||||
<A href='?src=\ref[user];mach_close=mob\ref[src]'>Close</A>
|
||||
"}
|
||||
|
||||
var/datum/browser/popup = new(user, "mob\ref[src]", "[src]", 440, 500)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
|
||||
/mob/living/simple_animal/pet/corgi/attackby(var/obj/item/O as obj, var/mob/user as mob, params)
|
||||
if(inventory_head && inventory_back)
|
||||
@@ -542,11 +519,7 @@
|
||||
overlays += image('icons/mob/mask.dmi',"facehugger_corgipuppy")
|
||||
else
|
||||
overlays += image('icons/mob/mask.dmi',"facehugger_corgi")
|
||||
if(pcollar)
|
||||
overlays += collar
|
||||
overlays += pettag
|
||||
|
||||
return
|
||||
..(0)
|
||||
|
||||
/mob/living/simple_animal/pet/corgi/puppy
|
||||
name = "\improper corgi puppy"
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
var/obj/item/inventory_head
|
||||
var/obj/item/inventory_mask
|
||||
can_hide = 1
|
||||
can_collar = 1
|
||||
|
||||
/mob/living/simple_animal/crab/handle_automated_movement()
|
||||
//CRAB movement
|
||||
|
||||
@@ -14,4 +14,5 @@
|
||||
meat_amount = 3
|
||||
response_help = "pets"
|
||||
response_disarm = "gently pushes aside"
|
||||
response_harm = "kicks"
|
||||
response_harm = "kicks"
|
||||
can_collar = 1
|
||||
@@ -38,6 +38,7 @@
|
||||
var/list/donors = list()
|
||||
var/ready_evolve = 0
|
||||
holder_type = /obj/item/weapon/holder/diona
|
||||
can_collar = 1
|
||||
|
||||
/mob/living/simple_animal/diona/New()
|
||||
..()
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
melee_damage_upper = 2
|
||||
stop_automated_movement_when_pulled = 1
|
||||
var/milk_content = 0
|
||||
can_collar = 1
|
||||
|
||||
/mob/living/simple_animal/hostile/retaliate/goat/handle_automated_movement()
|
||||
..()
|
||||
@@ -111,6 +112,7 @@
|
||||
attack_sound = 'sound/weapons/punch1.ogg'
|
||||
health = 50
|
||||
var/milk_content = 0
|
||||
can_collar = 1
|
||||
|
||||
/mob/living/simple_animal/cow/New()
|
||||
..()
|
||||
@@ -178,6 +180,7 @@
|
||||
pass_flags = PASSTABLE | PASSGRILLE | PASSMOB
|
||||
small = 1
|
||||
can_hide = 1
|
||||
can_collar = 1
|
||||
|
||||
/mob/living/simple_animal/chick/New()
|
||||
..()
|
||||
@@ -220,6 +223,7 @@ var/global/chicken_count = 0
|
||||
pass_flags = PASSTABLE | PASSMOB
|
||||
small = 1
|
||||
can_hide = 1
|
||||
can_collar = 1
|
||||
|
||||
/mob/living/simple_animal/chicken/New()
|
||||
..()
|
||||
@@ -297,6 +301,7 @@ var/global/chicken_count = 0
|
||||
response_harm = "kicks the"
|
||||
attacktext = "kicks"
|
||||
health = 50
|
||||
can_collar = 1
|
||||
|
||||
/mob/living/simple_animal/turkey
|
||||
name = "turkey"
|
||||
@@ -318,6 +323,7 @@ var/global/chicken_count = 0
|
||||
response_harm = "kicks the"
|
||||
attacktext = "pecks"
|
||||
health = 50
|
||||
can_collar = 1
|
||||
|
||||
/mob/living/simple_animal/goose
|
||||
name = "goose"
|
||||
@@ -339,6 +345,7 @@ var/global/chicken_count = 0
|
||||
response_harm = "kicks the"
|
||||
attacktext = "kicks"
|
||||
health = 50
|
||||
can_collar = 1
|
||||
|
||||
/mob/living/simple_animal/seal
|
||||
name = "seal"
|
||||
@@ -360,6 +367,7 @@ var/global/chicken_count = 0
|
||||
response_harm = "kicks the"
|
||||
attacktext = "kicks"
|
||||
health = 50
|
||||
can_collar = 1
|
||||
|
||||
/mob/living/simple_animal/walrus
|
||||
name = "walrus"
|
||||
@@ -381,3 +389,4 @@ var/global/chicken_count = 0
|
||||
response_harm = "kicks the"
|
||||
attacktext = "kicks"
|
||||
health = 50
|
||||
can_collar = 1
|
||||
|
||||
@@ -22,3 +22,4 @@
|
||||
can_hide = 1
|
||||
meat_type = /obj/item/weapon/reagent_containers/food/snacks/meat
|
||||
meat_amount = 1
|
||||
can_collar = 1
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
universal_speak = 0
|
||||
can_hide = 1
|
||||
holder_type = /obj/item/weapon/holder/mouse
|
||||
can_collar = 1
|
||||
|
||||
/mob/living/simple_animal/mouse/handle_automated_speech()
|
||||
..()
|
||||
|
||||
@@ -1,22 +1,8 @@
|
||||
/mob/living/simple_animal/pet
|
||||
icon = 'icons/mob/pets.dmi'
|
||||
var/obj/item/clothing/accessory/petcollar/pcollar = null
|
||||
var/image/collar = null
|
||||
var/image/pettag = null
|
||||
can_collar = 1
|
||||
|
||||
/mob/living/simple_animal/pet/attackby(var/obj/item/O as obj, var/mob/user as mob, params)
|
||||
if(istype(O, /obj/item/clothing/accessory/petcollar) && !pcollar)
|
||||
var/obj/item/clothing/accessory/petcollar/P = O
|
||||
pcollar = P
|
||||
collar = image('icons/mob/pets.dmi', src, "[icon_state]collar")
|
||||
pettag = image('icons/mob/pets.dmi', src, "[icon_state]tag")
|
||||
regenerate_icons()
|
||||
user << "<span class='notice'>You put the [P] around [src]'s neck.</span>"
|
||||
if(P.tagname)
|
||||
name = P.tagname
|
||||
real_name = P.tagname
|
||||
qdel(P)
|
||||
return
|
||||
if(istype(O, /obj/item/weapon/newspaper))
|
||||
if(!stat)
|
||||
user.visible_message("[user] baps [name] on the nose with the rolled up [O].")
|
||||
@@ -27,12 +13,6 @@
|
||||
else
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/pet/New()
|
||||
..()
|
||||
if(pcollar)
|
||||
pcollar = new(src)
|
||||
regenerate_icons()
|
||||
|
||||
/mob/living/simple_animal/pet/revive()
|
||||
..()
|
||||
regenerate_icons()
|
||||
@@ -41,7 +21,9 @@
|
||||
..()
|
||||
regenerate_icons()
|
||||
|
||||
/mob/living/simple_animal/pet/regenerate_icons()
|
||||
overlays.Cut()
|
||||
overlays += collar
|
||||
overlays += pettag
|
||||
/mob/living/simple_animal/pet/regenerate_icons(cut_overlays = 1)
|
||||
if(cut_overlays)
|
||||
overlays.Cut()
|
||||
if(collar)
|
||||
overlays += "[icon_state]collar"
|
||||
overlays += "[icon_state]tag"
|
||||
@@ -34,6 +34,7 @@
|
||||
icon_dead = "parrot_dead"
|
||||
pass_flags = PASSTABLE
|
||||
small = 1
|
||||
can_collar = 1
|
||||
|
||||
speak = list("Hi","Hello!","Cracker?","BAWWWWK george mellons griffing me")
|
||||
speak_emote = list("squawks","says","yells")
|
||||
@@ -118,17 +119,21 @@
|
||||
*/
|
||||
/mob/living/simple_animal/parrot/show_inv(mob/user as mob)
|
||||
user.set_machine(src)
|
||||
if(user.stat) return
|
||||
|
||||
var/dat = "<div align='center'><b>Inventory of [name]</b></div><p>"
|
||||
if(ears)
|
||||
dat += "<br><b>Headset:</b> [ears] (<a href='?src=\ref[src];remove_inv=ears'>Remove</a>)"
|
||||
else
|
||||
dat += "<br><b>Headset:</b> <a href='?src=\ref[src];add_inv=ears'>Nothing</a>"
|
||||
var/dat = {"<table>"}
|
||||
|
||||
user << browse(dat, text("window=mob[];size=325x500", name))
|
||||
onclose(user, "mob[real_name]")
|
||||
return
|
||||
dat += "<tr><td><B>Headset:</B></td><td><A href='?src=\ref[src];[ears?"remove_inv":"add_inv"]=ears'>[(ears && !(ears.flags&ABSTRACT)) ? ears : "<font color=grey>Empty</font>"]</A></td></tr>"
|
||||
if(can_collar)
|
||||
dat += "<tr><td> </td></tr>"
|
||||
dat += "<tr><td><B>Collar:</B></td><td><A href='?src=\ref[src];[collar?"remove_inv":"add_inv"]=collar'>[(collar && !(collar.flags&ABSTRACT)) ? collar : "<font color=grey>Empty</font>"]</A></td></tr>"
|
||||
|
||||
dat += {"</table>
|
||||
<A href='?src=\ref[user];mach_close=mob\ref[src]'>Close</A>
|
||||
"}
|
||||
|
||||
var/datum/browser/popup = new(user, "mob\ref[src]", "[src]", 440, 500)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
|
||||
/mob/living/simple_animal/parrot/Topic(href, href_list)
|
||||
|
||||
@@ -138,8 +143,6 @@
|
||||
|
||||
//Is the usr's mob type able to do this?
|
||||
if(ishuman(usr) || isrobot(usr))
|
||||
|
||||
//Removing from inventory
|
||||
if(href_list["remove_inv"])
|
||||
var/remove_from = href_list["remove_inv"]
|
||||
switch(remove_from)
|
||||
@@ -157,8 +160,7 @@
|
||||
else
|
||||
usr << "\red There is nothing to remove from its [remove_from]."
|
||||
return
|
||||
|
||||
//Adding things to inventory
|
||||
show_inv(usr)
|
||||
else if(href_list["add_inv"])
|
||||
var/add_to = href_list["add_inv"]
|
||||
if(!usr.get_active_hand())
|
||||
@@ -205,6 +207,7 @@
|
||||
|
||||
if(headset_to_add.translate_binary)
|
||||
available_channels.Add(":b")
|
||||
show_inv(usr)
|
||||
else
|
||||
..()
|
||||
|
||||
|
||||
@@ -67,6 +67,9 @@
|
||||
var/speed = 1 //LETS SEE IF I CAN SET SPEEDS FOR SIMPLE MOBS WITHOUT DESTROYING EVERYTHING. Higher speed is slower, negative speed is faster
|
||||
var/can_hide = 0
|
||||
|
||||
var/obj/item/clothing/accessory/petcollar/collar = null
|
||||
var/can_collar = 0 // can add collar to mob or not
|
||||
|
||||
//Hot simple_animal baby making vars
|
||||
var/childtype = null
|
||||
var/scan_ready = 1
|
||||
@@ -80,7 +83,15 @@
|
||||
verbs -= /mob/verb/observe
|
||||
if(!can_hide)
|
||||
verbs -= /mob/living/simple_animal/verb/hide
|
||||
if(collar)
|
||||
if(!istype(collar))
|
||||
collar = new(src)
|
||||
regenerate_icons()
|
||||
|
||||
/mob/living/simple_animal/Destroy()
|
||||
if(collar)
|
||||
collar.forceMove(loc)
|
||||
collar = null
|
||||
|
||||
/mob/living/simple_animal/Login()
|
||||
if(src && src.client)
|
||||
@@ -92,6 +103,30 @@
|
||||
..()
|
||||
health = Clamp(health, 0, maxHealth)
|
||||
|
||||
/mob/living/simple_animal/handle_hud_icons()
|
||||
..()
|
||||
if(fire)
|
||||
if(fire_alert) fire.icon_state = "fire[fire_alert]" //fire_alert is either 0 if no alert, 1 for heat and 2 for cold.
|
||||
else fire.icon_state = "fire0"
|
||||
if(oxygen)
|
||||
if(oxygen_alert) oxygen.icon_state = "oxy1"
|
||||
else oxygen.icon_state = "oxy0"
|
||||
if(toxin)
|
||||
if(toxins_alert) toxin.icon_state = "tox1"
|
||||
else toxin.icon_state = "tox0"
|
||||
|
||||
/mob/living/simple_animal/handle_hud_icons_health()
|
||||
..()
|
||||
if(healths && maxHealth > 0)
|
||||
switch(health / maxHealth * 30)
|
||||
if(30 to INFINITY) healths.icon_state = "health0"
|
||||
if(26 to 29) healths.icon_state = "health1"
|
||||
if(21 to 25) healths.icon_state = "health2"
|
||||
if(16 to 20) healths.icon_state = "health3"
|
||||
if(11 to 15) healths.icon_state = "health4"
|
||||
if(6 to 10) healths.icon_state = "health5"
|
||||
if(1 to 5) healths.icon_state = "health6"
|
||||
if(0) healths.icon_state = "health7"
|
||||
|
||||
/mob/living/simple_animal/Life()
|
||||
|
||||
@@ -176,7 +211,7 @@
|
||||
var/diff = areatemp - bodytemperature
|
||||
diff = diff / 5
|
||||
bodytemperature += diff
|
||||
|
||||
|
||||
var/tox = environment.toxins
|
||||
var/oxy = environment.oxygen
|
||||
var/n2 = environment.nitrogen
|
||||
@@ -401,6 +436,18 @@
|
||||
else
|
||||
user << "\blue [src] is dead, medical items won't bring it back to life."
|
||||
return
|
||||
else if(can_collar && !collar && istype(O, /obj/item/clothing/accessory/petcollar))
|
||||
var/obj/item/clothing/accessory/petcollar/C = O
|
||||
user.drop_item()
|
||||
C.forceMove(src)
|
||||
collar = C
|
||||
collar.equipped(src)
|
||||
regenerate_icons()
|
||||
usr << "<span class='notice'>You put \the [C] around \the [src]'s neck.</span>"
|
||||
if(C.tagname)
|
||||
name = C.tagname
|
||||
real_name = C.tagname
|
||||
return
|
||||
else if(meat_type && (stat == DEAD)) //if the animal has a meat, and if it is dead.
|
||||
if(istype(O, /obj/item/weapon/kitchen/knife))
|
||||
harvest()
|
||||
@@ -525,6 +572,21 @@
|
||||
density = initial(density)
|
||||
update_canmove()
|
||||
|
||||
/mob/living/simple_animal/show_inv(mob/user as mob)
|
||||
user.set_machine(src)
|
||||
var/dat = {"<table>
|
||||
<tr><td><B>Left Hand:</B></td><td><A href='?src=\ref[src];item=[slot_l_hand]'>[(l_hand && !(l_hand.flags&ABSTRACT)) ? l_hand : "<font color=grey>Empty</font>"]</A></td></tr>
|
||||
<tr><td><B>Right Hand:</B></td><td><A href='?src=\ref[src];item=[slot_r_hand]'>[(r_hand && !(r_hand.flags&ABSTRACT)) ? r_hand : "<font color=grey>Empty</font>"]</A></td></tr>
|
||||
<tr><td> </td></tr>"}
|
||||
if(can_collar)
|
||||
dat += "<tr><td><B>Collar:</B></td><td><A href='?src=\ref[src];[collar?"remove_inv":"add_inv"]=collar'>[(collar && !(collar.flags&ABSTRACT)) ? collar : "<font color=grey>Empty</font>"]</A></td></tr>"
|
||||
dat += {"</table>
|
||||
<A href='?src=\ref[user];mach_close=mob\ref[src]'>Close</A>
|
||||
"}
|
||||
|
||||
var/datum/browser/popup = new(user, "mob\ref[src]", "[src]", 440, 250)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
|
||||
/mob/living/simple_animal/proc/make_babies() // <3 <3 <3
|
||||
if(gender != FEMALE || stat || !scan_ready || !childtype || !simplespecies)
|
||||
@@ -586,3 +648,54 @@
|
||||
|
||||
if(changed)
|
||||
animate(src, transform = ntransform, time = 2, easing = EASE_IN|EASE_OUT)
|
||||
|
||||
/mob/living/simple_animal/Topic(href, href_list)
|
||||
if(!usr.stat && usr.canmove && !usr.restrained() && in_range(src, usr))
|
||||
if(href_list["remove_inv"])
|
||||
if(!Adjacent(usr) || !(ishuman(usr) || isrobot(usr) || isalienadult(usr)))
|
||||
return
|
||||
var/remove_from = href_list["remove_inv"]
|
||||
switch(remove_from)
|
||||
if("collar")
|
||||
if(!can_collar)
|
||||
return
|
||||
if(collar)
|
||||
if(collar.flags & NODROP)
|
||||
usr << "<span class='warning'>\The [collar] is stuck too hard to [src] for you to remove!</span>"
|
||||
return
|
||||
collar.dropped(src)
|
||||
collar.forceMove(src.loc)
|
||||
collar = null
|
||||
regenerate_icons()
|
||||
else
|
||||
usr << "<span class='danger'>There is nothing to remove from its [remove_from].</span>"
|
||||
return
|
||||
show_inv(usr)
|
||||
else if(href_list["add_inv"])
|
||||
if(!Adjacent(usr) || !(ishuman(usr) || isrobot(usr) || isalienadult(usr)))
|
||||
return
|
||||
|
||||
var/add_to = href_list["add_inv"]
|
||||
switch(add_to)
|
||||
if("collar")
|
||||
if(!can_collar || collar)
|
||||
return
|
||||
var/obj/item/clothing/accessory/petcollar/C = usr.get_active_hand()
|
||||
if(!C)
|
||||
usr.visible_message("[usr] rubs [src]'s neck.","<span class='notice'>You rub [src]'s neck for a moment.</span>")
|
||||
return
|
||||
usr.drop_item()
|
||||
C.forceMove(src)
|
||||
collar = C
|
||||
collar.equipped(src)
|
||||
regenerate_icons()
|
||||
usr << "<span class='notice'>You put \the [C] around \the [src]'s neck.</span>"
|
||||
if(C.tagname)
|
||||
name = C.tagname
|
||||
real_name = C.tagname
|
||||
show_inv(usr)
|
||||
|
||||
/mob/living/simple_animal/get_access()
|
||||
. = ..()
|
||||
if(collar)
|
||||
. |= collar.GetAccess()
|
||||
+10
-9
@@ -495,16 +495,17 @@ var/list/slot_equipment_priority = list( \
|
||||
|
||||
/mob/proc/show_inv(mob/user)
|
||||
user.set_machine(src)
|
||||
var/dat = {"
|
||||
<HR>
|
||||
<B><FONT size=3>[name]</FONT></B>
|
||||
<HR>
|
||||
<BR><B>Left Hand:</B> <A href='?src=\ref[src];item=[slot_l_hand]'> [(l_hand&&!(l_hand.flags&ABSTRACT)) ? l_hand : "Nothing"]</A>
|
||||
<BR><B>Right Hand:</B> <A href='?src=\ref[src];item=[slot_r_hand]'> [(r_hand&&!(r_hand.flags&ABSTRACT)) ? r_hand : "Nothing"]</A>
|
||||
<BR><A href='?src=\ref[user];mach_close=mob\ref[src]'>Close</A>
|
||||
var/dat = {"<table>
|
||||
<tr><td><B>Left Hand:</B></td><td><A href='?src=\ref[src];item=[slot_l_hand]'>[(l_hand && !(l_hand.flags&ABSTRACT)) ? l_hand : "<font color=grey>Empty</font>"]</A></td></tr>
|
||||
<tr><td><B>Right Hand:</B></td><td><A href='?src=\ref[src];item=[slot_r_hand]'>[(r_hand && !(r_hand.flags&ABSTRACT)) ? r_hand : "<font color=grey>Empty</font>"]</A></td></tr>
|
||||
<tr><td> </td></tr>"}
|
||||
dat += {"</table>
|
||||
<A href='?src=\ref[user];mach_close=mob\ref[src]'>Close</A>
|
||||
"}
|
||||
user << browse(dat, "window=mob\ref[src];size=325x500")
|
||||
onclose(user, "mob\ref[src]")
|
||||
|
||||
var/datum/browser/popup = new(user, "mob\ref[src]", "[src]", 440, 250)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
|
||||
//mob verbs are faster than object verbs. See http://www.byond.com/forum/?post=1326139&page=2#comment8198716 for why this isn't atom/verb/examine()
|
||||
/mob/verb/examinate(atom/A as mob|obj|turf in view())
|
||||
|
||||
@@ -62,6 +62,13 @@ proc/isembryo(A)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/ispet(A)
|
||||
if(istype(A, /mob/living/simple_animal))
|
||||
var/mob/living/simple_animal/SA = A
|
||||
if(SA.can_collar)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/iscrab(A)
|
||||
if(istype(A, /mob/living/simple_animal/crab))
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user