/
dog.dm
637 lines (553 loc) · 20 KB
/
dog.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
//Dogs.
/mob/living/simple_animal/pet/dog
mob_biotypes = list(MOB_ORGANIC, MOB_BEAST)
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("dog")
see_in_dark = 5
speak_chance = 1
turns_per_move = 10
//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/slab/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
var/shaved = 0
var/obj/item/inventory_head
var/obj/item/inventory_back
var/nofur = 0 //Corgis that have risen past the material plane of existence.
gold_core_spawnable = FRIENDLY_SPAWN
can_be_held = TRUE
collar_type = "corgi"
/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/slab/pug = 3)
gold_core_spawnable = FRIENDLY_SPAWN
collar_type = "pug"
/mob/living/simple_animal/pet/dog/Initialize()
. = ..()
var/dog_area = get_area(src)
for(var/obj/structure/bed/dogbed/D in dog_area)
if(!D.owner)
D.update_owner(src)
break
/mob/living/simple_animal/pet/dog/corgi/Initialize()
. = ..()
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)
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>"
user << browse(dat, text("window=mob[];size=325x500", real_name))
onclose(user, "mob[real_name]")
return
/mob/living/simple_animal/pet/dog/corgi/getarmor(def_zone, type)
var/armorval = 0
if(def_zone)
if(def_zone == BODY_ZONE_HEAD)
if(inventory_head)
armorval = inventory_head.armor.getRating(type)
else
if(inventory_back)
armorval = inventory_back.armor.getRating(type)
return armorval
else
if(inventory_head)
armorval += inventory_head.armor.getRating(type)
if(inventory_back)
armorval += inventory_back.armor.getRating(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("[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("[user] shaves [src]'s hair using \the [O].")
playsound(loc, 'sound/items/welder2.ogg', 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
..()
update_corgi_fluff()
/mob/living/simple_animal/pet/dog/corgi/mob_pickup(mob/living/L)
var/obj/item/clothing/head/mob_holder/holder = new(get_turf(src), src, "corgi", null, 'icons/mob/pets_held_lh.dmi', 'icons/mob/pets_held_rh.dmi', FALSE)
if(!L.put_in_hands(holder))
qdel(holder)
else
L.visible_message("<span class='warning'>[L] scoops up [src]!</span>")
/mob/living/simple_animal/pet/dog/corgi/Topic(href, href_list)
if(usr.stat)
return
//Removing from inventory
if(href_list["remove_inv"])
if(!Adjacent(usr) || !(ishuman(usr) || ismonkey(usr) || iscyborg(usr) || isalienadult(usr)))
return
var/remove_from = href_list["remove_inv"]
switch(remove_from)
if(BODY_ZONE_HEAD)
if(inventory_head)
inventory_head.forceMove(drop_location())
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)
inventory_back.forceMove(drop_location())
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
show_inv(usr)
//Adding things to inventory
else if(href_list["add_inv"])
if(!Adjacent(usr) || !(ishuman(usr) || ismonkey(usr) || iscyborg(usr) || isalienadult(usr)))
return
var/add_to = href_list["add_inv"]
switch(add_to)
if(BODY_ZONE_HEAD)
place_on_head(usr.get_active_held_item(),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_held_item()
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(!usr.temporarilyRemoveItemFromInventory(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)) // 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)
src.inventory_back = item_to_add
update_corgi_fluff()
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.
// > some will probably be removed
/mob/living/simple_animal/pet/dog/corgi/proc/place_on_head(obj/item/item_to_add, mob/living/user)
if(istype(item_to_add, /obj/item/grenade/plastic)) // 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>")
if(user.has_trait(TRAIT_DOG_PERSON))
if(user.has_trait(TRAIT_CAT_PERSON))
user.SendSignal(COMSIG_ADD_MOOD_EVENT, "wuv", /datum/mood_event/pet_corgi)
else
user.SendSignal(COMSIG_ADD_MOOD_EVENT, "wuv", /datum/mood_event/pet_corgi_dogperson)
else if(user.has_trait(TRAIT_CAT_PERSON))
user.SendSignal(COMSIG_ADD_MOOD_EVENT, "wuv", /datum/mood_event/pet_corgi_catperson)
else
user.SendSignal(COMSIG_ADD_MOOD_EVENT, "wuv", /datum/mood_event/pet_corgi)
return
if(user && !user.temporarilyRemoveItemFromInventory(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("[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.forceMove(src)
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)
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)
//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 = NO_SPAWN
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()
. = ..()
//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)
return INITIALIZE_HINT_QDEL
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/Life()
..()
//Feeding, chasing food, FOOOOODDDD
if(!stat && !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)
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)
setDir(WEST)
else if (movement_target.loc.x > src.x)
setDir(EAST)
else if (movement_target.loc.y < src.y)
setDir(SOUTH)
else if (movement_target.loc.y > src.y)
setDir(NORTH)
else
setDir(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))
emote("me", 1, "stares at [movement_target.loc]'s [movement_target] with a sad puppy-face")
if(prob(1))
emote("me", 1, pick("dances around.","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))
setDir(i)
sleep(1)
/mob/living/simple_animal/pet/dog/corgi/Ian/narsie_act()
playsound(src, 'sound/magic/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("dog", "cult")
gold_core_spawnable = NO_SPAWN
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 && prob(5))
visible_message("<span class='warning'>[src] devours [P]!</span>", \
"<span class='cult big bold'>DELICIOUS SOULS</span>")
playsound(src, 'sound/magic/demon_attack1.ogg', 75, TRUE)
narsie_act()
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/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)
return
/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 = 1
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 = NO_SPAWN
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()
if(!stat && !resting && !buckled)
if(prob(1))
emote("me", 1, pick("dances around.","chases her 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))
setDir(i)
sleep(1)
/mob/living/simple_animal/pet/dog/pug/Life()
..()
if(!stat && !resting && !buckled)
if(prob(1))
emote("me", 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))
setDir(i)
sleep(1)
/mob/living/simple_animal/pet/dog/attack_hand(mob/living/carbon/human/M)
. = ..()
switch(M.a_intent)
if("help")
wuv(1,M)
if("harm")
wuv(-1,M)
/mob/living/simple_animal/pet/dog/proc/wuv(change, mob/living/M)
if(change)
if(change > 0)
if(M && stat != DEAD) // Added check to see if this mob (the dog) is dead to fix issue 2454
new /obj/effect/temp_visual/heart(loc)
emote("me", 1, "yaps happily!")
if(M.has_trait(TRAIT_DOG_PERSON))
if(M.has_trait(TRAIT_CAT_PERSON))
M.SendSignal(COMSIG_ADD_MOOD_EVENT, "wuv", /datum/mood_event/pet_corgi)
else
M.SendSignal(COMSIG_ADD_MOOD_EVENT, "wuv", /datum/mood_event/pet_corgi_dogperson)
else if(M.has_trait(TRAIT_CAT_PERSON))
M.SendSignal(COMSIG_ADD_MOOD_EVENT, "wuv", /datum/mood_event/pet_corgi_catperson)
else
M.SendSignal(COMSIG_ADD_MOOD_EVENT, "wuv", /datum/mood_event/pet_corgi)
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)
emote("me", 1, "growls!")