Merge branch 'master' of https://github.com/PolarisSS13/Polaris into NanoGrade

Conflicts:
	code/modules/client/client procs.dm
	nano/templates/robot_control.tmpl
This commit is contained in:
SinTwo
2016-07-27 16:11:55 -04:00
601 changed files with 16156 additions and 7173 deletions

View File

@@ -1139,12 +1139,15 @@ obj/machinery/power/apc/proc/autoset(var/val, var/on)
// damage and destruction acts
/obj/machinery/power/apc/emp_act(severity)
if(is_critical)
severity += 2
if(cell)
cell.emp_act(severity)
lighting = 0
equipment = 0
environ = 0
if(!is_critical)
equipment = 0
environ = 0
update()
update_icon()

View File

@@ -110,6 +110,17 @@ var/list/possible_cable_coil_colours = list(
cable_list -= src //remove it from global cable list
..() // then go ahead and delete the cable
// Ghost examining the cable -> tells him the power
/obj/structure/cable/attack_ghost(mob/user)
if(user.client && user.client.inquisitive_ghost)
user.examinate(src)
// following code taken from attackby (multitool)
if(powernet && (powernet.avail > 0))
user << "<span class='warning'>[powernet.avail]W in power network.</span>"
else
user << "<span class='warning'>The cable is not powered.</span>"
return
///////////////////////////////////
// General procedures
///////////////////////////////////

View File

@@ -26,6 +26,8 @@
..()
if (fixture_type == "bulb")
icon_state = "bulb-construct-stage1"
if (fixture_type == "flamp")
icon_state = "flamp-construct-stage1"
/obj/machinery/light_construct/examine(mob/user)
if(!..(user, 2))
@@ -71,6 +73,8 @@
src.icon_state = "tube-construct-stage1"
if("bulb")
src.icon_state = "bulb-construct-stage1"
if("flamp")
src.icon_state = "flamp-construct-stage1"
new /obj/item/stack/cable_coil(get_turf(src.loc), 1, "red")
user.visible_message("[user.name] removes the wiring from [src].", \
"You remove the wiring from [src].", "You hear a noise.")
@@ -86,6 +90,8 @@
src.icon_state = "tube-construct-stage2"
if("bulb")
src.icon_state = "bulb-construct-stage2"
if("flamp")
src.icon_state = "flamp-construct-stage2"
src.stage = 2
user.visible_message("[user.name] adds wires to [src].", \
"You add wires to [src].")
@@ -98,6 +104,8 @@
src.icon_state = "tube-empty"
if("bulb")
src.icon_state = "bulb-empty"
if("flamp")
src.icon_state = "flamp-empty"
src.stage = 3
user.visible_message("[user.name] closes [src]'s casing.", \
"You close [src]'s casing.", "You hear a noise.")
@@ -109,6 +117,8 @@
newlight = new /obj/machinery/light/built(src.loc)
if ("bulb")
newlight = new /obj/machinery/light/small/built(src.loc)
if ("flamp")
newlight = new /obj/machinery/light/flamp/built(src.loc)
newlight.dir = src.dir
src.transfer_fingerprints_to(newlight)
@@ -127,6 +137,17 @@
fixture_type = "bulb"
sheets_refunded = 1
/obj/machinery/light_construct/flamp
name = "floor light fixture frame"
desc = "A floor light fixture under construction."
icon = 'icons/obj/lighting.dmi'
icon_state = "flamp-construct-stage1"
anchored = 0
layer = OBJ_LAYER
stage = 1
fixture_type = "flamp"
sheets_refunded = 2
// the standard tube light fixture
/obj/machinery/light
name = "light fixture"
@@ -141,7 +162,6 @@
active_power_usage = 20
power_channel = LIGHT //Lights are calc'd via area so they dont need to be in the machine list
var/on = 0 // 1 if on, 0 if off
var/on_gs = 0
var/brightness_range = 10 // luminosity when on, also used in power calculation
var/brightness_power = 3
var/brightness_color = null
@@ -166,6 +186,18 @@
desc = "A small lighting fixture."
light_type = /obj/item/weapon/light/bulb
/obj/machinery/light/flamp
icon_state = "flamp1"
base_state = "flamp"
fitting = "bulb"
brightness_range = 5
brightness_power = 2
layer = OBJ_LAYER
brightness_color = "#FFF4E5"
desc = "A floor lamp."
light_type = /obj/item/weapon/light/bulb
var/lamp_shade = 1
/obj/machinery/light/small/emergency
brightness_range = 6
brightness_power = 2
@@ -188,6 +220,12 @@
update(0)
..()
/obj/machinery/light/flamp/built/New()
status = LIGHT_EMPTY
lamp_shade = 0
update(0)
..()
// create a new lighting fixture
/obj/machinery/light/New()
..()
@@ -228,9 +266,29 @@
on = 0
return
/obj/machinery/light/flamp/update_icon()
if(lamp_shade)
base_state = "flampshade"
switch(status) // set icon_states
if(LIGHT_OK)
icon_state = "[base_state][on]"
if(LIGHT_EMPTY)
on = 0
icon_state = "[base_state][on]"
if(LIGHT_BURNED)
on = 0
icon_state = "[base_state][on]"
if(LIGHT_BROKEN)
on = 0
icon_state = "[base_state][on]"
return
else
base_state = "flamp"
..()
// update the icon_state and luminosity of the light depending on its state
/obj/machinery/light/proc/update(var/trigger = 1)
update_icon()
if(on)
if(light_range != brightness_range || light_power != brightness_power || light_color != brightness_color)
@@ -245,7 +303,7 @@
else if( prob( min(60, switchcount*switchcount*0.01) ) )
if(status == LIGHT_OK && trigger)
status = LIGHT_BURNED
icon_state = "[base_state]-burned"
update_icon()
on = 0
set_light(0)
else
@@ -256,8 +314,7 @@
set_light(0)
active_power_usage = light_range * light_power
if(on != on_gs)
on_gs = on
/obj/machinery/light/attack_generic(var/mob/user, var/damage)
if(!damage)
@@ -373,6 +430,11 @@
if("bulb")
newlight = new /obj/machinery/light_construct/small(src.loc)
newlight.icon_state = "bulb-construct-stage2"
if("flamp")
newlight = new /obj/machinery/light_construct/flamp(src.loc)
newlight.icon_state = "flamp-construct-stage2"
newlight.dir = src.dir
newlight.stage = 2
newlight.fingerprints = src.fingerprints
@@ -390,6 +452,30 @@
if (prob(75))
electrocute_mob(user, get_area(src), src, rand(0.7,1.0))
/obj/machinery/light/flamp/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/wrench))
anchored = !anchored
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user << "<span class='notice'>You [anchored ? "wrench" : "unwrench"] \the [src].</span>"
if(!lamp_shade)
if(istype(W, /obj/item/weapon/lampshade))
lamp_shade = 1
qdel(W)
update_icon()
return
else
if(istype(W, /obj/item/weapon/screwdriver))
playsound(src.loc, 'sound/items/Screwdriver.ogg', 75, 1)
user.visible_message("[user.name] removes [src]'s lamp shade.", \
"You remove [src]'s lamp shade.", "You hear a noise.")
lamp_shade = 0
new /obj/item/weapon/lampshade(src.loc)
update_icon()
return
..()
// returns whether this light has power
// true if area has power and lightswitch is on
@@ -397,6 +483,13 @@
var/area/A = get_area(src)
return A && A.lightswitch && (!A.requires_power || A.power_light)
/obj/machinery/light/flamp/has_power()
var/area/A = get_area(src)
if(lamp_shade)
return A && (!A.requires_power || A.power_light)
else
return A && A.lightswitch && (!A.requires_power || A.power_light)
/obj/machinery/light/proc/flicker(var/amount = rand(10, 20))
if(flickering) return
flickering = 1
@@ -417,6 +510,10 @@
src.flicker(1)
return
/obj/machinery/light/flamp/attack_ai(mob/user)
attack_hand()
return
// attack with hand - remove tube/bulb
// if hands aren't protected and the light is on, burn the player
/obj/machinery/light/attack_hand(mob/user)
@@ -481,6 +578,21 @@
status = LIGHT_EMPTY
update()
/obj/machinery/light/flamp/attack_hand(mob/user)
if(lamp_shade)
if(status == LIGHT_EMPTY)
user << "There is no [fitting] in this light."
return
if(on)
on = 0
update()
else
on = has_power()
update()
else
..()
/obj/machinery/light/attack_tk(mob/user)
if(status == LIGHT_EMPTY)
@@ -708,3 +820,11 @@
sharp = 1
playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1)
update()
//Lamp Shade
/obj/item/weapon/lampshade
name = "lamp shade"
desc = "A lamp shade for a lamp."
icon = 'icons/obj/lighting.dmi'
icon_state = "lampshade"
w_class = 1

View File

@@ -24,6 +24,8 @@
var/state = 0
var/locked = 0
var/integrity = 80
/obj/machinery/power/emitter/verb/rotate()
set name = "Rotate"
@@ -221,3 +223,12 @@
emagged = 1
user.visible_message("[user.name] emags [src].","<span class='warning'>You short out the lock.</span>")
return 1
/obj/machinery/power/emitter/bullet_act(var/obj/item/projectile/P)
if(!P || !P.damage || (!P.damage_type == BRUTE || !P.damage_type == BURN) )
return
integrity = integrity - P.damage
if(integrity >= 0)
explosion(get_turf(src), 1, 2, 4)
qdel(src)

View File

@@ -1,6 +1,6 @@
#define SOLAR_MAX_DIST 40
#define SOLARGENRATE 1500
var/solar_gen_rate = 1500
var/list/solars_list = list()
/obj/machinery/power/solar
@@ -130,7 +130,7 @@ var/list/solars_list = list()
if(powernet == control.powernet)//check if the panel is still connected to the computer
if(obscured) //get no light from the sun, so don't generate power
return
var/sgen = SOLARGENRATE * sunfrac
var/sgen = solar_gen_rate * sunfrac
add_avail(sgen)
control.gen += sgen
else //if we're no longer on the same powernet, remove from control computer
@@ -206,7 +206,7 @@ var/list/solars_list = list()
desc = "A solar panel assembly kit, allows constructions of a solar panel, or with a tracking circuit board, a solar tracker"
icon = 'icons/obj/power.dmi'
icon_state = "sp_base"
item_state = "electropack"
item_state = "camera"
w_class = 4 // Pretty big!
anchored = 0
var/tracker = 0