and finally, the modules folder. Now I can publish and take a break

This commit is contained in:
deathride58
2018-07-02 01:19:37 -04:00
parent 91805b8789
commit b1688405d9
380 changed files with 2204 additions and 1588 deletions
+58 -29
View File
@@ -303,7 +303,7 @@
need_mob_update += R.addiction_act_stage4(C)
if(40 to INFINITY)
to_chat(C, "<span class='notice'>You feel like you've gotten over your need for [R.name].</span>")
C.SendSignal(COMSIG_CLEAR_MOOD_EVENT, "[R.id]_addiction")
SEND_SIGNAL(C, COMSIG_CLEAR_MOOD_EVENT, "[R.id]_addiction")
cached_addictions.Remove(R)
addiction_tick++
if(C && need_mob_update) //some of the metabolized reagents had effects on the mob that requires some updates.
@@ -526,19 +526,54 @@
return TRUE
return FALSE
//Returns the average specific heat for all reagents currently in this holder.
/datum/reagents/proc/specific_heat()
. = 0
var/cached_amount = total_volume //cache amount
var/list/cached_reagents = reagent_list //cache reagents
for(var/I in cached_reagents)
var/datum/reagent/R = I
. += R.specific_heat * (R.volume / cached_amount)
/datum/reagents/proc/adjust_thermal_energy(J, min_temp = 2.7, max_temp = 1000)
var/S = specific_heat()
chem_temp = CLAMP(chem_temp + (J / (S * total_volume)), 2.7, 1000)
/datum/reagents/proc/add_reagent(reagent, amount, list/data=null, reagtemp = 300, no_react = 0)
if(!isnum(amount) || !amount)
return FALSE
if(amount < 0)
if(amount <= 0)
return FALSE
var/list/cached_reagents = reagent_list
update_total()
if(total_volume + amount > maximum_volume)
amount = (maximum_volume - total_volume) //Doesnt fit in. Make it disappear. Shouldnt happen. Will happen.
chem_temp = round(((amount * reagtemp) + (total_volume * chem_temp)) / (total_volume + amount)) //equalize with new chems
var/datum/reagent/D = GLOB.chemical_reagents_list[reagent]
if(!D)
WARNING("[my_atom] attempted to add a reagent called '[reagent]' which doesn't exist. ([usr])")
return FALSE
update_total()
var/cached_total = total_volume
if(cached_total + amount > maximum_volume)
amount = (maximum_volume - cached_total) //Doesnt fit in. Make it disappear. Shouldnt happen. Will happen.
if(amount <= 0)
return FALSE
var/new_total = cached_total + amount
var/cached_temp = chem_temp
var/list/cached_reagents = reagent_list
//Equalize temperature - Not using specific_heat() because the new chemical isn't in yet.
var/specific_heat = 0
var/thermal_energy = 0
for(var/i in cached_reagents)
var/datum/reagent/R = i
specific_heat += R.specific_heat * (R.volume / new_total)
thermal_energy += R.specific_heat * R.volume * cached_temp
specific_heat += D.specific_heat * (amount / new_total)
thermal_energy += D.specific_heat * amount * reagtemp
chem_temp = thermal_energy / (specific_heat * new_total)
////
//add the reagent to the existing if it exists
for(var/A in cached_reagents)
var/datum/reagent/R = A
if (R.id == reagent)
@@ -551,29 +586,23 @@
handle_reactions()
return TRUE
var/datum/reagent/D = GLOB.chemical_reagents_list[reagent]
if(D)
//otherwise make a new one
var/datum/reagent/R = new D.type(data)
cached_reagents += R
R.holder = src
R.volume = amount
if(data)
R.data = data
R.on_new(data)
var/datum/reagent/R = new D.type(data)
cached_reagents += R
R.holder = src
R.volume = amount
if(data)
R.data = data
R.on_new(data)
update_total()
if(my_atom)
my_atom.on_reagent_change(ADD_REAGENT)
if(!no_react)
handle_reactions()
if(isliving(my_atom))
R.on_mob_add(my_atom)
return TRUE
else
WARNING("[my_atom] attempted to add a reagent called '[reagent]' which doesn't exist. ([usr])")
return FALSE
update_total()
if(my_atom)
my_atom.on_reagent_change(ADD_REAGENT)
if(!no_react)
handle_reactions()
if(isliving(my_atom))
R.on_mob_add(my_atom)
return TRUE
/datum/reagents/proc/add_reagent_list(list/list_reagents, list/data=null) // Like add_reagent but you can enter a list. Format it like this: list("toxin" = 10, "beer" = 15)
for(var/r_id in list_reagents)
@@ -293,7 +293,7 @@
if(default_deconstruction_crowbar(I))
return
if(istype(I, /obj/item/reagent_containers) && !(I.flags_1 & ABSTRACT_1) && I.is_open_container())
if(istype(I, /obj/item/reagent_containers) && !(I.item_flags & ABSTRACT) && I.is_open_container())
var/obj/item/reagent_containers/B = I
. = 1 //no afterattack
if(beaker)
@@ -467,14 +467,14 @@
"creme_de_menthe",
"creme_de_cacao",
"triple_sec",
"sake",
"fernet"
"sake"
)
emagged_reagents = list(
"ethanol",
"iron",
"minttoxin",
"atomicbomb"
"atomicbomb",
"fernet"
)
@@ -46,13 +46,8 @@
if(stat & NOPOWER)
return
if(on)
if(beaker)
if(beaker.reagents.chem_temp > target_temperature)
beaker.reagents.chem_temp += min(-1, (target_temperature - beaker.reagents.chem_temp) * heater_coefficient)
if(beaker.reagents.chem_temp < target_temperature)
beaker.reagents.chem_temp += max(1, (target_temperature - beaker.reagents.chem_temp) * heater_coefficient)
beaker.reagents.chem_temp = round(beaker.reagents.chem_temp)
if(beaker && beaker.reagents.total_volume)
beaker.reagents.adjust_thermal_energy((target_temperature - beaker.reagents.chem_temp) * heater_coefficient * SPECIFIC_HEAT_DEFAULT * beaker.reagents.total_volume)
beaker.reagents.handle_reactions()
/obj/machinery/chem_heater/attackby(obj/item/I, mob/user, params)
@@ -62,7 +57,7 @@
if(default_deconstruction_crowbar(I))
return
if(istype(I, /obj/item/reagent_containers) && !(I.flags_1 & ABSTRACT_1) && I.is_open_container())
if(istype(I, /obj/item/reagent_containers) && !(I.item_flags & ABSTRACT) && I.is_open_container())
. = 1 //no afterattack
if(beaker)
to_chat(user, "<span class='warning'>A container is already loaded into [src]!</span>")
@@ -84,7 +84,7 @@
if(default_unfasten_wrench(user, I))
return
if(istype(I, /obj/item/reagent_containers) && !(I.flags_1 & ABSTRACT_1) && I.is_open_container())
if(istype(I, /obj/item/reagent_containers) && !(I.item_flags & ABSTRACT) && I.is_open_container())
. = 1 // no afterattack
if(panel_open)
to_chat(user, "<span class='warning'>You can't use the [src.name] while its panel is opened!</span>")
@@ -228,7 +228,7 @@
/obj/machinery/computer/pandemic/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/reagent_containers) && !(I.flags_1 & ABSTRACT_1) && I.is_open_container())
if(istype(I, /obj/item/reagent_containers) && !(I.item_flags & ABSTRACT) && I.is_open_container())
. = TRUE //no afterattack
if(stat & (NOPOWER|BROKEN))
return
@@ -81,7 +81,7 @@
if(panel_open) //Can't insert objects when its screwed open
return TRUE
if (istype(I, /obj/item/reagent_containers) && !(I.flags_1 & ABSTRACT_1) && I.is_open_container())
if (istype(I, /obj/item/reagent_containers) && !(I.item_flags & ABSTRACT) && I.is_open_container())
if (!beaker)
if(!user.transferItemToLoc(I, src))
to_chat(user, "<span class='warning'>[I] is stuck to your hand!</span>")
@@ -101,7 +101,7 @@
//Fill machine with a bag!
if(istype(I, /obj/item/storage/bag))
var/list/inserted = list()
if(I.SendSignal(COMSIG_TRY_STORAGE_TAKE_TYPE, /obj/item/reagent_containers/food/snacks/grown, src, limit - length(holdingitems), null, null, user, inserted))
if(SEND_SIGNAL(I, COMSIG_TRY_STORAGE_TAKE_TYPE, /obj/item/reagent_containers/food/snacks/grown, src, limit - length(holdingitems), null, null, user, inserted))
for(var/i in inserted)
holdingitems[i] = TRUE
if(!I.contents.len)
+11 -10
View File
@@ -8,6 +8,7 @@
var/name = "Reagent"
var/id = "reagent"
var/description = ""
var/specific_heat = SPECIFIC_HEAT_DEFAULT //J/(K*mol)
var/taste_description = "metaphorical salt"
var/taste_mult = 1 //how this taste compares to others. Higher values means it is more noticable
var/glass_name = "glass of ...what?" // use for specialty drinks.
@@ -18,7 +19,7 @@
var/reagent_state = LIQUID
var/list/data
var/current_cycle = 0
var/volume = 0
var/volume = 0 //pretend this is moles
var/color = "#000000" // rgb: 0, 0, 0
var/can_synth = TRUE // can this reagent be synthesized? (for example: odysseus syringe gun)
var/metabolization_rate = REAGENTS_METABOLISM //how fast the reagent is metabolized by the mob
@@ -87,37 +88,37 @@
/datum/reagent/proc/overdose_start(mob/living/M)
to_chat(M, "<span class='userdanger'>You feel like you took too much of [name]!</span>")
M.SendSignal(COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/drugs/overdose, name)
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/drugs/overdose, name)
return
/datum/reagent/proc/addiction_act_stage1(mob/living/M)
M.SendSignal(COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/drugs/withdrawal_light, name)
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/drugs/withdrawal_light, name)
if(prob(30))
to_chat(M, "<span class='notice'>You feel like having some [name] right about now.</span>")
return
/datum/reagent/proc/addiction_act_stage2(mob/living/M)
M.SendSignal(COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/drugs/withdrawal_medium, name)
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/drugs/withdrawal_medium, name)
if(prob(30))
to_chat(M, "<span class='notice'>You feel like you need [name]. You just can't get enough.</span>")
return
/datum/reagent/proc/addiction_act_stage3(mob/living/M)
M.SendSignal(COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/drugs/withdrawal_severe, name)
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/drugs/withdrawal_severe, name)
if(prob(30))
to_chat(M, "<span class='danger'>You have an intense craving for [name].</span>")
return
/datum/reagent/proc/addiction_act_stage4(mob/living/M)
M.SendSignal(COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/drugs/withdrawal_critical, name)
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/drugs/withdrawal_critical, name)
if(prob(30))
to_chat(M, "<span class='boldannounce'>You're not feeling good at all! You really need some [name].</span>")
return
/proc/pretty_string_from_reagent_list(var/list/reagent_list)
/proc/pretty_string_from_reagent_list(list/reagent_list)
//Convert reagent list to a printable string for logging etc
var/result = "| "
var/list/rs = list()
for (var/datum/reagent/R in reagent_list)
result += "[R.name], [R.volume] | "
rs += "[R.name], [R.volume]"
return result
return rs.Join(" | ")
@@ -88,6 +88,15 @@ All effects don't start immediately, but rather get worse over time; the rate is
glass_name = "glass of beer"
glass_desc = "A freezing pint of beer."
/datum/reagent/consumable/ethanol/beer/light
name = "Light Beer"
id = "light_beer"
description = "An alcoholic beverage brewed since ancient times on Old Earth. This variety has reduced calorie and alcohol content."
boozepwr = 5 //Space Europeans hate it
taste_description = "dish water"
glass_name = "glass of light beer"
glass_desc = "A freezing pint of watery light beer."
/datum/reagent/consumable/ethanol/beer/green
name = "Green Beer"
id = "greenbeer"
@@ -1739,10 +1748,6 @@ All effects don't start immediately, but rather get worse over time; the rate is
/datum/reagent/consumable/ethanol/branca_menta/on_mob_life(mob/living/M)
M.adjust_bodytemperature(-20 * TEMPERATURE_DAMAGE_COEFFICIENT, T0C)
if(M.nutrition <= NUTRITION_LEVEL_STARVING)
M.adjustToxLoss(1*REM, 0)
M.nutrition = max(M.nutrition - 5, 0)
M.overeatduration = 0
return ..()
/datum/reagent/consumable/ethanol/branca_menta/on_mob_add(mob/living/M)
@@ -7,7 +7,7 @@
/datum/reagent/drug/on_mob_delete(mob/living/M)
if(trippy)
M.SendSignal(COMSIG_CLEAR_MOOD_EVENT, "[id]_high")
SEND_SIGNAL(M, COMSIG_CLEAR_MOOD_EVENT, "[id]_high")
/datum/reagent/drug/space_drugs
name = "Space drugs"
@@ -28,7 +28,7 @@
/datum/reagent/drug/space_drugs/overdose_start(mob/living/M)
to_chat(M, "<span class='userdanger'>You start tripping hard!</span>")
M.SendSignal(COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/drugs/overdose, name)
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/drugs/overdose, name)
/datum/reagent/drug/space_drugs/overdose_process(mob/living/M)
if(M.hallucination < volume && prob(20))
@@ -49,7 +49,7 @@
if(prob(1))
var/smoke_message = pick("You feel relaxed.", "You feel calmed.","You feel alert.","You feel rugged.")
to_chat(M, "<span class='notice'>[smoke_message]</span>")
M.SendSignal(COMSIG_ADD_MOOD_EVENT, "smoked", /datum/mood_event/drugs/smoked, name)
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "smoked", /datum/mood_event/drugs/smoked, name)
M.AdjustStun(-20, 0)
M.AdjustKnockdown(-20, 0)
M.AdjustUnconscious(-20, 0)
@@ -1018,12 +1018,12 @@
else
if(O)
O.remove_atom_colour(WASHABLE_COLOUR_PRIORITY)
O.SendSignal(COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD)
SEND_SIGNAL(O, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD)
/datum/reagent/space_cleaner/reaction_turf(turf/T, reac_volume)
if(reac_volume >= 1)
T.remove_atom_colour(WASHABLE_COLOUR_PRIORITY)
T.SendSignal(COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD)
SEND_SIGNAL(T, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD)
for(var/obj/effect/decal/cleanable/C in T)
qdel(C)
@@ -1041,26 +1041,26 @@
H.lip_style = null
H.update_body()
for(var/obj/item/I in C.held_items)
I.SendSignal(COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD)
SEND_SIGNAL(I, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD)
if(C.wear_mask)
if(C.wear_mask.SendSignal(COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD))
if(SEND_SIGNAL(C.wear_mask, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD))
C.update_inv_wear_mask()
if(ishuman(M))
var/mob/living/carbon/human/H = C
if(H.head)
if(H.head.SendSignal(COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD))
if(SEND_SIGNAL(H.head, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD))
H.update_inv_head()
if(H.wear_suit)
if(H.wear_suit.SendSignal(COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD))
if(SEND_SIGNAL(H.wear_suit, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD))
H.update_inv_wear_suit()
else if(H.w_uniform)
if(H.w_uniform.SendSignal(COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD))
if(SEND_SIGNAL(H.w_uniform, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD))
H.update_inv_w_uniform()
if(H.shoes)
if(H.shoes.SendSignal(COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD))
if(SEND_SIGNAL(H.shoes, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD))
H.update_inv_shoes()
H.wash_cream()
M.SendSignal(COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD)
SEND_SIGNAL(M, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRENGTH_BLOOD)
/datum/reagent/space_cleaner/ez_clean
name = "EZ Clean"
@@ -58,6 +58,7 @@
id = "plasma"
description = "Plasma in its liquid form."
taste_description = "bitterness"
specific_heat = SPECIFIC_HEAT_PLASMA
taste_mult = 1.5
color = "#8228A0"
toxpwr = 3
@@ -180,7 +180,7 @@ Borg Shaker
recharge_time = 3
accepts_reagent_upgrades = FALSE
reagent_ids = list("beer", "orangejuice", "grenadine", "limejuice", "tomatojuice", "cola", "tonic", "sodawater", "ice", "cream", "whiskey", "vodka", "rum", "gin", "tequila", "vermouth", "wine", "kahlua", "cognac", "ale", "fernet", "milk", "coffee", "banana", "lemonjuice")
reagent_ids = list("beer", "orangejuice", "grenadine", "limejuice", "tomatojuice", "cola", "tonic", "sodawater", "ice", "cream", "whiskey", "vodka", "rum", "gin", "tequila", "vermouth", "wine", "kahlua", "cognac", "ale", "milk", "coffee", "banana", "lemonjuice")
/obj/item/reagent_containers/borghypo/borgshaker/attack(mob/M, mob/user)
return //Can't inject stuff with a shaker, can we? //not with that attitude
@@ -235,7 +235,7 @@ Borg Shaker
recharge_time = 3
accepts_reagent_upgrades = FALSE
reagent_ids = list("fakebeer")
reagent_ids = list("fakebeer", "fernet")
/obj/item/reagent_containers/borghypo/peace
name = "Peace Hypospray"
@@ -226,25 +226,10 @@
desc = "A small bottle of Romerol. The REAL zombie powder."
list_reagents = list("romerol" = 30)
/obj/item/reagent_containers/glass/bottle/flu_virion
name = "Flu virion culture bottle"
desc = "A small bottle. Contains H13N1 flu virion culture in synthblood medium."
spawned_disease = /datum/disease/advance/flu
/obj/item/reagent_containers/glass/bottle/epiglottis_virion
name = "Epiglottis virion culture bottle"
desc = "A small bottle. Contains Epiglottis virion culture in synthblood medium."
spawned_disease = /datum/disease/advance/voice_change
/obj/item/reagent_containers/glass/bottle/liver_enhance_virion
name = "Liver enhancement virion culture bottle"
desc = "A small bottle. Contains liver enhancement virion culture in synthblood medium."
spawned_disease = /datum/disease/advance/heal
/obj/item/reagent_containers/glass/bottle/hallucigen_virion
name = "Hallucigen virion culture bottle"
desc = "A small bottle. Contains hallucigen virion culture in synthblood medium."
spawned_disease = /datum/disease/advance/hallucigen
/obj/item/reagent_containers/glass/bottle/random_virus
name = "Experimental disease culture bottle"
desc = "A small bottle. Contains an untested viral culture in synthblood medium."
spawned_disease = /datum/disease/advance/random
/obj/item/reagent_containers/glass/bottle/pierrot_throat
name = "Pierrot's Throat culture bottle"
@@ -255,6 +240,11 @@
name = "Rhinovirus culture bottle"
desc = "A small bottle. Contains XY-rhinovirus culture in synthblood medium."
spawned_disease = /datum/disease/advance/cold
/obj/item/reagent_containers/glass/bottle/flu_virion
name = "Flu virion culture bottle"
desc = "A small bottle. Contains H13N1 flu virion culture in synthblood medium."
spawned_disease = /datum/disease/advance/flu
/obj/item/reagent_containers/glass/bottle/retrovirus
name = "Retrovirus culture bottle"
@@ -6,7 +6,7 @@
item_state = "spraycan"
lefthand_file = 'icons/mob/inhands/equipment/hydroponics_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/hydroponics_righthand.dmi'
flags_1 = NOBLUDGEON_1
item_flags = NOBLUDGEON
obj_flags = UNIQUE_RENAME
container_type = OPENCONTAINER
slot_flags = ITEM_SLOT_BELT
@@ -6,7 +6,7 @@
item_state = "cleaner"
lefthand_file = 'icons/mob/inhands/equipment/custodial_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/custodial_righthand.dmi'
flags_1 = NOBLUDGEON_1
item_flags = NOBLUDGEON
container_type = OPENCONTAINER
slot_flags = ITEM_SLOT_BELT
throwforce = 0