mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-31 09:08:30 +01:00
* Fixes the exploit allowing you to stack up absurd mood bonuses using the Holodeck pet garden. Petting 10 animals no longer counts as individual mood bonuses, and will instead replace eachother. (#67178) Fixes the exploit allowing you to stack up absurd mood bonuses using the Holodeck pet garden * Fixes the exploit allowing you to stack up absurd mood bonuses using the Holodeck pet garden. Petting 10 animals no longer counts as individual mood bonuses, and will instead replace eachother. Co-authored-by: Iamgoofball <iamgoofball@gmail.com>
39 lines
1.3 KiB
Plaintext
39 lines
1.3 KiB
Plaintext
/**
|
|
* # Pet bonus element!
|
|
*
|
|
* Bespoke element that plays a fun message, sends a heart out, and gives a stronger mood bonus when you pet this animal.
|
|
* I may have been able to make this work for carbons, but it would have been interjecting on some help mode interactions anyways.
|
|
*/
|
|
/datum/element/pet_bonus
|
|
element_flags = ELEMENT_BESPOKE|ELEMENT_DETACH
|
|
id_arg_index = 2
|
|
|
|
///optional cute message to send when you pet your pet!
|
|
var/emote_message
|
|
///actual moodlet given, defaults to the pet animal one
|
|
var/moodlet
|
|
|
|
/datum/element/pet_bonus/Attach(datum/target, emote_message, moodlet = /datum/mood_event/pet_animal)
|
|
. = ..()
|
|
if(!isliving(target))
|
|
return ELEMENT_INCOMPATIBLE
|
|
|
|
src.emote_message = emote_message
|
|
src.moodlet = moodlet
|
|
RegisterSignal(target, COMSIG_ATOM_ATTACK_HAND, .proc/on_attack_hand)
|
|
|
|
/datum/element/pet_bonus/Detach(datum/target)
|
|
. = ..()
|
|
UnregisterSignal(target, COMSIG_ATOM_ATTACK_HAND)
|
|
|
|
/datum/element/pet_bonus/proc/on_attack_hand(mob/living/pet, mob/living/petter, list/modifiers)
|
|
SIGNAL_HANDLER
|
|
|
|
if(pet.stat != CONSCIOUS || petter.combat_mode || LAZYACCESS(modifiers, RIGHT_CLICK))
|
|
return
|
|
|
|
new /obj/effect/temp_visual/heart(pet.loc)
|
|
if(emote_message && prob(33))
|
|
pet.manual_emote(emote_message)
|
|
SEND_SIGNAL(petter, COMSIG_ADD_MOOD_EVENT, "petting_bonus", moodlet, pet)
|