Merge pull request #12206 from Fox-McCloud/refactors-corgis

Refactors Corgis and Other Doggos
This commit is contained in:
variableundefined
2019-09-05 21:17:53 -04:00
committed by GitHub
69 changed files with 1232 additions and 872 deletions
@@ -152,14 +152,6 @@ var/const/MAX_ACTIVE_TIME = 400
target.equip_to_slot(src, slot_wear_mask,,0)
if(!sterile)
M.Paralyse(MAX_IMPREGNATION_TIME/6) //something like 25 ticks = 20 seconds with the default settings
else if(iscorgi(M))
var/mob/living/simple_animal/pet/corgi/C = M
if(C.facehugger)
var/obj/item/F = C.facehugger
F.forceMove(C.loc)
forceMove(C)
C.facehugger = src
C.regenerate_icons()
GoIdle() //so it doesn't jump the people that tear it off
@@ -192,11 +184,6 @@ var/const/MAX_ACTIVE_TIME = 400
if(!target.get_int_organ(/obj/item/organ/internal/body_egg/alien_embryo))
new /obj/item/organ/internal/body_egg/alien_embryo(target)
if(iscorgi(target))
var/mob/living/simple_animal/pet/corgi/C = target
src.loc = get_turf(C)
C.facehugger = null
else
target.visible_message("<span class='danger'>[src] violates [target]'s face!</span>", \
"<span class='userdanger'>[src] violates [target]'s face!</span>")
@@ -1,15 +1,6 @@
/mob/living/simple_animal/attackby(obj/item/O, mob/living/user)
if(can_collar && !collar && istype(O, /obj/item/clothing/accessory/petcollar))
var/obj/item/clothing/accessory/petcollar/C = O
if(user.drop_item())
C.forceMove(src)
collar = C
collar.equipped(src)
regenerate_icons()
to_chat(usr, "<span class='notice'>You put \the [C] around \the [src]'s neck.</span>")
if(C.tagname)
name = C.tagname
real_name = C.tagname
if(can_collar && istype(O, /obj/item/clothing/accessory/petcollar) && !pcollar)
add_collar(O, user)
return
else
return ..()
@@ -23,7 +23,7 @@
response_disarm = "gently pushes aside"
response_harm = "kicks"
gold_core_spawnable = CHEM_MOB_SPAWN_FRIENDLY
collar_type = "cat"
var/turns_since_scan = 0
var/mob/living/simple_animal/mouse/movement_target
var/eats_mice = 1
@@ -38,6 +38,7 @@
icon_resting = "cat_rest"
gender = FEMALE
gold_core_spawnable = CHEM_MOB_SPAWN_INVALID
unique_pet = TRUE
var/list/family = list()
var/memory_saved = 0
var/list/children = list() //Actual mob instances of children
@@ -107,6 +108,7 @@
else if(prob(1))
custom_emote(1, pick("sits down.", "crouches on its hind legs.", "looks alert."))
icon_state = "[icon_living]_sit"
collar_type = "[initial(collar_type)]_sit"
resting = TRUE
update_canmove()
else if(prob(1))
@@ -188,6 +190,7 @@
/mob/living/simple_animal/pet/cat/Proc
name = "Proc"
unique_pet = TRUE
/mob/living/simple_animal/pet/cat/kitten
name = "kitten"
@@ -199,6 +202,7 @@
gender = NEUTER
density = 0
pass_flags = PASSMOB
collar_type = "kitten"
/mob/living/simple_animal/pet/cat/Syndi
name = "SyndiCat"
@@ -1,669 +0,0 @@
//Corgi
/mob/living/simple_animal/pet/corgi
name = "\improper corgi"
real_name = "corgi"
desc = "It's a corgi."
icon_state = "corgi"
icon_living = "corgi"
icon_dead = "corgi_dead"
gender = NEUTER
health = 30
maxHealth = 30
speak = list("YAP", "Woof!", "Bark!", "AUUUUUU")
speak_emote = list("barks", "woofs")
emote_hear = list("barks", "woofs", "yaps","pants")
emote_see = list("shakes its head", "shivers")
var/bark_sound = list('sound/creatures/dog_bark1.ogg','sound/creatures/dog_bark2.ogg') //Used in emote.
var/yelp_sound = 'sound/creatures/dog_yelp.ogg' //Used on death.
speak_chance = 1
turns_per_move = 10
butcher_results = list(/obj/item/reagent_containers/food/snacks/meat/corgi = 3)
response_help = "pets"
response_disarm = "bops"
response_harm = "kicks"
see_in_dark = 5
childtype = list(/mob/living/simple_animal/pet/corgi)
animal_species = /mob/living/simple_animal/pet/corgi
gold_core_spawnable = CHEM_MOB_SPAWN_FRIENDLY
var/shaved = 0
var/obj/item/inventory_head
var/obj/item/inventory_back
var/facehugger
var/default_atmos_requirements = 0
var/last_eaten = 0
/mob/living/simple_animal/pet/corgi/New()
..()
default_atmos_requirements = src.atmos_requirements
regenerate_icons()
if(gender == NEUTER)
gender = pick(MALE, FEMALE)
/mob/living/simple_animal/pet/corgi/Life(seconds, times_fired)
. = ..()
regenerate_icons()
/mob/living/simple_animal/pet/corgi/show_inv(mob/user as mob)
user.set_machine(src)
if(user.stat) return
var/dat = {"<table>"}
dat += "<tr><td><B>Head:</B></td><td><A href='?src=[UID()];[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=[UID()];[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>&nbsp;</td></tr>"
dat += "<tr><td><B>Collar:</B></td><td><A href='?src=[UID()];item=[slot_collar]'>[(collar && !(collar.flags&ABSTRACT)) ? collar : "<font color=grey>Empty</font>"]</A></td></tr>"
if(facehugger)
dat += "<tr><td><B>Facehugger:</B></td><td><A href='?src=[UID()];remove_hugger=1'>[facehugger]</A></td></tr>"
dat += {"</table>
<A href='?src=[user.UID()];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)
//helmet and armor = 100% protection
if( istype(inventory_head,/obj/item/clothing/head/helmet) && istype(inventory_back,/obj/item/clothing/suit/armor) )
if( O.force )
to_chat(user, "<span class='warning'>[src] is wearing too much armor! You can't cause [p_them()] any damage.</span>")
visible_message("<span class='danger'> [user] hits [src] with [O], however [src] is too armored.</span>")
else
to_chat(user, "<span class='warning'>[src] is wearing too much armor! You can't reach [p_their()] skin.</span>")
visible_message("[user] gently taps [src] with [O].")
if(health>0 && prob(15))
custom_emote(1, "looks at [user] with [pick("an amused","an annoyed","a confused","a resentful", "a happy", "an excited")] expression.")
return
if(istype(O, /obj/item/razor))
if(shaved)
to_chat(user, "<span class='warning'>You can't shave this corgi, it's already been shaved!</span>")
return
user.visible_message("[user] starts to shave [src] using \the [O].", "<span class='notice'>You start to shave [src] using \the [O]...</span>")
if(do_after(user, 50 * O.toolspeed, target = src))
user.visible_message("[user] shaves [src]'s hair using \the [O].")
playsound(loc, O.usesound, 20, 1)
shaved = 1
icon_living = "[initial(icon_living)]_shaved"
icon_dead = "[initial(icon_living)]_shaved_dead"
if(stat == CONSCIOUS)
icon_state = icon_living
else
icon_state = icon_dead
return
..()
/mob/living/simple_animal/pet/corgi/Topic(href, href_list)
if(usr.stat) return
if((!ishuman(usr) && !isrobot(usr)) || !Adjacent(usr))
return
//Removing from inventory
if(href_list["remove_inv"])
var/remove_from = href_list["remove_inv"]
switch(remove_from)
if("head")
if(inventory_head)
if(inventory_head.flags & NODROP)
to_chat(usr, "<span class='warning'>\The [inventory_head] is stuck too hard to [src] for you to remove!</span>")
return
name = real_name
desc = initial(desc)
speak = list("YAP", "Woof!", "Bark!", "AUUUUUU")
speak_emote = list("barks", "woofs")
emote_hear = list("barks", "woofs", "yaps","pants")
emote_see = list("shakes its head", "shivers")
desc = "It's a corgi."
set_light(0)
mutations.Remove(BREATHLESS)
atmos_requirements = default_atmos_requirements
minbodytemp = initial(minbodytemp)
inventory_head.loc = src.loc
inventory_head = null
regenerate_icons()
else
to_chat(usr, "<span class='danger'>There is nothing to remove from its [remove_from].</span>")
return
if("back")
if(inventory_back)
if(inventory_back.flags & NODROP)
to_chat(usr, "<span class='warning'>\The [inventory_back] is stuck too hard to [src] for you to remove!</span>")
return
inventory_back.loc = src.loc
inventory_back = null
regenerate_icons()
else
to_chat(usr, "<span class='danger'>There is nothing to remove from its [remove_from].</span>")
return
show_inv(usr)
//Adding things to inventory
else if(href_list["add_inv"])
var/add_to = href_list["add_inv"]
switch(add_to)
if("head")
place_on_head(usr.get_active_hand(),usr)
if("back")
if(inventory_back)
to_chat(usr, "<span class='warning'>It's already wearing something!</span>")
return
else
var/obj/item/item_to_add = usr.get_active_hand()
if(!item_to_add)
usr.visible_message("[usr] pets [src].","<span class='notice'>You rest your hand on [src]'s back for a moment.</span>")
return
if(istype(item_to_add,/obj/item/grenade/plastic/c4)) // last thing he ever wears, I guess
item_to_add.afterattack(src,usr,1)
return
//The objects that corgis can wear on their backs.
var/list/allowed_types = list(
/obj/item/clothing/suit/armor/vest,
/obj/item/clothing/suit/armor/vest/blueshield,
/obj/item/clothing/suit/space/deathsquad,
/obj/item/clothing/suit/space/hardsuit/engine,
/obj/item/radio,
/obj/item/radio/off,
/obj/item/clothing/suit/cardborg,
/obj/item/tank/oxygen,
/obj/item/tank/air,
/obj/item/extinguisher,
)
if( ! ( item_to_add.type in allowed_types ) )
to_chat(usr, "<span class='warning'>You set [item_to_add] on [src]'s back, but [p_they()] shake[p_s()] it off!</span>")
if(!usr.drop_item())
to_chat(usr, "<span class='warning'>\The [item_to_add] is stuck to your hand, you cannot put it on [src]'s back!</span>")
return
item_to_add.loc = loc
if(prob(25))
step_rand(item_to_add)
for(var/i in list(1,2,4,8,4,8,4,dir))
dir = i
sleep(1)
return
usr.drop_item()
item_to_add.loc = src
src.inventory_back = item_to_add
regenerate_icons()
show_inv(usr)
//Removing facehuggers
else if(href_list["remove_hugger"])
if(!facehugger)
return
var/obj/item/F = facehugger
F.forceMove(loc)
facehugger = null
to_chat(usr, "<span class='notice'>You remove [F] from [src]'s face. [src] pants for air and barks.</span>")
regenerate_icons()
show_inv(usr)
else
..()
//Corgis are supposed to be simpler, so only a select few objects can actually be put
//to be compatible with them. The objects are below.
//Many hats added, Some will probably be removed, just want to see which ones are popular.
/mob/living/simple_animal/pet/corgi/proc/place_on_head(obj/item/item_to_add, var/mob/user as mob)
if(istype(item_to_add,/obj/item/grenade/plastic/c4)) // last thing he ever wears, I guess
item_to_add.afterattack(src,user,1)
return
if(inventory_head)
if(user)
to_chat(user, "<span class='warning'>You can't put more than one hat on [src]!</span>")
return
if(!item_to_add)
user.visible_message("[user] pets [src].","<span class='notice'>You rest your hand on [src]'s head for a moment.</span>")
return
var/valid = 0
//Various hats and items (worn on his head) change Ian's behaviour. His attributes are reset when a hat is removed.
if(istype(item_to_add, /obj/item/clothing/accessory/scarf))
valid = 1
else
switch(item_to_add.type)
if( /obj/item/clothing/glasses/sunglasses, /obj/item/clothing/head/that, /obj/item/clothing/head/collectable/paper,
/obj/item/clothing/head/hardhat, /obj/item/clothing/head/collectable/hardhat, /obj/item/clothing/head/hardhat/white,
/obj/item/paper)
valid = 1
if(/obj/item/clothing/head/helmet)
name = "Sergeant [real_name]"
desc = "The ever-loyal, the ever-vigilant."
valid = 1
if(/obj/item/clothing/head/chefhat, /obj/item/clothing/head/collectable/chef)
name = "Sous chef [real_name]"
desc = "Your food will be taste-tested. All of it."
valid = 1
if(/obj/item/clothing/head/caphat, /obj/item/clothing/head/collectable/captain)
name = "Captain [real_name]"
desc = "Probably better than the last captain."
valid = 1
if(/obj/item/clothing/head/kitty, /obj/item/clothing/head/collectable/kitty)
name = "Runtime"
emote_see = list("coughs up a furball", "stretches")
emote_hear = list("purrs")
speak = list("Purrr", "Meow!", "MAOOOOOW!", "HISSSSS", "MEEEEEEW")
desc = "It's a cute little kitty-cat! ... wait ... what the hell?"
valid = 1
if(/obj/item/clothing/head/rabbitears, /obj/item/clothing/head/collectable/rabbitears)
name = "Hoppy"
emote_see = list("twitches its nose", "hops around a bit")
desc = "This is Hoppy. It's a corgi-...urmm... bunny rabbit"
valid = 1
if(/obj/item/clothing/head/beret, /obj/item/clothing/head/collectable/beret)
name = "Yann"
desc = "Mon dieu! C'est un chien!"
speak = list("le woof!", "le bark!", "JAPPE!!")
emote_see = list("cowers in fear.", "surrenders.", "plays dead.","looks as though there is a wall in front of him.")
valid = 1
if(/obj/item/clothing/head/det_hat)
name = "Detective [real_name]"
desc = "[name] sees through your lies..."
emote_see = list("investigates the area.","sniffs around for clues.","searches for scooby snacks.")
valid = 1
if(/obj/item/clothing/head/nursehat)
name = "Nurse [real_name]"
desc = "[name] needs 100cc of beef jerky... STAT!"
valid = 1
if(/obj/item/clothing/head/pirate, /obj/item/clothing/head/collectable/pirate)
name = "[pick("Ol'","Scurvy","Black","Rum","Gammy","Bloody","Gangrene","Death","Long-John")] [pick("kibble","leg","beard","tooth","poop-deck","Threepwood","Le Chuck","corsair","Silver","Crusoe")]"
desc = "Yaarghh!! Thar' be a scurvy dog!"
emote_see = list("hunts for treasure.","stares coldly...","gnashes his tiny corgi teeth!")
emote_hear = list("growls ferociously!", "snarls.")
speak = list("Arrrrgh!!","Grrrrrr!")
valid = 1
if(/obj/item/clothing/head/ushanka)
name = "[pick("Comrade","Commissar","Glorious Leader")] [real_name]"
desc = "A follower of Karl Barx."
emote_see = list("contemplates the failings of the capitalist economic model.", "ponders the pros and cons of vanguardism.")
valid = 1
if(/obj/item/clothing/head/warden, /obj/item/clothing/head/collectable/police)
name = "Officer [real_name]"
emote_see = list("drools.","looks for donuts.")
desc = "Stop right there criminal scum!"
valid = 1
if(/obj/item/clothing/head/wizard/fake, /obj/item/clothing/head/wizard, /obj/item/clothing/head/collectable/wizard)
name = "Grandwizard [real_name]"
speak = list("YAP", "Woof!", "Bark!", "AUUUUUU", "EI NATH!")
valid = 1
if(/obj/item/clothing/head/cardborg)
name = "Borgi"
speak = list("Ping!","Beep!","Woof!")
emote_see = list("goes rogue.", "sniffs out non-humans.")
desc = "Result of robotics budget cuts."
valid = 1
if(/obj/item/bedsheet)
name = "\improper Ghost"
speak = list("WoooOOOooo~","AUUUUUUUUUUUUUUUUUU")
emote_see = list("stumbles around.", "shivers.")
emote_hear = list("howls!","groans.")
desc = "Spooky!"
valid = 1
if(/obj/item/clothing/head/helmet/space/santahat)
name = "Santa's Corgi Helper"
emote_hear = list("barks Christmas songs.", "yaps merrily!")
emote_see = list("looks for presents.", "checks his list.")
desc = "He's very fond of milk and cookies."
valid = 1
if(/obj/item/clothing/head/soft)
name = "Corgi Tech [real_name]"
desc = "The reason your yellow gloves have chew-marks."
valid = 1
if(/obj/item/clothing/head/hardhat/reindeer)
name = "[real_name] the red-nosed Corgi"
emote_hear = list("lights the way!", "illuminates.", "yaps!")
desc = "He has a very shiny nose."
set_light(1)
valid = 1
if(/obj/item/clothing/head/sombrero)
name = "Segnor [real_name]"
desc = "You must respect elder [real_name]"
valid = 1
if(/obj/item/clothing/head/hopcap)
name = "Lieutenant [real_name]"
desc = "Can actually be trusted to not run off on his own."
valid = 1
if(/obj/item/clothing/head/helmet/space/deathsquad)
name = "Trooper [real_name]"
desc = "That's not red paint. That's real corgi blood."
valid = 1
if(/obj/item/clothing/suit/space/hardsuit/engine)
name = "Space Explorer [real_name]"
desc = "That's one small step for a corgi. One giant yap for corgikind."
valid = 1
mutations.Add(BREATHLESS)
atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0)
minbodytemp = 0
if(/obj/item/clothing/mask/fakemoustache)
name = "Definitely Not [real_name]"
desc = "That's Definitely Not [real_name]"
valid = 1
if(/obj/item/clothing/head/beret/centcom/officer, /obj/item/clothing/head/beret/centcom/officer/navy)
name = "Blueshield [real_name]"
desc = "Will stand by you until the bitter end."
emote_see = list("stands with pride.", "growls heroically.")
valid = 1
if(valid)
if(user && !user.drop_item())
to_chat(user, "<span class='warning'>\The [item_to_add] is stuck to your hand, you cannot put it on [src]'s head!</span>")
return 0
if(health <= 0)
to_chat(user, "<span class ='notice'>There is merely a dull, lifeless look in [real_name]'s eyes as you put the [item_to_add] on [p_them()].</span>")
else if(user)
user.visible_message("[user] puts [item_to_add] on [real_name]'s head. [src] looks at [user] and barks once.",
"<span class='notice'>You put [item_to_add] on [real_name]'s head. [src] gives you a peculiar look, then wags [p_their()] tail once and barks.</span>",
"<span class='italics'>You hear a friendly-sounding bark.</span>")
item_to_add.loc = src
src.inventory_head = item_to_add
regenerate_icons()
else
if(user && !user.drop_item())
to_chat(user, "<span class='warning'>\The [item_to_add] is stuck to your hand, you cannot put it on [src]'s head!</span>")
return 0
to_chat(user, "<span class='warning'>You set [item_to_add] on [src]'s head, but [p_they()] shake[p_s()] it off!</span>")
item_to_add.loc = loc
if(prob(25))
step_rand(item_to_add)
for(var/i in list(1,2,4,8,4,8,4,dir))
dir = i
sleep(1)
return valid
/mob/living/simple_animal/pet/corgi/death(gibbed)
playsound(src, yelp_sound, 75, 1)
..()
/mob/living/simple_animal/pet/corgi/emote(act, m_type = 1, message = null, force)
if(stat != CONSCIOUS)
return
var/on_CD = 0
act = lowertext(act)
switch(act)
if("bark")
on_CD = handle_emote_CD()
if("growl")
on_CD = handle_emote_CD()
else
on_CD = 0
if(!force && on_CD == 1)
return
switch(act)
if("bark")
message = "<B>[src]</B> [pick(src.speak_emote)]!"
m_type = 2 //audible
playsound(src, pick(src.bark_sound), 50, 0.85)
if("growl")
message = "<B>[src]</B> growls!"
m_type = 2 //audible
if("help")
to_chat(src, "scream, bark, growl")
..()
//IAN! SQUEEEEEEEEE~
/mob/living/simple_animal/pet/corgi/Ian
name = "Ian"
real_name = "Ian" //Intended to hold the name without altering it.
gender = MALE
desc = "It's a corgi."
var/turns_since_scan = 0
var/obj/movement_target
response_help = "pets"
response_disarm = "bops"
response_harm = "kicks"
gold_core_spawnable = CHEM_MOB_SPAWN_INVALID
/mob/living/simple_animal/pet/corgi/Ian/handle_automated_movement()
. = ..()
//Feeding, chasing food, FOOOOODDDD
if(!resting && !buckled)
turns_since_scan++
if(turns_since_scan > 5)
turns_since_scan = 0
if((movement_target) && !(isturf(movement_target.loc) || ishuman(movement_target.loc) ))
movement_target = null
stop_automated_movement = 0
if( !movement_target || !(movement_target.loc in oview(src, 3)) )
movement_target = null
stop_automated_movement = 0
for(var/obj/item/reagent_containers/food/snacks/S in oview(src,3))
if(isturf(S.loc) || ishuman(S.loc))
movement_target = S
break
if(movement_target)
spawn(0)
stop_automated_movement = 1
step_to(src,movement_target,1)
sleep(3)
step_to(src,movement_target,1)
sleep(3)
step_to(src,movement_target,1)
if(movement_target) //Not redundant due to sleeps, Item can be gone in 6 decisecomds
if(movement_target.loc.x < src.x)
dir = WEST
else if(movement_target.loc.x > src.x)
dir = EAST
else if(movement_target.loc.y < src.y)
dir = SOUTH
else if(movement_target.loc.y > src.y)
dir = NORTH
else
dir = SOUTH
if(!Adjacent(movement_target)) //can't reach food through windows.
return
if(isturf(movement_target.loc) )
movement_target.attack_animal(src)
else if(ishuman(movement_target.loc) )
if(prob(20))
custom_emote(1, "stares at [movement_target.loc]'s [movement_target] with a sad puppy-face")
if(prob(1))
custom_emote(1, pick("dances around.","chases its tail!"))
spin(20, 1)
/obj/item/reagent_containers/food/snacks/meat/corgi
name = "Corgi meat"
desc = "Tastes like... well you know..."
/mob/living/simple_animal/pet/corgi/regenerate_icons()
overlays.Cut()
if(inventory_head)
var/image/head_icon
if(health <= 0)
head_icon = image('icons/mob/corgi_head.dmi', icon_state = inventory_head.icon_state, dir = EAST)
head_icon.pixel_y = -8
head_icon.transform = turn(head_icon.transform, 180)
else
head_icon = image('icons/mob/corgi_head.dmi', icon_state = inventory_head.icon_state)
overlays += head_icon
if(inventory_back)
var/image/back_icon
if(health <= 0)
back_icon = image('icons/mob/corgi_back.dmi', icon_state = inventory_back.icon_state, dir = EAST)
back_icon.pixel_y = -11
back_icon.transform = turn(back_icon.transform, 180)
else
back_icon = image('icons/mob/corgi_back.dmi', icon_state = inventory_back.icon_state)
overlays += back_icon
if(facehugger)
if(istype(src, /mob/living/simple_animal/pet/corgi/puppy))
overlays += image('icons/mob/mask.dmi',"facehugger_corgipuppy")
else
overlays += image('icons/mob/mask.dmi',"facehugger_corgi")
..(0)
/mob/living/simple_animal/pet/corgi/puppy
name = "\improper corgi puppy"
real_name = "corgi"
desc = "It's a corgi puppy."
icon_state = "puppy"
icon_living = "puppy"
icon_dead = "puppy_dead"
shaved = 0
density = 0
pass_flags = PASSMOB
mob_size = MOB_SIZE_SMALL
//puppies cannot wear anything.
/mob/living/simple_animal/pet/corgi/puppy/Topic(href, href_list)
if(href_list["remove_inv"] || href_list["add_inv"])
to_chat(usr, "<span class='warning'>You can't fit this on [src]!</span>")
return
..()
//LISA! SQUEEEEEEEEE~
/mob/living/simple_animal/pet/corgi/Lisa
name = "Lisa"
real_name = "Lisa"
gender = FEMALE
desc = "It's a corgi with a cute pink bow."
icon_state = "lisa"
icon_living = "lisa"
icon_dead = "lisa_dead"
response_help = "pets"
response_disarm = "bops"
response_harm = "kicks"
var/turns_since_scan = 0
var/puppies = 0
gold_core_spawnable = CHEM_MOB_SPAWN_INVALID
//Lisa already has a cute bow!
/mob/living/simple_animal/pet/corgi/Lisa/Topic(href, href_list)
if(href_list["remove_inv"] || href_list["add_inv"])
to_chat(usr, "<span class='warning'>[src] already has a cute bow!</span>")
return
..()
/mob/living/simple_animal/pet/corgi/Lisa/Life()
..()
make_babies()
/mob/living/simple_animal/pet/corgi/Lisa/handle_automated_movement()
. = ..()
if(!resting && !buckled)
if(prob(1))
custom_emote(1, pick("dances around.","chases her tail."))
spin(20, 1)
/mob/living/simple_animal/pet/corgi/attack_hand(mob/living/carbon/human/M)
. = ..()
switch(M.a_intent)
if(INTENT_HELP) wuv(1,M)
if(INTENT_HARM) wuv(-1,M)
/mob/living/simple_animal/pet/corgi/proc/wuv(change, mob/M)
if(change)
if(change > 0)
if(M && stat != DEAD) // Added check to see if this mob (the corgi) is dead to fix issue 2454
new /obj/effect/temp_visual/heart(loc)
custom_emote(1, "yaps happily!")
else
if(M && stat != DEAD) // Same check here, even though emote checks it as well (poor form to check it only in the help case)
custom_emote(1, "growls!")
/mob/living/simple_animal/pet/corgi/Ian/borgi
name = "E-N"
real_name = "E-N" //Intended to hold the name without altering it.
desc = "It's a borgi."
icon_state = "borgi"
icon_living = "borgi"
bark_sound = null //No robo-bjork...
yelp_sound = null //Or robo-Yelp.
var/emagged = 0
atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0)
minbodytemp = 0
loot = list(/obj/effect/decal/cleanable/blood/gibs/robot)
del_on_death = 1
deathmessage = "blows apart!"
/mob/living/simple_animal/pet/corgi/Ian/borgi/emag_act(user as mob)
if(!emagged)
emagged = 1
visible_message("<span class='warning'>[user] swipes a card through [src].</span>", "<span class='notice'>You overload [src]s internal reactor.</span>")
spawn (1000)
src.explode()
/mob/living/simple_animal/pet/corgi/Ian/borgi/proc/explode()
for(var/mob/M in viewers(src, null))
if(M.client)
M.show_message("<span class='warning'>[src] makes an odd whining noise.</span>")
sleep(10)
explosion(get_turf(src), 0, 1, 4, 7)
death()
/mob/living/simple_animal/pet/corgi/Ian/borgi/proc/shootAt(var/atom/movable/target)
var/turf/T = get_turf(src)
var/turf/U = get_turf(target)
if(!T || !U)
return
var/obj/item/projectile/beam/A = new /obj/item/projectile/beam(loc)
A.icon = 'icons/effects/genetics.dmi'
A.icon_state = "eyelasers"
playsound(src.loc, 'sound/weapons/taser2.ogg', 75, 1)
A.current = T
A.yo = U.y - T.y
A.xo = U.x - T.x
A.fire()
return
/mob/living/simple_animal/pet/corgi/Ian/borgi/Life(seconds, times_fired)
..()
//spark for no reason
if(prob(5))
do_sparks(3, 1, src)
/mob/living/simple_animal/pet/corgi/Ian/borgi/handle_automated_action()
if(emagged && prob(25))
var/mob/living/carbon/target = locate() in view(10, src)
if(target)
shootAt(target)
/mob/living/simple_animal/pet/corgi/Ian/borgi/death(gibbed)
// Only execute the below if we successfully died
. = ..(gibbed)
if(!.)
return FALSE
do_sparks(3, 1, src)
@@ -1,6 +0,0 @@
/mob/living/simple_animal/pet/corgi/verb/chasetail()
set name = "Chase your tail"
set desc = "d'awwww."
set category = "Corgi"
visible_message("[src] [pick("dances around","chases [p_their()] tail")].","[pick("You dance around","You chase your tail")].")
spin(20, 1)
@@ -40,6 +40,7 @@
response_disarm = "gently pushes aside"
response_harm = "stomps"
gold_core_spawnable = CHEM_MOB_SPAWN_INVALID
unique_pet = TRUE
//LOOK AT THIS - ..()??
/*/mob/living/simple_animal/crab/attackby(var/obj/item/O as obj, var/mob/user as mob, params)
@@ -0,0 +1,767 @@
//Dogs.
/mob/living/simple_animal/pet/dog
name = "dog"
icon_state = "blackdog"
icon_living = "blackdog"
icon_dead = "blackdog_dead"
response_help = "pets"
response_disarm = "bops"
response_harm = "kicks"
speak = list("YAP", "Woof!", "Bark!", "AUUUUUU")
speak_emote = list("barks", "woofs")
emote_hear = list("barks!", "woofs!", "yaps.","pants.")
emote_see = list("shakes its head.", "chases its tail.","shivers.")
faction = list("neutral")
see_in_dark = 5
speak_chance = 1
turns_per_move = 10
gold_core_spawnable = CHEM_MOB_SPAWN_FRIENDLY
var/bark_sound = list('sound/creatures/dog_bark1.ogg','sound/creatures/dog_bark2.ogg') //Used in emote.
var/yelp_sound = 'sound/creatures/dog_yelp.ogg' //Used on death.
var/last_eaten = 0
/mob/living/simple_animal/pet/dog/verb/chasetail()
set name = "Chase your tail"
set desc = "d'awwww."
set category = "Dog"
visible_message("[src] [pick("dances around", "chases [p_their()] tail")].", "[pick("You dance around", "You chase your tail")].")
spin(20, 1)
/mob/living/simple_animal/pet/dog/death(gibbed)
// Only execute the below if we successfully died
. = ..(gibbed)
if(!.)
return
playsound(src, yelp_sound, 75, TRUE)
/mob/living/simple_animal/pet/dog/emote(act, m_type = 1, message = null, force)
if(!incapacitated())
return
var/on_CD = 0
act = lowertext(act)
switch(act)
if("bark")
on_CD = handle_emote_CD()
if("yelp")
on_CD = handle_emote_CD()
else
on_CD = 0
if(!force && on_CD == 1)
return
switch(act)
if("bark")
message = "<B>[src]</B> [pick(src.speak_emote)]!"
m_type = 2 //audible
playsound(src, pick(src.bark_sound), 50, TRUE)
if("yelp")
message = "<B>[src]</B> yelps!"
m_type = 2 //audible
playsound(src, yelp_sound, 75, TRUE)
if("growl")
message = "<B>[src]</B> growls!"
m_type = 2 //audible
if("help")
to_chat(src, "scream, bark, growl")
..()
/mob/living/simple_animal/pet/dog/attack_hand(mob/living/carbon/human/M)
. = ..()
switch(M.a_intent)
if(INTENT_HELP)
wuv(1, M)
if(INTENT_HARM)
wuv(-1, M)
/mob/living/simple_animal/pet/dog/proc/wuv(change, mob/M)
if(change)
if(change > 0)
if(M && stat != DEAD) // Added check to see if this mob (the corgi) is dead to fix issue 2454
new /obj/effect/temp_visual/heart(loc)
custom_emote(1, "yaps happily!")
else
if(M && stat != DEAD) // Same check here, even though emote checks it as well (poor form to check it only in the help case)
custom_emote(1, "growls!")
//Corgis and pugs are now under one dog subtype
/mob/living/simple_animal/pet/dog/corgi
name = "\improper corgi"
real_name = "corgi"
desc = "It's a corgi."
icon_state = "corgi"
icon_living = "corgi"
icon_dead = "corgi_dead"
butcher_results = list(/obj/item/reagent_containers/food/snacks/meat/corgi = 3, /obj/item/stack/sheet/animalhide/corgi = 1)
childtype = list(/mob/living/simple_animal/pet/dog/corgi/puppy = 95, /mob/living/simple_animal/pet/dog/corgi/puppy/void = 5)
animal_species = /mob/living/simple_animal/pet/dog
gold_core_spawnable = CHEM_MOB_SPAWN_FRIENDLY
collar_type = "corgi"
var/obj/item/inventory_head
var/obj/item/inventory_back
var/shaved = FALSE
var/nofur = FALSE //Corgis that have risen past the material plane of existence.
/mob/living/simple_animal/pet/dog/corgi/Initialize(mapload)
. = ..()
regenerate_icons()
/mob/living/simple_animal/pet/dog/corgi/Destroy()
QDEL_NULL(inventory_head)
QDEL_NULL(inventory_back)
return ..()
/mob/living/simple_animal/pet/dog/corgi/handle_atom_del(atom/A)
if(A == inventory_head)
inventory_head = null
regenerate_icons()
if(A == inventory_back)
inventory_back = null
regenerate_icons()
return ..()
/mob/living/simple_animal/pet/dog/corgi/Life(seconds, times_fired)
. = ..()
regenerate_icons()
/mob/living/simple_animal/pet/dog/corgi/death(gibbed)
..(gibbed)
regenerate_icons()
/mob/living/simple_animal/pet/dog/corgi/show_inv(mob/user)
if(user.incapacitated() || !Adjacent(user))
return
user.set_machine(src)
var/dat = "<div align='center'><b>Inventory of [name]</b></div><p>"
dat += "<br><B>Head:</B> <A href='?src=[UID()];[inventory_head ? "remove_inv=head'>[inventory_head]" : "add_inv=head'>Nothing"]</A>"
dat += "<br><B>Back:</B> <A href='?src=[UID()];[inventory_back ? "remove_inv=back'>[inventory_back]" : "add_inv=back'>Nothing"]</A>"
dat += "<br><B>Collar:</B> <A href='?src=[UID()];[pcollar ? "remove_inv=collar'>[pcollar]" : "add_inv=collar'>Nothing"]</A>"
var/datum/browser/popup = new(user, "mob[UID()]", "[src]", 440, 250)
popup.set_content(dat)
popup.open()
/mob/living/simple_animal/pet/dog/corgi/getarmor(def_zone, type)
var/armorval = 0
if(def_zone)
if(def_zone == "head")
if(inventory_head)
armorval = inventory_head.armor[type]
else
if(inventory_back)
armorval = inventory_back.armor[type]
return armorval
else
if(inventory_head)
armorval += inventory_head.armor[type]
if(inventory_back)
armorval += inventory_back.armor[type]
return armorval * 0.5
/mob/living/simple_animal/pet/dog/corgi/attackby(obj/item/O, mob/user, params)
if(istype(O, /obj/item/razor))
if(shaved)
to_chat(user, "<span class='warning'>You can't shave this corgi, it's already been shaved!</span>")
return
if(nofur)
to_chat(user, "<span class='warning'>You can't shave this corgi, it doesn't have a fur coat!</span>")
return
user.visible_message("<span class='notice'>[user] starts to shave [src] using \the [O].", "<span class='notice'>You start to shave [src] using \the [O]...</span>")
if(do_after(user, 50, target = src))
user.visible_message("<span class='notice'>[user] shaves [src]'s hair using \the [O].</span>")
playsound(loc, O.usesound, 20, TRUE)
shaved = TRUE
icon_living = "[initial(icon_living)]_shaved"
icon_dead = "[initial(icon_living)]_shaved_dead"
if(stat == CONSCIOUS)
icon_state = icon_living
else
icon_state = icon_dead
return
..()
update_corgi_fluff()
/mob/living/simple_animal/pet/dog/corgi/Topic(href, href_list)
if(!(iscarbon(usr) || isrobot(usr)) || usr.incapacitated() || !Adjacent(usr))
usr << browse(null, "window=mob[UID()]")
usr.unset_machine()
return
//Removing from inventory
if(href_list["remove_inv"])
var/remove_from = href_list["remove_inv"]
switch(remove_from)
if("head")
if(inventory_head)
if(inventory_head.flags & NODROP)
to_chat(usr, "<span class='warning'>\The [inventory_head] is stuck too hard to [src] for you to remove!</span>")
return
usr.put_in_hands(inventory_head)
inventory_head = null
update_corgi_fluff()
regenerate_icons()
else
to_chat(usr, "<span class='danger'>There is nothing to remove from its [remove_from].</span>")
return
if("back")
if(inventory_back)
if(inventory_back.flags & NODROP)
to_chat(usr, "<span class='warning'>\The [inventory_head] is stuck too hard to [src] for you to remove!</span>")
return
usr.put_in_hands(inventory_back)
inventory_back = null
update_corgi_fluff()
regenerate_icons()
else
to_chat(usr, "<span class='danger'>There is nothing to remove from its [remove_from].</span>")
return
if("collar")
if(pcollar)
var/the_collar = pcollar
unEquip(pcollar)
usr.put_in_hands(the_collar)
pcollar = null
update_corgi_fluff()
regenerate_icons()
show_inv(usr)
//Adding things to inventory
else if(href_list["add_inv"])
var/add_to = href_list["add_inv"]
switch(add_to)
if("collar")
add_collar(usr.get_active_hand(), usr)
update_corgi_fluff()
if("head")
place_on_head(usr.get_active_hand(),usr)
if("back")
if(inventory_back)
to_chat(usr, "<span class='warning'>It's already wearing something!</span>")
return
else
var/obj/item/item_to_add = usr.get_active_hand()
if(!item_to_add)
usr.visible_message("<span class='notice'>[usr] pets [src].</span>", "<span class='notice'>You rest your hand on [src]'s back for a moment.</span>")
return
if(!usr.unEquip(item_to_add))
to_chat(usr, "<span class='warning'>\The [item_to_add] is stuck to your hand, you cannot put it on [src]'s back!</span>")
return
if(istype(item_to_add, /obj/item/grenade/plastic/c4)) // last thing he ever wears, I guess
item_to_add.afterattack(src,usr,1)
return
//The objects that corgis can wear on their backs.
var/allowed = FALSE
if(ispath(item_to_add.dog_fashion, /datum/dog_fashion/back))
allowed = TRUE
if(!allowed)
to_chat(usr, "<span class='warning'>You set [item_to_add] on [src]'s back, but it falls off!</span>")
item_to_add.forceMove(drop_location())
if(prob(25))
step_rand(item_to_add)
for(var/i in list(1,2,4,8,4,8,4,dir))
setDir(i)
sleep(1)
return
item_to_add.forceMove(src)
inventory_back = item_to_add
update_corgi_fluff()
regenerate_icons()
show_inv(usr)
else
return ..()
//Corgis are supposed to be simpler, so only a select few objects can actually be put
//to be compatible with them. The objects are below.
//Many hats added, Some will probably be removed, just want to see which ones are popular.
// > some will probably be removed
/mob/living/simple_animal/pet/dog/corgi/proc/place_on_head(obj/item/item_to_add, mob/user)
if(istype(item_to_add, /obj/item/grenade/plastic/c4)) // last thing he ever wears, I guess
item_to_add.afterattack(src,user,1)
return
if(inventory_head)
if(user)
to_chat(user, "<span class='warning'>You can't put more than one hat on [src]!</span>")
return
if(!item_to_add)
user.visible_message("<span class='notice'>[user] pets [src].</span>", "<span class='notice'>You rest your hand on [src]'s head for a moment.</span>")
if(flags_2 & HOLOGRAM_2)
return
return
if(user && !user.unEquip(item_to_add))
to_chat(user, "<span class='warning'>\The [item_to_add] is stuck to your hand, you cannot put it on [src]'s head!</span>")
return 0
var/valid = FALSE
if(ispath(item_to_add.dog_fashion, /datum/dog_fashion/head))
valid = TRUE
//Various hats and items (worn on his head) change Ian's behaviour. His attributes are reset when a hat is removed.
if(valid)
if(health <= 0)
to_chat(user, "<span class='notice'>There is merely a dull, lifeless look in [real_name]'s eyes as you put the [item_to_add] on [p_them()].</span>")
else if(user)
user.visible_message("<span class='notice'>[user] puts [item_to_add] on [real_name]'s head. [src] looks at [user] and barks once.</span>",
"<span class='notice'>You put [item_to_add] on [real_name]'s head. [src] gives you a peculiar look, then wags [p_their()] tail once and barks.</span>",
"<span class='italics'>You hear a friendly-sounding bark.</span>")
item_to_add.forceMove(src)
inventory_head = item_to_add
update_corgi_fluff()
regenerate_icons()
else
to_chat(user, "<span class='warning'>You set [item_to_add] on [src]'s head, but it falls off!</span>")
item_to_add.forceMove(drop_location())
if(prob(25))
step_rand(item_to_add)
for(var/i in list(1,2,4,8,4,8,4,dir))
setDir(i)
sleep(1)
return valid
/mob/living/simple_animal/pet/dog/corgi/proc/update_corgi_fluff()
// First, change back to defaults
name = real_name
desc = initial(desc)
// BYOND/DM doesn't support the use of initial on lists.
speak = list("YAP", "Woof!", "Bark!", "AUUUUUU")
speak_emote = list("barks", "woofs")
emote_hear = list("barks!", "woofs!", "yaps.","pants.")
emote_see = list("shakes its head.", "chases its tail.","shivers.")
desc = initial(desc)
set_light(0)
atmos_requirements = list("min_oxy" = 5, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 1, "min_co2" = 0, "max_co2" = 5, "min_n2" = 0, "max_n2" = 0)
mutations.Remove(BREATHLESS)
minbodytemp = initial(minbodytemp)
if(inventory_head && inventory_head.dog_fashion)
var/datum/dog_fashion/DF = new inventory_head.dog_fashion(src)
DF.apply(src)
if(inventory_back && inventory_back.dog_fashion)
var/datum/dog_fashion/DF = new inventory_back.dog_fashion(src)
DF.apply(src)
/mob/living/simple_animal/pet/dog/corgi/regenerate_icons()
..()
if(inventory_head)
var/image/head_icon
var/datum/dog_fashion/DF = new inventory_head.dog_fashion(src)
if(!DF.obj_icon_state)
DF.obj_icon_state = inventory_head.icon_state
if(!DF.obj_alpha)
DF.obj_alpha = inventory_head.alpha
if(!DF.obj_color)
DF.obj_color = inventory_head.color
if(health <= 0)
head_icon = DF.get_overlay(dir = EAST)
head_icon.pixel_y = -8
head_icon.transform = turn(head_icon.transform, 180)
else
head_icon = DF.get_overlay()
add_overlay(head_icon)
if(inventory_back)
var/image/back_icon
var/datum/dog_fashion/DF = new inventory_back.dog_fashion(src)
if(!DF.obj_icon_state)
DF.obj_icon_state = inventory_back.icon_state
if(!DF.obj_alpha)
DF.obj_alpha = inventory_back.alpha
if(!DF.obj_color)
DF.obj_color = inventory_back.color
if(health <= 0)
back_icon = DF.get_overlay(dir = EAST)
back_icon.pixel_y = -11
back_icon.transform = turn(back_icon.transform, 180)
else
back_icon = DF.get_overlay()
add_overlay(back_icon)
//IAN! SQUEEEEEEEEE~
/mob/living/simple_animal/pet/dog/corgi/Ian
name = "Ian"
real_name = "Ian" //Intended to hold the name without altering it.
gender = MALE
desc = "It's the HoP's beloved corgi."
var/turns_since_scan = 0
var/obj/movement_target
response_help = "pets"
response_disarm = "bops"
response_harm = "kicks"
gold_core_spawnable = CHEM_MOB_SPAWN_INVALID
unique_pet = TRUE
var/age = 0
var/record_age = 1
var/memory_saved = FALSE
var/saved_head //path
/mob/living/simple_animal/pet/dog/corgi/Ian/Initialize(mapload)
. = ..()
//parent call must happen first to ensure IAN
//is not in nullspace when child puppies spawn
Read_Memory()
if(age == 0)
var/turf/target = get_turf(loc)
if(target)
var/mob/living/simple_animal/pet/dog/corgi/puppy/P = new /mob/living/simple_animal/pet/dog/corgi/puppy(target)
P.name = "Ian"
P.real_name = "Ian"
P.gender = MALE
P.desc = "It's the HoP's beloved corgi puppy."
Write_Memory(FALSE)
qdel(src)
return
else if(age == record_age)
icon_state = "old_corgi"
icon_living = "old_corgi"
icon_dead = "old_corgi_dead"
desc = "At a ripe old age of [record_age], Ian's not as spry as he used to be, but he'll always be the HoP's beloved corgi." //RIP
turns_per_move = 20
/mob/living/simple_animal/pet/dog/corgi/Ian/Life()
if(!stat && SSticker.current_state == GAME_STATE_FINISHED && !memory_saved)
Write_Memory(FALSE)
memory_saved = TRUE
..()
/mob/living/simple_animal/pet/dog/corgi/Ian/death()
if(!memory_saved)
Write_Memory(TRUE)
..()
/mob/living/simple_animal/pet/dog/corgi/Ian/proc/Read_Memory()
if(fexists("data/npc_saves/Ian.sav")) //legacy compatability to convert old format to new
var/savefile/S = new /savefile("data/npc_saves/Ian.sav")
S["age"] >> age
S["record_age"] >> record_age
S["saved_head"] >> saved_head
fdel("data/npc_saves/Ian.sav")
else
var/json_file = file("data/npc_saves/Ian.json")
if(!fexists(json_file))
return
var/list/json = json_decode(file2text(json_file))
age = json["age"]
record_age = json["record_age"]
saved_head = json["saved_head"]
if(isnull(age))
age = 0
if(isnull(record_age))
record_age = 1
if(saved_head)
place_on_head(new saved_head)
/mob/living/simple_animal/pet/dog/corgi/Ian/proc/Write_Memory(dead)
var/json_file = file("data/npc_saves/Ian.json")
var/list/file_data = list()
if(!dead)
file_data["age"] = age + 1
if((age + 1) > record_age)
file_data["record_age"] = record_age + 1
else
file_data["record_age"] = record_age
if(inventory_head)
file_data["saved_head"] = inventory_head.type
else
file_data["saved_head"] = null
else
file_data["age"] = 0
file_data["record_age"] = record_age
file_data["saved_head"] = null
fdel(json_file)
WRITE_FILE(json_file, json_encode(file_data))
/mob/living/simple_animal/pet/dog/corgi/Ian/handle_automated_movement()
. = ..()
//Feeding, chasing food, FOOOOODDDD
if(!resting && !buckled)
turns_since_scan++
if(turns_since_scan > 5)
turns_since_scan = 0
if((movement_target) && !(isturf(movement_target.loc) || ishuman(movement_target.loc) ))
movement_target = null
stop_automated_movement = 0
if( !movement_target || !(movement_target.loc in oview(src, 3)) )
movement_target = null
stop_automated_movement = 0
for(var/obj/item/reagent_containers/food/snacks/S in oview(src,3))
if(isturf(S.loc) || ishuman(S.loc))
movement_target = S
break
if(movement_target)
spawn(0)
stop_automated_movement = 1
step_to(src,movement_target,1)
sleep(3)
step_to(src,movement_target,1)
sleep(3)
step_to(src,movement_target,1)
if(movement_target) //Not redundant due to sleeps, Item can be gone in 6 decisecomds
if(movement_target.loc.x < src.x)
dir = WEST
else if(movement_target.loc.x > src.x)
dir = EAST
else if(movement_target.loc.y < src.y)
dir = SOUTH
else if(movement_target.loc.y > src.y)
dir = NORTH
else
dir = SOUTH
if(!Adjacent(movement_target)) //can't reach food through windows.
return
if(isturf(movement_target.loc) )
movement_target.attack_animal(src)
else if(ishuman(movement_target.loc) )
if(prob(20))
custom_emote(1, "stares at [movement_target.loc]'s [movement_target] with a sad puppy-face")
if(prob(1))
custom_emote(1, pick("dances around.","chases its tail!"))
spin(20, 1)
/obj/item/reagent_containers/food/snacks/meat/corgi
name = "Corgi meat"
desc = "Tastes like... well you know..."
/mob/living/simple_animal/pet/dog/corgi/Ian/narsie_act()
playsound(src, 'sound/misc/demon_dies.ogg', 75, TRUE)
var/mob/living/simple_animal/pet/dog/corgi/narsie/N = new(loc)
N.setDir(dir)
gib()
/mob/living/simple_animal/pet/dog/corgi/narsie
name = "Nars-Ian"
desc = "Ia! Ia!"
icon_state = "narsian"
icon_living = "narsian"
icon_dead = "narsian_dead"
faction = list("neutral", "cult")
gold_core_spawnable = CHEM_MOB_SPAWN_INVALID
nofur = TRUE
unique_pet = TRUE
/mob/living/simple_animal/pet/dog/corgi/narsie/Life()
..()
for(var/mob/living/simple_animal/pet/P in range(1, src))
if(P != src && !istype(P, /mob/living/simple_animal/pet/dog/corgi/narsie))
visible_message("<span class='warning'>[src] devours [P]!</span>", \
"<span class='cult big bold'>DELICIOUS SOULS</span>")
playsound(src, 'sound/misc/demon_attack1.ogg', 75, TRUE)
narsie_act()
if(P.mind)
if(P.mind.hasSoul)
P.mind.hasSoul = FALSE //Nars-Ian ate your soul; you don't have one anymore
else
visible_message("<span class='cult big bold'>... Aw, someone beat me to this one.</span>")
P.gib()
/mob/living/simple_animal/pet/dog/corgi/narsie/update_corgi_fluff()
..()
speak = list("Tari'karat-pasnar!", "IA! IA!", "BRRUUURGHGHRHR")
speak_emote = list("growls", "barks ominously")
emote_hear = list("barks echoingly!", "woofs hauntingly!", "yaps in an eldritch manner.", "mutters something unspeakable.")
emote_see = list("communes with the unnameable.", "ponders devouring some souls.", "shakes.")
/mob/living/simple_animal/pet/dog/corgi/narsie/narsie_act()
adjustBruteLoss(-maxHealth)
/mob/living/simple_animal/pet/dog/corgi/puppy
name = "\improper corgi puppy"
real_name = "corgi"
desc = "It's a corgi puppy!"
icon_state = "puppy"
icon_living = "puppy"
icon_dead = "puppy_dead"
density = FALSE
pass_flags = PASSMOB
mob_size = MOB_SIZE_SMALL
collar_type = "puppy"
//puppies cannot wear anything.
/mob/living/simple_animal/pet/dog/corgi/puppy/Topic(href, href_list)
if(href_list["remove_inv"] || href_list["add_inv"])
to_chat(usr, "<span class='warning'>You can't fit this on [src]!</span>")
return
..()
/mob/living/simple_animal/pet/dog/corgi/puppy/void //Tribute to the corgis born in nullspace
name = "\improper void puppy"
real_name = "voidy"
desc = "A corgi puppy that has been infused with deep space energy. It's staring back..."
icon_state = "void_puppy"
icon_living = "void_puppy"
icon_dead = "void_puppy_dead"
nofur = TRUE
unsuitable_atmos_damage = 0
minbodytemp = TCMB
maxbodytemp = T0C + 40
/mob/living/simple_animal/pet/dog/corgi/puppy/void/Process_Spacemove(movement_dir = 0)
return 1 //Void puppies can navigate space.
//LISA! SQUEEEEEEEEE~
/mob/living/simple_animal/pet/dog/corgi/Lisa
name = "Lisa"
real_name = "Lisa"
gender = FEMALE
desc = "It's a corgi with a cute pink bow."
gold_core_spawnable = CHEM_MOB_SPAWN_INVALID
unique_pet = TRUE
icon_state = "lisa"
icon_living = "lisa"
icon_dead = "lisa_dead"
response_help = "pets"
response_disarm = "bops"
response_harm = "kicks"
var/turns_since_scan = 0
var/puppies = 0
//Lisa already has a cute bow!
/mob/living/simple_animal/pet/dog/corgi/Lisa/Topic(href, href_list)
if(href_list["remove_inv"] || href_list["add_inv"])
to_chat(usr, "<span class='danger'>[src] already has a cute bow!</span>")
return
..()
/mob/living/simple_animal/pet/dog/corgi/Lisa/Life()
..()
make_babies()
/mob/living/simple_animal/pet/dog/corgi/Lisa/handle_automated_movement()
. = ..()
if(!resting && !buckled)
if(prob(1))
custom_emote(1, pick("dances around.","chases her tail."))
spin(20, 1)
/mob/living/simple_animal/pet/dog/corgi/exoticcorgi
name = "Exotic Corgi"
desc = "As cute as it is colorful!"
icon = 'icons/mob/pets.dmi'
icon_state = "corgigrey"
icon_living = "corgigrey"
icon_dead = "corgigrey_dead"
animal_species = /mob/living/simple_animal/pet/dog/corgi/exoticcorgi
nofur = TRUE
/mob/living/simple_animal/pet/dog/corgi/exoticcorgi/Initialize(mapload)
. = ..()
var/newcolor = rgb(rand(0, 255), rand(0, 255), rand(0, 255))
add_atom_colour(newcolor, FIXED_COLOUR_PRIORITY)
/mob/living/simple_animal/pet/dog/corgi/borgi
name = "E-N"
real_name = "E-N" //Intended to hold the name without altering it.
desc = "It's a borgi."
icon_state = "borgi"
icon_living = "borgi"
bark_sound = null //No robo-bjork...
yelp_sound = null //Or robo-Yelp.
var/emagged = 0
atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0)
minbodytemp = 0
loot = list(/obj/effect/decal/cleanable/blood/gibs/robot)
del_on_death = 1
deathmessage = "blows apart!"
animal_species = /mob/living/simple_animal/pet/dog/corgi/borgi
nofur = TRUE
/mob/living/simple_animal/pet/dog/corgi/borgi/emag_act(user as mob)
if(!emagged)
emagged = 1
visible_message("<span class='warning'>[user] swipes a card through [src].</span>", "<span class='notice'>You overload [src]s internal reactor.</span>")
addtimer(CALLBACK(src, .proc/explode), 1000)
/mob/living/simple_animal/pet/dog/corgi/borgi/proc/explode()
visible_message("<span class='warning'>[src] makes an odd whining noise.</span>")
explosion(get_turf(src), 0, 1, 4, 7)
death()
/mob/living/simple_animal/pet/dog/corgi/borgi/proc/shootAt(var/atom/movable/target)
var/turf/T = get_turf(src)
var/turf/U = get_turf(target)
if(!T || !U)
return
var/obj/item/projectile/beam/A = new /obj/item/projectile/beam(loc)
A.icon = 'icons/effects/genetics.dmi'
A.icon_state = "eyelasers"
playsound(src.loc, 'sound/weapons/taser2.ogg', 75, 1)
A.current = T
A.yo = U.y - T.y
A.xo = U.x - T.x
A.fire()
/mob/living/simple_animal/pet/dog/corgi/borgi/Life(seconds, times_fired)
..()
//spark for no reason
if(prob(5))
do_sparks(3, 1, src)
/mob/living/simple_animal/pet/dog/corgi/borgi/handle_automated_action()
if(emagged && prob(25))
var/mob/living/carbon/target = locate() in view(10, src)
if(target)
shootAt(target)
/mob/living/simple_animal/pet/dog/corgi/borgi/death(gibbed)
// Only execute the below if we successfully died
. = ..(gibbed)
if(!.)
return FALSE
do_sparks(3, 1, src)
///Pugs
/mob/living/simple_animal/pet/dog/pug
name = "\improper pug"
real_name = "pug"
desc = "It's a pug."
icon = 'icons/mob/pets.dmi'
icon_state = "pug"
icon_living = "pug"
icon_dead = "pug_dead"
butcher_results = list(/obj/item/reagent_containers/food/snacks/meat/pug = 3)
gold_core_spawnable = CHEM_MOB_SPAWN_FRIENDLY
collar_type = "pug"
/mob/living/simple_animal/pet/pug/handle_automated_movement()
. = ..()
if(!resting && !buckled)
if(prob(1))
custom_emote(1, pick("chases its tail."))
spawn(0)
for(var/i in list(1, 2, 4, 8, 4, 2, 1, 2, 4, 8, 4, 2, 1, 2, 4, 8, 4, 2))
dir = i
sleep(1)
@@ -1,5 +1,5 @@
//Foxxy
/mob/living/simple_animal/pet/fox
/mob/living/simple_animal/pet/dog/fox
name = "fox"
desc = "It's a fox. I wonder what it says?"
icon_state = "fox"
@@ -20,13 +20,14 @@
gold_core_spawnable = CHEM_MOB_SPAWN_FRIENDLY
//Captain fox
/mob/living/simple_animal/pet/fox/Renault
/mob/living/simple_animal/pet/dog/fox/Renault
name = "Renault"
desc = "Renault, the Captain's trustworthy fox. I wonder what it says?"
unique_pet = TRUE
gold_core_spawnable = CHEM_MOB_SPAWN_INVALID
//Syndi fox
/mob/living/simple_animal/pet/fox/Syndifox
/mob/living/simple_animal/pet/dog/fox/Syndifox
name = "Syndifox"
desc = "Syndifox, the Syndicate's most respected mascot. I wonder what it says?"
icon_state = "Syndifox"
@@ -35,6 +36,7 @@
icon_resting = "Syndifox_rest"
mutations = list(BREATHLESS)
faction = list("syndicate")
unique_pet = TRUE
gold_core_spawnable = CHEM_MOB_SPAWN_INVALID
atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0)
minbodytemp = 0
@@ -168,6 +168,7 @@
response_help = "pets"
response_disarm = "gently pushes aside"
response_harm = "splats"
unique_pet = TRUE
gold_core_spawnable = CHEM_MOB_SPAWN_INVALID
@@ -1,31 +1,16 @@
/mob/living/simple_animal/pet
icon = 'icons/mob/pets.dmi'
can_collar = 1
mob_size = MOB_SIZE_SMALL
blood_volume = BLOOD_VOLUME_NORMAL
can_collar = TRUE
/mob/living/simple_animal/pet/attackby(var/obj/item/O as obj, var/mob/user as mob, params)
/mob/living/simple_animal/pet/attackby(obj/item/O, mob/user, params)
if(istype(O, /obj/item/newspaper))
if(!stat)
user.visible_message("[user] baps [name] on the nose with the rolled up [O].")
user.visible_message("<span class='notice'>[user] baps [name] on the nose with the rolled up [O].</span>")
spawn(0)
for(var/i in list(1,2,4,8,4,2,1,2))
dir = i
setDir(i)
sleep(1)
else
..()
/mob/living/simple_animal/pet/revive()
..()
regenerate_icons()
/mob/living/simple_animal/pet/death(gibbed)
. = ..()
regenerate_icons()
/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"
return ..()
@@ -1,30 +0,0 @@
//Corgi //best comment 2014
/mob/living/simple_animal/pet/pug
name = "\improper pug"
real_name = "pug"
desc = "It's a pug."
icon_state = "pug"
icon_living = "pug"
icon_dead = "pug_dead"
speak = list("YAP", "Woof!", "Bark!", "AUUUUUU")
speak_emote = list("barks", "woofs")
emote_hear = list("barks!", "woofs!", "yaps.","pants.")
emote_see = list("shakes its head.", "chases its tail.","shivers.")
speak_chance = 1
turns_per_move = 10
butcher_results = list(/obj/item/reagent_containers/food/snacks/meat/pug = 3)
response_help = "pets"
response_disarm = "bops"
response_harm = "kicks"
see_in_dark = 5
gold_core_spawnable = CHEM_MOB_SPAWN_FRIENDLY
/mob/living/simple_animal/pet/pug/handle_automated_movement()
. = ..()
if(!resting && !buckled)
if(prob(1))
custom_emote(1, pick("chases its tail."))
spawn(0)
for(var/i in list(1, 2, 4, 8, 4, 2, 1, 2, 4, 8, 4, 2, 1, 2, 4, 8, 4, 2))
dir = i
sleep(1)
@@ -28,4 +28,5 @@
/mob/living/simple_animal/pet/sloth/paperwork
name = "Paperwork"
desc = "Cargo's pet sloth. About as useful as the rest of the techs."
unique_pet = TRUE
gold_core_spawnable = CHEM_MOB_SPAWN_INVALID
@@ -16,5 +16,5 @@
harm_intent_damage = 3
melee_damage_lower = 15
melee_damage_upper = 20
unique_pet = TRUE
atmos_requirements = list("min_oxy" = 5, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 2, "min_co2" = 0, "max_co2" = 5, "min_n2" = 0, "max_n2" = 0)
@@ -135,7 +135,7 @@
dat += "<tr><td><B>Headset:</B></td><td><A href='?src=[UID()];[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>&nbsp;</td></tr>"
dat += "<tr><td><B>Collar:</B></td><td><A href='?src=[UID()];[collar?"remove_inv":"add_inv"]=collar'>[(collar && !(collar.flags&ABSTRACT)) ? collar : "<font color=grey>Empty</font>"]</A></td></tr>"
dat += "<tr><td><B>Collar:</B></td><td><A href='?src=[UID()];[pcollar ? "remove_inv" : "add_inv"]=collar'>[(pcollar && !(pcollar.flags&ABSTRACT)) ? pcollar : "<font color=grey>Empty</font>"]</A></td></tr>"
dat += {"</table>
<A href='?src=[user.UID()];mach_close=mob\ref[src]'>Close</A>
@@ -697,6 +697,7 @@
"What were the wires again?",
"Goddam emaggers!"
)
unique_pet = TRUE
gold_core_spawnable = CHEM_MOB_SPAWN_INVALID
/mob/living/simple_animal/parrot/Poly/New()
@@ -61,8 +61,10 @@
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
var/obj/item/clothing/accessory/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
//Hot simple_animal baby making vars
var/list/childtype = null
@@ -109,15 +111,12 @@
verbs -= /mob/verb/observe
if(!can_hide)
verbs -= /mob/living/simple_animal/verb/hide
if(collar)
if(!istype(collar))
collar = new(src)
if(pcollar)
pcollar = new(src)
regenerate_icons()
/mob/living/simple_animal/Destroy()
if(collar)
collar.forceMove(loc)
collar = null
QDEL_NULL(pcollar)
master_commander = null
GLOB.simple_animals[AIStatus] -= src
if(SSnpcpool.state == SS_PAUSED && LAZYLEN(SSnpcpool.currentrun))
@@ -133,6 +132,11 @@
return ..()
/mob/living/simple_animal/handle_atom_del(atom/A)
if(A == pcollar)
pcollar = null
return ..()
/mob/living/simple_animal/examine(mob/user)
. = ..()
if(stat == DEAD)
@@ -147,11 +151,17 @@
..()
if(icon_resting && stat != DEAD)
icon_state = icon_resting
if(collar_type)
collar_type = "[initial(collar_type)]_rest"
regenerate_icons()
/mob/living/simple_animal/StopResting(updating = 1)
..()
if(icon_resting && stat != DEAD)
icon_state = icon_living
if(collar_type)
collar_type = "[initial(collar_type)]"
regenerate_icons()
/mob/living/simple_animal/update_stat(reason = "none given")
if(status_flags & GODMODE)
@@ -278,6 +288,9 @@
for(var/path in butcher_results)
for(var/i in 1 to butcher_results[path])
new path(Tsec)
if(pcollar)
pcollar.forceMove(drop_location())
pcollar = null
..()
/mob/living/simple_animal/emote(act, m_type = 1, message = null, force)
@@ -348,6 +361,9 @@
if(flip_on_death)
transform = transform.Turn(180)
density = 0
if(collar_type)
collar_type = "[initial(collar_type)]_dead"
regenerate_icons()
/mob/living/simple_animal/proc/CanAttack(atom/the_target)
if(see_invisible < the_target.invisibility)
@@ -387,6 +403,9 @@
density = initial(density)
update_canmove()
flying = initial(flying)
if(collar_type)
collar_type = "[initial(collar_type)]"
regenerate_icons()
/mob/living/simple_animal/proc/make_babies() // <3 <3 <3
if(gender != FEMALE || stat || next_scan_time > world.time || !childtype || !animal_species || !SSticker.IsRoundInProgress())
@@ -421,7 +440,7 @@
return
user.set_machine(src)
var/dat = "<table><tr><td><B>Collar:</B></td><td><A href='?src=[UID()];item=[slot_collar]'>[(collar && !(collar.flags&ABSTRACT)) ? collar : "<font color=grey>Empty</font>"]</A></td></tr></table>"
var/dat = "<table><tr><td><B>Collar:</B></td><td><A href='?src=[UID()];item=[slot_collar]'>[(pcollar && !(pcollar.flags & ABSTRACT)) ? pcollar : "<font color=grey>Empty</font>"]</A></td></tr></table>"
dat += "<A href='?src=[user.UID()];mach_close=mob\ref[src]'>Close</A>"
var/datum/browser/popup = new(user, "mob\ref[src]", "[src]", 440, 250)
@@ -431,14 +450,14 @@
/mob/living/simple_animal/get_item_by_slot(slot_id)
switch(slot_id)
if(slot_collar)
return collar
return pcollar
. = ..()
/mob/living/simple_animal/can_equip(obj/item/I, slot, disable_warning = 0)
// . = ..() // Do not call parent. We do not want animals using their hand slots.
switch(slot)
if(slot_collar)
if(collar)
if(pcollar)
return FALSE
if(!can_collar)
return FALSE
@@ -453,32 +472,26 @@
if(!slot)
return FALSE
W.forceMove(src)
W.equipped(src, slot)
W.layer = ABOVE_HUD_LAYER
W.plane = ABOVE_HUD_PLANE
switch(slot)
if(slot_collar)
collar = W
if(collar.tagname)
name = collar.tagname
real_name = collar.tagname
regenerate_icons()
add_collar(W)
/mob/living/simple_animal/unEquip(obj/item/I, force)
. = ..()
if(!. || !I)
return
if(I == collar)
collar = null
if(I == pcollar)
pcollar = null
regenerate_icons()
/mob/living/simple_animal/get_access()
. = ..()
if(collar)
. |= collar.GetAccess()
if(pcollar)
. |= pcollar.GetAccess()
/mob/living/simple_animal/update_canmove(delay_action_updates = 0)
if(paralysis || stunned || weakened || stat || resting)
@@ -572,4 +585,25 @@
..()
if(AIStatus == AI_Z_OFF)
SSidlenpcpool.idle_mobs_by_zlevel[old_z] -= src
toggle_ai(initial(AIStatus))
toggle_ai(initial(AIStatus))
/mob/living/simple_animal/proc/add_collar(obj/item/clothing/accessory/petcollar/P, mob/user)
if(QDELETED(P) || pcollar)
return
if(user && !user.unEquip(P))
return
P.forceMove(src)
P.equipped(src)
pcollar = P
regenerate_icons()
if(user)
to_chat(user, "<span class='notice'>You put [P] around [src]'s neck.</span>")
if(P.tagname && !unique_pet)
name = P.tagname
real_name = P.tagname
/mob/living/simple_animal/regenerate_icons()
cut_overlays()
if(pcollar && collar_type)
add_overlay("[collar_type]collar")
add_overlay("[collar_type]tag")
+4 -5
View File
@@ -184,8 +184,7 @@
for(var/t in bodyparts) //this really should not be necessary
qdel(t)
var/mob/living/simple_animal/pet/corgi/new_corgi = new /mob/living/simple_animal/pet/corgi (loc)
new_corgi.a_intent = INTENT_HARM
var/mob/living/simple_animal/pet/dog/corgi/new_corgi = new /mob/living/simple_animal/pet/dog/corgi (loc)
new_corgi.key = key
to_chat(new_corgi, "<B>You are now a Corgi. Yap Yap!</B>")
@@ -277,7 +276,7 @@
return 0
if(ispath(MP, /mob/living/simple_animal/pet/cat))
return 1
if(ispath(MP, /mob/living/simple_animal/pet/corgi))
if(ispath(MP, /mob/living/simple_animal/pet/dog/corgi))
return 1
if(ispath(MP, /mob/living/simple_animal/crab))
return 1
@@ -288,9 +287,9 @@
if(ispath(MP, /mob/living/simple_animal/parrot))
return 1
if(!GAMEMODE_IS_NUCLEAR)
if(ispath(MP, /mob/living/simple_animal/pet/fox/Syndifox))
if(ispath(MP, /mob/living/simple_animal/pet/dog/fox/Syndifox))
return 0
if(ispath(MP, /mob/living/simple_animal/pet/fox))
if(ispath(MP, /mob/living/simple_animal/pet/dog/fox))
return 1
if(ispath(MP, /mob/living/simple_animal/chick))
return 1