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:
mport2004@gmail.com
2011-02-10 11:20:52 +00:00
parent 71d5a5f28c
commit 54b1d50b25
21 changed files with 8694 additions and 8554 deletions

View File

@@ -614,6 +614,10 @@ proc/process_ghost_teleport_locs()
name = "Engine Hallway"
icon_state = "engine_hallway"
/area/engine/engineering
name = "Engineering"
icon_state = "engine_hallway"
/area/engine/engine_mon
name = "Engine Monitoring"
icon_state = "engine_monitoring"

View File

@@ -9,6 +9,7 @@
permeability_coefficient = 0.90
flags = FPRINT | TABLEPASS | ONESIZEFITSALL
// Colors
/obj/item/clothing/under/chameleon
@@ -79,6 +80,15 @@
color = "yellow"
// RANKS
/obj/item/clothing/under/rank
var
has_sensor = 1//For the crew computer 2 = unable to change mode
sensor_mode = 0
/*
1 = Report living/dead
2 = Report detailed damages
3 = Report location
*/
/obj/item/clothing/under/rank/atmospheric_technician
desc = "It has an Atmospherics rank stripe on it."
@@ -202,27 +212,33 @@
color = "hydroponics"
permeability_coefficient = 0.50
// OTHER NONRANKED STATION JOBS
/obj/item/clothing/under/rank/cargo
name = "Quartermaster's Jumpsuit"
desc = "What can brown do for you?"
icon_state = "lightbrown"
item_state = "lb_suit"
color = "cargo"
/obj/item/clothing/under/bartender
/obj/item/clothing/under/rank/bartender
desc = "It looks like it could use more flair."
name = "Bartender's Uniform"
icon_state = "ba_suit"
item_state = "ba_suit"
color = "ba_suit"
/obj/item/clothing/under/clown
/obj/item/clothing/under/rank/clown
name = "clown suit"
desc = "Wearing this, all the children love you, for all the wrong reasons."
icon_state = "clown"
color = "clown"
/obj/item/clothing/under/chef
/obj/item/clothing/under/rank/chef
desc = "Issued only to the most hardcore chefs in space."
name = "Chef's Uniform"
icon_state = "chef"
color = "chef"
// OTHER NONRANKED STATION JOBS
/obj/item/clothing/under/det
name = "Hard worn suit"
desc = "Someone who wears this means business."
@@ -257,20 +273,12 @@
icon_state = "sl_suit"
color = "sl_suit"
/obj/item/clothing/under/cargo
name = "Quartermaster's Jumpsuit"
desc = "What can brown do for you?"
icon_state = "lightbrown"
item_state = "lb_suit"
color = "cargo"
/obj/item/clothing/under/syndicate
name = "Tactical Turtleneck"
desc = "Non-descript, slightly suspicious civilian clothing."
icon_state = "syndicate"
item_state = "bl_suit"
color = "syndicate"
mode = 0
/obj/item/clothing/under/syndicate/tacticool
name = "Tacticool Turtleneck"
@@ -278,7 +286,6 @@
icon_state = "tactifool"
item_state = "bl_suit"
color = "tactifool"
mode = 0
/obj/item/clothing/under/librarian
name = "Sensible Suit"

View File

@@ -111,6 +111,44 @@
containertype = "/obj/crate"
containername = "Engineering crate"
/datum/supply_packs/engine
name = "Emitter crate"
contains = list("/obj/machinery/emitter",
"/obj/machinery/emitter",)
cost = 10
containertype = "/obj/crate/secure"
containername = "Emitter crate"
access = access_heads
/datum/supply_packs/engine/field_gen
name = "Field Generator crate"
contains = list("/obj/machinery/field_generator",
"/obj/machinery/field_generator",)
containername = "Field Generator crate"
/datum/supply_packs/engine/sing_gen
name = "Singularity Generator crate"
contains = list("/obj/machinery/the_singularitygen")
containername = "Singularity Generator crate"
/datum/supply_packs/engine/collector
name = "Collector crate"
contains = list("/obj/machinery/power/rad_collector")
containername = "Collector crate"
/datum/supply_packs/engine/PA
name = "Particle Accelerator crate"
cost = 40
contains = list("/obj/particle_accelerator/fuel_chamber",
"/obj/machinery/particle_accelerator/control_box",
"/obj/particle_accelerator/particle_emitter/center",
"/obj/particle_accelerator/particle_emitter/left",
"/obj/particle_accelerator/particle_emitter/right",
"/obj/particle_accelerator/power_box",
"/obj/particle_accelerator/end_cap")
containername = "Particle Accelerator crate"
/datum/supply_packs/medical
name = "Medical crate"
contains = list("/obj/item/weapon/storage/firstaid/regular",

View File

@@ -333,7 +333,7 @@
// src.equip_if_possible(new /obj/item/weapon/storage/backpack(src), slot_back)
src.equip_if_possible(new /obj/item/weapon/storage/backpack/clown (src), slot_back)
src.equip_if_possible(new /obj/item/device/pda/clown(src), slot_belt)
src.equip_if_possible(new /obj/item/clothing/under/clown(src), slot_w_uniform)
src.equip_if_possible(new /obj/item/clothing/under/rank/clown(src), slot_w_uniform)
src.equip_if_possible(new /obj/item/clothing/shoes/clown_shoes(src), slot_shoes)
src.equip_if_possible(new /obj/item/clothing/mask/gas/clown_hat(src), slot_wear_mask)
src.equip_if_possible(new /obj/item/weapon/reagent_containers/food/snacks/banana(src), slot_in_backpack)
@@ -489,7 +489,7 @@
// src.equip_if_possible(new /obj/item/weapon/crowbar(src), slot_in_backpack) // same as with engineers, WHY
if ("Barman")
src.equip_if_possible(new /obj/item/clothing/under/bartender(src), slot_w_uniform)
src.equip_if_possible(new /obj/item/clothing/under/rank/bartender(src), slot_w_uniform)
src.equip_if_possible(new /obj/item/clothing/shoes/black(src), slot_shoes)
src.equip_if_possible(new /obj/item/clothing/suit/armor/vest(src), slot_wear_suit)
src.equip_if_possible(new /obj/item/weapon/storage/backpack(src), slot_back)
@@ -499,7 +499,7 @@
src.equip_if_possible(new /obj/item/weapon/ammo/shell/beanbag(src), slot_in_backpack)
if ("Chef")
src.equip_if_possible(new /obj/item/clothing/under/chef(src), slot_w_uniform)
src.equip_if_possible(new /obj/item/clothing/under/rank/chef(src), slot_w_uniform)
src.equip_if_possible(new /obj/item/clothing/shoes/black(src), slot_shoes)
src.equip_if_possible(new /obj/item/clothing/head/chefhat(src), slot_head)
// src.equip_if_possible(new /obj/item/weapon/kitchen/rollingpin(src), slot_in_backpack) // it's in his office
@@ -540,7 +540,7 @@
if ("Quartermaster")
src.equip_if_possible(new /obj/item/clothing/gloves/black(src), slot_gloves)
src.equip_if_possible(new /obj/item/clothing/shoes/black(src), slot_shoes)
src.equip_if_possible(new /obj/item/clothing/under/cargo(src), slot_w_uniform)
src.equip_if_possible(new /obj/item/clothing/under/rank/cargo(src), slot_w_uniform)
src.equip_if_possible(new /obj/item/device/pda/quartermaster(src), slot_belt)
src.equip_if_possible(new /obj/item/clothing/glasses/sunglasses(src), slot_glasses)
src.equip_if_possible(new /obj/item/weapon/clipboard(src), slot_l_hand)
@@ -549,7 +549,7 @@
if ("Cargo Technician")
src.equip_if_possible(new /obj/item/clothing/gloves/black(src), slot_gloves)
src.equip_if_possible(new /obj/item/clothing/shoes/black(src), slot_shoes)
src.equip_if_possible(new /obj/item/clothing/under/cargo(src), slot_w_uniform)
src.equip_if_possible(new /obj/item/clothing/under/rank/cargo(src), slot_w_uniform)
src.equip_if_possible(new /obj/item/device/pda/quartermaster(src), slot_belt)
if ("Chief Engineer")

View File

@@ -1,92 +1,107 @@
/obj/machinery/computer/crew
name = "crew monitoring computer"
icon_state = "crew"
use_power = 1
idle_power_usage = 250
active_power_usage = 500
var
list/tracked
New()
tracked = list()
..()
/obj/machinery/computer/crew/attack_ai(mob/user)
add_fingerprint(user)
attack_ai(mob/user)
attack_hand(user)
interact(user)
if(stat & (BROKEN|NOPOWER))
attack_hand(mob/user)
add_fingerprint(user)
if(stat & (BROKEN|NOPOWER))
return
interact(user)
process()
return
interact(user)
/obj/machinery/computer/crew/attack_hand(mob/user)
add_fingerprint(user)
if(stat & (BROKEN|NOPOWER))
return
interact(user)
/obj/machinery/computer/crew/proc/interact(mob/user)
power_change()
if(stat & BROKEN)
icon_state = "broken"
else
if( powered() )
icon_state = initial(icon_state)
stat &= ~NOPOWER
else
spawn(rand(0, 15))
src.icon_state = "c_unpowered"
stat |= NOPOWER
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
if (!istype(user, /mob/living/silicon))
user.machine = null
user << browse(null, "window=powcomp")
Topic(href, href_list)
..()
if( href_list["close"] )
usr << browse(null, "window=crewcomp")
usr.machine = null
return
if(href_list["update"])
src.updateDialog()
return
user.machine = src
var/t = "<TT><B>Crew Monitoring</B><HR>"
t += "<table><tr><td>Name</td><td>Vitals</td><td>Position</td></tr>"
var/list/tracked = list()
for(var/obj/item/clothing/under/C in world)
if(istype(C.loc, /mob/living/carbon/human))
tracked.Add(C.loc)
for(var/mob/living/carbon/human/H in tracked)
for(var/obj/item/clothing/under/C in H)
if(H.z != 1 || istype(H.loc, /turf/space))
if(C.mode > 0)
t += "<tr><td>[H.name]</td><td></td><td>Not Available</td></tr>"
break
switch(C.mode)
//if(0)
//t += "<tr><td>Not Available</td><td>Not Available</td><td>Not Available</td></tr>"
if(1)
t += "<tr><td>[H.name]</td><td>[H.stat > 1 ? "<font color=red>Deceased</font>" : "Living"]</td><td>Not Available</td></tr>"
if(2)
t += "<tr><td>[H.name]</td><td>[H.stat > 1 ? "<font color=red>Deceased</font>" : "Living"], [H.oxyloss] - [H.toxloss] - [H.fireloss] - [H.bruteloss]</td><td>Not Available</td></tr>"
if(3)
var/turf/mob_loc = get_turf_loc(H)
t += "<tr><td>[H.name]</td><td>[H.stat > 1 ? "<font color=red>Deceased</font>" : "Living"], [H.oxyloss] - [H.toxloss] - [H.fireloss] - [H.bruteloss]</td><td>[mob_loc.loc] ([H.x], [H.y])</td></tr>"
break
t += "</table>"
t += "</FONT></PRE>"
t += "<BR><HR><A href='?src=\ref[src];close=1'>Close</A></TT>"
user << browse(t, "window=crewcomp;size=420x700")
onclose(user, "crewcomp")
/obj/machinery/computer/crew/Topic(href, href_list)
..()
if( href_list["close"] )
usr << browse(null, "window=crewcomp")
usr.machine = null
return
/obj/machinery/computer/crew/process()
if(!(stat & (NOPOWER|BROKEN)) )
use_power(250)
src.updateDialog()
/obj/machinery/computer/crew/power_change()
if(stat & BROKEN)
icon_state = "broken"
else
if( powered() )
icon_state = initial(icon_state)
stat &= ~NOPOWER
else
spawn(rand(0, 15))
src.icon_state = "c_unpowered"
stat |= NOPOWER
proc
interact(mob/user)
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
if (!istype(user, /mob/living/silicon))
user.machine = null
user << browse(null, "window=powcomp")
return
user.machine = src
src.scan()
var/t = "<TT><B>Crew Monitoring</B><HR>"
t += "<BR><A href='?src=\ref[src];update=1'>Refresh</A>"
t += "<BR><A href='?src=\ref[src];close=1'>Close</A>"
t += "<table><tr><td>Name</td><td>Vitals</td><td>Position</td></tr>"
for(var/obj/item/clothing/under/rank/C in src.tracked)
if((C) && (C.has_sensor) && (C.loc) && (C.loc.z == 1))
if(istype(C.loc, /mob/living/carbon/human))
var/mob/living/carbon/human/H = C.loc
var/dam1 = round(H.oxyloss,1)
var/dam2 = round(H.toxloss,1)
var/dam3 = round(H.fireloss,1)
var/dam4 = round(H.bruteloss,1)
switch(C.sensor_mode)
if(1)
if(H.wear_id)
t += "<tr><td>[H.wear_id.name]</td><td>"
else
t += "<tr><td>Unknown:</td><td>"
t+= "[H.stat > 1 ? "<font color=red>Deceased</font>" : "Living"]</td><td>Not Available</td></tr>"
if(2)
if(H.wear_id)
t += "<tr><td>[H.wear_id.name]</td><td>"
else
t += "<tr><td>Unknown:</td><td>"
t += "[H.stat > 1 ? "<font color=red>Deceased</font>" : "Living"], [dam1] - [dam2] - [dam3] - [dam4]</td><td>Not Available</td></tr>"
if(3)
t += "<tr><td>[H.name]</td><td>[H.stat > 1 ? "<font color=red>Deceased</font>" : "Living"], [dam2] - [dam2] - [dam3] - [dam4]</td><td>[get_area(H)] ([H.x], [H.y])</td></tr>"
t += "</table>"
t += "</FONT></PRE></TT>"
user << browse(t, "window=crewcomp;size=500x800")
onclose(user, "crewcomp")
scan()
for(var/obj/item/clothing/under/rank/C in world)
if((C.has_sensor) && (istype(C.loc, /mob/living/carbon/human)))
var/check = 0
for(var/O in src.tracked)
if(O == C)
check = 1
break
if(!check)
src.tracked.Add(C)
return 1

View File

@@ -94,7 +94,7 @@
onclose(user, "computer")
return
/obj/machinery/computer/engine/process()
/obj/machinery/computer/prisoner/process()
if(stat & (NOPOWER|BROKEN))
return
use_power(500)
@@ -117,9 +117,9 @@
choice = input("Are you certain you wish to detonate [R.name]?") in list("Confirm", "Abort")
if(choice == "Confirm")
R << "You hear quiet beep from the base of your skull."
message_admins("\blue [key_name_admin(usr)] gibbed [R.name]")
if(prob(95))
R.gib()
message_admins("\blue [key_name_admin(usr)] killswitched [R.name]")
else
R << "\blue you hear a click as the implant fails to detonate and disintegrates."

View File

@@ -31,6 +31,8 @@ var/reportingpower = 0 //this tracks whether this power monitoring computer is
user.machine = src
var/t = "<TT><B>Power Monitoring</B><HR>"
t += "<BR><HR><A href='?src=\ref[src];update=1'>Refresh</A>"
t += "<BR><HR><A href='?src=\ref[src];close=1'>Close</A>"
if(!powernet)
t += "\red No connection"
@@ -58,11 +60,9 @@ var/reportingpower = 0 //this tracks whether this power monitoring computer is
t += copytext(add_tspace(A.area.name, 30), 1, 30)
t += " [S[A.equipment+1]] [S[A.lighting+1]] [S[A.environ+1]] [add_lspace(A.lastused_total, 6)] [A.cell ? "[add_lspace(round(A.cell.percent()), 3)]% [chg[A.charging+1]]" : " N/C"]<BR>"
t += "</FONT></PRE>"
t += "</FONT></PRE></TT>"
t += "<BR><HR><A href='?src=\ref[src];close=1'>Close</A></TT>"
user << browse(t, "window=powcomp;size=420x700")
user << browse(t, "window=powcomp;size=420x900")
onclose(user, "powcomp")
@@ -72,6 +72,10 @@ var/reportingpower = 0 //this tracks whether this power monitoring computer is
usr << browse(null, "window=powcomp")
usr.machine = null
return
if( href_list["update"] )
src.updateDialog()
return
/obj/machinery/power/monitor/process()
if(!(stat & (NOPOWER|BROKEN)) )
@@ -92,8 +96,6 @@ var/reportingpower = 0 //this tracks whether this power monitoring computer is
powerreportavail = powernet.avail
powerreportviewload = powernet.viewload
src.updateDialog()
/obj/machinery/power/monitor/power_change()

View File

@@ -5,8 +5,8 @@
new /obj/item/clothing/head/that(src)
new /obj/item/clothing/under/sl_suit(src)
new /obj/item/clothing/under/sl_suit(src)
new /obj/item/clothing/under/bartender(src)
new /obj/item/clothing/under/bartender(src)
new /obj/item/clothing/under/rank/bartender(src)
new /obj/item/clothing/under/rank/bartender(src)
new /obj/item/clothing/suit/wcoat(src)
new /obj/item/clothing/suit/wcoat(src)
new /obj/item/clothing/shoes/black(src)

View File

@@ -3,8 +3,8 @@
sleep(2)
new /obj/item/clothing/head/chefhat(src)
new /obj/item/clothing/head/chefhat(src)
new /obj/item/clothing/under/chef(src)
new /obj/item/clothing/under/chef(src)
new /obj/item/clothing/under/rank/chef(src)
new /obj/item/clothing/under/rank/chef(src)
new /obj/item/weapon/kitchen/utensil/fork(src)
new /obj/item/weapon/kitchen/utensil/knife(src)
new /obj/item/weapon/kitchen/utensil/spoon(src)

View File

@@ -103,13 +103,6 @@ DEATH COMMANDO GAS MASK
var/obj/item/clothing/under/V = new U
src.clothing_choices += V
src.clothing_choices += new /obj/item/clothing/under/bartender
src.clothing_choices += new /obj/item/clothing/under/cargo
src.clothing_choices += new /obj/item/clothing/under/chef
src.clothing_choices += new /obj/item/clothing/under/clown
src.clothing_choices += new /obj/item/clothing/under/det
src.clothing_choices += new /obj/item/clothing/under/librarian
return
@@ -177,36 +170,38 @@ DEATH COMMANDO GAS MASK
icon_state = "death_commando_mask"
item_state = "death_commando_mask"
/obj/item/clothing/under/rank/New()
sensor_mode = pick(0,1,2,3)
..()
/obj/item/clothing/under/var/mode = 1 // 0 - Off, 1 - Binary Lifesigns, 2 - Vitals, 3 - Positioning and Vitals
/obj/item/clothing/under/verb/toggle()
/obj/item/clothing/under/rank/verb/toggle()
set name = "Toggle Suit Sensors"
var/mob/M = usr
if (istype (M, /mob/dead/)) return
if (usr.stat != 0) return
if (istype (src, /obj/item/clothing/under/color/orange/))
mode = 3
usr << "There are no controls for the sensing equipment woven into the fabric."
return
mode += 1
if(mode > 3)
mode = 0
switch(mode)
if (istype(M, /mob/dead/)) return
if (usr.stat) return
if(src.has_sensor >= 2)
usr << "The controls are locked."
return 0
if(src.has_sensor <= 0)
usr << "This suit does not have any sensors"
return 0
src.sensor_mode += 1
if(src.sensor_mode > 3)
src.sensor_mode = 0
switch(src.sensor_mode)
if(0)
usr << "You disable your suit's remote sensing equipment."
if(1)
usr << "You enable your suit's remote sensing equipment. It will now report whether you are live or dead."
usr << "Your suit will now report whether you are live or dead."
if(2)
usr << "You enable more complicated sensors in your suit. It will now report your vital lifesigns."
usr << "Your suit will now report your vital lifesigns."
if(3)
usr << "You activate the full suite of sensors in your suit. It will now report your vital lifesigns as well as your coordinate position."
usr << "Your suit will now report your vital lifesigns as well as your coordinate position."
..()
/obj/item/clothing/under/examine()
/obj/item/clothing/under/rank/examine()
..()
switch(mode)
switch(src.sensor_mode)
if(0)
usr << "Its sensors appear to be disabled."
if(1)
@@ -217,8 +212,6 @@ DEATH COMMANDO GAS MASK
usr << "Its vital tracker and tracking beacon appear to be enabled."
/obj/item/clothing/under/color/orange/mode = 3
/obj/item/clothing/shoes/magboots/attack_self(mob/user as mob)
if(src.magpulse)
src.flags &= ~NOSLIP

View File

@@ -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()

View File

@@ -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

View File

@@ -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()

View File

@@ -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

View File

@@ -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

View File

@@ -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))

View File

@@ -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"

View File

@@ -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")

View File

@@ -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'

View File

@@ -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

File diff suppressed because it is too large Load Diff