mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-01-02 13:32:32 +00:00
The crew monitoring computer should work better now
North solars expanded slightly Cargo can now order engine parts Power computer wont update every second so you can actually use the thing now Rotate verb for the emitters and Particle Accelerator Solar tracker does not use "in world" anymore git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1013 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -49,12 +49,12 @@
|
||||
if(src.P)
|
||||
user << "\red There appears to already be a plasma tank loaded!"
|
||||
return 1
|
||||
updateicon()
|
||||
src.P = W
|
||||
W.loc = src
|
||||
if (user.client)
|
||||
user.client.screen -= W
|
||||
user.u_equip(W)
|
||||
updateicon()
|
||||
else if(istype(W, /obj/item/weapon/crowbar))
|
||||
if(P)
|
||||
eject()
|
||||
|
||||
@@ -7,13 +7,22 @@
|
||||
density = 0
|
||||
unacidable = 1
|
||||
use_power = 0
|
||||
|
||||
var
|
||||
obj/machinery/field_generator/FG1 = null
|
||||
obj/machinery/field_generator/FG2 = null
|
||||
|
||||
New()
|
||||
spawn(1)
|
||||
src.sd_SetLuminosity(5)
|
||||
|
||||
|
||||
Del()
|
||||
if(FG1)
|
||||
FG1.cleanup()
|
||||
if(FG2)
|
||||
FG2.cleanup()
|
||||
..()
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
if(get_dist(src, user) > 1)
|
||||
return 0
|
||||
@@ -23,24 +32,28 @@
|
||||
|
||||
|
||||
blob_act()
|
||||
return
|
||||
return 0
|
||||
|
||||
|
||||
ex_act(severity)
|
||||
return
|
||||
return 0
|
||||
|
||||
|
||||
HasProximity(atom/movable/AM as mob|obj)
|
||||
if(istype(AM,/mob/living/silicon) && prob(40))
|
||||
shock(AM)
|
||||
return
|
||||
return 1
|
||||
if(istype(AM,/mob/living/carbon) && prob(50))
|
||||
shock(AM)
|
||||
return
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
proc
|
||||
shock(mob/user as mob)
|
||||
if(!FG1 || !FG2)
|
||||
del(src)
|
||||
return 0
|
||||
if(iscarbon(user))
|
||||
var/datum/effects/system/spark_spread/s = new /datum/effects/system/spark_spread
|
||||
s.set_up(5, 1, user.loc)
|
||||
@@ -73,3 +86,10 @@
|
||||
user.stunned = 2
|
||||
return
|
||||
return
|
||||
|
||||
set_master(var/master1,var/master2)
|
||||
if(!master1 || !master2)
|
||||
return 0
|
||||
FG1 = master1
|
||||
FG2 = master2
|
||||
return 1
|
||||
@@ -16,168 +16,169 @@
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 300
|
||||
|
||||
verb/rotate()
|
||||
set name = "Rotate"
|
||||
set src in oview(1)
|
||||
|
||||
/obj/machinery/emitter/New()
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/emitter/update_icon()
|
||||
if (active && !(stat & (NOPOWER|BROKEN)))
|
||||
icon_state = "Emitter +a"
|
||||
else
|
||||
icon_state = "Emitter"
|
||||
|
||||
|
||||
/obj/machinery/emitter/attack_hand(mob/user as mob)
|
||||
src.add_fingerprint(user)
|
||||
if(state == 2)
|
||||
if(!src.locked || istype(user, /mob/living/silicon))
|
||||
if(src.active==1)
|
||||
src.active = 0
|
||||
user << "You turn off the [src]."
|
||||
src.use_power = 1
|
||||
else
|
||||
src.active = 1
|
||||
user << "You turn on the [src]."
|
||||
src.shot_number = 0
|
||||
src.fire_delay = 100
|
||||
src.use_power = 2
|
||||
update_icon()
|
||||
else
|
||||
user << "The controls are locked!"
|
||||
else
|
||||
user << "The [src] needs to be firmly secured to the floor first."
|
||||
if (src.anchored || usr:stat)
|
||||
usr << "It is fastened to the floor!"
|
||||
return 0
|
||||
src.dir = turn(src.dir, 90)
|
||||
return 1
|
||||
|
||||
/obj/machinery/emitter/emp_act()//Emitters are hardened but still might have issues
|
||||
use_power(50)
|
||||
if(prob(1)&&prob(1))
|
||||
if(src.active)
|
||||
src.active = 0
|
||||
src.use_power = 1
|
||||
return 1
|
||||
|
||||
|
||||
/obj/machinery/emitter/process()
|
||||
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
|
||||
if(src.state != 2)
|
||||
src.active = 0
|
||||
return
|
||||
|
||||
if(((src.last_shot + src.fire_delay) <= world.time) && (src.active == 1))
|
||||
src.last_shot = world.time
|
||||
if(src.shot_number < 3)
|
||||
src.fire_delay = 2
|
||||
src.shot_number ++
|
||||
else
|
||||
src.fire_delay = rand(20,100)
|
||||
src.shot_number = 0
|
||||
|
||||
use_power(1000)
|
||||
var/obj/beam/a_laser/A = new /obj/beam/a_laser( src.loc )
|
||||
A.icon_state = "u_laser"
|
||||
playsound(src.loc, 'emitter.ogg', 75, 1)
|
||||
|
||||
if(prob(35))
|
||||
var/datum/effects/system/spark_spread/s = new /datum/effects/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
A.dir = src.dir
|
||||
if(src.dir == 1)//Up
|
||||
A.yo = 20
|
||||
A.xo = 0
|
||||
|
||||
else if(src.dir == 2)//Down
|
||||
A.yo = -20
|
||||
A.xo = 0
|
||||
|
||||
else if(src.dir == 4)//Right
|
||||
A.yo = 0
|
||||
A.xo = 20
|
||||
|
||||
else if(src.dir == 8)//Left
|
||||
A.yo = 0
|
||||
A.xo = -20
|
||||
|
||||
else // Any other
|
||||
A.yo = -20
|
||||
A.xo = 0
|
||||
|
||||
A.process()
|
||||
|
||||
|
||||
/obj/machinery/emitter/attackby(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
if(active)
|
||||
user << "Turn off the [src] first."
|
||||
return
|
||||
switch(state)
|
||||
if(0)
|
||||
state = 1
|
||||
playsound(src.loc, 'Ratchet.ogg', 75, 1)
|
||||
user.visible_message("[user.name] secures [src.name] to the floor.", \
|
||||
"You secure the external reinforcing bolts to the floor.", \
|
||||
"You hear ratchet")
|
||||
src.anchored = 1
|
||||
if(1)
|
||||
state = 0
|
||||
playsound(src.loc, 'Ratchet.ogg', 75, 1)
|
||||
user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", \
|
||||
"You undo the external reinforcing bolts.", \
|
||||
"You hear ratchet")
|
||||
src.anchored = 0
|
||||
if(2)
|
||||
user << "\red The [src.name] needs to be unwelded from the floor."
|
||||
return
|
||||
|
||||
else if(istype(W, /obj/item/weapon/weldingtool))
|
||||
if(active)
|
||||
user << "Turn off the [src] first."
|
||||
return
|
||||
switch(state)
|
||||
if(0)
|
||||
user << "\red The [src.name] needs to be wrenched to the floor."
|
||||
return
|
||||
if(1)
|
||||
if (W:remove_fuel(2,user))
|
||||
playsound(src.loc, 'Welder2.ogg', 50, 1)
|
||||
user.visible_message("[user.name] starts to weld the [src.name] to the floor.", \
|
||||
"You start to weld the [src] to the floor.", \
|
||||
"You hear welding")
|
||||
if (do_after(user,20))
|
||||
state = 2
|
||||
user << "You weld the [src] to the floor."
|
||||
else
|
||||
user << "\blue You need more welding fuel to complete this task."
|
||||
return
|
||||
if(2)
|
||||
if (W:remove_fuel(2,user))
|
||||
playsound(src.loc, 'Welder2.ogg', 50, 1)
|
||||
user.visible_message("[user.name] starts to cut the [src.name] free from the floor.", \
|
||||
"You start to cut the [src] free from the floor.", \
|
||||
"You hear welding")
|
||||
if (do_after(user,20))
|
||||
state = 1
|
||||
user << "You cut the [src] free from the floor."
|
||||
else
|
||||
user << "\blue You need more welding fuel to complete this task."
|
||||
return
|
||||
else if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
|
||||
if (src.allowed(user))
|
||||
src.locked = !src.locked
|
||||
user << "Controls are now [src.locked ? "locked." : "unlocked."]"
|
||||
else
|
||||
user << "\red Access denied."
|
||||
return
|
||||
else
|
||||
New()
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/emitter/power_change()
|
||||
..()
|
||||
update_icon()
|
||||
update_icon()
|
||||
if (active && !(stat & (NOPOWER|BROKEN)))
|
||||
icon_state = "Emitter +a"
|
||||
else
|
||||
icon_state = "Emitter"
|
||||
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
src.add_fingerprint(user)
|
||||
if(state == 2)
|
||||
if(!src.locked || istype(user, /mob/living/silicon))
|
||||
if(src.active==1)
|
||||
src.active = 0
|
||||
user << "You turn off the [src]."
|
||||
src.use_power = 1
|
||||
else
|
||||
src.active = 1
|
||||
user << "You turn on the [src]."
|
||||
src.shot_number = 0
|
||||
src.fire_delay = 100
|
||||
src.use_power = 2
|
||||
update_icon()
|
||||
else
|
||||
user << "The controls are locked!"
|
||||
else
|
||||
user << "The [src] needs to be firmly secured to the floor first."
|
||||
return 1
|
||||
|
||||
|
||||
emp_act()//Emitters are hardened but still might have issues
|
||||
use_power(50)
|
||||
if(prob(1)&&prob(1))
|
||||
if(src.active)
|
||||
src.active = 0
|
||||
src.use_power = 1
|
||||
return 1
|
||||
|
||||
|
||||
process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if(src.state != 2)
|
||||
src.active = 0
|
||||
return
|
||||
if(((src.last_shot + src.fire_delay) <= world.time) && (src.active == 1))
|
||||
src.last_shot = world.time
|
||||
if(src.shot_number < 3)
|
||||
src.fire_delay = 2
|
||||
src.shot_number ++
|
||||
else
|
||||
src.fire_delay = rand(20,100)
|
||||
src.shot_number = 0
|
||||
use_power(1000)
|
||||
var/obj/beam/a_laser/A = new /obj/beam/a_laser( src.loc )
|
||||
A.icon_state = "u_laser"
|
||||
playsound(src.loc, 'emitter.ogg', 75, 1)
|
||||
if(prob(35))
|
||||
var/datum/effects/system/spark_spread/s = new /datum/effects/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
A.dir = src.dir
|
||||
if(src.dir == 1)//Up
|
||||
A.yo = 20
|
||||
A.xo = 0
|
||||
else if(src.dir == 2)//Down
|
||||
A.yo = -20
|
||||
A.xo = 0
|
||||
else if(src.dir == 4)//Right
|
||||
A.yo = 0
|
||||
A.xo = 20
|
||||
else if(src.dir == 8)//Left
|
||||
A.yo = 0
|
||||
A.xo = -20
|
||||
else // Any other
|
||||
A.yo = -20
|
||||
A.xo = 0
|
||||
A.process()
|
||||
|
||||
|
||||
attackby(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
if(active)
|
||||
user << "Turn off the [src] first."
|
||||
return
|
||||
switch(state)
|
||||
if(0)
|
||||
state = 1
|
||||
playsound(src.loc, 'Ratchet.ogg', 75, 1)
|
||||
user.visible_message("[user.name] secures [src.name] to the floor.", \
|
||||
"You secure the external reinforcing bolts to the floor.", \
|
||||
"You hear ratchet")
|
||||
src.anchored = 1
|
||||
if(1)
|
||||
state = 0
|
||||
playsound(src.loc, 'Ratchet.ogg', 75, 1)
|
||||
user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", \
|
||||
"You undo the external reinforcing bolts.", \
|
||||
"You hear ratchet")
|
||||
src.anchored = 0
|
||||
if(2)
|
||||
user << "\red The [src.name] needs to be unwelded from the floor."
|
||||
return
|
||||
|
||||
else if(istype(W, /obj/item/weapon/weldingtool))
|
||||
if(active)
|
||||
user << "Turn off the [src] first."
|
||||
return
|
||||
switch(state)
|
||||
if(0)
|
||||
user << "\red The [src.name] needs to be wrenched to the floor."
|
||||
return
|
||||
if(1)
|
||||
if (W:remove_fuel(2,user))
|
||||
playsound(src.loc, 'Welder2.ogg', 50, 1)
|
||||
user.visible_message("[user.name] starts to weld the [src.name] to the floor.", \
|
||||
"You start to weld the [src] to the floor.", \
|
||||
"You hear welding")
|
||||
if (do_after(user,20))
|
||||
state = 2
|
||||
user << "You weld the [src] to the floor."
|
||||
else
|
||||
user << "\blue You need more welding fuel to complete this task."
|
||||
return
|
||||
if(2)
|
||||
if (W:remove_fuel(2,user))
|
||||
playsound(src.loc, 'Welder2.ogg', 50, 1)
|
||||
user.visible_message("[user.name] starts to cut the [src.name] free from the floor.", \
|
||||
"You start to cut the [src] free from the floor.", \
|
||||
"You hear welding")
|
||||
if (do_after(user,20))
|
||||
state = 1
|
||||
user << "You cut the [src] free from the floor."
|
||||
else
|
||||
user << "\blue You need more welding fuel to complete this task."
|
||||
return
|
||||
else if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
|
||||
if (src.allowed(user))
|
||||
src.locked = !src.locked
|
||||
user << "Controls are now [src.locked ? "locked." : "unlocked."]"
|
||||
else
|
||||
user << "\red Access denied."
|
||||
return
|
||||
else
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
power_change()
|
||||
..()
|
||||
update_icon()
|
||||
@@ -136,6 +136,12 @@
|
||||
emp_act()
|
||||
return 0
|
||||
|
||||
blob_act()
|
||||
if(active)
|
||||
return 0
|
||||
else
|
||||
..()
|
||||
|
||||
|
||||
bullet_act(flag)
|
||||
if (flag == PROJECTILE_BULLET)
|
||||
@@ -181,33 +187,30 @@
|
||||
|
||||
calc_power()
|
||||
if(Varpower)
|
||||
return
|
||||
return 1
|
||||
|
||||
update_icon()
|
||||
if(src.power > field_generator_max_power)
|
||||
src.power = field_generator_max_power
|
||||
|
||||
var/power_draw = 0
|
||||
var/power_draw = 2
|
||||
for (var/obj/machinery/containment_field/F in fields)
|
||||
if (isnull(F))
|
||||
continue
|
||||
power_draw++
|
||||
if(!power_draw)//If we are usin no power then we have no fields and should turn off
|
||||
for(var/mob/M in viewers(src))
|
||||
M.show_message("\red The [src.name] shuts down!")
|
||||
turn_off()
|
||||
src.power = 0
|
||||
else if(draw_power(round(power_draw/2,1)))
|
||||
if(draw_power(round(power_draw/2,1)))
|
||||
return 1
|
||||
else
|
||||
for(var/mob/M in viewers(src))
|
||||
M.show_message("\red The [src.name] shuts down!")
|
||||
turn_off()
|
||||
src.power = 0
|
||||
return
|
||||
return 0
|
||||
|
||||
//This could likely be better, it tends to start loopin if you have a complex generator loop setup. Still works well enough to run the engine fields will likely recode the field gens and fields sometime -Mport
|
||||
draw_power(var/draw = 0, var/failsafe = 0, var/obj/machinery/field_generator/G = null, var/obj/machinery/field_generator/last = null)
|
||||
if(Varpower)
|
||||
return 1
|
||||
if((G && G == src) || (failsafe >= 8))//Loopin, set fail
|
||||
return 0
|
||||
else
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
density = 1
|
||||
var
|
||||
movement_range = 10
|
||||
energy = 5
|
||||
energy = 10
|
||||
|
||||
weak
|
||||
movement_range = 8
|
||||
energy = 10
|
||||
energy = 5
|
||||
|
||||
strong
|
||||
movement_range = 15
|
||||
|
||||
@@ -54,6 +54,32 @@ PE|PE|PE
|
||||
icon_state = "end_cap"
|
||||
|
||||
|
||||
verb/rotate()
|
||||
set name = "Rotate"
|
||||
set src in oview(1)
|
||||
|
||||
if (src.anchored || usr:stat)
|
||||
usr << "It is fastened to the floor!"
|
||||
return 0
|
||||
src.dir = turn(src.dir, 90)
|
||||
return 1
|
||||
|
||||
|
||||
examine()
|
||||
set src in usr
|
||||
switch(src.construction_state)
|
||||
if(0)
|
||||
src.desc = text("Part of a Particle Accelerator, looks like its not attached to the flooring")
|
||||
if(1)
|
||||
src.desc = text("Part of a Particle Accelerator, looks like its missing some cables")
|
||||
if(2)
|
||||
src.desc = text("Part of a Particle Accelerator, looks like its got an open panel")
|
||||
if(3)
|
||||
src.desc = text("Part of a Particle Accelerator, looks like its all setup")
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
attackby(obj/item/W, mob/user)
|
||||
if(istool(W))
|
||||
if(src.process_tool_hit(W,user))
|
||||
@@ -157,6 +183,32 @@ PE|PE|PE
|
||||
active = 0
|
||||
|
||||
|
||||
verb/rotate()
|
||||
set name = "Rotate"
|
||||
set src in oview(1)
|
||||
|
||||
if (src.anchored || usr:stat)
|
||||
usr << "It is fastened to the floor!"
|
||||
return 0
|
||||
src.dir = turn(src.dir, 90)
|
||||
return 1
|
||||
|
||||
|
||||
examine()
|
||||
set src in usr
|
||||
switch(src.construction_state)
|
||||
if(0)
|
||||
src.desc = text("Part of a Particle Accelerator, looks like its not attached to the flooring")
|
||||
if(1)
|
||||
src.desc = text("Part of a Particle Accelerator, looks like its missing some cables")
|
||||
if(2)
|
||||
src.desc = text("Part of a Particle Accelerator, looks like its got an open panel")
|
||||
if(3)
|
||||
src.desc = text("Part of a Particle Accelerator, looks like its all setup")
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
attackby(obj/item/W, mob/user)
|
||||
if(istool(W))
|
||||
if(src.process_tool_hit(W,user))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/obj/particle_accelerator/fuel_chamber
|
||||
name = "Particle Accelerator Emitter"
|
||||
desc = "Part of a Particle Accelerator, might not want to stand near this end."
|
||||
name = "Particle Accelerator Fuel Control"
|
||||
desc = "Part of a Particle Accelerator."
|
||||
icon = 'particle_accelerator.dmi'
|
||||
icon_state = "fuel_chamber"
|
||||
@@ -169,7 +169,7 @@
|
||||
else
|
||||
dat += "Off <BR>"
|
||||
dat += "<A href='?src=\ref[src];togglep=1'>Toggle Power</A><BR><BR>"
|
||||
dat += "Particle Strength: [src.strength]"
|
||||
dat += "Particle Strength: [src.strength] "
|
||||
dat += "<A href='?src=\ref[src];strengthdown=1'>--</A>|<A href='?src=\ref[src];strengthup=1'>++</A><BR><BR>"
|
||||
|
||||
user << browse(dat, "window=pacontrol;size=420x500")
|
||||
|
||||
@@ -135,7 +135,7 @@ var/global/list/uneatable = list(
|
||||
pixel_y = -64
|
||||
grav_pull = 8
|
||||
consume_range = 2
|
||||
dissipate_delay = 10
|
||||
dissipate_delay = 4
|
||||
dissipate_track = 0
|
||||
dissipate_strength = 20
|
||||
if(7)
|
||||
@@ -147,9 +147,9 @@ var/global/list/uneatable = list(
|
||||
pixel_y = -96
|
||||
grav_pull = 10
|
||||
consume_range = 3
|
||||
dissipate_delay = 5
|
||||
dissipate_delay = 10
|
||||
dissipate_track = 0
|
||||
dissipate_strength = 15
|
||||
dissipate_strength = 10
|
||||
if(9)//this one also lacks a check for gens because it eats everything
|
||||
current_size = 9
|
||||
icon = '288x288.dmi'
|
||||
|
||||
@@ -29,8 +29,9 @@
|
||||
// find all solar controls and update them
|
||||
// currently, just update all controllers in world
|
||||
// ***TODO: better communication system using network
|
||||
for(var/obj/machinery/power/solar_control/C in world)
|
||||
C.tracker_update(angle)
|
||||
if(powernet)
|
||||
for(var/obj/machinery/power/solar_control/C in powernet.nodes)
|
||||
C.tracker_update(angle)
|
||||
|
||||
|
||||
// timed process
|
||||
|
||||
Reference in New Issue
Block a user