mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-19 22:51:40 +00:00
Conflict fix?
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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^^^^^^^^^
|
||||
@@ -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
|
||||
|
||||
@@ -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'>"
|
||||
|
||||
|
||||
@@ -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)]."
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
@@ -148,10 +148,10 @@
|
||||
if(module)
|
||||
return
|
||||
var/list/modules = list("Standard", "Engineering", "Medical", "Miner", "Janitor", "Service", "Security")
|
||||
if(crisis) //Leaving this in until it's balanced appropriately.
|
||||
if(emagged || security_level > SEC_LEVEL_BLUE)
|
||||
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,7 +176,6 @@
|
||||
|
||||
if("Miner")
|
||||
module = new /obj/item/weapon/robot_module/miner(src)
|
||||
modtype = "Miner"
|
||||
channels = list("Supply" = 1)
|
||||
module_sprites["Basic"] = "Miner_old"
|
||||
module_sprites["Advanced Droid"] = "droid-miner"
|
||||
@@ -186,7 +183,6 @@
|
||||
|
||||
if("Medical")
|
||||
module = new /obj/item/weapon/robot_module/medical(src)
|
||||
modtype = "Med"
|
||||
channels = list("Medical" = 1)
|
||||
module_sprites["Basic"] = "Medbot"
|
||||
module_sprites["Advanced Droid"] = "droid-medical"
|
||||
@@ -195,7 +191,6 @@
|
||||
|
||||
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"
|
||||
@@ -204,7 +199,6 @@
|
||||
|
||||
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"
|
||||
@@ -212,26 +206,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)
|
||||
@@ -239,7 +231,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
|
||||
@@ -249,7 +242,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
|
||||
|
||||
@@ -287,7 +280,7 @@
|
||||
if (newname != "")
|
||||
custom_name = newname
|
||||
|
||||
updatename("Default")
|
||||
updatename()
|
||||
updateicon()
|
||||
|
||||
/mob/living/silicon/robot/verb/cmd_robot_alerts()
|
||||
|
||||
@@ -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")
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>")
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
ammo_type = "/obj/item/ammo_casing/c9mm"
|
||||
automatic = 1
|
||||
|
||||
fire_delay = 0
|
||||
|
||||
isHandgun()
|
||||
return 0
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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()
|
||||
|
||||
62
code/modules/virus2/analyser.dm
Normal file
62
code/modules/virus2/analyser.dm
Normal 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
|
||||
52
code/modules/virus2/antibodies.dm
Normal file
52
code/modules/virus2/antibodies.dm
Normal 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
|
||||
20
code/modules/virus2/biohazard destroyer.dm
Normal file
20
code/modules/virus2/biohazard destroyer.dm
Normal 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)
|
||||
157
code/modules/virus2/centrifuge.dm
Normal file
157
code/modules/virus2/centrifuge.dm
Normal 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")
|
||||
113
code/modules/virus2/curer.dm
Normal file
113
code/modules/virus2/curer.dm
Normal 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")
|
||||
164
code/modules/virus2/disease2.dm
Normal file
164
code/modules/virus2/disease2.dm
Normal 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
|
||||
144
code/modules/virus2/diseasesplicer.dm
Normal file
144
code/modules/virus2/diseasesplicer.dm
Normal 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
|
||||
167
code/modules/virus2/dishincubator.dm
Normal file
167
code/modules/virus2/dishincubator.dm
Normal 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
|
||||
361
code/modules/virus2/effect.dm
Normal file
361
code/modules/virus2/effect.dm
Normal 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>"
|
||||
82
code/modules/virus2/helpers.dm
Normal file
82
code/modules/virus2/helpers.dm
Normal 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)))
|
||||
97
code/modules/virus2/isolator.dm
Normal file
97
code/modules/virus2/isolator.dm
Normal 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"
|
||||
81
code/modules/virus2/items_devices.dm
Normal file
81
code/modules/virus2/items_devices.dm
Normal 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
|
||||
Reference in New Issue
Block a user