Revert "12/21 modernizations from TG live"

This commit is contained in:
LetterJay
2016-12-22 22:35:44 -06:00
committed by GitHub
parent cf59ac1c3d
commit ae40d4134e
2215 changed files with 86928 additions and 707332 deletions
+46 -47
View File
@@ -12,12 +12,7 @@
active_power_usage = 10
layer = WALL_OBJ_LAYER
resistance_flags = FIRE_PROOF
armor = list(melee = 50, bullet = 20, laser = 20, energy = 20, bomb = 0, bio = 0, rad = 0, fire = 90, acid = 50)
obj_integrity = 100
max_integrity = 100
integrity_failure = 50
var/health = 50
var/list/network = list("SS13")
var/c_tag = null
var/c_tag_order = 999
@@ -26,7 +21,7 @@
var/start_active = 0 //If it ignores the random chance to start broken on round start
var/invuln = null
var/obj/item/device/camera_bug/bug = null
var/obj/structure/camera_assembly/assembly = null
var/obj/machinery/camera_assembly/assembly = null
//OTHER
@@ -88,7 +83,7 @@
network = list()
cameranet.removeCamera(src)
stat |= EMPED
SetLuminosity(0)
set_light(0)
emped = emped+1 //Increase the number of consecutive EMP's
update_icon()
var/thisemp = emped //Take note of which EMP this proc is for
@@ -110,16 +105,17 @@
O << "The screen bursts into static."
..()
/obj/machinery/camera/tesla_act(var/power)//EMP proof upgrade also makes it tesla immune
if(isEmpProof())
return
..()
qdel(src)//to prevent bomb testing camera from exploding over and over forever
/obj/machinery/camera/ex_act(severity, target)
if(invuln)
if(src.invuln)
return
..()
switch(severity)
if(1)
qdel(src)
if(2)
take_damage(50, BRUTE, 0)
else
take_damage(rand(30,60), BRUTE, 0)
/obj/machinery/camera/proc/setViewRange(num = 7)
src.view_range = num
@@ -144,7 +140,7 @@
if(panel_open)
if(istype(W, /obj/item/weapon/wirecutters)) //enable/disable the camera
toggle_cam(user, 1)
obj_integrity = max_integrity //this is a pretty simplistic way to heal the camera, but there's no reason for this to be complex.
health = initial(health) //this is a pretty simplistic way to heal the camera, but there's no reason for this to be complex.
return
else if(istype(W, /obj/item/device/multitool)) //change focus
@@ -155,13 +151,17 @@
else if(istype(W, /obj/item/weapon/weldingtool))
if(weld(W, user))
visible_message("<span class='warning'>[user] unwelds [src], leaving it as just a frame screwed to the wall.</span>", "<span class='warning'>You unweld [src], leaving it as just a frame screwed to the wall</span>")
deconstruct(TRUE)
if(!assembly)
assembly = new()
assembly.loc = src.loc
assembly.state = 1
assembly.setDir(src.dir)
assembly = null
qdel(src)
return
else if(istype(W, /obj/item/device/analyzer))
if(!isXRay())
if(!user.drop_item(W))
return
upgradeXRay()
qdel(W)
user << "[msg]"
@@ -206,7 +206,7 @@
U << "<span class='notice'>You hold \the [itemname] up to the camera...</span>"
U.changeNext_move(CLICK_CD_MELEE)
for(var/mob/O in player_list)
if(isAI(O))
if(istype(O, /mob/living/silicon/ai))
var/mob/living/silicon/ai/AI = O
if(AI.control_disabled || (AI.stat == DEAD))
return
@@ -241,31 +241,26 @@
return ..()
/obj/machinery/camera/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir)
if(damage_flag == "melee" && damage_amount < 12 && !(stat & BROKEN))
return 0
. = ..()
/obj/machinery/camera/obj_break(damage_flag)
if(status && !(flags & NODECONSTRUCT))
/obj/machinery/camera/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
switch(damage_type)
if(BRUTE)
if(sound_effect)
if(damage)
playsound(src, 'sound/weapons/smash.ogg', 50, 1)
else
playsound(src, 'sound/weapons/tap.ogg', 50, 1)
if(BURN)
if(sound_effect)
playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
else
return
if(damage < 10) //camera has a damage resistance threshold
return
health = max(0, health - damage)
if(!health && status)
triggerCameraAlarm()
toggle_cam(null, 0)
/obj/machinery/camera/deconstruct(disassembled = TRUE)
if(!(flags & NODECONSTRUCT))
if(disassembled)
if(!assembly)
assembly = new()
assembly.loc = src.loc
assembly.state = 1
assembly.setDir(dir)
assembly = null
else
var/obj/item/I = new /obj/item/wallframe/camera (loc)
I.obj_integrity = I.max_integrity * 0.5
new /obj/item/stack/cable_coil(loc, 2)
qdel(src)
/obj/machinery/camera/update_icon()
if(!status)
icon_state = "[initial(icon_state)]1"
@@ -279,7 +274,7 @@
if(can_use())
cameranet.addCamera(src)
else
SetLuminosity(0)
set_light(0)
cameranet.removeCamera(src)
cameranet.updateChunk(x, y, z)
var/change_msg = "deactivates"
@@ -374,9 +369,9 @@
return 0
user << "<span class='notice'>You start to weld [src]...</span>"
playsound(src.loc, WT.usesound, 50, 1)
playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
busy = 1
if(do_after(user, 100*WT.toolspeed, target = src))
if(do_after(user, 100, target = src))
busy = 0
if(!WT.isOn())
return 0
@@ -390,9 +385,13 @@
if(cam == src)
return
if(on)
src.SetLuminosity(AI_CAMERA_LUMINOSITY)
src.set_light(AI_CAMERA_LUMINOSITY)
else
src.SetLuminosity(0)
src.set_light(0)
/obj/machinery/camera/bullet_act(obj/item/projectile/P)
. = ..()
take_damage(P.damage, P.damage_type, 0)
/obj/machinery/camera/portable //Cameras which are placed inside of things, such as helmets.
var/turf/prev_turf
+23 -24
View File
@@ -4,21 +4,19 @@
icon = 'icons/obj/monitors.dmi'
icon_state = "cameracase"
materials = list(MAT_METAL=400, MAT_GLASS=250)
result_path = /obj/structure/camera_assembly
result_path = /obj/machinery/camera_assembly
/obj/structure/camera_assembly
/obj/machinery/camera_assembly
name = "camera assembly"
desc = "The basic construction for Nanotrasen-Always-Watching-You cameras."
icon = 'icons/obj/monitors.dmi'
icon_state = "camera1"
obj_integrity = 150
max_integrity = 150
// Motion, EMP-Proof, X-Ray
var/list/obj/item/possible_upgrades = list(/obj/item/device/assembly/prox_sensor, /obj/item/stack/sheet/mineral/plasma, /obj/item/device/analyzer)
var/list/upgrades = list()
var/state = 1
var/busy = 0
/*
1 = Wrenched in place
2 = Welded in place
@@ -26,12 +24,12 @@
4 = Screwdriver panel closed and is fully built (you cannot attach upgrades)
*/
/obj/structure/camera_assembly/New(loc, ndir, building)
/obj/machinery/camera_assembly/New(loc, ndir, building)
..()
if(building)
setDir(ndir)
/obj/structure/camera_assembly/attackby(obj/item/W, mob/living/user, params)
/obj/machinery/camera_assembly/attackby(obj/item/W, mob/living/user, params)
switch(state)
if(1)
// State 1
@@ -75,14 +73,14 @@
if(istype(W, /obj/item/weapon/screwdriver))
playsound(src.loc, W.usesound, 50, 1)
var/input = stripped_input(user, "Which networks would you like to connect this camera to? Seperate networks with a comma. No Spaces!\nFor example: SS13,Security,Secret ", "Set Network", "SS13")
var/input = stripped_input(usr, "Which networks would you like to connect this camera to? Seperate networks with a comma. No Spaces!\nFor example: SS13,Security,Secret ", "Set Network", "SS13")
if(!input)
user << "<span class='warning'>No input found, please hang up and try your call again!</span>"
usr << "<span class='warning'>No input found, please hang up and try your call again!</span>"
return
var/list/tempnetwork = splittext(input, ",")
if(tempnetwork.len < 1)
user << "<span class='warning'>No network found, please hang up and try your call again!</span>"
usr << "<span class='warning'>No network found, please hang up and try your call again!</span>"
return
state = 4
@@ -105,11 +103,11 @@
// Upgrades!
if(is_type_in_list(W, possible_upgrades) && !is_type_in_list(W, upgrades)) // Is a possible upgrade and isn't in the camera already.
if(!user.drop_item(W))
if(!user.unEquip(W))
return
user << "<span class='notice'>You attach \the [W] into the assembly inner circuits.</span>"
upgrades += W
W.forceMove(src)
W.loc = src
return
// Taking out upgrades
@@ -124,18 +122,19 @@
return ..()
/obj/structure/camera_assembly/proc/weld(obj/item/weapon/weldingtool/WT, mob/living/user)
/obj/machinery/camera_assembly/proc/weld(obj/item/weapon/weldingtool/WT, mob/living/user)
if(busy)
return 0
if(!WT.remove_fuel(0, user))
return 0
user << "<span class='notice'>You start to weld \the [src]...</span>"
playsound(src.loc, WT.usesound, 50, 1)
if(do_after(user, 20*WT.toolspeed, target = src))
if(WT.isOn())
playsound(loc, 'sound/items/Welder2.ogg', 50, 1)
return 1
return 0
/obj/structure/camera_assembly/deconstruct(disassembled = TRUE)
if(!(flags & NODECONSTRUCT))
new /obj/item/stack/sheet/metal(loc)
qdel(src)
user << "<span class='notice'>You start to weld \the [src]...</span>"
playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
busy = 1
if(do_after(user, 20, target = src))
busy = 0
if(!WT.isOn())
return 0
return 1
busy = 0
return 0
+15 -19
View File
@@ -1,6 +1,6 @@
/obj/machinery/camera
var/list/localMotionTargets = list()
var/list/motionTargets = list()
var/detectTime = 0
var/area/ai_monitored/area_motion = null
var/alarm_delay = 30 // Don't forget, there's another 3 seconds in queueAlarm()
@@ -15,31 +15,27 @@
if (elapsed > alarm_delay)
triggerAlarm()
else if (detectTime == -1)
for (var/mob/target in getTargetList())
if (target.stat == DEAD || (!area_motion && !in_range(src, target)))
//If not part of a monitored area and the camera is not in range or the target is dead
lostTarget(target)
/obj/machinery/camera/proc/getTargetList()
if(area_motion)
return area_motion.motionTargets
return localMotionTargets
for (var/mob/target in motionTargets)
if (target.stat == 2) lostTarget(target)
// If not detecting with motion camera...
if (!area_motion)
// See if the camera is still in range
if(!in_range(src, target))
// If they aren't in range, lose the target.
lostTarget(target)
/obj/machinery/camera/proc/newTarget(mob/target)
if(isAI(target))
return 0
if (istype(target, /mob/living/silicon/ai)) return 0
if (detectTime == 0)
detectTime = world.time // start the clock
var/list/targets = getTargetList()
if (!(target in targets))
targets += target
if (!(target in motionTargets))
motionTargets += target
return 1
/obj/machinery/camera/proc/lostTarget(mob/target)
var/list/targets = getTargetList()
if (target in targets)
targets -= target
if (targets.len == 0)
if (target in motionTargets)
motionTargets -= target
if (motionTargets.len == 0)
cancelAlarm()
/obj/machinery/camera/proc/cancelAlarm()
+2 -2
View File
@@ -54,7 +54,7 @@
// Human check
var/human = 0
if(ishuman(M))
if(istype(M, /mob/living/carbon/human))
human = 1
var/name = M.name
@@ -136,7 +136,7 @@
/proc/near_camera(mob/living/M)
if (!isturf(M.loc))
return 0
if(iscyborg(M))
if(isrobot(M))
var/mob/living/silicon/robot/R = M
if(!(R.camera && R.camera.can_use()) && !cameranet.checkCameraVis(M))
return 0