This commit is contained in:
Zuhayr
2013-07-29 06:05:00 -07:00
132 changed files with 3891 additions and 2734 deletions

View File

@@ -6,8 +6,8 @@ var/list/admin_verbs_default = list(
/client/proc/hide_verbs, /*hides all our adminverbs*/
/client/proc/hide_most_verbs, /*hides all our hideable adminverbs*/
/client/proc/debug_variables, /*allows us to -see- the variables of any instance in the game. +VAREDIT needed to modify*/
/client/proc/check_antagonists, /*shows all antags*/
/client/proc/deadchat /*toggles deadchat on/off*/
/client/proc/check_antagonists /*shows all antags*/
// /client/proc/deadchat /*toggles deadchat on/off*/
)
var/list/admin_verbs_admin = list(
/client/proc/player_panel, /*shows an interface for all players, with links to various panels (old style)*/
@@ -156,7 +156,7 @@ var/list/admin_verbs_rejuv = list(
var/list/admin_verbs_hideable = list(
/client/proc/set_ooc,
/client/proc/deadmin_self,
/client/proc/deadchat,
// /client/proc/deadchat,
/client/proc/toggleprayers,
/client/proc/toggle_hear_radio,
/datum/admins/proc/show_traitor_panel,

View File

@@ -11,6 +11,10 @@
src << "\red You cannot send DSAY messages (muted)."
return
if(!(prefs.toggles & CHAT_DEAD))
src << "\red You have deadchat muted."
return
if (src.handle_spam_prevention(msg,MUTE_DEADCHAT))
return
@@ -25,7 +29,11 @@
for (var/mob/M in player_list)
if (istype(M, /mob/new_player))
continue
if (M.stat == DEAD || (M.client && M.client.holder && (M.client.prefs.toggles & CHAT_DEAD))) //admins can toggle deadchat on and off. This is a proc in admin.dm and is only give to Administrators and above
if(M.client && M.client.holder && (M.client.prefs.toggles & CHAT_DEAD)) // show the message to admins who have deadchat toggled on
M.show_message(rendered, 2)
else if(M.stat == DEAD && (M.client.prefs.toggles & CHAT_DEAD)) // show the message to regular ghosts who have deadchat toggled on
M.show_message(rendered, 2)
feedback_add_details("admin_verb","D") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!

View File

@@ -62,7 +62,7 @@
*/
/client/proc/fix_next_move()
set category = "Debug"
/* set category = "Debug"
set name = "Unfreeze Everyone"
var/largest_move_time = 0
var/largest_click_time = 0
@@ -90,6 +90,7 @@
message_admins("[key_name_admin(largest_click_mob)] had the largest click delay with [largest_click_time] frames / [largest_click_time/10] seconds!", 1)
message_admins("world.time = [world.time]", 1)
feedback_add_details("admin_verb","UFE") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
*/
return
/client/proc/radio_report()

View File

@@ -462,11 +462,11 @@ client/proc/one_click_antag()
candidates.Remove(G)
if(candidates.len)
var/max_raiders = 4
var/max_raiders = 1
var/raiders = max_raiders
//Spawns vox raiders and equips them.
for (var/obj/effect/landmark/L in world)
if(L.name == "Response Team")
if(L.name == "voxstart")
if(raiders<=0)
break

View File

@@ -15,6 +15,7 @@ var/global/list/special_roles = list( //keep synced with the defines BE_* in set
"cultist" = IS_MODE_COMPILED("cult"), // 8
"infested monkey" = IS_MODE_COMPILED("monkey"), // 9
"ninja" = "true", // 10
"vox raider" = IS_MODE_COMPILED("heist"), // 11
)
var/const/MAX_SAVE_SLOTS = 10
@@ -99,6 +100,7 @@ datum/preferences
var/flavor_text = ""
var/med_record = ""
var/sec_record = ""
var/gen_record = ""
var/disabilities = 0
var/nanotrasen_relation = "Neutral"
@@ -492,6 +494,13 @@ datum/preferences
else
HTML += "[copytext(med_record, 1, 37)]..."
HTML += "<br><br><a href=\"byond://?src=\ref[user];preference=records;task=gen_record\">Employment Records</a><br>"
if(lentext(gen_record) <= 40)
HTML += "[gen_record]"
else
HTML += "[copytext(gen_record, 1, 37)]..."
HTML += "<br><br><a href=\"byond://?src=\ref[user];preference=records;task=sec_record\">Security Records</a><br>"
if(lentext(sec_record) <= 40)
@@ -732,6 +741,15 @@ datum/preferences
sec_record = secmsg
SetRecords(user)
if(href_list["task"] == "gen_record")
var/genmsg = input(usr,"Set your employment notes here.","Employment Records",html_decode(gen_record)) as message
if(genmsg != null)
genmsg = copytext(genmsg, 1, MAX_PAPER_MESSAGE_LEN)
genmsg = html_encode(genmsg)
gen_record = genmsg
SetRecords(user)
switch(href_list["task"])
if("random")
@@ -1118,7 +1136,7 @@ datum/preferences
proc/copy_to(mob/living/carbon/human/character, safety = 0)
if(be_random_name)
real_name = random_name()
real_name = random_name(gender)
if(config.humans_need_surnames)
var/firstspace = findtext(real_name, " ")
@@ -1136,6 +1154,7 @@ datum/preferences
character.flavor_text = flavor_text
character.med_record = med_record
character.sec_record = sec_record
character.gen_record = gen_record
character.gender = gender
character.age = age

View File

@@ -138,6 +138,7 @@
S["flavor_text"] >> flavor_text
S["med_record"] >> med_record
S["sec_record"] >> sec_record
S["gen_record"] >> gen_record
S["be_special"] >> be_special
S["disabilities"] >> disabilities
S["player_alt_titles"] >> player_alt_titles
@@ -155,7 +156,7 @@
if(isnull(species)) species = "Human"
if(isnull(language)) language = "None"
if(isnull(nanotrasen_relation)) nanotrasen_relation = initial(nanotrasen_relation)
if(!real_name) real_name = random_name()
if(!real_name) real_name = random_name(gender)
be_random_name = sanitize_integer(be_random_name, 0, 1, initial(be_random_name))
gender = sanitize_gender(gender)
age = sanitize_integer(age, AGE_MIN, AGE_MAX, initial(age))
@@ -241,6 +242,7 @@
S["flavor_text"] << flavor_text
S["med_record"] << med_record
S["sec_record"] << sec_record
S["gen_record"] << gen_record
S["player_alt_titles"] << player_alt_titles
S["be_special"] << be_special
S["disabilities"] << disabilities

View File

@@ -37,13 +37,18 @@
usr << "You will [(prefs.toggles & SOUND_ADMINHELP) ? "now" : "no longer"] hear a sound when adminhelps arrive."
feedback_add_details("admin_verb","AHS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/deadchat()
/client/verb/deadchat() // Deadchat toggle is usable by anyone.
set name = "Show/Hide Deadchat"
set category = "Preferences"
set desc ="Toggles seeing deadchat"
prefs.toggles ^= CHAT_DEAD
prefs.save_preferences()
src << "You will [(prefs.toggles & CHAT_DEAD) ? "now" : "no longer"] see deadchat."
if(src.holder)
src << "You will [(prefs.toggles & CHAT_DEAD) ? "now" : "no longer"] see deadchat."
else
src << "As a ghost, you will [(prefs.toggles & CHAT_DEAD) ? "now" : "no longer"] see deadchat."
feedback_add_details("admin_verb","TDV") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/toggleprayers()

View File

@@ -53,8 +53,10 @@
for(var/datum/disease/D in patient.viruses)
if(!D.hidden[SCANNER])
foundVirus++
if(patient.virus2)
foundVirus++
for (var/ID in patient.virus2)
if (ID in virusDB)
foundVirus = 1
break
if(!C) continue
holder = patient.hud_list[HEALTH_HUD]

View File

@@ -1,14 +1,30 @@
/obj/item/clothing/head/helmet/space/ert
/obj/item/clothing/head/helmet/space/rig/ert
name = "emergency response team helmet"
desc = "A helmet worn by members of the NanoTrasen Emergency Response Team. Armoured and space ready."
icon_state = "ert_commander"
icon_state = "rig0-ert_commander"
item_state = "helm-command"
armor = list(melee = 50, bullet = 50, laser = 30,energy = 15, bomb = 30, bio = 100, rad = 60)
siemens_coefficient = 0.6
var/obj/machinery/camera/camera
/obj/item/clothing/suit/space/ert
/obj/item/clothing/head/helmet/space/rig/ert/attack_self(mob/user)
if(camera)
..(user)
else
camera = new /obj/machinery/camera(src)
camera.network = list("ERT")
cameranet.removeCamera(camera)
camera.c_tag = user.name
user << "\blue User scanned as [camera.c_tag]. Camera activated."
/obj/item/clothing/head/helmet/space/rig/ert/examine()
..()
if(get_dist(usr,src) <= 1)
usr << "This helmet has a built-in camera. It's [camera ? "" : "in"]active."
/obj/item/clothing/suit/space/rig/ert
name = "emergency response team suit"
desc = "A suit worn by members of the NanoTrasen Emergency Response Team. Armoured, space ready, and fire resistant."
desc = "A suit worn by members of the NanoTrasen Emaergency Response Team. Armoured, space ready, and fire resistant."
icon_state = "ert_commander"
item_state = "suit-command"
w_class = 3
@@ -22,49 +38,53 @@
siemens_coefficient = 0.6
//Commander
/obj/item/clothing/head/helmet/space/ert/commander
/obj/item/clothing/head/helmet/space/rig/ert/commander
name = "emergency response team commander helmet"
desc = "A helmet worn by the commander of a NanoTrasen Emergency Response Team. Has blue highlights. Armoured and space ready."
icon_state = "ert_commander"
icon_state = "rig0-ert_commander"
item_state = "helm-command"
color = "ert_commander"
/obj/item/clothing/suit/space/ert/commander
/obj/item/clothing/suit/space/rig/ert/commander
name = "emergency response team commander suit"
desc = "A suit worn by the commander of a NanoTrasen Emergency Response Team. Has blue highlights. Armoured, space ready, and fire resistant."
icon_state = "ert_commander"
item_state = "suit-command"
//Security
/obj/item/clothing/head/helmet/space/ert/security
/obj/item/clothing/head/helmet/space/rig/ert/security
name = "emergency response team security helmet"
desc = "A helmet worn by security members of a NanoTrasen Emergency Response Team. Has red highlights. Armoured and space ready."
icon_state = "ert_security"
icon_state = "rig0-ert_security"
item_state = "syndicate-helm-black-red"
color = "ert_security"
/obj/item/clothing/suit/space/ert/security
/obj/item/clothing/suit/space/rig/ert/security
name = "emergency response team security suit"
desc = "A suit worn by security members of a NanoTrasen Emergency Response Team. Has red highlights. Armoured, space ready, and fire resistant."
icon_state = "ert_security"
item_state = "syndicate-black-red"
//Engineer
/obj/item/clothing/head/helmet/space/ert/engineer
/obj/item/clothing/head/helmet/space/rig/ert/engineer
name = "emergency response team engineer helmet"
desc = "A helmet worn by engineering members of a NanoTrasen Emergency Response Team. Has blue highlights. Armoured and space ready."
icon_state = "ert_engineer"
icon_state = "rig0-ert_engineer"
color = "ert_engineer"
/obj/item/clothing/suit/space/ert/engineer
/obj/item/clothing/suit/space/rig/ert/engineer
name = "emergency response team engineer suit"
desc = "A suit worn by the engineering of a NanoTrasen Emergency Response Team. Has blue highlights. Armoured, space ready, and fire resistant."
icon_state = "ert_engineer"
//Medical
/obj/item/clothing/head/helmet/space/ert/medical
/obj/item/clothing/head/helmet/space/rig/ert/medical
name = "emergency response team medical helmet"
desc = "A helmet worn by medical members of a NanoTrasen Emergency Response Team. Has white highlights. Armoured and space ready."
icon_state = "ert_medical"
icon_state = "rig0-ert_medical"
color = "ert_medical"
/obj/item/clothing/suit/space/ert/medical
/obj/item/clothing/suit/space/rig/ert/medical
name = "emergency response team medical suit"
desc = "A suit worn by medical members of a NanoTrasen Emergency Response Team. Has white highlights. Armoured and space ready."
icon_state = "ert_medical"

View File

@@ -87,7 +87,22 @@
color = "syndi"
armor = list(melee = 60, bullet = 50, laser = 30,energy = 15, bomb = 35, bio = 100, rad = 60)
siemens_coefficient = 0.6
var/obj/machinery/camera/camera
/obj/item/clothing/head/helmet/space/rig/syndi/attack_self(mob/user)
if(camera)
..(user)
else
camera = new /obj/machinery/camera(src)
camera.network = list("NUKE")
cameranet.removeCamera(camera)
camera.c_tag = user.name
user << "\blue User scanned as [camera.c_tag]. Camera activated."
/obj/item/clothing/head/helmet/space/rig/syndi/examine()
..()
if(get_dist(usr,src) <= 1)
usr << "This helmet has a built-in camera. It's [camera ? "" : "in"]active."
/obj/item/clothing/suit/space/rig/syndi
icon_state = "rig-syndi"

View File

@@ -222,7 +222,7 @@
slots = 5
/obj/item/clothing/tie/storage/brown_vest
name = "black webbing vest"
name = "brown webbing vest"
desc = "Worn brownish synthcotton vest with lots of pockets to unload your hands."
icon_state = "vest_brown"
color = "vest_brown"

View File

@@ -318,6 +318,10 @@
icon_state = "eleanorstone"
item_state = "eleanorstone"
volume = 150
amount_per_transfer_from_this = 10
possible_transfer_amounts = list(5,10,15,25,30,50,150)
/obj/item/weapon/storage/pill_bottle/fluff/listermedbottle //compactninja: Lister Black
name = "Pill bottle (anti-depressants)"
desc = "Contains pills used to deal with depression. They appear to be prescribed to Lister Black"

View File

@@ -598,12 +598,10 @@ commented out in r5061, I left it because of the shroom thingies
if(istype(R.module_active,/obj/item/weapon/pickaxe))
src.attackby(R.module_active,R)
return
/* else if(istype(AM,/obj/mecha))
else if(istype(AM,/obj/mecha))
var/obj/mecha/M = AM
if(istype(M.selected,/obj/item/mecha_parts/mecha_equipment/tool/drill))
src.attackby(M.selected,M)
return*/
//Aparantly mechs are just TOO COOL to call Bump(), so fuck em (for now)
M.selected.action(src)
else
return

View File

@@ -286,3 +286,13 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(host)
host.ckey = src.ckey
host << "<span class='info'>You are now a mouse. Try to avoid interaction with players, and do not give hints away that you are more than a simple rodent.</span>"
/mob/dead/observer/verb/view_manfiest()
set name = "View Crew Manifest"
set category = "Ghost"
var/dat
dat += "<h4>Crew Manifest</h4>"
dat += data_core.get_manifest()
src << browse(dat, "window=manifest;size=370x420;can_close=1")

View File

@@ -18,6 +18,29 @@
return
. = src.say_dead(message)
/mob/dead/observer/emote(var/act, var/type, var/message)
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
if(!message)
return
if(act != "me")
return
log_emote("Ghost/[src.key] : [message]")
if(src.client)
if(src.client.prefs.muted & MUTE_DEADCHAT)
src << "\red You cannot emote in deadchat (muted)."
return
if(src.client.handle_spam_prevention(message, MUTE_DEADCHAT))
return
. = src.emote_dead(message)
/*
for (var/mob/M in hearers(null, null))
if (!M.stat)

View File

@@ -1,5 +1,5 @@
// All mobs should have custom emote, really..
mob/proc/custom_emote(var/m_type=1,var/message = null)
/mob/proc/custom_emote(var/m_type=1,var/message = null)
if(!use_me && usr == src)
usr << "You are unable to emote."
@@ -25,7 +25,7 @@ mob/proc/custom_emote(var/m_type=1,var/message = null)
//Hearing gasp and such every five seconds is not good emotes were not global for a reason.
// Maybe some people are okay with that.
for(var/mob/M in world)
for(var/mob/M in player_list)
if (!M.client)
continue //skip monkeys and leavers
if (istype(M, /mob/new_player))
@@ -42,3 +42,38 @@ mob/proc/custom_emote(var/m_type=1,var/message = null)
else if (m_type & 2)
for (var/mob/O in hearers(src.loc, null))
O.show_message(message, m_type)
/mob/proc/emote_dead(var/message)
if(client.prefs.muted & MUTE_DEADCHAT)
src << "\red You cannot send deadchat emotes (muted)."
return
if(!(client.prefs.toggles & CHAT_DEAD))
src << "\red You have deadchat muted."
return
var/input
if(!message)
input = copytext(sanitize(input(src, "Choose an emote to display.") as text|null), 1, MAX_MESSAGE_LEN)
else
input = message
if(input)
message = "<span class='game deadsay'><span class='prefix'>DEAD:</span> <b>[src]</b> [message]</span>"
else
return
if(message)
log_emote("Ghost/[src.key] : [message]")
for(var/mob/M in player_list)
if(istype(M, /mob/new_player))
continue
if(M.client && M.client.holder && (M.client.holder.rights & R_ADMIN|R_MOD) && (M.client.prefs.toggles & CHAT_DEAD)) // Show the emote to admins/mods
M << message
else if(M.stat == DEAD && (M.client.prefs.toggles & CHAT_DEAD)) // Show the emote to regular ghosts with deadchat toggled on
M.show_message(message, 2)

View File

@@ -455,4 +455,26 @@
<BR>"}
user << browse(dat, text("window=mob[];size=325x500", name))
onclose(user, "mob[name]")
return
return
//generates realistic-ish pulse output based on preset levels
/mob/living/carbon/proc/get_pulse(var/method) //method 0 is for hands, 1 is for machines, more accurate
var/temp = 0 //see setup.dm:694
switch(src.pulse)
if(PULSE_NONE)
return "0"
if(PULSE_SLOW)
temp = rand(40, 60)
return num2text(method ? temp : temp + rand(-10, 10))
if(PULSE_NORM)
temp = rand(60, 90)
return num2text(method ? temp : temp + rand(-10, 10))
if(PULSE_FAST)
temp = rand(90, 120)
return num2text(method ? temp : temp + rand(-10, 10))
if(PULSE_2FAST)
temp = rand(120, 160)
return num2text(method ? temp : temp + rand(-10, 10))
if(PULSE_THREADY)
return method ? ">250" : "extremely weak and fast, patient's artery feels like a thread"
// output for machines^ ^^^^^^^output for people^^^^^^^^^

View File

@@ -2,8 +2,7 @@
gender = MALE
var/list/stomach_contents = list()
var/brain_op_stage = 0.0
var/datum/disease2/disease/virus2 = null
var/list/datum/disease2/disease/resistances2 = list()
var/list/datum/disease2/disease/virus2 = list()
var/antibodies = 0
var/silent = null //Can't talk. Value goes down every life proc.
@@ -19,4 +18,6 @@
//Surgery info
var/datum/surgery_status/op_stage = new/datum/surgery_status
//Active emote/pose
var/pose = null
var/pose = null
var/pulse = PULSE_NORM //current pulse level

View File

@@ -54,6 +54,14 @@
dizziness = 0
jitteriness = 0
//Check for heist mode kill count.
if(ticker.mode && ( istype( ticker.mode,/datum/game_mode/heist) ) )
//Check for last assailant's mutantrace.
/*if( LAssailant && ( istype( LAssailant,/mob/living/carbon/human ) ) )
var/mob/living/carbon/human/V = LAssailant
if (V.dna && (V.dna.mutantrace == "vox"))*/ //Not currently feasible due to terrible LAssailant tracking.
vox_kills++ //Bad vox. Shouldn't be killing humans.
if(!gibbed)
emote("deathgasp") //let the world KNOW WE ARE DEAD

View File

@@ -209,19 +209,13 @@
spawn(15)
usr << "\blue [t_He] has a pulse!"
if (src.stat == 2 || (status_flags & FAKEDEATH))
if(distance <= 1)
if(istype(usr, /mob/living/carbon/human) && usr.stat == 0)
for(var/mob/O in viewers(usr.loc, null))
O.show_message("[usr] checks [src]'s pulse.", 1)
if(distance <= 1)
if(istype(usr, /mob/living/carbon/human) && usr.stat == 0)
spawn(15)
var/foundghost = 0
if(src.client)
foundghost = 1
if(!foundghost)
usr << "<span class='deadsay'>[t_He] has no pulse and [t_his] soul has departed...</span>"
if(pulse == PULSE_NONE)
usr << "<span class='deadsay'>[t_He] has no pulse[src.client ? "" : " and [t_his] soul has departed"]...</span>"
else
usr << "<span class='deadsay'>[t_He] has no pulse...</span>"
usr << "<span class='deadsay'>[t_He] has a pulse!</span>"
msg += "<span class='warning'>"

View File

@@ -1114,9 +1114,9 @@ mob/living/carbon/human/yank_out_object()
set desc = "Remove an embedded item at the cost of bleeding and pain."
set src in view(1)
if(!isliving(usr) || usr.next_move > world.time)
if(!isliving(usr) || usr.last_click + usr.click_delay > world.time)
return
usr.next_move = world.time + 20
usr.delay_click(20)
if(usr.stat == 1)
usr << "You are unconcious and cannot do that!"
@@ -1213,3 +1213,36 @@ mob/living/carbon/human/yank_out_object()
organ.status |= ORGAN_BLEEDING
organ.take_damage(rand(1,3), 0, 0)
src.adjustToxLoss(rand(1,3))
/mob/living/carbon/human/verb/check_pulse()
set category = "Object"
set name = "Check pulse"
set desc = "Approximately count somebody's pulse. Requires you to stand still at least 6 seconds."
set src in view(1)
var/self = 0
if(usr.stat == 1 || usr.restrained() || !isliving(usr)) return
if(usr == src)
self = 1
if(!self)
usr.visible_message("\blue [usr] kneels down, puts \his hand on [src]'s wrist and begins counting their pulse.",\
"You begin counting [src]'s pulse")
else
usr.visible_message("\blue [usr] begins counting their pulse.",\
"You begin counting your pulse.")
if(src.pulse)
usr << "\blue [self ? "You have a" : "[src] has a"] pulse! Counting..."
else
usr << "\red [src] has no pulse!" //it is REALLY UNLIKELY that a dead person would check his own pulse
return
usr << "Don't move until counting is finished."
var/time = world.timeofday
sleep(60)
if(usr.l_move_time >= time) //checks if our mob has moved during the sleep()
usr << "You moved while counting. Try again."
else
usr << "\blue [self ? "Your" : "[src]'s"] pulse is [src.get_pulse(GETPULSE_HAND)]."

View File

@@ -113,6 +113,8 @@
handle_regular_hud_updates()
pulse = handle_pulse()
// Grabbing
for(var/obj/item/weapon/grab/G in src)
G.process()
@@ -542,17 +544,20 @@
if(stat != 2)
stabilize_temperature_from_calories()
// log_debug("Adjusting to atmosphere.")
//After then, it reacts to the surrounding atmosphere based on your thermal protection
if(loc_temp < bodytemperature)
//Place is colder than we are
if(loc_temp < BODYTEMP_COLD_DAMAGE_LIMIT) //Place is colder than we are
var/thermal_protection = get_cold_protection(loc_temp) //This returns a 0 - 1 value, which corresponds to the percentage of protection based on what you're wearing and what you're exposed to.
if(thermal_protection < 1)
bodytemperature += min((1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_COLD_DIVISOR), BODYTEMP_COOLING_MAX)
else
//Place is hotter than we are
var/amt = min((1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_COLD_DIVISOR), BODYTEMP_COOLING_MAX)
// log_debug("[loc_temp] is Cold. Cooling by [amt]")
bodytemperature += amt
else if (loc_temp > BODYTEMP_HEAT_DAMAGE_LIMIT) //Place is hotter than we are
var/thermal_protection = get_heat_protection(loc_temp) //This returns a 0 - 1 value, which corresponds to the percentage of protection based on what you're wearing and what you're exposed to.
if(thermal_protection < 1)
bodytemperature += min((1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR), BODYTEMP_HEATING_MAX)
var/amt = min((1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR), BODYTEMP_HEATING_MAX)
// log_debug("[loc_temp] is Heat. Heating up by [amt]")
bodytemperature += amt
// +/- 50 degrees from 310.15K is the 'safe' zone, where no damage is dealt.
if(bodytemperature > BODYTEMP_HEAT_DAMAGE_LIMIT)
@@ -632,19 +637,25 @@
*/
proc/stabilize_temperature_from_calories()
var/body_temperature_difference = 310.15 - bodytemperature
if (abs(body_temperature_difference) < 0.01)
return //fuck this precision
switch(bodytemperature)
if(-INFINITY to 260.15) //260.15 is 310.15 - 50, the temperature where you start to feel effects.
if(nutrition >= 2) //If we are very, very cold we'll use up quite a bit of nutriment to heat us up.
nutrition -= 2
var/body_temperature_difference = 310.15 - bodytemperature
bodytemperature += max((body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR), BODYTEMP_AUTORECOVERY_MINIMUM)
var/recovery_amt = max((body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR), BODYTEMP_AUTORECOVERY_MINIMUM)
// log_debug("Cold. Difference = [body_temperature_difference]. Recovering [recovery_amt]")
bodytemperature += recovery_amt
if(260.15 to 360.15)
var/body_temperature_difference = 310.15 - bodytemperature
bodytemperature += body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR
var/recovery_amt = body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR
// log_debug("Norm. Difference = [body_temperature_difference]. Recovering [recovery_amt]")
bodytemperature += recovery_amt
if(360.15 to INFINITY) //360.15 is 310.15 + 50, the temperature where you start to feel effects.
//We totally need a sweat system cause it totally makes sense...~
var/body_temperature_difference = 310.15 - bodytemperature
bodytemperature += min((body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR), -BODYTEMP_AUTORECOVERY_MINIMUM) //We're dealing with negative numbers
var/recovery_amt = min((body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR), -BODYTEMP_AUTORECOVERY_MINIMUM) //We're dealing with negative numbers
// log_debug("Hot. Difference = [body_temperature_difference]. Recovering [recovery_amt]")
bodytemperature += recovery_amt
//This proc returns a number made up of the flags for body parts which you are protected on. (such as HEAD, UPPER_TORSO, LOWER_TORSO, etc. See setup.dm for the full list)
proc/get_heat_protection_flags(temperature) //Temperature is the temperature you're being exposed to.
@@ -1332,28 +1343,35 @@
if(bodytemperature > 406)
for(var/datum/disease/D in viruses)
D.cure()
if(virus2) virus2.cure(src)
if(!virus2)
for(var/obj/effect/decal/cleanable/blood/B in view(1,src))
if(B.virus2 && get_infection_chance())
infect_virus2(src,B.virus2)
for(var/obj/effect/decal/cleanable/mucus/M in view(1,src))
if(M.virus2 && get_infection_chance())
infect_virus2(src,M.virus2)
else
if(isnull(virus2)) // Trying to figure out a runtime error that keeps repeating
for (var/ID in virus2)
var/datum/disease2/disease/V = virus2[ID]
V.cure(src)
for(var/obj/effect/decal/cleanable/blood/B in view(1,src))
if(B.virus2.len && get_infection_chance(src))
for (var/ID in B.virus2)
var/datum/disease2/disease/V = virus2[ID]
infect_virus2(src,V)
for(var/obj/effect/decal/cleanable/mucus/M in view(1,src))
if(M.virus2.len && get_infection_chance(src))
for (var/ID in M.virus2)
var/datum/disease2/disease/V = virus2[ID]
infect_virus2(src,V)
for (var/ID in virus2)
var/datum/disease2/disease/V = virus2[ID]
if(isnull(V)) // Trying to figure out a runtime error that keeps repeating
CRASH("virus2 nulled before calling activate()")
else
virus2.activate(src)
V.activate(src)
// activate may have deleted the virus
if(!virus2) return
if(!V) continue
// check if we're immune
if(virus2.antigen & src.antibodies) virus2.dead = 1
if(V.antigen & src.antibodies)
V.dead = 1
return
return
proc/handle_stomach()
spawn(0)
@@ -1414,5 +1432,34 @@
if (shock_stage > 80)
Paralyse(rand(15,28))
proc/handle_pulse()
if(life_tick % 5) return pulse //update pulse every 5 life ticks (~1 tick/sec, depending on server load)
if(stat == DEAD)
return PULSE_NONE //that's it, you're dead, nothing can influence your pulse
var/temp = PULSE_NORM
if(round(vessel.get_reagent_amount("blood")) <= BLOOD_VOLUME_BAD) //how much blood do we have
temp = PULSE_THREADY //not enough :(
if(status_flags & FAKEDEATH)
temp = PULSE_NONE //pretend that we're dead. unlike actual death, can be inflienced by meds
for(var/datum/reagent/R in reagents.reagent_list)
if(R.id in bradycardics)
if(temp <= PULSE_THREADY && temp >= PULSE_NORM)
temp--
break //one reagent is enough
//comment out the breaks to make med effects stack
for(var/datum/reagent/R in reagents.reagent_list) //handles different chems' influence on pulse
if(R.id in tachycardics)
if(temp <= PULSE_FAST && temp >= PULSE_NONE)
temp++
break
return temp
#undef HUMAN_MAX_OXYLOSS
#undef HUMAN_CRIT_MAX_OXYLOSS

View File

@@ -150,28 +150,40 @@
emote("gasp")
updatehealth()
proc/handle_virus_updates()//copypaste from mob/carbon/human/life.dm
proc/handle_virus_updates()
if(status_flags & GODMODE) return 0 //godmode
if(bodytemperature > 406)
for(var/datum/disease/D in viruses)
D.cure()
if(!virus2)
for(var/obj/effect/decal/cleanable/blood/B in view(1,src))
if(B.virus2 && get_infection_chance())
infect_virus2(src,B.virus2)
for(var/obj/effect/decal/cleanable/mucus/M in view(1,src))
if(M.virus2 && get_infection_chance())
infect_virus2(src,M.virus2)
else
if(isnull(virus2)) // Trying to figure out a runtime error that keeps repeating
for (var/ID in virus2)
var/datum/disease2/disease/V = virus2[ID]
V.cure(src)
for(var/obj/effect/decal/cleanable/blood/B in view(1,src))
if(B.virus2.len && get_infection_chance(src))
for (var/ID in B.virus2)
var/datum/disease2/disease/V = virus2[ID]
infect_virus2(src,V)
for(var/obj/effect/decal/cleanable/mucus/M in view(1,src))
if(M.virus2.len && get_infection_chance(src))
for (var/ID in M.virus2)
var/datum/disease2/disease/V = virus2[ID]
infect_virus2(src,V)
for (var/ID in virus2)
var/datum/disease2/disease/V = virus2[ID]
if(isnull(V)) // Trying to figure out a runtime error that keeps repeating
CRASH("virus2 nulled before calling activate()")
else
virus2.activate(src)
V.activate(src)
// activate may have deleted the virus
if(!virus2) return
if(!V) continue
// check if we're immune
if(virus2.antigen & src.antibodies) virus2.dead = 1
if(V.antigen & src.antibodies)
V.dead = 1
return
proc/breathe()
if(reagents)

View File

@@ -340,7 +340,7 @@ var/list/ai_list = list()
if(href_list["say_word"])
src.announcement(href_list["say_word"])
return
if (href_list["lawi"]) // Toggling whether or not a law gets stated by the State Laws verb --NeoFite
var/L = text2num(href_list["lawi"])
switch(ioncheck[L])
@@ -561,10 +561,9 @@ var/list/ai_list = list()
if(!C.can_use())
continue
var/list/tempnetwork = C.network
tempnetwork.Remove("CREED", "thunder", "RD", "toxins", "Prison")
var/list/tempnetwork = difflist(C.network,RESTRICTED_CAMERA_NETWORKS,1)
if(tempnetwork.len)
for(var/i in C.network)
for(var/i in tempnetwork)
cameralist[i] = i
var/old_network = network
network = input(U, "Which network would you like to view?") as null|anything in cameralist

View File

@@ -67,7 +67,7 @@
var/oldLoc = src.loc
. = ..()
if(.)
if(src.camera)
if(src.camera && src.camera.network.len)
if(!updating)
updating = 1
spawn(BORG_CAMERA_BUFFER)
@@ -89,12 +89,16 @@
/obj/machinery/camera/New()
..()
cameranet.cameras += src
cameranet.addCamera(src)
cameranet.cameras += src //Camera must be added to global list of all cameras no matter what...
var/list/open_networks = difflist(network,RESTRICTED_CAMERA_NETWORKS) //...but if all of camera's networks are restricted, it only works for specific camera consoles.
if(open_networks.len) //If there is at least one open network, chunk is available for AI usage.
cameranet.addCamera(src)
/obj/machinery/camera/Del()
cameranet.cameras -= src
cameranet.removeCamera(src)
var/list/open_networks = difflist(network,RESTRICTED_CAMERA_NETWORKS)
if(open_networks.len)
cameranet.removeCamera(src)
..()
#undef BORG_CAMERA_BUFFER

View File

@@ -59,8 +59,11 @@
for(var/datum/disease/D in patient.viruses)
if(!D.hidden[SCANNER])
foundVirus++
if(patient.virus2)
foundVirus++
for (var/ID in patient.virus2)
if (ID in virusDB)
foundVirus = 1
break
holder = patient.hud_list[HEALTH_HUD]
if(patient.stat == 2)

View File

@@ -6,7 +6,7 @@
usr << "<span class='notice'>Something is there but you can't see it.</span>"
return
var/msg = "<span class='info'>*---------*\nThis is \icon[src] \a <EM>[src]</EM>!\n"
var/msg = "<span class='info'>*---------*\nThis is \icon[src] \a <EM>[src]</EM>[custom_name ? ", [modtype] [braintype]" : ""]!\n"
msg += "<span class='warning'>"
if (src.getBruteLoss())
if (src.getBruteLoss() < 75)

View File

@@ -48,7 +48,7 @@
//var/list/laws = list()
var/alarms = list("Motion"=list(), "Fire"=list(), "Atmosphere"=list(), "Power"=list(), "Camera"=list())
var/viewalerts = 0
var/modtype = "robot"
var/modtype = "Default"
var/lower_mod = 0
var/jetpack = 0
var/datum/effect/effect/system/ion_trail_follow/ion_trail = null
@@ -87,7 +87,7 @@
module = new /obj/item/weapon/robot_module/syndicate(src)
hands.icon_state = "standard"
icon_state = "secborg"
modtype = "Synd"
modtype = "Security"
else
laws = new /datum/ai_laws/nanotrasen()
connected_ai = select_active_ai_with_fewest_borgs()
@@ -102,7 +102,7 @@
if(!scrambledcodes && !camera)
camera = new /obj/machinery/camera(src)
camera.c_tag = real_name
camera.network = list("SS13")
camera.network = list("SS13","Robots")
if(isWireCut(5)) // 5 = BORG CAMERA
camera.status = 0
@@ -151,7 +151,7 @@
if(crisis && security_level == SEC_LEVEL_RED) //Leaving this in until it's balanced appropriately.
src << "\red Crisis mode active. Combat module available."
modules+="Combat"
var/mod = input("Please, select a module!", "Robot", null, null) in modules
modtype = input("Please, select a module!", "Robot", null, null) in modules
var/module_sprites[0] //Used to store the associations between sprite names and sprite index.
var/channels = list()
@@ -159,17 +159,15 @@
if(module)
return
switch(mod)
switch(modtype)
if("Standard")
module = new /obj/item/weapon/robot_module/standard(src)
modtype = "Stand"
module_sprites["Basic"] = "robot_old"
module_sprites["Android"] = "droid"
module_sprites["Default"] = "robot"
if("Service")
module = new /obj/item/weapon/robot_module/butler(src)
modtype = "Butler"
module_sprites["Waitress"] = "Service"
module_sprites["Kent"] = "toiletbot"
module_sprites["Bro"] = "Brobot"
@@ -178,16 +176,18 @@
if("Miner")
module = new /obj/item/weapon/robot_module/miner(src)
modtype = "Miner"
channels = list("Supply" = 1)
if(camera && "Robots" in camera.network)
camera.network.Add("MINE")
module_sprites["Basic"] = "Miner_old"
module_sprites["Advanced Droid"] = "droid-miner"
module_sprites["Treadhead"] = "Miner"
if("Medical")
module = new /obj/item/weapon/robot_module/medical(src)
modtype = "Med"
channels = list("Medical" = 1)
if(camera && "Robots" in camera.network)
camera.network.Add("Medical")
module_sprites["Basic"] = "Medbot"
module_sprites["Advanced Droid"] = "droid-medical"
module_sprites["Needles"] = "medicalrobot"
@@ -195,17 +195,14 @@
if("Security")
module = new /obj/item/weapon/robot_module/security(src)
modtype = "Sec"
channels = list("Security" = 1)
module_sprites["Basic"] = "secborg"
module_sprites["Red Knight"] = "Security"
module_sprites["Black Knight"] = "securityrobot"
module_sprites["Bloodhound"] = "bloodhound"
module_sprites["Mark II"] = "droid-combat"
if("Engineering")
module = new /obj/item/weapon/robot_module/engineering(src)
modtype = "Eng"
channels = list("Engineering" = 1)
module_sprites["Basic"] = "Engineering"
module_sprites["Antique"] = "engineerrobot"
@@ -213,26 +210,24 @@
if("Janitor")
module = new /obj/item/weapon/robot_module/janitor(src)
modtype = "Jan"
module_sprites["Basic"] = "JanBot2"
module_sprites["Mopbot"] = "janitorrobot"
module_sprites["Mop Gear Rex"] = "mopgearrex"
if("Combat")
module = new /obj/item/weapon/robot_module/combat(src)
modtype = "Com"
module_sprites["Combat Android"] = "droid-combat"
channels = list("Security" = 1)
//Custom_sprite check and entry
if (custom_sprite == 1)
module_sprites["Custom"] = "[src.ckey]-[mod]"
module_sprites["Custom"] = "[src.ckey]-[modtype]"
hands.icon_state = lowertext(mod)
feedback_inc("cyborg_[lowertext(mod)]",1)
updatename(mod)
hands.icon_state = lowertext(modtype)
feedback_inc("cyborg_[lowertext(modtype)]",1)
updatename()
if(mod == "Medical" || mod == "Security" || mod == "Combat")
if(modtype == "Medical" || modtype == "Security" || modtype == "Combat")
status_flags &= ~CANPUSH
choose_icon(6,module_sprites)
@@ -240,7 +235,8 @@
base_icon = icon_state
/mob/living/silicon/robot/proc/updatename(var/prefix as text)
if(prefix)
modtype = prefix
if(istype(mmi, /obj/item/device/mmi/posibrain))
braintype = "Android"
else
@@ -250,7 +246,7 @@
if(custom_name)
changed_name = custom_name
else
changed_name = "[(prefix ? "[prefix] " : "")][braintype]-[num2text(ident)]"
changed_name = "[modtype] [braintype]-[num2text(ident)]"
real_name = changed_name
name = real_name
@@ -288,7 +284,7 @@
if (newname != "")
custom_name = newname
updatename("Default")
updatename()
updateicon()
/mob/living/silicon/robot/verb/cmd_robot_alerts()
@@ -1183,12 +1179,8 @@
scrambledcodes = 1
//Disconnect it's camera so it's not so easily tracked.
if(src.camera)
del(src.camera)
src.camera = null
// I'm trying to get the Cyborg to not be listed in the camera list
// Instead of being listed as "deactivated". The downside is that I'm going
// to have to check if every camera is null or not before doing anything, to prevent runtime errors.
// I could change the network to null but I don't know what would happen, and it seems too hacky for me.
src.camera.network = list()
cameranet.removeCamera(src.camera)
/mob/living/silicon/robot/proc/ResetSecurityCodes()

View File

@@ -145,8 +145,8 @@
if (bot.connected_ai == ai)
return 1
return 0
// this function shows the health of the pAI in the Status panel
/mob/living/silicon/proc/show_system_integrity()
if(!src.stat)
@@ -154,25 +154,25 @@
else
stat(null, text("Systems nonfunctional"))
// This is a pure virtual function, it should be overwritten by all subclasses
/mob/living/silicon/proc/show_malf_ai()
return 0
// this function displays the station time in the status panel
/mob/living/silicon/proc/show_station_time()
stat(null, "Station Time: [worldtime2text()]")
// this function displays the shuttles ETA in the status panel if the shuttle has been called
/mob/living/silicon/proc/show_emergency_shuttle_eta()
if(emergency_shuttle.online && emergency_shuttle.location < 2)
var/timeleft = emergency_shuttle.timeleft()
if (timeleft)
stat(null, "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]")
// This adds the basic clock, shuttle recall timer, and malf_ai info to all silicon lifeforms
/mob/living/silicon/Stat()
..()
@@ -182,13 +182,13 @@
show_emergency_shuttle_eta()
show_system_integrity()
show_malf_ai()
// this function displays the stations manifest in a separate window
/mob/living/silicon/proc/show_station_manifest()
var/dat
dat += "<h4>Crew Manifest</h4>"
if(data_core)
dat += data_core.get_manifest(0) // make it monochrome
dat += data_core.get_manifest(1) // make it monochrome
dat += "<br>"
src << browse(dat, "window=airoster")
onclose(src, "airoster")

View File

@@ -33,7 +33,7 @@
if(hud_used) del(hud_used) //remove the hud objects
hud_used = new /datum/hud(src)
next_move = 1
last_click = world.time
sight |= SEE_SELF
..()

View File

@@ -900,9 +900,9 @@ mob/verb/yank_out_object()
set desc = "Remove an embedded item at the cost of bleeding and pain."
set src in view(1)
if(!isliving(usr) || usr.next_move > world.time)
if(!isliving(usr) || usr.last_click + usr.click_delay > world.time)
return
usr.next_move = world.time + 20
usr.delay_click(20)
if(usr.stat == 1)
usr << "You are unconcious and cannot do that!"

View File

@@ -54,8 +54,8 @@
var/sdisabilities = 0 //Carbon
var/disabilities = 0 //Carbon
var/atom/movable/pulling = null
var/next_move = null
var/prev_move = null
var/last_click = null
var/click_delay = 0
var/monkeyizing = null //Carbon
var/other = 0.0
var/hand = null
@@ -69,6 +69,7 @@
var/flavor_text = ""
var/med_record = ""
var/sec_record = ""
var/gen_record = ""
var/blinded = null
var/bhunger = 0 //Carbon
var/ajourn = 0

View File

@@ -128,7 +128,7 @@
return
if(killing)
return
if (assailant.next_move > world.time)
if (assailant.last_click + assailant.click_delay > world.time)
return
if ((!( assailant.canmove ) || assailant.lying))
//SN src = null
@@ -140,7 +140,7 @@
if (!( killing ))
assailant.visible_message("\red [assailant] has temporarily tightened \his grip on [affecting]!")
//Foreach goto(97)
assailant.next_move = world.time + 10
assailant.delay_click(10)
//affecting.stunned = max(2, affecting.stunned)
//affecting.paralysis = max(1, affecting.paralysis)
affecting.losebreath = min(affecting.losebreath + 1, 3)
@@ -235,7 +235,7 @@
assailant.attack_log += text("\[[time_stamp()]\] <font color='red'>Strangled (kill intent) [affecting.name] ([affecting.ckey])</font>")
log_attack("<font color='red'>[assailant.name] ([assailant.ckey]) Strangled (kill intent) [affecting.name] ([affecting.ckey])</font>")
assailant.next_move = world.time + 10
assailant.delay_click(10)
affecting.losebreath += 1
else
assailant.visible_message("\red [assailant] was unable to tighten \his grip on [affecting]'s neck!")

View File

@@ -454,3 +454,7 @@ var/list/intents = list("help","disarm","grab","hurt")
hud_used.action_intent.icon_state = "harm"
else
hud_used.action_intent.icon_state = "help"
/mob/proc/delay_click(var/delay)
src.click_delay = max(src.click_delay, delay)
return src.click_delay

View File

@@ -119,7 +119,7 @@
src << "\blue Now teleporting."
observer.loc = O.loc
if(client.prefs.be_random_name)
client.prefs.real_name = random_name()
client.prefs.real_name = random_name(client.prefs.gender)
observer.real_name = client.prefs.real_name
observer.name = observer.real_name
observer.key = key
@@ -377,7 +377,7 @@
if(ticker.random_players)
new_character.gender = pick(MALE, FEMALE)
client.prefs.real_name = random_name()
client.prefs.real_name = random_name(new_character.gender)
client.prefs.randomize_appearance_for(new_character)
else
client.prefs.copy_to(new_character)

View File

@@ -37,6 +37,10 @@
usr << "\red Speech is currently admin-disabled."
return
if(!(client.prefs.toggles & CHAT_DEAD))
usr << "\red You have deadchat muted."
return
if(mind && mind.name)
name = "[mind.name]"
else
@@ -50,9 +54,10 @@
for(var/mob/M in player_list)
if(istype(M, /mob/new_player))
continue
if(M.client && M.client.holder && (M.client.holder.rights & R_ADMIN|R_MOD) && (M.client.prefs.toggles & CHAT_DEAD)) //admins can toggle deadchat on and off. This is a proc in admin.dm and is only give to Administrators and above
if(M.client && M.client.holder && (M.client.holder.rights & R_ADMIN|R_MOD) && (M.client.prefs.toggles & CHAT_DEAD)) // Show the message to admins/mods with deadchat toggled on
M << rendered //Admins can hear deadchat, if they choose to, no matter if they're blind/deaf or not.
else if(M.stat == DEAD)
else if(M.stat == DEAD && (M.client.prefs.toggles & CHAT_DEAD)) // Show the message to regular ghosts with deadchat toggled on.
M.show_message(rendered, 2) //Takes into account blindness and such.
return

View File

@@ -600,9 +600,9 @@
set name = "Resist"
set category = "IC"
if(!isliving(usr) || usr.next_move > world.time)
if(!isliving(usr) || usr.last_click + usr.click_delay > world.time)
return
usr.next_move = world.time + 20
usr.delay_click(20)
var/mob/living/L = usr
@@ -639,7 +639,7 @@
if(iscarbon(L))
var/mob/living/carbon/C = L
if( C.handcuffed )
C.next_move = world.time + 100
C.delay_click(100)
C.last_special = world.time + 100
C << "\red You attempt to unbuckle yourself. (This will take around 2 minutes and you need to stand still)"
for(var/mob/O in viewers(L))
@@ -673,7 +673,7 @@
// breakout_time++ //Harder to get out of welded lockers than locked lockers
//okay, so the closet is either welded or locked... resist!!!
usr.next_move = world.time + 100
usr.delay_click(100)
L.last_special = world.time + 100
L << "\red You lean on the back of \the [C] and start pushing the door open. (this will take about [breakout_time] minutes)"
for(var/mob/O in viewers(usr.loc))
@@ -726,7 +726,7 @@
else if(iscarbon(L))
var/mob/living/carbon/CM = L
if(CM.handcuffed && CM.canmove && (CM.last_special <= world.time))
CM.next_move = world.time + 100
CM.delay_click(100)
CM.last_special = world.time + 100
if(isalienadult(CM) || (HULK in usr.mutations))//Don't want to do a lot of logic gating here.
usr << "\red You attempt to break your handcuffs. (This will take around 5 seconds and you need to stand still)"
@@ -764,7 +764,7 @@
CM.handcuffed = null
CM.update_inv_handcuffed()
else if(CM.legcuffed && CM.canmove && (CM.last_special <= world.time))
CM.next_move = world.time + 100
CM.delay_click(100)
CM.last_special = world.time + 100
if(isalienadult(CM) || (HULK in usr.mutations))//Don't want to do a lot of logic gating here.
usr << "\red You attempt to break your legcuffs. (This will take around 5 seconds and you need to stand still)"

View File

@@ -163,8 +163,9 @@ var/const/BLOOD_VOLUME_SURVIVE = 122
//set reagent data
B.data["donor"] = src
if(src.virus2)
B.data["virus2"] = src.virus2.getcopy()
if (!B.data["virus2"])
B.data["virus2"] = list()
B.data["virus2"] |= virus_copylist(src.virus2)
B.data["antibodies"] = src.antibodies
B.data["blood_DNA"] = copytext(src.dna.unique_enzymes,1,0)
if(src.resistances && src.resistances.len)
@@ -200,7 +201,9 @@ var/const/BLOOD_VOLUME_SURVIVE = 122
else
vessel.add_reagent("blood", amount, injected.data)
vessel.update_total()
src.virus2 |= virus_copylist(injected.data["virus2"])
if (injected.data["antibodies"] && prob(5))
antibodies |= injected.data["antibodies"]
var/list/chems = list()
chems = params2list(injected.data["trace_chem"])
for(var/C in chems)

View File

@@ -114,7 +114,7 @@
del(spark_system)
else if(E.name in list("l_leg","l_foot","r_leg","r_foot") && !lying)
if (E.status & ORGAN_DESTROYED || malfunction || (broken && !(E.status & ORGAN_SPLINTED)))
if (!E.is_usable() || malfunction || (broken && !(E.status & ORGAN_SPLINTED)))
leg_tally-- // let it fail even if just foot&leg
// standing is poor

View File

@@ -28,6 +28,9 @@
if(issilicon(A))
user << "<span class='notice'>You can't label cyborgs.</span>"
return
if(istype(A, /obj/item/weapon/reagent_containers/glass))
user << "<span class='notice'>The label can't stick to the [A.name]. (Try using a pen)</span>"
return
user.visible_message("<span class='notice'>[user] labels [A] as [label].</span>", \
"<span class='notice'>You label [A] as [label].</span>")

View File

@@ -30,6 +30,15 @@
var/tmp/told_cant_shoot = 0 //So that it doesn't spam them with the fact they cannot hit them.
var/firerate = 1 // 0 for one bullet after tarrget moves and aim is lowered,
//1 for keep shooting until aim is lowered
var/fire_delay = 6
var/last_fired = 0
proc/ready_to_fire()
if(world.time >= last_fired + fire_delay)
last_fired = world.time
return 1
else
return 0
proc/load_into_chamber()
return 0
@@ -87,6 +96,11 @@
if(!special_check(user))
return
if (!ready_to_fire())
if (world.time % 3) //to prevent spam
user << "<span class='warning'>[src] is not ready to fire again!"
return
if(!load_into_chamber()) //CHECK
return click_empty(user)
@@ -117,7 +131,7 @@
in_chamber.loc = get_turf(user)
in_chamber.starting = get_turf(user)
in_chamber.shot_from = src
user.next_move = world.time + 4
usr.delay_click(4)
in_chamber.silenced = silenced
in_chamber.current = curloc
in_chamber.yo = targloc.y - curloc.y

View File

@@ -71,6 +71,8 @@ obj/item/weapon/gun/energy/laser/retro
origin_tech = "combat=4;materials=3;powerstorage=3"
projectile_type = "/obj/item/projectile/beam/heavylaser"
fire_delay = 20
isHandgun()
return 0

View File

@@ -9,7 +9,7 @@
projectile_type = "/obj/item/projectile/beam/pulse"
cell_type = "/obj/item/weapon/cell/super"
var/mode = 2
fire_delay = 25
attack_self(mob/living/user as mob)
switch(mode)

View File

@@ -9,6 +9,8 @@
ammo_type = "/obj/item/ammo_casing/c9mm"
automatic = 1
fire_delay = 0
isHandgun()
return 0

View File

@@ -929,11 +929,15 @@ datum
M.apply_effect(2*REM,IRRADIATE,0)
// radium may increase your chances to cure a disease
if(istype(M,/mob/living/carbon)) // make sure to only use it on carbon mobs
if(M:virus2 && prob(5))
if(prob(50))
M.radiation += 50 // curing it that way may kill you instead
M.adjustToxLoss(100)
M:antibodies |= M:virus2.antigen
var/mob/living/carbon/C = M
if(C.virus2.len)
for (var/ID in C.virus2)
var/datum/disease2/disease/V = C.virus2[ID]
if(prob(5))
if(prob(50))
M.radiation += 50 // curing it that way may kill you instead
M.adjustToxLoss(100)
M:antibodies |= V.antigen
..()
return
@@ -3459,4 +3463,4 @@ datum
else if(data >= 115 && prob(33))
M.confused = max(M.confused+15,15)
..()
return
return

View File

@@ -501,7 +501,7 @@ datum
result = "virusfood"
required_reagents = list("water" = 5, "milk" = 5, "oxygen" = 5)
result_amount = 15
/*
mix_virus
name = "Mix Virus"
id = "mixvirus"
@@ -539,7 +539,7 @@ datum
var/datum/disease/advance/D = locate(/datum/disease/advance) in B.data["viruses"]
if(D)
D.Devolve()
*/
condensedcapsaicin
name = "Condensed Capsaicin"
id = "condensedcapsaicin"

View File

@@ -4,6 +4,7 @@
////////////////////////////////////////////////////////////////////////////////
/obj/item/weapon/reagent_containers/glass
name = " "
var/base_name = " "
desc = " "
icon = 'icons/obj/chemical.dmi'
icon_state = "null"
@@ -13,6 +14,8 @@
volume = 50
flags = FPRINT | TABLEPASS | OPENCONTAINER
var/label_text = ""
var/list/can_be_placed_into = list(
/obj/machinery/chem_master/,
/obj/machinery/chem_dispenser/,
@@ -31,7 +34,12 @@
/obj/machinery/disposal,
/obj/machinery/apiary,
/mob/living/simple_animal/cow,
/mob/living/simple_animal/hostile/retaliate/goat )
/mob/living/simple_animal/hostile/retaliate/goat,
/obj/machinery/computer/centrifuge )
New()
..()
base_name = name
examine()
set src in view()
@@ -39,8 +47,7 @@
if (!(usr in view(2)) && usr!=src.loc) return
usr << "\blue It contains:"
if(reagents && reagents.reagent_list.len)
for(var/datum/reagent/R in reagents.reagent_list)
usr << "\blue [R.volume] units of [R.name]"
usr << "\blue [src.reagents.total_volume] units of liquid."
else
usr << "\blue Nothing."
if (!is_open_container())
@@ -121,6 +128,22 @@
spawn(5) src.reagents.clear_reagents()
return
attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/pen) || istype(W, /obj/item/device/flashlight/pen))
var/tmp_label = sanitize(input(user, "Enter a label for [src.name]","Label",src.label_text))
if(length(tmp_label) > 10)
user << "\red The label can be at most 10 characters long."
else
user << "\blue You set the label to \"[tmp_label]\"."
src.label_text = tmp_label
src.update_name_label()
proc/update_name_label()
if(src.label_text == "")
src.name = src.base_name
else
src.name = "[src.base_name] ([src.label_text])"
/obj/item/weapon/reagent_containers/glass/beaker
name = "beaker"
desc = "A beaker. Can hold up to 50 units."
@@ -228,6 +251,16 @@
user.drop_from_inventory(src)
del(src)
/obj/item/weapon/reagent_containers/glass/beaker/vial
name = "vial"
desc = "Small glass vial. Looks fragile."
icon_state = "vial"
g_amt = 500
volume = 15
amount_per_transfer_from_this = 5
possible_transfer_amounts = list(1,5,15)
flags = FPRINT | TABLEPASS | OPENCONTAINER
/*
/obj/item/weapon/reagent_containers/glass/blender_jug
name = "Blender Jug"

View File

@@ -88,8 +88,7 @@
/obj/item/weapon/reagent_containers/spray/examine()
set src in usr
..()
for(var/datum/reagent/R in reagents.reagent_list)
usr << "[round(R.volume)] units of [R.name] left."
usr << "[round(src.reagents.total_volume)] units left."
return
/obj/item/weapon/reagent_containers/spray/verb/empty()

View File

@@ -331,15 +331,6 @@ datum/design/supplycomp
materials = list("$glass" = 2000, "sacid" = 20)
build_path = "/obj/item/weapon/circuitboard/supplycomp"
datum/design/mining
name = "Circuit Design (Outpost Status Display)"
desc = "Allows for the construction of circuit boards used to build an outpost status display console."
id = "mining"
req_tech = list("programming" = 2)
build_type = IMPRINTER
materials = list("$glass" = 2000, "sacid" = 20)
build_path = "/obj/item/weapon/circuitboard/mining"
datum/design/comm_monitor
name = "Circuit Design (Telecommunications Monitoring Console)"
desc = "Allows for the construction of circuit boards used to build a telecommunications monitor."

View File

@@ -0,0 +1,62 @@
/obj/machinery/disease2/diseaseanalyser
name = "Disease Analyser"
icon = 'virology.dmi'
icon_state = "analyser"
anchored = 1
density = 1
var/scanning = 0
var/pause = 0
var/obj/item/weapon/virusdish/dish = null
/obj/machinery/disease2/diseaseanalyser/attackby(var/obj/I as obj, var/mob/user as mob)
if(istype(I,/obj/item/weapon/virusdish))
var/mob/living/carbon/c = user
if(!dish)
dish = I
c.drop_item()
I.loc = src
for(var/mob/M in viewers(src))
if(M == user) continue
M.show_message("\blue [user.name] inserts the [dish.name] in the [src.name]", 3)
else
user << "There is already a dish inserted"
return
/obj/machinery/disease2/diseaseanalyser/process()
if(stat & (NOPOWER|BROKEN))
return
use_power(500)
if(scanning)
scanning -= 1
if(scanning == 0)
var/r = dish.virus2.get_info()
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(src.loc)
P.info = r
dish.info = r
dish.analysed = 1
if (dish.virus2.addToDB())
src.state("\The [src.name] states, \"Added new pathogen to database.\"")
dish.loc = src.loc
dish = null
icon_state = "analyser"
src.state("\The [src.name] prints a sheet of paper")
else if(dish && !scanning && !pause)
if(dish.virus2 && dish.growth > 50)
dish.growth -= 10
scanning = 5
icon_state = "analyser_processing"
else
pause = 1
spawn(25)
dish.loc = src.loc
dish = null
src.state("\The [src.name] buzzes")
pause = 0
return

View File

@@ -0,0 +1,52 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33
// reserving some numbers for later special antigens
var/global/const/ANTIGEN_A = 1
var/global/const/ANTIGEN_B = 2
var/global/const/ANTIGEN_RH = 4
var/global/const/ANTIGEN_Q = 8
var/global/const/ANTIGEN_U = 16
var/global/const/ANTIGEN_V = 32
var/global/const/ANTIGEN_X = 64
var/global/const/ANTIGEN_Y = 128
var/global/const/ANTIGEN_Z = 256
var/global/const/ANTIGEN_M = 512
var/global/const/ANTIGEN_N = 1024
var/global/const/ANTIGEN_P = 2048
var/global/const/ANTIGEN_O = 4096
var/global/list/ANTIGENS = list(
"[ANTIGEN_A]" = "A",
"[ANTIGEN_B]" = "B",
"[ANTIGEN_RH]" = "RH",
"[ANTIGEN_Q]" = "Q",
"[ANTIGEN_U]" = "U",
"[ANTIGEN_V]" = "V",
"[ANTIGEN_Z]" = "Z",
"[ANTIGEN_M]" = "M",
"[ANTIGEN_N]" = "N",
"[ANTIGEN_P]" = "P",
"[ANTIGEN_O]" = "O"
)
// pure concentrated antibodies
datum/reagent/antibodies
data = list("antibodies"=0)
name = "Antibodies"
id = "antibodies"
reagent_state = LIQUID
color = "#0050F0"
reaction_mob(var/mob/M, var/method=TOUCH, var/volume)
if(istype(M,/mob/living/carbon))
if(src.data && method == INGEST)
if(M:virus2) if(src.data["antibodies"] & M:virus2.antigen)
M:virus2.dead = 1
M:antibodies |= src.data["antibodies"]
return
// iterate over the list of antigens and see what matches
/proc/antigens2string(var/antigens)
var/code = ""
for(var/V in ANTIGENS) if(text2num(V) & antigens) code += ANTIGENS[V]
return code

View File

@@ -0,0 +1,20 @@
/obj/machinery/disease2/biodestroyer
name = "Biohazard destroyer"
icon = 'disposal.dmi'
icon_state = "disposalbio"
var/list/accepts = list(/obj/item/clothing,/obj/item/weapon/virusdish/,/obj/item/weapon/cureimplanter,/obj/item/weapon/diseasedisk,/obj/item/weapon/reagent_containers)
density = 1
anchored = 1
/obj/machinery/disease2/biodestroyer/attackby(var/obj/I as obj, var/mob/user as mob)
for(var/path in accepts)
if(I.type in typesof(path))
user.drop_item()
del(I)
overlays += image('disposal.dmi', "dispover-handle")
return
user.drop_item()
I.loc = src.loc
for(var/mob/O in hearers(src, null))
O.show_message("\icon[src] \blue The [src.name] beeps", 2)

View File

@@ -0,0 +1,157 @@
/obj/machinery/computer/centrifuge
name = "Isolation Centrifuge"
desc = "Used to separate things with different weight. Spin 'em round, round, right round."
icon = 'icons/obj/virology.dmi'
icon_state = "centrifuge"
var/curing
var/isolating
var/obj/item/weapon/reagent_containers/glass/beaker/vial/sample = null
var/datum/disease2/disease/virus2 = null
/obj/machinery/computer/centrifuge/attackby(var/obj/I as obj, var/mob/user as mob)
if(istype(I, /obj/item/weapon/screwdriver))
return ..(I,user)
if(istype(I,/obj/item/weapon/reagent_containers/glass/beaker/vial))
var/mob/living/carbon/C = user
if(!sample)
sample = I
C.drop_item()
I.loc = src
src.attack_hand(user)
return
/obj/machinery/computer/centrifuge/update_icon()
..()
if(! (stat & (BROKEN|NOPOWER)) && (isolating || curing))
icon_state = "centrifuge_moving"
/obj/machinery/computer/centrifuge/attack_hand(var/mob/user as mob)
if(..())
return
user.machine = src
var/dat= ""
if(curing)
dat = "Antibody isolation in progress"
else if(isolating)
dat = "Pathogen isolation in progress"
else
dat += "<BR>Blood sample:"
dat += "<br><table cellpadding='10'><tr><td>"
if(sample)
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in sample.reagents.reagent_list
if(B)
dat += "Sample inserted."
if (B.data["antibodies"])
dat += "</td></tr><tr><td>"
dat += "Antibodies: [antigens2string(B.data["antibodies"])]"
dat += "</td><td><A href='?src=\ref[src];action=antibody'>Isolate</a>"
var/list/virus = B.data["virus2"]
for (var/ID in virus)
var/datum/disease2/disease/V = virus[ID]
dat += " </td></tr><tr><td> pathogen [V.name()]"
dat += "</td><td><A href='?src=\ref[src];action=isolate;isolate=[V.uniqueID]'>Isolate</a>"
else
dat += "Please check container contents."
dat += "</td></tr><tr><td><A href='?src=\ref[src];action=sample'>Eject container</a>"
else
dat = "Please insert a container."
dat += "</td></tr></table><br>"
dat += "<hr>"
user << browse(dat, "window=computer;size=400x500")
onclose(user, "computer")
return
/obj/machinery/computer/centrifuge/process()
..()
if(stat & (NOPOWER|BROKEN))
return
use_power(500)
if(curing)
curing -= 1
if(curing == 0)
if(sample)
cure()
update_icon()
if(isolating)
isolating -= 1
if(isolating == 0)
if(sample)
isolate()
update_icon()
return
/obj/machinery/computer/centrifuge/Topic(href, href_list)
if(..())
return
usr.machine = src
switch(href_list["action"])
if("antibody")
var/delay = 20
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in sample.reagents.reagent_list
if (!B)
state("\The [src.name] buzzes, \"No antibody carrier detected.\"", "blue")
return
if(sample.reagents.has_reagent("toxins"))
state("\The [src.name] beeps, \"Pathogen purging speed above nominal.\"", "blue")
delay = delay/2
return
curing = delay
playsound(src.loc, 'sound/machines/juicer.ogg', 50, 1)
update_icon()
if("isolate")
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in sample.reagents.reagent_list
if (!B)
return
var/list/virus = virus_copylist(B.data["virus2"])
var/choice = href_list["isolate"];
if (choice in virus)
virus2 = virus[choice]
else
state("\The [src.name] buzzes, \"No such pathogen detected.\"", "blue")
return
isolating = 40
update_icon()
src.updateUsrDialog()
return
if("sample")
if(sample)
sample.loc = src.loc
sample = null
src.add_fingerprint(usr)
src.updateUsrDialog()
attack_hand(usr)
return
/obj/machinery/computer/centrifuge/proc/cure()
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in sample.reagents.reagent_list
if (!B)
return
var/list/data = list("antibodies" = B.data["antibodies"])
var/amt= sample.reagents.get_reagent_amount("blood")
sample.reagents.remove_reagent("blood",amt)
sample.reagents.add_reagent("antibodies",amt,data)
state("\The [src.name] pings", "blue")
/obj/machinery/computer/centrifuge/proc/isolate()
var/obj/item/weapon/virusdish/dish = new/obj/item/weapon/virusdish(src.loc)
dish.virus2 = virus2
state("\The [src.name] pings", "blue")

View File

@@ -0,0 +1,113 @@
/obj/machinery/computer/curer
name = "Cure Research Machine"
icon = 'icons/obj/computer.dmi'
icon_state = "dna"
var/curing
var/virusing
var/obj/item/weapon/reagent_containers/container = null
/obj/machinery/computer/curer/attackby(var/obj/I as obj, var/mob/user as mob)
if(istype(I, /obj/item/weapon/screwdriver))
return ..(I,user)
if(istype(I,/obj/item/weapon/reagent_containers))
var/mob/living/carbon/C = user
if(!container)
container = I
C.drop_item()
I.loc = src
if(istype(I,/obj/item/weapon/virusdish))
if(virusing)
user << "<b>The pathogen materializer is still recharging.."
return
var/obj/item/weapon/reagent_containers/glass/beaker/product = new(src.loc)
var/list/data = list("donor"=null,"viruses"=null,"blood_DNA"=null,"blood_type"=null,"resistances"=null,"trace_chem"=null,"virus2"=list(),"antibodies"=0)
data["virus2"] |= I:virus2
product.reagents.add_reagent("blood",30,data)
virusing = 1
spawn(1200) virusing = 0
state("The [src.name] Buzzes", "blue")
return
src.attack_hand(user)
return
/obj/machinery/computer/curer/attack_ai(var/mob/user as mob)
return src.attack_hand(user)
/obj/machinery/computer/curer/attack_paw(var/mob/user as mob)
return src.attack_hand(user)
return
/obj/machinery/computer/curer/attack_hand(var/mob/user as mob)
if(..())
return
user.machine = src
var/dat
if(curing)
dat = "Antibody production in progress"
else if(virusing)
dat = "Virus production in progress"
else if(container)
// see if there's any blood in the container
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in container.reagents.reagent_list
if(B)
dat = "Blood sample inserted."
var/code = ""
for(var/V in ANTIGENS) if(text2num(V) & B.data["antibodies"]) code += ANTIGENS[V]
dat += "<BR>Antibodies: [code]"
dat += "<BR><A href='?src=\ref[src];antibody=1'>Begin antibody production</a>"
else
dat += "<BR>Please check container contents."
dat += "<BR><A href='?src=\ref[src];eject=1'>Eject container</a>"
else
dat = "Please insert a container."
user << browse(dat, "window=computer;size=400x500")
onclose(user, "computer")
return
/obj/machinery/computer/curer/process()
..()
if(stat & (NOPOWER|BROKEN))
return
use_power(500)
if(curing)
curing -= 1
if(curing == 0)
if(container)
createcure(container)
return
/obj/machinery/computer/curer/Topic(href, href_list)
if(..())
return
usr.machine = src
if (href_list["antibody"])
curing = 10
else if(href_list["eject"])
container.loc = src.loc
container = null
src.add_fingerprint(usr)
src.updateUsrDialog()
return
/obj/machinery/computer/curer/proc/createcure(var/obj/item/weapon/reagent_containers/container)
var/obj/item/weapon/reagent_containers/glass/beaker/product = new(src.loc)
var/datum/reagent/blood/B = locate() in container.reagents.reagent_list
var/list/data = list()
data["antibodies"] = B.data["antibodies"]
product.reagents.add_reagent("antibodies",30,data)
state("\The [src.name] buzzes", "blue")

View File

@@ -0,0 +1,164 @@
/datum/disease2/disease
var/infectionchance = 10
var/speed = 1
var/spreadtype = "Blood" // Can also be "Airborne"
var/stage = 1
var/stageprob = 10
var/dead = 0
var/clicks = 0
var/uniqueID = 0
var/list/datum/disease2/effectholder/effects = list()
var/antigen = 0 // 16 bits describing the antigens, when one bit is set, a cure with that bit can dock here
var/max_stage = 4
/datum/disease2/disease/New()
uniqueID = rand(0,10000)
..()
/datum/disease2/disease/proc/makerandom(var/greater=0)
for(var/i=1 ; i <= max_stage ; i++ )
var/datum/disease2/effectholder/holder = new /datum/disease2/effectholder
holder.stage = i
if(greater)
holder.getrandomeffect(2)
else
holder.getrandomeffect()
effects += holder
uniqueID = rand(0,10000)
infectionchance = rand(1,10)
antigen |= text2num(pick(ANTIGENS))
antigen |= text2num(pick(ANTIGENS))
spreadtype = "Airborne"
/datum/disease2/disease/proc/activate(var/mob/living/carbon/mob)
if(dead)
cure(mob)
return
if(mob.stat == 2)
return
if(stage <= 1 && clicks == 0) // with a certain chance, the mob may become immune to the disease before it starts properly
if(prob(20))
mob.antibodies |= antigen // 20% immunity is a good chance IMO, because it allows finding an immune person easily
else
if(mob.radiation > 50)
if(prob(1))
majormutate()
//Space antibiotics stop disease completely (temporary)
if(mob.reagents.has_reagent("spaceacillin"))
return
//Virus food speeds up disease progress
if(mob.reagents.has_reagent("virusfood"))
mob.reagents.remove_reagent("virusfood",0.1)
clicks += 10
//Moving to the next stage
if(clicks > stage*100 && prob(10))
if(stage == max_stage)
src.cure(mob)
mob.antibodies |= src.antigen
stage++
clicks = 0
//Do nasty effects
for(var/datum/disease2/effectholder/e in effects)
e.runeffect(mob,stage)
//fever
mob.bodytemperature = max(mob.bodytemperature, min(310+5*stage ,mob.bodytemperature+5*stage))
clicks+=speed
/datum/disease2/disease/proc/cure(var/mob/living/carbon/mob)
for(var/datum/disease2/effectholder/e in effects)
e.effect.deactivate(mob)
mob.virus2.Remove("[uniqueID]")
/datum/disease2/disease/proc/minormutate()
uniqueID = rand(0,10000)
var/datum/disease2/effectholder/holder = pick(effects)
holder.minormutate()
infectionchance = min(10,infectionchance + rand(0,1))
/datum/disease2/disease/proc/majormutate()
uniqueID = rand(0,10000)
var/datum/disease2/effectholder/holder = pick(effects)
holder.majormutate()
if (prob(5))
antigen = text2num(pick(ANTIGENS))
antigen |= text2num(pick(ANTIGENS))
/datum/disease2/disease/proc/getcopy()
var/datum/disease2/disease/disease = new /datum/disease2/disease
disease.infectionchance = infectionchance
disease.spreadtype = spreadtype
disease.stageprob = stageprob
disease.antigen = antigen
disease.uniqueID = uniqueID
for(var/datum/disease2/effectholder/holder in effects)
var/datum/disease2/effectholder/newholder = new /datum/disease2/effectholder
newholder.effect = new holder.effect.type
newholder.chance = holder.chance
newholder.cure = holder.cure
newholder.multiplier = holder.multiplier
newholder.happensonce = holder.happensonce
newholder.stage = holder.stage
disease.effects += newholder
return disease
/datum/disease2/disease/proc/issame(var/datum/disease2/disease/disease)
var/list/types = list()
var/list/types2 = list()
for(var/datum/disease2/effectholder/d in effects)
types += d.effect.type
var/equal = 1
for(var/datum/disease2/effectholder/d in disease.effects)
types2 += d.effect.type
for(var/type in types)
if(!(type in types2))
equal = 0
if (antigen != disease.antigen)
equal = 0
return equal
/proc/virus_copylist(var/list/datum/disease2/disease/viruses)
var/list/res = list()
for (var/ID in viruses)
var/datum/disease2/disease/V = viruses[ID]
res["[V.uniqueID]"] = V.getcopy()
return res
var/global/list/virusDB = list()
/datum/disease2/disease/proc/name()
.= "stamm #[add_zero("[uniqueID]", 4)]"
if ("[uniqueID]" in virusDB)
var/datum/data/record/V = virusDB["[uniqueID]"]
.= V.fields["name"]
/datum/disease2/disease/proc/get_info()
var/r = "GNAv2 based virus lifeform - [name()], #[add_zero("[uniqueID]", 4)]"
r += "<BR>Infection rate : [infectionchance * 10]"
r += "<BR>Spread form : [spreadtype]"
r += "<BR>Progress Speed : [stageprob * 10]"
for(var/datum/disease2/effectholder/E in effects)
r += "<BR>Effect:[E.effect.name]. Strength : [E.multiplier * 8]. Verosity : [E.chance * 15]. Type : [5-E.stage]."
r += "<BR>Antigen pattern: [antigens2string(antigen)]"
return r
/datum/disease2/disease/proc/addToDB()
if ("[uniqueID]" in virusDB)
return 0
var/datum/data/record/v = new()
v.fields["id"] = uniqueID
v.fields["name"] = name()
v.fields["description"] = get_info()
v.fields["antigen"] = antigens2string(antigen)
v.fields["spread type"] = spreadtype
virusDB["[uniqueID]"] = v
return 1

View File

@@ -0,0 +1,144 @@
/obj/machinery/computer/diseasesplicer
name = "Disease Splicer"
icon = 'computer.dmi'
icon_state = "crew"
var/datum/disease2/effectholder/memorybank = null
var/analysed = 0
var/obj/item/weapon/virusdish/dish = null
var/burning = 0
var/splicing = 0
var/scanning = 0
/obj/machinery/computer/diseasesplicer/attackby(var/obj/I as obj, var/mob/user as mob)
if(istype(I, /obj/item/weapon/screwdriver))
return ..(I,user)
if(istype(I,/obj/item/weapon/virusdish))
var/mob/living/carbon/c = user
if(!dish)
dish = I
c.drop_item()
I.loc = src
if(istype(I,/obj/item/weapon/diseasedisk))
user << "You upload the contents of the disk into the buffer"
memorybank = I:effect
src.attack_hand(user)
return
/obj/machinery/computer/diseasesplicer/attack_ai(var/mob/user as mob)
return src.attack_hand(user)
/obj/machinery/computer/diseasesplicer/attack_paw(var/mob/user as mob)
return src.attack_hand(user)
return
/obj/machinery/computer/diseasesplicer/attack_hand(var/mob/user as mob)
if(..())
return
user.machine = src
var/dat
if(splicing)
dat = "Splicing in progress."
else if(scanning)
dat = "Splicing in progress."
else if(burning)
dat = "Data disk burning in progress."
else
if(dish)
dat = "Virus dish inserted."
dat += "<BR>Current DNA strand : "
if(memorybank)
dat += "<A href='?src=\ref[src];splice=1'>"
if(analysed)
dat += "[memorybank.effect.name] ([5-memorybank.effect.stage])"
else
dat += "Unknown DNA strand ([5-memorybank.effect.stage])"
dat += "</a>"
dat += "<BR><A href='?src=\ref[src];disk=1'>Burn DNA Sequence to data storage disk</a>"
else
dat += "Empty."
dat += "<BR><BR>"
if(dish)
if(dish.virus2)
if(dish.growth >= 50)
for(var/datum/disease2/effectholder/e in dish.virus2.effects)
dat += "<BR><A href='?src=\ref[src];grab=\ref[e]'> DNA strand"
if(dish.analysed)
dat += ": [e.effect.name]"
dat += " (5-[e.effect.stage])</a>"
else
dat += "<BR>Insufficent cells to attempt gene splicing."
else
dat += "<BR>No virus found in dish."
dat += "<BR><BR><A href='?src=\ref[src];eject=1'>Eject disk</a>"
else
dat += "<BR>Please insert dish."
user << browse(dat, "window=computer;size=400x500")
onclose(user, "computer")
return
/obj/machinery/computer/diseasesplicer/process()
if(stat & (NOPOWER|BROKEN))
return
use_power(500)
if(scanning)
scanning -= 1
if(!scanning)
state("The [src.name] beeps", "blue")
if(splicing)
splicing -= 1
if(!splicing)
state("The [src.name] pings", "blue")
if(burning)
burning -= 1
if(!burning)
var/obj/item/weapon/diseasedisk/d = new /obj/item/weapon/diseasedisk(src.loc)
if(analysed)
d.name = "[memorybank.effect.name] GNA disk (Stage: [5-memorybank.effect.stage])"
else
d.name = "Unknown GNA disk (Stage: [5-memorybank.effect.stage])"
d.effect = memorybank
state("The [src.name] zings", "blue")
return
/obj/machinery/computer/diseasesplicer/Topic(href, href_list)
if(..())
return
if (href_list["grab"])
memorybank = locate(href_list["grab"])
analysed = dish.analysed
del(dish)
dish = null
scanning = 10
else if(href_list["eject"])
dish.loc = src.loc
dish = null
else if(href_list["splice"])
if(dish)
for(var/datum/disease2/effectholder/e in dish.virus2.effects)
if(e.stage == memorybank.stage)
e.effect = memorybank.effect
splicing = 10
// dish.virus2.spreadtype = "Blood"
else if(href_list["disk"])
burning = 10
src.add_fingerprint(usr)
src.updateUsrDialog()
return

View File

@@ -0,0 +1,167 @@
/obj/machinery/disease2/incubator/
name = "Pathogenic incubator"
density = 1
anchored = 1
icon = 'virology.dmi'
icon_state = "incubator"
var/obj/item/weapon/virusdish/dish
var/obj/item/weapon/reagent_containers/glass/beaker = null
var/radiation = 0
var/on = 0
var/power = 0
var/foodsupply = 0
var/toxins = 0
var/virusing
/obj/machinery/disease2/incubator/attackby(var/obj/B as obj, var/mob/user as mob)
if(istype(B, /obj/item/weapon/reagent_containers/glass) || istype(B,/obj/item/weapon/reagent_containers/syringe))
if(src.beaker)
if(istype(beaker,/obj/item/weapon/reagent_containers/syringe))
user << "A syringe is already loaded into the machine."
else
user << "A beaker is already loaded into the machine."
return
src.beaker = B
user.drop_item()
B.loc = src
if(istype(B,/obj/item/weapon/reagent_containers/syringe))
user << "You add the syringe to the machine!"
src.updateUsrDialog()
else
user << "You add the beaker to the machine!"
src.updateUsrDialog()
else
if(istype(B,/obj/item/weapon/virusdish))
if(src.dish)
user << "A dish is already loaded into the machine."
return
src.dish = B
user.drop_item()
B.loc = src
if(istype(B,/obj/item/weapon/virusdish))
user << "You add the dish to the machine!"
src.updateUsrDialog()
/obj/machinery/disease2/incubator/Topic(href, href_list)
if(..()) return
if (href_list["ejectchem"])
if(beaker)
beaker.loc = src.loc
beaker = null
if(!dish)
return
usr.machine = src
if (href_list["power"])
on = !on
if(on)
icon_state = "incubator_on"
else
icon_state = "incubator"
if (href_list["ejectdish"])
if(dish)
dish.loc = src.loc
dish = null
if (href_list["rad"])
radiation += 10
if (href_list["flush"])
radiation = 0
toxins = 0
foodsupply = 0
if(href_list["virus"])
if (!dish)
state("\The [src.name] buzzes, \"No viral culture sample detected.\"", "blue")
return
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in beaker.reagents.reagent_list
if (!B)
state("\The [src.name] buzzes, \"No suitable breeding enviroment detected.\"", "blue")
return
if (!B.data["virus2"])
B.data["virus2"] = list()
var/list/virus = list("[dish.virus2.uniqueID]" = dish.virus2.getcopy())
B.data["virus2"] = virus
state("\The [src.name] pings, \"Injection complete.\"", "blue")
src.add_fingerprint(usr)
src.updateUsrDialog()
/obj/machinery/disease2/incubator/attack_hand(mob/user as mob)
if(stat & BROKEN)
return
user.machine = src
var/dat = ""
if(!dish)
dat = "Please insert dish into the incubator.<BR>"
var/string = "Off"
if(on)
string = "On"
dat += "Power status : <A href='?src=\ref[src];power=1'>[string]</a>"
dat += "<BR>"
dat += "Food supply : [foodsupply]"
dat += "<BR>"
dat += "Radiation Levels : [radiation] RADS : <A href='?src=\ref[src];rad=1'>Radiate</a>"
dat += "<BR>"
dat += "Toxins : [toxins]"
dat += "<BR><BR>"
if(beaker)
dat += "Eject chemicals : <A href='?src=\ref[src];ejectchem=1'> Eject</a>"
dat += "<BR>"
if(dish)
dat += "Eject Virus dish : <A href='?src=\ref[src];ejectdish=1'> Eject</a>"
dat += "<BR>"
if(beaker)
dat += "Breed viral culture in beaker : <A href='?src=\ref[src];virus=1'> Start</a>"
dat += "<BR>"
dat += "<BR><BR>"
dat += "<A href='?src=\ref[src];flush=1'>Flush system</a><BR>"
dat += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
user << browse("<TITLE>Pathogenic incubator</TITLE>incubator menu:<BR><BR>[dat]", "window=incubator;size=575x400")
onclose(user, "incubator")
return
/obj/machinery/disease2/incubator/process()
if(dish && on && dish.virus2)
use_power(50,EQUIP)
if(!powered(EQUIP))
on = 0
icon_state = "incubator"
if(foodsupply)
foodsupply -= 1
dish.growth += 3
if(dish.growth >= 100)
state("The [src.name] pings", "blue")
if(radiation)
if(radiation > 50 & prob(5))
dish.virus2.majormutate()
if(dish.info)
dish.info = "OUTDATED : [dish.info]"
dish.analysed = 0
state("The [src.name] beeps", "blue")
else if(prob(5))
dish.virus2.minormutate()
radiation -= 1
if(toxins && prob(5))
dish.virus2.infectionchance -= 1
if(toxins > 50)
dish.virus2 = null
else if(!dish)
on = 0
icon_state = "incubator"
if(beaker)
if(!beaker.reagents.remove_reagent("virusfood",5))
foodsupply += 10
if(!beaker.reagents.remove_reagent("toxin",1))
toxins += 1

View File

@@ -0,0 +1,361 @@
/datum/disease2/effectholder
var/name = "Holder"
var/datum/disease2/effect/effect
var/chance = 0 //Chance in percentage each tick
var/cure = "" //Type of cure it requires
var/happensonce = 0
var/multiplier = 1 //The chance the effects are WORSE
var/stage = 0
/datum/disease2/effectholder/proc/runeffect(var/mob/living/carbon/human/mob,var/stage)
if(happensonce > -1 && effect.stage <= stage && prob(chance))
effect.activate(mob)
if(happensonce == 1)
happensonce = -1
/datum/disease2/effectholder/proc/getrandomeffect(var/badness = 1)
var/list/datum/disease2/effect/list = list()
for(var/e in (typesof(/datum/disease2/effect) - /datum/disease2/effect))
var/datum/disease2/effect/f = new e
if (f.badness > badness) //we don't want such strong effects
continue
if(f.stage == src.stage)
list += f
effect = pick(list)
chance = rand(1,6)
/datum/disease2/effectholder/proc/minormutate()
switch(pick(1,2,3,4,5))
if(1)
chance = rand(0,effect.chance_maxm)
if(2)
multiplier = rand(1,effect.maxm)
/datum/disease2/effectholder/proc/majormutate()
getrandomeffect(2)
////////////////////////////////////////////////////////////////
////////////////////////EFFECTS/////////////////////////////////
////////////////////////////////////////////////////////////////
/datum/disease2/effect
var/chance_maxm = 50
var/name = "Blanking effect"
var/stage = 4
var/maxm = 1
var/badness = 1
proc/activate(var/mob/living/carbon/mob,var/multiplier)
proc/deactivate(var/mob/living/carbon/mob)
////////////////////////SPECIAL/////////////////////////////////
/datum/disease2/effect/alien
name = "Unidentified Foreign Body"
stage = 4
activate(var/mob/living/carbon/mob,var/multiplier)
mob << "\red You feel something tearing its way out of your stomach..."
mob.adjustToxLoss(10)
mob.updatehealth()
if(prob(40))
if(mob.client)
mob.client.mob = new/mob/living/carbon/alien/larva(mob.loc)
else
new/mob/living/carbon/alien/larva(mob.loc)
var/datum/disease2/disease/D = mob:virus2
mob:gib()
del D
/datum/disease2/effect/invisible
name = "Waiting Syndrome"
stage = 1
activate(var/mob/living/carbon/mob,var/multiplier)
return
////////////////////////STAGE 4/////////////////////////////////
/datum/disease2/effect/gibbingtons
name = "Gibbingtons Syndrome"
stage = 4
badness = 2
activate(var/mob/living/carbon/mob,var/multiplier)
mob.gib()
/datum/disease2/effect/radian
name = "Radian's Syndrome"
stage = 4
maxm = 3
activate(var/mob/living/carbon/mob,var/multiplier)
mob.radiation += (2*multiplier)
/datum/disease2/effect/deaf
name = "Dead Ear Syndrome"
stage = 4
activate(var/mob/living/carbon/mob,var/multiplier)
mob.ear_deaf += 20
/datum/disease2/effect/monkey
name = "Monkism Syndrome"
stage = 4
badness = 2
activate(var/mob/living/carbon/mob,var/multiplier)
if(istype(mob,/mob/living/carbon/human))
var/mob/living/carbon/human/h = mob
h.monkeyize()
/datum/disease2/effect/suicide
name = "Suicidal Syndrome"
stage = 4
badness = 2
activate(var/mob/living/carbon/mob,var/multiplier)
mob.suiciding = 1
//instead of killing them instantly, just put them at -175 health and let 'em gasp for a while
viewers(mob) << "\red <b>[mob.name] is holding \his breath. It looks like \he's trying to commit suicide.</b>"
mob.adjustOxyLoss(175 - mob.getToxLoss() - mob.getFireLoss() - mob.getBruteLoss() - mob.getOxyLoss())
mob.updatehealth()
spawn(200) //in case they get revived by cryo chamber or something stupid like that, let them suicide again in 20 seconds
mob.suiciding = 0
/datum/disease2/effect/killertoxins
name = "Toxification Syndrome"
stage = 4
activate(var/mob/living/carbon/mob,var/multiplier)
mob.adjustToxLoss(15*multiplier)
/datum/disease2/effect/dna
name = "Reverse Pattern Syndrome"
stage = 4
activate(var/mob/living/carbon/mob,var/multiplier)
mob.bodytemperature = max(mob.bodytemperature, 350)
scramble(0,mob,10)
mob.apply_damage(10, CLONE)
/datum/disease2/effect/organs
name = "Shutdown Syndrome"
stage = 4
activate(var/mob/living/carbon/mob,var/multiplier)
if(istype(mob, /mob/living/carbon/human))
var/mob/living/carbon/human/H = mob
var/datum/organ/external/E = pick(H.organs)
if (!(E.status & ORGAN_DEAD))
E.status |= ORGAN_DEAD
H << "<span class='notice'>You can't feel your [E.display_name] anymore...</span>"
mob.adjustToxLoss(15*multiplier)
deactivate(var/mob/living/carbon/mob,var/multiplier)
if(istype(mob, /mob/living/carbon/human))
var/mob/living/carbon/human/H = mob
for (var/datum/organ/external/E in H.organs)
E.status ^= ORGAN_DEAD
/datum/disease2/effect/immortal
name = "Longevity Syndrome"
stage = 4
activate(var/mob/living/carbon/mob,var/multiplier)
if(istype(mob, /mob/living/carbon/human))
var/mob/living/carbon/human/H = mob
for (var/datum/organ/external/E in H.organs)
if (E.status & ORGAN_BROKEN && prob(30))
E.status ^= ORGAN_BROKEN
var/heal_amt = -5*multiplier
mob.apply_damages(heal_amt,heal_amt,heal_amt,heal_amt)
deactivate(var/mob/living/carbon/mob,var/multiplier)
if(istype(mob, /mob/living/carbon/human))
var/mob/living/carbon/human/H = mob
H << "<span class='notice'>You suddenly feel hurt and old...</span>"
H.age += 8
var/backlash_amt = 5*multiplier
mob.apply_damages(backlash_amt,backlash_amt,backlash_amt,backlash_amt)
////////////////////////STAGE 3/////////////////////////////////
/datum/disease2/effect/bones
name = "Fragile Bones Syndrome"
stage = 4
activate(var/mob/living/carbon/mob,var/multiplier)
if(istype(mob, /mob/living/carbon/human))
var/mob/living/carbon/human/H = mob
for (var/datum/organ/external/E in H.organs)
E.min_broken_damage = max(5, E.min_broken_damage - 30)
deactivate(var/mob/living/carbon/mob,var/multiplier)
if(istype(mob, /mob/living/carbon/human))
var/mob/living/carbon/human/H = mob
for (var/datum/organ/external/E in H.organs)
E.min_broken_damage = initial(E.min_broken_damage)
/datum/disease2/effect/toxins
name = "Hyperacidity"
stage = 3
maxm = 3
activate(var/mob/living/carbon/mob,var/multiplier)
mob.adjustToxLoss((2*multiplier))
/datum/disease2/effect/shakey
name = "World Shaking Syndrome"
stage = 3
maxm = 3
activate(var/mob/living/carbon/mob,var/multiplier)
shake_camera(mob,5*multiplier)
/datum/disease2/effect/telepathic
name = "Telepathy Syndrome"
stage = 3
activate(var/mob/living/carbon/mob,var/multiplier)
mob.dna.check_integrity()
var/newdna = setblock(mob.dna.struc_enzymes,REMOTETALKBLOCK,toggledblock(getblock(mob.dna.struc_enzymes,REMOTETALKBLOCK,3)),3)
mob.dna.struc_enzymes = newdna
domutcheck(mob, null)
/datum/disease2/effect/mind
name = "Lazy Mind Syndrome"
stage = 3
activate(var/mob/living/carbon/mob,var/multiplier)
if(istype(mob, /mob/living/carbon/human))
var/mob/living/carbon/human/H = mob
var/datum/organ/internal/brain/B = H.internal_organs["brain"]
B.take_damage(5)
else
mob.setBrainLoss(50)
/datum/disease2/effect/hallucinations
name = "Hallucinational Syndrome"
stage = 3
activate(var/mob/living/carbon/mob,var/multiplier)
mob.hallucination += 25
/datum/disease2/effect/deaf
name = "Hard of Hearing Syndrome"
stage = 3
activate(var/mob/living/carbon/mob,var/multiplier)
mob.ear_deaf = 5
/datum/disease2/effect/giggle
name = "Uncontrolled Laughter Effect"
stage = 3
activate(var/mob/living/carbon/mob,var/multiplier)
mob.say("*giggle")
/datum/disease2/effect/confusion
name = "Topographical Cretinism"
stage = 3
activate(var/mob/living/carbon/mob,var/multiplier)
mob << "<span class='notice'>You have trouble telling right and left apart all of a sudden.</span>"
mob.confused += 10
/datum/disease2/effect/mutation
name = "DNA Degradation"
stage = 3
activate(var/mob/living/carbon/mob,var/multiplier)
mob.apply_damage(2, CLONE)
/datum/disease2/effect/groan
name = "Groaning Syndrome"
stage = 3
activate(var/mob/living/carbon/mob,var/multiplier)
mob.say("*groan")
////////////////////////STAGE 2/////////////////////////////////
/datum/disease2/effect/scream
name = "Loudness Syndrome"
stage = 2
activate(var/mob/living/carbon/mob,var/multiplier)
mob.say("*scream")
/datum/disease2/effect/drowsness
name = "Automated Sleeping Syndrome"
stage = 2
activate(var/mob/living/carbon/mob,var/multiplier)
mob.drowsyness += 10
/datum/disease2/effect/sleepy
name = "Resting Syndrome"
stage = 2
activate(var/mob/living/carbon/mob,var/multiplier)
mob.say("*collapse")
/datum/disease2/effect/blind
name = "Blackout Syndrome"
stage = 2
activate(var/mob/living/carbon/mob,var/multiplier)
mob.eye_blind = max(mob.eye_blind, 4)
/datum/disease2/effect/cough
name = "Anima Syndrome"
stage = 2
activate(var/mob/living/carbon/mob,var/multiplier)
mob.say("*cough")
for(var/mob/living/carbon/M in view(1,mob))
if(airborne_can_reach(get_turf(mob), get_turf(M)))
for (var/datum/disease2/disease/V in mob.virus2)
if(V.spreadtype == "Airborne")
infect_virus2(M,V)
/datum/disease2/effect/hungry
name = "Appetiser Effect"
stage = 2
activate(var/mob/living/carbon/mob,var/multiplier)
mob.nutrition = max(0, mob.nutrition - 200)
/datum/disease2/effect/fridge
name = "Refridgerator Syndrome"
stage = 2
activate(var/mob/living/carbon/mob,var/multiplier)
mob.say("*shiver")
/datum/disease2/effect/hair
name = "Hair Loss"
stage = 2
activate(var/mob/living/carbon/mob,var/multiplier)
if(istype(mob, /mob/living/carbon/human))
var/mob/living/carbon/human/H = mob
if(!(H.h_style == "Bald") && !(H.h_style == "Balding Hair"))
H << "<span class='danger'>Your hair starts to fall out in clumps...</span>"
spawn(50)
H.h_style = "Balding Hair"
H.update_hair()
/datum/disease2/effect/stimulant
name = "Adrenaline Extra"
stage = 2
activate(var/mob/living/carbon/mob,var/multiplier)
mob << "<span class='notice'>You feel a rush of energy inside you!</span>"
if (mob.reagents.get_reagent_amount("hyperzine") < 30)
mob.reagents.add_reagent("hyperzine", 10)
if (prob(30))
mob.jitteriness += 10
////////////////////////STAGE 1/////////////////////////////////
/datum/disease2/effect/sneeze
name = "Coldingtons Effect"
stage = 1
activate(var/mob/living/carbon/mob,var/multiplier)
mob.say("*sneeze")
if (prob(50))
var/obj/effect/decal/cleanable/mucus/M = new(get_turf(mob))
M.virus2 = virus_copylist(mob.virus2)
/datum/disease2/effect/gunck
name = "Flemmingtons"
stage = 1
activate(var/mob/living/carbon/mob,var/multiplier)
mob << "\red Mucous runs down the back of your throat."
/datum/disease2/effect/drool
name = "Saliva Effect"
stage = 1
activate(var/mob/living/carbon/mob,var/multiplier)
mob.say("*drool")
/datum/disease2/effect/twitch
name = "Twitcher"
stage = 1
activate(var/mob/living/carbon/mob,var/multiplier)
mob.say("*twitch")
/datum/disease2/effect/headache
name = "Headache"
stage = 1
activate(var/mob/living/carbon/mob,var/multiplier)
mob << "<span class = 'notice'> Your head hurts a bit</span>"

View File

@@ -0,0 +1,82 @@
//Returns 1 if mob can be infected, 0 otherwise. Checks his clothing.
proc/get_infection_chance(var/mob/living/carbon/M)
var/score = 0
if (!istype(M))
return 0
if(istype(M, /mob/living/carbon/human))
if(M:gloves)
score += 5
if(istype(M:wear_suit, /obj/item/clothing/suit/space)) score += 10
if(istype(M:wear_suit, /obj/item/clothing/suit/bio_suit)) score += 10
if(istype(M:head, /obj/item/clothing/head/helmet/space)) score += 5
if(istype(M:head, /obj/item/clothing/head/bio_hood)) score += 5
if(M.wear_mask)
score += 5
if(istype(M:wear_mask, /obj/item/clothing/mask/surgical) && !M.internal)
score += 10
if(M.internal)
score += 10
if(score >= 30)
return 0
else if(score == 25 && prob(99))
return 0
else if(score == 20 && prob(95))
return 0
else if(score == 15 && prob(75))
return 0
else if(score == 10 && prob(55))
return 0
else if(score == 5 && prob(35))
return 0
return 1
//Checks if table-passing table can reach target (5 tile radius)
proc/airborne_can_reach(turf/source, turf/target)
var/obj/dummy = new(source)
dummy.flags = FPRINT | TABLEPASS
dummy.pass_flags = PASSTABLE
for(var/i=0, i<5, i++) if(!step_towards(dummy, target)) break
var/rval = (dummy.loc in range(1,target))
del dummy
return rval
//Attemptes to infect mob M with virus. Set forced to 1 to ignore protective clothnig
/proc/infect_virus2(var/mob/living/carbon/M,var/datum/disease2/disease/disease,var/forced = 0)
if(!istype(disease))
return
if(!istype(M))
return
if ("[disease.uniqueID]" in M.virus2)
return
// if one of the antibodies in the mob's body matches one of the disease's antigens, don't infect
if(M.antibodies & disease.antigen != 0)
return
if(prob(disease.infectionchance) || forced)
// certain clothes can prevent an infection
if(!forced && !get_infection_chance(M))
return
var/datum/disease2/disease/D = disease.getcopy()
D.minormutate()
M.virus2["[D.uniqueID]"] = D
//Infects mob M with random lesser disease, if he doesn't have one
/proc/infect_mob_random_lesser(var/mob/living/carbon/M)
var/datum/disease2/disease/D = new /datum/disease2/disease
D.makerandom()
D.infectionchance = 1
M.virus2["[D.uniqueID]"] = D
//Infects mob M with random greated disease, if he doesn't have one
/proc/infect_mob_random_greater(var/mob/living/carbon/M)
var/datum/disease2/disease/D = new /datum/disease2/disease
D.makerandom(1)
M.virus2["[D.uniqueID]"] = D
//Fancy prob() function.
/proc/dprob(var/p)
return(prob(sqrt(p)) && prob(sqrt(p)))

View File

@@ -0,0 +1,97 @@
/obj/machinery/disease2/isolator/
name = "Pathogenic Isolator"
density = 1
anchored = 1
icon = 'virology.dmi'
icon_state = "isolator"
var/datum/disease2/disease/virus2 = null
var/isolating = 0
var/beaker = null
/obj/machinery/disease2/isolator/attackby(var/W as obj, var/mob/user)
if(!istype(W,/obj/item/weapon/reagent_containers/syringe))
return
var/obj/item/weapon/reagent_containers/syringe/B = W
if(src.beaker)
user << "A syringe is already loaded into the machine."
return
src.beaker = B
user.drop_item()
B.loc = src
if(istype(B,/obj/item/weapon/reagent_containers/syringe))
user << "You add the syringe to the machine!"
src.updateUsrDialog()
icon_state = "isolator_in"
/obj/machinery/disease2/isolator/Topic(href, href_list)
if(..()) return
usr.machine = src
if(!beaker) return
var/datum/reagents/R = beaker:reagents
if (href_list["isolate"])
var/datum/reagent/blood/Blood
for(var/datum/reagent/blood/B in R.reagent_list)
if(B)
Blood = B
break
var/list/virus = virus_copylist(Blood.data["virus2"])
var/choice = text2num(href_list["isolate"]);
for (var/datum/disease2/disease/V in virus)
if (V.uniqueID == choice)
virus2 = virus
isolating = 40
icon_state = "isolator_processing"
src.updateUsrDialog()
return
else if (href_list["main"])
attack_hand(usr)
return
else if (href_list["eject"])
beaker:loc = src.loc
beaker = null
icon_state = "isolator"
src.updateUsrDialog()
return
/obj/machinery/disease2/isolator/attack_hand(mob/user as mob)
if(stat & BROKEN)
return
user.machine = src
var/dat = ""
if(!beaker)
dat = "Please insert sample into the isolator.<BR>"
dat += "<A href='?src=\ref[src];close=1'>Close</A>"
else if(isolating)
dat = "Isolating"
else
var/datum/reagents/R = beaker:reagents
dat += "<A href='?src=\ref[src];eject=1'>Eject</A><BR><BR>"
if(!R.total_volume)
dat += "[beaker] is empty."
else
dat += "Contained reagents:<BR>"
for(var/datum/reagent/blood/G in R.reagent_list)
if(G.data["virus2"])
var/list/virus = G.data["virus2"]
for (var/datum/disease2/disease/V in virus)
dat += " <br> [G.name]: <A href='?src=\ref[src];isolate=[V.uniqueID]'>Isolate pathogen #[V.uniqueID]</a>"
else
dat += " <b>No pathogen</b>"
user << browse("<TITLE>Pathogenic Isolator</TITLE>Isolator menu:<BR><BR>[dat]", "window=isolator;size=575x400")
onclose(user, "isolator")
return
/obj/machinery/disease2/isolator/process()
if(isolating > 0)
isolating -= 1
if(isolating == 0)
var/obj/item/weapon/virusdish/d = new /obj/item/weapon/virusdish(src.loc)
d.virus2 = virus2.getcopy()
virus2 = null
icon_state = "isolator_in"

View File

@@ -0,0 +1,81 @@
/obj/machinery/proc/state(var/msg)
for(var/mob/O in hearers(src, null))
O.show_message("\icon[src] <span class = 'notice'>[msg]</span>", 2)
///////////////ANTIBODY SCANNER///////////////
/obj/item/device/antibody_scanner
name = "Antibody Scanner"
desc = "Used to scan living beings for antibodies in their blood."
icon_state = "health"
w_class = 2.0
item_state = "electronic"
flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY
/obj/item/device/antibody_scanner/attack(mob/living/carbon/human/M as mob, mob/user as mob)
if(!istype(M))
user << "<span class='notice'>Incompatible object, scan aborted.</span>"
return
var/mob/living/carbon/C = M
if(!C.antibodies)
user << "<span class='notice'>Unable to detect antibodies.</span>"
return
var/code = antigens2string(M.antibodies)
user << "<span class='notice'>[src] The antibody scanner displays a cryptic set of data: [code]</span>"
///////////////VIRUS DISH///////////////
/obj/item/weapon/virusdish
name = "Virus containment/growth dish"
icon = 'items.dmi'
icon_state = "implantcase-b"
var/datum/disease2/disease/virus2 = null
var/growth = 0
var/info = 0
var/analysed = 0
reagents = list()
/obj/item/weapon/virusdish/random
name = "Virus Sample"
/obj/item/weapon/virusdish/random/New()
..()
src.virus2 = new /datum/disease2/disease
src.virus2.makerandom()
growth = rand(5, 50)
/obj/item/weapon/virusdish/attackby(var/obj/item/weapon/W as obj,var/mob/living/carbon/user as mob)
if(istype(W,/obj/item/weapon/hand_labeler) || istype(W,/obj/item/weapon/reagent_containers/syringe))
return
..()
if(prob(50))
user << "The dish shatters"
if(virus2.infectionchance > 0)
for(var/mob/living/carbon/target in view(null, src))
if(airborne_can_reach(src.loc, target.loc))
if(get_infection_chance(target))
infect_virus2(target,src.virus2)
del src
/obj/item/weapon/virusdish/examine()
usr << "This is a virus containment dish"
if(src.info)
usr << "It has the following information about its contents"
usr << src.info
///////////////GNA DISK///////////////
/obj/item/weapon/diseasedisk
name = "Blank GNA disk"
icon = 'cloning.dmi'
icon_state = "datadisk0"
var/datum/disease2/effectholder/effect = null
var/stage = 1
/obj/item/weapon/diseasedisk/premade/New()
name = "Blank GNA disk (stage: [5-stage])"
effect = new /datum/disease2/effectholder
effect.effect = new /datum/disease2/effect/invisible
effect.stage = stage