forked from tgstation/tgstation
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'TG/master' into merge-upstream
- Loading branch information
Showing
51 changed files
with
885 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/// Changes a food item's food buff to something else when it has "love" reagent within | ||
/datum/element/love_food_buff | ||
element_flags = ELEMENT_BESPOKE | ||
argument_hash_start_idx = 2 | ||
/// Buff typepath to add when our food has love within | ||
var/love_buff_type | ||
|
||
/datum/element/love_food_buff/Attach(datum/target, love_buff_type) | ||
. = ..() | ||
if(!istype(target, /obj/item/food)) | ||
return ELEMENT_INCOMPATIBLE | ||
var/obj/item/food/food = target | ||
if(isnull(food.reagents)) | ||
return ELEMENT_INCOMPATIBLE | ||
|
||
src.love_buff_type = love_buff_type | ||
RegisterSignals(food.reagents, list( | ||
COMSIG_REAGENTS_ADD_REAGENT, | ||
COMSIG_REAGENTS_CLEAR_REAGENTS, | ||
COMSIG_REAGENTS_DEL_REAGENT, | ||
COMSIG_REAGENTS_NEW_REAGENT, | ||
COMSIG_REAGENTS_REM_REAGENT, | ||
), PROC_REF(on_reagents_changed)) | ||
RegisterSignal(food, COMSIG_ATOM_EXAMINE, PROC_REF(on_examine)) | ||
|
||
/datum/element/love_food_buff/Detach(datum/source, ...) | ||
var/obj/item/food/food = source | ||
if(istype(food) && !isnull(food.reagents)) | ||
UnregisterSignal(food.reagents, list( | ||
COMSIG_REAGENTS_ADD_REAGENT, | ||
COMSIG_REAGENTS_CLEAR_REAGENTS, | ||
COMSIG_REAGENTS_DEL_REAGENT, | ||
COMSIG_REAGENTS_NEW_REAGENT, | ||
COMSIG_REAGENTS_REM_REAGENT, | ||
)) | ||
UnregisterSignal(food, COMSIG_ATOM_EXAMINE) | ||
return ..() | ||
|
||
/datum/element/love_food_buff/proc/on_reagents_changed(datum/reagents/source, ...) | ||
SIGNAL_HANDLER | ||
|
||
var/obj/item/food/food = source.my_atom | ||
if(!istype(food)) | ||
return | ||
|
||
food.crafted_food_buff = source.has_reagent(/datum/reagent/love) ? love_buff_type : initial(food.crafted_food_buff) | ||
|
||
/datum/element/love_food_buff/proc/on_examine(datum/source, mob/user, list/examine_list) | ||
SIGNAL_HANDLER | ||
|
||
examine_list += span_notice("Delivering a chef's kiss to [source] will alter [source.p_their()] effects.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.