mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-27 14:07:51 +01:00
fixups
This commit is contained in:
@@ -950,9 +950,6 @@ var/gamma_ship_location = 1 // 0 = station , 1 = space
|
||||
for(var/obj/machinery/mech_bay_recharge_port/P in toArea)
|
||||
P.update_recharge_turf()
|
||||
|
||||
for(var/obj/machinery/power/apc/A in toArea)
|
||||
A.init()
|
||||
|
||||
if(gamma_ship_location)
|
||||
gamma_ship_location = 0
|
||||
else
|
||||
@@ -1096,7 +1093,7 @@ var/gamma_ship_location = 1 // 0 = station , 1 = space
|
||||
dat += "<tr><td><b>" + id + "</b></td>"
|
||||
dat += "<td>" + ckey + "</td>"
|
||||
dat += "<td><a href='?src=[UID()];force_discord_unlink=[ckey]'>Unlink</td></tr>"
|
||||
|
||||
|
||||
dat += "</table></body></html>"
|
||||
|
||||
usr << browse(dat, "window=duplicates;size=500x480")
|
||||
+21
-20
@@ -46,7 +46,6 @@
|
||||
name = "area power controller"
|
||||
desc = "A control terminal for the area electrical systems."
|
||||
icon_state = "apc0"
|
||||
anchored = 1
|
||||
use_power = NO_POWER_USE
|
||||
req_access = list(access_engine_equip)
|
||||
siemens_strength = 1
|
||||
@@ -55,7 +54,7 @@
|
||||
var/areastring = null
|
||||
var/obj/item/stock_parts/cell/cell
|
||||
var/start_charge = 90 // initial cell charge %
|
||||
var/cell_type = 2500
|
||||
var/cell_type = 2500 //Base cell has 2500 capacity. Enter the path of a different cell you want to use. cell determines charge rates, max capacity, ect. These can also be changed with other APC vars, but isn't recommended to minimize the risk of accidental usage of dirty editted APCs
|
||||
var/opened = 0 //0=closed, 1=opened, 2=cover removed
|
||||
var/shorted = 0
|
||||
var/lighting = 3
|
||||
@@ -137,40 +136,35 @@
|
||||
/obj/machinery/power/apc/connect_to_network()
|
||||
//Override because the APC does not directly connect to the network; it goes through a terminal.
|
||||
//The terminal is what the power computer looks for anyway.
|
||||
if(!terminal)
|
||||
make_terminal()
|
||||
if(terminal)
|
||||
terminal.connect_to_network()
|
||||
|
||||
/obj/machinery/power/apc/New(turf/loc, var/ndir, var/building=0)
|
||||
/obj/machinery/power/apc/New(turf/loc, ndir, building = 0)
|
||||
if(!armor)
|
||||
armor = list(melee = 20, bullet = 20, laser = 10, energy = 100, bomb = 30, bio = 100, rad = 100)
|
||||
..()
|
||||
GLOB.apcs += src
|
||||
GLOB.apcs = sortAtom(GLOB.apcs)
|
||||
wires = new(src)
|
||||
|
||||
wires = new(src)
|
||||
// offset 24 pixels in direction of dir
|
||||
// this allows the APC to be embedded in a wall, yet still inside an area
|
||||
if(building)
|
||||
dir = ndir
|
||||
src.tdir = dir // to fix Vars bug
|
||||
dir = SOUTH
|
||||
setDir(ndir)
|
||||
tdir = dir // to fix Vars bug
|
||||
setDir(SOUTH)
|
||||
|
||||
pixel_x = (src.tdir & 3)? 0 : (src.tdir == 4 ? 24 : -24)
|
||||
pixel_y = (src.tdir & 3)? (src.tdir ==1 ? 24 : -24) : 0
|
||||
if(building==0)
|
||||
init()
|
||||
else
|
||||
if(building)
|
||||
area = get_area(src)
|
||||
area.apc |= src
|
||||
opened = 1
|
||||
operating = 0
|
||||
name = "[area.name] APC"
|
||||
stat |= MAINT
|
||||
src.update_icon()
|
||||
spawn(5)
|
||||
src.update()
|
||||
update_icon()
|
||||
addtimer(CALLBACK(src, .proc/update), 5)
|
||||
|
||||
/obj/machinery/power/apc/Destroy()
|
||||
GLOB.apcs -= src
|
||||
@@ -193,14 +187,17 @@
|
||||
// create a terminal object at the same position as original turf loc
|
||||
// wires will attach to this
|
||||
terminal = new/obj/machinery/power/terminal(src.loc)
|
||||
terminal.dir = tdir
|
||||
terminal.setDir(tdir)
|
||||
terminal.master = src
|
||||
|
||||
/obj/machinery/power/apc/proc/init()
|
||||
/obj/machinery/power/apc/Initialize(mapload)
|
||||
. = ..()
|
||||
if(!mapload)
|
||||
return
|
||||
has_electronics = 2 //installed and secured
|
||||
// is starting with a power cell installed, create it and set its charge level
|
||||
if(cell_type)
|
||||
src.cell = new/obj/item/stock_parts/cell(src)
|
||||
cell = new/obj/item/stock_parts/cell(src)
|
||||
cell.maxcharge = cell_type // cell_type is maximum charge (old default was 1000 or 2500 (values one and two respectively)
|
||||
cell.charge = start_charge * cell.maxcharge / 100 // (convert percentage to actual value)
|
||||
|
||||
@@ -219,12 +216,12 @@
|
||||
area = get_area_name(areastring)
|
||||
name = "\improper [area.name] APC"
|
||||
area.apc |= src
|
||||
|
||||
update_icon()
|
||||
|
||||
make_terminal()
|
||||
|
||||
spawn(5)
|
||||
src.update()
|
||||
addtimer(CALLBACK(src, .proc/update), 5)
|
||||
|
||||
/obj/machinery/power/apc/examine(mob/user)
|
||||
if(..(user, 1))
|
||||
@@ -1287,9 +1284,13 @@
|
||||
lighting = 0
|
||||
equipment = 0
|
||||
environ = 0
|
||||
update_icon()
|
||||
update()
|
||||
spawn(600)
|
||||
equipment = 3
|
||||
environ = 3
|
||||
update_icon()
|
||||
update()
|
||||
..()
|
||||
|
||||
/obj/machinery/power/apc/ex_act(severity)
|
||||
|
||||
+67
-60
@@ -65,14 +65,12 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
// ensure d1 & d2 reflect the icon_state for entering and exiting cable
|
||||
|
||||
var/dash = findtext(icon_state, "-")
|
||||
d1 = text2num(copytext( icon_state, 1, dash ))
|
||||
d2 = text2num(copytext( icon_state, dash+1 ))
|
||||
|
||||
d1 = text2num( copytext( icon_state, 1, dash ) )
|
||||
|
||||
d2 = text2num( copytext( icon_state, dash+1 ) )
|
||||
|
||||
var/turf/T = src.loc // hide if turf is not intact
|
||||
|
||||
if(level==1) hide(T.intact)
|
||||
var/turf/T = get_turf(src) // hide if turf is not intact
|
||||
if(level == 1)
|
||||
hide(T.intact)
|
||||
LAZYADD(GLOB.cable_list, src) //add it to the global cable list
|
||||
|
||||
|
||||
@@ -82,14 +80,23 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
LAZYREMOVE(GLOB.cable_list, src) //remove it from global cable list
|
||||
return ..() // then go ahead and delete the cable
|
||||
|
||||
|
||||
/obj/structure/cable/deconstruct(disassembled = TRUE)
|
||||
var/turf/T = get_turf(src)
|
||||
if(d1) // 0-X cables are 1 unit, X-X cables are 2 units long
|
||||
new/obj/item/stack/cable_coil(T, 2, paramcolor = color)
|
||||
else
|
||||
new/obj/item/stack/cable_coil(T, 1, paramcolor = color)
|
||||
qdel(src)
|
||||
|
||||
///////////////////////////////////
|
||||
// General procedures
|
||||
///////////////////////////////////
|
||||
|
||||
//If underfloor, hide the cable
|
||||
/obj/structure/cable/hide(var/i)
|
||||
/obj/structure/cable/hide(i)
|
||||
|
||||
if(level == 1 && istype(loc, /turf))
|
||||
if(level == 1 && isturf(loc))
|
||||
invisibility = i ? 101 : 0
|
||||
updateicon()
|
||||
|
||||
@@ -159,47 +166,19 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
if(T.intact)
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/wirecutters))
|
||||
///// Z-Level Stuff
|
||||
/* if(src.d1 == 12 || src.d2 == 12)
|
||||
to_chat(user, "<span class='warning'>You must cut this cable from above.</span>")
|
||||
return */
|
||||
///// Z-Level Stuff
|
||||
/* if(breaker_box)
|
||||
to_chat(user, "<span class='warning'>This cable is connected to nearby breaker box. Use breaker box to interact with it.</span>")
|
||||
return */
|
||||
|
||||
if(iswirecutter(W))
|
||||
if(shock(user, 50))
|
||||
return
|
||||
|
||||
if(src.d1) // 0-X cables are 1 unit, X-X cables are 2 units long
|
||||
new/obj/item/stack/cable_coil(T, 2, paramcolor = color)
|
||||
else
|
||||
new/obj/item/stack/cable_coil(T, 1, paramcolor = color)
|
||||
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message("<span class='warning'>[user] cuts the cable.</span>", 1)
|
||||
|
||||
///// Z-Level Stuff
|
||||
/*if(src.d1 == 11 || src.d2 == 11)
|
||||
var/turf/controllerlocation = locate(1, 1, z)
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
if(controller.down)
|
||||
var/turf/below = locate(src.x, src.y, controller.down_target)
|
||||
for(var/obj/structure/cable/c in below)
|
||||
if(c.d1 == 12 || c.d2 == 12)
|
||||
c.qdel()*/
|
||||
///// Z-Level Stuff
|
||||
user.visible_message("[user] cuts the cable.", "<span class='notice'>You cut the cable.</span>")
|
||||
investigate_log("was cut by [key_name(usr, 1)] in [get_area(user)]([T.x], [T.y], [T.z] - [ADMIN_JMP(T)])","wires")
|
||||
|
||||
qdel(src) // qdel
|
||||
deconstruct()
|
||||
return
|
||||
|
||||
|
||||
else if(istype(W, /obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/coil = W
|
||||
if(coil.get_amount() < 1)
|
||||
to_chat(user, "Not enough cable")
|
||||
to_chat(user, "<span class='warning'>Not enough cable!</span>")
|
||||
return
|
||||
coil.cable_join(src, user)
|
||||
|
||||
@@ -212,11 +191,9 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
else if(istype(W, /obj/item/multitool))
|
||||
|
||||
if(powernet && (powernet.avail > 0)) // is it powered?
|
||||
to_chat(user, "<span class='warning'>[powernet.avail]W in power network.</span>")
|
||||
|
||||
to_chat(user, "<span class='danger'>Total power: [DisplayPower(powernet.avail)]\nLoad: [DisplayPower(powernet.load)]\nExcess power: [DisplayPower(surplus())]</span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>The cable is not powered.</span>")
|
||||
|
||||
to_chat(user, "<span class='danger'>The cable is not powered.</span>")
|
||||
shock(user, 5, 0.2)
|
||||
|
||||
else if(istype(W, /obj/item/toy/crayon))
|
||||
@@ -227,7 +204,7 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
if(W.flags & CONDUCT)
|
||||
shock(user, 50, 0.7)
|
||||
|
||||
src.add_fingerprint(user)
|
||||
add_fingerprint(user)
|
||||
|
||||
// shock the user with probability prb
|
||||
/obj/structure/cable/proc/shock(mob/user, prb, siemens_coeff = 1)
|
||||
@@ -239,6 +216,11 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
else
|
||||
return FALSE
|
||||
|
||||
/obj/structure/cable/singularity_pull(S, current_size)
|
||||
..()
|
||||
if(current_size >= STAGE_FIVE)
|
||||
deconstruct()
|
||||
|
||||
//explosion handling
|
||||
/obj/structure/cable/ex_act(severity)
|
||||
switch(severity)
|
||||
@@ -494,9 +476,7 @@ obj/structure/cable/proc/cable_color(var/colorC)
|
||||
// Definitions
|
||||
////////////////////////////////
|
||||
|
||||
var/global/list/datum/stack_recipe/cable_coil_recipes = list(
|
||||
new /datum/stack_recipe/cable_restraints("cable restraints", /obj/item/restraints/handcuffs/cable, 15),
|
||||
)
|
||||
GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe("cable restraints", /obj/item/restraints/handcuffs/cable, 15)))
|
||||
|
||||
/obj/item/stack/cable_coil
|
||||
name = "cable coil"
|
||||
@@ -536,7 +516,7 @@ var/global/list/datum/stack_recipe/cable_coil_recipes = list(
|
||||
pixel_x = rand(-2,2)
|
||||
pixel_y = rand(-2,2)
|
||||
update_icon()
|
||||
recipes = cable_coil_recipes
|
||||
recipes = GLOB.cable_coil_recipes
|
||||
update_wclass()
|
||||
|
||||
///////////////////////////////////
|
||||
@@ -679,7 +659,7 @@ var/global/list/datum/stack_recipe/cable_coil_recipes = list(
|
||||
to_chat(user, "<span class='warning'>You can't lay cable at a place that far away!</span>")
|
||||
return
|
||||
|
||||
var/dirn = null
|
||||
var/dirn
|
||||
if(!dirnew) //If we weren't given a direction, come up with one! (Called as null from catwalk.dm and floor.dm)
|
||||
if(user.loc == T)
|
||||
dirn = user.dir //If laying on the tile we're on, lay in the direction we're facing
|
||||
@@ -716,7 +696,7 @@ var/global/list/datum/stack_recipe/cable_coil_recipes = list(
|
||||
if(C.shock(user, 50))
|
||||
if(prob(50)) //fail
|
||||
new /obj/item/stack/cable_coil(get_turf(C), 1, paramcolor = C.color)
|
||||
qdel(C) // qdel
|
||||
C.deconstruct()
|
||||
|
||||
return C
|
||||
|
||||
@@ -733,7 +713,7 @@ var/global/list/datum/stack_recipe/cable_coil_recipes = list(
|
||||
return
|
||||
|
||||
if(get_dist(C, user) > 1) // make sure it's close enough
|
||||
to_chat(user, "You can't lay cable at a place that far away.")
|
||||
to_chat(user, "<span class='warning'>You can't lay cable at a place that far away!</span>")
|
||||
return
|
||||
|
||||
|
||||
@@ -746,13 +726,41 @@ var/global/list/datum/stack_recipe/cable_coil_recipes = list(
|
||||
// one end of the clicked cable is pointing towards us
|
||||
if(C.d1 == dirn || C.d2 == dirn)
|
||||
if(U.intact) // can't place a cable if the floor is complete
|
||||
to_chat(user, "You can't lay cable there unless the floor tiles are removed.")
|
||||
to_chat(user, "<span class='warning'>You can't lay cable there unless the floor tiles are removed!</span>")
|
||||
return
|
||||
else
|
||||
// cable is pointing at us, we're standing on an open tile
|
||||
// so create a stub pointing at the clicked cable on our tile
|
||||
|
||||
place_turf(U, user, turn(dirn, 180))
|
||||
var/fdirn = turn(dirn, 180) // the opposite direction
|
||||
|
||||
for(var/obj/structure/cable/LC in U) // check to make sure there's not a cable there already
|
||||
if(LC.d1 == fdirn || LC.d2 == fdirn)
|
||||
to_chat(user, "<span class='warning'>There's already a cable at that position!</span>")
|
||||
return
|
||||
|
||||
var/obj/structure/cable/NC = get_new_cable (U)
|
||||
|
||||
NC.d1 = 0
|
||||
NC.d2 = fdirn
|
||||
NC.add_fingerprint(user)
|
||||
NC.update_icon()
|
||||
|
||||
//create a new powernet with the cable, if needed it will be merged later
|
||||
var/datum/powernet/newPN = new()
|
||||
newPN.add_cable(NC)
|
||||
|
||||
NC.mergeConnectedNetworks(NC.d2) //merge the powernet with adjacents powernets
|
||||
NC.mergeConnectedNetworksOnTurf() //merge the powernet with on turf powernets
|
||||
|
||||
if(NC.d2 & (NC.d2 - 1))// if the cable is layed diagonally, check the others 2 possible directions
|
||||
NC.mergeDiagonalsNetworks(NC.d2)
|
||||
|
||||
use(1)
|
||||
|
||||
if(NC.shock(user, 50))
|
||||
if(prob(50)) //fail
|
||||
NC.deconstruct()
|
||||
return
|
||||
|
||||
// exisiting cable doesn't point at our position, so see if it's a stub
|
||||
@@ -771,7 +779,7 @@ var/global/list/datum/stack_recipe/cable_coil_recipes = list(
|
||||
if(LC == C) // skip the cable we're interacting with
|
||||
continue
|
||||
if((LC.d1 == nd1 && LC.d2 == nd2) || (LC.d1 == nd2 && LC.d2 == nd1) ) // make sure no cable matches either direction
|
||||
to_chat(user, "There's already a cable at that position.")
|
||||
to_chat(user, "<span class='warning'>There's already a cable at that position!</span>")
|
||||
return
|
||||
|
||||
|
||||
@@ -798,8 +806,7 @@ var/global/list/datum/stack_recipe/cable_coil_recipes = list(
|
||||
|
||||
if(C.shock(user, 50))
|
||||
if(prob(50)) //fail
|
||||
new/obj/item/stack/cable_coil(get_turf(C), 2, paramcolor = C.color)
|
||||
qdel(C) // qdel
|
||||
C.deconstruct()
|
||||
return
|
||||
|
||||
C.denode()// this call may have disconnected some cables that terminated on the centre of the turf, if so split the powernets.
|
||||
@@ -812,8 +819,8 @@ var/global/list/datum/stack_recipe/cable_coil_recipes = list(
|
||||
/obj/item/stack/cable_coil/cut
|
||||
item_state = "coil2"
|
||||
|
||||
/obj/item/stack/cable_coil/cut/New(loc)
|
||||
..()
|
||||
/obj/item/stack/cable_coil/cut/Initialize(mapload)
|
||||
. = ..()
|
||||
src.amount = rand(1,2)
|
||||
pixel_x = rand(-2,2)
|
||||
pixel_y = rand(-2,2)
|
||||
|
||||
@@ -85,8 +85,8 @@ var/const/GRAV_NEEDS_WRENCH = 3
|
||||
// Generator which spawns with the station.
|
||||
//
|
||||
|
||||
/obj/machinery/gravity_generator/main/station/Initialize()
|
||||
..()
|
||||
/obj/machinery/gravity_generator/main/station/Initialize(mapload)
|
||||
. = ..()
|
||||
setup_parts()
|
||||
middle.overlays += "activated"
|
||||
update_list()
|
||||
|
||||
+13
-15
@@ -9,7 +9,7 @@
|
||||
/obj/machinery/power
|
||||
name = null
|
||||
icon = 'icons/obj/power.dmi'
|
||||
anchored = 1.0
|
||||
anchored = TRUE
|
||||
on_blueprints = TRUE
|
||||
var/datum/powernet/powernet = null
|
||||
use_power = NO_POWER_USE
|
||||
@@ -25,6 +25,10 @@
|
||||
//////////////////////////////
|
||||
|
||||
// common helper procs for all power machines
|
||||
// All power generation handled in add_avail()
|
||||
// Machines should use add_load(), surplus(), avail()
|
||||
// Non-machines should use add_delayedload(), delayed_surplus(), newavail()
|
||||
|
||||
/obj/machinery/power/proc/add_avail(amount)
|
||||
if(powernet)
|
||||
powernet.newavail += amount
|
||||
@@ -83,7 +87,7 @@
|
||||
return A.powered(chan) // return power status of the area
|
||||
|
||||
// increment the power usage stats for an area
|
||||
/obj/machinery/proc/use_power(var/amount, var/chan = -1) // defaults to power_channel
|
||||
/obj/machinery/proc/use_power(amount, chan = -1) // defaults to power_channel
|
||||
var/area/A = get_area(src) // make sure it's in an area
|
||||
if(!A)
|
||||
return
|
||||
@@ -132,25 +136,18 @@
|
||||
|
||||
// attach a wire to a power machine - leads from the turf you are standing on
|
||||
//almost never called, overwritten by all power machines but terminal and generator
|
||||
/obj/machinery/power/attackby(obj/item/W, mob/user)
|
||||
|
||||
if(istype(W, /obj/item/stack/cable_coil))
|
||||
|
||||
var/obj/item/stack/cable_coil/coil = W
|
||||
|
||||
/obj/machinery/power/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/coil = I
|
||||
var/turf/T = user.loc
|
||||
|
||||
if(T.intact || !istype(T, /turf/simulated/floor))
|
||||
if(T.intact || !isfloorturf(T))
|
||||
return
|
||||
|
||||
if(get_dist(src, user) > 1)
|
||||
return
|
||||
|
||||
coil.place_turf(T, user)
|
||||
return
|
||||
else
|
||||
..()
|
||||
return
|
||||
return ..()
|
||||
|
||||
|
||||
///////////////////////////////////////////
|
||||
// Powernet handling helpers
|
||||
@@ -208,6 +205,7 @@
|
||||
// GLOBAL PROCS for powernets handling
|
||||
//////////////////////////////////////////
|
||||
|
||||
|
||||
// returns a list of all power-related objects (nodes, cable, junctions) in turf,
|
||||
// excluding source, that match the direction d
|
||||
// if unmarked==1, only return those with no powernet
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
nodes -=M
|
||||
M.powernet = null
|
||||
if(is_empty())//the powernet is now empty...
|
||||
qdel(src)///... delete it - qdel
|
||||
qdel(src)///... delete it
|
||||
|
||||
|
||||
//add a power machine to the current powernet
|
||||
|
||||
@@ -15,8 +15,8 @@ var/global/list/rad_collectors = list()
|
||||
var/locked = 0
|
||||
var/drainratio = 1
|
||||
|
||||
/obj/machinery/power/rad_collector/New()
|
||||
..()
|
||||
/obj/machinery/power/rad_collector/Initialize(mapload)
|
||||
. = ..()
|
||||
rad_collectors += src
|
||||
|
||||
/obj/machinery/power/rad_collector/Destroy()
|
||||
|
||||
@@ -48,8 +48,8 @@ field_generator power level display
|
||||
overlays += "+p[power_level]"
|
||||
|
||||
|
||||
/obj/machinery/field/generator/New()
|
||||
..()
|
||||
/obj/machinery/field/generator/Initialize(mapload)
|
||||
. = ..()
|
||||
fields = list()
|
||||
connected_gens = list()
|
||||
|
||||
|
||||
@@ -2,11 +2,12 @@
|
||||
name = "Accelerated Particles"
|
||||
desc = "Small things moving very fast."
|
||||
icon = 'icons/obj/machines/particle_accelerator.dmi'
|
||||
icon_state = "particle"//Need a new icon for this
|
||||
anchored = 1
|
||||
density = 1
|
||||
icon_state = "particle"
|
||||
anchored = TRUE
|
||||
density = FALSE
|
||||
var/movement_range = 10
|
||||
var/energy = 10
|
||||
var/speed = 1
|
||||
|
||||
/obj/effect/accelerated_particle/weak
|
||||
movement_range = 8
|
||||
@@ -21,50 +22,45 @@
|
||||
energy = 50
|
||||
|
||||
|
||||
/obj/effect/accelerated_particle/New(loc, dir = 2)
|
||||
src.loc = loc
|
||||
src.dir = dir
|
||||
/obj/effect/accelerated_particle/New(loc)
|
||||
..()
|
||||
|
||||
if(movement_range > 20)
|
||||
movement_range = 20
|
||||
spawn(0)
|
||||
move(1)
|
||||
return
|
||||
addtimer(CALLBACK(src, .proc/move), 1)
|
||||
|
||||
|
||||
/obj/effect/accelerated_particle/Bump(atom/A)
|
||||
if(A)
|
||||
if(ismob(A))
|
||||
if(isliving(A))
|
||||
toxmob(A)
|
||||
if((istype(A,/obj/machinery/the_singularitygen))||(istype(A,/obj/singularity/)))
|
||||
A:energy += energy
|
||||
return
|
||||
else if(istype(A, /obj/machinery/the_singularitygen))
|
||||
var/obj/machinery/the_singularitygen/S = A
|
||||
S.energy += energy
|
||||
else if(istype(A, /obj/singularity))
|
||||
var/obj/singularity/S = A
|
||||
S.energy += energy
|
||||
|
||||
|
||||
/obj/effect/accelerated_particle/Bumped(atom/A)
|
||||
if(ismob(A))
|
||||
Bump(A)
|
||||
return
|
||||
/obj/effect/accelerated_particle/Crossed(atom/A)
|
||||
if(isliving(A))
|
||||
toxmob(A)
|
||||
|
||||
|
||||
/obj/effect/accelerated_particle/ex_act(severity)
|
||||
qdel(src)
|
||||
|
||||
/obj/effect/accelerated_particle/singularity_pull()
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/effect/accelerated_particle/proc/toxmob(var/mob/living/M)
|
||||
M.apply_effect((energy*6),IRRADIATE,0)
|
||||
M.updatehealth()
|
||||
return
|
||||
/obj/effect/accelerated_particle/proc/toxmob(mob/living/M)
|
||||
M.apply_effect((energy * 6), IRRADIATE, 0)
|
||||
|
||||
|
||||
/obj/effect/accelerated_particle/proc/move(var/lag)
|
||||
/obj/effect/accelerated_particle/proc/move()
|
||||
if(!step(src,dir))
|
||||
src.loc = get_step(src,dir)
|
||||
forceMove(get_step(src, dir))
|
||||
movement_range--
|
||||
if(movement_range <= 0)
|
||||
if(movement_range == 0)
|
||||
qdel(src)
|
||||
else
|
||||
sleep(lag)
|
||||
move(lag)
|
||||
sleep(speed)
|
||||
move()
|
||||
@@ -19,11 +19,11 @@
|
||||
var/parts = null
|
||||
var/datum/wires/particle_acc/control_box/wires = null
|
||||
|
||||
/obj/machinery/particle_accelerator/control_box/New()
|
||||
/obj/machinery/particle_accelerator/control_box/Initialize(mapload)
|
||||
. = ..()
|
||||
wires = new(src)
|
||||
connected_parts = list()
|
||||
update_icon()
|
||||
..()
|
||||
|
||||
/obj/machinery/particle_accelerator/control_box/Destroy()
|
||||
if(active)
|
||||
|
||||
@@ -29,21 +29,20 @@
|
||||
return 0
|
||||
|
||||
|
||||
/obj/structure/particle_accelerator/particle_emitter/proc/emit_particle(var/strength = 0)
|
||||
/obj/structure/particle_accelerator/particle_emitter/proc/emit_particle(strength = 0)
|
||||
if((last_shot + fire_delay) <= world.time)
|
||||
last_shot = world.time
|
||||
var/obj/effect/accelerated_particle/A = null
|
||||
var/turf/T = get_step(src, dir)
|
||||
var/turf/T = get_turf(src)
|
||||
var/obj/effect/accelerated_particle/P
|
||||
switch(strength)
|
||||
if(0)
|
||||
A = new/obj/effect/accelerated_particle/weak(T, dir)
|
||||
P = new/obj/effect/accelerated_particle/weak(T)
|
||||
if(1)
|
||||
A = new/obj/effect/accelerated_particle(T, dir)
|
||||
P = new/obj/effect/accelerated_particle(T)
|
||||
if(2)
|
||||
A = new/obj/effect/accelerated_particle/strong(T, dir)
|
||||
P = new/obj/effect/accelerated_particle/strong(T)
|
||||
if(3)
|
||||
A = new/obj/effect/accelerated_particle/powerful(T, dir)
|
||||
if(A)
|
||||
A.dir = dir
|
||||
return 1
|
||||
return 0
|
||||
P = new/obj/effect/accelerated_particle/powerful(T)
|
||||
P.setDir(dir)
|
||||
return TRUE
|
||||
return FALSE
|
||||
@@ -3,8 +3,4 @@
|
||||
desc_holder = "This part uses electromagnetic waves to focus the Alpha particles."
|
||||
icon = 'icons/obj/machines/particle_accelerator.dmi'
|
||||
icon_state = "power_box"
|
||||
reference = "power_box"
|
||||
|
||||
/obj/structure/particle_accelerator/power_box/update_icon()
|
||||
..()
|
||||
return
|
||||
reference = "power_box"
|
||||
@@ -12,7 +12,6 @@
|
||||
desc = "A high-capacity superconducting magnetic energy storage (SMES) unit."
|
||||
icon_state = "smes"
|
||||
density = TRUE
|
||||
anchored = TRUE
|
||||
use_power = NO_POWER_USE
|
||||
|
||||
var/capacity = 5e6 // maximum charge
|
||||
@@ -35,9 +34,7 @@
|
||||
var/last_input_attempt = 0
|
||||
var/last_charge = 0
|
||||
|
||||
var/open_hatch = 0
|
||||
var/name_tag = null
|
||||
var/building_terminal = 0 //Suggestions about how to avoid clickspam building several terminals accepted!
|
||||
var/obj/machinery/power/terminal/terminal = null
|
||||
|
||||
/obj/machinery/power/smes/Initialize(mapload)
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
desc = "A solar panel. Generates electricity when in contact with sunlight."
|
||||
icon = 'icons/obj/power.dmi'
|
||||
icon_state = "sp_base"
|
||||
anchored = 1
|
||||
density = 1
|
||||
density = TRUE
|
||||
use_power = NO_POWER_USE
|
||||
idle_power_usage = 0
|
||||
active_power_usage = 0
|
||||
@@ -20,8 +19,8 @@
|
||||
var/turn_angle = 0
|
||||
var/obj/machinery/power/solar_control/control = null
|
||||
|
||||
/obj/machinery/power/solar/New(var/turf/loc, var/obj/item/solar_assembly/S)
|
||||
..(loc)
|
||||
/obj/machinery/power/solar/Initialize(mapload, obj/item/solar_assembly/S)
|
||||
. = ..()
|
||||
Make(S)
|
||||
connect_to_network()
|
||||
|
||||
@@ -118,7 +117,7 @@
|
||||
return
|
||||
|
||||
sunfrac = cos(p_angle) ** 2
|
||||
//isn't the power recieved from the incoming light proportionnal to cos(p_angle) (Lambert's cosine law) rather than cos(p_angle)^2 ?
|
||||
//isn't the power received from the incoming light proportionnal to cos(p_angle) (Lambert's cosine law) rather than cos(p_angle)^2 ?
|
||||
|
||||
/obj/machinery/power/solar/process()//TODO: remove/add this from machines to save on processing as needed ~Carn PRIORITY
|
||||
if(stat & BROKEN)
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
//This is a power switch. When turned on it looks at the cables around the tile that it's on and notes which cables are trying to connect to it.
|
||||
//After it knows this it creates the number of cables from the center to each of the cables attempting to conenct. These cables cannot be removed
|
||||
//with wirecutters. When the switch is turned off it removes all the cables on the tile it's on.
|
||||
//The switch uses a 5s delay to prevent powernet change spamming.
|
||||
/*
|
||||
/obj/structure/powerswitch
|
||||
name = "power switch"
|
||||
desc = "A switch that controls power."
|
||||
icon = 'icons/obj/power.dmi'
|
||||
icon_state = "switch-dbl-up"
|
||||
var/icon_state_on = "switch-dbl-down"
|
||||
var/icon_state_off = "switch-dbl-up"
|
||||
density = 0
|
||||
anchored = 1
|
||||
var/on = 0 //up is off, down is on
|
||||
var/busy = 0 //set to 1 when you start pulling
|
||||
|
||||
/obj/structure/powerswitch/simple
|
||||
icon_state = "switch-up"
|
||||
icon_state_on = "switch-down"
|
||||
icon_state_off = "switch-up"
|
||||
|
||||
|
||||
/obj/structure/powerswitch/examine(mob/user)
|
||||
..(user)
|
||||
if(on)
|
||||
to_chat(user, "The switch is in the on position")
|
||||
else
|
||||
to_chat(user, "The switch is in the off position")
|
||||
|
||||
/obj/structure/powerswitch/attack_ai(mob/user)
|
||||
to_chat(user, "<span class='warning'>You're an AI. This is a manual switch. It's not going to work.</span>")
|
||||
return
|
||||
|
||||
/obj/structure/powerswitch/attack_hand(mob/user)
|
||||
|
||||
if(busy)
|
||||
to_chat(user, "<span class='warning'>This switch is already being toggled.</span>")
|
||||
return
|
||||
|
||||
..()
|
||||
|
||||
busy = 1
|
||||
for(var/mob/O in viewers(user))
|
||||
O.show_message(text("<span class='warning'>[user] starts pulling the [src].</span>"), 1)
|
||||
|
||||
if(do_after(user, 50, target = src))
|
||||
set_state(!on)
|
||||
for(var/mob/O in viewers(user))
|
||||
O.show_message(text("<span class='warning'>[user] flips the [src] into the [on ? </span>"on": "off"] position."), 1)
|
||||
busy = 0
|
||||
|
||||
/obj/structure/powerswitch/proc/set_state(var/state)
|
||||
on = state
|
||||
if(on)
|
||||
icon_state = icon_state_on
|
||||
var/list/connection_dirs = list()
|
||||
for(var/direction in list(1,2,4,8,5,6,9,10))
|
||||
for(var/obj/structure/cable/C in get_step(src,direction))
|
||||
if(C.d1 == turn(direction, 180) || C.d2 == turn(direction, 180))
|
||||
connection_dirs += direction
|
||||
break
|
||||
|
||||
for(var/direction in connection_dirs)
|
||||
var/obj/structure/cable/C = new/obj/structure/cable(src.loc)
|
||||
C.d1 = 0
|
||||
C.d2 = direction
|
||||
C.icon_state = "[C.d1]-[C.d2]"
|
||||
C.power_switch = src
|
||||
|
||||
var/datum/powernet/PN = new()
|
||||
PN.number = powernets.len + 1
|
||||
powernets += PN
|
||||
C.netnum = PN.number
|
||||
PN.cables += C
|
||||
|
||||
C.mergeConnectedNetworks(C.d2)
|
||||
C.mergeConnectedNetworksOnTurf()
|
||||
|
||||
else
|
||||
icon_state = icon_state_off
|
||||
for(var/obj/structure/cable/C in src.loc)
|
||||
qdel(C)
|
||||
*/
|
||||
@@ -8,17 +8,15 @@
|
||||
icon_state = "term"
|
||||
desc = "It's an underfloor wiring terminal for power equipment."
|
||||
level = 1
|
||||
layer = TURF_LAYER
|
||||
layer = WIRE_TERMINAL_LAYER //a bit above wires
|
||||
var/obj/machinery/power/master = null
|
||||
anchored = 1
|
||||
layer = 2.6 // a bit above wires
|
||||
|
||||
|
||||
/obj/machinery/power/terminal/Initialize(mapload)
|
||||
. = ..()
|
||||
var/turf/T = src.loc
|
||||
if(level==1) hide(T.intact)
|
||||
return
|
||||
var/turf/T = get_turf(src)
|
||||
if(level == 1)
|
||||
hide(T.intact)
|
||||
|
||||
/obj/machinery/power/terminal/Destroy()
|
||||
if(master)
|
||||
@@ -27,7 +25,7 @@
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/machinery/power/terminal/hide(var/i)
|
||||
/obj/machinery/power/terminal/hide(i)
|
||||
if(i)
|
||||
invisibility = 101
|
||||
icon_state = "term-f"
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
var/last_zap = 0
|
||||
var/datum/wires/tesla_coil/wires = null
|
||||
|
||||
/obj/machinery/power/tesla_coil/New()
|
||||
..()
|
||||
/obj/machinery/power/tesla_coil/Initialize(mapload)
|
||||
. = ..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/circuitboard/tesla_coil(null)
|
||||
component_parts += new /obj/item/stock_parts/capacitor(null)
|
||||
@@ -89,8 +89,8 @@
|
||||
anchored = 0
|
||||
density = 1
|
||||
|
||||
/obj/machinery/power/grounding_rod/New()
|
||||
..()
|
||||
/obj/machinery/power/grounding_rod/Initialize(mapload)
|
||||
. = ..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/circuitboard/grounding_rod(null)
|
||||
component_parts += new /obj/item/stock_parts/capacitor(null)
|
||||
|
||||
@@ -8,16 +8,15 @@
|
||||
desc = "A solar directional tracker."
|
||||
icon = 'icons/obj/power.dmi'
|
||||
icon_state = "tracker"
|
||||
anchored = 1
|
||||
density = 1
|
||||
density = TRUE
|
||||
use_power = NO_POWER_USE
|
||||
|
||||
var/id = 0
|
||||
var/sun_angle = 0 // sun angle as set by sun datum
|
||||
var/obj/machinery/power/solar_control/control = null
|
||||
|
||||
/obj/machinery/power/tracker/New(var/turf/loc, var/obj/item/solar_assembly/S)
|
||||
..(loc)
|
||||
/obj/machinery/power/tracker/Initialize(mapload, obj/item/solar_assembly/S)
|
||||
. = ..()
|
||||
Make(S)
|
||||
connect_to_network()
|
||||
|
||||
@@ -26,7 +25,7 @@
|
||||
return ..()
|
||||
|
||||
//set the control of the tracker to a given computer if closer than SOLAR_MAX_DIST
|
||||
/obj/machinery/power/tracker/proc/set_control(var/obj/machinery/power/solar_control/SC)
|
||||
/obj/machinery/power/tracker/proc/set_control(obj/machinery/power/solar_control/SC)
|
||||
if(SC && (get_dist(src, SC) > SOLAR_MAX_DIST))
|
||||
return 0
|
||||
control = SC
|
||||
@@ -39,21 +38,21 @@
|
||||
control.connected_tracker = null
|
||||
control = null
|
||||
|
||||
/obj/machinery/power/tracker/proc/Make(var/obj/item/solar_assembly/S)
|
||||
/obj/machinery/power/tracker/proc/Make(obj/item/solar_assembly/S)
|
||||
if(!S)
|
||||
S = new /obj/item/solar_assembly(src)
|
||||
S.glass_type = /obj/item/stack/sheet/glass
|
||||
S.tracker = 1
|
||||
S.anchored = 1
|
||||
S.loc = src
|
||||
S.anchored = TRUE
|
||||
S.forceMove(src)
|
||||
update_icon()
|
||||
|
||||
//updates the tracker icon and the facing angle for the control computer
|
||||
/obj/machinery/power/tracker/proc/set_angle(var/angle)
|
||||
/obj/machinery/power/tracker/proc/set_angle(angle)
|
||||
sun_angle = angle
|
||||
|
||||
//set icon dir to show sun illumination
|
||||
dir = turn(NORTH, -angle - 22.5) // 22.5 deg bias ensures, e.g. 67.5-112.5 is EAST
|
||||
setDir(turn(NORTH, -angle - 22.5)) // 22.5 deg bias ensures, e.g. 67.5-112.5 is EAST
|
||||
|
||||
if(powernet && (powernet == control.powernet)) //update if we're still in the same powernet
|
||||
control.cdir = angle
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
name = "treadmill"
|
||||
desc = "A power-generating treadmill."
|
||||
layer = 2.2
|
||||
anchored = 1
|
||||
use_power = NO_POWER_USE
|
||||
|
||||
var/speed = 0
|
||||
@@ -18,8 +17,8 @@
|
||||
var/list/mobs_running[0]
|
||||
var/id = null // for linking to monitor
|
||||
|
||||
/obj/machinery/power/treadmill/Initialize()
|
||||
..()
|
||||
/obj/machinery/power/treadmill/Initialize(mapload)
|
||||
. = ..()
|
||||
if(anchored)
|
||||
connect_to_network()
|
||||
|
||||
@@ -138,8 +137,8 @@
|
||||
var/frame = 0 // on 0, show labels, on 1 show numbers
|
||||
var/redeem_immediately = 0 // redeem immediately for holding cell
|
||||
|
||||
/obj/machinery/treadmill_monitor/Initialize()
|
||||
..()
|
||||
/obj/machinery/treadmill_monitor/Initialize(mapload)
|
||||
. = ..()
|
||||
if(id)
|
||||
for(var/obj/machinery/power/treadmill/T in GLOB.machines)
|
||||
if(T.id == id)
|
||||
|
||||
@@ -64,8 +64,8 @@
|
||||
|
||||
// the inlet stage of the gas turbine electricity generator
|
||||
|
||||
/obj/machinery/power/compressor/New()
|
||||
..()
|
||||
/obj/machinery/power/compressor/Initialize(mapload)
|
||||
. = ..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/circuitboard/power_compressor(null)
|
||||
component_parts += new /obj/item/stock_parts/manipulator(null)
|
||||
@@ -80,10 +80,6 @@
|
||||
|
||||
gas_contained = new
|
||||
inturf = get_step(src, dir)
|
||||
|
||||
|
||||
/obj/machinery/power/compressor/Initialize()
|
||||
..()
|
||||
locate_machinery()
|
||||
if(!turbine)
|
||||
stat |= BROKEN
|
||||
@@ -185,8 +181,8 @@
|
||||
#define TURBGENQ 100000
|
||||
#define TURBGENG 0.5
|
||||
|
||||
/obj/machinery/power/turbine/New()
|
||||
..()
|
||||
/obj/machinery/power/turbine/Initialize(mapload)
|
||||
. = ..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/circuitboard/power_turbine(src)
|
||||
component_parts += new /obj/item/stock_parts/capacitor(src)
|
||||
@@ -200,10 +196,6 @@
|
||||
// The outlet is pointed at the direction of the turbine component
|
||||
|
||||
outturf = get_step(src, dir)
|
||||
|
||||
|
||||
/obj/machinery/power/turbine/Initialize()
|
||||
..()
|
||||
locate_machinery()
|
||||
if(!compressor)
|
||||
stat |= BROKEN
|
||||
|
||||
Reference in New Issue
Block a user