diff --git a/baystation12.dme b/baystation12.dme index 46751361fe..5e58985c8c 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -1,10 +1,53 @@ // DM Environment file for baystation12.dme. -// All manual changes should be made outside the BEGIN_ and END_ blocks. - // New source code should be placed in .dm files: choose File/New --> Code File. +// All manual changes should be made outside the BEGIN_ and END_ blocks. + // New source code should be placed in .dm files: choose File/New --> Code File. // BEGIN_INTERNALS // END_INTERNALS // BEGIN_FILE_DIR #define FILE_DIR . +#define FILE_DIR "code" +#define FILE_DIR "code/TriDimension" +#define FILE_DIR "code/WorkInProgress" +#define FILE_DIR "code/WorkInProgress/Cael_Aislinn" +#define FILE_DIR "code/WorkInProgress/Cael_Aislinn/Rust" +#define FILE_DIR "code/WorkInProgress/Cael_Aislinn/Supermatter" +#define FILE_DIR "code/WorkInProgress/Susan" +#define FILE_DIR "html" +#define FILE_DIR "icons" +#define FILE_DIR "icons/48x48" +#define FILE_DIR "icons/effects" +#define FILE_DIR "icons/mecha" +#define FILE_DIR "icons/misc" +#define FILE_DIR "icons/mob" +#define FILE_DIR "icons/mob/human_races" +#define FILE_DIR "icons/obj" +#define FILE_DIR "icons/obj/assemblies" +#define FILE_DIR "icons/obj/atmospherics" +#define FILE_DIR "icons/obj/clothing" +#define FILE_DIR "icons/obj/doors" +#define FILE_DIR "icons/obj/flora" +#define FILE_DIR "icons/obj/machines" +#define FILE_DIR "icons/obj/pipes" +#define FILE_DIR "icons/pda_icons" +#define FILE_DIR "icons/spideros_icons" +#define FILE_DIR "icons/Testing" +#define FILE_DIR "icons/turf" +#define FILE_DIR "icons/vending_icons" +#define FILE_DIR "maps" +#define FILE_DIR "sound" +#define FILE_DIR "sound/AI" +#define FILE_DIR "sound/ambience" +#define FILE_DIR "sound/effects" +#define FILE_DIR "sound/effects/wind" +#define FILE_DIR "sound/hallucinations" +#define FILE_DIR "sound/items" +#define FILE_DIR "sound/machines" +#define FILE_DIR "sound/mecha" +#define FILE_DIR "sound/misc" +#define FILE_DIR "sound/piano" +#define FILE_DIR "sound/violin" +#define FILE_DIR "sound/voice" +#define FILE_DIR "sound/weapons" // END_FILE_DIR // BEGIN_PREFERENCES @@ -388,12 +431,10 @@ #include "code\game\objects\explosion_recursive.dm" #include "code\game\objects\items.dm" #include "code\game\objects\objs.dm" -#include "code\game\objects\sign_decals.dm" #include "code\game\objects\structures.dm" #include "code\game\objects\weapons.dm" #include "code\game\objects\closets\walllocker.dm" #include "code\game\objects\effects\aliens.dm" -#include "code\game\objects\effects\barsign.dm" #include "code\game\objects\effects\biomass_rift.dm" #include "code\game\objects\effects\bump_teleporter.dm" #include "code\game\objects\effects\effect_system.dm" @@ -405,7 +446,6 @@ #include "code\game\objects\effects\misc.dm" #include "code\game\objects\effects\overlays.dm" #include "code\game\objects\effects\portals.dm" -#include "code\game\objects\effects\signs.dm" #include "code\game\objects\effects\step_triggers.dm" #include "code\game\objects\effects\decals\cleanable.dm" #include "code\game\objects\effects\decals\contraband.dm" @@ -556,6 +596,8 @@ #include "code\game\objects\structures\morgue.dm" #include "code\game\objects\structures\musician.dm" #include "code\game\objects\structures\noticeboard.dm" +#include "code\game\objects\structures\safe.dm" +#include "code\game\objects\structures\signs.dm" #include "code\game\objects\structures\tables_racks.dm" #include "code\game\objects\structures\tank_dispenser.dm" #include "code\game\objects\structures\target_stake.dm" @@ -729,10 +771,10 @@ #include "code\modules\clothing\under\jobs\security.dm" #include "code\modules\customitems\item_defines.dm" #include "code\modules\customitems\item_spawning.dm" -#include "code\modules\DetectiveWork\detective_work.dm" -#include "code\modules\DetectiveWork\evidence.dm" -#include "code\modules\DetectiveWork\footprints_and_rag.dm" -#include "code\modules\DetectiveWork\scanner.dm" +#include "code\modules\detectivework\detective_work.dm" +#include "code\modules\detectivework\evidence.dm" +#include "code\modules\detectivework\footprints_and_rag.dm" +#include "code\modules\detectivework\scanner.dm" #include "code\modules\events\alien_infestation.dm" #include "code\modules\events\blob.dm" #include "code\modules\events\carp_migration.dm" @@ -1135,7 +1177,6 @@ #include "code\WorkInProgress\Cael_Aislinn\Supermatter\SuperMatter.dm" #include "code\WorkInProgress\Cael_Aislinn\Supermatter\ZeroPointLaser.dm" #include "code\WorkInProgress\Chinsky\ashtray.dm" -#include "code\WorkInProgress\Mini\atmos_control.dm" #include "code\WorkInProgress\Ported\policetape.dm" #include "code\WorkInProgress\SkyMarshal\Ultralight_procs.dm" #include "code\WorkInProgress\Susan\susan_desert_turfs.dm" @@ -1158,7 +1199,7 @@ #include "code\ZAS\ZAS_Zones.dm" #include "interface\interface.dm" #include "interface\skin.dmf" -#include "maps\tgstation.2.0.9.1.dmm" +#include "maps\tgstation.2.1.0.dmm" #include "maps\RandomZLevels\Academy.dm" #include "maps\RandomZLevels\challenge.dm" #include "maps\RandomZLevels\stationCollision.dm" diff --git a/code/WorkInProgress/Chinsky/ashtray.dm b/code/WorkInProgress/Chinsky/ashtray.dm index 9948c30663..1af757b962 100644 --- a/code/WorkInProgress/Chinsky/ashtray.dm +++ b/code/WorkInProgress/Chinsky/ashtray.dm @@ -29,7 +29,7 @@ var/obj/item/clothing/mask/cigarette/cig = W if (cig.lit == 1) src.visible_message("[user] crushes [cig] in [src], putting it out.") - cig.put_out() + cig.smoketime = 0 else if (cig.lit == 0) if(istype(cig, /obj/item/weapon/match)) user << "You place [cig] in [src] without even lighting it. Why would you do that?" diff --git a/code/WorkInProgress/Susan/susan_desert_turfs.dm b/code/WorkInProgress/Susan/susan_desert_turfs.dm index 788e665a81..011398b845 100644 --- a/code/WorkInProgress/Susan/susan_desert_turfs.dm +++ b/code/WorkInProgress/Susan/susan_desert_turfs.dm @@ -6,7 +6,6 @@ turf/unsimulated/desert icon_state = "desert" temperature = 393.15 luminosity = 5 - brightness_on = 1 lighting_lumcount = 8 turf/unsimulated/desert/New() @@ -54,47 +53,8 @@ turf/unsimulated/desert/New() //corpses and possibly other decorative items -/obj/effect/landmark/corpse/alien/New() //Creates a mob and checks for gear in each slot before attempting to equip it. - var/mob/living/carbon/human/M = new /mob/living/carbon/human (src.loc) - M.dna.mutantrace = "lizard" - M.real_name = src.name - M.stat = 2 //Kills the new mob - if(src.corpseuniform) - M.equip_to_slot_or_del(new src.corpseuniform(M), slot_w_uniform) - if(src.corpsesuit) - M.equip_to_slot_or_del(new src.corpsesuit(M), slot_wear_suit) - if(src.corpseshoes) - M.equip_to_slot_or_del(new src.corpseshoes(M), slot_shoes) - if(src.corpsegloves) - M.equip_to_slot_or_del(new src.corpsegloves(M), slot_gloves) - if(src.corpseradio) - M.equip_to_slot_or_del(new src.corpseradio(M), slot_ears) - if(src.corpseglasses) - M.equip_to_slot_or_del(new src.corpseglasses(M), slot_glasses) - if(src.corpsemask) - M.equip_to_slot_or_del(new src.corpsemask(M), slot_wear_mask) - if(src.corpsehelmet) - M.equip_to_slot_or_del(new src.corpsehelmet(M), slot_head) - if(src.corpsebelt) - M.equip_to_slot_or_del(new src.corpsebelt(M), slot_belt) - if(src.corpsepocket1) - M.equip_to_slot_or_del(new src.corpsepocket1(M), slot_r_store) - if(src.corpsepocket2) - M.equip_to_slot_or_del(new src.corpsepocket2(M), slot_l_store) - if(src.corpseback) - M.equip_to_slot_or_del(new src.corpseback(M), slot_back) - if(src.corpseid == 1) - var/obj/item/weapon/card/id/W = new(M) - W.name = "[M.real_name]'s ID Card" - if(src.corpseidicon) - W.icon_state = corpseidicon - if(src.corpseidaccess) - W.access = get_access(corpseidaccess) - if(corpseidjob) - W.assignment = corpseidjob - W.registered_name = M.real_name - M.equip_to_slot_or_del(W, slot_wear_id) - del(src) +/obj/effect/landmark/corpse/alien + mutantrace = "lizard" /obj/effect/landmark/corpse/alien/cargo name = "Cargo Technician" diff --git a/code/WorkInProgress/autopsy.dm b/code/WorkInProgress/autopsy.dm index 2137141996..7cbc8a4017 100644 --- a/code/WorkInProgress/autopsy.dm +++ b/code/WorkInProgress/autopsy.dm @@ -1,3 +1,12 @@ + +//moved these here from code/defines/obj/weapon.dm +//please preference put stuff where it's easy to find - C + +/obj/item/weapon/autopsy_scanner/var/list/datum/autopsy_data_scanner/wdata = list() +/obj/item/weapon/autopsy_scanner/var/list/datum/autopsy_data_scanner/chemtraces = list() +/obj/item/weapon/autopsy_scanner/var/target_name = null +/obj/item/weapon/autopsy_scanner/var/timeofdeath = null + /datum/autopsy_data_scanner var/weapon = null // this is the DEFINITE weapon type that was used var/list/organs_scanned = list() // this maps a number of scanned organs to diff --git a/code/WorkInProgress/surgery.dm b/code/WorkInProgress/surgery.dm index f07cf4b1f0..f7edadc0be 100644 --- a/code/WorkInProgress/surgery.dm +++ b/code/WorkInProgress/surgery.dm @@ -884,6 +884,8 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user) user.visible_message("\red [user]'s hand slips, tearing [target]'s innards with \the [tool]!", \ "\red Your hand slips, tearing [target]'s innards with \the [tool]!") +//see slimes +/* /datum/surgery_step/metroid/saw_core required_tool = /obj/item/weapon/circular_saw @@ -909,6 +911,7 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user) fail_step(mob/user, mob/living/carbon/metroid/target, target_zone, obj/item/tool) user.visible_message("\red [user]'s hand slips, failing to cut core out!", \ "\red Your hand slips, failing to cut core out!") +*/ ////////////////////////////////////////////////////////////////// // LIMB SURGERY // @@ -1182,7 +1185,7 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user) can_use(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/embryo = 0 - for(var/datum/disease/alien_embryo/A in target.viruses) + for(var/obj/item/alien_embryo/A in target) embryo = 1 break return ..() && embryo && target.ribcage_op_stage == 2 @@ -1197,11 +1200,8 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user) user.visible_message("\red [user] rips the larva out of [target]'s ribcage!", "You rip the larva out of [target]'s ribcage!") - var/mob/living/carbon/alien/larva/stupid = new(target.loc) - stupid.death(0) - - for(var/datum/disease/alien_embryo in target.viruses) - alien_embryo.cure() + for(var/obj/item/alien_embryo/A in target) + A.loc = A.loc.loc if (ishuman(user)) user:bloody_hands(target, 0) diff --git a/code/ZAS/Airflow.dm b/code/ZAS/Airflow.dm index e2edcaac7a..e4cb38dc09 100644 --- a/code/ZAS/Airflow.dm +++ b/code/ZAS/Airflow.dm @@ -206,8 +206,9 @@ proc/AirflowSpace(zone/A) if(M.last_airflow > world.time - vsc.airflow_delay) continue if(ismob(M) && n > vsc.airflow_stun_pressure) - if(M:nodamage) continue - M:airflow_stun() + var/mob/O = M + if(O.status_flags & GODMODE) continue + O.airflow_stun() if(M.check_airflow_movable(n)) diff --git a/code/ZAS/FEA_gas_mixture.dm b/code/ZAS/FEA_gas_mixture.dm index 05bb2e4e60..a4104ab01c 100644 --- a/code/ZAS/FEA_gas_mixture.dm +++ b/code/ZAS/FEA_gas_mixture.dm @@ -4,6 +4,13 @@ What are the archived variables for? This prevents race conditions that arise based on the order of tile processing. */ +#define SPECIFIC_HEAT_TOXIN 200 +#define SPECIFIC_HEAT_AIR 20 +#define SPECIFIC_HEAT_CDO 30 +#define HEAT_CAPACITY_CALCULATION(oxygen,carbon_dioxide,nitrogen,toxins) \ + (carbon_dioxide*SPECIFIC_HEAT_CDO + (oxygen+nitrogen)*SPECIFIC_HEAT_AIR + toxins*SPECIFIC_HEAT_TOXIN) + +#define MINIMUM_HEAT_CAPACITY 0.0003 #define QUANTIZE(variable) (round(variable,0.0001)) #define TRANSFER_FRACTION 5 //What fraction (1/#) of the air difference to try and transfer diff --git a/code/ZAS/ZAS_Zones.dm b/code/ZAS/ZAS_Zones.dm index 17867abf26..b219a10b13 100644 --- a/code/ZAS/ZAS_Zones.dm +++ b/code/ZAS/ZAS_Zones.dm @@ -151,8 +151,10 @@ zone/proc/process() //Sometimes explosions will cause the air to be deleted for some reason. if(!air) air = new() - air.adjust(MOLES_O2STANDARD, 0, MOLES_N2STANDARD, 0, list()) + air.oxygen = MOLES_O2STANDARD + air.nitrogen = MOLES_N2STANDARD air.temperature = T0C + air.total_moles() world.log << "Air object lost in zone. Regenerating." progress = "problem with: ShareSpace()" diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index a031a436c9..3cd5faff48 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -275,7 +275,8 @@ proc/isInSight(var/atom/A, var/atom/B) if(M.ckey == lowertext(key)) return M return null -/* + +//i think this is used soley by verb/give(), cael proc/check_can_reach(atom/user, atom/target) if(!in_range(user,target)) return 0 @@ -315,9 +316,8 @@ var/list/DummyCache = list() D.loc = null DummyCache.Add(D) return 1 -*/ -// Will return a list of active candidates. It increases the buffer 5 times until it finds a candidate which is active within the buffer. +// 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_active_candidates(var/buffer = 1) var/list/candidates = list() //List of candidate KEYS to assume control of the new larva ~Carn diff --git a/code/controllers/_DynamicAreaLighting_TG.dm b/code/controllers/_DynamicAreaLighting_TG.dm index 4ead017196..5f87620780 100644 --- a/code/controllers/_DynamicAreaLighting_TG.dm +++ b/code/controllers/_DynamicAreaLighting_TG.dm @@ -300,73 +300,6 @@ area //show the dark overlay so areas, not yet in a lighting subarea, won't be bright as day and look silly. SetLightLevel(4) -atom - var/light_on = 0 //Am I emitting light? - var/brightness_on = 0 //Luminosity when the above: light_on = 1 - - //Called when turning off or dropping a flashlight for ex. - //It checks the users slots for another source of light, and return the appropriate brightness. 0 if no other source is found - proc/search_light(mob/M, obj/item/W as obj) - var/list/slots - var/obj/item/I - var brightness = 0 //the new brightness to be returned - - if (istype(M, /mob/living/carbon/human)) - var/mob/living/carbon/human/H = M - slots = list ( - "l_hand", - "r_hand", - "belt", - "head", - "l_pocket", - "r_pocket", - "s_store") - - for (var/slot in slots) - switch(slot) - if("belt") - I = H.belt - if("head") - I = H.head - if("l_hand") - I = H.l_hand - if("r_hand") - I = H.r_hand - if("l_pocket") - I = H.l_store - if("r_pocket") - I = H.r_store - if("s_store") - I = H.s_store - if (I) - if ((I.light_on) && (I != W)) //an item emitting light other than itself - if (I.brightness_on > brightness) - brightness = I.brightness_on - - else if (istype(M, /mob/living/carbon/monkey)) - slots = list ( - "l_hand", - "r_hand") - - for (var/slot in slots) - switch(slot) - if("l_hand") - I = M.l_hand - if("r_hand") - I = M.r_hand - if (I) - if ((I.light_on) && (I != W)) //an item emitting light other than itself - if (I.brightness_on > brightness) - brightness = I.brightness_on - - else - for (I in M.contents) //Justin Case - if (I) - if ((I.light_on) && (I != W)) //an item emitting light other than itself - if (I.brightness_on > brightness) - brightness = I.brightness_on - - return brightness #undef LIGHTING_MAX_LUMINOSITY #undef LIGHTING_MAX_LUMINOSITY_MOB diff --git a/code/datums/supplypacks.dm b/code/datums/supplypacks.dm index cbe77117b5..6ff1b4acf1 100755 --- a/code/datums/supplypacks.dm +++ b/code/datums/supplypacks.dm @@ -101,9 +101,7 @@ /obj/item/weapon/reagent_containers/food/drinks/beer, /obj/item/weapon/reagent_containers/food/drinks/beer, /obj/item/weapon/reagent_containers/food/drinks/beer, - /obj/item/weapon/reagent_containers/food/drinks/beer, - /obj/item/weapon/cigpacket/dromedaryco, - /obj/item/weapon/lipstick/random) + /obj/item/weapon/reagent_containers/food/drinks/beer) cost = 20 containertype = /obj/structure/closet/crate containername = "Party equipment" @@ -657,7 +655,7 @@ /datum/supply_packs/artscrafts name = "Arts and Crafts supplies" - contains = list(/obj/item/weapon/storage/crayonbox, + contains = list(/obj/item/weapon/storage/fancy/crayons, /obj/item/device/camera, /obj/item/device/camera_film, /obj/item/device/camera_film, @@ -735,8 +733,8 @@ name = "Sterile equipment crate" contains = list(/obj/item/clothing/under/rank/medical/green, /obj/item/clothing/under/rank/medical/green, - /obj/item/weapon/storage/stma_kit, - /obj/item/weapon/storage/lglo_kit) + /obj/item/weapon/storage/box/masks, + /obj/item/weapon/storage/box/gloves) cost = 10 containertype = "/obj/structure/closet/crate" containername = "Sterile equipment crate" diff --git a/code/game/atoms.dm b/code/game/atoms.dm index d3554ef839..1451ad6264 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -822,7 +822,6 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl if ( !alien.restrained() ) attack_larva(alien) - else if(ismetroid(usr)) else if(isslime(usr)) var/mob/living/carbon/slime/slime = usr //-slime stuff- diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm index 333af390eb..fccb79cdbf 100644 --- a/code/game/gamemodes/events.dm +++ b/code/game/gamemodes/events.dm @@ -15,7 +15,8 @@ event() hadevent = 1 else - Holiday_Random_Event() else + Holiday_Random_Event() + else event = 0 sleep(2400) diff --git a/code/game/jobs/job/civilian.dm b/code/game/jobs/job/civilian.dm index 36d240dbd0..5c072d60db 100644 --- a/code/game/jobs/job/civilian.dm +++ b/code/game/jobs/job/civilian.dm @@ -290,7 +290,8 @@ H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand) else H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) - H.equip_to_slot_or_del(new /obj/item/key(H), slot_l_store) return 1 + H.equip_to_slot_or_del(new /obj/item/key(H), slot_l_store) + return 1 diff --git a/code/game/jobs/job/science.dm b/code/game/jobs/job/science.dm index 573c1a9e8d..a59ce9d67e 100644 --- a/code/game/jobs/job/science.dm +++ b/code/game/jobs/job/science.dm @@ -84,7 +84,7 @@ H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/roboticist(H), slot_w_uniform) H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes) H.equip_to_slot_or_del(new /obj/item/device/pda/roboticist(H), slot_belt) - H.equip_to_slot_or_del(new /obj/item/clothing/suit/labcoat(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/labcoat(H), slot_wear_suit) // H.equip_to_slot_or_del(new /obj/item/clothing/gloves/black(H), slot_gloves) H.equip_to_slot_or_del(new /obj/item/weapon/storage/toolbox/mechanical(H), slot_l_hand) if(H.backbag == 1) diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index 896bf363b1..228f585a90 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -1,6 +1,5 @@ -//////////////////////////////////////// -//CONTAINS: Air Alarms and Fire Alarms// -//////////////////////////////////////// +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 + /proc/RandomAAlarmWires() //to make this not randomize the wires, just set index to 1 and increment it in the flag for loop (after doing everything else). @@ -22,769 +21,601 @@ flagIndex+=1 return AAlarmwires -#define AALARM_WIRE_IDSCAN 1 //Added wires -#define AALARM_WIRE_POWER 2 -#define AALARM_WIRE_SYPHON 3 -#define AALARM_WIRE_AI_CONTROL 4 -#define AALARM_WIRE_AALARM 5 -#define AALARM_MODE_SCRUBBING 1 -#define AALARM_MODE_REPLACEMENT 2 //like scrubbing, but faster. -#define AALARM_MODE_PANIC 3 //constantly sucks all air -#define AALARM_MODE_CYCLE 4 //sucks off all air, then refill and swithes to scrubbing -#define AALARM_MODE_FILL 5 //emergency fill -#define AALARM_SCREEN_MAIN 1 -#define AALARM_SCREEN_VENT 2 -#define AALARM_SCREEN_SCRUB 3 -#define AALARM_SCREEN_MODE 4 -#define AALARM_SCREEN_SENSORS 5 - -#define AALARM_REPORT_TIMEOUT 100 - -#define RCON_NO 1 -#define RCON_AUTO 2 -#define RCON_YES 3 - -//all air alarms in area are connected via magic -/area - var/obj/machinery/alarm/master_air_alarm - var/list/air_vent_names - var/list/air_scrub_names - var/list/air_vent_info - var/list/air_scrub_info +// A datum for dealing with threshold limit values +// used in /obj/machinery/alarm +/datum/tlv + var/min2 + var/min1 + var/max1 + var/max2 + New(_min2 as num, _min1 as num, _max1 as num, _max2 as num) + min2 = _min2 + min1 = _min1 + max1 = _max1 + max2 = _max2 + proc/get_danger_level(curval as num) + if (max2 >=0 && curval>=max2) + return 2 + if (min2 >=0 && curval<=min2) + return 2 + if (max1 >=0 && curval>=max1) + return 1 + if (min1 >=0 && curval<=min1) + return 1 + return 0 + proc/CopyFrom(datum/tlv/other) + min2 = other.min2 + min1 = other.min1 + max1 = other.max1 + max2 = other.max2 /obj/machinery/alarm name = "alarm" - icon = 'monitors.dmi' + icon = 'icons/obj/monitors.dmi' icon_state = "alarm0" anchored = 1 use_power = 1 idle_power_usage = 4 active_power_usage = 8 power_channel = ENVIRON - req_access = list(access_atmospherics, access_engine_equip) + req_access = list(access_atmospherics) var/frequency = 1439 //var/skipprocess = 0 //Experimenting var/alarm_frequency = 1437 - var/remote_control = 0 - var/rcon_setting = 2 - var/rcon_time = 0 +#define AALARM_REPORT_TIMEOUT 100 + var/datum/radio_frequency/radio_connection var/locked = 1 var/wiresexposed = 0 // If it's been screwdrivered open. var/aidisabled = 0 var/AAlarmwires = 31 var/shorted = 0 + var/buildstage = 2 // 2 = complete, 1 = no wires, 0 = circuit gone + // Uses code from apc.dm + +#define AALARM_WIRE_IDSCAN 1 //Added wires +#define AALARM_WIRE_POWER 2 +#define AALARM_WIRE_SYPHON 3 +#define AALARM_WIRE_AI_CONTROL 4 +#define AALARM_WIRE_AALARM 5 + + +#define AALARM_MODE_SCRUBBING 1 +#define AALARM_MODE_VENTING 2 //makes draught +#define AALARM_MODE_PANIC 3 //constantly sucks all air +#define AALARM_MODE_REPLACEMENT 4 //sucks off all air, then refill and swithes to scrubbing +#define AALARM_MODE_OFF 5 var/mode = AALARM_MODE_SCRUBBING + +#define AALARM_SCREEN_MAIN 1 +#define AALARM_SCREEN_VENT 2 +#define AALARM_SCREEN_SCRUB 3 +#define AALARM_SCREEN_MODE 4 +#define AALARM_SCREEN_SENSORS 5 var/screen = AALARM_SCREEN_MAIN var/area_uid var/area/alarm_area var/danger_level = 0 - var/datum/radio_frequency/radio_connection + // breathable air according to human/Life() + var/list/TLV = list( + "oxygen" = new/datum/tlv( 16, 19, 135, 140), // Partial pressure, kpa + "carbon dioxide" = new/datum/tlv(-1.0, -1.0, 5, 10), // Partial pressure, kpa + "plasma" = new/datum/tlv(-1.0, -1.0, 0.2, 0.5), // Partial pressure, kpa + "other" = new/datum/tlv(-1.0, -1.0, 0.5, 1.0), // Partial pressure, kpa + "pressure" = new/datum/tlv(ONE_ATMOSPHERE*0.80,ONE_ATMOSPHERE*0.90,ONE_ATMOSPHERE*1.10,ONE_ATMOSPHERE*1.20), /* kpa */ + "temperature" = new/datum/tlv(T0C, T0C+10, T0C+40, T0C+66), // K + ) - var/list/TLV = list() +/* + // breathable air according to wikipedia + "oxygen" = new/datum/tlv( 9, 12, 158, 296), // Partial pressure, kpa + "carbon dioxide" = new/datum/tlv(-1.0,-1.0, 0.5, 1), // Partial pressure, kpa +*/ +/obj/machinery/alarm/server + //req_access = list(access_rd) //no, let departaments to work together + TLV = list( + "oxygen" = new/datum/tlv(-1.0, -1.0,-1.0,-1.0), // Partial pressure, kpa + "carbon dioxide" = new/datum/tlv(-1.0, -1.0, 5, 10), // Partial pressure, kpa + "plasma" = new/datum/tlv(-1.0, -1.0, 0.2, 0.5), // Partial pressure, kpa + "other" = new/datum/tlv(-1.0, -1.0, 0.5, 1.0), // Partial pressure, kpa + "pressure" = new/datum/tlv(-1.0, -1.0, -1.0, -1.0), /* kpa */ + "temperature" = new/datum/tlv(40, 60, 120, 140), // K + ) - server/New() - ..() - req_access = list(access_rd, access_atmospherics, access_engine_equip) - TLV["oxygen"] = list(-1.0, -1.0,-1.0,-1.0) // Partial pressure, kpa - TLV["carbon dioxide"] = list(-1.0, -1.0, 5, 10) // Partial pressure, kpa - TLV["plasma"] = list(-1.0, -1.0, 0.2, 0.5) // Partial pressure, kpa - TLV["other"] = list(-1.0, -1.0, 0.5, 1.0) // Partial pressure, kpa - TLV["pressure"] = list(0,ONE_ATMOSPHERE*0.10,ONE_ATMOSPHERE*1.40,ONE_ATMOSPHERE*1.60) /* kpa */ - TLV["temperature"] = list(20, 40, 140, 160) // K +/obj/machinery/alarm/kitchen_cold_room + TLV = list( + "oxygen" = new/datum/tlv( 16, 19, 135, 140), // Partial pressure, kpa + "carbon dioxide" = new/datum/tlv(-1.0, -1.0, 5, 10), // Partial pressure, kpa + "plasma" = new/datum/tlv(-1.0, -1.0, 0.2, 0.5), // Partial pressure, kpa + "other" = new/datum/tlv(-1.0, -1.0, 0.5, 1.0), // Partial pressure, kpa + "pressure" = new/datum/tlv(ONE_ATMOSPHERE*0.80,ONE_ATMOSPHERE*0.90,ONE_ATMOSPHERE*1.50,ONE_ATMOSPHERE*1.60), /* kpa */ + "temperature" = new/datum/tlv(200, 210, 273.15, 283.15), // K + ) - New() - ..() - alarm_area = get_area(src) - if (alarm_area.master) - alarm_area = alarm_area.master - area_uid = alarm_area.uid - if (name == "alarm") - name = "[alarm_area.name] Air Alarm" +//all air alarms in area are connected via magic +/area + var/obj/machinery/alarm/master_air_alarm + var/list/air_vent_names = list() + var/list/air_scrub_names = list() + var/list/air_vent_info = list() + var/list/air_scrub_info = list() - // breathable air according to human/Life() - TLV["oxygen"] = list(16, 19, 135, 140) // Partial pressure, kpa - TLV["carbon dioxide"] = list(-1.0, -1.0, 5, 10) // Partial pressure, kpa - TLV["plasma"] = list(-1.0, -1.0, 0.2, 0.5) // Partial pressure, kpa - TLV["other"] = list(-1.0, -1.0, 0.5, 1.0) // Partial pressure, kpa - TLV["pressure"] = list(ONE_ATMOSPHERE*0.80,ONE_ATMOSPHERE*0.90,ONE_ATMOSPHERE*1.10,ONE_ATMOSPHERE*1.20) /* kpa */ - TLV["temperature"] = list(T0C, T0C+10, T0C+40, T0C+66) // K +/obj/machinery/alarm/New(nloc, ndir, nbuild) + ..() + if(nloc) + loc = nloc - initialize() - set_frequency(frequency) - if (!master_is_operating()) - elect_master() + if(ndir) + dir = ndir + if(nbuild) + buildstage = 0 + wiresexposed = 1 + pixel_x = (dir & 3)? 0 : (dir == 4 ? -24 : 24) + pixel_y = (dir & 3)? (dir ==1 ? -24 : 24) : 0 - process() - if((stat & (NOPOWER|BROKEN)) || shorted) - return - - var/turf/simulated/location = loc - ASSERT(istype(location)) - - var/datum/gas_mixture/environment = location.return_air() - var/partial_pressure = R_IDEAL_GAS_EQUATION*environment.temperature/environment.volume - - var/list/current_settings = TLV["pressure"] - var/environment_pressure = environment.return_pressure() - var/pressure_dangerlevel = get_danger_level(environment_pressure, current_settings) - - current_settings = TLV["oxygen"] - var/oxygen_dangerlevel = get_danger_level(environment.oxygen*partial_pressure, current_settings) - - current_settings = TLV["carbon dioxide"] - var/co2_dangerlevel = get_danger_level(environment.carbon_dioxide*partial_pressure, current_settings) - - current_settings = TLV["plasma"] - var/plasma_dangerlevel = get_danger_level(environment.toxins*partial_pressure, current_settings) - - current_settings = TLV["other"] - var/other_moles = 0.0 - for(var/datum/gas/G in environment.trace_gases) - other_moles+=G.moles - var/other_dangerlevel = get_danger_level(other_moles*partial_pressure, current_settings) - - current_settings = TLV["temperature"] - var/temperature_dangerlevel = get_danger_level(environment.temperature, current_settings) - - var/old_danger_level = danger_level - danger_level = max(pressure_dangerlevel, - oxygen_dangerlevel, - co2_dangerlevel, - plasma_dangerlevel, - other_dangerlevel, - temperature_dangerlevel) - - if (old_danger_level != danger_level) - apply_danger_level(danger_level) - - if (mode==AALARM_MODE_CYCLE && environment_pressure= danger_levels[4] || current_value <= danger_levels[1]) - return 2 - if(current_value >= danger_levels[3] || current_value <= danger_levels[2]) - return 1 - return 0 + alarm_area = get_area(loc) + if (alarm_area.master) + alarm_area = alarm_area.master + area_uid = alarm_area.uid + if (name == "alarm") + name = "[alarm_area.name] Air Alarm" update_icon() - if(wiresexposed) - icon_state = "alarmx" - return - if((stat & (NOPOWER|BROKEN)) || shorted) - icon_state = "alarmp" - return - switch(max(danger_level, alarm_area.atmosalm)) - if (0) - icon_state = "alarm0" - if (1) - icon_state = "alarm2" //yes, alarm2 is yellow alarm - if (2) - icon_state = "alarm1" - receive_signal(datum/signal/signal) - if(stat & (NOPOWER|BROKEN)) - return - if (alarm_area.master_air_alarm != src) - if (master_is_operating()) - return - elect_master() - if (alarm_area.master_air_alarm != src) - return - if(!signal || signal.encryption) - return - var/id_tag = signal.data["tag"] - if (!id_tag) - return - if (signal.data["area"] != area_uid) - return - if (signal.data["sigtype"] != "status") +/obj/machinery/alarm/initialize() + set_frequency(frequency) + if (!master_is_operating()) + elect_master() + +/obj/machinery/alarm/proc/master_is_operating() + return alarm_area.master_air_alarm && !(alarm_area.master_air_alarm.stat & (NOPOWER|BROKEN)) + +/obj/machinery/alarm/proc/elect_master() + for (var/area/A in alarm_area.related) + for (var/obj/machinery/alarm/AA in A) + if (!(AA.stat & (NOPOWER|BROKEN))) + alarm_area.master_air_alarm = AA + return 1 + return 0 + +/obj/machinery/alarm/attack_hand(mob/user) + . = ..() + if (.) + return + user.set_machine(src) + + if ( (get_dist(src, user) > 1 )) + if (!istype(user, /mob/living/silicon)) + user.unset_machine() + user << browse(null, "window=air_alarm") + user << browse(null, "window=AAlarmwires") return - var/dev_type = signal.data["device"] - if(!(id_tag in alarm_area.air_scrub_names) && !(id_tag in alarm_area.air_vent_names)) - register_env_machine(id_tag, dev_type) - if(dev_type == "AScr") - alarm_area.air_scrub_info[id_tag] = signal.data - else if(dev_type == "AVP") - alarm_area.air_vent_info[id_tag] = signal.data - proc/register_env_machine(var/m_id, var/device_type) - var/new_name - if (device_type=="AVP") - new_name = "[alarm_area.name] Vent Pump #[alarm_area.air_vent_names.len+1]" - alarm_area.air_vent_names[m_id] = new_name - else if (device_type=="AScr") - new_name = "[alarm_area.name] Air Scrubber #[alarm_area.air_scrub_names.len+1]" - alarm_area.air_scrub_names[m_id] = new_name - else + else if (istype(user, /mob/living/silicon) && src.aidisabled) + user << "AI control for this Air Alarm interface has been disabled." + user << browse(null, "window=air_alarm") return - spawn (10) - send_signal(m_id, list("init" = new_name) ) - proc/refresh_all() - for(var/id_tag in alarm_area.air_vent_names) - var/list/I = alarm_area.air_vent_info[id_tag] - if (I && I["timestamp"]+AALARM_REPORT_TIMEOUT/2 > world.time) - continue - send_signal(id_tag, list("status") ) - for(var/id_tag in alarm_area.air_scrub_names) - var/list/I = alarm_area.air_scrub_info[id_tag] - if (I && I["timestamp"]+AALARM_REPORT_TIMEOUT/2 > world.time) - continue - send_signal(id_tag, list("status") ) + if(wiresexposed && (!istype(user, /mob/living/silicon))) + var/t1 = text("[alarm_area.name] Air Alarm WiresAccess Panel
\n") + var/list/AAlarmwires = list( + "Orange" = 1, + "Dark red" = 2, + "White" = 3, + "Yellow" = 4, + "Black" = 5, + ) + for(var/wiredesc in AAlarmwires) + var/is_uncut = src.AAlarmwires & AAlarmWireColorToFlag[AAlarmwires[wiredesc]] + t1 += "[wiredesc] wire: " + if(!is_uncut) + t1 += "Mend" - proc/set_frequency(new_frequency) - radio_controller.remove_object(src, frequency) - frequency = new_frequency - radio_connection = radio_controller.add_object(src, frequency, RADIO_TO_AIRALARM) + else + t1 += "Cut " + t1 += "Pulse " - proc/send_signal(var/target, var/list/command)//sends signal 'command' to 'target'. Returns 0 if no radio connection, 1 otherwise - if(!radio_connection) - return 0 + t1 += "
" + t1 += text("
\n[(src.locked ? "The Air Alarm is locked." : "The Air Alarm is unlocked.")]
\n[((src.shorted || (stat & (NOPOWER|BROKEN))) ? "The Air Alarm is offline." : "The Air Alarm is working properly!")]
\n[(src.aidisabled ? "The 'AI control allowed' light is off." : "The 'AI control allowed' light is on.")]") + t1 += text("

Close

") + user << browse(t1, "window=AAlarmwires") + onclose(user, "AAlarmwires") - var/datum/signal/signal = new - signal.transmission_method = 1 //radio signal - signal.source = src + if(!shorted) + user << browse(return_text(),"window=air_alarm") + onclose(user, "air_alarm") + refresh_all() - signal.data = command - signal.data["tag"] = target - signal.data["sigtype"] = "command" + return - radio_connection.post_signal(src, signal, RADIO_FROM_AIRALARM) - // world << text("Signal [] Broadcasted to []", command, target) - return 1 +/obj/machinery/alarm/proc/isWireColorCut(var/wireColor) + var/wireFlag = AAlarmWireColorToFlag[wireColor] + return ((src.AAlarmwires & wireFlag) == 0) - proc/apply_mode() - var/current_pressures = TLV["pressure"] - var/target_pressure = (current_pressures[2] + current_pressures[3])/2 - switch(mode) - if(AALARM_MODE_SCRUBBING) - for(var/device_id in alarm_area.air_scrub_names) - send_signal(device_id, list("power"= 1, "co2_scrub"= 1, "setting"= 1, "scrubbing"= 1, "panic_siphon"= 0) ) - for(var/device_id in alarm_area.air_vent_names) - send_signal(device_id, list("power"= 1, "checks"= 1, "setting"= 1, "set_external_pressure"= target_pressure) ) +/obj/machinery/alarm/proc/isWireCut(var/wireIndex) + var/wireFlag = AAlarmIndexToFlag[wireIndex] + return ((src.AAlarmwires & wireFlag) == 0) - if(AALARM_MODE_PANIC, AALARM_MODE_CYCLE) - for(var/device_id in alarm_area.air_scrub_names) - send_signal(device_id, list("power"= 1, "panic_siphon"= 1) ) - for(var/device_id in alarm_area.air_vent_names) - send_signal(device_id, list("power"= 0) ) +/obj/machinery/alarm/proc/cut(var/wireColor) + var/wireFlag = AAlarmWireColorToFlag[wireColor] + var/wireIndex = AAlarmWireColorToIndex[wireColor] + AAlarmwires &= ~wireFlag + switch(wireIndex) + if(AALARM_WIRE_IDSCAN) + src.locked = 1 + //world << "Idscan wire cut" - if(AALARM_MODE_REPLACEMENT) - for(var/device_id in alarm_area.air_scrub_names) - send_signal(device_id, list("power"= 1, "co2_scrub"= 1, "setting"= 3, "scrubbing"= 1, "panic_siphon"= 0) ) - for(var/device_id in alarm_area.air_vent_names) - send_signal(device_id, list("power"= 1, "checks"= 1, "setting"= 3, "set_external_pressure"= target_pressure) ) + if(AALARM_WIRE_POWER) + src.shock(usr, 50) + src.shorted = 1 + update_icon() + //world << "Power wire cut" - if(AALARM_MODE_FILL) - for(var/device_id in alarm_area.air_scrub_names) - send_signal(device_id, list("power"= 0) ) - for(var/device_id in alarm_area.air_vent_names) - send_signal(device_id, list("power"= 1, "checks"= 1, "setting"= 3, "set_external_pressure"= target_pressure) ) + if (AALARM_WIRE_AI_CONTROL) + if (src.aidisabled == 0) + src.aidisabled = 1 + //world << "AI Control Wire Cut" - proc/apply_danger_level(var/new_danger_level) - alarm_area.atmosalm = new_danger_level + if(AALARM_WIRE_SYPHON) + mode = AALARM_MODE_PANIC + apply_mode() + //world << "Syphon Wire Cut" - for (var/area/A in alarm_area.related) - for (var/obj/machinery/alarm/AA in A) - if ( !(AA.stat & (NOPOWER|BROKEN)) && !AA.shorted && AA.danger_level != new_danger_level) - AA.update_icon() + if(AALARM_WIRE_AALARM) - if(danger_level > 1) - air_doors_close(0) - else - air_doors_open(0) + if (alarm_area.atmosalert(2)) + post_alert(2) + spawn(1) + src.updateUsrDialog() + update_icon() - update_icon() + //world << "AAlarm Wire Cut" - proc/air_doors_close(manual) - var/area/A = get_area(src) - if(!A.master.air_doors_activated) - A.master.air_doors_activated = 1 - for(var/obj/machinery/door/E in A.master.all_doors) - if(istype(E,/obj/machinery/door/firedoor)) - if(!E:blocked) - if(E.operating) - E:nextstate = CLOSED - else if(!E.density) - spawn(0) - E.close() - continue + src.updateDialog() + update_icon() -/* if(istype(E, /obj/machinery/door/airlock)) - if((!E:arePowerSystemsOn()) || (E.stat & NOPOWER) || E:air_locked) continue - if(!E.density) - spawn(0) - E.close() - spawn(10) - if(E.density) - E:air_locked = E.req_access - E:req_access = list(ACCESS_ENGINE, ACCESS_ATMOSPHERICS) - E.update_icon() - else if(E.operating) - spawn(10) - E.close() - if(E.density) - E:air_locked = E.req_access - E:req_access = list(ACCESS_ENGINE, ACCESS_ATMOSPHERICS) - E.update_icon() - else if(!E:locked) //Don't lock already bolted doors. - E:air_locked = E.req_access - E:req_access = list(ACCESS_ENGINE, ACCESS_ATMOSPHERICS) - E.update_icon()*/ + return - proc/air_doors_open(manual) - var/area/A = get_area(loc) - if(A.master.air_doors_activated) - A.master.air_doors_activated = 0 - for(var/obj/machinery/door/E in A.master.all_doors) - if(istype(E, /obj/machinery/door/firedoor)) - if(!E:blocked) - if(E.operating) - E:nextstate = OPEN - else if(E.density) - spawn(0) - E.open() - continue +/obj/machinery/alarm/proc/mend(var/wireColor) + var/wireFlag = AAlarmWireColorToFlag[wireColor] + var/wireIndex = AAlarmWireColorToIndex[wireColor] //not used in this function + AAlarmwires |= wireFlag + switch(wireIndex) + if(AALARM_WIRE_IDSCAN) + //world << "Idscan wire mended" -/* if(istype(E, /obj/machinery/door/airlock)) - if((!E:arePowerSystemsOn()) || (E.stat & NOPOWER)) continue - if(!isnull(E:air_locked)) //Don't mess with doors locked for other reasons. - E:req_access = E:air_locked - E:air_locked = null - E.update_icon()*/ + if(AALARM_WIRE_POWER) + src.shorted = 0 + src.shock(usr, 50) + update_icon() + //world << "Power wire mended" -/////////// -//HACKING// -/////////// - proc/isWireColorCut(var/wireColor) - var/wireFlag = AAlarmWireColorToFlag[wireColor] - return ((AAlarmwires & wireFlag) == 0) + if(AALARM_WIRE_AI_CONTROL) + if (src.aidisabled == 1) + src.aidisabled = 0 + //world << "AI Cont. wire mended" - proc/isWireCut(var/wireIndex) - var/wireFlag = AAlarmIndexToFlag[wireIndex] - return ((AAlarmwires & wireFlag) == 0) - proc/cut(var/wireColor) - var/wireFlag = AAlarmWireColorToFlag[wireColor] - var/wireIndex = AAlarmWireColorToIndex[wireColor] - AAlarmwires &= ~wireFlag - switch(wireIndex) - if(AALARM_WIRE_IDSCAN) - locked = 1 + // if(AALARM_WIRE_SYPHON) + // world << "Syphon Wire mended" - if(AALARM_WIRE_POWER) - shock(usr, 50) + + // if(AALARM_WIRE_AALARM) + //world << "AAlarm Wire mended" + + update_icon() + src.updateDialog() + return + +/obj/machinery/alarm/proc/pulse(var/wireColor) + //var/wireFlag = AAlarmWireColorToFlag[wireColor] //not used in this function + var/wireIndex = AAlarmWireColorToIndex[wireColor] + switch(wireIndex) + if(AALARM_WIRE_IDSCAN) //unlocks for 30 seconds, if you have a better way to hack I'm all ears + src.locked = 0 + spawn(300) + src.locked = 1 + //world << "Idscan wire pulsed" + + if (AALARM_WIRE_POWER) + // world << "Power wire pulsed" + if(shorted == 0) shorted = 1 update_icon() - if (AALARM_WIRE_AI_CONTROL) - if (aidisabled == 0) - aidisabled = 1 - - if(AALARM_WIRE_SYPHON) - mode = AALARM_MODE_PANIC - apply_mode() - - if(AALARM_WIRE_AALARM) - - if (alarm_area.atmosalert(2)) - apply_danger_level(2) - spawn(1) - updateUsrDialog() - update_icon() - - updateDialog() - - return - - proc/mend(var/wireColor) - var/wireFlag = AAlarmWireColorToFlag[wireColor] - var/wireIndex = AAlarmWireColorToIndex[wireColor] //not used in this function - AAlarmwires |= wireFlag - switch(wireIndex) - if(AALARM_WIRE_IDSCAN) - - if(AALARM_WIRE_POWER) - shorted = 0 - shock(usr, 50) - update_icon() - - if(AALARM_WIRE_AI_CONTROL) - if (aidisabled == 1) - aidisabled = 0 - - updateDialog() - return - - proc/pulse(var/wireColor) - //var/wireFlag = AAlarmWireColorToFlag[wireColor] //not used in this function - var/wireIndex = AAlarmWireColorToIndex[wireColor] - switch(wireIndex) - if(AALARM_WIRE_IDSCAN) //unlocks for 30 seconds, if you have a better way to hack I'm all ears - locked = 0 - spawn(300) - locked = 1 - - if (AALARM_WIRE_POWER) - if(shorted == 0) - shorted = 1 + spawn(1200) + if(shorted == 1) + shorted = 0 update_icon() - spawn(1200) - if(shorted == 1) - shorted = 0 - update_icon() + if (AALARM_WIRE_AI_CONTROL) + // world << "AI Control wire pulsed" + if (src.aidisabled == 0) + src.aidisabled = 1 + src.updateDialog() + spawn(10) + if (src.aidisabled == 1) + src.aidisabled = 0 + src.updateDialog() - if (AALARM_WIRE_AI_CONTROL) - if (aidisabled == 0) - aidisabled = 1 - updateDialog() - spawn(10) - if (aidisabled == 1) - aidisabled = 0 - updateDialog() + if(AALARM_WIRE_SYPHON) + // world << "Syphon wire pulsed" + mode = AALARM_MODE_REPLACEMENT + apply_mode() - if(AALARM_WIRE_SYPHON) - mode = AALARM_MODE_REPLACEMENT - apply_mode() + if(AALARM_WIRE_AALARM) + // world << "Aalarm wire pulsed" + if (alarm_area.atmosalert(0)) + post_alert(0) + spawn(1) + src.updateUsrDialog() + update_icon() - if(AALARM_WIRE_AALARM) - if (alarm_area.atmosalert(0)) - apply_danger_level(0) - spawn(1) - updateUsrDialog() - update_icon() + src.updateDialog() + return - updateDialog() - return +/obj/machinery/alarm/proc/shock(mob/user, prb) + if((stat & (NOPOWER))) // unpowered, no shock + return 0 + if(!prob(prb)) + return 0 //you lucked out, no shock for you + var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread + s.set_up(5, 1, src) + s.start() //sparks always. + if (electrocute_mob(user, get_area(src), src)) + return 1 + else + return 0 - proc/shock(mob/user, prb) - if((stat & (NOPOWER))) // unpowered, no shock - return 0 - if(!prob(prb)) - return 0 //you lucked out, no shock for you - var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread - s.set_up(5, 1, src) - s.start() //sparks always. - if (electrocute_mob(user, get_area(src), src)) - return 1 - else - return 0 -/////////////// -//END HACKING// -/////////////// +/obj/machinery/alarm/proc/refresh_all() + for(var/id_tag in alarm_area.air_vent_names) + var/list/I = alarm_area.air_vent_info[id_tag] + if (I && I["timestamp"]+AALARM_REPORT_TIMEOUT/2 > world.time) + continue + send_signal(id_tag, list("status") ) + for(var/id_tag in alarm_area.air_scrub_names) + var/list/I = alarm_area.air_scrub_info[id_tag] + if (I && I["timestamp"]+AALARM_REPORT_TIMEOUT/2 > world.time) + continue + send_signal(id_tag, list("status") ) +/obj/machinery/alarm/proc/set_frequency(new_frequency) + radio_controller.remove_object(src, frequency) + frequency = new_frequency + radio_connection = radio_controller.add_object(src, frequency, RADIO_TO_AIRALARM) - attack_hand(mob/user) - . = ..() - if (.) - return - user.set_machine(src) +/obj/machinery/alarm/proc/send_signal(var/target, var/list/command)//sends signal 'command' to 'target'. Returns 0 if no radio connection, 1 otherwise + if(!radio_connection) + return 0 - if ( (get_dist(src, user) > 1 )) - if (!istype(user, /mob/living/silicon)) - user.machine = null - user << browse(null, "window=air_alarm") - user << browse(null, "window=AAlarmwires") - return + var/datum/signal/signal = new + signal.transmission_method = 1 //radio signal + signal.source = src + signal.data = command + signal.data["tag"] = target + signal.data["sigtype"] = "command" - else if (istype(user, /mob/living/silicon) && aidisabled) - user << "AI control for this Air Alarm interface has been disabled." - user << browse(null, "window=air_alarm") - return + radio_connection.post_signal(src, signal, RADIO_FROM_AIRALARM) +// world << text("Signal [] Broadcasted to []", command, target) - if(wiresexposed && (!istype(user, /mob/living/silicon))) - var/t1 = text("[alarm_area.name] Air Alarm WiresAccess Panel
\n") - var/list/AAlarmwires = list( - "Orange" = 1, - "Dark red" = 2, - "White" = 3, - "Yellow" = 4, - "Black" = 5, - ) - for(var/wiredesc in AAlarmwires) - var/is_uncut = AAlarmwires & AAlarmWireColorToFlag[AAlarmwires[wiredesc]] - t1 += "[wiredesc] wire: " - if(!is_uncut) - t1 += "Mend" + return 1 - else - t1 += "Cut " - t1 += "Pulse " +/obj/machinery/alarm/proc/return_text() + if(!(istype(usr, /mob/living/silicon)) && locked) + return "[src][return_status()]
(Swipe ID card to unlock interface)" + else + return "[src][return_status()]
[return_controls()]" - t1 += "
" - t1 += text("
\n[(locked ? "The Air Alarm is locked." : "The Air Alarm is unlocked.")]
\n[((shorted || (stat & (NOPOWER|BROKEN))) ? "The Air Alarm is offline." : "The Air Alarm is working properly!")]
\n[(aidisabled ? "The 'AI control allowed' light is off." : "The 'AI control allowed' light is on.")]") - t1 += text("

Close

") - user << browse(t1, "window=AAlarmwires") - onclose(user, "AAlarmwires") +/obj/machinery/alarm/proc/return_status() + var/turf/location = src.loc + var/datum/gas_mixture/environment = location.return_air() + var/total = environment.oxygen + environment.carbon_dioxide + environment.toxins + environment.nitrogen + var/output = "Air Status:
" - if(!shorted) - user << browse(return_text(user),"window=air_alarm") - onclose(user, "air_alarm") + if(total == 0) + output +={"Warning: Cannot obtain air sample for analysis."} + return output - return - - proc/return_text(mob/user) - if(!(istype(user, /mob/living/silicon)) && locked) - return "\The [src][return_status()]
[rcon_text()]
(Swipe ID card to unlock interface)" - else - return "\The [src][return_status()]
[rcon_text()]
[return_controls()]" - - proc/return_status() - var/turf/location = get_turf(src) - var/datum/gas_mixture/environment = location.return_air() - var/total = environment.oxygen + environment.carbon_dioxide + environment.toxins + environment.nitrogen - var/output = "Air Status:
" - - if(total == 0) - output += "Warning: Cannot obtain air sample for analysis." - return output - - output += {" + output += {" "} + var/datum/tlv/cur_tlv + var/GET_PP = R_IDEAL_GAS_EQUATION*environment.temperature/environment.volume - var/partial_pressure = R_IDEAL_GAS_EQUATION*environment.temperature/environment.volume + cur_tlv = TLV["pressure"] + var/environment_pressure = environment.return_pressure() + var/pressure_dangerlevel = cur_tlv.get_danger_level(environment_pressure) - var/list/current_settings = TLV["pressure"] - var/environment_pressure = environment.return_pressure() - var/pressure_dangerlevel = get_danger_level(environment_pressure, current_settings) + cur_tlv = TLV["oxygen"] + var/oxygen_dangerlevel = cur_tlv.get_danger_level(environment.oxygen*GET_PP) + var/oxygen_percent = round(environment.oxygen / total * 100, 2) - current_settings = TLV["oxygen"] - var/oxygen_dangerlevel = get_danger_level(environment.oxygen*partial_pressure, current_settings) - var/oxygen_percent = round(environment.oxygen / total * 100, 2) + cur_tlv = TLV["carbon dioxide"] + var/co2_dangerlevel = cur_tlv.get_danger_level(environment.carbon_dioxide*GET_PP) + var/co2_percent = round(environment.carbon_dioxide / total * 100, 2) - current_settings = TLV["carbon dioxide"] - var/co2_dangerlevel = get_danger_level(environment.carbon_dioxide*partial_pressure, current_settings) - var/co2_percent = round(environment.carbon_dioxide / total * 100, 2) + cur_tlv = TLV["plasma"] + var/plasma_dangerlevel = cur_tlv.get_danger_level(environment.toxins*GET_PP) + var/plasma_percent = round(environment.toxins / total * 100, 2) - current_settings = TLV["plasma"] - var/plasma_dangerlevel = get_danger_level(environment.toxins*partial_pressure, current_settings) - var/plasma_percent = round(environment.toxins / total * 100, 2) + cur_tlv = TLV["other"] + var/other_moles = 0.0 + for(var/datum/gas/G in environment.trace_gases) + other_moles+=G.moles + var/other_dangerlevel = cur_tlv.get_danger_level(other_moles*GET_PP) - current_settings = TLV["other"] - var/other_moles = 0.0 - for(var/datum/gas/G in environment.trace_gases) - other_moles+=G.moles - var/other_dangerlevel = get_danger_level(other_moles*partial_pressure, current_settings) + cur_tlv = TLV["temperature"] + var/temperature_dangerlevel = cur_tlv.get_danger_level(environment.temperature) - current_settings = TLV["temperature"] - var/temperature_dangerlevel = get_danger_level(environment.temperature, current_settings) - - output += {" + output += {" Pressure: [environment_pressure]kPa
Oxygen: [oxygen_percent]%
Carbon dioxide: [co2_percent]%
Toxins: [plasma_percent]%
"} - if (other_dangerlevel==2) - output += "Notice: High Concentration of Unknown Particles Detected
" - else if (other_dangerlevel==1) - output += "Notice: Low Concentration of Unknown Particles Detected
" + if (other_dangerlevel==2) + output += {"Notice: High Concentration of Unknown Particles Detected
"} + else if (other_dangerlevel==1) + output += {"Notice: Low Concentration of Unknown Particles Detected
"} - output += "Temperature: [environment.temperature]K
" + output += {" +Temperature: [environment.temperature]K
+"} - //Overall status - output += "Local Status: " - switch(max(pressure_dangerlevel,oxygen_dangerlevel,co2_dangerlevel,plasma_dangerlevel,other_dangerlevel,temperature_dangerlevel)) - if(2) - output += "DANGER: Internals Required" - if(1) - output += "Caution" - if(0) - if(alarm_area.atmosalm) - output += {"Caution: Atmos alert in area"} - else - output += {"Optimal"} + var/display_danger_level = max( + pressure_dangerlevel, + oxygen_dangerlevel, + co2_dangerlevel, + plasma_dangerlevel, + other_dangerlevel, + temperature_dangerlevel + ) - return output + //Overall status + output += {"Local Status: "} + if(display_danger_level == 2) + output += {"DANGER: Internals Required"} + else if(display_danger_level == 1) + output += {"Caution"} + else if (alarm_area.atmosalm) + output += {"Caution: Atmos alert in area"} + else + output += {"Optimal"} - proc/rcon_text() - var/dat = "Remote Control:
" - if(rcon_setting == RCON_NO) - dat += "Off" - else - dat += "Off" - dat += " | " - if(rcon_setting == RCON_AUTO) - dat += "Auto" - else - dat += "Auto" - dat += " | " - if(rcon_setting == RCON_YES) - dat += "On" - else - dat += "On" - return dat + return output - proc/return_controls() - var/output = ""//"[alarm_zone] Air [name]
" +/obj/machinery/alarm/proc/return_controls() + var/output = ""//"[alarm_zone] Air [name]
" - switch(screen) - if (AALARM_SCREEN_MAIN) - if(alarm_area.atmosalm) - output += "Reset - Atmospheric Alarm
" - else - output += "Activate - Atmospheric Alarm
" + switch(screen) + if (AALARM_SCREEN_MAIN) + if(alarm_area.atmosalm) + output += {"Reset - Atmospheric Alarm
"} + else + output += {"Activate - Atmospheric Alarm
"} - output += {" + output += {" Scrubbers Control
Vents Control
Set environmentals mode
Sensor Settings

"} - if (mode==AALARM_MODE_PANIC) - output += "PANIC SYPHON ACTIVE
Turn syphoning off" - else - output += "ACTIVATE PANIC SYPHON IN AREA" - - - if (AALARM_SCREEN_VENT) - var/sensor_data = "" - if(alarm_area.air_vent_names.len) - for(var/id_tag in alarm_area.air_vent_names) - var/long_name = alarm_area.air_vent_names[id_tag] - var/list/data = alarm_area.air_vent_info[id_tag] - if(!data) - continue; - var/state = "" + if (mode==AALARM_MODE_PANIC) + output += "PANIC SYPHON ACTIVE
Turn syphoning off" + else + output += "ACTIVATE PANIC SYPHON IN AREA" + if (AALARM_SCREEN_VENT) + var/sensor_data = "" + if(alarm_area.air_vent_names.len) + for(var/id_tag in alarm_area.air_vent_names) + var/long_name = alarm_area.air_vent_names[id_tag] + var/list/data = alarm_area.air_vent_info[id_tag] + if(!data) + continue; + var/state = "" + sensor_data += {" +[long_name][state]
+Operating: +[data["power"]?"on":"off"] +
+Pressure checks: +external +internal +
+External pressure bound: +- +- +- +- +[data["external"]] ++ ++ ++ ++ + (reset) +
+"} + if (data["direction"] == "siphon") sensor_data += {" - [long_name][state]
- Operating: - [data["power"]?"on":"off"] -
- Pressure checks: - external - internal -
- External pressure bound: - - - - - - - - - [data["external"]] - + - + - + - + - (reset) -
- "} - if (data["direction"] == "siphon") - sensor_data += {" - Direction: - siphoning -
- "} - sensor_data += {"
"} - else - sensor_data = "No vents connected.
" - output = {"Main menu
[sensor_data]"} - if (AALARM_SCREEN_SCRUB) - var/sensor_data = "" - if(alarm_area.air_scrub_names.len) - for(var/id_tag in alarm_area.air_scrub_names) - var/long_name = alarm_area.air_scrub_names[id_tag] - var/list/data = alarm_area.air_scrub_info[id_tag] - if(!data) - continue; - var/state = "" +Direction: +siphoning +
+"} + sensor_data += {"
"} + else + sensor_data = "No vents connected.
" + output = {"Main menu
[sensor_data]"} + if (AALARM_SCREEN_SCRUB) + var/sensor_data = "" + if(alarm_area.air_scrub_names.len) + for(var/id_tag in alarm_area.air_scrub_names) + var/long_name = alarm_area.air_scrub_names[id_tag] + var/list/data = alarm_area.air_scrub_info[id_tag] + if(!data) + continue; + var/state = "" + sensor_data += {" +[long_name][state]
+Operating: +[data["power"]?"on":"off"]
+Type: +[data["scrubbing"]?"scrubbing":"syphoning"]
+"} + + if(data["scrubbing"]) sensor_data += {" - [long_name][state]
- Operating: - [data["power"]?"on":"off"]
- Type: - [data["scrubbing"]?"scrubbing":"syphoning"]
- "} +Filtering: +Carbon Dioxide +[data["filter_co2"]?"on":"off"]; +Toxins +[data["filter_toxins"]?"on":"off"]; +Nitrous Oxide +[data["filter_n2o"]?"on":"off"] +
+"} + sensor_data += {" +Panic syphon: [data["panic"]?"PANIC SYPHON ACTIVATED":""] +Dea":"red'>A")]ctivate
+
+"} + else + sensor_data = "No scrubbers connected.
" + output = {"Main menu
[sensor_data]"} - if(data["scrubbing"]) - sensor_data += {" - Filtering: - Carbon Dioxide - [data["filter_co2"]?"on":"off"]; - Toxins - [data["filter_toxins"]?"on":"off"]; - Nitrous Oxide - [data["filter_n2o"]?"on":"off"] -
- "} - sensor_data += {" - Panic syphon: [data["panic"]?"PANIC SYPHON ACTIVATED":""] - Dea":"red'>A")]ctivate
-
- "} + if (AALARM_SCREEN_MODE) + output += {" +Main menu
+Air machinery mode for the area:" + if (AALARM_SCREEN_SENSORS) + output += {" Main menu
Alarm thresholds:
Partial pressure for gases @@ -800,192 +631,404 @@ table tr:first-child th:first-child { border: none;} "} - var/list/gases = list( - "oxygen" = "O2", - "carbon dioxide" = "CO2", - "plasma" = "Toxin", - "other" = "Other",) + var/list/gases = list( + "oxygen" = "O2", + "carbon dioxide" = "CO2", + "plasma" = "Toxin", + "other" = "Other", + ) + var/list/thresholds = list("min2", "min1", "max1", "max2") + var/datum/tlv/tlv + for (var/g in gases) + output += {" + +"} + tlv = TLV[g] + for (var/v in thresholds) + output += {" + +"} + output += {" + +"} + tlv = TLV["pressure"] + output += {" + +"} + for (var/v in thresholds) + output += {" + +"} + output += {" + +"} + tlv = TLV["temperature"] + output += {" + +"} + for (var/v in thresholds) + output += {" + +"} + output += {" + +"} + output += {"
min2min1max1max2
[gases[g]] +[tlv.vars[v]>=0?tlv.vars[v]:"OFF"] +
Pressure +[tlv.vars[v]>=0?tlv.vars[v]:"OFF"] +
Temperature +[tlv.vars[v]>=0?tlv.vars[v]:"OFF"] +
"} - var/list/selected - for (var/g in gases) - output += "[gases[g]]" - selected = TLV[g] - for(var/i = 1, i <= 4, i++) - output += "[selected[i] >= 0 ? selected[i] :"OFF"]" - output += "" + return output - selected = TLV["pressure"] - output += " Pressure" - for(var/i = 1, i <= 4, i++) - output += "[selected[i] >= 0 ? selected[i] :"OFF"]" - output += "" +/obj/machinery/alarm/Topic(href, href_list) + if(..()) + return + src.add_fingerprint(usr) + usr.set_machine(src) - selected = TLV["temperature"] - output += "Temperature" - for(var/i = 1, i <= 4, i++) - output += "[selected[i] >= 0 ? selected[i] :"OFF"]" - output += "" + if ( (get_dist(src, usr) > 1 )) + if (!istype(usr, /mob/living/silicon)) + usr.unset_machine() + usr << browse(null, "window=air_alarm") + usr << browse(null, "window=AAlarmwires") + return - return output + if (href_list["AAlarmwires"]) + var/t1 = text2num(href_list["AAlarmwires"]) + if (!( istype(usr.get_active_hand(), /obj/item/weapon/wirecutters) )) + usr << "You need wirecutters!" + return + if (src.isWireColorCut(t1)) + src.mend(t1) + else + src.cut(t1) + spawn(1) + src.updateUsrDialog() + else if (href_list["pulse"]) + var/t1 = text2num(href_list["pulse"]) + if (!istype(usr.get_active_hand(), /obj/item/device/multitool)) + usr << "You need a multitool!" + return + if (src.isWireColorCut(t1)) + usr << "You can't pulse a cut wire." + return + else + src.pulse(t1) + spawn(1) + src.updateUsrDialog() - Topic(href, href_list) - if(href_list["rcon"]) - rcon_setting = text2num(href_list["rcon"]) - if ( (get_dist(src, usr) > 1 )) - if (!istype(usr, /mob/living/silicon)) - usr.machine = null - usr << browse(null, "window=air_alarm") - usr << browse(null, "window=AAlarmwires") - return + if(href_list["command"]) + var/device_id = href_list["id_tag"] + switch(href_list["command"]) + if( + "power", + "adjust_external_pressure", + "set_external_pressure", + "checks", + "co2_scrub", + "tox_scrub", + "n2o_scrub", + "panic_siphon", + "scrubbing" + ) + send_signal(device_id, list (href_list["command"] = text2num(href_list["val"]))) + spawn(3) + src.updateUsrDialog() - add_fingerprint(usr) - usr.machine = src + //if("adjust_threshold") //was a good idea but required very wide window + if("set_threshold") + var/env = href_list["env"] + var/varname = href_list["var"] + var/datum/tlv/tlv = TLV[env] + var/newval = input("Enter [varname] for env", "Alarm triggers", tlv.vars[varname]) as num|null - if(href_list["command"]) - var/device_id = href_list["id_tag"] - switch(href_list["command"]) - if( "power", - "adjust_external_pressure", - "set_external_pressure", - "checks", - "co2_scrub", - "tox_scrub", - "n2o_scrub", - "panic_siphon", - "scrubbing") + if (isnull(newval) || ..() || (locked && !issilicon(usr))) + return + if (newval<0) + tlv.vars[varname] = -1.0 + else if (env=="temperature" && newval>5000) + tlv.vars[varname] = 5000 + else if (env=="pressure" && newval>50*ONE_ATMOSPHERE) + tlv.vars[varname] = 50*ONE_ATMOSPHERE + else if (env!="temperature" && env!="pressure" && newval>200) + tlv.vars[varname] = 200 + else + newval = round(newval,0.01) + tlv.vars[varname] = newval + spawn(1) + src.updateUsrDialog() - send_signal(device_id, list(href_list["command"] = text2num(href_list["val"]) ) ) + if(href_list["screen"]) + screen = text2num(href_list["screen"]) + spawn(1) + src.updateUsrDialog() - if("set_threshold") - var/env = href_list["env"] - var/threshold = text2num(href_list["var"]) - var/list/selected = TLV[env] - var/list/thresholds = list("lower bound", "low warning", "high warning", "upper bound") - var/newval = input("Enter [thresholds[threshold]] for [env]", "Alarm triggers", selected[threshold]) as null|num - if (isnull(newval) || ..() || (locked && issilicon(usr))) - return - if (newval<0) - selected[threshold] = -1.0 - else if (env=="temperature" && newval>5000) - selected[threshold] = 5000 - else if (env=="pressure" && newval>50*ONE_ATMOSPHERE) - selected[threshold] = 50*ONE_ATMOSPHERE - else if (env!="temperature" && env!="pressure" && newval>200) - selected[threshold] = 200 - else - newval = round(newval,0.01) - selected[threshold] = newval - if(threshold == 1) - if(selected[1] > selected[2]) - selected[2] = selected[1] - if(selected[1] > selected[3]) - selected[3] = selected[1] - if(selected[1] > selected[4]) - selected[4] = selected[1] - if(threshold == 2) - if(selected[1] > selected[2]) - selected[1] = selected[2] - if(selected[2] > selected[3]) - selected[3] = selected[2] - if(selected[2] > selected[4]) - selected[4] = selected[2] - if(threshold == 3) - if(selected[1] > selected[3]) - selected[1] = selected[3] - if(selected[2] > selected[3]) - selected[2] = selected[3] - if(selected[3] > selected[4]) - selected[4] = selected[3] - if(threshold == 4) - if(selected[1] > selected[4]) - selected[1] = selected[4] - if(selected[2] > selected[4]) - selected[2] = selected[4] - if(selected[3] > selected[4]) - selected[3] = selected[4] - apply_mode() - if(href_list["screen"]) - screen = text2num(href_list["screen"]) + if(href_list["atmos_alarm"]) + if (alarm_area.atmosalert(2)) + post_alert(2) + spawn(1) + src.updateUsrDialog() + update_icon() + if(href_list["atmos_reset"]) + if (alarm_area.atmosalert(0)) + post_alert(0) + spawn(1) + src.updateUsrDialog() + update_icon() - if(href_list["atmos_unlock"]) - switch(href_list["atmos_unlock"]) - if("0") - air_doors_close(1) - if("1") - air_doors_open(1) + if(href_list["mode"]) + mode = text2num(href_list["mode"]) + apply_mode() + spawn(5) + src.updateUsrDialog() - if(href_list["atmos_alarm"]) - if (alarm_area.atmosalert(2)) - apply_danger_level(2) - update_icon() + return - if(href_list["atmos_reset"]) - if (alarm_area.atmosalert(0)) - apply_danger_level(0) - update_icon() +/obj/machinery/alarm/proc/apply_mode() + switch(mode) + if(AALARM_MODE_SCRUBBING) + for(var/device_id in alarm_area.air_scrub_names) + send_signal(device_id, list( + "power"= 1, + "co2_scrub"= 1, + "scrubbing"= 1, + "panic_siphon"= 0, + )) + for(var/device_id in alarm_area.air_vent_names) + send_signal(device_id, list( + "power"= 1, + "checks"= 1, + "set_external_pressure"= ONE_ATMOSPHERE + )) - if(href_list["mode"]) - mode = text2num(href_list["mode"]) - apply_mode() + if(AALARM_MODE_VENTING) + for(var/device_id in alarm_area.air_scrub_names) + send_signal(device_id, list( + "power"= 1, + "panic_siphon"= 0, + "scrubbing"= 0 + )) + for(var/device_id in alarm_area.air_vent_names) + send_signal(device_id, list( + "power"= 1, + "checks"= 1, + "set_external_pressure"= ONE_ATMOSPHERE + )) + if( + AALARM_MODE_PANIC, + AALARM_MODE_REPLACEMENT + ) + for(var/device_id in alarm_area.air_scrub_names) + send_signal(device_id, list( + "power"= 1, + "panic_siphon"= 1 + )) + for(var/device_id in alarm_area.air_vent_names) + send_signal(device_id, list( + "power"= 0 + )) + /*if(AALARM_MODE_OFF) Commented out cause the "turn off panic" uses scrubbing mode now instead. + for(var/device_id in alarm_area.air_scrub_names) + send_signal(device_id, list( + "panic_siphon" = 0 + )) + for(var/device_id in alarm_area.air_vent_names) + send_signal(device_id, list( + "power"= 1 + ))*/ - if (href_list["AAlarmwires"]) - var/t1 = text2num(href_list["AAlarmwires"]) - if (!( istype(usr.equipped(), /obj/item/weapon/wirecutters) )) - usr << "You need wirecutters!" - return - if (isWireColorCut(t1)) - mend(t1) - else - cut(t1) +/obj/machinery/alarm/update_icon() + if(wiresexposed) + switch(buildstage) + if(2) + if(src.AAlarmwires == 0) // All wires cut + icon_state = "alarm_b2" + else + icon_state = "alarmx" + if(1) + icon_state = "alarm_b2" + if(0) + icon_state = "alarm_b1" + return - else if (href_list["pulse"]) - var/t1 = text2num(href_list["pulse"]) - if (!istype(usr.equipped(), /obj/item/device/multitool)) - usr << "You need a multitool!" - return - if (isWireColorCut(t1)) - usr << "You can't pulse a cut wire." - return - else - pulse(t1) + if((stat & (NOPOWER|BROKEN)) || shorted) + icon_state = "alarmp" + return + switch(max(danger_level, alarm_area.atmosalm)) + if (0) + src.icon_state = "alarm0" + if (1) + src.icon_state = "alarm2" //yes, alarm2 is yellow alarm + if (2) + src.icon_state = "alarm1" - updateUsrDialog() +/obj/machinery/alarm/process() + if((stat & (NOPOWER|BROKEN)) || shorted) + return + var/turf/simulated/location = src.loc + if (!istype(location)) + return 0 + + var/datum/gas_mixture/environment = location.return_air() + + var/datum/tlv/cur_tlv + var/GET_PP = R_IDEAL_GAS_EQUATION*environment.temperature/environment.volume + + cur_tlv = TLV["pressure"] + var/environment_pressure = environment.return_pressure() + var/pressure_dangerlevel = cur_tlv.get_danger_level(environment_pressure) + + cur_tlv = TLV["oxygen"] + var/oxygen_dangerlevel = cur_tlv.get_danger_level(environment.oxygen*GET_PP) + + cur_tlv = TLV["carbon dioxide"] + var/co2_dangerlevel = cur_tlv.get_danger_level(environment.carbon_dioxide*GET_PP) + + cur_tlv = TLV["plasma"] + var/plasma_dangerlevel = cur_tlv.get_danger_level(environment.toxins*GET_PP) + + cur_tlv = TLV["other"] + var/other_moles = 0.0 + for(var/datum/gas/G in environment.trace_gases) + other_moles+=G.moles + var/other_dangerlevel = cur_tlv.get_danger_level(other_moles*GET_PP) + + cur_tlv = TLV["temperature"] + var/temperature_dangerlevel = cur_tlv.get_danger_level(environment.temperature) + + var/old_danger_level = danger_level + danger_level = max( + pressure_dangerlevel, + oxygen_dangerlevel, + co2_dangerlevel, + plasma_dangerlevel, + other_dangerlevel, + temperature_dangerlevel + ) + if (old_danger_level!=danger_level) + apply_danger_level() + + if (mode==AALARM_MODE_REPLACEMENT && environment_pressure. Thus, keep pulling it forever." + icon = 'icons/obj/monitors.dmi' + icon_state = "fire0" + var/detecting = 1.0 + var/working = 1.0 + var/time = 10.0 + var/timing = 0.0 + var/lockdownbyai = 0 + anchored = 1.0 + use_power = 1 + idle_power_usage = 2 + active_power_usage = 6 + power_channel = ENVIRON + var/last_process = 0 + var/wiresexposed = 0 + var/buildstage = 2 // 2 = complete, 1 = no wires, 0 = circuit gone + +/obj/machinery/firealarm/update_icon() + + if(wiresexposed) + switch(buildstage) + if(2) + icon_state="fire_b2" + if(1) + icon_state="fire_b1" + if(0) + icon_state="fire_b0" + + return + + if(stat & BROKEN) + icon_state = "firex" + else if(stat & NOPOWER) + icon_state = "firep" + else if(!src.detecting) + icon_state = "fire1" + else + icon_state = "fire0" + /obj/machinery/firealarm/temperature_expose(datum/gas_mixture/air, temperature, volume) - if(detecting) + if(src.detecting) if(temperature > T0C+200) - alarm() // added check of detector status here + src.alarm() // added check of detector status here return /obj/machinery/firealarm/attack_ai(mob/user as mob) - return attack_hand(user) + return src.attack_hand(user) /obj/machinery/firealarm/bullet_act(BLAH) - return alarm() + return src.alarm() /obj/machinery/firealarm/attack_paw(mob/user as mob) - return attack_hand(user) + return src.attack_hand(user) /obj/machinery/firealarm/emp_act(severity) if(prob(50/severity)) alarm() ..() -/obj/machinery/firealarm/attackby(obj/item/weapon/W as obj, mob/user as mob) - if (istype(W, /obj/item/weapon/wirecutters)) - detecting = !detecting - user.visible_message("\red \The [user] has [detecting ? "re" : "dis" ]connected \the [src]'s detecting unit!",\ - "You have [detecting ? "re" : "dis" ]connected \the [src]'s detecting unit.") - else - alarm() - add_fingerprint(user) +/obj/machinery/firealarm/attackby(obj/item/W as obj, mob/user as mob) + src.add_fingerprint(user) + + if (istype(W, /obj/item/weapon/screwdriver) && buildstage == 2) + wiresexposed = !wiresexposed + update_icon() + return + + if(wiresexposed) + switch(buildstage) + if(2) + if (istype(W, /obj/item/device/multitool)) + src.detecting = !( src.detecting ) + if (src.detecting) + user.visible_message("\red [user] has reconnected [src]'s detecting unit!", "You have reconnected [src]'s detecting unit.") + else + user.visible_message("\red [user] has disconnected [src]'s detecting unit!", "You have disconnected [src]'s detecting unit.") + + else if (istype(W, /obj/item/weapon/wirecutters)) + buildstage = 1 + playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) + var/obj/item/weapon/cable_coil/coil = new /obj/item/weapon/cable_coil() + coil.amount = 5 + coil.loc = user.loc + user << "You cut the wires from \the [src]" + update_icon() + if(1) + if(istype(W, /obj/item/weapon/cable_coil)) + var/obj/item/weapon/cable_coil/coil = W + if(coil.amount < 5) + user << "You need more cable for this!" + return + + coil.amount -= 5 + if(!coil.amount) + del(coil) + + buildstage = 2 + user << "You wire \the [src]!" + update_icon() + + else if(istype(W, /obj/item/weapon/crowbar)) + user << "You pry out the circuit!" + playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) + spawn(20) + var/obj/item/weapon/firealarm_electronics/circuit = new /obj/item/weapon/firealarm_electronics() + circuit.loc = user.loc + buildstage = 0 + update_icon() + if(0) + if(istype(W, /obj/item/weapon/firealarm_electronics)) + user << "You insert the circuit!" + del(W) + buildstage = 1 + update_icon() + + else if(istype(W, /obj/item/weapon/wrench)) + user << "You remove the fire alarm assembly from the wall!" + var/obj/item/firealarm_frame/frame = new /obj/item/firealarm_frame() + frame.loc = user.loc + playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) + del(src) + return + + src.alarm() return -/obj/machinery/firealarm/process() +/obj/machinery/firealarm/process()//Note: this processing was mostly phased out due to other code, and only runs when needed if(stat & (NOPOWER|BROKEN)) return - var/area/A = get_area(src) - ASSERT(isarea(A)) - if(A.master) - A = A.master - - if(A.fire) - icon_state = "fire1" - else - icon_state = "fire0" - - if (timing) - if (time > 0) - time = round(time) - 1 + if(src.timing) + if(src.time > 0) + src.time = src.time - ((world.timeofday - last_process)/10) else - alarm() - time = 0 - timing = 0 - updateDialog() + src.alarm() + src.time = 0 + src.timing = 0 + processing_objects.Remove(src) + src.updateDialog() + last_process = world.timeofday return /obj/machinery/firealarm/power_change() if(powered(ENVIRON)) stat &= ~NOPOWER - icon_state = "fire0" + update_icon() else spawn(rand(0,15)) stat |= NOPOWER - icon_state = "firep" + update_icon() /obj/machinery/firealarm/attack_hand(mob/user as mob) if(user.stat || stat & (NOPOWER|BROKEN)) return - user.machine = src - var/area/A = get_area(src) - ASSERT(isarea(A)) - if(A.master) - A = A.master + if (buildstage != 2) + return + + user.set_machine(src) + var/area/A = src.loc var/d1 var/d2 if (istype(user, /mob/living/carbon/human) || istype(user, /mob/living/silicon)) + A = A.loc if (A.fire) d1 = text("Reset - Lockdown", src) else d1 = text("Alarm - Lockdown", src) - if (timing) + if (src.timing) d2 = text("Stop Time Lock", src) else d2 = text("Initiate Time Lock", src) - var/second = time % 60 - var/minute = (time - second) / 60 + var/second = round(src.time) % 60 + var/minute = (round(src.time) - second) / 60 var/dat = "Fire alarm [d1]\n
The current alert level is: [get_security_level()]

\nTimer System: [d2]
\nTime Left: [(minute ? "[minute]:" : null)][second] - - + +\n
" user << browse(dat, "window=firealarm") onclose(user, "firealarm") else + A = A.loc if (A.fire) d1 = text("[]", src, stars("Reset - Lockdown")) else d1 = text("[]", src, stars("Alarm - Lockdown")) - if (timing) + if (src.timing) d2 = text("[]", src, stars("Stop Time Lock")) else d2 = text("[]", src, stars("Initiate Time Lock")) - var/second = time % 60 - var/minute = (time - second) / 60 + var/second = round(src.time) % 60 + var/minute = (round(src.time) - second) / 60 var/dat = "[stars("Fire alarm")] [d1]\n
The current alert level is: [stars(get_security_level())]

\nTimer System: [d2]
\nTime Left: [(minute ? text("[]:", minute) : null)][second] - - + +\n
" user << browse(dat, "window=firealarm") onclose(user, "firealarm") @@ -1162,52 +1301,81 @@ Code shamelessly copied from apc_frame ..() if (usr.stat || stat & (BROKEN|NOPOWER)) return - if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon))) - usr.machine = src - if (href_list["reset"]) - reset() - else - if (href_list["alarm"]) - alarm() - else - if (href_list["time"]) - timing = text2num(href_list["time"]) - else - if (href_list["tp"]) - var/tp = text2num(href_list["tp"]) - time += tp - time = min(max(round(time), 0), 120) - updateUsrDialog() - add_fingerprint(usr) + if (buildstage != 2) + return + + if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon))) + usr.set_machine(src) + if (href_list["reset"]) + src.reset() + else if (href_list["alarm"]) + src.alarm() + else if (href_list["time"]) + src.timing = text2num(href_list["time"]) + last_process = world.timeofday + processing_objects.Add(src) + else if (href_list["tp"]) + var/tp = text2num(href_list["tp"]) + src.time += tp + src.time = min(max(round(src.time), 0), 120) + + src.updateUsrDialog() + + src.add_fingerprint(usr) else usr << browse(null, "window=firealarm") return return /obj/machinery/firealarm/proc/reset() - if (!working) + if (!( src.working )) + return + var/area/A = src.loc + A = A.loc + if (!( istype(A, /area) )) return - var/area/A = get_area(src) - ASSERT(isarea(A)) - if(A.master) - A = A.master for(var/area/RA in A.related) RA.firereset() + update_icon() return /obj/machinery/firealarm/proc/alarm() - if (!( working )) + if (!( src.working )) + return + var/area/A = src.loc + A = A.loc + if (!( istype(A, /area) )) return - var/area/A = get_area(src) - ASSERT(isarea(A)) - if(A.master) - A = A.master for(var/area/RA in A.related) RA.firealert() - //playsound(loc, 'signal.ogg', 75, 0) + update_icon() + //playsound(src.loc, 'sound/ambience/signal.ogg', 75, 0) return +/obj/machinery/firealarm/New(loc, dir, building) + ..() + + if(loc) + src.loc = loc + + if(dir) + src.dir = dir + + if(building) + buildstage = 0 + wiresexposed = 1 + pixel_x = (dir & 3)? 0 : (dir == 4 ? -24 : 24) + pixel_y = (dir & 3)? (dir ==1 ? -24 : 24) : 0 + + if(z == 1) + if(security_level) + src.overlays += image('icons/obj/monitors.dmi', "overlay_[get_security_level()]") + else + src.overlays += image('icons/obj/monitors.dmi', "overlay_green") + + update_icon() + /* FIRE ALARM CIRCUIT Just a object used in constructing fire alarms @@ -1234,6 +1402,26 @@ Code shamelessly copied from apc_frame icon_state = "fire_bitem" flags = FPRINT | TABLEPASS| CONDUCT + +/* + * Party button + */ + +/obj/machinery/partyalarm + name = "\improper PARTY BUTTON" + desc = "Cuban Pete is in the house!" + icon = 'icons/obj/monitors.dmi' + icon_state = "fire0" + var/detecting = 1.0 + var/working = 1.0 + var/time = 10.0 + var/timing = 0.0 + var/lockdownbyai = 0 + anchored = 1.0 + use_power = 1 + idle_power_usage = 2 + active_power_usage = 6 + /obj/item/firealarm_frame/attackby(obj/item/weapon/W as obj, mob/user as mob) if (istype(W, /obj/item/weapon/wrench)) new /obj/item/stack/sheet/metal( get_turf(src.loc), 2 ) @@ -1267,67 +1455,65 @@ Code shamelessly copied from apc_frame del(src) /obj/machinery/partyalarm/attack_paw(mob/user as mob) - return attack_hand(user) - + return src.attack_hand(user) /obj/machinery/partyalarm/attack_hand(mob/user as mob) if(user.stat || stat & (NOPOWER|BROKEN)) return - user.machine = src - var/area/A = get_area(src) - ASSERT(isarea(A)) - if(A.master) - A = A.master + user.set_machine(src) + var/area/A = src.loc var/d1 var/d2 if (istype(user, /mob/living/carbon/human) || istype(user, /mob/living/silicon/ai)) + A = A.loc if (A.party) d1 = text("No Party :(", src) else d1 = text("PARTY!!!", src) - if (timing) + if (src.timing) d2 = text("Stop Time Lock", src) else d2 = text("Initiate Time Lock", src) - var/second = time % 60 - var/minute = (time - second) / 60 + var/second = src.time % 60 + var/minute = (src.time - second) / 60 var/dat = text("Party Button []\n
\nTimer System: []
\nTime Left: [][] - - + +\n
", d1, d2, (minute ? text("[]:", minute) : null), second, src, src, src, src) user << browse(dat, "window=partyalarm") onclose(user, "partyalarm") else + A = A.loc if (A.fire) d1 = text("[]", src, stars("No Party :(")) else d1 = text("[]", src, stars("PARTY!!!")) - if (timing) + if (src.timing) d2 = text("[]", src, stars("Stop Time Lock")) else d2 = text("[]", src, stars("Initiate Time Lock")) - var/second = time % 60 - var/minute = (time - second) / 60 + var/second = src.time % 60 + var/minute = (src.time - second) / 60 var/dat = text("[] []\n
\nTimer System: []
\nTime Left: [][] - - + +\n
", stars("Party Button"), d1, d2, (minute ? text("[]:", minute) : null), second, src, src, src, src) user << browse(dat, "window=partyalarm") onclose(user, "partyalarm") return /obj/machinery/partyalarm/proc/reset() - if (!( working )) + if (!( src.working )) + return + var/area/A = src.loc + A = A.loc + if (!( istype(A, /area) )) return - var/area/A = get_area(src) - ASSERT(isarea(A)) - if(A.master) - A = A.master A.partyreset() return /obj/machinery/partyalarm/proc/alarm() - if (!( working )) + if (!( src.working )) + return + var/area/A = src.loc + A = A.loc + if (!( istype(A, /area) )) return - var/area/A = get_area(src) - ASSERT(isarea(A)) - if(A.master) - A = A.master A.partyalert() return @@ -1335,25 +1521,25 @@ Code shamelessly copied from apc_frame ..() if (usr.stat || stat & (BROKEN|NOPOWER)) return - if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon/ai))) - usr.machine = src + if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon/ai))) + usr.set_machine(src) if (href_list["reset"]) - reset() + src.reset() else if (href_list["alarm"]) - alarm() + src.alarm() else if (href_list["time"]) - timing = text2num(href_list["time"]) + src.timing = text2num(href_list["time"]) else if (href_list["tp"]) var/tp = text2num(href_list["tp"]) - time += tp - time = min(max(round(time), 0), 120) - updateUsrDialog() + src.time += tp + src.time = min(max(round(src.time), 0), 120) + src.updateUsrDialog() - add_fingerprint(usr) + src.add_fingerprint(usr) else usr << browse(null, "window=partyalarm") return - return \ No newline at end of file + return diff --git a/code/game/machinery/atmoalter/zvent.dm b/code/game/machinery/atmoalter/zvent.dm index 2de9f72375..163e86a74d 100644 --- a/code/game/machinery/atmoalter/zvent.dm +++ b/code/game/machinery/atmoalter/zvent.dm @@ -20,7 +20,7 @@ if (istype(zvent_conn)) //both floors have simulated turfs, share() var/turf/simulated/myturf = loc - var/datum/gas_mixture/conn_air = zturf_conn.air //TODO: pop culture reference + var/datum/gas_mixture/conn_air = zturf_conn.zone.air //TODO: pop culture reference var/datum/gas_mixture/my_air = myturf.air if (istype(conn_air) && istype(my_air)) // if (!my_air.compare(conn_air)) diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm index e1f1dfa36e..b9b4fe0a04 100644 --- a/code/game/machinery/constructable_frame.dm +++ b/code/game/machinery/constructable_frame.dm @@ -45,7 +45,8 @@ if(!C.amount) del(C) user << "\blue You add cables to the frame." state = 2 - icon_state = "box_1" else + icon_state = "box_1" + else if(istype(P, /obj/item/weapon/wrench)) playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) user << "\blue You dismantle the frame" diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 33cf295195..e9e824f66b 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -244,38 +244,11 @@ update_heat_protection(loc) - if(need_rebuild) - if(istype(source)) //Rebuild/update nearby group geometry - if(source.parent) - air_master.groups_to_rebuild += source.parent - else - air_master.tiles_to_update += source - if(istype(north)) - if(north.parent) - air_master.groups_to_rebuild += north.parent - else - air_master.tiles_to_update += north - if(istype(south)) - if(south.parent) - air_master.groups_to_rebuild += south.parent - else - air_master.tiles_to_update += south - if(istype(east)) - if(east.parent) - air_master.groups_to_rebuild += east.parent - else - air_master.tiles_to_update += east - if(istype(west)) - if(west.parent) - air_master.groups_to_rebuild += west.parent - else - air_master.tiles_to_update += west - else - if(istype(source)) air_master.tiles_to_update += source - if(istype(north)) air_master.tiles_to_update += north - if(istype(south)) air_master.tiles_to_update += south - if(istype(east)) air_master.tiles_to_update += east - if(istype(west)) air_master.tiles_to_update += west + if(istype(source)) air_master.tiles_to_update += source + if(istype(north)) air_master.tiles_to_update += north + if(istype(south)) air_master.tiles_to_update += south + if(istype(east)) air_master.tiles_to_update += east + if(istype(west)) air_master.tiles_to_update += west return 1 /obj/machinery/door/proc/update_heat_protection(var/turf/simulated/source) @@ -285,43 +258,6 @@ else source.thermal_conductivity = initial(source.thermal_conductivity) - - //skytodo - /*if(need_rebuild) - if(istype(source)) //Rebuild/update nearby group geometry - if(source.parent) - air_master.groups_to_rebuild += source.parent - else - air_master.tiles_to_update += source - if(istype(north)) - if(north.parent) - air_master.groups_to_rebuild += north.parent - else - air_master.tiles_to_update += north - if(istype(south)) - if(south.parent) - air_master.groups_to_rebuild += south.parent - else - air_master.tiles_to_update += south - if(istype(east)) - if(east.parent) - air_master.groups_to_rebuild += east.parent - else - air_master.tiles_to_update += east - if(istype(west)) - if(west.parent) - air_master.groups_to_rebuild += west.parent - else - air_master.tiles_to_update += west - else*/ - if(istype(source)) air_master.tiles_to_update |= source - if(istype(north)) air_master.tiles_to_update |= north - if(istype(south)) air_master.tiles_to_update |= south - if(istype(east)) air_master.tiles_to_update |= east - if(istype(west)) air_master.tiles_to_update |= west - - return 1 - /obj/machinery/door/proc/autoclose() var/obj/machinery/door/airlock/A = src if(!A.density && !A.operating && !A.locked && !A.welded && A.autoclose) diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index 2fdb122e9a..d7693b4b38 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -253,18 +253,6 @@ update_heat_protection(loc) - if(need_rebuild) - if(istype(source)) //Rebuild/update nearby group geometry - if(source.parent) - air_master.groups_to_rebuild += source.parent - else - air_master.tiles_to_update += source - if(istype(destination)) - if(destination.parent) - air_master.groups_to_rebuild += destination.parent - else - air_master.tiles_to_update += destination - else - if(istype(source)) air_master.tiles_to_update += source - if(istype(destination)) air_master.tiles_to_update += destination + if(istype(source)) air_master.tiles_to_update += source + if(istype(destination)) air_master.tiles_to_update += destination return 1 diff --git a/code/game/objects/effects/decals/Cleanable/fuel.dm b/code/game/objects/effects/decals/Cleanable/fuel.dm index eae392b5a1..e4c5ae4220 100644 --- a/code/game/objects/effects/decals/Cleanable/fuel.dm +++ b/code/game/objects/effects/decals/Cleanable/fuel.dm @@ -25,17 +25,12 @@ obj/effect/decal/cleanable/liquid_fuel var/turf/simulated/S = loc if(!istype(S)) return for(var/d in cardinal) - if(S.air_check_directions & d) - if(rand(25)) - var/turf/simulated/O = get_step(src,d) - var/can_pass = 1 - for (var/obj/machinery/door/airlock/door in O) - if (door.density) - can_pass = 0 - if (can_pass) - if(!locate(/obj/effect/decal/cleanable/liquid_fuel) in O) - new/obj/effect/decal/cleanable/liquid_fuel(O,amount*0.25) - amount *= 0.75 + if(rand(25)) + var/turf/simulated/O = get_step(src,d) + if(O.CanPass(target = get_turf(src), air_group = 1)) + if(!locate(/obj/effect/decal/cleanable/liquid_fuel) in O) + new/obj/effect/decal/cleanable/liquid_fuel(O,amount*0.25) + amount *= 0.75 flamethrower_fuel icon_state = "mustard" @@ -50,9 +45,11 @@ obj/effect/decal/cleanable/liquid_fuel if(!istype(S)) return for(var/d in list(turn(dir,90),turn(dir,-90))) - if(S.air_check_directions & d) - var/turf/simulated/O = get_step(S,d) + var/turf/simulated/O = get_step(S,d) + if(locate(/obj/effect/decal/cleanable/liquid_fuel/flamethrower_fuel) in O) + continue + if(O.CanPass(target = get_turf(src), air_group = 1)) new/obj/effect/decal/cleanable/liquid_fuel/flamethrower_fuel(O,amount*0.25,d) O.hotspot_expose((T20C*2) + 380,500) //Light flamethrower fuel on fire immediately. - amount *= 0.5 \ No newline at end of file + amount *= 0.5 diff --git a/code/game/objects/effects/mines.dm b/code/game/objects/effects/mines.dm index b285b15df0..b9a2e57daf 100644 --- a/code/game/objects/effects/mines.dm +++ b/code/game/objects/effects/mines.dm @@ -58,7 +58,7 @@ trace_gas.moles = 30 payload += trace_gas - target.air.merge(payload) + target.zone.air.merge(payload) spawn(0) del(src) @@ -71,7 +71,7 @@ payload.toxins = 30 - target.air.merge(payload) + target.zone.air.merge(payload) target.hotspot_expose(1000, CELL_VOLUME) diff --git a/code/game/objects/items/candle.dm b/code/game/objects/items/candle.dm index 0ea57a1256..b47a2a3068 100644 --- a/code/game/objects/items/candle.dm +++ b/code/game/objects/items/candle.dm @@ -5,11 +5,9 @@ icon_state = "candle1" item_state = "candle1" w_class = 1 - light_on = 0 - brightness_on = 3 //luminosity when on var/wax = 200 - + var/lit = 0 proc light(var/flavor_text = "\red [usr] lights the [name].") @@ -21,7 +19,7 @@ else if(wax>80) i = 2 else i = 3 - icon_state = "candle[i][light_on ? "_lit" : ""]" + icon_state = "candle[i][lit ? "_lit" : ""]" attackby(obj/item/weapon/W as obj, mob/user as mob) @@ -32,30 +30,30 @@ light("\red [user] casually lights the [name] with [W], what a badass.") else if(istype(W, /obj/item/weapon/lighter)) var/obj/item/weapon/lighter/L = W - if(L.light_on) + if(L.lit) light() else if(istype(W, /obj/item/weapon/match)) var/obj/item/weapon/match/M = W - if(M.light_on) + if(M.lit) light() else if(istype(W, /obj/item/candle)) var/obj/item/candle/C = W - if(C.light_on) + if(C.lit) light() light(var/flavor_text = "\red [usr] lights the [name].") - if(!src.light_on) - src.light_on = 1 + if(!src.lit) + src.lit = 1 //src.damtype = "fire" for(var/mob/O in viewers(usr, null)) O.show_message(flavor_text, 1) - SetLuminosity(brightness_on) + SetLuminosity(CANDLE_LUM) processing_objects.Add(src) process() - if(!light_on) + if(!lit) return wax-- if(!wax) @@ -70,29 +68,20 @@ attack_self(mob/user as mob) - if(light_on) - light_on = 0 + if(lit) + lit = 0 update_icon() SetLuminosity(0) - user.SetLuminosity(search_light(user, src)) + user.SetLuminosity(user.luminosity - CANDLE_LUM) pickup(mob/user) - if(light_on) - if (user.luminosity < brightness_on) - user.SetLuminosity(brightness_on) + if(lit) SetLuminosity(0) + user.SetLuminosity(user.luminosity + CANDLE_LUM) dropped(mob/user) - if(light_on) - if ((layer <= 3) || (loc != user.loc)) - user.SetLuminosity(search_light(user, src)) - SetLuminosity(brightness_on) - - - equipped(mob/user, slot) - if(light_on) - if (user.luminosity < brightness_on) - user.SetLuminosity(brightness_on) - SetLuminosity(0) + if(lit) + user.SetLuminosity(user.luminosity - CANDLE_LUM) + SetLuminosity(CANDLE_LUM) diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index 836657f587..46b7a8b4f3 100755 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -13,8 +13,6 @@ var/global/list/obj/item/device/pda/PDAs = list() w_class = 1.0 flags = FPRINT | TABLEPASS slot_flags = SLOT_ID | SLOT_BELT - light_on = 0 //Is the flashlight function on? - brightness_on = 4 //Luminosity for the flashlight function //Main variables var/owner = null @@ -24,6 +22,8 @@ var/global/list/obj/item/device/pda/PDAs = list() //Secondary variables var/scanmode = 0 //1 is medical scanner, 2 is forensics, 3 is reagent scanner. + var/fon = 0 //Is the flashlight function on? + var/f_lum = 4 //Luminosity for the flashlight function var/silent = 0 //To beep or not to beep, that is the question var/toff = 0 //If 1, messenger disabled var/tnote = null //Current Texts @@ -113,6 +113,7 @@ var/global/list/obj/item/device/pda/PDAs = list() /obj/item/device/pda/captain default_cartridge = /obj/item/weapon/cartridge/captain icon_state = "pda-c" + toff = 1 /obj/item/device/pda/cargo default_cartridge = /obj/item/weapon/cartridge/quartermaster @@ -199,22 +200,14 @@ var/global/list/obj/item/device/pda/PDAs = list() * The Actual PDA */ /obj/item/device/pda/pickup(mob/user) - if(light_on) - if(user.luminosity < brightness_on) - user.SetLuminosity(brightness_on) + if(fon) SetLuminosity(0) + user.SetLuminosity(user.luminosity + f_lum) /obj/item/device/pda/dropped(mob/user) - if(light_on) - if ((layer <= 3) || (loc != user.loc)) - user.SetLuminosity(search_light(user, src)) - SetLuminosity(brightness_on) - -/obj/item/device/pda/equipped(mob/user, slot) - if(light_on) - if(user.luminosity < brightness_on) - user.SetLuminosity(brightness_on) - SetLuminosity(0) + if(fon) + user.SetLuminosity(user.luminosity - f_lum) + SetLuminosity(f_lum) /obj/item/device/pda/New() ..() @@ -343,7 +336,7 @@ var/global/list/obj/item/device/pda/PDAs = list() if (cartridge.access_remote_door) dat += "
  • Toggle Remote Door
  • " dat += "
  • Atmospheric Scan
  • " - dat += "
  • [light_on ? "Disable" : "Enable"] Flashlight
  • " + dat += "
  • [fon ? "Disable" : "Enable"] Flashlight
  • " if (pai) if(pai.loc != src) pai = null @@ -518,18 +511,14 @@ var/global/list/obj/item/device/pda/PDAs = list() //MAIN FUNCTIONS=================================== if("Light") - if(light_on) - light_on = 0 - if(src in U.contents) - U.SetLuminosity(search_light(U, src)) - else - SetLuminosity(0) + if(fon) + fon = 0 + if(src in U.contents) U.SetLuminosity(U.luminosity - f_lum) + else SetLuminosity(0) else - light_on = 1 - if((src in U.contents) && (U.luminosity < brightness_on)) - U.SetLuminosity(brightness_on) - else - SetLuminosity(brightness_on) + fon = 1 + if(src in U.contents) U.SetLuminosity(U.luminosity + f_lum) + else SetLuminosity(f_lum) if("Medical Scan") if(scanmode == 1) scanmode = 0 @@ -769,14 +758,12 @@ var/global/list/obj/item/device/pda/PDAs = list() if (prob(15)) //Give the AI a chance of intercepting the message var/who = src.owner - var/sp_word = "from" if(prob(50)) who = P:owner - sp_word = "to" for(var/mob/living/silicon/ai/ai in mob_list) // Allows other AIs to intercept the message but the AI won't intercept their own message. if(ai.aiPDA != P && ai.aiPDA != src) - ai.show_message("Intercepted message [sp_word] [who]: [t]") + ai.show_message("Intercepted message from [who]: [t]") if (!P.silent) playsound(P.loc, 'sound/machines/twobeep.ogg', 50, 1) @@ -870,6 +857,7 @@ var/global/list/obj/item/device/pda/PDAs = list() user << "You insert [cartridge] into [src]." if(cartridge.radio) cartridge.radio.hostpda = src + else if(istype(C, /obj/item/weapon/card/id)) var/obj/item/weapon/card/id/idcard = C if(!idcard.registered_name) @@ -1011,15 +999,16 @@ var/global/list/obj/item/device/pda/PDAs = list() for (var/mob/O in viewers(user, null)) O << "\red [user] has used [src] on \icon[icon] [A]" - var/pressure = A:parent.air.return_pressure() - var/total_moles = A:parent.air.total_moles() + var/obj/machinery/atmospherics/pipe/tank/T = A + var/pressure = T.parent.air.return_pressure() + var/total_moles = T.parent.air.total_moles() user << "\blue Results of analysis of \icon[icon]" if (total_moles>0) - var/o2_concentration = A:parent.air.oxygen/total_moles - var/n2_concentration = A:parent.air.nitrogen/total_moles - var/co2_concentration = A:parent.air.carbon_dioxide/total_moles - var/plasma_concentration = A:parent.air.toxins/total_moles + var/o2_concentration = T.parent.air.oxygen/total_moles + var/n2_concentration = T.parent.air.nitrogen/total_moles + var/co2_concentration = T.parent.air.carbon_dioxide/total_moles + var/plasma_concentration = T.parent.air.toxins/total_moles var/unknown_concentration = 1-(o2_concentration+n2_concentration+co2_concentration+plasma_concentration) @@ -1030,7 +1019,7 @@ var/global/list/obj/item/device/pda/PDAs = list() user << "\blue Plasma: [round(plasma_concentration*100)]%" if(unknown_concentration>0.01) user << "\red Unknown: [round(unknown_concentration*100)]%" - user << "\blue Temperature: [round(A:parent.air.temperature-T0C)]°C" + user << "\blue Temperature: [round(T.parent.air.temperature-T0C)]°C" else user << "\blue Tank is empty!" diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm index 9c93d5dab9..9117e3f63d 100644 --- a/code/game/objects/items/weapons/cards_ids.dm +++ b/code/game/objects/items/weapons/cards_ids.dm @@ -59,6 +59,7 @@ icon_state = "emag" item_state = "card-id" origin_tech = "magnets=2;syndicate=2" + var/uses = 10 /obj/item/weapon/card/id name = "identification card" @@ -69,8 +70,14 @@ var/registered_name = null // The name registered_name on the card slot_flags = SLOT_ID + var/blood_type = "\[UNSET\]" + var/dna_hash = "\[UNSET\]" + var/fingerprint_hash = "\[UNSET\]" + var/assignment = null + var/assignment_real_title = null var/dorm = 0 // determines if this ID has claimed a dorm already + /obj/item/weapon/card/id/attack_self(mob/user as mob) for(var/mob/O in viewers(user, null)) O.show_message(text("[] shows you: \icon[] []: assignment: []", user, src, src.name, src.assignment), 1) diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm index c2aba29f82..dff332f2a6 100644 --- a/code/game/objects/items/weapons/cigs_lighters.dm +++ b/code/game/objects/items/weapons/cigs_lighters.dm @@ -63,7 +63,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM var/lit = 0 var/icon_on = "cigon" //Note - these are in masks.dmi not in cigarette.dmi var/icon_off = "cigoff" - var/butt_icon = "cigbutt" + var/type_butt = /obj/item/weapon/cigbutt var/lastHolder = null var/smoketime = 300 var/chem_volume = 15 @@ -86,12 +86,12 @@ CIGARETTE PACKETS ARE IN FANCY.DM else if(istype(W, /obj/item/weapon/lighter/zippo)) var/obj/item/weapon/lighter/zippo/Z = W - if(Z.light_on) + if(Z.lit) light("With a single flick of their wrist, [user] smoothly lights their [name] with their [W]. Damn they're cool.") else if(istype(W, /obj/item/weapon/lighter)) var/obj/item/weapon/lighter/L = W - if(L.light_on) + if(L.lit) light("After some fiddling, [user] manages to light their [name] with [W].") else if(istype(W, /obj/item/weapon/match)) @@ -116,16 +116,15 @@ CIGARETTE PACKETS ARE IN FANCY.DM /obj/item/clothing/mask/cigarette/afterattack(obj/item/weapon/reagent_containers/glass/glass, mob/user as mob) ..() - if(lit == 0) - if(istype(glass)) //you can dip cigarettes into beakers - var/transfered = glass.reagents.trans_to(src, chem_volume) - if(transfered) //if reagents were transfered, show the message - user << "You dip \the [src] into \the [glass]." - else //if not, either the beaker was empty, or the cigarette was full - if(!glass.reagents.total_volume) - user << "[glass] is empty." - else - user << "[src] is full." + if(istype(glass)) //you can dip cigarettes into beakers + var/transfered = glass.reagents.trans_to(src, chem_volume) + if(transfered) //if reagents were transfered, show the message + user << "You dip \the [src] into \the [glass]." + else //if not, either the beaker was empty, or the cigarette was full + if(!glass.reagents.total_volume) + user << "[glass] is empty." + else + user << "[src] is full." /obj/item/clothing/mask/cigarette/proc/light(var/flavor_text = "[usr] lights the [name].") @@ -157,50 +156,38 @@ CIGARETTE PACKETS ARE IN FANCY.DM var/turf/location = get_turf(src) smoketime-- if(smoketime < 1) - put_out() + new type_butt(location) + processing_objects.Remove(src) if(ismob(loc)) var/mob/living/M = loc M << "Your [name] goes out." - //M.u_equip(src) //un-equip it so the overlays can update - //M.update_inv_wear_mask(0) + M.u_equip(src) //un-equip it so the overlays can update + M.update_inv_wear_mask(0) + del(src) return - if(lit == 1) - if(location) - location.hotspot_expose(700, 5) - if(reagents && reagents.total_volume) // check if it has any reagents at all - if(iscarbon(loc) && (src == loc:wear_mask)) // if it's in the human/monkey mouth, transfer reagents to the mob - var/mob/living/carbon/C = loc - if(prob(15)) // so it's not an instarape in case of acid - reagents.reaction(C, INGEST) - reagents.trans_to(C, REAGENTS_METABOLISM) - else // else just remove some of the reagents - reagents.remove_any(REAGENTS_METABOLISM) + if(location) + location.hotspot_expose(700, 5) + if(reagents && reagents.total_volume) // check if it has any reagents at all + if(iscarbon(loc) && (src == loc:wear_mask)) // if it's in the human/monkey mouth, transfer reagents to the mob + var/mob/living/carbon/C = loc + if(prob(15)) // so it's not an instarape in case of acid + reagents.reaction(C, INGEST) + reagents.trans_to(C, REAGENTS_METABOLISM) + else // else just remove some of the reagents + reagents.remove_any(REAGENTS_METABOLISM) return /obj/item/clothing/mask/cigarette/attack_self(mob/user as mob) if(lit == 1) - var/mob/living/carbon/human/H = user - if(H.shoes) - user.visible_message("[user] crushes [src] on the sole of his shoes, putting it out instantly.") - else - user.visible_message("[user] spits oh his fingers, then puts down [src].") - put_out() + user.visible_message("[user] calmly drops and treads on the lit [src], putting it out instantly.") + var/turf/T = get_turf(src) + new type_butt(T) + processing_objects.Remove(src) + del(src) return ..() -/obj/item/clothing/mask/cigarette/proc/put_out() - if(src.lit == 1) - src.lit = -1 - icon_state = src.butt_icon - desc = "Old manky [src] butt." - name = "[src] butt" - attack_verb = list("poked") - processing_objects.Remove(src) - if (usr) - usr.update_inv_l_hand() - usr.update_inv_r_hand() - //////////// // CIGARS // @@ -211,7 +198,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM icon_state = "cigaroff" icon_on = "cigaron" icon_off = "cigaroff" - butt_icon = "cigarbutt" + type_butt = /obj/item/weapon/cigbutt/cigarbutt throw_speed = 0.5 item_state = "cigaroff" smoketime = 1500 @@ -247,6 +234,12 @@ CIGARETTE PACKETS ARE IN FANCY.DM icon_state = "cigarbutt" +/obj/item/clothing/mask/cigarette/cigar/attackby(obj/item/weapon/W as obj, mob/user as mob) + if(istype(W, /obj/item/weapon/match)) + ..() + else + user << "\The [src] straight out REFUSES to be lit by such uncivilized means." + ///////////////// //SMOKING PIPES// ///////////////// @@ -300,6 +293,12 @@ CIGARETTE PACKETS ARE IN FANCY.DM smoketime = initial(smoketime) return +/obj/item/clothing/mask/cigarette/pipe/attackby(obj/item/weapon/W as obj, mob/user as mob) + if(istype(W, /obj/item/weapon/match)) + ..() + else + user << "\The [src] straight out REFUSES to be lit by such means." + /obj/item/clothing/mask/cigarette/pipe/cobpipe name = "corn cob pipe" desc = "A nicotine delivery system popularized by folksy backwoodsmen and kept popular in the modern age and beyond by space hipsters." @@ -327,8 +326,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM flags = TABLEPASS | CONDUCT slot_flags = SLOT_BELT attack_verb = list("burnt", "singed") - light_on = 0 - brightness_on = 2 //luminosity when on + var/lit = 0 /obj/item/weapon/lighter/zippo name = "Zippo lighter" @@ -347,28 +345,24 @@ CIGARETTE PACKETS ARE IN FANCY.DM /obj/item/weapon/lighter/attack_self(mob/living/user) if(user.r_hand == src || user.l_hand == src) - if(!light_on) - light_on = 1 + if(!lit) + lit = 1 icon_state = icon_on item_state = icon_on if(istype(src, /obj/item/weapon/lighter/zippo) ) user.visible_message("Without even breaking stride, [user] flips open and lights [src] in one smooth movement.") else - if(prob(90)) + if(prob(75)) user.visible_message("After a few attempts, [user] manages to light the [src].") else user << "You burn yourself while lighting the lighter." - if (user.l_hand == src) - user.apply_damage(2,BURN,"l_hand") - else - user.apply_damage(2,BURN,"r_hand") + user.adjustFireLoss(5) user.visible_message("After a few attempts, [user] manages to light the [src], they however burn their finger in the process.") - if (user.luminosity < brightness_on) - user.SetLuminosity(brightness_on) + user.SetLuminosity(user.luminosity + 2) processing_objects.Add(src) else - light_on = 0 + lit = 0 icon_state = icon_off item_state = icon_off if(istype(src, /obj/item/weapon/lighter/zippo) ) @@ -376,7 +370,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM else user.visible_message("[user] quietly shuts off the [src].") - user.SetLuminosity(search_light(user, src)) + user.SetLuminosity(user.luminosity - 2) processing_objects.Remove(src) else return ..() @@ -387,7 +381,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM if(!istype(M, /mob)) return - if(istype(M.wear_mask, /obj/item/clothing/mask/cigarette) && user.zone_sel.selecting == "mouth" && light_on) + if(istype(M.wear_mask, /obj/item/clothing/mask/cigarette) && user.zone_sel.selecting == "mouth" && lit) var/obj/item/clothing/mask/cigarette/cig = M.wear_mask if(M == user) cig.attackby(src, user) @@ -407,24 +401,14 @@ CIGARETTE PACKETS ARE IN FANCY.DM /obj/item/weapon/lighter/pickup(mob/user) - if(light_on) - if (user.luminosity < brightness_on) - user.SetLuminosity(brightness_on) + if(lit) SetLuminosity(0) + user.SetLuminosity(user.luminosity+2) return /obj/item/weapon/lighter/dropped(mob/user) - if(light_on) - if ((layer <= 3) || (loc != user.loc)) - user.SetLuminosity(search_light(user, src)) - SetLuminosity(brightness_on) - return - - -/obj/item/weapon/lighter/equipped(mob/user, slot) - if(light_on) - if (user.luminosity < brightness_on) - user.SetLuminosity(brightness_on) - SetLuminosity(0) + if(lit) + user.SetLuminosity(user.luminosity-2) + SetLuminosity(2) return diff --git a/code/game/objects/items/weapons/surgery_tools.dm b/code/game/objects/items/weapons/surgery_tools.dm index a3aee8097d..e0cb460355 100644 --- a/code/game/objects/items/weapons/surgery_tools.dm +++ b/code/game/objects/items/weapons/surgery_tools.dm @@ -22,16 +22,17 @@ w_class = 1.0 origin_tech = "materials=1;biotech=1" -/obj/item/weapon/retractor/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob) - if(!istype(M)) - return - /*HAHA, SUCK IT, 2000 LINES OF SPAGHETTI CODE! NOW YOUR JOB IOS DONE BY ONLY 500 LINES OF SPAGHETTI CODE! LOOK FOR SURGERY.DM*/ +/* +/obj/item/weapon/retractor/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob) + if(!istype(M)) + return + var/mob/living/carbon/human/H = M if(istype(H) && ( \ (H.head && H.head.flags & HEADCOVERSEYES) || \ @@ -119,6 +120,7 @@ LOOK FOR SURGERY.DM*/ return ..() return +*/ /* * Hemostat @@ -135,6 +137,7 @@ LOOK FOR SURGERY.DM*/ origin_tech = "materials=1;biotech=1" attack_verb = list("attacked", "pinched") +/* /obj/item/weapon/hemostat/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob) if(!istype(M)) return @@ -252,6 +255,7 @@ LOOK FOR SURGERY.DM*/ return ..() return +*/ /* * Cautery @@ -268,6 +272,7 @@ LOOK FOR SURGERY.DM*/ origin_tech = "materials=1;biotech=1" attack_verb = list("burnt") +/* /obj/item/weapon/cautery/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob) if(!istype(M)) return @@ -340,6 +345,7 @@ LOOK FOR SURGERY.DM*/ return ..() return +*/ /* * Surgical Drill @@ -362,6 +368,7 @@ LOOK FOR SURGERY.DM*/ viewers(user) << pick("/red [user] is pressing the [src] to \his temple and activating it! It looks like \he's trying to commit suicide.", \ "/red [user] is pressing [src] to \his chest and activating it! It looks like \he's trying to commit suicide.") return (BRUTELOSS) + /* * Scalpel */ @@ -387,6 +394,7 @@ LOOK FOR SURGERY.DM*/ "\red [user] is slitting \his stomach open with the [src]! It looks like \he's trying to commit seppuku.") return (BRUTELOSS) +/* /obj/item/weapon/scalpel/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob) if(!istype(M)) return ..() @@ -610,7 +618,7 @@ LOOK FOR SURGERY.DM*/ else if((!(user.zone_sel.selecting == "head")) || (!(user.zone_sel.selecting == "groin")) || (!(istype(M, /mob/living/carbon/human)))) return ..()*/ return - +*/ /* * Circular Saw @@ -632,6 +640,7 @@ LOOK FOR SURGERY.DM*/ origin_tech = "materials=1;biotech=1" attack_verb = list("attacked", "slashed", "sawed", "cut") +/* /obj/item/weapon/circular_saw/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob) if(!istype(M)) return ..() @@ -780,6 +789,7 @@ LOOK FOR SURGERY.DM*/ return ..() */ return +*/ //misc, formerly from code/defines/weapons.dm /obj/item/weapon/bonegel diff --git a/code/game/objects/structures/barsign.dm b/code/game/objects/structures/barsign.dm new file mode 100644 index 0000000000..3164bf90ea --- /dev/null +++ b/code/game/objects/structures/barsign.dm @@ -0,0 +1,12 @@ +/obj/structure/sign/barsign + icon = 'barsigns.dmi' + icon_state = "empty" + anchored = 1 + New() + ChangeSign(pick("pinkflamingo", "magmasea", "limbo", "rustyaxe", "armokbar", "brokendrum", "meadbay", "thedamnwall", "thecavern", "cindikate", "theorchard", "thesaucyclown", "theclownshead")) + return + proc/ChangeSign(var/Text) + src.icon_state = "[Text]" + //on = 0 + //brightness_on = 4 //uncomment these when the lighting fixes get in + return diff --git a/code/game/objects/structures/crates_lockers/closets/secure/hydroponics.dm b/code/game/objects/structures/crates_lockers/closets/secure/hydroponics.dm index 4d834e94aa..cf1132c93f 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/hydroponics.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/hydroponics.dm @@ -17,7 +17,8 @@ new /obj/item/clothing/suit/apron(src) if(2) new /obj/item/clothing/suit/apron/overalls(src) - new /obj/item/weapon/storage/bag/plants(src) new /obj/item/clothing/under/rank/hydroponics(src) + new /obj/item/weapon/storage/bag/plants(src) + new /obj/item/clothing/under/rank/hydroponics(src) new /obj/item/device/analyzer/plant_analyzer(src) new /obj/item/clothing/head/greenbandana(src) new /obj/item/weapon/minihoe(src) diff --git a/code/game/objects/structures/crates_lockers/closets/secure/scientist.dm b/code/game/objects/structures/crates_lockers/closets/secure/scientist.dm index 6dfafcdad1..1dc3ca6f58 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/scientist.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/scientist.dm @@ -13,7 +13,8 @@ sleep(2) new /obj/item/clothing/under/rank/scientist(src) //new /obj/item/clothing/suit/labcoat/science(src) - new /obj/item/clothing/suit/storage/labcoat(src) new /obj/item/clothing/shoes/white(src) + new /obj/item/clothing/suit/storage/labcoat(src) + new /obj/item/clothing/shoes/white(src) // new /obj/item/weapon/cartridge/signal/toxins(src) new /obj/item/device/radio/headset/headset_sci(src) new /obj/item/weapon/tank/air(src) diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm index 57d854594f..236d41d319 100644 --- a/code/game/turfs/simulated/floor.dm +++ b/code/game/turfs/simulated/floor.dm @@ -159,10 +159,10 @@ turf/simulated/floor/proc/update_icon() if( !(icon_state in wood_icons) ) icon_state = "wood" //world << "[icon_state]y's got [icon_state]" - spawn(1) + /*spawn(1) if(istype(src,/turf/simulated/floor)) //Was throwing runtime errors due to a chance of it changing to space halfway through. if(air) - update_visuals(air) + update_visuals(air)*/ /turf/simulated/floor/return_siding_icon_state() ..() diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 3fe1f78928..854d024fdb 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -243,6 +243,7 @@ //////Assimilate Air////// /turf/simulated/proc/Assimilate_Air() + /* var/aoxy = 0//Holders to assimilate air from nearby turfs var/anitro = 0 var/aco = 0 @@ -269,6 +270,7 @@ air.carbon_dioxide = (aco/max(turf_count,1)) air.toxins = (atox/max(turf_count,1)) air.temperature = (atemp/max(turf_count,1))//Trace gases can get bant + */ /turf/proc/ReplaceWithLattice() src.ChangeTurf(/turf/space) diff --git a/code/modules/DetectiveWork/detective_work.dm b/code/modules/DetectiveWork/detective_work.dm index e02f0ea789..047fa29e50 100644 --- a/code/modules/DetectiveWork/detective_work.dm +++ b/code/modules/DetectiveWork/detective_work.dm @@ -459,11 +459,12 @@ obj/machinery/computer/forensic_scanning proc/add_data_scanner(var/obj/item/device/W) if(istype(W, /obj/item/device/detective_scanner)) - if(W:stored) - for(var/atom in W:stored) - var/list/data = W:stored[atom] + var/obj/item/device/detective_scanner/D = W + if(D.stored) + for(var/atom in D.stored) + var/list/data = D.stored[atom] add_data_master(atom,data[1],data[2],data[3],data[4]) - W:stored = list() + D.stored = list() else if(istype(W, /obj/item/device/pda) && W:cartridge && W:cartridge.access_security) if(W:cartridge.stored_data) for(var/atom in W:cartridge.stored_data) diff --git a/code/modules/DetectiveWork/scanner.dm b/code/modules/DetectiveWork/scanner.dm index a1c667a127..7bafd4a31f 100644 --- a/code/modules/DetectiveWork/scanner.dm +++ b/code/modules/DetectiveWork/scanner.dm @@ -1,166 +1,173 @@ //CONTAINS: Detective's Scanner -// TODO: Split everything into easy to manage procs. /obj/item/device/detective_scanner - name = "scanner" - desc = "Used to scan objects for DNA and fingerprints. Can print a report of the findings." + name = "Scanner" + desc = "Used to scan objects for DNA and fingerprints." icon_state = "forensic1" + var/amount = 20.0 + var/list/stored = list() w_class = 3.0 item_state = "electronic" flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY slot_flags = SLOT_BELT - var/scanning = 0 - var/list/log = list() -/obj/item/device/detective_scanner/attack_self(var/mob/user) - if(log.len && !scanning) - scanning = 1 - user << "Printing report, please wait..." - - spawn(100) - - // Create our paper - var/obj/item/weapon/paper/P = new(get_turf(src)) - P.name = "paper- 'Scanner Report'" - P.info = "
    Scanner Report


    " - P.info += dd_list2text(log, "
    ") - P.info += "
    Notes:
    " - P.info_links = P.info - - if(ismob(loc)) - var/mob/M = loc - M.put_in_hands(P) - M << "Report printed. Log cleared." - - // Clear the logs - log = list() - scanning = 0 - else - user << "The scanner has no logs or is in use." - -/obj/item/device/detective_scanner/attack(mob/living/M as mob, mob/user as mob) - scan(M, user) - - -/obj/item/device/detective_scanner/afterattack(atom/A as obj|turf|area, mob/user as mob) - - if(!in_range(A,user)) - return - if(!isturf(A) && !isobj(A)) - return - if(loc != user) - return - scan(A, user) - -/obj/item/device/detective_scanner/proc/scan(var/atom/A, var/mob/user) - - if(!scanning) - scanning = 1 - - user.visible_message("\The [user] scans \the [A] with \the [src], the air around [user.gender == MALE ? "him" : "her"] humming[prob(70) ? " gently." : "."]") - user << "You scan [A]. The scanner is analysing the results..." - - - // GATHER INFORMATION - - //Make our lists - var/list/fingerprints = list() - var/list/blood = list() - var/list/fibers = list() - var/list/reagents = list() - - var/target_name = A.name - - // Start gathering - - if(ishuman(A)) - - var/mob/living/carbon/human/H = A - if (istype(H.dna, /datum/dna) && !H.gloves) - fingerprints += md5(H.dna.uni_identity) - - if(H.blood_DNA && H.blood_DNA.len) - blood = H.blood_DNA.Copy() - else - - if(A.fingerprints && A.fingerprints.len) - fingerprints = A.fingerprints.Copy() - - if(A.blood_DNA && A.blood_DNA.len) - blood = A.blood_DNA.Copy() - - if(A.reagents && A.reagents.reagent_list.len) - for(var/datum/reagent/R in A.reagents.reagent_list) - reagents[R.name] = R.volume - - if(A.suit_fibers && A.suit_fibers.len) - fibers = A.suit_fibers.Copy() - - // We gathered everything. Create a fork and slowly display the results to the holder of the scanner. - - spawn(0) - - var/found_something = 0 - add_log("[get_timestamp()] - [target_name]", 0) - - // Fingerprints - if(fingerprints && fingerprints.len) - sleep(30) - add_log("Prints:") - for(var/finger in fingerprints) - add_log("[finger]") - found_something = 1 - - // Blood - if (blood && blood.len) - sleep(30) - add_log("Blood:") - found_something = 1 - for(var/B in blood) - add_log("Type: [blood[B]] DNA: [B]") - - //Fibers - if(fibers && fibers.len) - sleep(30) - add_log("Fibers:") - for(var/fiber in fibers) - add_log("[fiber]") - found_something = 1 - - //Reagents - if(reagents && reagents.len) - sleep(30) - add_log("Reagents:") - for(var/R in reagents) - add_log("Reagent: [R] Volume: [reagents[R]]") - found_something = 1 - - // Get a new user - var/mob/holder = null - if(ismob(src.loc)) - holder = src.loc - - if(!found_something) - add_log("# No forensic traces found #", 0) // Don't display this to the holder user - if(holder) - holder << "Unable to locate any fingerprints, materials, fibers, or blood on [target_name]!" + attackby(obj/item/weapon/f_card/W as obj, mob/user as mob) + ..() + if (istype(W, /obj/item/weapon/f_card)) + if (W.fingerprints) + return + if (src.amount == 20) + return + if (W.amount + src.amount > 20) + src.amount = 20 + W.amount = W.amount + src.amount - 20 else - if(holder) - holder << "You finish scanning \the [target_name]." + src.amount += W.amount + //W = null + del(W) + add_fingerprint(user) + if (W) + W.add_fingerprint(user) + return - add_log("---------------------------------------------------------", 0) - scanning = 0 + attack(mob/living/carbon/human/M as mob, mob/user as mob) + if (!ishuman(M)) + user << "\red [M] is not human and cannot have the fingerprints." + return 0 + if (( !( istype(M.dna, /datum/dna) ) || M.gloves) ) + user << "\blue No fingerprints found on [M]" + return 0 + else + if (src.amount < 1) + user << text("\blue Fingerprints scanned on [M]. Need more cards to print.") + else + src.amount-- + var/obj/item/weapon/f_card/F = new /obj/item/weapon/f_card( user.loc ) + F.amount = 1 + F.add_fingerprint(M) + F.icon_state = "fingerprint1" + F.name = text("FPrintC- '[M.name]'") + + user << "\blue Done printing." + user << "\blue [M]'s Fingerprints: [md5(M.dna.uni_identity)]" + if ( !M.blood_DNA || !M.blood_DNA.len ) + user << "\blue No blood found on [M]" + if(M.blood_DNA) + del(M.blood_DNA) + else + user << "\blue Blood found on [M]. Analysing..." + spawn(15) + for(var/blood in M.blood_DNA) + user << "\blue Blood type: [M.blood_DNA[blood]]\nDNA: [blood]" + return + + afterattack(atom/A as obj|turf|area, mob/user as mob) + if(!in_range(A,user)) + return + if(loc != user) + return + if(istype(A,/obj/machinery/computer/forensic_scanning)) //breaks shit. + return + if(istype(A,/obj/item/weapon/f_card)) + user << "The scanner displays on the screen: \"ERROR 43: Object on Excluded Object List.\"" return -/obj/item/device/detective_scanner/proc/add_log(var/msg, var/broadcast = 1) - if(scanning) - if(broadcast && ismob(loc)) - var/mob/M = loc - M << msg - log += "  [msg]" - else - CRASH("[src] \ref[src] is adding a log when it was never put in scanning mode!") + add_fingerprint(user) -/obj/item/device/detective_scanner/proc/get_timestamp() - return time2text(world.time + 432000, "hh:mm:ss") \ No newline at end of file + + //Special case for blood splaters. + if (istype(A, /obj/effect/decal/cleanable/blood) || istype(A, /obj/effect/rune)) + if(!isnull(A.blood_DNA)) + for(var/blood in A.blood_DNA) + user << "\blue Blood type: [A.blood_DNA[blood]]\nDNA: [blood]" + return + + //General + if ((!A.fingerprints || !A.fingerprints.len) && !A.suit_fibers && !A.blood_DNA) + user.visible_message("\The [user] scans \the [A] with \a [src], the air around [user.gender == MALE ? "him" : "her"] humming[prob(70) ? " gently." : "."]" ,\ + "\blue Unable to locate any fingerprints, materials, fibers, or blood on [A]!",\ + "You hear a faint hum of electrical equipment.") + return 0 + + if(add_data(A)) + user << "\blue Object already in internal memory. Consolidating data..." + return + + + //PRINTS + if(!A.fingerprints || !A.fingerprints.len) + if(A.fingerprints) + del(A.fingerprints) + else + user << "\blue Isolated [A.fingerprints.len] fingerprints: Data Stored: Scan with Hi-Res Forensic Scanner to retrieve." + var/list/complete_prints = list() + for(var/i in A.fingerprints) + var/print = A.fingerprints[i] + if(stringpercent(print) <= FINGERPRINT_COMPLETE) + complete_prints += print + if(complete_prints.len < 1) + user << "\blue   No intact prints found" + else + user << "\blue   Found [complete_prints.len] intact prints" + for(var/i in complete_prints) + user << "\blue     [i]" + + //FIBERS + if(A.suit_fibers) + user << "\blue Fibers/Materials Data Stored: Scan with Hi-Res Forensic Scanner to retrieve." + + //Blood + if (A.blood_DNA) + user << "\blue Blood found on [A]. Analysing..." + spawn(15) + for(var/blood in A.blood_DNA) + user << "Blood type: \red [A.blood_DNA[blood]] \t \black DNA: \red [blood]" + if(prob(80) || !A.fingerprints) + user.visible_message("\The [user] scans \the [A] with \a [src], the air around [user.gender == MALE ? "him" : "her"] humming[prob(70) ? " gently." : "."]" ,\ + "You finish scanning \the [A].",\ + "You hear a faint hum of electrical equipment.") + return 0 + else + user.visible_message("\The [user] scans \the [A] with \a [src], the air around [user.gender == MALE ? "him" : "her"] humming[prob(70) ? " gently." : "."]\n[user.gender == MALE ? "He" : "She"] seems to perk up slightly at the readout." ,\ + "The results of the scan pique your interest.",\ + "You hear a faint hum of electrical equipment, and someone making a thoughtful noise.") + return 0 + return + + proc/add_data(atom/A as mob|obj|turf|area) + //I love associative lists. + var/list/data_entry = stored["\ref [A]"] + if(islist(data_entry)) //Yay, it was already stored! + //Merge the fingerprints. + var/list/data_prints = data_entry[1] + for(var/print in A.fingerprints) + var/merged_print = data_prints[print] + if(!merged_print) + data_prints[print] = A.fingerprints[print] + else + data_prints[print] = stringmerge(data_prints[print],A.fingerprints[print]) + + //Now the fibers + var/list/fibers = data_entry[2] + if(!fibers) + fibers = list() + if(A.suit_fibers && A.suit_fibers.len) + for(var/j = 1, j <= A.suit_fibers.len, j++) //Fibers~~~ + if(!fibers.Find(A.suit_fibers[j])) //It isn't! Add! + fibers += A.suit_fibers[j] + var/list/blood = data_entry[3] + if(!blood) + blood = list() + if(A.blood_DNA && A.blood_DNA.len) + for(var/main_blood in A.blood_DNA) + if(!blood[main_blood]) + blood[main_blood] = A.blood_DNA[blood] + return 1 + var/list/sum_list[4] //Pack it back up! + sum_list[1] = A.fingerprints ? A.fingerprints.Copy() : null + sum_list[2] = A.suit_fibers ? A.suit_fibers.Copy() : null + sum_list[3] = A.blood_DNA ? A.blood_DNA.Copy() : null + sum_list[4] = "\The [A] in \the [get_area(A)]" + stored["\ref [A]"] = sum_list + return 0 \ No newline at end of file diff --git a/code/modules/admin/verbs/diagnostics.dm b/code/modules/admin/verbs/diagnostics.dm index 8f887f837c..1e328970fd 100644 --- a/code/modules/admin/verbs/diagnostics.dm +++ b/code/modules/admin/verbs/diagnostics.dm @@ -182,6 +182,7 @@ else usr << "Local airgroup is unsimulated!" feedback_add_details("admin_verb","KLAG") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + */ /client/proc/print_jobban_old() set name = "Print Jobban Log" diff --git a/code/modules/admin/verbs/getlogs.dm b/code/modules/admin/verbs/getlogs.dm index 884ec0e875..eac11fcac0 100644 --- a/code/modules/admin/verbs/getlogs.dm +++ b/code/modules/admin/verbs/getlogs.dm @@ -23,7 +23,6 @@ set desc = "Give somebody access to any session logfiles saved to the /log/runtime/ folder." set category = null - if( !src.holder ) if(!src.holder) src << "Only Admins may use this command." return diff --git a/code/modules/awaymissions/corpse.dm b/code/modules/awaymissions/corpse.dm index 9dfe29ce23..e0cc01cb3e 100644 --- a/code/modules/awaymissions/corpse.dm +++ b/code/modules/awaymissions/corpse.dm @@ -23,12 +23,14 @@ var/corpseidjob = null // Needs to be in quotes, such as "Clown" or "Chef." This just determines what the ID reads as, not their access var/corpseidaccess = null //This is for access. See access.dm for which jobs give what access. Again, put in quotes. Use "Captain" if you want it to be all access. var/corpseidicon = null //For setting it to be a gold, silver, centcomm etc ID + var/mutantrace = "human" /obj/effect/landmark/corpse/initialize() createCorpse() /obj/effect/landmark/corpse/proc/createCorpse() //Creates a mob and checks for gear in each slot before attempting to equip it. var/mob/living/carbon/human/M = new /mob/living/carbon/human (src.loc) + M.dna.mutantrace = mutantrace M.real_name = src.name M.death(1) //Kills the new mob if(src.corpseuniform) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index e762025782..55259f65f0 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -358,7 +358,8 @@ datum/preferences user << browse(dat, "window=preferences;size=560x580") proc/SetChoices(mob/user, limit = 17, list/splitJobs = list("Chief Engineer"), width = 550, height = 550) - if(!job_master) return + if(!job_master) + return //limit - The amount of jobs allowed per column. Defaults to 17 to make it look nice. //splitJobs - Allows you split the table by job. You can make different tables for each department by including their heads. Defaults to CE to make it look nice. diff --git a/code/modules/clothing/head/hardhat.dm b/code/modules/clothing/head/hardhat.dm index f35ddfb30c..dfca62aa01 100644 --- a/code/modules/clothing/head/hardhat.dm +++ b/code/modules/clothing/head/hardhat.dm @@ -4,8 +4,8 @@ icon_state = "hardhat0_yellow" flags = FPRINT | TABLEPASS item_state = "hardhat0_yellow" - brightness_on = 4 //luminosity when on - light_on = 0 + var/brightness_on = 4 //luminosity when on + var/on = 0 color = "yellow" //Determines used sprites: hardhat[on]_[color] and hardhat[on]_[color]2 (lying down sprite) armor = list(melee = 30, bullet = 5, laser = 20,energy = 10, bomb = 20, bio = 10, rad = 20) flags_inv = 0 @@ -15,35 +15,24 @@ if(!isturf(user.loc)) user << "You cannot turn the light on while in this [user.loc]" //To prevent some lighting anomalities. return - light_on = !light_on - icon_state = "hardhat[light_on]_[color]" - item_state = "hardhat[light_on]_[color]" + on = !on + icon_state = "hardhat[on]_[color]" + item_state = "hardhat[on]_[color]" - if((light_on) && (user.luminosity < brightness_on)) - user.SetLuminosity(brightness_on) - else - user.SetLuminosity(search_light(user, src)) + if(on) user.SetLuminosity(user.luminosity + brightness_on) + else user.SetLuminosity(user.luminosity - brightness_on) pickup(mob/user) - if(light_on) - if (user.luminosity < brightness_on) - user.SetLuminosity(brightness_on) + if(on) + user.SetLuminosity(user.luminosity + brightness_on) // user.UpdateLuminosity() //TODO: Carn SetLuminosity(0) dropped(mob/user) - if(light_on) - if ((layer <= 3) || (loc != user.loc)) - user.SetLuminosity(search_light(user, src)) - SetLuminosity(brightness_on) - // user.UpdateLuminosity() - - equipped(mob/user, slot) - if(light_on) - if (user.luminosity < brightness_on) - user.SetLuminosity(brightness_on) -// user.UpdateLuminosity() //TODO: Carn - SetLuminosity(0) + if(on) + user.SetLuminosity(user.luminosity - brightness_on) +// user.UpdateLuminosity() + SetLuminosity(brightness_on) /obj/item/clothing/head/hardhat/orange diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm index 5cbd78b5d7..b3c1eb5b9b 100644 --- a/code/modules/clothing/head/misc_special.dm +++ b/code/modules/clothing/head/misc_special.dm @@ -122,42 +122,32 @@ color = "pumpkin" flags = FPRINT | TABLEPASS | HEADCOVERSEYES | HEADCOVERSMOUTH | BLOCKHAIR flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE - brightness_on = 2 //luminosity when on - light_on = 0 + var/brightness_on = 2 //luminosity when on + var/on = 0 attack_self(mob/user) if(!isturf(user.loc)) user << "You cannot turn the light on while in this [user.loc]" //To prevent some lighting anomalities. return - light_on = !light_on - icon_state = "hardhat[light_on]_[color]" - item_state = "hardhat[light_on]_[color]" + on = !on + icon_state = "hardhat[on]_[color]" + item_state = "hardhat[on]_[color]" - if((light_on) && (user.luminosity < brightness_on)) - user.SetLuminosity(brightness_on) - else - user.SetLuminosity(search_light(user, src)) + if(on) user.SetLuminosity(user.luminosity + brightness_on) + else user.SetLuminosity(user.luminosity - brightness_on) pickup(mob/user) - if(light_on) - if (user.luminosity < brightness_on) - user.SetLuminosity(brightness_on) -// user.UpdateLuminosity() //TODO: Carn + if(on) + user.SetLuminosity(user.luminosity + brightness_on) +// user.UpdateLuminosity() SetLuminosity(0) dropped(mob/user) - if(light_on) - if ((layer <= 3) || (loc != user.loc)) - user.SetLuminosity(search_light(user, src)) - SetLuminosity(brightness_on) - // user.UpdateLuminosity() + if(on) + user.SetLuminosity(user.luminosity - brightness_on) +// user.UpdateLuminosity() + SetLuminosity(brightness_on) - equipped(mob/user, slot) - if(light_on) - if (user.luminosity < brightness_on) - user.SetLuminosity(brightness_on) -// user.UpdateLuminosity() //TODO: Carn - SetLuminosity(0) /* * Kitty ears */ diff --git a/code/modules/clothing/suits/jobs.dm b/code/modules/clothing/suits/jobs.dm index f7307da9f8..77af80b677 100644 --- a/code/modules/clothing/suits/jobs.dm +++ b/code/modules/clothing/suits/jobs.dm @@ -75,7 +75,7 @@ desc = "A forensics technician jacket." item_state = "det_suit" body_parts_covered = UPPER_TORSO|LOWER_TORSO|ARMS - allowed = list(/obj/item/weapon/tank/emergency_oxygen, /obj/item/device/flashlight,/obj/item/weapon/gun/energy,/obj/item/weapon/gun/projectile,/obj/item/ammo_magazine,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/handcuffs,/obj/item/weapon/cigpacket,/obj/item/weapon/lighter,/obj/item/device/detective_scanner,/obj/item/device/taperecorder) + allowed = list(/obj/item/weapon/tank/emergency_oxygen, /obj/item/device/flashlight,/obj/item/weapon/gun/energy,/obj/item/weapon/gun/projectile,/obj/item/ammo_magazine,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/handcuffs,/obj/item/device/detective_scanner,/obj/item/device/taperecorder) armor = list(melee = 10, bullet = 10, laser = 15, energy = 10, bomb = 0, bio = 0, rad = 0) /obj/item/clothing/suit/storage/forensics/red diff --git a/code/modules/clothing/suits/utility.dm b/code/modules/clothing/suits/utility.dm index 005ded48a9..b6d2607eb7 100644 --- a/code/modules/clothing/suits/utility.dm +++ b/code/modules/clothing/suits/utility.dm @@ -25,7 +25,6 @@ heat_protection = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS max_heat_protection_temperature = FIRESUIT_MAX_HEAT_PROTECITON_TEMPERATURE cold_protection = UPPER_TORSO | LOWER_TORSO | LEGS | FEET | ARMS | HANDS - min_cold_protection_temperature = FIRESUIT_MIN_COLD_PROTECITON_TEMPERATURE /obj/item/clothing/suit/fire/firefighter diff --git a/code/modules/customitems/item_spawning.dm b/code/modules/customitems/item_spawning.dm index d9a6e57d51..ffcc19b7b7 100644 --- a/code/modules/customitems/item_spawning.dm +++ b/code/modules/customitems/item_spawning.dm @@ -42,7 +42,7 @@ I.blood_type = C.blood_type I.dna_hash = C.dna_hash I.fingerprint_hash = C.fingerprint_hash - I.pin = C.pin + //I.pin = C.pin //custom stuff if(M.ckey == "fastler" && M.real_name == "Fastler Greay") //This is a Lifetime ID diff --git a/code/modules/detectivework/scanner.dm b/code/modules/detectivework/scanner.dm index a1c667a127..7bafd4a31f 100644 --- a/code/modules/detectivework/scanner.dm +++ b/code/modules/detectivework/scanner.dm @@ -1,166 +1,173 @@ //CONTAINS: Detective's Scanner -// TODO: Split everything into easy to manage procs. /obj/item/device/detective_scanner - name = "scanner" - desc = "Used to scan objects for DNA and fingerprints. Can print a report of the findings." + name = "Scanner" + desc = "Used to scan objects for DNA and fingerprints." icon_state = "forensic1" + var/amount = 20.0 + var/list/stored = list() w_class = 3.0 item_state = "electronic" flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY slot_flags = SLOT_BELT - var/scanning = 0 - var/list/log = list() -/obj/item/device/detective_scanner/attack_self(var/mob/user) - if(log.len && !scanning) - scanning = 1 - user << "Printing report, please wait..." - - spawn(100) - - // Create our paper - var/obj/item/weapon/paper/P = new(get_turf(src)) - P.name = "paper- 'Scanner Report'" - P.info = "
    Scanner Report


    " - P.info += dd_list2text(log, "
    ") - P.info += "
    Notes:
    " - P.info_links = P.info - - if(ismob(loc)) - var/mob/M = loc - M.put_in_hands(P) - M << "Report printed. Log cleared." - - // Clear the logs - log = list() - scanning = 0 - else - user << "The scanner has no logs or is in use." - -/obj/item/device/detective_scanner/attack(mob/living/M as mob, mob/user as mob) - scan(M, user) - - -/obj/item/device/detective_scanner/afterattack(atom/A as obj|turf|area, mob/user as mob) - - if(!in_range(A,user)) - return - if(!isturf(A) && !isobj(A)) - return - if(loc != user) - return - scan(A, user) - -/obj/item/device/detective_scanner/proc/scan(var/atom/A, var/mob/user) - - if(!scanning) - scanning = 1 - - user.visible_message("\The [user] scans \the [A] with \the [src], the air around [user.gender == MALE ? "him" : "her"] humming[prob(70) ? " gently." : "."]") - user << "You scan [A]. The scanner is analysing the results..." - - - // GATHER INFORMATION - - //Make our lists - var/list/fingerprints = list() - var/list/blood = list() - var/list/fibers = list() - var/list/reagents = list() - - var/target_name = A.name - - // Start gathering - - if(ishuman(A)) - - var/mob/living/carbon/human/H = A - if (istype(H.dna, /datum/dna) && !H.gloves) - fingerprints += md5(H.dna.uni_identity) - - if(H.blood_DNA && H.blood_DNA.len) - blood = H.blood_DNA.Copy() - else - - if(A.fingerprints && A.fingerprints.len) - fingerprints = A.fingerprints.Copy() - - if(A.blood_DNA && A.blood_DNA.len) - blood = A.blood_DNA.Copy() - - if(A.reagents && A.reagents.reagent_list.len) - for(var/datum/reagent/R in A.reagents.reagent_list) - reagents[R.name] = R.volume - - if(A.suit_fibers && A.suit_fibers.len) - fibers = A.suit_fibers.Copy() - - // We gathered everything. Create a fork and slowly display the results to the holder of the scanner. - - spawn(0) - - var/found_something = 0 - add_log("[get_timestamp()] - [target_name]", 0) - - // Fingerprints - if(fingerprints && fingerprints.len) - sleep(30) - add_log("Prints:") - for(var/finger in fingerprints) - add_log("[finger]") - found_something = 1 - - // Blood - if (blood && blood.len) - sleep(30) - add_log("Blood:") - found_something = 1 - for(var/B in blood) - add_log("Type: [blood[B]] DNA: [B]") - - //Fibers - if(fibers && fibers.len) - sleep(30) - add_log("Fibers:") - for(var/fiber in fibers) - add_log("[fiber]") - found_something = 1 - - //Reagents - if(reagents && reagents.len) - sleep(30) - add_log("Reagents:") - for(var/R in reagents) - add_log("Reagent: [R] Volume: [reagents[R]]") - found_something = 1 - - // Get a new user - var/mob/holder = null - if(ismob(src.loc)) - holder = src.loc - - if(!found_something) - add_log("# No forensic traces found #", 0) // Don't display this to the holder user - if(holder) - holder << "Unable to locate any fingerprints, materials, fibers, or blood on [target_name]!" + attackby(obj/item/weapon/f_card/W as obj, mob/user as mob) + ..() + if (istype(W, /obj/item/weapon/f_card)) + if (W.fingerprints) + return + if (src.amount == 20) + return + if (W.amount + src.amount > 20) + src.amount = 20 + W.amount = W.amount + src.amount - 20 else - if(holder) - holder << "You finish scanning \the [target_name]." + src.amount += W.amount + //W = null + del(W) + add_fingerprint(user) + if (W) + W.add_fingerprint(user) + return - add_log("---------------------------------------------------------", 0) - scanning = 0 + attack(mob/living/carbon/human/M as mob, mob/user as mob) + if (!ishuman(M)) + user << "\red [M] is not human and cannot have the fingerprints." + return 0 + if (( !( istype(M.dna, /datum/dna) ) || M.gloves) ) + user << "\blue No fingerprints found on [M]" + return 0 + else + if (src.amount < 1) + user << text("\blue Fingerprints scanned on [M]. Need more cards to print.") + else + src.amount-- + var/obj/item/weapon/f_card/F = new /obj/item/weapon/f_card( user.loc ) + F.amount = 1 + F.add_fingerprint(M) + F.icon_state = "fingerprint1" + F.name = text("FPrintC- '[M.name]'") + + user << "\blue Done printing." + user << "\blue [M]'s Fingerprints: [md5(M.dna.uni_identity)]" + if ( !M.blood_DNA || !M.blood_DNA.len ) + user << "\blue No blood found on [M]" + if(M.blood_DNA) + del(M.blood_DNA) + else + user << "\blue Blood found on [M]. Analysing..." + spawn(15) + for(var/blood in M.blood_DNA) + user << "\blue Blood type: [M.blood_DNA[blood]]\nDNA: [blood]" + return + + afterattack(atom/A as obj|turf|area, mob/user as mob) + if(!in_range(A,user)) + return + if(loc != user) + return + if(istype(A,/obj/machinery/computer/forensic_scanning)) //breaks shit. + return + if(istype(A,/obj/item/weapon/f_card)) + user << "The scanner displays on the screen: \"ERROR 43: Object on Excluded Object List.\"" return -/obj/item/device/detective_scanner/proc/add_log(var/msg, var/broadcast = 1) - if(scanning) - if(broadcast && ismob(loc)) - var/mob/M = loc - M << msg - log += "  [msg]" - else - CRASH("[src] \ref[src] is adding a log when it was never put in scanning mode!") + add_fingerprint(user) -/obj/item/device/detective_scanner/proc/get_timestamp() - return time2text(world.time + 432000, "hh:mm:ss") \ No newline at end of file + + //Special case for blood splaters. + if (istype(A, /obj/effect/decal/cleanable/blood) || istype(A, /obj/effect/rune)) + if(!isnull(A.blood_DNA)) + for(var/blood in A.blood_DNA) + user << "\blue Blood type: [A.blood_DNA[blood]]\nDNA: [blood]" + return + + //General + if ((!A.fingerprints || !A.fingerprints.len) && !A.suit_fibers && !A.blood_DNA) + user.visible_message("\The [user] scans \the [A] with \a [src], the air around [user.gender == MALE ? "him" : "her"] humming[prob(70) ? " gently." : "."]" ,\ + "\blue Unable to locate any fingerprints, materials, fibers, or blood on [A]!",\ + "You hear a faint hum of electrical equipment.") + return 0 + + if(add_data(A)) + user << "\blue Object already in internal memory. Consolidating data..." + return + + + //PRINTS + if(!A.fingerprints || !A.fingerprints.len) + if(A.fingerprints) + del(A.fingerprints) + else + user << "\blue Isolated [A.fingerprints.len] fingerprints: Data Stored: Scan with Hi-Res Forensic Scanner to retrieve." + var/list/complete_prints = list() + for(var/i in A.fingerprints) + var/print = A.fingerprints[i] + if(stringpercent(print) <= FINGERPRINT_COMPLETE) + complete_prints += print + if(complete_prints.len < 1) + user << "\blue   No intact prints found" + else + user << "\blue   Found [complete_prints.len] intact prints" + for(var/i in complete_prints) + user << "\blue     [i]" + + //FIBERS + if(A.suit_fibers) + user << "\blue Fibers/Materials Data Stored: Scan with Hi-Res Forensic Scanner to retrieve." + + //Blood + if (A.blood_DNA) + user << "\blue Blood found on [A]. Analysing..." + spawn(15) + for(var/blood in A.blood_DNA) + user << "Blood type: \red [A.blood_DNA[blood]] \t \black DNA: \red [blood]" + if(prob(80) || !A.fingerprints) + user.visible_message("\The [user] scans \the [A] with \a [src], the air around [user.gender == MALE ? "him" : "her"] humming[prob(70) ? " gently." : "."]" ,\ + "You finish scanning \the [A].",\ + "You hear a faint hum of electrical equipment.") + return 0 + else + user.visible_message("\The [user] scans \the [A] with \a [src], the air around [user.gender == MALE ? "him" : "her"] humming[prob(70) ? " gently." : "."]\n[user.gender == MALE ? "He" : "She"] seems to perk up slightly at the readout." ,\ + "The results of the scan pique your interest.",\ + "You hear a faint hum of electrical equipment, and someone making a thoughtful noise.") + return 0 + return + + proc/add_data(atom/A as mob|obj|turf|area) + //I love associative lists. + var/list/data_entry = stored["\ref [A]"] + if(islist(data_entry)) //Yay, it was already stored! + //Merge the fingerprints. + var/list/data_prints = data_entry[1] + for(var/print in A.fingerprints) + var/merged_print = data_prints[print] + if(!merged_print) + data_prints[print] = A.fingerprints[print] + else + data_prints[print] = stringmerge(data_prints[print],A.fingerprints[print]) + + //Now the fibers + var/list/fibers = data_entry[2] + if(!fibers) + fibers = list() + if(A.suit_fibers && A.suit_fibers.len) + for(var/j = 1, j <= A.suit_fibers.len, j++) //Fibers~~~ + if(!fibers.Find(A.suit_fibers[j])) //It isn't! Add! + fibers += A.suit_fibers[j] + var/list/blood = data_entry[3] + if(!blood) + blood = list() + if(A.blood_DNA && A.blood_DNA.len) + for(var/main_blood in A.blood_DNA) + if(!blood[main_blood]) + blood[main_blood] = A.blood_DNA[blood] + return 1 + var/list/sum_list[4] //Pack it back up! + sum_list[1] = A.fingerprints ? A.fingerprints.Copy() : null + sum_list[2] = A.suit_fibers ? A.suit_fibers.Copy() : null + sum_list[3] = A.blood_DNA ? A.blood_DNA.Copy() : null + sum_list[4] = "\The [A] in \the [get_area(A)]" + stored["\ref [A]"] = sum_list + return 0 \ No newline at end of file diff --git a/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm b/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm index eb451b33fc..92426808b6 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm @@ -137,7 +137,7 @@ Doesn't work on other aliens/AI.*/ if(!istype(T, /turf)) return if (U == T) - usr.bullet_act(new /obj/item/projectile/neurotoxin(usr.loc), get_organ_target()) + usr.bullet_act(new /obj/item/projectile/energy/neurotoxin(usr.loc), get_organ_target()) return if(!istype(U, /turf)) return @@ -185,4 +185,4 @@ Doesn't work on other aliens/AI.*/ M.loc = loc //Paralyse(10) src.visible_message("\green [src] hurls out the contents of their stomach!") - return + return diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 61ed6812f3..8f8fe88145 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -151,7 +151,8 @@ swap_hand() /mob/living/carbon/proc/help_shake_act(mob/living/carbon/M) - if (src.health >= config.health_threshold_crit) if(src == M && istype(src, /mob/living/carbon/human)) + if (src.health >= config.health_threshold_crit) + if(src == M && istype(src, /mob/living/carbon/human)) var/mob/living/carbon/human/H = src src.visible_message( \ text("\blue [src] examines [].",src.gender==MALE?"himself":"herself"), \ diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm index 0a879bf1c3..f183606d8c 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -57,7 +57,8 @@ switch(M.a_intent) if("help") - if(health >= config.health_threshold_crit) help_shake_act(M) + if(health >= config.health_threshold_crit) + help_shake_act(M) return 1 // if(M.health < -75) return 0 diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 0390b583a1..040c983ba5 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1340,7 +1340,8 @@ var/const/BLOOD_VOLUME_SURVIVE = 122 sight &= ~(SEE_TURFS|SEE_MOBS|SEE_OBJS) if(dna) switch(dna.mutantrace) - if("lizard","slime") see_in_dark = 3 + if("lizard","slime") + see_in_dark = 3 see_invisible = SEE_INVISIBLE_LEVEL_ONE if("tajaran") see_in_dark = 4 diff --git a/code/modules/mob/living/carbon/human/say.dm b/code/modules/mob/living/carbon/human/say.dm index ebf2e23031..1dbe9b874a 100644 --- a/code/modules/mob/living/carbon/human/say.dm +++ b/code/modules/mob/living/carbon/human/say.dm @@ -22,7 +22,7 @@ /*if(src.dna.mutantrace == "lizard") //Soghun stutterss-s-ss-sss. if(copytext(message, 1, 2) != "*") message = replacetext(message, "s", stutter("ss"))*/ - /*if(src.dna.mutantrace == "slime" && prob(5)) + if(src.dna.mutantrace == "slime" && prob(5)) if(copytext(message, 1, 2) != "*") if(copytext(message, 1, 2) == ";") message = ";" @@ -31,7 +31,7 @@ message += "SKR" var/imax = rand(5,20) for(var/i = 0,i= 25) if ((HULK in mutations) && health >= 25 && length(message)) if(copytext(message, 1, 2) != "*") message = "[uppertext(message)]!!" //because I don't know how to code properly in getting vars from other files -Bro diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index bf9dfc074a..9cf18615f9 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -448,7 +448,8 @@ proc/get_damage_icon_part(damage_state, body_part) //BS12 EDIT if(dna) switch(dna.mutantrace) - if("lizard","golem","slime","shadow","adamantine") overlays_lying[MUTANTRACE_LAYER] = image("icon" = 'icons/effects/genetics.dmi', "icon_state" = "[dna.mutantrace][fat]_[gender]_l") + if("lizard","golem","slime","shadow","adamantine") + overlays_lying[MUTANTRACE_LAYER] = image("icon" = 'icons/effects/genetics.dmi', "icon_state" = "[dna.mutantrace][fat]_[gender]_l") overlays_standing[MUTANTRACE_LAYER] = image("icon" = 'icons/effects/genetics.dmi', "icon_state" = "[dna.mutantrace][fat]_[gender]_s") if("lizard","tajaran","skrell") overlays_lying[MUTANTRACE_LAYER] = image("icon" = 'icons/effects/species.dmi', "icon_state" = "[dna.mutantrace]_[gender]_l") diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm index 668f3c8ba9..36243f06cb 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules.dm @@ -179,7 +179,7 @@ src.modules += new /obj/item/weapon/reagent_containers/robodropper(src) var/obj/item/weapon/lighter/zippo/L = new /obj/item/weapon/lighter/zippo(src) - L.light_on = 1 + L.lit = 1 src.modules += L src.modules += new /obj/item/weapon/tray/robotray(src) diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index d814ac0fe3..f6d6b5118d 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -289,15 +289,14 @@ proc/AnnounceArrival(var/mob/living/carbon/human/character, var/rank) if (ticker.current_state == GAME_STATE_PLAYING) var/obj/item/device/radio/intercom/a = new /obj/item/device/radio/intercom(null)// BS12 EDIT Arrivals Announcement Computer, rather than the AI. - a.autosay("\"[character.real_name],[character.wear_id.assignment ? " [character.wear_id.assignment]," : "" ] has arrived on the station.\"", "Arrivals Announcement Computer") + + //unlikely for this to be an issue, but just in case + if(istype(character.wear_id, /obj/item/weapon/card/id)) + var/obj/item/weapon/card/id/I = character.wear_id + a.autosay("\"[character.real_name],[I.assignment ? " [I.assignment]," : "" ] has arrived on the station.\"", "Arrivals Announcement Computer") + else + a.autosay("\"[character.real_name], visitor, has arrived on the station.\"", "Arrivals Announcement Computer") del(a) - /* - var/mob/living/silicon/ai/announcer = new (null) - announcer.name = "Arrivals Announcement Computer" - announcer.real_name = "Arrivals Announcement Computer" - a.autosay("\"[character.real_name],[character.wear_id.assignment ? " [character.wear_id.assignment]," : "" ] has arrived on the station.\"", announcer) - del(announcer) - */ proc/LateChoices() var/mills = world.time // 1/10 of a second, not real milliseconds but whatever diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index af5ec79ffe..b070a95c26 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -213,7 +213,7 @@ datum for(var/mob/living/carbon/slime/M in T) M.adjustToxLoss(rand(15,20)) - var/hotspot = (locate(/obj/effect/hotspot) in T) + var/hotspot = (locate(/obj/fire) in T) if(hotspot && !istype(T, /turf/space)) var/datum/gas_mixture/lowertemp = T.remove_air( T:air:total_moles() ) lowertemp.temperature = max( min(lowertemp.temperature-2000,lowertemp.temperature / 2) ,0) @@ -224,7 +224,7 @@ datum reaction_obj(var/obj/O, var/volume) src = null var/turf/T = get_turf(O) - var/hotspot = (locate(/obj/effect/hotspot) in T) + var/hotspot = (locate(/obj/fire) in T) if(hotspot && !istype(T, /turf/space)) var/datum/gas_mixture/lowertemp = T.remove_air( T:air:total_moles() ) lowertemp.temperature = max( min(lowertemp.temperature-2000,lowertemp.temperature / 2) ,0) @@ -2102,7 +2102,7 @@ datum if(T.wet_overlay) T.overlays -= T.wet_overlay T.wet_overlay = null - var/hotspot = (locate(/obj/effect/hotspot) in T) + var/hotspot = (locate(/obj/fire) in T) if(hotspot) var/datum/gas_mixture/lowertemp = T.remove_air( T:air:total_moles() ) lowertemp.temperature = max( min(lowertemp.temperature-2000,lowertemp.temperature / 2) ,0) diff --git a/code/modules/reagents/Chemistry-Recipes.dm b/code/modules/reagents/Chemistry-Recipes.dm index ea84013e2b..3e1015c3a9 100644 --- a/code/modules/reagents/Chemistry-Recipes.dm +++ b/code/modules/reagents/Chemistry-Recipes.dm @@ -1109,8 +1109,6 @@ datum sleep(50) var/turf/location = get_turf(holder.my_atom.loc) for(var/turf/simulated/floor/target_tile in range(0,location)) - if(target_tile.parent && target_tile.parent.group_processing) - target_tile.parent.suspend_group_processing() var/datum/gas_mixture/napalm = new diff --git a/code/modules/reagents/reagent_containers/food/snacks/grown.dm b/code/modules/reagents/reagent_containers/food/snacks/grown.dm index b148c6ed60..474323928d 100644 --- a/code/modules/reagents/reagent_containers/food/snacks/grown.dm +++ b/code/modules/reagents/reagent_containers/food/snacks/grown.dm @@ -236,8 +236,8 @@ seed = "/obj/item/seeds/glowberryseed" name = "bunch of glow-berries" desc = "Nutritious!" - light_on = 1 - brightness_on = 2 //luminosity when on + var/light_on = 1 + var/brightness_on = 2 //luminosity when on icon_state = "glowberrypile" New() ..() @@ -976,4 +976,4 @@ new/obj/effect/decal/cleanable/oil(src.loc) src.visible_message("The [src.name] has been squashed, causing a distortion in space-time.","You hear a splat and a crackle.") del(src) - return + return diff --git a/code/modules/research/designs.dm b/code/modules/research/designs.dm index 8c5e42b565..84eef14e63 100644 --- a/code/modules/research/designs.dm +++ b/code/modules/research/designs.dm @@ -547,7 +547,8 @@ datum/design/telecomms_processor build_path = "/obj/item/weapon/circuitboard/telecomms/processor" datum/design/telecomms_server - name = "Circuit Design (Server Mainframe)" desc = "Allows for the construction of Telecommunications Servers." + name = "Circuit Design (Server Mainframe)" + desc = "Allows for the construction of Telecommunications Servers." id = "s-server" req_tech = list("programming" = 4, "engineering" = 4) build_type = IMPRINTER diff --git a/code/setup.dm b/code/setup.dm index d863aac100..a3bcc6a958 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -51,8 +51,6 @@ #define HELMET_MAX_HEAT_PROTECITON_TEMPERATURE 600 //For normal helmets #define ARMOR_MIN_COLD_PROTECITON_TEMPERATURE 160 //For armor #define ARMOR_MAX_HEAT_PROTECITON_TEMPERATURE 600 //For armor -#define FIRESUIT_MIN_COLD_PROTECITON_TEMPERATURE 50 //These need better cold protect -#define SPACE_SUIT_MAX_HEAT_PROTECITON_TEMPERATURE 5000 //These need better heat protect #define GLOVES_MIN_COLD_PROTECITON_TEMPERATURE 2.0 //For some gloves (black and) #define GLOVES_MAX_HEAT_PROTECITON_TEMPERATURE 1500 //For some gloves @@ -71,11 +69,8 @@ #define DOOR_CRUSH_DAMAGE 10 // Factor of how fast mob nutrition decreases -#define HUNGER_FACTOR 0.05 -#define REAGENTS_METABOLISM 0.02 -// By defining the effect multiplier this way, it'll exactly adjust -// all effects according to how they originally were with the 0.4 metabolism -#define REAGENTS_EFFECT_MULTIPLIER REAGENTS_METABOLISM / 0.4 +#define HUNGER_FACTOR 0.1 +#define REAGENTS_METABOLISM 0.4 #define MINIMUM_AIR_RATIO_TO_SUSPEND 0.05 //Minimum ratio of air that must move to/from a tile to suspend group processing @@ -110,7 +105,7 @@ #define FIRE_PLASMA_ENERGY_RELEASED 3000000 //Amount of heat released per mole of burnt plasma into the tile #define FIRE_GROWTH_RATE 40000 //For small fires -#define WATER_BOIL_TEMP 393 +//#define WATER_BOIL_TEMP 393 // Fire Damage #define CARBON_LIFEFORM_FIRE_RESISTANCE 200+T0C @@ -127,16 +122,6 @@ #define T20C 293.15 // 20degC #define TCMB 2.7 // -270.3degC -#define SPECIFIC_HEAT_TOXIN 200 -#define SPECIFIC_HEAT_AIR 20 -#define SPECIFIC_HEAT_CDO 30 -#define HEAT_CAPACITY_CALCULATION(oxygen,carbon_dioxide,nitrogen,toxins) \ - (carbon_dioxide*SPECIFIC_HEAT_CDO + (oxygen+nitrogen)*SPECIFIC_HEAT_AIR + toxins*SPECIFIC_HEAT_TOXIN) - -#define MINIMUM_HEAT_CAPACITY 0.0003 -#define QUANTIZE(variable) (round(variable,0.0001)) -#define TRANSFER_FRACTION 5 //What fraction (1/#) of the air difference to try and transfer - var/turf/space/Space_Tile = locate(/turf/space) // A space tile to reference when atmos wants to remove excess heat. #define TANK_LEAK_PRESSURE (30.*ONE_ATMOSPHERE) // Tank starts leaking @@ -549,7 +534,7 @@ var/list/liftable_structures = list(\ #define INVISIBILITY_MAXIMUM 100 //Object specific defines -//#define CANDLE_LUM 3 //For how bright candles are //Why is this here? Moved to candle.dm (brightness_on) -SweeperM +#define CANDLE_LUM 3 //For how bright candles are //Some mob defines below @@ -572,8 +557,13 @@ var/list/TAGGERLOCATIONS = list("Disposals", "Robotics", "HoP Office", "Library", "Chapel", "Theatre", "Bar", "Kitchen", "Hydroponics", "Janitor Closet","Genetics") -#define MIN_PLAYER_AGE 19 -#define MAX_PLAYER_AGE 60 +#define HOSTILE_STANCE_IDLE 1 +#define HOSTILE_STANCE_ALERT 2 +#define HOSTILE_STANCE_ATTACK 3 +#define HOSTILE_STANCE_ATTACKING 4 +#define HOSTILE_STANCE_TIRED 5 + +#define ROUNDSTART_LOGOUT_REPORT_TIME 6000 //Amount of time (in deciseconds) after the rounds starts, that the player disconnect report is issued. //Damage things @@ -607,14 +597,6 @@ var/list/TAGGERLOCATIONS = list("Disposals", #define ORGAN_SPLINTED 256 #define SALVED 512 -#define HOSTILE_STANCE_IDLE 1 -#define HOSTILE_STANCE_ALERT 2 -#define HOSTILE_STANCE_ATTACK 3 -#define HOSTILE_STANCE_ATTACKING 4 -#define HOSTILE_STANCE_TIRED 5 -#define LEFT 1 -#define RIGHT 2 - #define ROUNDSTART_LOGOUT_REPORT_TIME 6000 //Amount of time (in deciseconds) after the rounds starts, that the player disconnect report is issued. @@ -692,3 +674,6 @@ var/list/be_special_flags = list( #define LANGUAGE_OTHER 32768 #define LANGUAGE_UNIVERSAL 65535 + +#define LEFT 1 +#define RIGHT 2 diff --git a/maps/tgstation.2.1.0.dmm b/maps/tgstation.2.1.0.dmm index 9e2fba9dbc..c3b5e94a50 100755 --- a/maps/tgstation.2.1.0.dmm +++ b/maps/tgstation.2.1.0.dmm @@ -5002,7 +5002,7 @@ "bSj" = (/obj/machinery/atmospherics/portables_connector{dir = 8},/turf/simulated/floor{icon_state = "floorgrime"},/area/maintenance/incinerator) "bSk" = (/obj/machinery/disposal,/obj/structure/disposalpipe/trunk{dir = 1},/turf/simulated/floor/plating,/area/construction) "bSl" = (/obj/machinery/power/apc{dir = 2; name = "Construction Area APC"; pixel_y = -24},/obj/structure/cable,/turf/simulated/floor/plating,/area/construction) -"bSm" = (/obj/structure/rack{dir = 1},/obj/item/clothing/suit/hazardvest,/turf/simulated/floor/plating,/area/construction) +"bSm" = (/obj/structure/rack{dir = 1},/obj/item/clothing/suit/storage/hazardvest,/turf/simulated/floor/plating,/area/construction) "bSn" = (/obj/structure/table,/obj/item/weapon/cable_coil{amount = 5},/obj/item/device/flashlight,/turf/simulated/floor/plating,/area/construction) "bSo" = (/obj/structure/table,/turf/simulated/floor/plating,/area/construction) "bSp" = (/obj/machinery/atmospherics/pipe/simple/scrubbers/hidden,/obj/structure/disposalpipe/segment,/turf/simulated/floor{dir = 8; icon_state = "cautioncorner"},/area/hallway/primary/aft) @@ -5041,7 +5041,7 @@ "bSW" = (/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; tag = ""},/obj/machinery/atmospherics/pipe/manifold{tag = "icon-manifold-r (EAST)"; icon_state = "manifold-r"; dir = 4; level = 2; color = "red"},/turf/simulated/floor,/area/atmos) "bSX" = (/obj/structure/reagent_dispensers/watertank,/turf/simulated/floor,/area/atmos) "bSY" = (/obj/structure/reagent_dispensers/fueltank,/turf/simulated/floor,/area/atmos) -"bSZ" = (/obj/structure/rack{dir = 8; layer = 2.9},/obj/item/clothing/suit/hazardvest,/obj/item/clothing/suit/hazardvest,/obj/item/clothing/suit/hazardvest,/obj/item/clothing/suit/hazardvest,/obj/item/clothing/gloves/black,/obj/item/clothing/gloves/black,/obj/item/clothing/gloves/black,/obj/item/clothing/mask/gas,/obj/item/clothing/mask/gas,/turf/simulated/floor,/area/atmos) +"bSZ" = (/obj/structure/rack{dir = 8; layer = 2.9},/obj/item/clothing/suit/storage/hazardvest,/obj/item/clothing/suit/storage/hazardvest,/obj/item/clothing/suit/storage/hazardvest,/obj/item/clothing/suit/storage/hazardvest,/obj/item/clothing/gloves/black,/obj/item/clothing/gloves/black,/obj/item/clothing/gloves/black,/obj/item/clothing/mask/gas,/obj/item/clothing/mask/gas,/turf/simulated/floor,/area/atmos) "bTa" = (/obj/machinery/atmospherics/pipe/manifold{dir = 8; icon_state = "manifold"; level = 2},/turf/simulated/floor,/area/atmos) "bTb" = (/obj/machinery/atmospherics/pipe/manifold{icon_state = "manifold"; level = 2},/obj/machinery/meter,/turf/simulated/floor,/area/atmos) "bTc" = (/obj/machinery/atmospherics/pipe/manifold{dir = 4; icon_state = "manifold"; initialize_directions = 11; level = 2},/turf/simulated/floor,/area/atmos) @@ -5791,7 +5791,7 @@ "chs" = (/obj/structure/closet/radiation,/turf/simulated/floor,/area/engine/engineering) "cht" = (/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; tag = ""},/obj/machinery/door/poddoor{density = 0; icon_state = "pdoor0"; id = "Singularity"; layer = 2.8; name = "Singularity Shutters"; opacity = 0},/obj/machinery/door/firedoor/border_only,/turf/simulated/floor{icon_state = "bot"; dir = 1},/area/engine/engineering) "chu" = (/obj/structure/table,/obj/item/device/flashlight{pixel_y = 5},/obj/item/clothing/ears/earmuffs{pixel_x = -5; pixel_y = 6},/turf/simulated/floor,/area/engine/engineering) -"chv" = (/obj/structure/rack{dir = 8; layer = 2.9},/obj/item/clothing/suit/hazardvest,/obj/item/clothing/suit/hazardvest,/obj/item/weapon/tank/emergency_oxygen/engi,/obj/item/weapon/tank/emergency_oxygen/engi,/obj/item/device/radio/intercom{dir = 4; name = "Station Intercom (General)"; pixel_x = 31},/obj/machinery/camera{c_tag = "Engineering East"; dir = 8; network = "SS13"; pixel_x = 0; pixel_y = 0},/turf/simulated/floor{dir = 4; icon_state = "yellowcorner"},/area/engine/engineering) +"chv" = (/obj/structure/rack{dir = 8; layer = 2.9},/obj/item/clothing/suit/storage/hazardvest,/obj/item/clothing/suit/storage/hazardvest,/obj/item/weapon/tank/emergency_oxygen/engi,/obj/item/weapon/tank/emergency_oxygen/engi,/obj/item/device/radio/intercom{dir = 4; name = "Station Intercom (General)"; pixel_x = 31},/obj/machinery/camera{c_tag = "Engineering East"; dir = 8; network = "SS13"; pixel_x = 0; pixel_y = 0},/turf/simulated/floor{dir = 4; icon_state = "yellowcorner"},/area/engine/engineering) "chw" = (/obj/structure/disposaloutlet{dir = 4},/obj/structure/disposalpipe/trunk{dir = 1},/turf/simulated/floor/engine,/area/toxins/xenobiology) "chx" = (/obj/structure/lattice,/obj/structure/grille,/obj/structure/lattice,/turf/space,/area) "chy" = (/obj/structure/disposalpipe/segment{dir = 1; icon_state = "pipe-c"},/turf/simulated/floor,/area/engine/engineering)