Merge pull request #510 from Markolie/master

Syndicate teleporter fix, fix fire alarm in engineering that gets EMP'ed
This commit is contained in:
Fox-McCloud
2014-11-22 11:24:34 -05:00
9 changed files with 153 additions and 48 deletions
+2
View File
@@ -9,6 +9,7 @@
anchored = 1
use_power = 1
idle_power_usage = 0
var/syndicate = 0
var/obj/item/device/radio/beacon/Beacon
New()
@@ -17,6 +18,7 @@
Beacon = new /obj/item/device/radio/beacon
Beacon.invisibility = INVISIBILITY_MAXIMUM
Beacon.loc = T
Beacon.syndicate = syndicate
hide(T.intact)
+3 -4
View File
@@ -12,7 +12,6 @@
var/list/tempnets[0]
var/list/data[0]
var/list/access[0]
var/emag = 0
New() // Lists existing networks and their required access. Format: networks[<name>] = list(<access>)
networks["SS13"] = list(access_hos,access_captain)
@@ -53,10 +52,10 @@
attackby(I as obj, user as mob)
if(istype(I,/obj/item/weapon/card/emag)) // If hit by an emag.
var/obj/item/weapon/card/emag/E = I
if(!emag)
if(!emagged)
if(E.uses)
E.uses--
emag = 1
emagged = 1
user << "\blue You have authorized full network access!"
ui_interact(user)
else
@@ -78,7 +77,7 @@
data.Cut()
tempnets.Cut()
if(emag)
if(emagged)
access = list(access_captain) // Assume captain level access when emagged
data["emagged"] = 1
if(isAI(user))
@@ -12,6 +12,10 @@
var/list/req_components = null
var/list/req_component_names = null // user-friendly names of components
var/state = 1
// For pods
var/list/connected_parts = list()
var/pattern_idx=0
// unfortunately, we have to instance the objects really quickly to get the names
// fortunately, this is only called once when the board is added and the items are immediately GC'd
@@ -26,6 +30,47 @@
var/obj/O = new path()
req_component_names[tname] = O.name
/obj/machinery/constructable_frame/proc/find_square()
// This is fucking stupid but what the hell.
// This corresponds to indicies from alldirs.
// 1 2 3 4 5 6 7 8
// var/list/alldirs = list(NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST)
var/valid_patterns=list(
list(1,3,5), //SW - NORTH,EAST,NORTHEAST
list(2,3,7), //NW - SOUTH,EAST,SOUTHEAST
list(1,4,6), //SE - NORTH,WEST,NORTHWEST
list(2,4,8) //NE - SOUTH,WEST,SOUTHWEST
)
var/detected_parts[8]
var/tally=0
var/turf/T
var/obj/machinery/constructable_frame/machine_frame/friend
for(var/i=1;i<=8;i++)
T=get_step(src.loc,alldirs[i])
friend = locate() in T
if(friend)
detected_parts[i]=friend
tally++
// Need at least 3 connections to make a square
if(tally<3)
return
// Find stuff in the patterns indicated
for(var/i=1;i<=4;i++)
var/list/scanidxs=valid_patterns[i]
var/list/new_connected=list()
var/allfound=1
for(var/diridx in scanidxs)
if(detected_parts[diridx]==null)
allfound=0
break
new_connected.Add(detected_parts[diridx])
if(allfound)
connected_parts=new_connected
pattern_idx=i
return 1
return 0
// update description of required components remaining
/obj/machinery/constructable_frame/proc/update_req_desc()
if(!req_components || !req_component_names)
@@ -78,6 +123,35 @@
new /obj/structure/displaycase_frame(src.loc)
del(src)
return
else if(istype(P, /obj/item/stack/rods))
var/obj/item/stack/rods/R=P
if(R.amount<10)
user << "\red You need 10 rods to assemble a pod frame."
return
if(!find_square())
user << "\red You cannot assemble a pod frame without a 2x2 square of machine frames."
return
R.use(10)
for(var/obj/machinery/constructable_frame/machine_frame/F in connected_parts)
qdel(F)
var/turf/T=get_turf(src)
// Offset frame (if needed) so it doesn't look wonky when it spawns.
switch(pattern_idx)
if(2)
T=get_step(T,SOUTH)
if(3)
T=get_step(T,WEST)
if(4)
T=get_step(T,SOUTHWEST)
new /obj/structure/spacepod_frame(T)
user << "\blue You assemble the pod frame."
playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, 1)
qdel(src)
return
if(istype(P, /obj/item/weapon/wrench))
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
user << "<span class='notice'>You dismantle the frame.</span>"
+12 -2
View File
@@ -31,7 +31,16 @@
return power_station
/obj/machinery/computer/teleporter/attackby(I as obj, mob/living/user as mob)
if(istype(I, /obj/item/device/sps))
if(istype(I,/obj/item/weapon/card/emag)) // If hit by an emag.
var/obj/item/weapon/card/emag/E = I
if(!emagged)
if(E.uses)
E.uses--
emagged = 1
user << "\blue The teleporter can now lock on to Syndicate beacons!"
else
ui_interact(user)
else if(istype(I, /obj/item/device/sps))
var/obj/item/device/sps/L = I
if(L.locked_location && !(stat & (NOPOWER|BROKEN)))
user.before_take_item(L)
@@ -172,6 +181,8 @@
continue
if(T.z == 2 || T.z > 7)
continue
if(R.syndicate == 1 && emagged == 0)
continue
var/tmpname = T.loc.name
if(areaindex[tmpname])
tmpname = "[tmpname] ([++areaindex[tmpname]])"
@@ -330,7 +341,6 @@
component_parts += new /obj/item/weapon/stock_parts/matter_bin/super(null)
RefreshParts()
/obj/machinery/teleport/station
name = "station"
desc = "The power control station for a bluespace teleporter."
@@ -5,7 +5,19 @@
item_state = "signaler"
var/code = "electronic"
origin_tech = "bluespace=1"
var/emagged = 0
var/syndicate = 0
/obj/item/device/radio/beacon/attackby(I as obj, mob/living/user as mob)
if(istype(I,/obj/item/weapon/card/emag)) // If hit by an emag.
var/obj/item/weapon/card/emag/E = I
if(!emagged)
if(E.uses)
E.uses--
emagged = 1
syndicate = 1
user << "\blue The This beacon now only be locked on to by emagged teleporters!"
/obj/item/device/radio/beacon/hear_talk()
return
@@ -39,6 +51,7 @@
name = "suspicious beacon"
desc = "A label on it reads: <i>Activate to have a singularity beacon teleported to your location</i>."
origin_tech = "bluespace=1;syndicate=7"
syndicate = 1
/obj/item/device/radio/beacon/syndicate/attack_self(mob/user as mob)
if(user)
@@ -64,7 +77,7 @@
/obj/item/device/telepad_beacon
name = "Telepad Beacon"
desc = "Use to warp in a cargo telepad."
desc = "Used to warp in a cargo telepad."
icon = 'icons/obj/radio.dmi'
icon_state = "beacon"
item_state = "signaler"
@@ -21,9 +21,9 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
var/broadcasting = 0
var/listening = 1
var/freerange = 0 // 0 - Sanitize frequencies, 1 - Full range
var/list/channels = list() //see communications.dm for full list. First channes is a "default" for :h
var/list/channels = list() //see communications.dm for full list. First channels is a "default" for :h
var/subspace_transmission = 0
var/syndie = 0//Holder to see if it's a syndicate encrpyed radio
var/syndie = 0//Holder to see if it's a syndicate encrypted radio
var/maxf = 1499
// "Example" = FREQ_LISTENING|FREQ_BROADCASTING
flags = FPRINT | CONDUCT | TABLEPASS