Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Tastyfish
2012-01-02 11:47:20 -05:00
19 changed files with 8680 additions and 8332 deletions

View File

@@ -961,7 +961,7 @@
#include "code\modules\projectiles\projectile\bullets.dm"
#include "code\modules\projectiles\projectile\energy.dm"
#include "code\modules\projectiles\projectile\special.dm"
#include "code\modules\recycling\conveyor.dm"
#include "code\modules\recycling\conveyor2.dm"
#include "code\modules\recycling\disposal-construction.dm"
#include "code\modules\recycling\disposal.dm"
#include "code\modules\recycling\sortingmachinery.dm"
@@ -1005,6 +1005,6 @@
#include "code\WorkInProgress\virus2\monkeydispensor.dm"
#include "code\WorkInProgress\virus2\Prob.dm"
#include "interface\skin.dmf"
#include "maps\Antiqua.dmm"
#include "maps\tgstation.2.0.8.dmm"
// END_INCLUDE

View File

@@ -113,6 +113,7 @@ var/list/radiochannels = list(
var/list/DEPT_FREQS = list(1351,1355,1357,1359,1213,1441,1349,1347)
var/const/COMM_FREQ = 1353 //command, colored gold in chat window
var/const/SYND_FREQ = 1213
var/NUKE_FREQ = 1199 //Never accessable except on nuke rounds.
#define TRANSMISSION_WIRE 0
#define TRANSMISSION_RADIO 1

View File

@@ -6,7 +6,7 @@
name = "nuclear emergency"
config_tag = "nuclear"
required_players = 3
required_enemies = 3
required_enemies = 2
var/const/agents_possible = 5 //If we ever need more syndicate agents.
var/const/waittime_l = 600 //lower bound on time before intercept arrives (in tenths of seconds)
@@ -110,6 +110,9 @@
var/nuke_code = "[rand(10000, 99999)]"
var/leader_selected = 0
var/freq = random_radio_frequency()
radiochannels += list("Nuclear" = freq)
NUKE_FREQ = freq
//var/agent_number = 1
for(var/datum/mind/synd_mind in syndicates)
@@ -126,7 +129,7 @@
//synd_mind.current.real_name = "[syndicate_name()] Operative #[agent_number]"
//agent_number++
equip_syndicate(synd_mind.current)
equip_syndicate(synd_mind.current,freq)
update_synd_icons_added(synd_mind)
update_all_synd_icons()
@@ -182,7 +185,7 @@
P.loc = H.loc
else
nuke_code = "code will be proveded later"
nuke_code = "code will be provided later"
synd_mind.current << "Nuclear Explosives 101:\n\tHello and thank you for choosing the Syndicate for your nuclear information needs.\nToday's crash course will deal with the operation of a Fusion Class Nanotrasen made Nuclear Device.\nFirst and foremost, DO NOT TOUCH ANYTHING UNTIL THE BOMB IS IN PLACE.\nPressing any button on the compacted bomb will cause it to extend and bolt itself into place.\nIf this is done to unbolt it one must compeltely log in which at this time may not be possible.\nTo make the device functional:\n1. Place bomb in designated detonation zone\n2. Extend and anchor bomb (attack with hand).\n3. Insert Nuclear Auth. Disk into slot.\n4. Type numeric code into keypad ([nuke_code]).\n\tNote: If you make a mistake press R to reset the device.\n5. Press the E button to log onto the device\nYou now have activated the device. To deactivate the buttons at anytime for example when\nyou've already prepped the bomb for detonation remove the auth disk OR press the R ont he keypad.\nNow the bomb CAN ONLY be detonated using the timer. A manual det. is not an option.\n\tNote: Nanotrasen is a pain in the neck.\nToggle off the SAFETY.\n\tNote: You wouldn't believe how many Syndicate Operatives with doctorates have forgotten this step\nSo use the - - and + + to set a det time between 5 seconds and 10 minutes.\nThen press the timer toggle button to start the countdown.\nNow remove the auth. disk so that the buttons deactivate.\n\tNote: THE BOMB IS STILL SET AND WILL DETONATE\nNow before you remove the disk if you need to move the bomb you can:\nToggle off the anchor, move it, and re-anchor.\n\nGood luck. Remember the order:\nDisk, Code, Safety, Timer, Disk, RUN!\nIntelligence Analysts believe that they are hiding the disk in the bridge. Your space ship will not leave until the bomb is armed and timing.\nGood luck!"
return
@@ -203,17 +206,18 @@
return
/datum/game_mode/proc/random_radio_frequency()
return 1337
/datum/game_mode/proc/equip_syndicate(mob/living/carbon/human/synd_mob)
var/radio_freq = random_radio_frequency()
/datum/game_mode/proc/random_radio_frequency(var/tempfreq = 1459)
tempfreq = rand(1400,1600)
if(tempfreq in radiochannels || (tempfreq > 1441 && tempfreq < 1489))
random_radio_frequency(tempfreq)
return tempfreq
/datum/game_mode/proc/equip_syndicate(mob/living/carbon/human/synd_mob,radio_freq)
var/obj/item/device/radio/R = new /obj/item/device/radio/headset(synd_mob)
R.set_frequency(radio_freq)
R.freerange = 1
R.config(list("Nuclear" = 1))
synd_mob.equip_if_possible(R, synd_mob.slot_ears)
synd_mob.equip_if_possible(new /obj/item/clothing/under/syndicate(synd_mob), synd_mob.slot_w_uniform)
synd_mob.equip_if_possible(new /obj/item/clothing/shoes/black(synd_mob), synd_mob.slot_shoes)
synd_mob.equip_if_possible(new /obj/item/clothing/suit/armor/vest(synd_mob), synd_mob.slot_wear_suit)
@@ -225,9 +229,10 @@
synd_mob.equip_if_possible(new /obj/item/ammo_magazine/a12mm(synd_mob), synd_mob.slot_in_backpack)
synd_mob.equip_if_possible(new /obj/item/weapon/reagent_containers/pill/cyanide(synd_mob), synd_mob.slot_in_backpack)
synd_mob.equip_if_possible(new /obj/item/weapon/gun/projectile/automatic/c20r(synd_mob), synd_mob.slot_belt)
var/obj/item/weapon/implant/explosive/E = new/obj/item/weapon/implant/explosive(synd_mob)
var/obj/item/weapon/implant/dexplosive/E = new/obj/item/weapon/implant/dexplosive(synd_mob)
E.imp_in = synd_mob
E.implanted = 1
return 1

View File

@@ -49,6 +49,7 @@
//When given the choice, people have been P2W
menu_message += "<A href='byond://?src=\ref[src];buy_item=sleepypen'>Sleepy Pen</A> (4)<BR>" //Terrible -Pete.
menu_message += "<BR>"
menu_message += "<A href='byond://?src=\ref[src];buy_item=imp_exp'>Explosive Implant (with injector)</A> (6)<BR>"
menu_message += "<A href='byond://?src=\ref[src];buy_item=detomatix'>Detomatix Cartridge</A> (3)<BR>"
menu_message += "<A href='byond://?src=\ref[src];buy_item=bomb'>Plastic Explosives</A> (2)<BR>"
menu_message += "<A href='byond://?src=\ref[src];buy_item=powersink'>Power Sink</A> (5)<BR>"
@@ -144,6 +145,13 @@
uses -= 10
var/obj/item/weapon/implanter/O = new /obj/item/weapon/implanter(get_turf(hostpda))
O.imp = new /obj/item/weapon/implant/uplink(O)
if("imp_exp")
if (src.uses >= 6)
src.uses -= 6
var/obj/item/weapon/implanter/O = new /obj/item/weapon/implanter(get_turf(hostpda))
O.imp = new /obj/item/weapon/implant/explosive(O)
O.name = "(BIO-HAZARD) BIO-detpack"
O.update()
if("sleepypen")
if (uses >= 4)
uses -= 4

View File

@@ -6,12 +6,12 @@
/obj/item/weapon/plastique/afterattack(atom/target as obj|turf, mob/user as mob, flag)
if (!flag)
return
if (istype(target, /turf/unsimulated) || istype(target, /turf/simulated/shuttle) || istype(target, /obj/item/weapon/storage/))
if (istype(target, /turf/unsimulated) || istype(target, /turf/simulated/shuttle) || istype(target, /obj/item/weapon/storage/) || ismob(target))
return
user << "Planting explosives..."
if(ismob(target))
/* if(ismob(target))
user.attack_log += "\[[time_stamp()]\] <font color='red'> [user.real_name] tried planting [name] on [target:real_name] ([target:ckey])</font>"
user.visible_message("\red [user.name] is trying to plant some kind of explosive on [target.name]!")
user.visible_message("\red [user.name] is trying to plant some kind of explosive on [target.name]!") */
if(do_after(user, 50) && in_range(user, target))
user.drop_item()
target = target

View File

@@ -45,8 +45,9 @@
implanted(mob/source as mob)
source.mind.store_memory("Uplink implant can be activated by using the [activation_emote] emote, <B>say *[activation_emote]</B> to attempt to activate.", 0, 0)
source << "The implanted uplink implant can be activated by using the [activation_emote] emote, <B>say *[activation_emote]</B> to attempt to activate."
activation_emote = input("Choose activation emote:") in list("blink", "blink_r", "eyebrow", "chuckle", "twitch_s", "frown", "nod", "blush", "giggle", "grin", "groan", "shrug", "smile", "pale", "sniff", "whimper", "wink")
source.mind.store_memory("Uplink implant can be activated by using the [src.activation_emote] emote, <B>say *[src.activation_emote]</B> to attempt to activate.", 0, 0)
source << "The implanted uplink implant can be activated by using the [src.activation_emote] emote, <B>say *[src.activation_emote]</B> to attempt to activate."
return
@@ -82,11 +83,15 @@ Implant Specifics:<BR>"}
return dat
/obj/item/weapon/implant/explosive
//Nuke Agent Explosive
/obj/item/weapon/implant/dexplosive
name = "explosive"
desc = "And boom goes the weasel."
var/activation_emote = "deathgasp"
var/coded = 0
New()
verbs += /obj/item/weapon/implant/dexplosive/proc/set_emote
get_data()
var/dat = {"
@@ -103,7 +108,7 @@ Implant Specifics:<BR>"}
trigger(emote, source as mob)
if(emote == "deathgasp")
if(emote == activation_emote)
src.activate("death")
return
@@ -114,6 +119,20 @@ Implant Specifics:<BR>"}
if(src.imp_in)
src.imp_in.gib()
proc/set_emote()
set name = "Set Emote"
set category = "Object"
set src in usr
if(coded != 0)
usr << "You've already set up your implant!"
return
activation_emote = input("Choose activation emote:") in list("deathgasp","blink", "blink_r", "eyebrow", "chuckle", "twitch_s", "frown", "nod", "blush", "giggle", "grin", "groan", "shrug", "smile", "pale", "sniff", "whimper", "wink")
usr.mind.store_memory("Explosive implant can be activated by using the [src.activation_emote] emote, <B>say *[src.activation_emote]</B> to attempt to activate.", 0, 0)
usr << "The implanted explosive implant can be activated by using the [src.activation_emote] emote, <B>say *[src.activation_emote]</B> to attempt to activate."
coded = 1
verbs -= /obj/item/weapon/implant/dexplosive/proc/set_emote
return
/obj/item/weapon/implant/chem
@@ -195,3 +214,40 @@ the implant may become unstable and either pre-maturely inject the subject or si
ticker.mode:remove_revolutionary(H.mind)
H << "\blue You feel a surge of loyalty towards NanoTrasen."
return
//BS12 Explosive
/obj/item/weapon/implant/explosive
name = "explosive"
desc = "And boom goes the weasel."
var/phrase = "die"
get_data()
var/dat = {"
<b>Implant Specifications:</b><BR>
<b>Name:</b> Robust Corp RX-78 Intimidation Class Implant<BR>
<b>Life:</b> Activates upon codephrase.<BR>
<b>Important Notes:</b> Explodes<BR>
<HR>
<b>Implant Details:</b><BR>
<b>Function:</b> Contains a compact, electrically detonated explosive that detonates upon receiving a specially encoded signal or upon host death.<BR>
<b>Special Features:</b> Explodes<BR>
<b>Integrity:</b> Implant will occasionally be degraded by the body's immune system and thus will occasionally malfunction."}
return dat
hear_talk(M as mob, var/msg)
if(findtext(msg,phrase))
if(istype(loc, /mob/))
var/mob/T = loc
T.gib()
explosion(find_loc(src), 1, 3, 4, 6, 3)
var/turf/t = find_loc(src)
if(t)
t.hotspot_expose(3500,125)
del(src)
implanted(mob/source as mob)
phrase = input("Choose activation phrase:") as text
usr.mind.store_memory("Explosive implant in [source] can be activated by saying something containing the phrase ''[src.phrase]'', <B>say [src.phrase]</B> to attempt to activate.", 0, 0)
usr << "The implanted explosive implant in [source] can be activated by saying something containing the phrase ''[src.phrase]'', <B>say [src.phrase]</B> to attempt to activate."

View File

@@ -79,7 +79,7 @@
/obj/item/weapon/implantcase/explosive
name = "Glass Case- 'Explosive'"
name = "Glass Case- '(BIO-HAZARD) BIO-detpack'"
desc = "A case containing an explosive implant."
icon = 'items.dmi'
icon_state = "implantcase-r"

View File

@@ -25,7 +25,30 @@
return
if (user && src.imp)
for (var/mob/O in viewers(M, null))
O.show_message("\red [M] has been implanted by [user].", 1)
if (M != user)
O.show_message(text("\red <B>[] is trying to implant [] with [src.name]!</B>", user, M), 1)
else
O.show_message("\red <B>[user] is trying to inject themselves with [src.name]!</B>", 1)
if(!do_mob(user, M,60)) return
if(istype(M, /mob/living/carbon/human))
var/picked = 0
var/mob/living/carbon/human/T = M
var/list/datum/organ/external/E = T.organs
while(picked == 0 && E.len > 0)
var/datum/organ/external/O = pick(E)
E -= O
if(!E.implant)
O.implant = src.imp
picked = 1
if(picked == 0)
for (var/mob/O in viewers(M, null))
O.show_message(text("[user.name] can't find anywhere to implant [M.name]"), 1)
return
for (var/mob/O in viewers(M, null))
if (M != user)
O.show_message(text("\red [] implants [] with [src.name]!", user, M), 1)
else
O.show_message("\red [user] implants themself with [src.name]!", 1)
M.attack_log += text("\[[time_stamp()]\] <font color='orange'> Implanted with [src.name] ([src.imp.name]) by [user.name] ([user.ckey])</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [src.name] ([src.imp.name]) to implant [M.name] ([M.ckey])</font>")
src.imp.loc = M
@@ -33,7 +56,6 @@
src.imp.implanted = 1
src.imp.implanted(M)
src.imp = null
user.show_message("\red You implanted the implant into [M].")
src.icon_state = "implanter0"
return

View File

@@ -33,6 +33,7 @@
implanted(mob/source as mob)
activation_emote = input("Choose activation emote:") in list("blink", "blink_r", "eyebrow", "chuckle", "twitch_s", "frown", "nod", "blush", "giggle", "grin", "groan", "shrug", "smile", "pale", "sniff", "whimper", "wink")
source.mind.store_memory("Freedom implant can be activated by using the [src.activation_emote] emote, <B>say *[src.activation_emote]</B> to attempt to activate.", 0, 0)
source << "The implanted freedom implant can be activated by using the [src.activation_emote] emote, <B>say *[src.activation_emote]</B> to attempt to activate."
return

View File

@@ -48,9 +48,9 @@ SYNDICATE UPLINK
dat += "<BR>"
dat += "<A href='byond://?src=\ref[src];buy_item=imp_freedom'>Freedom Implant (with injector)</A> (3)<BR>"
// dat += "<A href='byond://?src=\ref[src];buy_item=paralysispen'>Paralysis Pen</A> (3)<BR>" //Note that this goes to the updated sleepypen now.
dat += "<A href='byond://?src=\ref[src];buy_item=sleepypen'>Sleepy Pen</A> (4)<BR>" //Terrible -Pete. //Reinstated -Skymarshal
dat += "<BR>"
dat += "<A href='byond://?src=\ref[src];buy_item=imp_exp'>Explosive Implant (with injector)</A> (6)<BR>"
dat += "<A href='byond://?src=\ref[src];buy_item=detomatix'>Detomatix Cartridge</A> (3)<BR>"
dat += "<A href='byond://?src=\ref[src];buy_item=bomb'>Plastic Explosives</A> (2)<BR>"
dat += "<A href='byond://?src=\ref[src];buy_item=powersink'>Power Sink</A> (5)<BR>"
@@ -133,6 +133,13 @@ SYNDICATE UPLINK
src.uses -= 3
var/obj/item/weapon/implanter/O = new /obj/item/weapon/implanter(get_turf(src))
O.imp = new /obj/item/weapon/implant/freedom(O)
if("imp_exp")
if (src.uses >= 6)
src.uses -= 6
var/obj/item/weapon/implanter/O = new /obj/item/weapon/implanter(get_turf(src))
O.imp = new /obj/item/weapon/implant/explosive(O)
O.name = "(BIO-HAZARD) BIO-detpack"
O.update()
if("sleepypen")
if (src.uses >= 4)
src.uses -= 4

View File

@@ -259,6 +259,8 @@
freq_text = "Mining"
if(1347)
freq_text = "Cargo"
if(connection.frequency == NUKE_FREQ)
freq_text = "Agent"
//There's probably a way to use the list var of channels in code\game\communications.dm to make the dept channels non-hardcoded, but I wasn't in an experimentive mood. --NEO
if(!freq_text)
@@ -269,6 +271,8 @@
if (display_freq==SYND_FREQ)
part_a = "<span class='syndradio'><span class='name'>"
if (display_freq==NUKE_FREQ)
part_a = "<span class='nukeradio'><span class='name'>"
else if (display_freq==COMM_FREQ)
part_a = "<span class='comradio'><span class='name'>"
else if (display_freq in DEPT_FREQS)
@@ -408,9 +412,7 @@
hear+=M
return hear
/obj/item/device/radio/proc/borg(mob/user as mob, op)
if(!(issilicon(user)))
return
/obj/item/device/radio/proc/config(op)
for (var/ch_name in channels)
radio_controller.remove_object(src, radiochannels[ch_name])
secure_radio_connections = new

View File

@@ -15,6 +15,9 @@
if(src.stat == 2.0 && (act != "deathgasp"))
return
if(src.stat != 2.0 && act == "deathgasp" && !src.mind.special_role == "Syndicate")
src << "You are not dead. No."
return
switch(act)
if ("airguitar")
if (!src.restrained())
@@ -461,6 +464,18 @@
message = "<B>[src]</B> makes a very loud noise."
m_type = 2
if ("hungry")
if(prob(1))
message = "<B>Blue Elf</B> needs food Badly."
else
message = "<B>[src]'s</B> stomach growls."
if ("thirsty")
if(prob(1))
message = "<B>[src]</B> cancels destory station: Drinking."
else
message = "<B>[src]</B> looks thirsty."
if ("help")
src << "blink, blink_r, blush, bow-(none)/mob, burp, choke, chuckle, clap, collapse, cough,\ncry, custom, deathgasp, drool, eyebrow, frown, gasp, giggle, groan, grumble, handshake, hug-(none)/mob, glare-(none)/mob,\ngrin, laugh, look-(none)/mob, moan, mumble, nod, pale, point-atom, raise, salute, shake, shiver, shrug,\nsigh, signal-#1-10, smile, sneeze, sniff, snore, stare-(none)/mob, tremble, twitch, twitch_s, whimper,\nwink, yawn"

View File

@@ -318,6 +318,13 @@
for (var/mob/M in W)
W |= M.contents
if(ishuman(M))
var/mob/living/carbon/human/G = M
for(var/datum/organ/external/F in G.organs)
W |= F.implant
for (var/obj/item/device/pda/M in W)
W |= M.contents
for (var/obj/O in W) //radio in pocket could work, radio in backpack wouldn't --rastaf0
spawn (0)

View File

@@ -142,7 +142,7 @@
channels = list()
overlays -= "eyes" //Takes off the eyes that it started with
radio.borg(src, channels)
radio.config(channels)
updateicon()
/mob/living/silicon/robot/verb/cmd_robot_alerts()
@@ -959,7 +959,7 @@ Frequency:
icon_state = "robot"
updateicon()
channels = list()
radio.borg(src, channels)
radio.config(channels)
uneq_all()
del(module)

View File

@@ -29,6 +29,7 @@
max_damage = 0
wound_size = 0
max_size = 0
var/obj/item/weapon/implant/implant = null
proc/take_damage(brute, burn)

View File

@@ -0,0 +1,223 @@
//conveyor2 is pretty much like the original, except it supports corners, but not diverters.
//note that corner pieces transfer stuff clockwise when running forward, and anti-clockwise backwards.
/obj/machinery/conveyor
icon = 'recycling.dmi'
icon_state = "conveyor0"
name = "conveyor belt"
desc = "A conveyor belt."
anchored = 1
var/operating = 0 // 1 if running forward, -1 if backwards, 0 if off
var/operable = 1 // true if can operate (no broken segments in this belt run)
var/forwards // this is the default (forward) direction, set by the map dir
var/backwards // hopefully self-explanatory
var/movedir // the actual direction to move stuff in
var/list/affecting // the list of all items that will be moved this ptick
var/id = "" // the control ID - must match controller ID
// create a conveyor
/obj/machinery/conveyor/New()
..()
switch(dir)
if(NORTH)
forwards = NORTH
backwards = SOUTH
if(SOUTH)
forwards = SOUTH
backwards = NORTH
if(EAST)
forwards = EAST
backwards = WEST
if(WEST)
forwards = WEST
backwards = EAST
if(NORTHEAST)
forwards = EAST
backwards = SOUTH
if(NORTHWEST)
forwards = SOUTH
backwards = WEST
if(SOUTHEAST)
forwards = NORTH
backwards = EAST
if(SOUTHWEST)
forwards = WEST
backwards = NORTH
/obj/machinery/conveyor/proc/setmove()
if(operating == 1)
movedir = forwards
else
movedir = backwards
update()
/obj/machinery/conveyor/proc/update()
if(stat & BROKEN)
icon_state = "conveyor-broken"
operating = 0
return
if(!operable)
operating = 0
if(stat & NOPOWER)
operating = 0
icon_state = "conveyor[operating]"
// machine process
// move items to the target location
/obj/machinery/conveyor/process()
if(stat & (BROKEN | NOPOWER))
return
if(!operating)
return
use_power(100)
affecting = loc.contents - src // moved items will be all in loc
spawn(1) // slight delay to prevent infinite propagation due to map order
var/items_moved = 0
for(var/atom/movable/A in affecting)
if(!A.anchored)
if(isturf(A.loc)) // this is to prevent an ugly bug that forces a player to drop what they're holding if they recently pick it up from the conveyer belt
step(A,movedir)
items_moved++
if(items_moved >= 10)
break
// attack with item, place item on conveyor
/obj/machinery/conveyor/attackby(var/obj/item/I, mob/user)
user.drop_item()
if(I && I.loc) I.loc = src.loc
return
// attack with hand, move pulled object onto conveyor
/obj/machinery/conveyor/attack_hand(mob/user as mob)
if ((!( user.canmove ) || user.restrained() || !( user.pulling )))
return
if (user.pulling.anchored)
return
if ((user.pulling.loc != user.loc && get_dist(user, user.pulling) > 1))
return
if (ismob(user.pulling))
var/mob/M = user.pulling
M.pulling = null
step(user.pulling, get_dir(user.pulling.loc, src))
user.pulling = null
else
step(user.pulling, get_dir(user.pulling.loc, src))
user.pulling = null
return
// make the conveyor broken
// also propagate inoperability to any connected conveyor with the same ID
/obj/machinery/conveyor/proc/broken()
stat |= BROKEN
update()
var/obj/machinery/conveyor/C = locate() in get_step(src, dir)
if(C)
C.set_operable(dir, id, 0)
C = locate() in get_step(src, turn(dir,180))
if(C)
C.set_operable(turn(dir,180), id, 0)
//set the operable var if ID matches, propagating in the given direction
/obj/machinery/conveyor/proc/set_operable(stepdir, match_id, op)
if(id != match_id)
return
operable = op
update()
var/obj/machinery/conveyor/C = locate() in get_step(src, stepdir)
if(C)
C.set_operable(stepdir, id, op)
/*
/obj/machinery/conveyor/verb/destroy()
set src in view()
src.broken()
*/
/obj/machinery/conveyor/power_change()
..()
update()
// the conveyor control switch
//
//
/obj/machinery/conveyor_switch
name = "conveyor switch"
desc = "A conveyor control switch."
icon = 'recycling.dmi'
icon_state = "switch-off"
var/position = 0 // 0 off, -1 reverse, 1 forward
var/last_pos = -1 // last direction setting
var/operated = 1 // true if just operated
var/id = "" // must match conveyor IDs to control them
var/list/conveyors // the list of converyors that are controlled by this switch
anchored = 1
/obj/machinery/conveyor_switch/New()
..()
update()
spawn(5) // allow map load
conveyors = list()
for(var/obj/machinery/conveyor/C in world)
if(C.id == id)
conveyors += C
// update the icon depending on the position
/obj/machinery/conveyor_switch/proc/update()
if(position<0)
icon_state = "switch-rev"
else if(position>0)
icon_state = "switch-fwd"
else
icon_state = "switch-off"
// timed process
// if the switch changed, update the linked conveyors
/obj/machinery/conveyor_switch/process()
if(!operated)
return
operated = 0
for(var/obj/machinery/conveyor/C in conveyors)
C.operating = position
C.setmove()
// attack with hand, switch position
/obj/machinery/conveyor_switch/attack_hand(mob/user)
if(position == 0)
if(last_pos < 0)
position = 1
last_pos = 0
else
position = -1
last_pos = 0
else
last_pos = position
position = 0
operated = 1
update()
// find any switches with same id as this one, and set their positions to match us
for(var/obj/machinery/conveyor_switch/S in world)
if(S.id == src.id)
S.position = position
S.update()

View File

@@ -102,6 +102,11 @@ h1, h2, h3, h4, h5, h6
color: #6D3F40;
}
.nukeradio
{
color: #FF3300;
}
.alert
{
color: #ff0000;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

File diff suppressed because it is too large Load Diff