Skip to content

Commit

Permalink
Merge pull request #91 from Nerev4r/vampiretherequiem
Browse files Browse the repository at this point in the history
[HELP ME HOLY SHIT please TESTMERGE THIS] Hemophages!
  • Loading branch information
carpotoxin authored Sep 28, 2024
2 parents b598102 + 6ae8a86 commit a87b853
Show file tree
Hide file tree
Showing 45 changed files with 1,655 additions and 106 deletions.
5 changes: 5 additions & 0 deletions code/__DEFINES/food.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#define BUGS (1<<18)
#define GORE (1<<19)
#define STONE (1<<20)
#define BLOODY (1<<21) // DOPPLER ADDITION - Hemophage Food

DEFINE_BITFIELD(foodtypes, list(
"MEAT" = MEAT,
Expand All @@ -42,6 +43,7 @@ DEFINE_BITFIELD(foodtypes, list(
"BUGS" = BUGS,
"GORE" = GORE,
"STONE" = STONE,
"BLOODY" = BLOODY, //Doppler Edit Addition
))

/// A list of food type names, in order of their flags
Expand All @@ -67,6 +69,7 @@ DEFINE_BITFIELD(foodtypes, list(
"BUGS", \
"GORE", \
"STONE", \
"BLOODY", \
)

/// IC meaning (more or less) for food flags
Expand All @@ -92,6 +95,7 @@ DEFINE_BITFIELD(foodtypes, list(
"Bugs", \
"Gore", \
"Rocks", \
"Bloody", \
)

#define DRINK_REVOLTING 1
Expand All @@ -101,6 +105,7 @@ DEFINE_BITFIELD(foodtypes, list(
#define DRINK_FANTASTIC 5

#define FOOD_AMAZING 6
#define RACE_DRINK 7 // DOPPLER EDIT ADDITION

#define FOOD_QUALITY_NORMAL 1
#define FOOD_QUALITY_NICE 2
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/~doppler_defines/construction.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define CAT_HEMOPHAGE "Hemophage Food"
2 changes: 2 additions & 0 deletions code/__DEFINES/~doppler_defines/declarations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
#define TRAIT_DETECTIVE "detective_ability"
/// Trait for the excitable quirk, woof!
#define TRAIT_EXCITABLE "wagwag"
/// Trait for hemophages particularly!
#define TRAIT_OXYIMMUNE "oxyimmune" // Immune to oxygen damage, ideally give this to all non-breathing species or bad stuff will happen
1 change: 1 addition & 0 deletions code/__DEFINES/~doppler_defines/is_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
//Customization bases
#define isinsectoid(A) (is_species(A, /datum/species/insectoid))
#define issnail(A) (is_species(A, /datum/species/snail))
#define ishemophage(A) (is_species(A, /datum/species/hemophage))
//Species with green blood
#define hasgreenblood(A) (isinsectoid(A) || HAS_TRAIT(A, TRAIT_GREEN_BLOOD))
2 changes: 2 additions & 0 deletions code/__DEFINES/~doppler_defines/reagents.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/// This reagent is useful for blood regeneration. Useful for Hemophages.
#define REAGENT_BLOOD_REGENERATING (1<<0)
7 changes: 7 additions & 0 deletions code/__DEFINES/~doppler_defines/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,10 @@
#define COMPONENT_POWER_SUCCESS (1<<0)
#define COMPONENT_NO_CELL (1<<1)
#define COMPONENT_NO_CHARGE (1<<2)

/// For when a Hemophage's pulsating tumor gets added to their body.
#define COMSIG_PULSATING_TUMOR_ADDED "pulsating_tumor_added"
/// For when a Hemophage's pulsating tumor gets removed from their body.
#define COMSIG_PULSATING_TUMOR_REMOVED "pulsating_tumor_removed"
/// From /obj/item/organ/internal/stomach/after_eat(atom/edible)
#define COMSIG_STOMACH_AFTER_EAT "stomach_after_eat"
1 change: 1 addition & 0 deletions code/__DEFINES/~doppler_defines/species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
#define SPECIES_ANTHROMORPH "anthromorph"
#define SPECIES_AQUATIC "aquatic"
#define SPECIES_INSECTOID "insectoid"
#define SPECIES_HEMOPHAGE "hemophage"
3 changes: 3 additions & 0 deletions code/__DEFINES/~doppler_defines/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@

// Trait that lets golems put stone limbs back on
#define TRAIT_GOLEM_LIMBATTACHMENT "golem_limbattachment"

/// Trait that was granted by a reagent.
#define REAGENT_TRAIT "reagent"
1 change: 1 addition & 0 deletions code/_globalvars/traits/_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_CURRENTLY_GLASSBLOWING" = TRAIT_CURRENTLY_GLASSBLOWING,
"TRAIT_ANIMALISTIC" = TRAIT_ANIMALISTIC,
"TRAIT_GLASSBLOWING" = TRAIT_GLASSBLOWING,
"TRAIT_OXYIMMUNE" = TRAIT_OXYIMMUNE, //Doppler Edit Addition - Needed for hemophages.
"TRAIT_XENOARCH_QUALIFIED" = TRAIT_XENOARCH_QUALIFIED,
"TRAIT_DETECTIVE" = TRAIT_DETECTIVE,
"TRAIT_EXCITABLE" = TRAIT_EXCITABLE,
Expand Down
4 changes: 4 additions & 0 deletions code/_globalvars/~doppler_globalvars/bitfields.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
DEFINE_BITFIELD(obj_flags_doppler, list(
"ANVIL_REPAIR" = ANVIL_REPAIR,
))

DEFINE_BITFIELD(chemical_flags_doppler, list(
"REAGENT_BLOOD_REGENERATING" = REAGENT_BLOOD_REGENERATING,
))
4 changes: 4 additions & 0 deletions code/modules/reagents/chemistry/reagents/food_reagents.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
var/obj/item/the_real_food = holder.my_atom
if(isitem(the_real_food) && !is_reagent_container(the_real_food))
exposed_mob.add_mob_memory(/datum/memory/good_food, food = the_real_food)
// DOPPLER EDIT ADDITION BEGIN - Race Quality Drinks
if (RACE_DRINK)
exposed_mob.add_mood_event("quality_drink", /datum/mood_event/race_drink)
// DOPPLER EDIT ADDITION END

/// Gets just how much nutrition this reagent is worth for the passed mob
/datum/reagent/consumable/proc/get_nutriment_factor(mob/living/carbon/eater)
Expand Down
1 change: 1 addition & 0 deletions code/modules/reagents/reagent_containers/condiment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
M.visible_message(span_warning("[user] fed [M] from [src]."), \
span_warning("[user] fed you from [src]."))
log_combat(user, M, "fed", reagents.get_reagent_log_string())
SEND_SIGNAL(M, COMSIG_GLASS_DRANK, src, user) // DOPPLER EDIT ADDITION - Hemophages can't casually drink what's not going to regenerate their blood
reagents.trans_to(M, 10, transferred_by = user, methods = INGEST)
playsound(M.loc,'sound/items/drink.ogg', rand(10,50), TRUE)
return TRUE
Expand Down
1 change: 1 addition & 0 deletions code/modules/reagents/reagent_containers/cups/_cup.dm
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
to_chat(user, span_notice("You swallow a gulp of [src]."))

SEND_SIGNAL(src, COMSIG_GLASS_DRANK, target_mob, user)
SEND_SIGNAL(target_mob, COMSIG_GLASS_DRANK, src, user) // DOPPLER EDIT ADDITION - Hemophages can't casually drink what's not going to regenerate their blood
var/fraction = min(gulp_size/reagents.total_volume, 1)
reagents.trans_to(target_mob, gulp_size, transferred_by = user, methods = INGEST)
checkLiked(fraction, target_mob)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions config/game_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ ROUNDSTART_RACES aquatic
ROUNDSTART_RACES insectoid
ROUNDSTART_RACES genemod
ROUNDSTART_RACES primitive_genemod
ROUNDSTART_RACES hemophage

## Races that are better than humans in some ways, but worse in others
ROUNDSTART_RACES ethereal
Expand Down
4 changes: 0 additions & 4 deletions modular_doppler/hearthkin/primitive_genemod/code/map_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@
/turf/open/water/hot_spring/proc/hotspring_mood(mob/living/swimmer)
swimmer.add_mood_event("hotspring", /datum/mood_event/hotspring/nerfed)

/datum/mood_event/hotspring/nerfed
description = span_nicegreen("The water was enjoyably warm!\n")
mood_change = 2

// Steam particles for pairing with the hotsprings above

/particles/hotspring_steam
Expand Down
6 changes: 0 additions & 6 deletions modular_doppler/modular_customization/organs/external/tail.dm
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,6 @@
var/mob/living/carbon/human/empath = entered
empath.add_mood_event("dog_wag", /datum/mood_event/dog_wag)

// The mood buff itself
/datum/mood_event/dog_wag
description = "That wagging tail's excitement is infectious!"
mood_change = 1
timeout = 30 SECONDS

/// Fox tail
//
/obj/item/organ/external/tail/fox
Expand Down
50 changes: 36 additions & 14 deletions modular_doppler/modular_food_drinks_and_chems/chemistry_reagents.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,6 @@
/datum/reagent/carbondioxide
process_flags = REAGENT_ORGANIC | REAGENT_SYNTHETIC
/datum/reagent/iron
chemical_flags_nova = REAGENT_BLOOD_REGENERATING
/datum/reagent/blood
chemical_flags_nova = REAGENT_BLOOD_REGENERATING // For Hemophages to be able to drink it without any issue.
/datum/reagent/blood/on_new(list/data)
. = ..()
if(!src.data["blood_type"])
src.data["blood_type"] = random_blood_type() // This is so we don't get blood without a blood type spawned from something that doesn't explicitly set the blood type.
/datum/reagent/stable_plasma/on_mob_life(mob/living/carbon/C)
if(C.mob_biotypes & MOB_ROBOTIC)
C.nutrition = min(C.nutrition + 5, NUTRITION_LEVEL_FULL-1)
Expand All @@ -54,6 +40,19 @@
C.nutrition = min(C.nutrition + 5, NUTRITION_LEVEL_FULL-1)
..()
*/

/datum/reagent/iron
chemical_flags_doppler = REAGENT_BLOOD_REGENERATING

/datum/reagent/blood
chemical_flags_doppler = REAGENT_BLOOD_REGENERATING // For Hemophages to be able to drink it without any issue.

/datum/reagent/blood/on_new(list/data)
. = ..()

if(!src.data["blood_type"])
src.data["blood_type"] = random_blood_type() // This is so we don't get blood without a blood type spawned from something that doesn't explicitly set the blood type.

// Catnip
/datum/reagent/pax/catnip
name = "Catnip"
Expand Down Expand Up @@ -99,3 +98,26 @@
#undef DERMAGEN_SCAR_FIX_AMOUNT
*/

/**
* Check if this holder contains a reagent with a `chemical_flags_doppler` containing this flag.
*
* Arguments:
* * chemical_flag - The bitflag to search for.
* * min_volume - Checks for having a specific amount of reagents matching that `chemical_flag`
*/
/datum/reagents/proc/has_chemical_flag_doppler(chemical_flag, min_volume = 0)
var/found_amount = 0
var/list/cached_reagents = reagent_list
for(var/datum/reagent/holder_reagent as anything in cached_reagents)
if (holder_reagent.chemical_flags_doppler & chemical_flag)
found_amount += holder_reagent.volume
if(found_amount >= min_volume)
return TRUE

return FALSE

/datum/reagent
/// Modular version of `chemical_flags`, so we don't have to worry about
/// it causing conflicts in the future.
var/chemical_flags_doppler = NONE
Loading

0 comments on commit a87b853

Please sign in to comment.