Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds the Cat and Dog Person traits #36963

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions code/__DEFINES/traits.dm
Expand Up @@ -59,6 +59,8 @@
#define TRAIT_SKITTISH "skittish"
#define TRAIT_POOR_AIM "poor_aim"
#define TRAIT_PROSOPAGNOSIA "prosopagnosia"
#define TRAIT_DOG_PERSON "dog_person" //you like dogs more than cats!
#define TRAIT_CAT_PERSON "cat_person" //you like cats more than dogs!

// common trait sources
#define TRAIT_GENERIC "generic"
Expand Down
25 changes: 25 additions & 0 deletions code/datums/mood_events/generic_positive_events.dm
Expand Up @@ -23,6 +23,31 @@
mood_change = 3
timeout = 3000

/datum/mood_event/pet_corgi_dogperson
description = "<span class='nicegreen'>WHO'S A GOOD BOY? IS IT YOU? ARE YOU THE GOOD BOY???</span>\n"
mood_change = 5
timeout = 3000

/datum/mood_event/pet_corgi_catperson
description = "<span class='nicegreen'>Hehe, dogs are cute.</span>\n"
mood_change = 1
timeout = 3000

/datum/mood_event/pet_cat
description = "<span class='nicegreen'>I pet a cat, and it didn't even bite me!</span>\n"
mood_change = 3
timeout = 3000

/datum/mood_event/pet_cat_catperson
description = "<span class='nicegreen'>I pet a cat and it was FLUFFY.</span>\n"
mood_change = 5
timeout = 3000

/datum/mood_event/pet_cat_dogperson
description = "<span class='nicegreen'>Are all cats this content to laze around?</span>\n" //yes.
mood_change = 1
timeout = 3000

/datum/mood_event/honk
description = "<span class='nicegreen'>Maybe clowns aren't so bad after all. Honk!</span>\n"
mood_change = 2
Expand Down
16 changes: 16 additions & 0 deletions code/datums/traits/neutral.dm
Expand Up @@ -12,6 +12,14 @@



/datum/trait/cat_person
name = "Cat Person"
desc = "You are a firm believer in the theory that cats are the fluffiest animal in the universe."
value = 0
mob_trait = TRAIT_CAT_PERSON



/datum/trait/deviant_tastes
name = "Deviant Tastes"
desc = "You dislike food that most people enjoy, and find delicious what they don't."
Expand All @@ -34,6 +42,14 @@



/datum/trait/dog_person
name = "Dog Person"
desc = "You get along very well with dogs. You love them SO MUCH."
value = 0
mob_trait = TRAIT_DOG_PERSON



/datum/trait/monochromatic
name = "Monochromacy"
desc = "You suffer from full colorblindness, and perceive nearly the entire world in blacks and whites."
Expand Down
11 changes: 10 additions & 1 deletion code/modules/mob/living/simple_animal/friendly/cat.dm
Expand Up @@ -234,11 +234,20 @@
if("harm")
wuv(-1, M)

/mob/living/simple_animal/pet/cat/proc/wuv(change, mob/M)
/mob/living/simple_animal/pet/cat/proc/wuv(change, mob/living/M)
if(change)
if(change > 0)
if(M && stat != DEAD)
new /obj/effect/temp_visual/heart(loc)
if(M.has_trait(TRAIT_CAT_PERSON))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uhm this is all backwards.

Send only a signal that a cat has been petted.

then let the thing that processes the signal figure out what trait the person has.

You're leaking the systems abstractions

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless I misunderstand moodlet code, wouldn't that require me to check every moodlet event to see if it's a certain type, and if so, if the traits were present?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, yes. You will have to edit moodlet code to allow for some moodlets to receive nonstandard signals.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Qustinnus didn't I make you do this for something else, how did you implement it?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think my case was unique because everyone gets the same moodlet (table) except I modified it after if you are a catperson. Ill look into a different way of approaching this

if(M.has_trait(TRAIT_DOG_PERSON))
M.SendSignal(COMSIG_ADD_MOOD_EVENT, "wuv", /datum/mood_event/pet_cat)
else
M.SendSignal(COMSIG_ADD_MOOD_EVENT, "wuv", /datum/mood_event/pet_cat_catperson)
else if(M.has_trait(TRAIT_DOG_PERSON))
M.SendSignal(COMSIG_ADD_MOOD_EVENT, "wuv", /datum/mood_event/pet_cat_dogperson)
else
M.SendSignal(COMSIG_ADD_MOOD_EVENT, "wuv", /datum/mood_event/pet_cat)
emote("me", 1, "purrs!")
else
if(M && stat != DEAD)
Expand Down
24 changes: 20 additions & 4 deletions code/modules/mob/living/simple_animal/friendly/dog.dm
Expand Up @@ -220,7 +220,7 @@
//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)
/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)
Expand All @@ -232,7 +232,15 @@
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>")
user.SendSignal(COMSIG_ADD_MOOD_EVENT, "pet_corgi", /datum/mood_event/pet_corgi)
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))
Expand Down Expand Up @@ -609,13 +617,21 @@
if("harm")
wuv(-1,M)

/mob/living/simple_animal/pet/dog/proc/wuv(change, mob/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!")
M.SendSignal(COMSIG_ADD_MOOD_EVENT, "pet_corgi", /datum/mood_event/pet_corgi)
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!")