mirror of
https://github.com/CHOMPstation/CHOMPstation.git
synced 2026-08-22 19:46:36 +01:00
Merge branch 'master' of https://github.com/PolarisSS13/Polaris into polaris-sync-2018-03-15
# Conflicts: # README.md # code/__defines/mobs.dm # code/__defines/subsystems.dm # code/_helpers/global_lists.dm # code/controllers/subsystems/garbage.dm # code/controllers/subsystems/overlays.dm # code/datums/datacore.dm # code/datums/supplypacks/munitions.dm # code/game/machinery/suit_storage_unit.dm # code/game/objects/items/devices/communicator/UI.dm # code/game/objects/items/weapons/id cards/station_ids.dm # code/game/objects/random/random.dm # code/game/turfs/simulated/floor.dm # code/game/turfs/simulated/floor_icon.dm # code/modules/awaymissions/gateway.dm # code/modules/client/preferences.dm # code/modules/ext_scripts/python.dm # code/modules/mob/living/carbon/human/human.dm # code/modules/mob/living/carbon/human/life.dm # code/modules/mob/living/carbon/human/species/station/station.dm # code/modules/mob/living/carbon/human/species/virtual_reality/avatar.dm # code/modules/mob/living/carbon/human/update_icons.dm # code/modules/mob/living/living.dm # code/modules/mob/living/living_defines.dm # code/modules/mob/living/simple_animal/animals/bear.dm # code/modules/mob/mob_helpers.dm # code/modules/mob/new_player/new_player.dm # code/modules/mob/new_player/preferences_setup.dm # code/modules/mob/new_player/sprite_accessories.dm # code/modules/organs/organ_external.dm # code/modules/organs/organ_icon.dm # code/modules/organs/robolimbs.dm # code/modules/reagents/reagent_containers/glass.dm # code/modules/reagents/reagent_containers/syringes.dm # html/changelogs/.all_changelog.yml # maps/southern_cross/southern_cross-1.dmm # maps/southern_cross/southern_cross-3.dmm # maps/southern_cross/southern_cross-4.dmm # maps/southern_cross/southern_cross-6.dmm # vorestation.dme
This commit is contained in:
@@ -1,21 +1,34 @@
|
||||
/datum/reagents/metabolism
|
||||
var/metabolism_class //CHEM_TOUCH, CHEM_INGEST, or CHEM_BLOOD
|
||||
var/metabolism_speed = 1 // Multiplicative, 1 is full speed, 0.5 is half, etc.
|
||||
var/mob/living/carbon/parent
|
||||
|
||||
/datum/reagents/metabolism/New(var/max = 100, mob/living/carbon/parent_mob, var/met_class)
|
||||
/datum/reagents/metabolism/New(var/max = 100, mob/living/carbon/parent_mob, var/met_class = null)
|
||||
..(max, parent_mob)
|
||||
|
||||
metabolism_class = met_class
|
||||
|
||||
if(met_class)
|
||||
metabolism_class = met_class
|
||||
if(istype(parent_mob))
|
||||
parent = parent_mob
|
||||
|
||||
/datum/reagents/metabolism/proc/metabolize()
|
||||
|
||||
|
||||
var/metabolism_type = 0 //non-human mobs
|
||||
if(ishuman(parent))
|
||||
var/mob/living/carbon/human/H = parent
|
||||
metabolism_type = H.species.reagent_tag
|
||||
|
||||
|
||||
for(var/datum/reagent/current in reagent_list)
|
||||
current.on_mob_life(parent, metabolism_type, metabolism_class)
|
||||
update_total()
|
||||
current.on_mob_life(parent, metabolism_type, src)
|
||||
update_total()
|
||||
|
||||
// "Specialized" metabolism datums
|
||||
/datum/reagents/metabolism/bloodstream
|
||||
metabolism_class = CHEM_BLOOD
|
||||
|
||||
/datum/reagents/metabolism/ingested
|
||||
metabolism_class = CHEM_INGEST
|
||||
metabolism_speed = 0.5
|
||||
|
||||
/datum/reagents/metabolism/touch
|
||||
metabolism_class = CHEM_TOUCH
|
||||
@@ -57,12 +57,17 @@
|
||||
/datum/reagent/proc/touch_turf(var/turf/T, var/amount) // Cleaner cleaning, lube lubbing, etc, all go here
|
||||
return
|
||||
|
||||
/datum/reagent/proc/on_mob_life(var/mob/living/carbon/M, var/alien, var/location) // Currently, on_mob_life is called on carbons. Any interaction with non-carbon mobs (lube) will need to be done in touch_mob.
|
||||
/datum/reagent/proc/on_mob_life(var/mob/living/carbon/M, var/alien, var/datum/reagents/metabolism/location) // Currently, on_mob_life is called on carbons. Any interaction with non-carbon mobs (lube) will need to be done in touch_mob.
|
||||
if(!istype(M))
|
||||
return
|
||||
if(!affects_dead && M.stat == DEAD)
|
||||
return
|
||||
if(!istype(location))
|
||||
return
|
||||
|
||||
var/datum/reagents/metabolism/active_metab = location
|
||||
var/removed = metabolism
|
||||
|
||||
if(!mrate_static == TRUE)
|
||||
// Modifiers
|
||||
for(var/datum/modifier/mod in M.modifiers)
|
||||
@@ -70,23 +75,25 @@
|
||||
removed *= mod.metabolism_percent
|
||||
// Species
|
||||
removed *= M.species.metabolic_rate
|
||||
// Metabolism
|
||||
removed *= active_metab.metabolism_speed
|
||||
|
||||
if(ingest_met && (location == CHEM_INGEST))
|
||||
if(ingest_met && (active_metab.metabolism_class == CHEM_INGEST))
|
||||
removed = ingest_met
|
||||
if(touch_met && (location == CHEM_TOUCH))
|
||||
if(touch_met && (active_metab.metabolism_class == CHEM_TOUCH))
|
||||
removed = touch_met
|
||||
removed = min(removed, volume)
|
||||
max_dose = max(volume, max_dose)
|
||||
dose = min(dose + removed, max_dose)
|
||||
if(removed >= (metabolism * 0.1) || removed >= 0.1) // If there's too little chemical, don't affect the mob, just remove it
|
||||
switch(location)
|
||||
switch(active_metab.metabolism_class)
|
||||
if(CHEM_BLOOD)
|
||||
affect_blood(M, alien, removed)
|
||||
if(CHEM_INGEST)
|
||||
affect_ingest(M, alien, removed)
|
||||
if(CHEM_TOUCH)
|
||||
affect_touch(M, alien, removed)
|
||||
if(overdose && (volume > overdose) && (location != CHEM_TOUCH))
|
||||
if(overdose && (volume > overdose) && (active_metab.metabolism_class != CHEM_TOUCH))
|
||||
overdose(M, alien, removed)
|
||||
remove_self(removed)
|
||||
return
|
||||
@@ -95,7 +102,7 @@
|
||||
return
|
||||
|
||||
/datum/reagent/proc/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
|
||||
affect_blood(M, alien, removed * 0.5)
|
||||
M.bloodstr.add_reagent(id, removed)
|
||||
return
|
||||
|
||||
/datum/reagent/proc/affect_touch(var/mob/living/carbon/M, var/alien, var/removed)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/datum/reagent/blood
|
||||
data = new/list("donor" = null, "viruses" = null, "species" = "Human", "blood_DNA" = null, "blood_type" = null, "blood_colour" = "#A10808", "resistances" = null, "trace_chem" = null, "antibodies" = list())
|
||||
data = new/list("donor" = null, "viruses" = null, "species" = SPECIES_HUMAN, "blood_DNA" = null, "blood_type" = null, "blood_colour" = "#A10808", "resistances" = null, "trace_chem" = null, "antibodies" = list())
|
||||
name = "Blood"
|
||||
id = "blood"
|
||||
taste_description = "iron"
|
||||
|
||||
@@ -64,6 +64,9 @@
|
||||
taste_description = "pure alcohol"
|
||||
reagent_state = LIQUID
|
||||
color = "#404030"
|
||||
|
||||
ingest_met = REM
|
||||
|
||||
var/nutriment_factor = 0
|
||||
var/strength = 10 // This is, essentially, units between stages - the lower, the stronger. Less fine tuning, more clarity.
|
||||
var/toxicity = 1
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
taste_mult = 4
|
||||
reagent_state = SOLID
|
||||
metabolism = REM * 4
|
||||
ingest_met = REM * 4
|
||||
var/nutriment_factor = 30 // Per unit
|
||||
var/injectable = 0
|
||||
color = "#664330"
|
||||
@@ -255,6 +256,7 @@
|
||||
reagent_state = SOLID
|
||||
color = "#FFFFFF"
|
||||
overdose = REAGENTS_OVERDOSE
|
||||
ingest_met = REM
|
||||
|
||||
/datum/reagent/blackpepper
|
||||
name = "Black Pepper"
|
||||
@@ -262,6 +264,7 @@
|
||||
description = "A powder ground from peppercorns. *AAAACHOOO*"
|
||||
taste_description = "pepper"
|
||||
reagent_state = SOLID
|
||||
ingest_met = REM
|
||||
color = "#000000"
|
||||
|
||||
/datum/reagent/enzyme
|
||||
@@ -281,6 +284,7 @@
|
||||
taste_description = "mint"
|
||||
taste_mult = 1.5
|
||||
reagent_state = LIQUID
|
||||
ingest_met = REM
|
||||
color = "#B31008"
|
||||
|
||||
/datum/reagent/frostoil/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
|
||||
@@ -308,6 +312,7 @@
|
||||
taste_description = "hot peppers"
|
||||
taste_mult = 1.5
|
||||
reagent_state = LIQUID
|
||||
ingest_met = REM
|
||||
color = "#B31008"
|
||||
|
||||
/datum/reagent/capsaicin/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
|
||||
@@ -341,6 +346,7 @@
|
||||
taste_mult = 10
|
||||
reagent_state = LIQUID
|
||||
touch_met = 50 // Get rid of it quickly
|
||||
ingest_met = REM
|
||||
color = "#B31008"
|
||||
|
||||
/datum/reagent/condensedcapsaicin/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
|
||||
@@ -424,6 +430,7 @@
|
||||
name = "Drink"
|
||||
id = "drink"
|
||||
description = "Uh, some kind of drink."
|
||||
ingest_met = REM
|
||||
reagent_state = LIQUID
|
||||
color = "#E78108"
|
||||
var/nutrition = 0 // Per unit
|
||||
|
||||
@@ -266,6 +266,18 @@
|
||||
user.drop_from_inventory(src)
|
||||
qdel(src)
|
||||
return
|
||||
else if(istype(D, /obj/item/stack/material) && D.get_material_name() == DEFAULT_WALL_MATERIAL)
|
||||
var/obj/item/stack/material/M = D
|
||||
if (M.use(1))
|
||||
var/obj/item/weapon/secbot_assembly/edCLN_assembly/B = new /obj/item/weapon/secbot_assembly/edCLN_assembly
|
||||
B.loc = get_turf(src)
|
||||
to_chat(user, "<span class='notice'>You armed the robot frame.</span>")
|
||||
if (user.get_inactive_hand()==src)
|
||||
user.remove_from_mob(src)
|
||||
user.put_in_inactive_hand(B)
|
||||
qdel(src)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need one sheet of metal to arm the robot frame.</span>")
|
||||
else if(istype(D, /obj/item/weapon/mop) || istype(D, /obj/item/weapon/soap) || istype(D, /obj/item/weapon/reagent_containers/glass/rag)) //VOREStation Edit - "Allows soap and rags to be used on buckets"
|
||||
if(reagents.total_volume < 1)
|
||||
to_chat(user, "<span class='warning'>\The [src] is empty!</span>")
|
||||
@@ -273,7 +285,6 @@
|
||||
reagents.trans_to_obj(D, 5)
|
||||
to_chat(user, "<span class='notice'>You wet \the [D] in \the [src].</span>")
|
||||
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
|
||||
return
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user