This commit is contained in:
Putnam
2020-01-10 17:57:03 -08:00
438 changed files with 5922 additions and 6464 deletions
+14 -10
View File
@@ -946,21 +946,25 @@
if(A.reagents)
var/chosen_id
var/list/reagent_options = sortList(GLOB.chemical_reagents_list)
switch(alert(usr, "Choose a method.", "Add Reagents", "Enter ID", "Choose ID"))
if("Enter ID")
switch(alert(usr, "Choose a method.", "Add Reagents", "Search", "Choose from a list", "I'm feeling lucky"))
if("Search")
var/valid_id
while(!valid_id)
chosen_id = stripped_input(usr, "Enter the ID of the reagent you want to add.")
if(!chosen_id) //Get me out of here!
chosen_id = input(usr, "Enter the ID of the reagent you want to add.", "Search reagents") as null|text
if(isnull(chosen_id)) //Get me out of here!
break
for(var/ID in reagent_options)
if(ID == chosen_id)
valid_id = 1
if(!ispath(text2path(chosen_id)))
chosen_id = pick_closest_path(chosen_id, make_types_fancy(subtypesof(/datum/reagent)))
if(ispath(chosen_id))
valid_id = TRUE
else
valid_id = TRUE
if(!valid_id)
to_chat(usr, "<span class='warning'>A reagent with that ID doesn't exist!</span>")
if("Choose ID")
chosen_id = input(usr, "Choose a reagent to add.", "Choose a reagent.") as null|anything in reagent_options
if("Choose from a list")
chosen_id = input(usr, "Choose a reagent to add.", "Choose a reagent.") as null|anything in subtypesof(/datum/reagent)
if("I'm feeling lucky")
chosen_id = pick(subtypesof(/datum/reagent))
if(chosen_id)
var/amount = input(usr, "Choose the amount to add.", "Choose the amount.", A.reagents.maximum_volume) as num
if(amount)
+1 -1
View File
@@ -103,7 +103,7 @@
if(!(spread_flags & DISEASE_SPREAD_AIRBORNE) && !force_spread)
return
if(affected_mob.reagents.has_reagent("spaceacillin") || (affected_mob.satiety > 0 && prob(affected_mob.satiety/10)))
if(affected_mob.reagents.has_reagent(/datum/reagent/medicine/spaceacillin) || (affected_mob.satiety > 0 && prob(affected_mob.satiety/10)))
return
var/spread_range = 2
+15 -11
View File
@@ -36,37 +36,41 @@
// The order goes from easy to cure to hard to cure. Keep in mind that sentient diseases pick two cures from tier 6 and up, ensure they wont react away in bodies.
var/static/list/advance_cures = list(
list( // level 1
"copper", "silver", "iodine", "iron", "carbon"
/datum/reagent/copper, /datum/reagent/silver, /datum/reagent/iodine, /datum/reagent/iron, /datum/reagent/carbon
),
list( // level 2
"potassium", "ethanol", "lithium", "silicon", "bromine"
/datum/reagent/potassium, /datum/reagent/consumable/ethanol, /datum/reagent/lithium,
/datum/reagent/silicon, /datum/reagent/bromine
),
list( // level 3
"sodiumchloride", "sugar", "orangejuice", "tomatojuice", "milk"
/datum/reagent/consumable/sodiumchloride, /datum/reagent/consumable/sugar, /datum/reagent/consumable/orangejuice,
/datum/reagent/consumable/tomatojuice, /datum/reagent/consumable/milk
),
list( //level 4
"spaceacillin", "salglu_solution", "epinephrine", "charcoal"
/datum/reagent/medicine/spaceacillin, /datum/reagent/medicine/salglu_solution,
/datum/reagent/medicine/epinephrine, /datum/reagent/medicine/charcoal
),
list( //level 5
"oil", "synaptizine", "mannitol", "space_drugs", "cryptobiolin"
/datum/reagent/oil, /datum/reagent/medicine/synaptizine, /datum/reagent/medicine/mannitol,
/datum/reagent/drug/space_drugs, /datum/reagent/cryptobiolin
),
list( // level 6
"phenol", "inacusiate", "oculine", "antihol"
/datum/reagent/phenol, /datum/reagent/medicine/inacusiate, /datum/reagent/medicine/oculine, /datum/reagent/medicine/antihol
),
list( // level 7
"leporazine", "mindbreaker", "corazone"
/datum/reagent/medicine/leporazine, /datum/reagent/toxin/mindbreaker, /datum/reagent/medicine/corazone
),
list( // level 8
"pax", "happiness", "ephedrine"
/datum/reagent/pax, /datum/reagent/drug/happiness, /datum/reagent/medicine/ephedrine
),
list( // level 9
"lipolicide", "sal_acid"
/datum/reagent/toxin/lipolicide, /datum/reagent/medicine/sal_acid
),
list( // level 10
"haloperidol", "aranesp", "diphenhydramine"
/datum/reagent/medicine/haloperidol, /datum/reagent/drug/aranesp, /datum/reagent/medicine/diphenhydramine
),
list( //level 11
"modafinil", "anacea"
/datum/reagent/medicine/modafinil, /datum/reagent/toxin/anacea
)
)
@@ -138,7 +138,7 @@ Bonus
var/get_damage = rand(15,21) * power
M.adjustOxyLoss(get_damage)
if(paralysis)
M.reagents.add_reagent_list(list("pancuronium" = 3, "sodium_thiopental" = 3))
M.reagents.add_reagent_list(list(/datum/reagent/toxin/pancuronium = 3, /datum/reagent/toxin/sodium_thiopental = 3))
return 1
/datum/symptom/asphyxiation/proc/Asphyxiate_death(mob/living/M, datum/disease/advance/A)
@@ -156,7 +156,7 @@ Bonus
M.adjust_fire_stacks(get_stacks)
M.adjustFireLoss(get_stacks/2)
if(chems)
M.reagents.add_reagent("clf3", 2 * power)
M.reagents.add_reagent(/datum/reagent/clf3, 2 * power)
return 1
/datum/symptom/alkali/proc/Alkali_fire_stage_5(mob/living/M, datum/disease/advance/A)
@@ -164,5 +164,5 @@ Bonus
M.adjust_fire_stacks(get_stacks)
M.adjustFireLoss(get_stacks)
if(chems)
M.reagents.add_reagent_list(list("napalm" = 4 * power, "clf3" = 4 * power))
M.reagents.add_reagent_list(list(/datum/reagent/napalm = 4 * power, /datum/reagent/clf3 = 4 * power))
return 1
@@ -124,7 +124,7 @@ Bonus
var/get_damage = rand(6,10)
M.adjustBruteLoss(get_damage)
if(chems)
M.reagents.add_reagent_list(list("heparin" = 2, "lipolicide" = 2))
M.reagents.add_reagent_list(list(/datum/reagent/toxin/heparin = 2, /datum/reagent/toxin/lipolicide = 2))
if(zombie)
M.reagents.add_reagent("romerol", 1)
M.reagents.add_reagent(/datum/reagent/romerol, 1)
return 1
@@ -117,8 +117,9 @@
power = 2
/datum/symptom/heal/chem/Heal(mob/living/M, datum/disease/advance/A, actual_power)
for(var/datum/reagent/R in M.reagents.reagent_list) //Not just toxins!
M.reagents.remove_reagent(R.id, actual_power)
for(var/E in M.reagents.reagent_list) //Not just toxins!
var/datum/reagent/R = E
M.reagents.remove_reagent(R.type, actual_power)
if(food_conversion)
M.nutrition += 0.3
if(prob(2))
@@ -329,11 +330,11 @@
if(M.fire_stacks < 0)
M.fire_stacks = min(M.fire_stacks + 1 * absorption_coeff, 0)
. += power
if(M.reagents.has_reagent("holywater"))
M.reagents.remove_reagent("holywater", 0.5 * absorption_coeff)
if(M.reagents.has_reagent(/datum/reagent/water/holywater))
M.reagents.remove_reagent(/datum/reagent/water/holywater, 0.5 * absorption_coeff)
. += power * 0.75
else if(M.reagents.has_reagent("water"))
M.reagents.remove_reagent("water", 0.5 * absorption_coeff)
else if(M.reagents.has_reagent(/datum/reagent/water))
M.reagents.remove_reagent(/datum/reagent/water, 0.5 * absorption_coeff)
. += power * 0.5
/datum/symptom/heal/water/Heal(mob/living/carbon/M, datum/disease/advance/A, actual_power)
@@ -392,7 +393,7 @@
plasmamount = environment.gases[/datum/gas/plasma]
if(plasmamount && plasmamount > GLOB.meta_gas_visibility[/datum/gas/plasma]) //if there's enough plasma in the air to see
. += power * 0.5
if(M.reagents.has_reagent("plasma"))
if(M.reagents.has_reagent(/datum/reagent/toxin/plasma))
. += power * 0.75
/datum/symptom/heal/plasma/Heal(mob/living/carbon/M, datum/disease/advance/A, actual_power)
@@ -44,10 +44,10 @@
if(A.stage >= 4)
M.drowsyness = max(0, M.drowsyness - 2)
if(M.reagents.has_reagent("mindbreaker"))
M.reagents.remove_reagent("mindbreaker", 5)
if(M.reagents.has_reagent("histamine"))
M.reagents.remove_reagent("histamine", 5)
if(M.reagents.has_reagent(/datum/reagent/toxin/mindbreaker))
M.reagents.remove_reagent(/datum/reagent/toxin/mindbreaker, 5)
if(M.reagents.has_reagent(/datum/reagent/toxin/histamine))
M.reagents.remove_reagent(/datum/reagent/toxin/histamine, 5)
M.hallucination = max(0, M.hallucination - 10)
if(A.stage >= 5)
+1 -1
View File
@@ -5,7 +5,7 @@
spread_text = "On contact"
spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_CONTACT_FLUIDS
cure_text = "Ethanol"
cures = list("ethanol")
cures = list(/datum/reagent/consumable/ethanol)
agent = "Excess Lepidopticides"
viable_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
desc = "If left untreated subject will regurgitate butterflies."
+1 -1
View File
@@ -5,7 +5,7 @@
spread_text = "On contact"
spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_CONTACT_FLUIDS
cure_text = "Sugar"
cures = list("sugar")
cures = list(/datum/reagent/consumable/sugar)
agent = "Apidae Infection"
viable_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
desc = "If left untreated subject will regurgitate bees."
+1 -1
View File
@@ -4,7 +4,7 @@
spread_text = "On contact"
spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_CONTACT_FLUIDS
cure_text = "Mannitol"
cures = list("mannitol")
cures = list(/datum/reagent/medicine/mannitol)
agent = "Cryptococcus Cosmosis"
viable_mobtypes = list(/mob/living/carbon/human)
cure_chance = 15//higher chance to cure, since two reagents are required
+1 -1
View File
@@ -2,7 +2,7 @@
name = "The Cold"
max_stages = 3
cure_text = "Rest & Spaceacillin"
cures = list("spaceacillin")
cures = list(/datum/reagent/medicine/spaceacillin)
agent = "XY-rhinovirus"
viable_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
permeability_mod = 0.5
+1 -1
View File
@@ -4,7 +4,7 @@
spread_text = "On contact"
spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_CONTACT_FLUIDS
cure_text = "Common Cold Anti-bodies & Spaceacillin"
cures = list("spaceacillin")
cures = list(/datum/reagent/medicine/spaceacillin)
agent = "ICE9-rhinovirus"
viable_mobtypes = list(/mob/living/carbon/human)
desc = "If left untreated the subject will slow, as if partly frozen."
+1 -1
View File
@@ -4,7 +4,7 @@
spread_text = "On contact"
spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_CONTACT_FLUIDS
cure_text = "Mutadone"
cures = list("mutadone")
cures = list(/datum/reagent/medicine/mutadone)
disease_flags = CAN_CARRY|CAN_RESIST|CURABLE
agent = "S4E1 retrovirus"
viable_mobtypes = list(/mob/living/carbon/human)
+1 -1
View File
@@ -4,7 +4,7 @@
spread_text = "On contact"
spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_CONTACT_FLUIDS
cure_text = "Synaptizine & Sulfur"
cures = list("synaptizine","sulfur")
cures = list(/datum/reagent/medicine/synaptizine,/datum/reagent/sulfur)
agent = "Gravitokinetic Bipotential SADS-"
viable_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
desc = "If left untreated death will occur."
+1 -1
View File
@@ -3,7 +3,7 @@
max_stages = 3
spread_text = "Airborne"
cure_text = "Spaceacillin"
cures = list("spaceacillin")
cures = list(/datum/reagent/medicine/spaceacillin)
cure_chance = 10
agent = "H13N1 flu virion"
viable_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
+1 -1
View File
@@ -3,7 +3,7 @@
max_stages = 3
spread_text = "Airborne"
cure_text = "Spaceacillin & Anti-bodies to the common flu"
cures = list("spaceacillin")
cures = list(/datum/reagent/medicine/spaceacillin)
cure_chance = 10
agent = "1nqu1s1t10n flu virion"
viable_mobtypes = list(/mob/living/carbon/human)
+1 -1
View File
@@ -4,7 +4,7 @@
spread_text = "On contact"
spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_CONTACT_FLUIDS
cure_text = "Synaptizine & Sulfur"
cures = list("synaptizine","sulfur")
cures = list(/datum/reagent/medicine/synaptizine,/datum/reagent/sulfur)
cure_chance = 15//higher chance to cure, since two reagents are required
agent = "Gravitokinetic Bipotential SADS+"
viable_mobtypes = list(/mob/living/carbon/human)
+1 -1
View File
@@ -58,7 +58,7 @@
H.visible_message("<span class='userdanger'>[H] clutches at [H.p_their()] chest as if [H.p_their()] heart is stopping!</span>")
H.adjustStaminaLoss(60)
H.set_heartattack(TRUE)
H.reagents.add_reagent("corazone", 3) // To give the victim a final chance to shock their heart before losing consciousness
H.reagents.add_reagent(/datum/reagent/medicine/corazone, 3) // To give the victim a final chance to shock their heart before losing consciousness
cure()
else
+1 -1
View File
@@ -3,7 +3,7 @@
max_stages = 4
spread_text = "Airborne"
cure_text = "Iron"
cures = list("iron")
cures = list(/datum/reagent/iron)
agent = "Fukkos Miracos"
viable_mobtypes = list(/mob/living/carbon/human)
disease_flags = CAN_CARRY|CAN_RESIST|CURABLE
+1 -1
View File
@@ -5,7 +5,7 @@
spread_flags = DISEASE_SPREAD_SPECIAL
disease_flags = CURABLE
cure_text = "Holy Water."
cures = list("holywater")
cures = list(/datum/reagent/water/holywater)
cure_chance = 20
agent = "Avian Vengence"
viable_mobtypes = list(/mob/living/carbon/human)
+1 -1
View File
@@ -3,7 +3,7 @@
max_stages = 4
spread_text = "Airborne"
cure_text = "Banana products, especially banana bread."
cures = list("banana")
cures = list(/datum/reagent/consumable/banana)
cure_chance = 75
agent = "H0NI<42 Virus"
viable_mobtypes = list(/mob/living/carbon/human)
+1 -1
View File
@@ -17,7 +17,7 @@
..()
agent = "Virus class [pick("A","B","C","D","E","F")][pick("A","B","C","D","E","F")]-[rand(50,300)]"
if(prob(40))
cures = list("mutadone")
cures = list(/datum/reagent/medicine/mutadone)
else
restcure = 1
+1 -1
View File
@@ -4,7 +4,7 @@
spread_text = "On contact"
spread_flags = DISEASE_SPREAD_BLOOD | DISEASE_SPREAD_CONTACT_SKIN | DISEASE_SPREAD_CONTACT_FLUIDS
cure_text = "Chick Chicky Boom!"
cures = list("plasma")
cures = list(/datum/reagent/toxin/plasma)
agent = "Unknown"
viable_mobtypes = list(/mob/living/carbon/human)
permeability_mod = 1
+10 -10
View File
@@ -93,7 +93,7 @@
/datum/disease/transformation/jungle_fever
name = "Jungle Fever"
cure_text = "Death."
cures = list("adminordrazine")
cures = list(/datum/reagent/medicine/adminordrazine)
spread_text = "Monkey Bites"
spread_flags = DISEASE_SPREAD_SPECIAL
viable_mobtypes = list(/mob/living/carbon/monkey, /mob/living/carbon/human)
@@ -156,7 +156,7 @@
name = "Robotic Transformation"
cure_text = "An injection of copper."
cures = list("copper")
cures = list(/datum/reagent/copper)
cure_chance = 5
agent = "R2D2 Nanomachines"
desc = "This disease, actually acute nanomachine infection, converts the victim into a cyborg."
@@ -189,7 +189,7 @@
name = "Xenomorph Transformation"
cure_text = "Spaceacillin & Glycerol"
cures = list("spaceacillin", "glycerol")
cures = list(/datum/reagent/medicine/spaceacillin, /datum/reagent/glycerol)
cure_chance = 5
agent = "Rip-LEY Alien Microbes"
desc = "This disease changes the victim into a xenomorph."
@@ -218,7 +218,7 @@
/datum/disease/transformation/slime
name = "Advanced Mutation Transformation"
cure_text = "frost oil"
cures = list("frostoil")
cures = list(/datum/reagent/consumable/frostoil)
cure_chance = 80
agent = "Advanced Mutation Toxin"
desc = "This highly concentrated extract converts anything into more of itself."
@@ -247,7 +247,7 @@
/datum/disease/transformation/corgi
name = "The Barkening"
cure_text = "Death"
cures = list("adminordrazine")
cures = list(/datum/reagent/medicine/adminordrazine)
agent = "Fell Doge Majicks"
desc = "This disease transforms the victim into a corgi."
severity = DISEASE_SEVERITY_BIOHAZARD
@@ -272,7 +272,7 @@
/datum/disease/transformation/morph
name = "Gluttony's Blessing"
cure_text = "nothing"
cures = list("adminordrazine")
cures = list(/datum/reagent/medicine/adminordrazine)
agent = "Gluttony's Blessing"
desc = "A 'gift' from somewhere terrible."
stage_prob = 20
@@ -289,7 +289,7 @@
/datum/disease/transformation/gondola
name = "Gondola Transformation"
cure_text = "Condensed Capsaicin, ingested or injected." //getting pepper sprayed doesn't help
cures = list("condensedcapsaicin") //beats the hippie crap right out of your system
cures = list(/datum/reagent/consumable/condensedcapsaicin) //beats the hippie crap right out of your system
cure_chance = 80
stage_prob = 5
agent = "Tranquility"
@@ -310,17 +310,17 @@
if (prob(5))
affected_mob.emote("smile")
if (prob(20))
affected_mob.reagents.add_reagent_list(list("pax" = 5))
affected_mob.reagents.add_reagent(/datum/reagent/pax, 5)
if(3)
if (prob(5))
affected_mob.emote("smile")
if (prob(20))
affected_mob.reagents.add_reagent_list(list("pax" = 5))
affected_mob.reagents.add_reagent(/datum/reagent/pax, 5)
if(4)
if (prob(5))
affected_mob.emote("smile")
if (prob(20))
affected_mob.reagents.add_reagent_list(list("pax" = 5))
affected_mob.reagents.add_reagent(/datum/reagent/pax, 5)
if (prob(2))
to_chat(affected_mob, "<span class='danger'>You let go of what you were holding.</span>")
var/obj/item/I = affected_mob.get_active_held_item()
+1 -1
View File
@@ -4,7 +4,7 @@
max_stages = 5
spread_text = "Airborne"
cure_text = "Spaceacillin & salbutamol"
cures = list("spaceacillin", "salbutamol")
cures = list(/datum/reagent/medicine/spaceacillin, /datum/reagent/medicine/salbutamol)
agent = "Fungal Tubercle bacillus Cosmosis"
viable_mobtypes = list(/mob/living/carbon/human)
cure_chance = 5//like hell are you getting out of hell
+1 -1
View File
@@ -3,7 +3,7 @@
max_stages = 4
spread_text = "Airborne"
cure_text = "The Manly Dorf"
cures = list("manlydorf")
cures = list(/datum/reagent/consumable/ethanol/manly_dorf)
cure_chance = 100
agent = "Rincewindus Vulgaris"
viable_mobtypes = list(/mob/living/carbon/human)
+1 -1
View File
@@ -88,7 +88,7 @@
var/obj/result_obj = new result(container)
for (var/obj/O in (container.contents-result_obj))
if (O.reagents)
O.reagents.del_reagent("nutriment")
O.reagents.del_reagent(/datum/reagent/consumable/nutriment)
O.reagents.update_total()
O.reagents.trans_to(result_obj, O.reagents.total_volume)
qdel(O)
+6 -6
View File
@@ -8,29 +8,29 @@
/datum/map_template/ruin/station/box/engine
id = "engine_sm"
suffix = "Box/Engine/engine_sm.dmm"
name = "Engine SM"
name = "Box SM"
/datum/map_template/ruin/station/box/engine/onebythree
id = "engine_sm_1x3"
suffix = "Box/Engine/engine_sm_1x3.dmm"
name = "Engine SM 1x3"
name = "Box SM 1x3"
/datum/map_template/ruin/station/box/engine/fivebyfive
id = "engine_sm_5x5"
suffix = "Box/Engine/engine_sm_5x5.dmm"
name = "Engine SM 5x5"
name = "Box SM 5x5"
/datum/map_template/ruin/station/box/engine/threesm
id = "engine_sm_3x"
suffix = "Box/Engine/engine_sm_3x.dmm"
name = "Engine SM 3x"
name = "Box SM 3x"
/datum/map_template/ruin/station/box/engine/singulo
id = "engine_singulo"
suffix = "Box/Engine/engine_singulo.dmm"
name = "Engine Singulo"
name = "Box Singulo"
/datum/map_template/ruin/station/box/engine/tesla
id = "engine_tesla"
suffix = "Box/Engine/engine_tesla.dmm"
name = "Engine Tesla"
name = "Box Tesla"
+1 -1
View File
@@ -308,7 +308,7 @@
/datum/status_effect/cultghost/tick()
if(owner.reagents)
owner.reagents.del_reagent("holywater") //can't be deconverted
owner.reagents.del_reagent(/datum/reagent/water/holywater) //can't be deconverted
/datum/status_effect/crusher_mark
id = "crusher_mark"
+1 -1
View File
@@ -289,7 +289,7 @@
medical_record_text = "Patient suffers from acute Reality Dissociation Syndrome and experiences vivid hallucinations."
/datum/quirk/insanity/on_process()
if(quirk_holder.reagents.has_reagent("mindbreaker"))
if(quirk_holder.reagents.has_reagent(/datum/reagent/toxin/mindbreaker))
quirk_holder.hallucination = 0
return
if(prob(2)) //we'll all be mad soon enough
+48
View File
@@ -0,0 +1,48 @@
/datum/wires/autoylathe
holder_type = /obj/machinery/autoylathe
proper_name = "Autoylathe"
/datum/wires/autoylathe/New(atom/holder)
wires = list(
WIRE_HACK, WIRE_DISABLE,
WIRE_SHOCK, WIRE_ZAP
)
add_duds(6)
..()
/datum/wires/autoylathe/interactable(mob/user)
var/obj/machinery/autoylathe/A = holder
if(A.panel_open)
return TRUE
/datum/wires/autoylathe/get_status()
var/obj/machinery/autoylathe/A = holder
var/list/status = list()
status += "The red light is [A.disabled ? "on" : "off"]."
status += "The blue light is [A.hacked ? "on" : "off"]."
return status
/datum/wires/autoylathe/on_pulse(wire)
var/obj/machinery/autoylathe/A = holder
switch(wire)
if(WIRE_HACK)
A.adjust_hacked(!A.hacked)
addtimer(CALLBACK(A, /obj/machinery/autoylathe.proc/reset, wire), 60)
if(WIRE_SHOCK)
A.shocked = !A.shocked
addtimer(CALLBACK(A, /obj/machinery/autoylathe.proc/reset, wire), 60)
if(WIRE_DISABLE)
A.disabled = !A.disabled
addtimer(CALLBACK(A, /obj/machinery/autoylathe.proc/reset, wire), 60)
/datum/wires/autoylathe/on_cut(wire, mend)
var/obj/machinery/autoylathe/A = holder
switch(wire)
if(WIRE_HACK)
A.adjust_hacked(!mend)
if(WIRE_HACK)
A.shocked = !mend
if(WIRE_DISABLE)
A.disabled = !mend
if(WIRE_ZAP)
A.shock(usr, 50)
+189 -183
View File
@@ -1,183 +1,189 @@
// SETUP
/proc/TopicHandlers()
. = list()
var/list/all_handlers = subtypesof(/datum/world_topic)
for(var/I in all_handlers)
var/datum/world_topic/WT = I
var/keyword = initial(WT.keyword)
if(!keyword)
warning("[WT] has no keyword! Ignoring...")
continue
var/existing_path = .[keyword]
if(existing_path)
warning("[existing_path] and [WT] have the same keyword! Ignoring [WT]...")
else if(keyword == "key")
warning("[WT] has keyword 'key'! Ignoring...")
else
.[keyword] = WT
// DATUM
/datum/world_topic
var/keyword
var/log = TRUE
var/key_valid
var/require_comms_key = FALSE
/datum/world_topic/proc/TryRun(list/input)
key_valid = config && (CONFIG_GET(string/comms_key) == input["key"])
if(require_comms_key && !key_valid)
return "Bad Key"
input -= "key"
. = Run(input)
if(islist(.))
. = list2params(.)
/datum/world_topic/proc/Run(list/input)
CRASH("Run() not implemented for [type]!")
// TOPICS
/datum/world_topic/ping
keyword = "ping"
log = FALSE
/datum/world_topic/ping/Run(list/input)
. = 0
for (var/client/C in GLOB.clients)
++.
/datum/world_topic/playing
keyword = "playing"
log = FALSE
/datum/world_topic/playing/Run(list/input)
return GLOB.player_list.len
/datum/world_topic/pr_announce
keyword = "announce"
require_comms_key = TRUE
var/static/list/PRcounts = list() //PR id -> number of times announced this round
/datum/world_topic/pr_announce/Run(list/input)
var/list/payload = json_decode(input["payload"])
var/id = "[payload["pull_request"]["id"]]"
if(!PRcounts[id])
PRcounts[id] = 1
else
++PRcounts[id]
if(PRcounts[id] > PR_ANNOUNCEMENTS_PER_ROUND)
return
var/final_composed = "<span class='announce'>PR: [input[keyword]]</span>"
for(var/client/C in GLOB.clients)
C.AnnouncePR(final_composed)
/datum/world_topic/ahelp_relay
keyword = "Ahelp"
require_comms_key = TRUE
/datum/world_topic/ahelp_relay/Run(list/input)
relay_msg_admins("<span class='adminnotice'><b><font color=red>HELP: </font> [input["source"]] [input["message_sender"]]: [input["message"]]</b></span>")
/datum/world_topic/comms_console
keyword = "Comms_Console"
require_comms_key = TRUE
/datum/world_topic/comms_console/Run(list/input)
minor_announce(input["message"], "Incoming message from [input["message_sender"]]")
for(var/obj/machinery/computer/communications/CM in GLOB.machines)
CM.overrideCooldown()
/datum/world_topic/news_report
keyword = "News_Report"
require_comms_key = TRUE
/datum/world_topic/news_report/Run(list/input)
minor_announce(input["message"], "Breaking Update From [input["message_sender"]]")
/datum/world_topic/server_hop
keyword = "server_hop"
/datum/world_topic/server_hop/Run(list/input)
var/expected_key = input[keyword]
for(var/mob/dead/observer/O in GLOB.player_list)
if(O.key == expected_key)
if(O.client)
new /obj/screen/splash(O.client, TRUE)
break
/datum/world_topic/adminmsg
keyword = "adminmsg"
require_comms_key = TRUE
/datum/world_topic/adminmsg/Run(list/input)
return IrcPm(input[keyword], input["msg"], input["sender"])
/datum/world_topic/namecheck
keyword = "namecheck"
require_comms_key = TRUE
/datum/world_topic/namecheck/Run(list/input)
//Oh this is a hack, someone refactor the functionality out of the chat command PLS
var/datum/tgs_chat_command/namecheck/NC = new
var/datum/tgs_chat_user/user = new
user.friendly_name = input["sender"]
user.mention = user.friendly_name
return NC.Run(user, input["namecheck"])
/datum/world_topic/adminwho
keyword = "adminwho"
require_comms_key = TRUE
/datum/world_topic/adminwho/Run(list/input)
return ircadminwho()
/datum/world_topic/status
keyword = "status"
/datum/world_topic/status/Run(list/input)
. = list()
.["version"] = GLOB.game_version
.["mode"] = "hidden" //CIT CHANGE - hides the gamemode in topic() calls to prevent meta'ing the gamemode
.["respawn"] = config ? !CONFIG_GET(flag/norespawn) : FALSE
.["enter"] = GLOB.enter_allowed
.["vote"] = CONFIG_GET(flag/allow_vote_mode)
.["ai"] = CONFIG_GET(flag/allow_ai)
.["host"] = world.host ? world.host : null
.["round_id"] = GLOB.round_id
.["players"] = GLOB.clients.len
.["revision"] = GLOB.revdata.commit
.["revision_date"] = GLOB.revdata.date
var/list/adm = get_admin_counts()
var/list/presentmins = adm["present"]
var/list/afkmins = adm["afk"]
.["admins"] = presentmins.len + afkmins.len //equivalent to the info gotten from adminwho
.["gamestate"] = SSticker.current_state
.["map_name"] = SSmapping.config?.map_name || "Loading..."
if(key_valid)
.["active_players"] = get_active_player_count()
if(SSticker.HasRoundStarted())
.["real_mode"] = SSticker.mode.name
// Key-authed callers may know the truth behind the "secret"
.["security_level"] = get_security_level()
.["round_duration"] = SSticker ? round((world.time-SSticker.round_start_time)/10) : 0
// Amount of world's ticks in seconds, useful for calculating round duration
//Time dilation stats.
.["time_dilation_current"] = SStime_track.time_dilation_current
.["time_dilation_avg"] = SStime_track.time_dilation_avg
.["time_dilation_avg_slow"] = SStime_track.time_dilation_avg_slow
.["time_dilation_avg_fast"] = SStime_track.time_dilation_avg_fast
if(SSshuttle && SSshuttle.emergency)
.["shuttle_mode"] = SSshuttle.emergency.mode
// Shuttle status, see /__DEFINES/stat.dm
.["shuttle_timer"] = SSshuttle.emergency.timeLeft()
// Shuttle timer, in seconds
// SETUP
/proc/TopicHandlers()
. = list()
var/list/all_handlers = subtypesof(/datum/world_topic)
for(var/I in all_handlers)
var/datum/world_topic/WT = I
var/keyword = initial(WT.keyword)
if(!keyword)
warning("[WT] has no keyword! Ignoring...")
continue
var/existing_path = .[keyword]
if(existing_path)
warning("[existing_path] and [WT] have the same keyword! Ignoring [WT]...")
else if(keyword == "key")
warning("[WT] has keyword 'key'! Ignoring...")
else
.[keyword] = WT
// DATUM
/datum/world_topic
var/keyword
var/log = TRUE
var/key_valid
var/require_comms_key = FALSE
/datum/world_topic/proc/TryRun(list/input, addr)
key_valid = config && (CONFIG_GET(string/comms_key) == input["key"])
if(require_comms_key && !key_valid)
return "Bad Key"
input -= "key"
. = Run(input, addr)
if(islist(.))
. = list2params(.)
/datum/world_topic/proc/Run(list/input, addr)
CRASH("Run() not implemented for [type]!")
// TOPICS
/datum/world_topic/ping
keyword = "ping"
log = FALSE
/datum/world_topic/ping/Run(list/input, addr)
. = 0
for (var/client/C in GLOB.clients)
++.
/datum/world_topic/playing
keyword = "playing"
log = FALSE
/datum/world_topic/playing/Run(list/input, addr)
return GLOB.player_list.len
/datum/world_topic/pr_announce
keyword = "announce"
require_comms_key = TRUE
var/static/list/PRcounts = list() //PR id -> number of times announced this round
/datum/world_topic/pr_announce/Run(list/input, addr)
var/list/payload = json_decode(input["payload"])
var/id = "[payload["pull_request"]["id"]]"
if(!PRcounts[id])
PRcounts[id] = 1
else
++PRcounts[id]
if(PRcounts[id] > PR_ANNOUNCEMENTS_PER_ROUND)
return
var/final_composed = "<span class='announce'>PR: [input[keyword]]</span>"
for(var/client/C in GLOB.clients)
C.AnnouncePR(final_composed)
/datum/world_topic/ahelp_relay
keyword = "Ahelp"
require_comms_key = TRUE
/datum/world_topic/ahelp_relay/Run(list/input, addr)
relay_msg_admins("<span class='adminnotice'><b><font color=red>HELP: </font> [input["source"]] [input["message_sender"]]: [input["message"]]</b></span>")
/datum/world_topic/comms_console
keyword = "Comms_Console"
require_comms_key = TRUE
/datum/world_topic/comms_console/Run(list/input, addr)
minor_announce(input["message"], "Incoming message from [input["message_sender"]]")
for(var/obj/machinery/computer/communications/CM in GLOB.machines)
CM.overrideCooldown()
/datum/world_topic/news_report
keyword = "News_Report"
require_comms_key = TRUE
/datum/world_topic/news_report/Run(list/input, addr)
minor_announce(input["message"], "Breaking Update From [input["message_sender"]]")
/datum/world_topic/server_hop
keyword = "server_hop"
/datum/world_topic/server_hop/Run(list/input, addr)
var/expected_key = input[keyword]
for(var/mob/dead/observer/O in GLOB.player_list)
if(O.key == expected_key)
if(O.client?.address == addr)
new /obj/screen/splash(O.client, TRUE)
break
/datum/world_topic/adminmsg
keyword = "adminmsg"
require_comms_key = TRUE
/datum/world_topic/adminmsg/Run(list/input, addr)
return IrcPm(input[keyword], input["msg"], input["sender"])
/datum/world_topic/namecheck
keyword = "namecheck"
require_comms_key = TRUE
/datum/world_topic/namecheck/Run(list/input, addr)
//Oh this is a hack, someone refactor the functionality out of the chat command PLS
var/datum/tgs_chat_command/namecheck/NC = new
var/datum/tgs_chat_user/user = new
user.friendly_name = input["sender"]
user.mention = user.friendly_name
return NC.Run(user, input["namecheck"])
/datum/world_topic/adminwho
keyword = "adminwho"
require_comms_key = TRUE
/datum/world_topic/adminwho/Run(list/input, addr)
return ircadminwho()
/datum/world_topic/status
keyword = "status"
/datum/world_topic/status/Run(list/input, addr)
if(!key_valid) //If we have a key, then it's safe to trust that this isn't a malicious packet. Also prevents the extra info from leaking
if(GLOB.topic_status_lastcache <= world.time + 5)
return GLOB.topic_status_cache
GLOB.topic_status_lastcache = world.time
. = list()
.["version"] = GLOB.game_version
.["mode"] = "hidden" //CIT CHANGE - hides the gamemode in topic() calls to prevent meta'ing the gamemode
.["respawn"] = config ? !CONFIG_GET(flag/norespawn) : FALSE
.["enter"] = GLOB.enter_allowed
.["vote"] = CONFIG_GET(flag/allow_vote_mode)
.["ai"] = CONFIG_GET(flag/allow_ai)
.["host"] = world.host ? world.host : null
.["round_id"] = GLOB.round_id
.["players"] = GLOB.clients.len
.["revision"] = GLOB.revdata.commit
.["revision_date"] = GLOB.revdata.date
var/list/adm = get_admin_counts()
var/list/presentmins = adm["present"]
var/list/afkmins = adm["afk"]
.["admins"] = presentmins.len + afkmins.len //equivalent to the info gotten from adminwho
.["gamestate"] = SSticker.current_state
.["map_name"] = SSmapping.config?.map_name || "Loading..."
if(key_valid)
.["active_players"] = get_active_player_count()
if(SSticker.HasRoundStarted())
.["real_mode"] = SSticker.mode.name
// Key-authed callers may know the truth behind the "secret"
.["security_level"] = get_security_level()
.["round_duration"] = SSticker ? round((world.time-SSticker.round_start_time)/10) : 0
// Amount of world's ticks in seconds, useful for calculating round duration
//Time dilation stats.
.["time_dilation_current"] = SStime_track.time_dilation_current
.["time_dilation_avg"] = SStime_track.time_dilation_avg
.["time_dilation_avg_slow"] = SStime_track.time_dilation_avg_slow
.["time_dilation_avg_fast"] = SStime_track.time_dilation_avg_fast
if(SSshuttle && SSshuttle.emergency)
.["shuttle_mode"] = SSshuttle.emergency.mode
// Shuttle status, see /__DEFINES/stat.dm
.["shuttle_timer"] = SSshuttle.emergency.timeLeft()
// Shuttle timer, in seconds
if(!key_valid)
GLOB.topic_status_cache = .