[MIRROR] Fresh Meat, Leatherworking

This commit is contained in:
Chompstation Bot
2020-11-08 17:04:32 +00:00
parent 2fda5bc91f
commit 018d176c51
38 changed files with 608 additions and 209 deletions

View File

@@ -14,6 +14,8 @@
target_parent_classes = list() // Is the parent supposed to be organic, robotic, assisted?
forgiving_class = TRUE // Will the organ give its verbs when it isn't a perfect match? I.E., assisted in organic, synthetic in organic.
butcherable = FALSE
var/obj/item/integrated_object // Objects held by the organ, used for re-usable, deployable things.
var/integrated_object_type // Object type the organ will spawn.
var/target_slot = null

View File

@@ -83,8 +83,11 @@ GLOBAL_LIST_BOILERPLATE(all_brain_organs, /obj/item/organ/internal/brain)
health = config.default_brain_health
defib_timer = (config.defib_timer MINUTES) / 2
spawn(5)
if(brainmob && brainmob.client)
brainmob.client.screen.len = null //clear the hud
if(brainmob)
butcherable = FALSE
if(brainmob.client)
brainmob.client.screen.len = null //clear the hud
/obj/item/organ/internal/brain/Destroy()
QDEL_NULL(brainmob)
@@ -96,9 +99,11 @@ GLOBAL_LIST_BOILERPLATE(all_brain_organs, /obj/item/organ/internal/brain)
brainmob = new(src)
brainmob.name = H.real_name
brainmob.real_name = H.real_name
brainmob.dna = H.dna.Clone()
brainmob.timeofhostdeath = H.timeofdeath
brainmob.ooc_notes = H.ooc_notes //VOREStation Edit
if(istype(H))
brainmob.dna = H.dna.Clone()
brainmob.timeofhostdeath = H.timeofdeath
brainmob.ooc_notes = H.ooc_notes //VOREStation Edit
// Copy modifiers.
for(var/datum/modifier/M in H.modifiers)
@@ -125,13 +130,13 @@ GLOBAL_LIST_BOILERPLATE(all_brain_organs, /obj/item/organ/internal/brain)
if(name == initial(name))
name = "\the [owner.real_name]'s [initial(name)]"
var/mob/living/simple_mob/animal/borer/borer = owner.has_brain_worms()
var/mob/living/simple_mob/animal/borer/borer = owner?.has_brain_worms()
if(borer)
borer.detatch() //Should remove borer if the brain is removed - RR
var/obj/item/organ/internal/brain/B = src
if(istype(B) && istype(owner))
if(istype(B) && owner)
B.transfer_identity(owner)
..()

View File

@@ -8,7 +8,7 @@
/obj/item/organ/internal/liver/process()
..()
if(!owner) return
if(!iscarbon(owner)) return
if(owner.life_tick % PROCESS_ACCURACY == 0)

View File

@@ -9,3 +9,4 @@
decays = FALSE // Ditto. Rust takes a while.
robotic = ORGAN_ROBOT
butcherable = FALSE

View File

@@ -44,6 +44,9 @@ var/list/organ_cache = list()
var/list/target_parent_classes = list() // Is the parent supposed to be organic, robotic, assisted?
var/forgiving_class = TRUE // Will the organ give its verbs when it isn't a perfect match? I.E., assisted in organic, synthetic in organic.
var/butcherable = TRUE
var/meat_type // What does butchering, if possible, make?
/obj/item/organ/Destroy()
handle_organ_mod_special(TRUE)
@@ -59,21 +62,42 @@ var/list/organ_cache = list()
/obj/item/organ/proc/update_health()
return
/obj/item/organ/New(var/mob/living/carbon/holder, var/internal)
/obj/item/organ/New(var/mob/living/holder, var/internal)
..(holder)
create_reagents(5)
if(!max_damage)
max_damage = min_broken_damage * 2
if(istype(holder))
if(isliving(holder))
src.owner = holder
src.w_class = max(src.w_class + mob_size_difference(holder.mob_size, MOB_MEDIUM), 1) //smaller mobs have smaller organs.
if(internal)
if(!LAZYLEN(holder.internal_organs))
holder.internal_organs = list()
if(!LAZYLEN(holder.internal_organs_by_name))
holder.internal_organs_by_name = list()
holder.internal_organs |= src
holder.internal_organs_by_name[organ_tag] = src
else
if(!LAZYLEN(holder.organs))
holder.organs = list()
if(!LAZYLEN(holder.organs_by_name))
holder.organs_by_name = list()
holder.internal_organs |= src
holder.internal_organs_by_name[organ_tag] = src
if(!max_damage)
max_damage = min_broken_damage * 2
if(iscarbon(holder))
var/mob/living/carbon/C = holder
species = GLOB.all_species[SPECIES_HUMAN]
if(holder.dna)
dna = holder.dna.Clone()
species = holder.species //VOREStation Edit - For custom species
dna = C.dna.Clone()
species = C.species //VOREStation Edit - For custom species
else
log_debug("[src] at [loc] spawned without a proper DNA.")
var/mob/living/carbon/human/H = holder
var/mob/living/carbon/human/H = C
if(istype(H))
if(internal)
var/obj/item/organ/external/E = H.get_organ(parent_organ)
@@ -81,18 +105,32 @@ var/list/organ_cache = list()
if(E.internal_organs == null)
E.internal_organs = list()
E.internal_organs |= src
H.internal_organs_by_name[organ_tag] = src
if(dna)
if(!blood_DNA)
blood_DNA = list()
blood_DNA[dna.unique_enzymes] = dna.b_type
if(internal)
holder.internal_organs |= src
else
species = GLOB.all_species["Human"]
handle_organ_mod_special()
/obj/item/organ/Initialize()
..()
if(owner)
if(!meat_type)
if(owner.isSynthetic())
meat_type = /obj/item/stack/material/steel
else if(ishuman(owner))
var/mob/living/carbon/human/H = owner
meat_type = H?.species?.meat_type
if(!meat_type)
if(owner.meat_type)
meat_type = owner.meat_type
else
meat_type = /obj/item/weapon/reagent_containers/food/snacks/meat
/obj/item/organ/proc/set_dna(var/datum/dna/new_dna)
if(new_dna)
dna = new_dna.Clone()
@@ -134,7 +172,7 @@ var/list/organ_cache = list()
handle_organ_proc_special()
//Process infections
if(robotic >= ORGAN_ROBOT || (owner && owner.species && (owner.species.flags & IS_PLANT || (owner.species.flags & NO_INFECT))))
if(robotic >= ORGAN_ROBOT || (istype(owner) && (owner.species && (owner.species.flags & (IS_PLANT | NO_INFECT)))))
germ_level = 0
return
@@ -152,7 +190,7 @@ var/list/organ_cache = list()
if(germ_level >= INFECTION_LEVEL_THREE)
die()
else if(owner && owner.bodytemperature >= 170) //cryo stops germs from moving and doing their bad stuffs
else if(owner && owner?.bodytemperature >= 170) //cryo stops germs from moving and doing their bad stuffs
//** Handle antibiotics and curing infections
handle_antibiotics()
handle_rejection()
@@ -170,7 +208,7 @@ var/list/organ_cache = list()
germ_level = 0
return 0
var/antibiotics = owner.chem_effects[CE_ANTIBIOTIC] || 0
var/antibiotics = iscarbon(owner) ? owner.chem_effects[CE_ANTIBIOTIC] || 0 : 0
var/infection_damage = 0
@@ -203,10 +241,12 @@ var/list/organ_cache = list()
//Level 1 qualifies for specific organ processing effects
if(germ_level >= INFECTION_LEVEL_ONE)
. = 1
var/fever_temperature = owner.species.heat_discomfort_level * 1.10 //Heat discomfort level plus 10%
if(owner.bodytemperature < fever_temperature)
owner.bodytemperature += min(0.2,(fever_temperature - owner.bodytemperature) / 10) //Will usually climb by 0.2, else 10% of the difference if less
. = 1 //Organ qualifies for effect-specific processing
//var/fever_temperature = (owner.species.heat_level_1 - owner.species.body_temperature - 5)* min(germ_level/INFECTION_LEVEL_TWO, 1) + owner.species.body_temperature
//owner.bodytemperature += between(0, (fever_temperature - T20C)/BODYTEMP_COLD_DIVISOR + 1, fever_temperature - owner.bodytemperature)
var/fever_temperature = owner?.species.heat_discomfort_level * 1.10 //Heat discomfort level plus 10%
if(owner?.bodytemperature < fever_temperature)
owner?.bodytemperature += min(0.2,(fever_temperature - owner?.bodytemperature) / 10) //Will usually climb by 0.2, else 10% of the difference if less
//Level two qualifies for further processing effects
if (germ_level >= INFECTION_LEVEL_TWO)
@@ -269,19 +309,20 @@ var/list/organ_cache = list()
//Germs
/obj/item/organ/proc/handle_antibiotics()
var/antibiotics = owner.chem_effects[CE_ANTIBIOTIC] || 0
if(istype(owner))
var/antibiotics = owner.chem_effects[CE_ANTIBIOTIC] || 0
if (!germ_level || antibiotics < ANTIBIO_NORM)
return
if (!germ_level || antibiotics < ANTIBIO_NORM)
return
if (germ_level < INFECTION_LEVEL_ONE)
germ_level = 0 //cure instantly
else if (germ_level < INFECTION_LEVEL_TWO)
adjust_germ_level(-antibiotics*4) //at germ_level < 500, this should cure the infection in a minute
else if (germ_level < INFECTION_LEVEL_THREE)
adjust_germ_level(-antibiotics*2) //at germ_level < 1000, this will cure the infection in 5 minutes
else
adjust_germ_level(-antibiotics) // You waited this long to get treated, you don't really deserve this organ
if (germ_level < INFECTION_LEVEL_ONE)
germ_level = 0 //cure instantly
else if (germ_level < INFECTION_LEVEL_TWO)
adjust_germ_level(-antibiotics*4) //at germ_level < 500, this should cure the infection in a minute
else if (germ_level < INFECTION_LEVEL_THREE)
adjust_germ_level(-antibiotics*2) //at germ_level < 1000, this will cure the infection in 5 minutes
else
adjust_germ_level(-antibiotics) // You waited this long to get treated, you don't really deserve this organ
//Adds autopsy data for used_weapon.
/obj/item/organ/proc/add_autopsy_data(var/used_weapon, var/damage)
@@ -304,7 +345,7 @@ var/list/organ_cache = list()
//only show this if the organ is not robotic
if(owner && parent_organ && amount > 0)
var/obj/item/organ/external/parent = owner.get_organ(parent_organ)
var/obj/item/organ/external/parent = owner?.get_organ(parent_organ)
if(parent && !silent)
owner.custom_pain("Something inside your [parent.name] hurts a lot.", amount)
@@ -322,6 +363,7 @@ var/list/organ_cache = list()
robotic = ORGAN_ASSISTED
min_bruised_damage = 15
min_broken_damage = 35
butcherable = FALSE
/obj/item/organ/proc/digitize() //Used to make the circuit-brain. On this level in the event more circuit-organs are added/tweaks are wanted.
robotize()
@@ -341,31 +383,30 @@ var/list/organ_cache = list()
take_damage(rand(1,3))
/obj/item/organ/proc/removed(var/mob/living/user)
if(owner)
owner.internal_organs_by_name[organ_tag] = null
owner.internal_organs_by_name -= organ_tag
owner.internal_organs_by_name -= null
owner.internal_organs -= src
if(!istype(owner))
return
var/obj/item/organ/external/affected = owner.get_organ(parent_organ)
if(affected) affected.internal_organs -= src
owner.internal_organs_by_name[organ_tag] = null
owner.internal_organs_by_name -= organ_tag
owner.internal_organs_by_name -= null
owner.internal_organs -= src
forceMove(owner.drop_location())
START_PROCESSING(SSobj, src)
rejecting = null
var/obj/item/organ/external/affected = owner.get_organ(parent_organ)
if(affected) affected.internal_organs -= src
if(istype(owner))
var/datum/reagent/blood/organ_blood = locate(/datum/reagent/blood) in reagents.reagent_list
if(!organ_blood || !organ_blood.data["blood_DNA"])
owner.vessel.trans_to(src, 5, 1, 1)
forceMove(owner.drop_location())
START_PROCESSING(SSobj, src)
rejecting = null
var/datum/reagent/blood/organ_blood = locate(/datum/reagent/blood) in reagents.reagent_list
if(!organ_blood || !organ_blood.data["blood_DNA"])
owner.vessel.trans_to(src, 5, 1, 1)
if(owner && vital)
if(user)
add_attack_logs(user, owner, "Removed vital organ [src.name]")
if(owner.stat != DEAD)
owner.can_defib = 0
owner.death()
if(owner && vital)
if(user)
add_attack_logs(user, owner, "Removed vital organ [src.name]")
if(owner.stat != DEAD)
owner.can_defib = 0
owner.death()
handle_organ_mod_special(TRUE)
@@ -379,13 +420,13 @@ var/list/organ_cache = list()
var/datum/reagent/blood/transplant_blood = locate(/datum/reagent/blood) in reagents.reagent_list
transplant_data = list()
if(!transplant_blood)
transplant_data["species"] = target.species.name
transplant_data["blood_type"] = target.dna.b_type
transplant_data["blood_DNA"] = target.dna.unique_enzymes
transplant_data["species"] = target?.species.name
transplant_data["blood_type"] = target?.dna.b_type
transplant_data["blood_DNA"] = target?.dna.unique_enzymes
else
transplant_data["species"] = transplant_blood.data["species"]
transplant_data["blood_type"] = transplant_blood.data["blood_type"]
transplant_data["blood_DNA"] = transplant_blood.data["blood_DNA"]
transplant_data["species"] = transplant_blood?.data["species"]
transplant_data["blood_type"] = transplant_blood?.data["blood_type"]
transplant_data["blood_DNA"] = transplant_blood?.data["blood_DNA"]
owner = target
loc = owner
@@ -428,6 +469,46 @@ var/list/organ_cache = list()
bitten(user)
return
/obj/item/organ/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(can_butcher(W, user))
butcher(W, user)
return
return ..()
/obj/item/organ/proc/can_butcher(var/obj/item/O, var/mob/living/user)
if(butcherable && meat_type)
if(istype(O, /obj/machinery/gibber)) // The great equalizer.
return TRUE
if(robotic >= ORGAN_ROBOT)
if(O.is_screwdriver())
return TRUE
else
if(is_sharp(O) && has_edge(O))
return TRUE
return FALSE
/obj/item/organ/proc/butcher(var/obj/item/O, var/mob/living/user, var/atom/newtarget)
if(robotic >= ORGAN_ROBOT)
user?.visible_message("<span class='notice'>[user] disassembles \the [src].</span>")
else
user?.visible_message("<span class='notice'>[user] butchers \the [src].</span>")
if(!newtarget)
newtarget = get_turf(src)
var/obj/item/newmeat = new meat_type(newtarget)
if(istype(newmeat, /obj/item/weapon/reagent_containers/food/snacks/meat))
newmeat.name = "[src.name] [newmeat.name]" // "liver meat" "heart meat", etc.
qdel(src)
/obj/item/organ/proc/organ_can_feel_pain()
if(species.flags & NO_PAIN)
return 0

View File

@@ -34,7 +34,8 @@
var/body_part = null // Part flag
var/icon_position = 0 // Used in mob overlay layering calculations.
var/model // Used when caching robolimb icons.
var/force_icon // Used to force override of species-specific limb icons (for prosthetics).
var/force_icon // Used to force override of species-specific limb icons (for prosthetics). Also used for any limbs chopped from a simple mob, and then attached to humans.
var/force_icon_key // Used to force the override of the icon-key generated using the species. Must be used in tandem with the above.
var/icon/mob_icon // Cached icon for use in mob overlays.
var/gendered_icon = 0 // Whether or not the icon state appends a gender.
var/s_tone // Skin tone.
@@ -97,7 +98,7 @@
qdel(splinted)
splinted = null
if(owner)
if(istype(owner))
owner.organs -= src
owner.organs_by_name[organ_tag] = null
owner.organs_by_name -= organ_tag
@@ -199,7 +200,7 @@
return
dislocated = 1
if(owner)
if(istype(owner))
owner.verbs |= /mob/living/carbon/human/proc/relocate
/obj/item/organ/external/proc/relocate()
@@ -207,7 +208,7 @@
return
dislocated = 0
if(owner)
if(istype(owner))
owner.shock_stage += 20
//check to see if we still need the verb
@@ -221,7 +222,7 @@
/obj/item/organ/external/New(var/mob/living/carbon/holder)
..(holder, 0)
if(owner)
if(istype(owner))
replaced(owner)
sync_colour_to_human(owner)
spawn(1)
@@ -887,11 +888,11 @@ Note that amputating the affected organ does in fact remove the infection from t
var/mob/living/carbon/human/victim = owner //Keep a reference for post-removed().
var/obj/item/organ/external/parent_organ = parent
var/use_flesh_colour = species.get_flesh_colour(owner)
var/use_blood_colour = species.get_blood_colour(owner)
var/use_flesh_colour = species?.get_flesh_colour(owner) ? species.get_flesh_colour(owner) : "#C80000"
var/use_blood_colour = species?.get_blood_colour(owner) ? species.get_blood_colour(owner) : "#C80000"
removed(null, ignore_children)
victim.traumatic_shock += 60
victim?.traumatic_shock += 60
if(parent_organ)
var/datum/wound/lost_limb/W = new (src, disintegrate, clean)
@@ -907,9 +908,12 @@ Note that amputating the affected organ does in fact remove the infection from t
stump.update_damages()
spawn(1)
victim.updatehealth()
victim.UpdateDamageIcon()
victim.update_icons_body()
if(istype(victim))
victim.updatehealth()
victim.UpdateDamageIcon()
victim.update_icons_body()
else
victim.update_icons()
dir = 2
var/atom/droploc = victim.drop_location()
@@ -1236,7 +1240,7 @@ Note that amputating the affected organ does in fact remove the infection from t
organ.loc = src
// Remove parent references
parent.children -= src
parent?.children -= src
parent = null
release_restraints(victim)

View File

@@ -58,7 +58,7 @@ var/global/list/limb_icon_cache = list()
cut_overlays()
//Every 'addon' below requires information from species
if(!owner || !owner.species)
if(!iscarbon(owner) || !owner.species)
return
//Eye color/icon
@@ -135,7 +135,10 @@ var/global/list/limb_icon_cache = list()
if(owner && owner.gender == FEMALE)
gender = "f"
icon_cache_key = "[icon_name]_[species ? species.get_bodytype() : SPECIES_HUMAN]" //VOREStation Edit
if(!force_icon_key)
icon_cache_key = "[icon_name]_[species ? species.get_bodytype() : SPECIES_HUMAN]" //VOREStation Edit
else
icon_cache_key = "[icon_name]_[force_icon_key]"
if(force_icon)
mob_icon = new /icon(force_icon, "[icon_name][gendered_icon ? "_[gender]" : ""]")

View File

@@ -38,6 +38,7 @@
var/brain_type = /obj/item/device/mmi
var/obj/item/device/mmi/stored_mmi
robotic = ORGAN_ASSISTED
butcherable = FALSE
/obj/item/organ/internal/mmi_holder/Destroy()
if(stored_mmi && (stored_mmi.loc == src))

View File

@@ -282,14 +282,15 @@
/obj/item/organ/external/head/removed()
if(owner)
name = "[owner.real_name]'s head"
owner.drop_from_inventory(owner.glasses)
owner.drop_from_inventory(owner.head)
owner.drop_from_inventory(owner.l_ear)
owner.drop_from_inventory(owner.r_ear)
owner.drop_from_inventory(owner.wear_mask)
spawn(1)
owner.update_hair()
if(iscarbon(owner))
name = "[owner.real_name]'s head"
owner.drop_from_inventory(owner.glasses)
owner.drop_from_inventory(owner.head)
owner.drop_from_inventory(owner.l_ear)
owner.drop_from_inventory(owner.r_ear)
owner.drop_from_inventory(owner.wear_mask)
spawn(1)
owner.update_hair()
get_icon()
..()