diff --git a/_maps/map_files/MetaStation.v39K.dmm b/_maps/map_files/MetaStation.v39K.dmm index 6c657034541..036beee3a6f 100644 --- a/_maps/map_files/MetaStation.v39K.dmm +++ b/_maps/map_files/MetaStation.v39K.dmm @@ -965,7 +965,7 @@ "asC" = (/obj/machinery/atmospherics/pipe/manifold{dir = 4; icon_state = "manifold"; level = 2},/obj/machinery/meter,/turf/simulated/floor{icon_state = "dark"},/area/prison/solitary{name = "Prisoner Education Chamber"}) "asD" = (/obj/machinery/door/airlock/security{name = "Prisoner Education Chamber"; req_access = null; req_access_txt = "3"},/turf/simulated/floor/plating,/area/prison/solitary{name = "Prisoner Education Chamber"}) "asE" = (/turf/simulated/floor/plating{icon_state = "warnplate"; dir = 4},/area/security/prison) -"asF" = (/obj/item/weapon/caution/cone,/turf/simulated/floor/plating{tag = "icon-panelscorched"; icon_state = "panelscorched"},/area/maintenance/fpmaint2{name = "Port Maintenance"}) +"asF" = (/obj/item/clothing/head/cone,/turf/simulated/floor/plating{tag = "icon-panelscorched"; icon_state = "panelscorched"},/area/maintenance/fpmaint2{name = "Port Maintenance"}) "asG" = (/obj/machinery/atmospherics/pipe/simple{dir = 6; icon_state = "intact"; level = 2},/obj/structure/window/reinforced{dir = 8},/turf/simulated/floor{icon_state = "dark"},/area/prison/solitary{name = "Prisoner Education Chamber"}) "asH" = (/obj/structure/rack,/obj/item/weapon/tank/oxygen/red{pixel_x = -4; pixel_y = -1},/obj/item/weapon/tank/oxygen/red{pixel_x = 4; pixel_y = -1},/obj/item/weapon/tank/anesthetic{pixel_x = 2},/obj/item/weapon/wrench,/obj/item/clothing/mask/gas,/obj/item/clothing/mask/gas,/turf/simulated/floor{icon_state = "dark"},/area/prison/solitary{name = "Prisoner Education Chamber"}) "asI" = (/obj/structure/cable/yellow{d1 = 1; d2 = 2; icon_state = "1-2"},/turf/simulated/floor{icon_state = "dark"},/area/prison/solitary{name = "Prisoner Education Chamber"}) diff --git a/code/__DEFINES/flags.dm b/code/__DEFINES/flags.dm index 954cf9c3c6c..805a1627251 100644 --- a/code/__DEFINES/flags.dm +++ b/code/__DEFINES/flags.dm @@ -49,6 +49,7 @@ #define PASSGLASS 2 #define PASSGRILLE 4 #define PASSBLOB 8 +#define PASSMOB 16 //flags for species diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index 96dca1bb1f0..256aee3b322 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -311,57 +311,20 @@ return M return null -// Will poll ghosts for volunteers -/proc/get_candidates(be_special_flag=0, rolename=null, wait_time=200) - var/list/mob/dead/observer/volunteers = list() - var/list/client/candidates = list() - var/time_passed = world.time - - for(var/mob/dead/observer/G in player_list) - spawn(0) - if(!G.client) - return - if((G.client.prefs.be_special & be_special_flag) && !jobban_isbanned(G, get_roletext(be_special_flag)) || (be_special_flag < 0)) - switch(alert(G,"Do you want to be considered to be a [rolename ? rolename : get_roletext(be_special_flag)]?","Please answer in [wait_time/10] seconds!","Yes","No")) - if("Yes") - if((world.time-time_passed)>wait_time) - return - volunteers += G - if("No") - return - else - return - sleep(wait_time) - - for(var/mob/dead/observer/G in volunteers) - if(G.client) - candidates += G.client +// Will return a list of active candidates. It increases the buffer 5 times until it finds a candidate which is active within the buffer. +/proc/get_candidates(be_special_flag=0, afk_bracket=3000) + var/list/candidates = list() + // Keep looping until we find a non-afk candidate within the time bracket (we limit the bracket to 10 minutes (6000)) + while(!candidates.len && afk_bracket < 6000) + for(var/mob/dead/observer/G in player_list) + if(G.client != null) + if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD)) + if(!G.client.is_afk(afk_bracket) && (G.client.prefs.be_special & be_special_flag)) + candidates += G.client + afk_bracket += 600 // Add a minute to the bracket, for every attempt return candidates -/proc/pick_from_candidates(be_special_flag=0, rolename=null, wait_time=200) - var/list/candidates = get_candidates(be_special_flag, rolename, wait_time) - if(candidates.len) - var/client/C = pick(candidates) - return C - return 0 //Unable to find a valid candidate - - -/proc/get_roletext(role) //Translates role flag to role text - var/roletext - switch(role) - if(BE_CHANGELING) roletext="changeling" - if(BE_TRAITOR) roletext="traitor" - if(BE_OPERATIVE) roletext="operative" - if(BE_WIZARD) roletext="wizard" - if(BE_REV) roletext="revolutionary" - if(BE_GANG) roletext="gangster" - if(BE_CULTIST) roletext="cultist" - if(BE_MONKEY) roletext="monkey" - if(BE_NINJA) roletext="ninja" - if(BE_ALIEN) roletext="alien" - return roletext - /proc/ScreenText(obj/O, maptext="", screen_loc="CENTER-7,CENTER-7", maptext_height=480, maptext_width=480) if(!isobj(O)) O = new /obj/screen/text() O.maptext = maptext diff --git a/code/datums/disease.dm b/code/datums/disease.dm index 3a37ce32022..84267f8631d 100644 --- a/code/datums/disease.dm +++ b/code/datums/disease.dm @@ -52,6 +52,8 @@ var/list/diseases = typesof(/datum/disease) - /datum/disease var/requires = 0 var/list/required_limb = list() + var/const/non_threat = "Non-Threat" + /datum/disease/proc/stage_act() var/cure_present = has_cure() diff --git a/code/datums/diseases/advance/advance.dm b/code/datums/diseases/advance/advance.dm index 52e20c2c07b..b356109b1b2 100644 --- a/code/datums/diseases/advance/advance.dm +++ b/code/datums/diseases/advance/advance.dm @@ -182,7 +182,7 @@ var/list/advance_cures = list( CRASH("We did not have any symptoms before generating properties.") return - var/list/properties = list("resistance" = 1, "stealth" = 1, "stage_rate" = 1, "transmittable" = 1, "severity" = 1) + var/list/properties = list("resistance" = 1, "stealth" = 1, "stage_rate" = 1, "transmittable" = 1, "severity" = 0) for(var/datum/symptom/S in symptoms) @@ -190,7 +190,7 @@ var/list/advance_cures = list( properties["stealth"] += S.stealth properties["stage_rate"] += S.stage_speed properties["transmittable"] += S.transmittable - properties["severity"] = max(properties["severity"], S.level) // severity is based on the highest level symptom + properties["severity"] = max(properties["severity"], S.severity) // severity is based on the highest severity symptom return properties @@ -234,7 +234,7 @@ var/list/advance_cures = list( switch(level_sev) if(-INFINITY to 0) - severity = "Non-Threat" + severity = non_threat if(1) severity = "Minor" if(2) diff --git a/code/datums/diseases/advance/symptoms/beard.dm b/code/datums/diseases/advance/symptoms/beard.dm index 3ef4df27119..d56c8421f2d 100644 --- a/code/datums/diseases/advance/symptoms/beard.dm +++ b/code/datums/diseases/advance/symptoms/beard.dm @@ -22,6 +22,7 @@ BONUS stage_speed = -3 transmittable = -1 level = 4 + severity = 1 /datum/symptom/beard/Activate(var/datum/disease/advance/A) ..() diff --git a/code/datums/diseases/advance/symptoms/choking.dm b/code/datums/diseases/advance/symptoms/choking.dm index f5b21f08dca..e068adf4835 100644 --- a/code/datums/diseases/advance/symptoms/choking.dm +++ b/code/datums/diseases/advance/symptoms/choking.dm @@ -23,6 +23,7 @@ Bonus stage_speed = -2 transmittable = -4 level = 3 + severity = 3 /datum/symptom/choking/Activate(var/datum/disease/advance/A) ..() diff --git a/code/datums/diseases/advance/symptoms/confusion.dm b/code/datums/diseases/advance/symptoms/confusion.dm index 9bc2b6769c2..0fbc941a32f 100644 --- a/code/datums/diseases/advance/symptoms/confusion.dm +++ b/code/datums/diseases/advance/symptoms/confusion.dm @@ -23,6 +23,7 @@ Bonus stage_speed = -3 transmittable = 0 level = 4 + severity = 2 /datum/symptom/confusion/Activate(var/datum/disease/advance/A) diff --git a/code/datums/diseases/advance/symptoms/cough.dm b/code/datums/diseases/advance/symptoms/cough.dm index 5e0675c40c4..2c50271aa92 100644 --- a/code/datums/diseases/advance/symptoms/cough.dm +++ b/code/datums/diseases/advance/symptoms/cough.dm @@ -23,6 +23,7 @@ BONUS stage_speed = 1 transmittable = 2 level = 1 + severity = 1 /datum/symptom/cough/Activate(var/datum/disease/advance/A) ..() diff --git a/code/datums/diseases/advance/symptoms/deafness.dm b/code/datums/diseases/advance/symptoms/deafness.dm index 2b210fc1f60..a5394222876 100644 --- a/code/datums/diseases/advance/symptoms/deafness.dm +++ b/code/datums/diseases/advance/symptoms/deafness.dm @@ -23,6 +23,7 @@ Bonus stage_speed = -1 transmittable = -3 level = 4 + severity = 3 /datum/symptom/deafness/Activate(var/datum/disease/advance/A) ..() diff --git a/code/datums/diseases/advance/symptoms/dizzy.dm b/code/datums/diseases/advance/symptoms/dizzy.dm index 14a01866ff4..a7109a316ac 100644 --- a/code/datums/diseases/advance/symptoms/dizzy.dm +++ b/code/datums/diseases/advance/symptoms/dizzy.dm @@ -23,6 +23,7 @@ Bonus stage_speed = -3 transmittable = -1 level = 4 + severity = 2 /datum/symptom/dizzy/Activate(var/datum/disease/advance/A) ..() diff --git a/code/datums/diseases/advance/symptoms/fever.dm b/code/datums/diseases/advance/symptoms/fever.dm index f24e789810f..749bab09fea 100644 --- a/code/datums/diseases/advance/symptoms/fever.dm +++ b/code/datums/diseases/advance/symptoms/fever.dm @@ -23,6 +23,7 @@ Bonus stage_speed = 3 transmittable = 2 level = 2 + severity = 2 /datum/symptom/fever/Activate(var/datum/disease/advance/A) ..() diff --git a/code/datums/diseases/advance/symptoms/flesh_eating.dm b/code/datums/diseases/advance/symptoms/flesh_eating.dm index 2d8a9027613..8c71d05f2bd 100644 --- a/code/datums/diseases/advance/symptoms/flesh_eating.dm +++ b/code/datums/diseases/advance/symptoms/flesh_eating.dm @@ -23,6 +23,7 @@ Bonus stage_speed = 0 transmittable = -4 level = 6 + severity = 5 /datum/symptom/flesh_eating/Activate(var/datum/disease/advance/A) ..() diff --git a/code/datums/diseases/advance/symptoms/genetics.dm b/code/datums/diseases/advance/symptoms/genetics.dm index fdf3975ecba..065bf9d3ed1 100644 --- a/code/datums/diseases/advance/symptoms/genetics.dm +++ b/code/datums/diseases/advance/symptoms/genetics.dm @@ -23,6 +23,7 @@ Bonus stage_speed = 0 transmittable = -3 level = 6 + severity = 3 var/good_mutations = 0 var/archived_dna = null @@ -78,4 +79,5 @@ Bonus stage_speed = -7 transmittable = -7 level = 6 - good_mutations = 1 \ No newline at end of file + good_mutations = 1 + severity = 0 \ No newline at end of file diff --git a/code/datums/diseases/advance/symptoms/hallucigen.dm b/code/datums/diseases/advance/symptoms/hallucigen.dm index 5e0f0aa4731..4854b8d3261 100644 --- a/code/datums/diseases/advance/symptoms/hallucigen.dm +++ b/code/datums/diseases/advance/symptoms/hallucigen.dm @@ -23,6 +23,7 @@ Bonus stage_speed = -3 transmittable = -1 level = 5 + severity = 3 /datum/symptom/hallucigen/Activate(var/datum/disease/advance/A) ..() diff --git a/code/datums/diseases/advance/symptoms/headache.dm b/code/datums/diseases/advance/symptoms/headache.dm index 691b7bf3122..abbb0c44f9b 100644 --- a/code/datums/diseases/advance/symptoms/headache.dm +++ b/code/datums/diseases/advance/symptoms/headache.dm @@ -24,6 +24,7 @@ BONUS stage_speed = 2 transmittable = 0 level = 1 + severity = 1 /datum/symptom/headache/Activate(var/datum/disease/advance/A) ..() diff --git a/code/datums/diseases/advance/symptoms/itching.dm b/code/datums/diseases/advance/symptoms/itching.dm index f4b69c364ab..e7302c4345a 100644 --- a/code/datums/diseases/advance/symptoms/itching.dm +++ b/code/datums/diseases/advance/symptoms/itching.dm @@ -24,6 +24,7 @@ BONUS stage_speed = 3 transmittable = 1 level = 1 + severity = 1 /datum/symptom/itching/Activate(var/datum/disease/advance/A) ..() diff --git a/code/datums/diseases/advance/symptoms/shedding.dm b/code/datums/diseases/advance/symptoms/shedding.dm index 69ffefad263..d1c2317b868 100644 --- a/code/datums/diseases/advance/symptoms/shedding.dm +++ b/code/datums/diseases/advance/symptoms/shedding.dm @@ -22,6 +22,7 @@ BONUS stage_speed = -1 transmittable = 2 level = 4 + severity = 1 /datum/symptom/shedding/Activate(var/datum/disease/advance/A) ..() diff --git a/code/datums/diseases/advance/symptoms/shivering.dm b/code/datums/diseases/advance/symptoms/shivering.dm index e87b395b13a..ac13329d12c 100644 --- a/code/datums/diseases/advance/symptoms/shivering.dm +++ b/code/datums/diseases/advance/symptoms/shivering.dm @@ -23,6 +23,7 @@ Bonus stage_speed = 2 transmittable = 2 level = 2 + severity = 2 /datum/symptom/shivering/Activate(var/datum/disease/advance/A) ..() diff --git a/code/datums/diseases/advance/symptoms/sneeze.dm b/code/datums/diseases/advance/symptoms/sneeze.dm index 155e71839a4..f26a0c78b66 100644 --- a/code/datums/diseases/advance/symptoms/sneeze.dm +++ b/code/datums/diseases/advance/symptoms/sneeze.dm @@ -24,6 +24,7 @@ Bonus stage_speed = 0 transmittable = 4 level = 1 + severity = 1 /datum/symptom/sneeze/Activate(var/datum/disease/advance/A) ..() diff --git a/code/datums/diseases/advance/symptoms/symptoms.dm b/code/datums/diseases/advance/symptoms/symptoms.dm index 349809b973e..4b06cb505db 100644 --- a/code/datums/diseases/advance/symptoms/symptoms.dm +++ b/code/datums/diseases/advance/symptoms/symptoms.dm @@ -12,8 +12,10 @@ var/global/const/SYMPTOM_ACTIVATION_PROB = 3 var/resistance = 0 var/stage_speed = 0 var/transmittable = 0 - // The type level of the symptom. Higher is more lethal and harder to generate. + // The type level of the symptom. Higher is harder to generate. var/level = 0 + // The severity level of the symptom. Higher is more dangerous. + var/severity = 0 // The hash tag for our diseases, we will add it up with our other symptoms to get a unique id! ID MUST BE UNIQUE!!! var/id = "" diff --git a/code/datums/diseases/advance/symptoms/visionloss.dm b/code/datums/diseases/advance/symptoms/visionloss.dm index 466809d32e8..47303b9643a 100644 --- a/code/datums/diseases/advance/symptoms/visionloss.dm +++ b/code/datums/diseases/advance/symptoms/visionloss.dm @@ -23,6 +23,7 @@ Bonus stage_speed = -4 transmittable = -3 level = 5 + severity = 4 /datum/symptom/visionloss/Activate(var/datum/disease/advance/A) ..() diff --git a/code/datums/diseases/advance/symptoms/vitiligo.dm b/code/datums/diseases/advance/symptoms/vitiligo.dm index 21036166dbe..e24be2c36b5 100644 --- a/code/datums/diseases/advance/symptoms/vitiligo.dm +++ b/code/datums/diseases/advance/symptoms/vitiligo.dm @@ -22,6 +22,7 @@ BONUS stage_speed = -1 transmittable = -2 level = 5 + severity = 1 /datum/symptom/vitiligo/Activate(var/datum/disease/advance/A) ..() diff --git a/code/datums/diseases/advance/symptoms/voice_change.dm b/code/datums/diseases/advance/symptoms/voice_change.dm index 655cbc65c10..02f352f3550 100644 --- a/code/datums/diseases/advance/symptoms/voice_change.dm +++ b/code/datums/diseases/advance/symptoms/voice_change.dm @@ -23,6 +23,7 @@ Bonus stage_speed = -3 transmittable = -1 level = 6 + severity = 2 /datum/symptom/voice_change/Activate(var/datum/disease/advance/A) ..() diff --git a/code/datums/diseases/advance/symptoms/vomit.dm b/code/datums/diseases/advance/symptoms/vomit.dm index 79a3d82c7c4..67f53564deb 100644 --- a/code/datums/diseases/advance/symptoms/vomit.dm +++ b/code/datums/diseases/advance/symptoms/vomit.dm @@ -27,6 +27,7 @@ Bonus stage_speed = 0 transmittable = 1 level = 3 + severity = 4 /datum/symptom/vomit/Activate(var/datum/disease/advance/A) ..() @@ -78,6 +79,7 @@ Bonus stage_speed = -1 transmittable = 1 level = 4 + severity = 5 /datum/symptom/vomit/blood/Vomit(var/mob/living/M) diff --git a/code/datums/diseases/advance/symptoms/weight.dm b/code/datums/diseases/advance/symptoms/weight.dm index 911efef1a7d..3734176978c 100644 --- a/code/datums/diseases/advance/symptoms/weight.dm +++ b/code/datums/diseases/advance/symptoms/weight.dm @@ -23,6 +23,7 @@ Bonus stage_speed = -2 transmittable = -2 level = 4 + severity = 1 /datum/symptom/weight_gain/Activate(var/datum/disease/advance/A) ..() @@ -64,6 +65,7 @@ Bonus stage_speed = -2 transmittable = -2 level = 3 + severity = 1 /datum/symptom/weight_loss/Activate(var/datum/disease/advance/A) ..() diff --git a/code/datums/diseases/appendicitis.dm b/code/datums/diseases/appendicitis.dm index f5d6ceef2bd..8a628eefd62 100644 --- a/code/datums/diseases/appendicitis.dm +++ b/code/datums/diseases/appendicitis.dm @@ -9,7 +9,7 @@ permeability_mod = 1 contagious_period = 9001 //slightly hacky, but hey! whatever works, right? desc = "If left untreated the subject will become very weak, and may vomit often." - severity = "Medium" + severity = "Dangerous!" longevity = 1000 hidden = list(0, 1) requires = 1 @@ -35,7 +35,8 @@ if(prob(1)) if (affected_mob.nutrition > 100) affected_mob.Stun(rand(4,6)) - affected_mob.show_message("[affected_mob] throws up!") + affected_mob.visible_message("[affected_mob] throws up!", \ + "[affected_mob] throws up!") playsound(affected_mob.loc, 'sound/effects/splat.ogg', 50, 1) var/turf/location = affected_mob.loc if(istype(location, /turf/simulated)) diff --git a/code/datums/diseases/brainrot.dm b/code/datums/diseases/brainrot.dm index 782e518ffd7..971755d070d 100644 --- a/code/datums/diseases/brainrot.dm +++ b/code/datums/diseases/brainrot.dm @@ -10,7 +10,7 @@ curable = 0 cure_chance = 15//higher chance to cure, since two reagents are required desc = "This disease destroys the braincells, causing brain fever, brain necrosis and general intoxication." - severity = "Major" + severity = "Dangerous!" requires = 1 required_limb = list(/obj/item/organ/limb/head) diff --git a/code/datums/diseases/cold9.dm b/code/datums/diseases/cold9.dm index e22016eb01f..0e7847588fa 100644 --- a/code/datums/diseases/cold9.dm +++ b/code/datums/diseases/cold9.dm @@ -8,7 +8,7 @@ agent = "ICE9-rhinovirus" affected_species = list("Human") desc = "If left untreated the subject will slow, as if partly frozen." - severity = "Moderate" + severity = "Medium" /datum/disease/cold9/stage_act() ..() diff --git a/code/datums/diseases/fake_gbs.dm b/code/datums/diseases/fake_gbs.dm index a56e62c28d0..9700cd120a5 100644 --- a/code/datums/diseases/fake_gbs.dm +++ b/code/datums/diseases/fake_gbs.dm @@ -8,7 +8,7 @@ agent = "Gravitokinetic Bipotential SADS-" affected_species = list("Human", "Monkey") desc = "If left untreated death will occur." - severity = "Major" + severity = "BIOHAZARD THREAT!" /datum/disease/fake_gbs/stage_act() ..() diff --git a/code/datums/diseases/fluspanish.dm b/code/datums/diseases/fluspanish.dm index ef85ab1961d..6d8a9c9a290 100644 --- a/code/datums/diseases/fluspanish.dm +++ b/code/datums/diseases/fluspanish.dm @@ -9,7 +9,7 @@ affected_species = list("Human") permeability_mod = 0.75 desc = "If left untreated the subject will burn to death for being a heretic." - severity = "Serious" + severity = "Dangerous!" /datum/disease/inquisition/stage_act() ..() diff --git a/code/datums/diseases/gbs.dm b/code/datums/diseases/gbs.dm index 9a677b7111c..9579d8f2036 100644 --- a/code/datums/diseases/gbs.dm +++ b/code/datums/diseases/gbs.dm @@ -10,6 +10,7 @@ affected_species = list("Human") curable = 0 permeability_mod = 1 + severity = "BIOHAZARD THREAT!" /datum/disease/gbs/stage_act() ..() diff --git a/code/datums/diseases/plasmatoid.dm b/code/datums/diseases/plasmatoid.dm index 232371cd3b2..499edcb5fa1 100644 --- a/code/datums/diseases/plasmatoid.dm +++ b/code/datums/diseases/plasmatoid.dm @@ -2,4 +2,5 @@ name = "Plasmatoid" max_stages = 4 cure = "None" - affected_species = list("Monkey", "Human") \ No newline at end of file + affected_species = list("Monkey", "Human") + severity = "Unknown" \ No newline at end of file diff --git a/code/datums/diseases/retrovirus.dm b/code/datums/diseases/retrovirus.dm index 3c6450ccd8a..40b56b05bf6 100644 --- a/code/datums/diseases/retrovirus.dm +++ b/code/datums/diseases/retrovirus.dm @@ -8,7 +8,7 @@ agent = "" affected_species = list("Human") desc = "A DNA-altering retrovirus that scrambles the structural and unique enzymes of a host constantly." - severity = "Severe" + severity = "Dangerous!" permeability_mod = 0.4 stage_prob = 2 var/SE diff --git a/code/datums/diseases/rhumba_beat.dm b/code/datums/diseases/rhumba_beat.dm index 9de82ceaac0..09225bf25b1 100644 --- a/code/datums/diseases/rhumba_beat.dm +++ b/code/datums/diseases/rhumba_beat.dm @@ -8,6 +8,7 @@ agent = "Unknown" affected_species = list("Human") permeability_mod = 1 + severity = "BIOHAZARD THREAT!" /datum/disease/rhumba_beat/stage_act() ..() diff --git a/code/datums/diseases/transformation.dm b/code/datums/diseases/transformation.dm index 3526359eadb..71dbe67181e 100644 --- a/code/datums/diseases/transformation.dm +++ b/code/datums/diseases/transformation.dm @@ -7,7 +7,7 @@ cure = "A coder's love (theoretical)." agent = "Shenanigans" affected_species = list("Human", "Monkey", "Alien") - severity = "Major" + severity = "Harmful" stage_prob = 10 hidden = list(1, 1) var/list/stage1 = list("You feel unremarkable.") @@ -78,7 +78,7 @@ curable = 0 longevity = 30 desc = "Monkeys with this disease will bite humans, causing humans to mutate into a monkey." - severity = "Major" + severity = "BIOHAZARD THREAT!" hidden = list(0, 0)//Not hidden, with the exception of the starting ape. stage_prob = 4 agent = "Kongey Vibrion M-909" @@ -123,6 +123,7 @@ cure_chance = 5 agent = "R2D2 Nanomachines" desc = "This disease, actually acute nanomachine infection, converts the victim into a cyborg." + severity = "Dangerous!" hidden = list(0, 0) stage1 = null stage2 = list("Your joints feel stiff.", "Beep...boop..") @@ -131,6 +132,7 @@ stage5 = list("Your skin feels as if it's about to burst off!") new_form = /mob/living/silicon/robot + /datum/disease/transformation/robot/stage_act() ..() switch(stage) @@ -152,6 +154,8 @@ cure_id = list("spaceacillin", "glycerol") cure_chance = 5 agent = "Rip-LEY Alien Microbes" + desc = "This disease changes the victim into a xenomorph." + severity = "BIOHAZARD THREAT!" hidden = list(0, 0) stage1 = null stage2 = list("Your throat feels scratchy.", "Kill...") @@ -179,6 +183,7 @@ cure_chance = 80 agent = "Advanced Mutation Toxin" desc = "This highly concentrated extract converts anything into more of itself." + severity = "BIOHAZARD THREAT!" hidden = list(0, 0) stage1 = list("You don't feel very well.") stage2 = list("You are turning a little green.") @@ -204,6 +209,7 @@ name = "The Barkening" cure = "Death" agent = "Fell Doge Majicks" + desc = "This disease transforms the victim into a corgi." hidden = list(0, 0) stage1 = list("BARK.") stage2 = list("You feel the need to wear silly hats.") diff --git a/code/datums/diseases/wizarditis.dm b/code/datums/diseases/wizarditis.dm index 42579215037..c8cf37d77aa 100644 --- a/code/datums/diseases/wizarditis.dm +++ b/code/datums/diseases/wizarditis.dm @@ -10,7 +10,7 @@ curable = 1 permeability_mod = 0.75 desc = "Some speculate, that this virus is the cause of Wizard Federation existance. Subjects affected show the signs of mental retardation, yelling obscure sentences or total gibberish. On late stages subjects sometime express the feelings of inner power, and, cite, 'the ability to control the forces of cosmos themselves!' A gulp of strong, manly spirits usually reverts them to normal, humanlike, condition." - severity = "Major" + severity = "Harmful" requires = 1 required_limb = list(/obj/item/organ/limb/head) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 8a26a4f0cfb..af3e024b5e9 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -787,18 +787,18 @@ var/list/L = current.get_contents() var/obj/item/device/flash/flash = locate() in L if (!flash) - usr << "\red Deleting flash failed!" + usr << "Deleting flash failed!" qdel(flash) var/obj/item/device/recaller/recaller = locate() in L if (!recaller) - usr << "\red Deleting recaller failed!" + usr << "Deleting recaller failed!" qdel(recaller) if("repairflash") var/list/L = current.get_contents() var/obj/item/device/flash/flash = locate() in L if (!flash) - usr << "\red Repairing flash failed!" + usr << "Repairing flash failed!" else flash.broken = 0 diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm index 05025fbc6f5..42ebeec3ef0 100644 --- a/code/defines/obj/weapon.dm +++ b/code/defines/obj/weapon.dm @@ -166,11 +166,6 @@ w_class = 2.0 attack_verb = list("warned", "cautioned", "smashed") -/obj/item/weapon/caution/cone - desc = "This cone is trying to warn you of something!" - name = "warning cone" - icon_state = "cone" - /obj/item/weapon/rack_parts name = "rack parts" desc = "Parts of a rack." diff --git a/code/game/data_huds.dm b/code/game/data_huds.dm index 54b628e4200..8cea24b69b5 100644 --- a/code/game/data_huds.dm +++ b/code/game/data_huds.dm @@ -100,7 +100,8 @@ proc/med_hud_suit_sensors(var/mob/living/carbon/human/patient) proc/med_hud_find_virus(var/mob/living/carbon/human/patient) for(var/datum/disease/D in patient.viruses) if(!D.hidden[SCANNER]) - return 1 + if(D.severity != D.non_threat) + return 1 proc/med_hud_get_health(var/mob/living/carbon/human/patient) var/image/holder = patient.hud_list[HEALTH_HUD] diff --git a/code/game/gamemodes/antag_spawner.dm b/code/game/gamemodes/antag_spawner.dm index 9f2ecfdccea..1791a7319c7 100644 --- a/code/game/gamemodes/antag_spawner.dm +++ b/code/game/gamemodes/antag_spawner.dm @@ -3,7 +3,6 @@ throw_range = 5 w_class = 1.0 var/used = 0 - var/polling_ghosts = 0 /obj/item/weapon/antag_spawner/proc/spawn_antag(var/client/C, var/turf/T, var/type = "") return @@ -43,7 +42,7 @@ ..() var/mob/living/carbon/human/H = usr - if(H.stat || H.restrained() || polling_ghosts) + if(H.stat || H.restrained()) return if(!istype(H, /mob/living/carbon/human)) return 1 @@ -54,12 +53,10 @@ if (used) H << "You already used this contract!" return - H << "You send out a call for aid into the realms! It will be about 20 seconds before you get a response." - polling_ghosts = 1 - var/client/C = pick_from_candidates(BE_WIZARD, "wizard's apprentice") - polling_ghosts = 0 - if(C) + var/list/candidates = get_candidates(BE_WIZARD) + if(candidates.len) src.used = 1 + var/client/C = pick(candidates) spawn_antag(C, get_turf(H.loc), href_list["school"]) else H << "Unable to reach your apprentice! You can either attack the spellbook with the contract to refund your points, or wait and try again later." @@ -126,17 +123,13 @@ var/TC_cost = 0 /obj/item/weapon/antag_spawner/borg_tele/attack_self(mob/user as mob) - if(polling_ghosts) - return if(used) user << "The teleporter is out of power." return - user << "Standby for reinforcements... ETA 20 seconds." - polling_ghosts = 1 - var/client/C = pick_from_candidates(BE_OPERATIVE, "Syndicate cyborg") - polling_ghosts = 0 - if(C) + var/list/borg_candicates = get_candidates(BE_OPERATIVE) + if(borg_candicates.len > 0) used = 1 + var/client/C = pick(borg_candicates) spawn_antag(C, get_turf(src.loc), "syndieborg") else user << "Unable to connect to Syndicate Command. Please wait and try again later or use the teleporter on your uplink to get your points refunded." diff --git a/code/game/gamemodes/blob/blobs/core.dm b/code/game/gamemodes/blob/blobs/core.dm index a179d503ce1..fd3ce5d5a5b 100644 --- a/code/game/gamemodes/blob/blobs/core.dm +++ b/code/game/gamemodes/blob/blobs/core.dm @@ -72,18 +72,20 @@ qdel(overmind) var/client/C = null + var/list/candidates = list() - spawn(0) - if(!new_overmind) - C = pick_from_candidates(BE_BLOB) - else - C = new_overmind + if(!new_overmind) + candidates = get_candidates(BE_BLOB) + if(candidates.len) + C = pick(candidates) + else + C = new_overmind - if(C) - var/mob/camera/blob/B = new(src.loc) - B.key = C.key - B.blob_core = src - src.overmind = B - return 1 - return 0 + if(C) + var/mob/camera/blob/B = new(src.loc) + B.key = C.key + B.blob_core = src + src.overmind = B + return 1 + return 0 diff --git a/code/game/gamemodes/cult/cult.dm b/code/game/gamemodes/cult/cult.dm index 69089cbb230..894e84f6ec9 100644 --- a/code/game/gamemodes/cult/cult.dm +++ b/code/game/gamemodes/cult/cult.dm @@ -101,7 +101,7 @@ // grant_runeword(cult_mind.current) // grant_secondword(cult_mind.current) update_cult_icons_added(cult_mind) - cult_mind.current << "You are a member of the cult!" + cult_mind.current << "You are a member of the cult!" memorize_cult_objectives(cult_mind) cult_mind.special_role = "Cultist" ..() @@ -129,11 +129,6 @@ // grant_runeword(cult_mind.current,"blood") // grant_runeword(cult_mind.current,"hell") -/datum/game_mode/proc/greet_cultist(mob/M) - M << "Your blood pulses. Your head throbs. The world goes red. All at once you are aware of a horrible, horrible truth. The veil of reality has been ripped away and in the festering wound left behind something sinister takes root." - M << "Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back." - - /datum/game_mode/proc/equip_cultist(mob/living/carbon/human/mob) if(!istype(mob)) return diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index ffc72668ec5..2b16cdcc366 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -113,24 +113,26 @@ var/list/sacrificed = list() "AAAAAAHHHH!", \ "You hear an anguished scream.") if(is_convertable_to_cult(M.mind)) - if(jobban_isbanned(M, "Syndicate") || jobban_isbanned(M, "cultist")) - M.visible_message("[M] screams horrifically before falling limp, his mind clearly broken by something he saw.", \ - "You are currently jobbanned from Cultist.") - M.ghostize(0) //Jobbanned players are force ghosted - M.resting = 1 - spawn(0) - var/client/C = pick_from_candidates(BE_CULTIST) //Try to find a suitable observer to replace the jobbanned player - if(C) - M.key = C.key - M << "Who are you? How did you get here? You can't seem to remember anything but..." - ticker.mode.add_cultist(M.mind) - M.mind.special_role = "Cultist" - ticker.mode.greet_cultist(M) - else - ticker.mode.add_cultist(M.mind) - M.mind.special_role = "Cultist" - ticker.mode.greet_cultist(M) - + ticker.mode.add_cultist(M.mind) + M.mind.special_role = "Cultist" + M << "Your blood pulses. Your head throbs. The world goes red. All at once you are aware of a horrible, horrible truth. The veil of reality has been ripped away and in the festering wound left behind something sinister takes root." + M << "Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back." +/*//convert no longer gives words + //picking which word to use + if(usr.mind.cult_words.len != ticker.mode.allwords.len) // No point running if they already know everything + var/convert_word + for(var/i=1, i<=3, i++) + convert_word = pick(ticker.mode.grantwords) + if(convert_word in usr.mind.cult_words) + if(i==3) convert_word = null //NOTE: If max loops is changed ensure this condition is changed to match /Mal + else + break + if(!convert_word) + usr << "\red This Convert was unworthy of knowledge of the other side!" + else + usr << "\red The Geometer of Blood is pleased to see his followers grow in numbers." + ticker.mode.grant_runeword(usr, convert_word) + return 1 */ else M << "Your blood pulses. Your head throbs. The world goes red. All at once you are aware of a horrible, horrible truth. The veil of reality has been ripped away and in the festering wound left behind something sinister takes root." M << "And not a single fuck was given, exterminate the cult at all costs." @@ -301,12 +303,8 @@ var/list/sacrificed = list() var/mob/dead/observer/ghost for(var/mob/dead/observer/O in loc) - if(!O.client) - continue - if(O.mind && O.mind.current && O.mind.current.stat != DEAD) - continue - if(!jobban_isbanned(O, "Syndicate") && !jobban_isbanned(O, "cultist")) - continue + if(!O.client) continue + if(O.mind && O.mind.current && O.mind.current.stat != DEAD) continue ghost = O break @@ -342,11 +340,12 @@ var/list/sacrificed = list() body_to_sacrifice.gib() // if(ticker.mode.name == "cult") -// ticker.mode: corpse_to_raise.mind) +// ticker.mode:add_cultist(corpse_to_raise.mind) // else // ticker.mode.cult |= corpse_to_raise.mind - ticker.mode.greet_cultist(corpse_to_raise) + corpse_to_raise << "Your blood pulses. Your head throbs. The world goes red. All at once you are aware of a horrible, horrible truth. The veil of reality has been ripped away and in the festering wound left behind something sinister takes root." + corpse_to_raise << "Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back." return @@ -436,7 +435,8 @@ var/list/sacrificed = list() ticker.mode.cult+=D.mind D.mind.special_role = "Cultist" - ticker.mode.greet_cultist(D) + D << "Your blood pulses. Your head throbs. The world goes red. All at once you are aware of a horrible, horrible truth. The veil of reality has been ripped away and in the festering wound left behind something sinister takes root." + D << "Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back." var/mob/living/user = usr while(this_rune && user && user.stat==CONSCIOUS && user.client && user.loc==this_rune.loc) diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index f57c052457f..7974819cefb 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -211,7 +211,17 @@ var/list/drafted = list() var/datum/mind/applicant = null - var/roletext = get_roletext(role) + var/roletext + switch(role) + if(BE_CHANGELING) roletext="changeling" + if(BE_TRAITOR) roletext="traitor" + if(BE_OPERATIVE) roletext="operative" + if(BE_WIZARD) roletext="wizard" + if(BE_REV) roletext="revolutionary" + if(BE_GANG) roletext="gangster" + if(BE_CULTIST) roletext="cultist" + if(BE_MONKEY) roletext="monkey" + // Ultimate randomizing code right here for(var/mob/new_player/player in player_list) @@ -371,6 +381,8 @@ proc/display_roundstart_logout_report() msg += "[L.name] ([ckey(D.mind.key)]), the [L.job] (Ghosted)\n" continue //Ghosted while alive + + for(var/mob/M in mob_list) if(M.client && M.client.holder) M << msg @@ -389,4 +401,4 @@ proc/display_roundstart_logout_report() text += "body destroyed" text += ")" - return text + return text diff --git a/code/game/gamemodes/gang/gang.dm b/code/game/gamemodes/gang/gang.dm index 339f74c03e8..7ed0f980bc6 100644 --- a/code/game/gamemodes/gang/gang.dm +++ b/code/game/gamemodes/gang/gang.dm @@ -23,7 +23,7 @@ /////////////////////////// /datum/game_mode/gang/announce() world << "The current game mode is - Gang War!" - world << "A violent turf war has erupted on the station!
\nGangsters - Take over the station by killing the rival gang's bosses! Recruit gangsters by flashing them!
\nSecurity - Protect the Crew! Identify and stop the mob bosses!
" + world << "A violent turf war has erupted on the station!
Gangsters - Take over the station by killing the rival gang's bosses! Recruit gangsters by flashing them!
Security - Protect the Crew! Identify and stop the mob bosses!
" /////////////////////////////////////////////////////////////////////////////// diff --git a/code/game/gamemodes/meteor/meteors.dm b/code/game/gamemodes/meteor/meteors.dm index 992398ae800..b9ed5c88c54 100644 --- a/code/game/gamemodes/meteor/meteors.dm +++ b/code/game/gamemodes/meteor/meteors.dm @@ -93,6 +93,10 @@ qdel(src) return ..() +/obj/effect/meteor/Destroy() + walk(src,0) //this cancels the walk_towards() proc + ..() + /obj/effect/meteor/dust name = "space dust" icon_state = "dust" diff --git a/code/game/gamemodes/wizard/rightandwrong.dm b/code/game/gamemodes/wizard/rightandwrong.dm index e4eae407ef3..04b837c7d0a 100644 --- a/code/game/gamemodes/wizard/rightandwrong.dm +++ b/code/game/gamemodes/wizard/rightandwrong.dm @@ -14,7 +14,6 @@ if(H.mind) if(H.mind.special_role == "Wizard" || H.mind.special_role == "apprentice") continue if(prob(25) && !(H.mind in ticker.mode.traitors)) - if(jobban_isbanned(H, "Syndicate") || jobban_isbanned(H, "traitor")) continue ticker.mode.traitors += H.mind H.mind.special_role = "traitor" var/datum/objective/survive/survive = new diff --git a/code/game/machinery/bots/medbot.dm b/code/game/machinery/bots/medbot.dm index 7c29d4e703c..76c315270aa 100644 --- a/code/game/machinery/bots/medbot.dm +++ b/code/game/machinery/bots/medbot.dm @@ -365,7 +365,11 @@ for(var/datum/disease/D in C.viruses) - if((D.stage > 1) || (D.spread_type == AIRBORNE)) + if((D.hidden[SCANNER]) || (D.hidden[PANDEMIC])) //the medibot can't detect viruses that are undetectable to Health Analyzers or Pandemic machines. + return 0 + if(D.severity == D.non_threat) // medibot doesn't try to heal truly harmless viruses + return 0 + if((D.stage > 1) || (D.spread_type == AIRBORNE)) // medibot can't detect a virus in its initial stage unless it spreads airborne. if (!C.reagents.has_reagent(src.treatment_virus)) return 1 //STOP DISEASE FOREVER @@ -400,7 +404,10 @@ else var/virus = 0 for(var/datum/disease/D in C.viruses) - virus = 1 + if((!D.hidden[SCANNER]) && (!D.hidden[PANDEMIC])) //detectable virus + if(D.severity != D.non_threat) //virus is harmful + if((D.stage > 1) || (D.spread_type == AIRBORNE)) + virus = 1 if (!reagent_id && (virus)) if(!C.reagents.has_reagent(src.treatment_virus)) diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm index f273a019358..af90f9b35cc 100644 --- a/code/game/machinery/computer/card.dm +++ b/code/game/machinery/computer/card.dm @@ -15,14 +15,13 @@ var/time_last_changed_position = 0 var/authenticated = 0.0 var/mode = 0.0 var/printing = null - var/edit_job_target = "" var/list/region_access = null var/list/head_subordinates = null //Cooldown for closing positions in seconds //if set to -1: No cooldown... probably a bad idea //if set to 0: Not able to close "original" positions. You can only close positions that you have opened before - var/change_position_cooldown = 280 + var/change_position_cooldown = 60 //Jobs you cannot open new positions for var/list/blacklisted = list( "AI", @@ -109,54 +108,61 @@ var/time_last_changed_position = 0 else if(mode == 2) // JOB MANAGEMENT - var/datum/job/j = job_master.GetJob(edit_job_target) - if(!j) - // SHOW MAIN JOB MANAGEMENT MENU - dat = "Return
" - dat += "

Job Management

" - dat += "Choose Job
" - for(var/datum/job/job in job_master.occupations) - if(!(job.title in blacklisted)) - dat += "[job.title] ([job.current_positions]/[job.total_positions])
" + dat = "Return" + dat += " || Confirm Identity: " + var/S + if(scan) + S = html_encode(scan.name) else - if(access_change_ids in scan.access) - // EDIT SPECIFIC JOB - dat = "Return
" - dat += "

[j.title]: [j.current_positions]/[j.total_positions]


" - //Make sure antags can't completely ruin rounds - - //Don't allow more than 1 Head / limit blacklisted jobs - switch(can_open_job(j)) - if(1) - dat += "Open Position
" - if(-1) - dat += "You cannot open any more positions for this job.
" - if(-2) - var/time_to_wait = round(change_position_cooldown - ((world.time / 10) - time_last_changed_position), 1) - var/mins = round(time_to_wait / 60) - var/seconds = time_to_wait - (60*mins) - dat += "You have to wait [mins]:[(seconds < 10) ? "0[seconds]" : "[seconds]"] minutes before you can open this position." - if(0) - dat += "You cannot open positions for this job.
" - - - switch(can_close_job(j)) - if(1) - dat += "Close Position" - if(-1) - dat += "You cannot close any more positions for this job.
" - if(-2) - var/time_to_wait = round(change_position_cooldown - ((world.time / 10) - time_last_changed_position), 1) - var/mins = round(time_to_wait / 60) - var/seconds = time_to_wait - (60*mins) - dat += "You have to wait [mins]:[(seconds < 10) ? "0[seconds]" : "[seconds]"] minutes before you can close this position." - if(0) - dat += "You cannot close positions for this job.
" - else - dat = "Return
" - dat += "

Please insert your ID

" - mode = 3 - + S = "--------" + dat += "[S]" + dat += "" + dat += "" + var/ID + if(scan && (access_change_ids in scan.access)) + ID = 1 + else + ID = 0 + for(var/datum/job/job in job_master.occupations) + dat += "" + if(job.title in blacklisted) + continue + dat += "" + dat += "" + dat += "" + dat += "
JobSlotsOpen jobClose job
[job.title][job.current_positions]/[job.total_positions]" + switch(can_open_job(job)) + if(1) + if(ID) + dat += "Open Position
" + else + dat += "Open Position" + if(-1) + dat += "Denied" + if(-2) + var/time_to_wait = round(change_position_cooldown - ((world.time / 10) - time_last_changed_position), 1) + var/mins = round(time_to_wait / 60) + var/seconds = time_to_wait - (60*mins) + dat += "Cooldown ongoing: [mins]:[(seconds < 10) ? "0[seconds]" : "[seconds]"]" + if(0) + dat += "Denied" + dat += "
" + switch(can_close_job(job)) + if(1) + if(ID) + dat += "Close Position" + else + dat += "Close Position" + if(-1) + dat += "Denied" + if(-2) + var/time_to_wait = round(change_position_cooldown - ((world.time / 10) - time_last_changed_position), 1) + var/mins = round(time_to_wait / 60) + var/seconds = time_to_wait - (60*mins) + dat += "Cooldown ongoing: [mins]:[(seconds < 10) ? "0[seconds]" : "[seconds]"]" + if(0) + dat += "Denied" + dat += "
" else var/header = "" @@ -230,7 +236,7 @@ var/time_last_changed_position = 0 carddesc += "
" carddesc += "" carddesc += "" - carddesc += "registered_name: " + carddesc += "registered name: " carddesc += "" carddesc += "
" carddesc += "Assignment: " @@ -282,7 +288,7 @@ var/time_last_changed_position = 0 //user << browse(dat, "window=id_com;size=900x520") //onclose(user, "id_com") - var/datum/browser/popup = new(user, "id_com", "Identification Card Modifier Console", 900, 590) + var/datum/browser/popup = new(user, "id_com", "Identification Card Modifier Console", 900, 620) popup.set_content(dat) popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state)) popup.open() @@ -408,44 +414,38 @@ var/time_last_changed_position = 0 if ("mode") mode = text2num(href_list["mode_target"]) - if("edit_job") - edit_job_target = href_list["job"] - if(job_master.GetJob(edit_job_target) == null) - edit_job_target = "" - if("return") - if(edit_job_target != "") - //RETURN TO JOB MANAGEMENT - edit_job_target = "" - else - //DISPLAY MAIN MENU - mode = 3; - edit_job_target = "" + //DISPLAY MAIN MENU + mode = 3; if("make_job_available") // MAKE ANOTHER JOB POSITION AVAILABLE FOR LATE JOINERS - var/datum/job/j = job_master.GetJob(edit_job_target) - if(!j) - return 0 - if(can_open_job(j) != 1) - return 0 - if(opened_positions[edit_job_target] >= 0) - time_last_changed_position = world.time / 10 - j.total_positions++ - opened_positions[edit_job_target]++ + if(scan && (access_change_ids in scan.access)) + var/edit_job_target = href_list["job"] + var/datum/job/j = job_master.GetJob(edit_job_target) + if(!j) + return 0 + if(can_open_job(j) != 1) + return 0 + if(opened_positions[edit_job_target] >= 0) + time_last_changed_position = world.time / 10 + j.total_positions++ + opened_positions[edit_job_target]++ if("make_job_unavailable") // MAKE JOB POSITION UNAVAILABLE FOR LATE JOINERS - var/datum/job/j = job_master.GetJob(edit_job_target) - if(!j) - return 0 - if(can_close_job(j) != 1) - return 0 - //Allow instant closing without cooldown if a position has been opened before - if(opened_positions[edit_job_target] <= 0) - time_last_changed_position = world.time / 10 - j.total_positions-- - opened_positions[edit_job_target]-- + if(scan && (access_change_ids in scan.access)) + var/edit_job_target = href_list["job"] + var/datum/job/j = job_master.GetJob(edit_job_target) + if(!j) + return 0 + if(can_close_job(j) != 1) + return 0 + //Allow instant closing without cooldown if a position has been opened before + if(opened_positions[edit_job_target] <= 0) + time_last_changed_position = world.time / 10 + j.total_positions-- + opened_positions[edit_job_target]-- if ("print") if (!( printing )) diff --git a/code/game/machinery/telecomms/broadcaster.dm b/code/game/machinery/telecomms/broadcaster.dm index 4b97f504628..add0390729f 100644 --- a/code/game/machinery/telecomms/broadcaster.dm +++ b/code/game/machinery/telecomms/broadcaster.dm @@ -213,7 +213,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept var/list/radios = list() - var/atom/movable/virtualspeaker/virt = new(null) + var/atom/movable/virtualspeaker/virt = PoolOrNew(/atom/movable/virtualspeaker,null) virt.name = name virt.job = job virt.languages = AM.languages @@ -295,7 +295,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept blackbox.messages += blackbox_msg spawn(50) - qdel(virt) + PlaceInPool(virt) /proc/Broadcast_SimpleMessage(var/source, var/frequency, var/text, var/data, var/mob/M, var/compression, var/level) diff --git a/code/game/machinery/transformer.dm b/code/game/machinery/transformer.dm index 1aab4cf960d..5f00666e819 100644 --- a/code/game/machinery/transformer.dm +++ b/code/game/machinery/transformer.dm @@ -59,13 +59,12 @@ playsound(src.loc, 'sound/machines/buzz-sigh.ogg', 50, 0) return - // Activate the cooldown if the human isn't jobbanned - if(!jobban_isbanned(H, "Cyborg")) - cooldown = 1 + // Activate the cooldown + cooldown = 1 + update_icon() + spawn(cooldown_duration) + cooldown = 0 update_icon() - spawn(cooldown_duration) - cooldown = 0 - update_icon() playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) H.emote("scream") // It is painful @@ -75,11 +74,6 @@ // Sleep for a couple of ticks to allow the human to see the pain sleep(5) - if(jobban_isbanned(H, "Cyborg")) //Jobbanned players get horribly maimed instead - H.adjustBruteLoss(1000) - playsound(src.loc, 'sound/effects/splat.ogg', 50, 1) - return - use_power(5000) // Use a lot of power. var/mob/living/silicon/robot/R = H.Robotize(1) // Delete the items or they'll all pile up in a single tile and lag diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 8bdddddfb38..22f292604e3 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -1100,6 +1100,8 @@ var/atom/movable/mob_container if(ishuman(occupant)) mob_container = src.occupant + if(occupant.hud_used && last_user_hud) + occupant.hud_used.show_hud(HUD_STYLE_STANDARD) else if(istype(occupant, /mob/living/carbon/brain)) var/mob/living/carbon/brain/brain = occupant mob_container = brain.container @@ -1135,8 +1137,7 @@ src.occupant.client.perspective = MOB_PERSPECTIVE */ src.occupant << browse(null, "window=exosuit") - if(src.occupant.hud_used && src.last_user_hud) - src.occupant.hud_used.show_hud(HUD_STYLE_STANDARD) + if(istype(mob_container, /obj/item/device/mmi)) var/obj/item/device/mmi/mmi = mob_container diff --git a/code/game/objects/effects/spawners/lootdrop.dm b/code/game/objects/effects/spawners/lootdrop.dm index a3b1520af36..73b14346a40 100644 --- a/code/game/objects/effects/spawners/lootdrop.dm +++ b/code/game/objects/effects/spawners/lootdrop.dm @@ -89,7 +89,7 @@ /obj/item/stack/sheet/rglass = 1, /obj/item/weapon/book/manual/wiki/engineering_construction = 1, /obj/item/weapon/book/manual/wiki/engineering_hacking = 1, - /obj/item/weapon/caution/cone = 1, + /obj/item/clothing/head/cone = 1, /obj/item/weapon/coin/silver = 1, /obj/item/weapon/coin/twoheaded = 1, /obj/item/weapon/contraband/poster = 1, diff --git a/code/game/objects/items/devices/flash.dm b/code/game/objects/items/devices/flash.dm index fa75079885e..f418c40a72b 100644 --- a/code/game/objects/items/devices/flash.dm +++ b/code/game/objects/items/devices/flash.dm @@ -92,21 +92,8 @@ if(!ticker.mode.add_gangster(M.mind,"B")) resisted = 1 if(!resisted) - if(jobban_isbanned(M, "Syndicate") || jobban_isbanned(M, "revolutionary")) - M << "You are currently jobbanned from Revolutionary." - user << "This mind was unable to survive the rigors of conversion and has been wiped clean!" - M.ghostize(0) //Jobbanned players are force ghosted - M.resting = 1 - spawn(0) - var/client/C = pick_from_candidates(BE_REV) //Try to find a suitable observer to replace the jobbanned player - if(C) - M.key = C.key - M << "Who are you? How did you get here? You can't seem to remember anything but..." - M.mind.has_been_rev = 1 - ticker.mode.add_revolutionary(M.mind) - else - M.mind.has_been_rev = 1 - ticker.mode.add_revolutionary(M.mind) + M.mind.has_been_rev = 1 + ticker.mode.add_revolutionary(M.mind) else user << "This mind seems resistant to the flash!" else diff --git a/code/game/objects/items/weapons/storage/fancy.dm b/code/game/objects/items/weapons/storage/fancy.dm index 303850c14dd..f9558b784c8 100644 --- a/code/game/objects/items/weapons/storage/fancy.dm +++ b/code/game/objects/items/weapons/storage/fancy.dm @@ -153,7 +153,7 @@ throwforce = 0 slot_flags = SLOT_BELT storage_slots = 6 - can_hold = list(/obj/item/clothing/mask/cigarette) + can_hold = list(/obj/item/clothing/mask/cigarette,/obj/item/weapon/lighter) icon_type = "cigarette" /obj/item/weapon/storage/fancy/cigarettes/New() @@ -168,24 +168,26 @@ desc = "There are [contents.len] cig\s left!" return -/obj/item/weapon/storage/fancy/cigarettes/remove_from_storage(obj/item/W as obj, atom/new_location) - var/obj/item/clothing/mask/cigarette/C = W - if(!istype(C)) return // what - reagents.trans_to(C, (reagents.total_volume/contents.len)) - ..() +/obj/item/weapon/storage/fancy/cigarettes/remove_from_storage(obj/item/W, atom/new_location) + if(istype(W,/obj/item/clothing/mask/cigarette)) + reagents.trans_to(W,(reagents.total_volume/contents.len)) + ..() /obj/item/weapon/storage/fancy/cigarettes/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob) if(!istype(M, /mob)) return - - if(M == user && user.zone_sel.selecting == "mouth" && contents.len > 0 && !user.wear_mask) - var/obj/item/clothing/mask/cigarette/W = contents[1] - remove_from_storage(W, M) - M.equip_to_slot_if_possible(W, slot_wear_mask) - contents -= W - user << "You take a cigarette out of the pack." + var/obj/item/clothing/mask/cigarette/cig = locate(/obj/item/clothing/mask/cigarette) in contents + if(cig) + if(M == user && user.zone_sel.selecting == "mouth" && contents.len > 0 && !user.wear_mask) + var/obj/item/clothing/mask/cigarette/W = cig + remove_from_storage(W, M) + M.equip_to_slot_if_possible(W, slot_wear_mask) + contents -= W + user << "You take a cigarette out of the pack." + else + ..() else - ..() + user << "There are no cigarettes left in the pack." /obj/item/weapon/storage/fancy/cigarettes/dromedaryco name = "\improper DromedaryCo packet" diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index 05d2baedd22..340933e8184 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -37,7 +37,7 @@ if(HULK in user.mutations) health -= 5 else - health -= 3 + health -= rand(1,2) healthcheck() /obj/structure/grille/attack_alien(mob/user as mob) @@ -62,7 +62,7 @@ "You smash against [src].", \ "You hear twisting metal.") - health -= rand(2,3) + health -= rand(1,2) healthcheck() return @@ -94,8 +94,8 @@ if(!Proj) return ..() - if((Proj.damage_type == BRUTE || Proj.damage_type == BURN)) - src.health -= Proj.damage*0.2 + if((Proj.damage_type != STAMINA)) //Grilles can't be exhausted to death + src.health -= Proj.damage*0.3 healthcheck() return @@ -174,11 +174,10 @@ else if(!shock(user, 70)) switch(W.damtype) if(BURN) - health -= W.force playsound(loc, 'sound/items/welder.ogg', 80, 1) - if(BRUTE) - health -= W.force * 0.1 + else playsound(loc, 'sound/effects/grillehit.ogg', 80, 1) + health -= W.force * 0.3 healthcheck() ..() diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index d5bf0f371a5..3e626648f71 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -698,6 +698,22 @@ Destroy type values: return ..() +/obj/structure/table/MouseDrop_T(mob/target, mob/living/carbon/human/user) + if(istype(target) && user == target) + if(user.canmove) + climb_table(user) + +/obj/structure/table/proc/climb_table(mob/user) + src.add_fingerprint(user) + user.visible_message("[user] starts climbing onto [src].", \ + "[user] starts climbing onto [src].") + if(do_mob(user, user, 20)) + user.loc = src.loc + user.visible_message("[user] climbs onto [src].", \ + "[user] climbs onto [src].") + add_logs(user, src, "climbed onto") + user.Stun(2) + /* * Racks */ diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index 0e9c73ac499..62b181272f2 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -156,7 +156,11 @@ add_fingerprint(M) if(on) for (var/atom/movable/G in loc) - Crossed(G) + wash(G) + else + if(istype(loc, /turf/simulated)) + var/turf/simulated/tile = loc + tile.MakeSlippery() /obj/machinery/shower/attackby(obj/item/I, mob/user) @@ -206,9 +210,10 @@ /obj/machinery/shower/Crossed(atom/movable/O) ..() wash(O) - if(ismob(O)) - mobpresent += 1 - check_heat(O) + if(iscarbon(O) && on) + var/mob/living/carbon/M=O + M.slip(4,2,null,NO_SLIP_WHEN_WALKING) + /obj/machinery/shower/Uncrossed(atom/movable/O) @@ -220,7 +225,9 @@ //Yes, showers are super powerful as far as washing goes. /obj/machinery/shower/proc/wash(atom/movable/O) if(!on) return - + if(ismob(O)) + mobpresent += 1 + check_heat(O) if(isliving(O)) var/mob/living/L = O L.ExtinguishMob() @@ -306,6 +313,7 @@ check_heat(C) + /obj/machinery/shower/proc/check_heat(mob/M) if(!on || watertemp == "normal") return if(iscarbon(M)) diff --git a/code/game/pooling/atom_pool.dm b/code/game/pooling/atom_pool.dm new file mode 100644 index 00000000000..ca6f8f19341 --- /dev/null +++ b/code/game/pooling/atom_pool.dm @@ -0,0 +1,93 @@ + +/* +/tg/station13 /atom/movable Pool: +--------------------------------- +By RemieRichards + +Creation/Deletion is laggy, so let's reduce reuse and recycle! + +Locked to /atom/movable and it's subtypes due to Loc being a const var on /atom +but being read&write on /movable due to how they... move. + +*/ + +var/global/list/GlobalPool = list() + +//You'll be using this proc 90% of the time. +//It grabs a type from the pool if it can +//And if it can't, it creates one +//The pool is flexible and will expand to fit +//The new created atom when it eventually +//Goes into the pool + +/proc/PoolOrNew(var/get_type,var/new_loc) + if(!get_type) + return + + var/atom/movable/AM + if(new_loc) + AM = GetFromPool(get_type,new_loc) + else + AM = GetFromPool(get_type,null) + + if(!AM) + if(ispath(get_type)) + if(new_loc) + AM = new get_type (new_loc) + else + AM = new get_type (null) + + if(AM) + return AM + + + +/proc/GetFromPool(var/get_type,var/new_loc) + if(!get_type) + return 0 + + if(isnull(GlobalPool[get_type])) + return 0 + + if(length(GlobalPool[get_type]) == 0) + return 0 + + var/atom/movable/AM = pick_n_take(GlobalPool[get_type]) + if(AM) + AM.ResetVars() + AM.New() + if(new_loc) + AM.loc = new_loc + return AM + return 0 + + + +/proc/PlaceInPool(var/atom/movable/AM) + if(!istype(AM)) + return + + if(AM in GlobalPool[AM.type]) + return + + AM.ResetVars() + + if(!GlobalPool[AM.type]) + GlobalPool[AM.type] = list() + + GlobalPool[AM.type] += AM + + + +/atom/movable/proc/ResetVars() + var/list/excluded = list("loc", "locs", "parent_type", "vars", "verbs", "type") + + for(var/V in vars) + if(V in excluded) + continue + + vars[V] = initial(vars[V]) + + vars["loc"] = null + + diff --git a/code/modules/admin/verbs/one_click_antag.dm b/code/modules/admin/verbs/one_click_antag.dm index cb99d40727b..5f55666e9de 100644 --- a/code/modules/admin/verbs/one_click_antag.dm +++ b/code/modules/admin/verbs/one_click_antag.dm @@ -148,10 +148,35 @@ client/proc/one_click_antag() return 0 /datum/admins/proc/makeWizard() - var/client/C = pick_from_candidates(BE_WIZARD) + var/list/mob/dead/observer/candidates = list() + var/mob/dead/observer/theghost = null + var/time_passed = world.time - if(C) - var/mob/living/carbon/human/new_character=makeBody(C.mob) + for(var/mob/dead/observer/G in player_list) + if(!jobban_isbanned(G, "wizard") && !jobban_isbanned(G, "Syndicate")) + spawn(0) + switch(alert(G, "Do you wish to be considered for the position of Space Wizard Foundation 'diplomat'?","Please answer in 30 seconds!","Yes","No")) + if("Yes") + if((world.time-time_passed)>300)//If more than 30 game seconds passed. + return + candidates += G + if("No") + return + else + return + + sleep(300) + + if(candidates.len) + shuffle(candidates) + for(var/mob/i in candidates) + if(!i || !i.client) continue //Dont bother removing them from the list since we only grab one wizard + + theghost = i + break + + if(theghost) + var/mob/living/carbon/human/new_character=makeBody(theghost) new_character.mind.make_Wizard() return 1 @@ -193,22 +218,42 @@ client/proc/one_click_antag() /datum/admins/proc/makeNukeTeam() - var/list/candidates = get_candidates(BE_OPERATIVE) - + var/list/mob/dead/observer/candidates = list() var/list/mob/dead/observer/chosen = list() - var/client/C = null + var/mob/dead/observer/theghost = null + var/time_passed = world.time + + for(var/mob/dead/observer/G in player_list) + if(!jobban_isbanned(G, "operative") && !jobban_isbanned(G, "Syndicate")) + spawn(0) + switch(alert(G,"Do you wish to be considered for a nuke team being sent in?","Please answer in 30 seconds!","Yes","No")) + if("Yes") + if((world.time-time_passed)>300)//If more than 30 game seconds passed. + return + candidates += G + if("No") + return + else + return + + sleep(300) if(candidates.len) var/numagents = 5 var/agentcount = 0 for(var/i = 0, i300)//If more than 30 game seconds passed. + return + candidates += G + if("No") + return + else + return + sleep(300) + + for(var/mob/dead/observer/G in candidates) + if(!G.key) + candidates.Remove(G) if(candidates.len >= 3) //Minimum 3 to be considered a squad //Pick the lucky players var/numagents = min(5,candidates.len) //How many commandos to spawn while(numagents && deathsquadspawn.len && candidates.len) var/spawnloc = deathsquadspawn[1] - var/client/C = pick(candidates) - var/mob/dead/observer/chosen_candidate = C.mob + var/mob/dead/observer/chosen_candidate = pick(candidates) candidates -= chosen_candidate if(!chosen_candidate.key) continue diff --git a/code/modules/clothing/head/misc.dm b/code/modules/clothing/head/misc.dm index 1c473a51679..3edc7631113 100644 --- a/code/modules/clothing/head/misc.dm +++ b/code/modules/clothing/head/misc.dm @@ -194,3 +194,16 @@ item_state = "shamebrero" desc = "Once it's on, it never comes off." flags = NODROP + +/obj/item/clothing/head/cone + desc = "This cone is trying to warn you of something!" + name = "warning cone" + icon = 'icons/obj/janitor.dmi' + icon_state = "cone" + item_state = "cone" + force = 1.0 + throwforce = 3.0 + throw_speed = 2 + throw_range = 5 + w_class = 2.0 + attack_verb = list("warned", "cautioned", "smashed") diff --git a/code/modules/events/alien_infestation.dm b/code/modules/events/alien_infestation.dm index b96f2d5472e..c4c82a9cf45 100644 --- a/code/modules/events/alien_infestation.dm +++ b/code/modules/events/alien_infestation.dm @@ -32,7 +32,7 @@ if(temp_vent.network.normal_members.len > 20) //Stops Aliens getting stuck in small networks. See: Security, Virology vents += temp_vent - var/list/candidates = get_candidates(BE_ALIEN) + var/list/candidates = get_candidates(BE_ALIEN, ALIEN_AFK_BRACKET) while(spawncount > 0 && vents.len && candidates.len) var/obj/vent = pick_n_take(vents) diff --git a/code/modules/events/ninja.dm b/code/modules/events/ninja.dm index 6390d3ea352..746d1010d0f 100644 --- a/code/modules/events/ninja.dm +++ b/code/modules/events/ninja.dm @@ -42,9 +42,10 @@ //selecting a candidate player if(!key) - var/client/C = pick_from_candidates(BE_NINJA) - if(!C) + var/list/candidates = get_candidates(BE_NINJA) + if(!candidates.len) return kill() + var/client/C = pick(candidates) key = C.key if(!key) return kill() diff --git a/code/modules/mob/living/carbon/alien/larva/larva.dm b/code/modules/mob/living/carbon/alien/larva/larva.dm index 892a68b5344..9c191d338ae 100644 --- a/code/modules/mob/living/carbon/alien/larva/larva.dm +++ b/code/modules/mob/living/carbon/alien/larva/larva.dm @@ -2,7 +2,7 @@ name = "alien larva" real_name = "alien larva" icon_state = "larva0" - pass_flags = PASSTABLE + pass_flags = PASSTABLE | PASSMOB maxHealth = 25 health = 25 @@ -284,6 +284,9 @@ /mob/living/carbon/alien/larva/toggle_throw_mode() return +/mob/living/carbon/alien/larva/start_pulling() + return + /* Commented out because it's duplicated in life.dm /mob/living/carbon/alien/larva/proc/grow() // Larvae can grow into full fledged Xenos if they survive long enough if(icon_state == "larva_l" && !canmove) // This is a shit death check. It is made of shit and death. Fix later. diff --git a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm index 5c2d03085cf..b895068c1c2 100644 --- a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm +++ b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm @@ -9,7 +9,6 @@ var/const/ALIEN_AFK_BRACKET = 450 // 45 seconds icon_state = "larva0_dead" var/mob/living/affected_mob var/stage = 0 - var/polling_ghosts = 0 /obj/item/alien_embryo/New() if(istype(loc, /mob/living)) @@ -71,20 +70,23 @@ var/const/ALIEN_AFK_BRACKET = 450 // 45 seconds affected_mob << "You feel something tearing its way out of your stomach..." affected_mob.adjustToxLoss(10) affected_mob.updatehealth() - if(prob(50) && !polling_ghosts) + if(prob(50)) AttemptGrow() /obj/item/alien_embryo/proc/AttemptGrow(var/gib_on_success = 1) - polling_ghosts = 1 - var/client/C = pick_from_candidates(BE_ALIEN) - polling_ghosts = 0 + var/list/candidates = get_candidates(BE_ALIEN, ALIEN_AFK_BRACKET) + var/client/C = null // To stop clientless larva, we will check that our host has a client // if we find no ghosts to become the alien. If the host has a client // he will become the alien but if he doesn't then we will set the stage // to 2, so we don't do a process heavy check everytime. - if(!C) + if(candidates.len) + C = pick(candidates) + else if(affected_mob.client) + C = affected_mob.client + else stage = 4 // Let's try again later. return diff --git a/code/modules/mob/living/simple_animal/friendly/drone.dm b/code/modules/mob/living/simple_animal/friendly/drone.dm index 23f53d05cd6..dae3657b655 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone.dm @@ -19,8 +19,7 @@ wander = 0 speed = 0 ventcrawler = 2 - density = 0 - pass_flags = PASSTABLE + pass_flags = PASSTABLE | PASSMOB sight = (SEE_TURFS | SEE_OBJS) status_flags = (CANPUSH | CANSTUN) gender = NEUTER diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index b98b745ce79..42b25fe0a5f 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -1,6 +1,8 @@ /mob/CanPass(atom/movable/mover, turf/target, height=0, air_group=0) if(air_group || (height==0)) return 1 + if(istype(mover) && mover.checkpass(PASSMOB)) + return 1 if(ismob(mover)) var/mob/moving_mob = mover if ((other_mobs && moving_mob.other_mobs)) diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm index c48fef8ac0e..30991698e7c 100644 --- a/code/modules/power/singularity/emitter.dm +++ b/code/modules/power/singularity/emitter.dm @@ -119,13 +119,17 @@ else src.fire_delay = rand(20,100) src.shot_number = 0 - var/obj/item/projectile/beam/emitter/A = new /obj/item/projectile/beam/emitter( src.loc ) + + var/obj/item/projectile/beam/emitter/A = PoolOrNew(/obj/item/projectile/beam/emitter,src.loc) + + A.dir = src.dir playsound(src.loc, 'sound/weapons/emitter.ogg', 25, 1) + if(prob(35)) var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread s.set_up(5, 1, src) s.start() - A.dir = src.dir + switch(dir) if(NORTH) A.yo = 20 diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index 78c01b24636..2f0e57e313d 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -68,10 +68,12 @@ capacity = C / (15000) * 1e6 /obj/machinery/power/smes/attackby(obj/item/I, mob/user) + //opening using screwdriver if(default_deconstruction_screwdriver(user, "[initial(icon_state)]-o", initial(icon_state), I)) update_icon() return + //changing direction using wrench if(default_change_direction_wrench(user, I)) terminal = null var/turf/T = get_step(src, dir) @@ -81,12 +83,6 @@ terminal.master = src user << "Terminal found." break - if(!terminal) - for(var/obj/structure/cable/C in T) - if(C.d1 == turn(dir, 180) || C.d2 == turn(dir, 180)) - terminal = C - user << "Cable found." - break if(!terminal) user << "No power source found." return @@ -94,9 +90,83 @@ update_icon() return + //exchanging parts using the RPE if(exchange_parts(user, I)) return + //building and linking a terminal + if(istype(I, /obj/item/stack/cable_coil)) + var/dir = get_dir(user,src) + if(dir & (dir-1))//we don't want diagonal click + return + + if(terminal) //is there already a terminal ? + user << "This SMES already have a power terminal!" + return + + if(!panel_open) //is the panel open ? + user << "You must open the maintenance panel first!" + return + + var/turf/T = get_turf(user) + if (T.intact) //is the floor plating removed ? + user << "You must first remove the floor plating!" + return + + + var/obj/item/stack/cable_coil/C = I + if(C.amount < 10) + user << "You need more wires." + return + + user << "You start building the power terminal..." + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) + + if(do_after(user, 20) && C.amount >= 10) + var/obj/structure/cable/N = T.get_cable_node() //get the connecting node cable, if there's one + if (prob(50) && electrocute_mob(usr, N, N)) //animate the electrocution if uncautious and unlucky + var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread + s.set_up(5, 1, src) + s.start() + return + + C.use(10) + user.visible_message(\ + "[user.name] has build a power terminal!",\ + "You build the power terminal.") + + //build the terminal and link it to the network + make_terminal(T) + terminal.connect_to_network() + return + + //disassembling the terminal + if(istype(I, /obj/item/weapon/wirecutters) && terminal && panel_open) + var/turf/T = get_turf(terminal) + if (T.intact) //is the floor plating removed ? + user << "You must first expose the power terminal!" + return + + user << "You begin to dismantle the power terminal..." + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) + + if(do_after(user, 50)) + if (prob(50) && electrocute_mob(usr, terminal.powernet, terminal)) //animate the electrocution if uncautious and unlucky + var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread + s.set_up(5, 1, src) + s.start() + return + + //give the wires back and delete the terminal + new /obj/item/stack/cable_coil(T,10) + user.visible_message(\ + "[user.name] cuts the cables and dismantles the power terminal.",\ + "You cut the cables and dismantle the power terminal.") + inputting = 0 //stop inputting, since we have don't have a terminal anymore + qdel(terminal) + return + + //crowbarring it ! default_deconstruction_crowbar(I) /obj/machinery/power/smes/Destroy() @@ -109,6 +179,13 @@ disconnect_terminal() ..() +// create a terminal object pointing towards the SMES +// wires will attach to this +/obj/machinery/power/smes/proc/make_terminal(var/turf/T) + terminal = new/obj/machinery/power/terminal(T) + terminal.dir = get_dir(T,src) + terminal.master = src + /obj/machinery/power/smes/disconnect_terminal() if(terminal) terminal.master = null diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 8d6659ff84a..e5213d7c967 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -50,10 +50,13 @@ var/forcedodge = 0 + /obj/item/projectile/proc/delete() // Garbage collect the projectiles loc = null + + /obj/item/projectile/proc/on_hit(var/atom/target, var/blocked = 0, var/hit_zone) if(!isliving(target)) return 0 if(isanimal(target)) return 0 @@ -67,8 +70,8 @@ else return 50 //if the projectile doesn't do damage, play its hitsound at 50% volume -/obj/item/projectile/Bump(atom/A as mob|obj|turf|area) +/obj/item/projectile/Bump(atom/A as mob|obj|turf|area) if(A == firer) loc = A.loc return 0 //cannot shoot yourself @@ -120,8 +123,7 @@ permutated.Add(A) return 0 - density = 0 - invisibility = 101 + delete() return 0 return 1 @@ -141,9 +143,9 @@ delete() return kill_count-- - spawn while(src && src.loc) + spawn while(loc) if((!( current ) || loc == current)) - current = locate(min(max(x + xo, 1), world.maxx), min(max(y + yo, 1), world.maxy), z) + current = locate(Clamp(x+xo,1,world.maxx),Clamp(y+yo,1,world.maxy),z) if((x == 1 || x == world.maxx || y == 1 || y == world.maxy)) delete() return diff --git a/code/modules/projectiles/projectile/beams.dm b/code/modules/projectiles/projectile/beams.dm index a64c3291f23..ef6596731cf 100644 --- a/code/modules/projectiles/projectile/beams.dm +++ b/code/modules/projectiles/projectile/beams.dm @@ -54,6 +54,8 @@ icon_state = "emitter" damage = 30 +/obj/item/projectile/beam/emitter/delete() //what projectiles use to set loc = null + PlaceInPool(src) /obj/item/projectile/lasertag name = "laser tag beam" diff --git a/code/modules/scripting/Implementations/Telecomms.dm b/code/modules/scripting/Implementations/Telecomms.dm index ab3b73cdbfa..2437e485f77 100644 --- a/code/modules/scripting/Implementations/Telecomms.dm +++ b/code/modules/scripting/Implementations/Telecomms.dm @@ -301,10 +301,10 @@ datum/signal if(!job) job = "Unknown" - + //SAY REWRITE RELATED CODE. //This code is a little hacky, but it *should* work. Even though it'll result in a virtual speaker referencing another virtual speaker. vOv - var/atom/movable/virtualspeaker/virt = new(null) + var/atom/movable/virtualspeaker/virt = PoolOrNew(/atom/movable/virtualspeaker,null) virt.name = source virt.job = job virt.faketrack = 1 diff --git a/html/changelogs/Jordie0608-PR-4838.yml b/html/changelogs/Jordie0608-PR-4838.yml new file mode 100644 index 00000000000..efcf16c26b6 --- /dev/null +++ b/html/changelogs/Jordie0608-PR-4838.yml @@ -0,0 +1,6 @@ +author: Jordie0608 + +delete-after: True + +changes: + - tweak: Grille damage update, humans now deal less unarmed damage to grilles while projectiles and items deal more. \ No newline at end of file diff --git a/icons/mob/head.dmi b/icons/mob/head.dmi index 333ed1fdc92..eebb5300d0b 100644 Binary files a/icons/mob/head.dmi and b/icons/mob/head.dmi differ diff --git a/icons/mob/suit.dmi b/icons/mob/suit.dmi index 5bc9546152e..6b212898009 100644 Binary files a/icons/mob/suit.dmi and b/icons/mob/suit.dmi differ diff --git a/tgstation.dme b/tgstation.dme index 3476b1b8f90..5ee02581787 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -672,6 +672,7 @@ #include "code\game\objects\structures\transit_tubes\station.dm" #include "code\game\objects\structures\transit_tubes\transit_tube.dm" #include "code\game\objects\structures\transit_tubes\transit_tube_pod.dm" +#include "code\game\pooling\atom_pool.dm" #include "code\game\turfs\simulated.dm" #include "code\game\turfs\turf.dm" #include "code\game\turfs\unsimulated.dm"