diff --git a/code/WorkInProgress/explosion_particles.dm b/code/WorkInProgress/explosion_particles.dm index 4d0f24799e1..b63eeb9aab5 100644 --- a/code/WorkInProgress/explosion_particles.dm +++ b/code/WorkInProgress/explosion_particles.dm @@ -1,5 +1,5 @@ /obj/effect/expl_particles - name = "fire" + name = "explosive particles" icon = 'icons/effects/effects.dmi' icon_state = "explosion_particle" opacity = 1 @@ -9,7 +9,7 @@ /obj/effect/expl_particles/New() ..() spawn (15) - del(src) + src.loc = null return /obj/effect/expl_particles/Move() @@ -38,7 +38,7 @@ step(expl,direct) /obj/effect/explosion - name = "fire" + name = "explosive particles" icon = 'icons/effects/96x96.dmi' icon_state = "explosion" opacity = 1 @@ -50,7 +50,7 @@ /obj/effect/explosion/New() ..() spawn (10) - del(src) + src.loc = null return /datum/effect/system/explosion diff --git a/code/ZAS - vgstation/Fire.dm b/code/ZAS - vgstation/Fire.dm index 2047042ea6d..5d0ab4b0f17 100644 --- a/code/ZAS - vgstation/Fire.dm +++ b/code/ZAS - vgstation/Fire.dm @@ -67,10 +67,10 @@ obj var/turf/simulated/S = loc if(!istype(S)) - del src + src.gc_del() if(!S.zone) - del src + src.gc_del() var/datum/gas_mixture/air_contents = S.return_air() //get liquid fuels on the ground. @@ -90,7 +90,7 @@ obj //check if there is something to combust if(!air_contents.check_recombustability(liquid)) - //del src + //src.gc_del() RemoveFire() //get a firelevel and set the icon @@ -159,7 +159,7 @@ obj ..() if(!istype(loc, /turf)) - del src + src.gc_del() dir = pick(cardinal) SetLuminosity(3) @@ -182,6 +182,10 @@ obj loc = null air_master.active_hotspots.Remove(src) + proc/gc_del() + loc = null + air_master.active_hotspots.Remove(src) + turf/simulated/var/fire_protection = 0 //Protects newly extinguished tiles from being overrun again. diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 92b9f1d4ed1..64e0647222e 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -435,6 +435,7 @@ its easier to just keep the beam vertical. //returns 1 if made bloody, returns 0 otherwise /atom/proc/add_blood(mob/living/carbon/human/M as mob) + if(flags & NOBLOODY) return 0 .=1 if (!( istype(M, /mob/living/carbon/human) )) return 0 diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm index 7d21117c69a..ae7accd056d 100644 --- a/code/game/gamemodes/gameticker.dm +++ b/code/game/gamemodes/gameticker.dm @@ -63,10 +63,10 @@ var/global/datum/controller/gameticker/ticker timerbuffer = config.vote_autotransfer_initial else timerbuffer = config.vote_autotransfer_interval - sleep(timerbuffer) - vote.autotransfer() - initialtpass = 1 - votetimer() + spawn(timerbuffer) + vote.autotransfer() + initialtpass = 1 + votetimer() /datum/controller/gameticker/proc/setup() //Create and announce mode diff --git a/code/game/machinery/washing_machine.dm b/code/game/machinery/washing_machine.dm index 0ee5ecf2e71..3c894359db0 100644 --- a/code/game/machinery/washing_machine.dm +++ b/code/game/machinery/washing_machine.dm @@ -27,6 +27,9 @@ set category = "Object" set src in oview(1) + if(!istype(usr, /mob/living)) //ew ew ew usr, but it's the only way to check. + return + if( state != 4 ) usr << "The washing machine cannot run in this state." return diff --git a/code/game/objects/effects/glowshroom.dm b/code/game/objects/effects/glowshroom.dm index 9dd3c79c711..425034ba485 100644 --- a/code/game/objects/effects/glowshroom.dm +++ b/code/game/objects/effects/glowshroom.dm @@ -16,6 +16,8 @@ var/spreadChance = 40 var/spreadIntoAdjacentChance = 60 var/evolveChance = 2 + var/lastTick = 0 + var/spreaded = 1 /obj/effect/glowshroom/single spreadChance = 0 @@ -40,15 +42,21 @@ else //if on the floor, glowshroom on-floor sprite icon_state = "glowshroomf" - spawn(delay) - SetLuminosity(round(potency/10)) - Spread() + processing_objects += src -/obj/effect/glowshroom/proc/Spread() - set background = 1 - var/spreaded = 1 + SetLuminosity(round(potency/10)) + lastTick = world.timeofday - while(spreaded) +/obj/effect/glowshroom/Del() + processing_objects -= src + ..() + +/obj/effect/glowshroom/process() + if(!spreaded) + return + + if(((world.timeofday - lastTick) > delay) || ((world.timeofday - lastTick) < 0)) + lastTick = world.timeofday spreaded = 0 for(var/i=1,i<=yield,i++) @@ -90,8 +98,6 @@ if(prob(evolveChance)) //very low chance to evolve on its own potency += rand(4,6) - sleep(delay) - /obj/effect/glowshroom/proc/CalcDir(turf/location = loc) set background = 1 var/direction = 16 diff --git a/code/game/objects/items/devices/radio/intercom.dm b/code/game/objects/items/devices/radio/intercom.dm index c230a3f5a9b..be44b1df8f1 100644 --- a/code/game/objects/items/devices/radio/intercom.dm +++ b/code/game/objects/items/devices/radio/intercom.dm @@ -5,13 +5,18 @@ anchored = 1 w_class = 4.0 canhear_range = 2 + flags = FPRINT | CONDUCT | TABLEPASS | NOBLOODY var/number = 0 var/anyai = 1 var/mob/living/silicon/ai/ai = list() + var/last_tick //used to delay the powercheck /obj/item/device/radio/intercom/New() - spawn(5) - checkpower() + ..() + processing_objects += src + +/obj/item/device/radio/intercom/Del() + processing_objects -= src ..() /obj/item/device/radio/intercom/attack_ai(mob/user as mob) @@ -51,10 +56,9 @@ return ..() -/obj/item/device/radio/intercom/proc/checkpower() - - // Simple loop, checks for power. Strictly for intercoms - while(src) +/obj/item/device/radio/intercom/process() + if(((world.timeofday - last_tick) > 30) || ((world.timeofday - last_tick) < 0)) + last_tick = world.timeofday if(!src.loc) on = 0 @@ -68,6 +72,4 @@ if(!on) icon_state = "intercom-p" else - icon_state = "intercom" - - sleep(30) \ No newline at end of file + icon_state = "intercom" \ No newline at end of file diff --git a/code/modules/customitems/item_spawning.dm b/code/modules/customitems/item_spawning.dm index 6ca5945f54a..e061afc1019 100644 --- a/code/modules/customitems/item_spawning.dm +++ b/code/modules/customitems/item_spawning.dm @@ -3,6 +3,10 @@ M.equip_to_slot_or_del(new /obj/item/clothing/shoes/magboots/vox(M), slot_shoes) // REPLACE THESE WITH CODED VOX ALTERNATIVES. M.equip_to_slot_or_del(new /obj/item/clothing/mask/breath/vox(M), slot_wear_mask) M.equip_to_slot_or_del(new /obj/item/weapon/tank/nitrogen(M), slot_back) + M << "\blue You are now running on nitrogen internals from the [M.back] in your suit storage. Your species finds oxygen toxic, so you must breathe nitrogen only." + M.internal = M.back + if (M.internals) + M.internals.icon_state = "internal1" var/sounds = rand(2,10) var/i = 0 diff --git a/code/modules/events/tgevents/anomaly.dm b/code/modules/events/tgevents/anomaly.dm index 3173123f1c6..a30b558d338 100644 --- a/code/modules/events/tgevents/anomaly.dm +++ b/code/modules/events/tgevents/anomaly.dm @@ -5,6 +5,7 @@ /datum/event/anomaly/setup() impact_area = findEventArea() + testing("[impact_area]") /datum/event/anomaly/announce() command_alert("Localized hyper-energetic flux wave detected on long range scanners. Expected location of impact: [impact_area.name].", "Anomaly Alert") diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 29388c4f479..f96c9214f9e 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -72,6 +72,8 @@ if (ismob(AM)) var/mob/tmob = AM + if( istype(tmob, /mob/living/carbon) && prob(10) ) + src.spread_disease_to(AM, "Contact") //BubbleWrap - Should stop you pushing a restrained person out of the way if(istype(tmob, /mob/living/carbon/human)) diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm index 73f0a354c12..21800952777 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -59,6 +59,10 @@ apply_effect(4, WEAKEN, armor_block) return + else + if(istype(M,/mob/living/carbon)) +// log_debug("No gloves, [M] is truing to infect [src]") + M.spread_disease_to(src, "Contact") switch(M.a_intent) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 5ac49d15761..715c45ff944 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -365,6 +365,13 @@ if(breath) loc.assume_air(breath) + //spread some viruses while we are at it + if (virus2.len > 0) + if (get_infection_chance(src) && prob(20)) +// log_debug("[src] : Exhaling some viruses") + for(var/mob/living/carbon/M in view(1,src)) + src.spread_disease_to(M) + proc/get_breath_from_internal(volume_needed) if(internal) @@ -921,11 +928,13 @@ nutrition = max (0, nutrition - HUNGER_FACTOR) if (nutrition > 450) - if(overeatduration < 600) //capped so people don't take forever to unfat + if(overeatduration < 800) //capped so people don't take forever to unfat overeatduration++ +/* else if(overeatduration > 1) overeatduration -= 2 //doubled the unfat rate +*/ if(species.flags & REQUIRE_LIGHT) if(nutrition < 200) @@ -1385,19 +1394,19 @@ V.cure(src) for(var/obj/effect/decal/cleanable/blood/B in view(1,src)) - if(B.virus2.len && get_infection_chance(src)) + if(B.virus2.len) for (var/ID in B.virus2) - var/datum/disease2/disease/V = virus2[ID] + var/datum/disease2/disease/V = B.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)) + if(M.virus2.len) for (var/ID in M.virus2) - var/datum/disease2/disease/V = virus2[ID] + var/datum/disease2/disease/V = M.virus2[ID] infect_virus2(src,V) for(var/obj/effect/decal/cleanable/poop/P in view(1,src)) - if(P.virus2.len && get_infection_chance(src)) + if(P.virus2.len) for (var/ID in P.virus2) - var/datum/disease2/disease/V = virus2[ID] + var/datum/disease2/disease/V = P.virus2[ID] infect_virus2(src,V) for (var/ID in virus2) diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index 366f5bfaad4..d7cbfbd52f5 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -174,19 +174,19 @@ V.cure(src) for(var/obj/effect/decal/cleanable/blood/B in view(1,src)) - if(B.virus2.len && get_infection_chance(src)) + if(B.virus2.len) for (var/ID in B.virus2) - var/datum/disease2/disease/V = virus2[ID] + var/datum/disease2/disease/V = B.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)) + if(M.virus2.len) for (var/ID in M.virus2) - var/datum/disease2/disease/V = virus2[ID] + var/datum/disease2/disease/V = M.virus2[ID] infect_virus2(src,V) for(var/obj/effect/decal/cleanable/poop/P in view(1,src)) - if(P.virus2.len && get_infection_chance(src)) + if(P.virus2.len) for (var/ID in P.virus2) - var/datum/disease2/disease/V = virus2[ID] + var/datum/disease2/disease/V = P.virus2[ID] infect_virus2(src,V) for (var/ID in virus2) diff --git a/code/modules/organs/pain.dm b/code/modules/organs/pain.dm index fed144a39e3..718abbe2726 100644 --- a/code/modules/organs/pain.dm +++ b/code/modules/organs/pain.dm @@ -83,7 +83,7 @@ mob/living/carbon/human/proc/handle_pain() for(var/datum/organ/external/E in organs) // amputated limbs don't cause pain if(E.amputated) continue - + if(E.status & ORGAN_DEAD) continue var/dam = E.get_damage() // make the choice of the organ depend on damage, // but also sometimes use one of the less damaged ones diff --git a/code/modules/reagents/reagent_containers/food/snacks/grown.dm b/code/modules/reagents/reagent_containers/food/snacks/grown.dm index dd3010ca637..c47103e2821 100644 --- a/code/modules/reagents/reagent_containers/food/snacks/grown.dm +++ b/code/modules/reagents/reagent_containers/food/snacks/grown.dm @@ -886,7 +886,7 @@ user.SetLuminosity(round(user.luminosity + (potency/10),1)) /obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/dropped(mob/user) - user.SetLuminosity(round(user.luminosity + (potency/10),1)) + user.SetLuminosity(round(user.luminosity - (potency/10),1)) SetLuminosity(round(potency/10,1)) diff --git a/code/modules/virus2/disease2.dm b/code/modules/virus2/disease2.dm index 810b03e7391..ac5ef88843d 100644 --- a/code/modules/virus2/disease2.dm +++ b/code/modules/virus2/disease2.dm @@ -1,7 +1,7 @@ /datum/disease2/disease - var/infectionchance = 10 + var/infectionchance = 70 var/speed = 1 - var/spreadtype = "Blood" // Can also be "Airborne" + var/spreadtype = "Contact" // Can also be "Airborne" var/stage = 1 var/stageprob = 10 var/dead = 0 @@ -25,10 +25,10 @@ holder.getrandomeffect() effects += holder uniqueID = rand(0,10000) - infectionchance = rand(1,10) + infectionchance = rand(60,90) antigen |= text2num(pick(ANTIGENS)) antigen |= text2num(pick(ANTIGENS)) - spreadtype = "Airborne" + spreadtype = prob(70) ? "Airborne" : "Contact" /datum/disease2/disease/proc/activate(var/mob/living/carbon/mob) if(dead) @@ -38,9 +38,8 @@ 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(prob(5)) + mob.antibodies |= antigen if(mob.radiation > 50) if(prob(1)) majormutate() @@ -65,6 +64,12 @@ for(var/datum/disease2/effectholder/e in effects) e.runeffect(mob,stage) + //Short airborne spread + if(src.spreadtype == "Airborne") + for(var/mob/living/carbon/M in oview(1,mob)) + if(airborne_can_reach(get_turf(mob), get_turf(M))) + infect_virus2(M,src) + //fever mob.bodytemperature = max(mob.bodytemperature, min(310+5*stage ,mob.bodytemperature+5*stage)) clicks+=speed @@ -75,10 +80,10 @@ mob.virus2.Remove("[uniqueID]") /datum/disease2/disease/proc/minormutate() - uniqueID = rand(0,10000) + //uniqueID = rand(0,10000) var/datum/disease2/effectholder/holder = pick(effects) holder.minormutate() - infectionchance = min(10,infectionchance + rand(0,1)) + infectionchance = min(50,infectionchance + rand(0,10)) /datum/disease2/disease/proc/majormutate() uniqueID = rand(0,10000) diff --git a/code/modules/virus2/effect.dm b/code/modules/virus2/effect.dm index 213c743c703..fa70a969ba0 100644 --- a/code/modules/virus2/effect.dm +++ b/code/modules/virus2/effect.dm @@ -134,10 +134,13 @@ 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) + var/organ = pick(list("r_arm","l_arm","r_leg","r_leg")) + var/datum/organ/external/E = H.organs_by_name[organ] if (!(E.status & ORGAN_DEAD)) E.status |= ORGAN_DEAD H << "You can't feel your [E.display_name] anymore..." + for (var/datum/organ/external/C in E.children) + C.status |= ORGAN_DEAD mob.adjustToxLoss(15*multiplier) deactivate(var/mob/living/carbon/mob,var/multiplier) @@ -145,6 +148,8 @@ var/mob/living/carbon/human/H = mob for (var/datum/organ/external/E in H.organs) E.status &= ~ORGAN_DEAD + for (var/datum/organ/external/C in E.children) + C.status &= ~ORGAN_DEAD /datum/disease2/effect/immortal name = "Longevity Syndrome" @@ -285,11 +290,8 @@ 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) + for(var/mob/living/carbon/M in oview(2,mob)) + mob.spread_disease_to(M) /datum/disease2/effect/hungry name = "Appetiser Effect" @@ -320,8 +322,8 @@ stage = 2 activate(var/mob/living/carbon/mob,var/multiplier) mob << "You feel a rush of energy inside you!" - if (mob.reagents.get_reagent_amount("hyperzine") < 30) - mob.reagents.add_reagent("hyperzine", 10) + if (mob.reagents.get_reagent_amount("hyperzine") < 10) + mob.reagents.add_reagent("hyperzine", 4) if (prob(30)) mob.jitteriness += 10 diff --git a/code/modules/virus2/helpers.dm b/code/modules/virus2/helpers.dm index e496018f7e4..b94bb80a9c4 100644 --- a/code/modules/virus2/helpers.dm +++ b/code/modules/virus2/helpers.dm @@ -1,21 +1,26 @@ //Returns 1 if mob can be infected, 0 otherwise. Checks his clothing. -proc/get_infection_chance(var/mob/living/carbon/M) +proc/get_infection_chance(var/mob/living/carbon/M, var/vector = "Airborne") 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 (vector == "Airborne") + if(M.internal) //not breathing infected air helps greatly + score = 30 + if(M.wear_mask) + score += 5 + if(istype(M:wear_mask, /obj/item/clothing/mask/surgical) && !M.internal) + score += 10 + if(istype(M:wear_suit, /obj/item/clothing/suit/space) && istype(M:head, /obj/item/clothing/head/helmet/space)) score += 15 + if(istype(M:wear_suit, /obj/item/clothing/suit/bio_suit) && istype(M:head, /obj/item/clothing/head/bio_hood)) score += 15 + + + if (vector == "Contact") + if(M:gloves) score += 15 + 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 + +// log_debug("[M]'s resistance to [vector] viruses: [score]") if(score >= 30) return 0 @@ -57,14 +62,12 @@ proc/airborne_can_reach(turf/source, turf/target) if(prob(disease.infectionchance) || forced) // certain clothes can prevent an infection - if(!forced && !get_infection_chance(M)) + if(!forced && !get_infection_chance(M, disease.spreadtype)) return var/datum/disease2/disease/D = disease.getcopy() D.minormutate() M.virus2["[D.uniqueID]"] = D - else - message_admins("Virus2 [disease.uniqueID] could not transmit") //Infects mob M with random lesser disease, if he doesn't have one /proc/infect_mob_random_lesser(var/mob/living/carbon/M) @@ -82,3 +85,45 @@ proc/airborne_can_reach(turf/source, turf/target) //Fancy prob() function. /proc/dprob(var/p) return(prob(sqrt(p)) && prob(sqrt(p))) + +/mob/living/carbon/proc/spread_disease_to(var/mob/living/carbon/victim, var/vector = "Airborne") + if (src == victim) + return "retardation" + +// log_debug("Spreading [vector] diseases from [src] to [victim]") + if (virus2.len > 0) + for (var/ID in virus2) + log_debug("Attempting virus [ID]") + var/datum/disease2/disease/V = virus2[ID] + if(V.spreadtype != vector) continue + + if (vector == "Airborne") + if(airborne_can_reach(get_turf(src), get_turf(victim))) +// log_debug("In range, infecting") + infect_virus2(victim,V) +// else +// log_debug("Could not reach target") + + if (vector == "Contact") + if (in_range(src, victim)) +// log_debug("In range, infecting") + infect_virus2(victim,V) + +//contact goes both ways + if (victim.virus2.len > 0 && vector == "Contact") +// log_debug("Spreading [vector] diseases from [victim] to [src]") + var/nudity = 1 + + if (ishuman(victim)) + var/mob/living/carbon/human/H = victim + var/datum/organ/external/select_area = H.get_organ(src.zone_sel.selecting) + var/list/clothes = list(H.head, H.wear_mask, H.wear_suit, H.w_uniform, H.gloves, H.shoes) + for(var/obj/item/clothing/C in clothes ) + if(C && istype(C)) + if(C.body_parts_covered & select_area.body_part) + nudity = 0 + if (nudity) + for (var/ID in victim.virus2) + var/datum/disease2/disease/V = victim.virus2[ID] + if(V && V.spreadtype != vector) continue + infect_virus2(src,V) \ No newline at end of file diff --git a/code/modules/virus2/items_devices.dm b/code/modules/virus2/items_devices.dm index 27b01513ea5..5e067f92adc 100644 --- a/code/modules/virus2/items_devices.dm +++ b/code/modules/virus2/items_devices.dm @@ -53,8 +53,8 @@ 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)) + for(var/mob/living/carbon/target in view(1, get_turf(src))) + if(airborne_can_reach(get_turf(src), get_turf(target))) if(get_infection_chance(target)) infect_virus2(target,src.virus2) del src diff --git a/code/setup.dm b/code/setup.dm index 7d1d2fe09b0..876b1ed0639 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -187,6 +187,7 @@ var/MAX_EXPLOSION_RANGE = 14 #define CONDUCT 64 // conducts electricity (metal etc.) #define FPRINT 256 // takes a fingerprint #define ON_BORDER 512 // item has priority to check when entering or leaving +#define NOBLOODY 2048 // used to items if they don't want to get a blood overlay #define GLASSESCOVERSEYES 1024 #define MASKCOVERSEYES 1024 // get rid of some of the other retardation in these flags diff --git a/code/world.dm b/code/world.dm index 91bb972e336..9b68d62a55c 100644 --- a/code/world.dm +++ b/code/world.dm @@ -173,17 +173,27 @@ #define INACTIVITY_KICK 6000 //10 minutes in ticks (approx.) /world/proc/KickInactiveClients() - spawn(-1) - set background = 1 - while(1) - sleep(INACTIVITY_KICK) - for(var/client/C in clients) - if(C.holder) return - if(C.is_afk(INACTIVITY_KICK)) - if(!istype(C.mob, /mob/dead)) - log_access("AFK: [key_name(C)]") - C << "\red You have been inactive for more than 10 minutes and have been disconnected." - del(C) + var/tmp/sleep_check = 0 // buffer for checking elapsed ticks + var/tmp/work_length = 2 // number of ticks to run before yielding cpu + var/tmp/sleep_length = 5 // number of ticks to yield + var/waiting=1 + + sleep_check = world.timeofday + + while(waiting) + waiting = 0 + sleep(INACTIVITY_KICK) + for(var/client/C in clients) + if(C.holder) return + if(C.is_afk(INACTIVITY_KICK)) + if(!istype(C.mob, /mob/dead)) + log_access("AFK: [key_name(C)]") + C << "\red You have been inactive for more than 10 minutes and have been disconnected." + del(C) + if ( ((world.timeofday - sleep_check) > work_length) || ((world.timeofday - sleep_check) < 0) ) + sleep(sleep_length) + sleep_check = world.timeofday + waiting++ #undef INACTIVITY_KICK /* #define DISCONNECTED_DELETE 6000 //10 minutes in ticks (approx) diff --git a/maps/tgstation-redux-WIP.dmm b/maps/tgstation-redux-WIP.dmm index dc4d8fc4bdc..5b19ee3204b 100644 --- a/maps/tgstation-redux-WIP.dmm +++ b/maps/tgstation-redux-WIP.dmm @@ -2951,7 +2951,7 @@ "beM" = (/obj/structure/sign/redcross{desc = "The Star of Life, a symbol of Medical Aid."; icon_state = "lifestar"; name = "Medbay"},/turf/simulated/wall,/area) "beN" = (/obj/machinery/door/firedoor,/turf/simulated/floor{tag = "icon-warnwhite (NORTH)"; icon_state = "warnwhite"; dir = 1},/area/medical/reception) "beO" = (/turf/simulated/wall,/area/medical/morgue) -"beP" = (/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; tag = ""},/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; tag = ""},/obj/structure/disposalpipe/segment,/obj/machinery/door/firedoor,/obj/machinery/door/airlock/medical{name = "Morgue"; req_access_txt = "6;9"},/turf/simulated/floor,/area/medical/morgue) +"beP" = (/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; tag = ""},/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; tag = ""},/obj/structure/disposalpipe/segment,/obj/machinery/door/firedoor,/obj/machinery/door/airlock/medical{name = "Morgue"; req_access_txt = "0"; req_one_access_txt = "6,9"},/turf/simulated/floor,/area/medical/morgue) "beQ" = (/obj/machinery/firealarm,/turf/simulated/wall,/area/medical/morgue) "beR" = (/obj/machinery/door/airlock{name = "Starboard Emergency Storage"; req_access_txt = "0"},/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; tag = ""},/obj/structure/disposalpipe/segment,/turf/simulated/floor/plating,/area/maintenance/asmaint) "beS" = (/turf/simulated/floor{dir = 1; icon_state = "loadingarea"; tag = "loading"},/area/hallway/primary/starboard) @@ -3004,7 +3004,7 @@ "bfN" = (/obj/structure/table/woodentable,/obj/item/device/eftpos{eftpos_name = "Captain EFTPOS scanner"},/turf/simulated/floor/wood,/area/crew_quarters/captain) "bfO" = (/obj/structure/table/woodentable,/obj/item/weapon/melee/chainofcommand,/obj/machinery/alarm{dir = 8; icon_state = "alarm0"; pixel_x = 24},/turf/simulated/floor/wood,/area/crew_quarters/captain) "bfP" = (/obj/machinery/firealarm{dir = 4; pixel_x = 24},/turf/simulated/floor,/area/hallway/primary/central) -"bfQ" = (/obj/structure/table/reinforced,/obj/item/weapon/reagent_containers/dropper,/obj/item/weapon/reagent_containers/dropper,/obj/machinery/light{dir = 8},/turf/simulated/floor{icon_state = "white"},/area/medical/chemistry) +"bfQ" = (/obj/machinery/chem_master,/turf/simulated/floor{icon_state = "white"},/area/medical/chemistry) "bfR" = (/obj/machinery/chem_dispenser,/turf/simulated/floor{icon_state = "white"},/area/medical/chemistry) "bfS" = (/obj/structure/table/reinforced,/obj/item/weapon/storage/box/beakers,/obj/item/weapon/storage/box/beakers,/obj/item/weapon/reagent_containers/dropper,/obj/machinery/camera{c_tag = "Chemistry"; network = list("SS13")},/obj/structure/extinguisher_cabinet{pixel_x = 0; pixel_y = 30},/turf/simulated/floor{icon_state = "white"},/area/medical/chemistry) "bfT" = (/obj/structure/table/reinforced,/obj/item/stack/sheet/mineral/plasma,/turf/simulated/floor{icon_state = "white"},/area/medical/chemistry) @@ -3080,7 +3080,7 @@ "bhl" = (/obj/structure/disposalpipe/segment,/obj/machinery/atmospherics/pipe/simple/supply/hidden{dir = 4},/turf/simulated/floor{dir = 8; icon_state = "bluecorner"},/area/hallway/primary/central) "bhm" = (/obj/machinery/atmospherics/pipe/simple/supply/hidden{dir = 4},/turf/simulated/floor,/area/hallway/primary/central) "bhn" = (/obj/machinery/atmospherics/unary/vent_pump{dir = 8; on = 1},/turf/simulated/floor,/area/hallway/primary/central) -"bho" = (/obj/structure/table/reinforced,/obj/item/weapon/reagent_containers/glass/beaker/large,/obj/item/weapon/reagent_containers/glass/beaker/large,/turf/simulated/floor{icon_state = "white"},/area/medical/chemistry) +"bho" = (/obj/structure/table/reinforced,/obj/item/weapon/reagent_containers/glass/beaker/large,/obj/item/weapon/reagent_containers/glass/beaker/large,/obj/item/weapon/reagent_containers/dropper,/turf/simulated/floor{icon_state = "white"},/area/medical/chemistry) "bhp" = (/obj/structure/stool,/obj/effect/landmark/start{name = "Chemist"},/obj/machinery/atmospherics/unary/vent_pump{dir = 4; external_pressure_bound = 101.325; on = 1; pressure_checks = 1},/turf/simulated/floor{icon_state = "white"},/area/medical/chemistry) "bhq" = (/obj/machinery/atmospherics/pipe/simple/supply/hidden{dir = 10},/turf/simulated/floor{icon_state = "white"},/area/medical/chemistry) "bhr" = (/obj/machinery/atmospherics/unary/vent_scrubber{on = 1; scrub_N2O = 1; scrub_Toxins = 1},/turf/simulated/floor{icon_state = "white"},/area/medical/chemistry) @@ -3172,9 +3172,9 @@ "biZ" = (/obj/machinery/atmospherics/pipe/manifold{color = "blue"; dir = 4; icon_state = "manifold-b-f"; initialize_directions = 11; level = 1; name = "pipe manifold"},/turf/simulated/wall/r_wall,/area) "bja" = (/obj/machinery/light{dir = 8},/obj/structure/disposalpipe/segment,/turf/simulated/floor{dir = 8; icon_state = "bluecorner"},/area/hallway/primary/central) "bjb" = (/obj/structure/table/reinforced,/obj/item/clothing/glasses/science,/obj/item/clothing/glasses/science,/obj/item/clothing/glasses/science,/obj/machinery/alarm{dir = 4; icon_state = "alarm0"; pixel_x = -22},/turf/simulated/floor{icon_state = "white"},/area/medical/chemistry) -"bjc" = (/obj/machinery/chem_master,/turf/simulated/floor{icon_state = "white"},/area/medical/chemistry) -"bjd" = (/obj/machinery/chem_master,/obj/machinery/atmospherics/pipe/simple/supply/hidden,/turf/simulated/floor{icon_state = "white"},/area/medical/chemistry) -"bje" = (/obj/machinery/atmospherics/pipe/simple/scrubbers/hidden,/turf/simulated/floor{icon_state = "white"},/area/medical/chemistry) +"bjc" = (/obj/machinery/disposal,/obj/structure/disposalpipe/trunk{dir = 4},/turf/simulated/floor{icon_state = "white"},/area/medical/chemistry) +"bjd" = (/obj/machinery/atmospherics/pipe/simple/supply/hidden,/obj/structure/disposalpipe/segment{dir = 4},/turf/simulated/floor{icon_state = "white"},/area/medical/chemistry) +"bje" = (/obj/machinery/atmospherics/pipe/simple/scrubbers/hidden,/obj/structure/disposalpipe/segment{dir = 2; icon_state = "pipe-c"},/turf/simulated/floor{icon_state = "white"},/area/medical/chemistry) "bjf" = (/obj/structure/table/reinforced,/obj/item/weapon/hand_labeler,/obj/item/weapon/reagent_containers/spray/cleaner{desc = "Someone has crossed out the 'Space' from Space Cleaner and written in Chemistry. Scrawled on the back is, 'Okay, whoever filled this with polytrinic acid, it was only funny the first time. It was hard enough replacing the CMO's first cat!'"; name = "Chemistry Cleaner"},/obj/item/device/radio/intercom{freerange = 1; frequency = 1459; name = "Station Intercom (General)"; pixel_x = 30},/turf/simulated/floor{icon_state = "white"},/area/medical/chemistry) "bjg" = (/obj/machinery/atmospherics/unary/vent_pump,/turf/simulated/floor{tag = "icon-whiteblue (EAST)"; icon_state = "whiteblue"; dir = 4},/area/medical/reception) "bjh" = (/obj/machinery/door/firedoor/border_only{dir = 8; name = "Firelock West"},/obj/machinery/door/airlock/medical{name = "Examination room"; req_access_txt = "5"},/turf/simulated/floor{tag = "icon-whitebluefull"; icon_state = "whitebluefull"},/area/medical/exam_room) @@ -3245,10 +3245,10 @@ "bku" = (/obj/machinery/door/airlock/maintenance{name = "Captain's Office Maintenance"; req_access_txt = "20"},/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; tag = ""},/turf/simulated/floor/plating,/area/crew_quarters/captain) "bkv" = (/obj/structure/disposalpipe/segment,/obj/structure/extinguisher_cabinet{pixel_x = -27; pixel_y = 1},/turf/simulated/floor,/area/hallway/primary/central) "bkw" = (/obj/machinery/atmospherics/unary/vent_scrubber{dir = 4; icon_state = "off"; on = 1; scrub_N2O = 1; scrub_Toxins = 1},/turf/simulated/floor,/area/hallway/primary/central) -"bkx" = (/obj/structure/table/reinforced,/obj/item/weapon/reagent_containers/glass/beaker/large,/obj/item/weapon/reagent_containers/glass/beaker/large,/obj/machinery/atmospherics/pipe/simple/scrubbers/hidden{dir = 4},/obj/machinery/firealarm{dir = 8; pixel_x = -24},/turf/simulated/floor{icon_state = "white"},/area/medical/chemistry) +"bkx" = (/obj/structure/table/reinforced,/obj/item/weapon/reagent_containers/glass/beaker/large,/obj/item/weapon/reagent_containers/glass/beaker/large,/obj/machinery/atmospherics/pipe/simple/scrubbers/hidden{dir = 4},/obj/machinery/firealarm{dir = 8; pixel_x = -24},/obj/item/weapon/reagent_containers/dropper,/turf/simulated/floor{icon_state = "white"},/area/medical/chemistry) "bky" = (/obj/structure/stool,/obj/effect/landmark/start{name = "Chemist"},/obj/machinery/atmospherics/pipe/simple/scrubbers/hidden{dir = 4},/turf/simulated/floor{icon_state = "white"},/area/medical/chemistry) "bkz" = (/obj/machinery/atmospherics/pipe/simple/supply/hidden,/obj/machinery/atmospherics/pipe/simple/scrubbers/hidden{dir = 4},/turf/simulated/floor{icon_state = "white"},/area/medical/chemistry) -"bkA" = (/obj/machinery/atmospherics/pipe/manifold{color = "red"; dir = 4; icon_state = "manifold-r-f"; initialize_directions = 11; level = 1; name = "pipe manifold"},/turf/simulated/floor{icon_state = "white"},/area/medical/chemistry) +"bkA" = (/obj/machinery/atmospherics/pipe/manifold{color = "red"; dir = 4; icon_state = "manifold-r-f"; initialize_directions = 11; level = 1; name = "pipe manifold"},/obj/structure/disposalpipe/segment,/turf/simulated/floor{icon_state = "white"},/area/medical/chemistry) "bkB" = (/obj/structure/table/reinforced,/obj/item/weapon/storage/box/syringes,/turf/simulated/floor{icon_state = "white"},/area/medical/chemistry) "bkC" = (/obj/item/device/radio/intercom{dir = 0; name = "Station Intercom (General)"; pixel_x = -27},/turf/simulated/floor{tag = "icon-whiteblue (WEST)"; icon_state = "whiteblue"; dir = 8},/area/medical/reception) "bkD" = (/obj/machinery/atmospherics/unary/vent_scrubber{on = 1; scrub_N2O = 1; scrub_Toxins = 1},/turf/simulated/floor{icon_state = "white"},/area/medical/reception) @@ -3311,8 +3311,8 @@ "blI" = (/obj/structure/sink{dir = 4; icon_state = "sink"; pixel_x = 11; pixel_y = 0},/obj/structure/mirror{pixel_x = 28},/obj/machinery/light{dir = 1},/obj/machinery/atmospherics/pipe/simple/supply/hidden{dir = 4},/turf/simulated/floor{icon_state = "freezerfloor"},/area/crew_quarters/captain) "blJ" = (/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; tag = ""},/obj/machinery/atmospherics/pipe/simple/supply/hidden{dir = 4},/turf/simulated/floor/plating,/area/crew_quarters/captain) "blK" = (/obj/structure/disposalpipe/segment,/turf/simulated/floor,/area/hallway/primary/central) -"blL" = (/obj/machinery/disposal,/obj/structure/disposalpipe/trunk{dir = 4},/obj/machinery/atmospherics/pipe/simple/supply/hidden,/turf/simulated/floor{icon_state = "white"},/area/medical/chemistry) -"blM" = (/obj/structure/disposalpipe/segment{dir = 2; icon_state = "pipe-c"},/obj/machinery/atmospherics/pipe/simple/scrubbers/hidden,/turf/simulated/floor{icon_state = "white"},/area/medical/chemistry) +"blL" = (/obj/machinery/atmospherics/pipe/simple/supply/hidden,/turf/simulated/floor{icon_state = "white"},/area/medical/chemistry) +"blM" = (/obj/machinery/atmospherics/pipe/simple/scrubbers/hidden,/obj/structure/disposalpipe/segment,/turf/simulated/floor{icon_state = "white"},/area/medical/chemistry) "blN" = (/obj/machinery/light{dir = 4; icon_state = "tube1"},/obj/structure/table/reinforced,/obj/item/weapon/packageWrap,/obj/item/device/mass_spectrometer,/turf/simulated/floor{icon_state = "white"},/area/medical/chemistry) "blO" = (/obj/structure/sign/redcross{desc = "The Star of Life, a symbol of Medical Aid."; icon_state = "lifestar"; name = "Medbay"},/turf/simulated/wall/r_wall,/area) "blP" = (/turf/simulated/floor{tag = "icon-whiteblue (SOUTHWEST)"; icon_state = "whiteblue"; dir = 10},/area/medical/reception) @@ -3410,7 +3410,7 @@ "bnD" = (/obj/structure/cable{d1 = 4; d2 = 8; icon_state = "4-8"; pixel_x = 0; tag = ""},/turf/simulated/floor{icon_state = "loadingarea"; tag = "loading"},/area/medical/reception) "bnE" = (/obj/structure/cable{d1 = 2; d2 = 8; icon_state = "2-8"; tag = ""},/obj/machinery/atmospherics/pipe/simple/supply/hidden,/turf/simulated/floor{icon_state = "loadingarea"; tag = "loading"},/area/medical/reception) "bnF" = (/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; tag = ""},/obj/structure/disposalpipe/segment,/obj/machinery/door/firedoor,/obj/machinery/door/airlock/glass_medical{id_tag = null; name = "Examination Room"; req_access_txt = "5"},/turf/simulated/floor{icon_state = "white"},/area/medical/medbay2) -"bnG" = (/obj/structure/disposalpipe/segment,/obj/machinery/door/airlock/medical{name = "Morgue"; req_access_txt = "6"},/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; tag = ""},/turf/simulated/floor{icon_state = "white"},/area/medical/medbay2) +"bnG" = (/obj/structure/disposalpipe/segment,/obj/machinery/door/airlock/medical{name = "Morgue"; req_access_txt = "0"; req_one_access_txt = "6,9"},/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; tag = ""},/turf/simulated/floor{icon_state = "white"},/area/medical/medbay2) "bnH" = (/obj/machinery/firealarm,/turf/simulated/wall,/area) "bnI" = (/obj/structure/disposalpipe/segment{dir = 4; icon_state = "pipe-c"},/turf/simulated/wall,/area) "bnJ" = (/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; tag = ""},/obj/structure/disposalpipe/segment{dir = 8; icon_state = "pipe-c"},/turf/simulated/floor/plating,/area/maintenance/asmaint)