mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 02:54:41 +01:00
Frankenstein Station 13: Introducing dissections and alien organs to xenobiology (#29093)
* ddsadsa ddsadsa * moderate again * revert * beginning with rebase * organssssssssss * organs now process! * analyzer finished! + mapping * tool bit implementation and quality * organs and fixes and reworks * more organ work * more organs done * more organ progress! * more organ work * MORE. ORGANS. * temp * more organsssss * ITS DONE!!!!!!!! * oops * also oops * linter stuff * forgot this + oops * linter * i forgot to save! * lots of improvements and tweaks * move icon over * icon tweaks * icon mistake * oops * dumb * more icon validations * i think thisll fix it? * Apply suggestions from code review Co-authored-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com> Signed-off-by: Kyani <65205627+EmeraldCandy@users.noreply.github.com> * fixes * fixes+tweaks * fix * oops * linter * i didnt save.... * this should give -some- warning * forgot a span * Apply suggestions from code review Co-authored-by: 1080pCat <96908085+1080pCat@users.noreply.github.com> Signed-off-by: Kyani <65205627+EmeraldCandy@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: 1080pCat <96908085+1080pCat@users.noreply.github.com> Signed-off-by: Kyani <65205627+EmeraldCandy@users.noreply.github.com> * beginning edits * more fixed and tweaks with cooldowns * Apply suggestions from code review Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> Signed-off-by: Kyani <65205627+EmeraldCandy@users.noreply.github.com> * lots of tweaks * more review changes * comment change * Apply suggestions from code review Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> Signed-off-by: Kyani <65205627+EmeraldCandy@users.noreply.github.com> * returns start back to gland * Apply suggestions from code review Co-authored-by: 1080pCat <96908085+1080pCat@users.noreply.github.com> Signed-off-by: Kyani <65205627+EmeraldCandy@users.noreply.github.com> * code review fixes * trying to make surgery work.... * might as well push this * perfection. now i need text * text + small tweaks and bugfixing * linting * forgot to implement this * deconflicting maps * modifying for xenos again * i guess this wasnt needed??? * added surgical belts to xeno * minor swap * quick fix * small tweaks * small tweak * tiny tweak * some slime updates * more tweaks * more updates * first batch of fixes * hiero audio fix * robotic fauna fixes * more rounds of bugfixes * prevents teleporting * tiny fix * makes sharp more common * misc fixes * surgery and revenant fixes + extractor * adds cursed organ logging * small bananium organ tweak * actually gives teleporter access * adds a message to the analyzer * can now drag naughts * slime behavior tweaks * headslug tweak, cant eat organs * Update code/datums/components/special_tastes.dm Co-authored-by: warriorstar-orion <orion@snowfrost.garden> Signed-off-by: Kyani <65205627+EmeraldCandy@users.noreply.github.com> * Update code/datums/components/special_tastes.dm Co-authored-by: warriorstar-orion <orion@snowfrost.garden> Signed-off-by: Kyani <65205627+EmeraldCandy@users.noreply.github.com> * Update code/datums/components/special_tastes.dm Co-authored-by: warriorstar-orion <orion@snowfrost.garden> Signed-off-by: Kyani <65205627+EmeraldCandy@users.noreply.github.com> * Update code/modules/mob/living/simple_animal/slime/slime_mob.dm Co-authored-by: warriorstar-orion <orion@snowfrost.garden> Signed-off-by: Kyani <65205627+EmeraldCandy@users.noreply.github.com> * Update code/modules/mob/living/simple_animal/slime/slime_mob.dm Co-authored-by: warriorstar-orion <orion@snowfrost.garden> Signed-off-by: Kyani <65205627+EmeraldCandy@users.noreply.github.com> * Update code/game/gamemodes/miniantags/revenant/revenant.dm Co-authored-by: warriorstar-orion <orion@snowfrost.garden> Signed-off-by: Kyani <65205627+EmeraldCandy@users.noreply.github.com> * Update code/datums/components/special_tastes.dm Co-authored-by: warriorstar-orion <orion@snowfrost.garden> Signed-off-by: Kyani <65205627+EmeraldCandy@users.noreply.github.com> * Update code/game/gamemodes/miniantags/abduction/gland.dm Co-authored-by: warriorstar-orion <orion@snowfrost.garden> Signed-off-by: Kyani <65205627+EmeraldCandy@users.noreply.github.com> * Update code/game/gamemodes/miniantags/abduction/gland.dm Co-authored-by: warriorstar-orion <orion@snowfrost.garden> Signed-off-by: Kyani <65205627+EmeraldCandy@users.noreply.github.com> * moved this * major rework prep * didnt save * rework done * small fix * makes aliens draggable by crew after death * shouldnt have cut this * xeno organ tweak + tips * oops * fixes and tweaks to slimes * not used * temp revert * rebase map files to master * re-applying changes * access fix * access tweak * big fix for new refactor * more refactoring * forgot a span * Update code/datums/components/surgery_initiator.dm Co-authored-by: warriorstar-orion <orion@snowfrost.garden> Signed-off-by: Kyani <65205627+EmeraldCandy@users.noreply.github.com> * hiero only doesnt target dead megafauna * various fixes * fix requests * fixed weird conflict markers * deconflict * deconflicting * antimagic flags * merge fixing * Update code/modules/mining/lavaland/loot/hierophant_loot.dm Signed-off-by: Burzah <116982774+Burzah@users.noreply.github.com> * regen mesh fix * small fixes * tick fix * Apply suggestions from code review Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> Signed-off-by: Kyani <65205627+EmeraldCandy@users.noreply.github.com> * grammar * Update code/modules/surgery/organs/organ_internal.dm Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> Signed-off-by: Kyani <65205627+EmeraldCandy@users.noreply.github.com> * Update code/modules/surgery/organs/organ_internal.dm Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> Signed-off-by: Kyani <65205627+EmeraldCandy@users.noreply.github.com> * Update code/modules/research/xenobiology/xenobiology_organs.dm Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> Signed-off-by: Kyani <65205627+EmeraldCandy@users.noreply.github.com> * Update code/modules/research/xenobiology/xenobiology_organs.dm Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> Signed-off-by: Kyani <65205627+EmeraldCandy@users.noreply.github.com> * Update code/modules/research/xenobiology/xenobiology_organs.dm Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> Signed-off-by: Kyani <65205627+EmeraldCandy@users.noreply.github.com> * tweaks --------- Signed-off-by: Kyani <65205627+EmeraldCandy@users.noreply.github.com> Signed-off-by: Burzah <116982774+Burzah@users.noreply.github.com> Co-authored-by: BeagleGaming1 <56142455+BeagleGaming1@users.noreply.github.com> Co-authored-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com> Co-authored-by: 1080pCat <96908085+1080pCat@users.noreply.github.com> Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> Co-authored-by: warriorstar-orion <orion@snowfrost.garden> Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
/// Allows humanoids to eat arbitrary items
|
||||
/datum/component/special_tastes
|
||||
/// associated list of item to reagents and tastes
|
||||
/// Typepath = (list(reagents = list(reagents), tastes = list(tastes)); Ex: list(/obj/item/stack/sheet/mineral/silver = list("reagents" = list("nutriment" = 5, "vitamin" = 1), "tastes" = list("metal and blood" = 1)))
|
||||
var/list/obj/item/edible_items = list()
|
||||
|
||||
/datum/component/special_tastes/Initialize(list/edible_items)
|
||||
if(!length(edible_items))
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
if(!ishuman(parent))
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
for(var/obj/item/current_item as anything in edible_items)
|
||||
if(!islist(edible_items[current_item])) // if not a list of reagents
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
src.edible_items = edible_items
|
||||
RegisterSignal(parent, COMSIG_ATTACK_BY, PROC_REF(attempt_ingest))
|
||||
|
||||
/// check if item is in the list of potential food
|
||||
/datum/component/special_tastes/proc/attempt_ingest(datum/source, obj/item/attacking_item, mob/living/carbon/human/attacker)
|
||||
SIGNAL_HANDLER // COMSIG_ATTACK_BY
|
||||
if(parent != attacker) // only if they attack themselves with it
|
||||
return
|
||||
var/is_edible = FALSE
|
||||
var/obj/item/similar_to
|
||||
for(var/potential_type in edible_items)
|
||||
if(istype(attacking_item, potential_type))
|
||||
is_edible = TRUE
|
||||
similar_to = potential_type
|
||||
break
|
||||
if(!is_edible)
|
||||
return
|
||||
attempt_to_eat(attacker, attacking_item, similar_to)
|
||||
return COMPONENT_SKIP_AFTERATTACK
|
||||
|
||||
/// Handle eating and nutrition gain from eating minerals
|
||||
/datum/component/special_tastes/proc/attempt_to_eat(mob/living/carbon/human/user, obj/item/attacking_item, obj/item/similar_to)
|
||||
if(istype(attacking_item, /obj/item/stack))
|
||||
var/obj/item/stack/stacked_item = attacking_item
|
||||
if(stacked_item.amount > 1)
|
||||
to_chat(user, "<span class='notice'>You can only eat one of [stacked_item] at a time.</span>")
|
||||
return
|
||||
var/obj/item/food/food = turn_into_food(attacking_item, similar_to)
|
||||
user.drop_item_to_ground(attacking_item, TRUE, TRUE)
|
||||
user.put_in_active_hand(food)
|
||||
var/fullness = user.nutrition + 10
|
||||
for(var/datum/reagent/consumable/chem in food.reagents.reagent_list)
|
||||
fullness += chem.nutriment_factor * chem.volume / (chem.metabolization_rate * user.metabolism_efficiency)
|
||||
if(!(fullness > (600 * (1 + user.overeatduration / 2000)))) // need to work around the sleep()'s in eat()
|
||||
user.consume(food)
|
||||
food.On_Consume(user, user)
|
||||
qdel(attacking_item)
|
||||
return // couldnt eat it, undo
|
||||
to_chat(user, "<span class='notice'>You are too full to eat [attacking_item].</span>")
|
||||
user.drop_item_to_ground(food, TRUE, TRUE)
|
||||
user.put_in_active_hand(attacking_item)
|
||||
qdel(food)
|
||||
|
||||
/// Turn the item into food, can only be eaten in 1 bite to prevent creating a half-eaten item that those without the trait can also eat.
|
||||
/datum/component/special_tastes/proc/turn_into_food(obj/item/future_food, obj/item/similar_to)
|
||||
var/obj/item/food/food = new
|
||||
food.name = future_food.name
|
||||
food.desc = future_food.desc
|
||||
food.icon = future_food.icon
|
||||
food.icon_state = future_food.icon_state
|
||||
var/list/food_info = edible_items[similar_to]
|
||||
var/list/chem_info = food_info["reagents"]
|
||||
var/list/taste_info = food_info["tastes"]
|
||||
for(var/reagent_id in chem_info)
|
||||
var/reagent_amount = chem_info[reagent_id]
|
||||
food.reagents.add_reagent(reagent_id, reagent_amount, taste_info.Copy())
|
||||
food.bitesize = food.reagents.total_volume
|
||||
return food
|
||||
|
||||
/datum/component/special_tastes/Destroy(force, silent)
|
||||
UnregisterSignal(parent, COMSIG_ATTACK_BY)
|
||||
return ..()
|
||||
@@ -82,7 +82,7 @@
|
||||
return
|
||||
if(!IS_HORIZONTAL(L) && !can_start_on_stander)
|
||||
return
|
||||
if(IS_HORIZONTAL(L) && !on_operable_surface(L))
|
||||
if(IS_HORIZONTAL(L) && !on_operable_surface(L) && !isanimal(L))
|
||||
return
|
||||
if(iscarbon(target))
|
||||
var/mob/living/carbon/C = target
|
||||
@@ -128,7 +128,7 @@
|
||||
var/datum/surgery/procedure
|
||||
|
||||
if(!length(available_surgeries))
|
||||
if(IS_HORIZONTAL(target))
|
||||
if(IS_HORIZONTAL(target) || isanimal(target))
|
||||
to_chat(user, "<span class='notice'>There aren't any surgeries you can perform there right now.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You can't perform any surgeries there while [target] is standing.</span>")
|
||||
@@ -209,8 +209,7 @@
|
||||
if(!affected)
|
||||
skip_surgery = TRUE
|
||||
|
||||
else
|
||||
// uh there's no reason this should be hit but let's be safe LOL
|
||||
else if(!isanimal(patient)) // surgery is base to living mobs now but we should still probably restrict this
|
||||
skip_surgery = TRUE
|
||||
|
||||
if(!skip_surgery)
|
||||
@@ -288,9 +287,15 @@
|
||||
|
||||
return
|
||||
|
||||
if(!isnull(affecting_limb) && (surgery.requires_organic_bodypart && affecting_limb.is_robotic()) || (!surgery.requires_organic_bodypart && !affecting_limb.is_robotic()))
|
||||
to_chat(user, "<span class='warning'>That's not the right type of limb for this operation!</span>")
|
||||
return
|
||||
if(iscarbon(target))
|
||||
if(!isnull(affecting_limb))
|
||||
if((surgery.requires_organic_bodypart && affecting_limb.is_robotic()) || (!surgery.requires_organic_bodypart && !affecting_limb.is_robotic()))
|
||||
to_chat(user, "<span class='warning'>That's not the right type of limb for this operation!</span>")
|
||||
return
|
||||
|
||||
if(surgery_needs_exposure(surgery, target))
|
||||
to_chat(user, "<span class='warning'>You have to expose [target.p_their()] [parse_zone(selected_zone)] first!</span>")
|
||||
return
|
||||
|
||||
if(surgery.lying_required && !on_operable_surface(target))
|
||||
to_chat(user, "<span class='notice'>Patient must be lying down for this operation.</span>")
|
||||
@@ -304,12 +309,16 @@
|
||||
to_chat(user, "<span class='warning'>Can't start the surgery!</span>")
|
||||
return
|
||||
|
||||
if(surgery_needs_exposure(surgery, target))
|
||||
to_chat(user, "<span class='warning'>You have to expose [target.p_their()] [parse_zone(selected_zone)] first!</span>")
|
||||
return
|
||||
|
||||
var/datum/surgery/procedure = new surgery.type(target, selected_zone, affecting_limb)
|
||||
|
||||
// Need to pass dissection its steps because it changes alot depending on the creature
|
||||
if(istype(procedure, /datum/surgery/dissect))
|
||||
if(isnull(target.surgery_container))
|
||||
log_debug("A dissection was started on [target] with contains_xeno_organ as TRUE, however its surgery_container was null!")
|
||||
CRASH("<span class='userdanger'>[target] does not have a dissection surgery information set to it. Please inform an admin or developer.</span>")
|
||||
if(ispath(target.surgery_container, /datum/xenobiology_surgery_container))
|
||||
target.surgery_container = new target.surgery_container
|
||||
procedure.steps = target.surgery_container.dissection_tool_step
|
||||
|
||||
RegisterSignal(procedure, COMSIG_SURGERY_BLOOD_SPLASH, PROC_REF(on_blood_splash))
|
||||
|
||||
@@ -382,7 +391,6 @@
|
||||
)
|
||||
return
|
||||
|
||||
|
||||
if(!isnull(surgery_start_sound))
|
||||
playsound(src, surgery_start_sound, 50, TRUE)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user