Merge pull request #182 from Tastyfish/master

Toggle-Deny-Shuttle, can build fire alarms, atmos alarms, status displays and light switches
This commit is contained in:
Albert Iordache
2011-12-31 11:38:31 -08:00
11 changed files with 284 additions and 4 deletions
@@ -0,0 +1,215 @@
// a frame for generic wall-mounted things, such as fire alarm, status display..
// combination of apc_frame and machine_frame
/obj/machinery/constructable_frame/wallmount_frame
icon = 'stock_parts.dmi'
icon_state = "wm_0"
var/wall_offset = 24
density = 0
/obj/machinery/constructable_frame/wallmount_frame/New()
spawn(1)
if (!istype(loc, /turf/simulated/floor))
usr << "\red [name] cannot be placed on this spot."
new/obj/item/stack/sheet/metal(get_turf(src), 2)
del(src)
return
var/turf/obj_ofs = get_step(locate(2,2,1), dir)
pixel_x = (obj_ofs.x - 2) * wall_offset
pixel_y = (obj_ofs.y - 2) * wall_offset
var/turf/T = get_step(usr, dir)
if(!istype(T, /turf/simulated/wall))
usr << "\red [name] must be placed on a wall."
new/obj/item/stack/sheet/metal(get_turf(src), 2)
del(src)
return
dir = get_dir(T, loc)
/obj/machinery/constructable_frame/wallmount_frame/attackby(obj/item/P as obj, mob/user as mob)
if(P.crit_fail)
user << "\red This part is faulty, you cannot add this to the machine!"
return
switch(state)
if(1)
if(istype(P, /obj/item/weapon/cable_coil))
if(P:amount >= 5)
playsound(src.loc, 'Deconstruct.ogg', 50, 1)
user << "\blue You start to add cables to the frame."
if(do_after(user, 20))
P:amount -= 5
if(!P:amount) del(P)
user << "\blue You add cables to the frame."
state = 2
icon_state = "wm_1"
if(istype(P, /obj/item/weapon/wrench))
playsound(src.loc, 'Ratchet.ogg', 75, 1)
user << "\blue You dismantle the frame"
new /obj/item/stack/sheet/metal(src.loc, 2)
del(src)
if(2)
if(istype(P, /obj/item/weapon/circuitboard))
var/obj/item/weapon/circuitboard/B = P
if(B.board_type == "wallmount")
playsound(src.loc, 'Deconstruct.ogg', 50, 1)
user << "\blue You add the circuit board to the frame."
circuit = P
user.drop_item()
P.loc = src
icon_state = "wm_2"
state = 3
components = list()
req_components = circuit.req_components.Copy()
for(var/A in circuit.req_components)
req_components[A] = circuit.req_components[A]
if(circuit.frame_desc) desc = circuit.frame_desc
else
user << "\red This frame does not accept circuit boards of this type!"
if(istype(P, /obj/item/weapon/wirecutters))
playsound(src.loc, 'wirecutter.ogg', 50, 1)
user << "\blue You remove the cables."
state = 1
icon_state = "wm_0"
var/obj/item/weapon/cable_coil/A = new /obj/item/weapon/cable_coil( src.loc )
A.amount = 5
if(3)
if(istype(P, /obj/item/weapon/crowbar))
playsound(src.loc, 'Crowbar.ogg', 50, 1)
state = 2
circuit.loc = src.loc
circuit = null
if(components.len == 0)
user << "\blue You remove the circuit board."
else
user << "\blue You remove the circuit board and other components."
for(var/obj/item/weapon/W in components)
W.loc = src.loc
desc = initial(desc)
req_components = null
components = null
icon_state = "wm_1"
if(istype(P, /obj/item/weapon/screwdriver))
var/component_check = 1
for(var/R in req_components)
if(req_components[R] > 0)
component_check = 0
break
if(component_check)
playsound(src.loc, 'Screwdriver.ogg', 50, 1)
var/obj/machinery/new_machine = new src.circuit.build_path(src.loc)
new_machine.dir = dir
if(istype(circuit, /obj/item/weapon/circuitboard/status_display))
new_machine.pixel_x = pixel_x * 1.33
new_machine.pixel_y = pixel_y * 1.33
else
new_machine.pixel_x = pixel_x
new_machine.pixel_y = pixel_y
for(var/obj/O in new_machine.component_parts)
del(O)
new_machine.component_parts = list()
for(var/obj/O in src)
if(circuit.contain_parts) // things like disposal don't want their parts in them
O.loc = new_machine
else
O.loc = null
new_machine.component_parts += O
if(circuit.contain_parts)
circuit.loc = new_machine
else
circuit.loc = null
new_machine.RefreshParts()
del(src)
if(istype(P, /obj/item/weapon))
for(var/I in req_components)
if(istype(P, text2path(I)) && (req_components[I] > 0))
if(istype(P, /obj/item/weapon/cable_coil))
var/obj/item/weapon/cable_coil/CP = P
if(CP.amount > 1)
var/obj/item/weapon/cable_coil/CC = new /obj/item/weapon/cable_coil(src)
CC.amount = 1
components += CC
req_components[I]--
break
user.drop_item()
P.loc = src
components += P
req_components[I]--
break
if(P.loc != src && !istype(P, /obj/item/weapon/cable_coil))
user << "\red You cannot add that component to the machine!"
/obj/item/weapon/circuitboard/firealarm
name = "Circuit board (Fire Alarm)"
build_path = "/obj/machinery/firealarm"
board_type = "wallmount"
origin_tech = "engineering=2"
frame_desc = "Requires 1 Scanning Module, 1 Capacitor, and 2 pieces of cable."
contain_parts = 0
req_components = list(
"/obj/item/weapon/stock_parts/scanning_module" = 1,
"/obj/item/weapon/stock_parts/capacitor" = 1,
"/obj/item/weapon/cable_coil" = 2)
/obj/item/weapon/circuitboard/alarm
name = "Circuit board (Atmospheric Alarm)"
build_path = "/obj/machinery/alarm"
board_type = "wallmount"
origin_tech = "engineering=2;programming=2"
frame_desc = "Requires 1 Scanning Module, 1 Console Screen, and 2 pieces of cable."
contain_parts = 0
req_components = list(
"/obj/item/weapon/stock_parts/scanning_module" = 1,
"/obj/item/weapon/stock_parts/console_screen" = 1,
"/obj/item/weapon/cable_coil" = 2)
/* oh right, not a machine :(
/obj/item/weapon/circuitboard/intercom
name = "Circuit board (Intercom)"
build_path = "/obj/item/device/radio/intercom"
board_type = "wallmount"
origin_tech = "engineering=2"
frame_desc = "Requires 1 Console Screen, and 2 piece of cable."
contain_parts = 0
req_components = list(
"/obj/item/weapon/stock_parts/console_screen" = 1,
"/obj/item/weapon/cable_coil" = 2)
*/
/* too complex to set up the dept for an RC in a way intuitive for the user
/obj/item/weapon/circuitboard/requests_console
name = "Circuit board (Requests Console)"
build_path = "/obj/machinery/requests_console"
board_type = "wallmount"
origin_tech = "engineering=2;programming=2"
frame_desc = "Requires 1 radio, 1 Console Screen, and 1 piece of cable."
contain_parts = 0
req_components = list(
"/obj/item/device/radio" = 1,
"/obj/item/weapon/stock_parts/console_screen" = 1
"/obj/item/weapon/cable_coil" = 1)
*/
/obj/item/weapon/circuitboard/status_display
name = "Circuit board (Status Display)"
build_path = "/obj/machinery/status_display"
board_type = "wallmount"
origin_tech = "engineering=2,programming=2"
frame_desc = "Requires 2 Console Screens, and 1 piece of cable."
contain_parts = 0
req_components = list(
"/obj/item/weapon/stock_parts/console_screen" = 2,
"/obj/item/weapon/cable_coil" = 1)
/obj/item/weapon/circuitboard/light_switch
name = "Circuit board (Light Switch)"
build_path = "/obj/machinery/light_switch"
board_type = "wallmount"
origin_tech = "engineering=2"
frame_desc = "Requires 2 pieces of cable."
contain_parts = 0
req_components = list(
"/obj/item/weapon/cable_coil" = 2)
+4 -1
View File
@@ -18,12 +18,15 @@ datum/shuttle_controller
timelimit //important when the shuttle gets called for more than shuttlearrivetime
//timeleft = 360 //600
fake_recall = 0 //Used in rounds to prevent "ON NOES, IT MUST [INSERT ROUND] BECAUSE SHUTTLE CAN'T BE CALLED"
deny_shuttle = 0 //for admins not allowing it to be called.
// call the shuttle
// if not called before, set the endtime to T+600 seconds
// otherwise if outgoing, switch to incoming
proc/incall(coeff = 1)
if(deny_shuttle)
return
if(endtime)
if(direction == -1)
setdirection(1)
@@ -379,6 +379,10 @@
if ((!( ticker ) || emergency_shuttle.location))
return
if(emergency_shuttle.deny_shuttle)
user << "Centcom does not currently have a shuttle available in your sector. Please try again later."
return
if(sent_strike_team == 1)
user << "Centcom will not allow the shuttle to be called. Consider all contracts terminated."
return
+1 -1
View File
@@ -252,4 +252,4 @@ obj/item/weapon/circuitboard/rdserver
"/obj/item/weapon/stock_parts/matter_bin" = 1,
"/obj/item/weapon/cable_coil" = 1)
m_amt = 50
g_amt = 50
g_amt = 50
+2 -1
View File
@@ -73,14 +73,15 @@ var/global/list/datum/stack_recipe/metal_recipes = list ( \
new/datum/stack_recipe("wall girders", /obj/structure/girder, 2, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("airlock assembly", /obj/structure/door_assembly, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("machine frame", /obj/machinery/constructable_frame/machine_frame, 5, one_per_turf = 1), \
new/datum/stack_recipe("wall machine frame", /obj/machinery/constructable_frame/wallmount_frame, 2, one_per_turf = 1), \
new/datum/stack_recipe("turret frame", /obj/machinery/porta_turret_construct, 5, one_per_turf = 1), \
null, \
new/datum/stack_recipe("apc frame", /obj/item/apc_frame, 2), \
new/datum/stack_recipe("tube light frame", /obj/structure/light_frame), \
new/datum/stack_recipe("small light frame", /obj/structure/light_frame/small), \
new/datum/stack_recipe("table lamp frame", /obj/structure/light_frame/lamp), \
new/datum/stack_recipe("grenade casing", /obj/item/weapon/chem_grenade), \
null, \
new/datum/stack_recipe("grenade casing", /obj/item/weapon/chem_grenade), \
new/datum/stack_recipe("iron door", /obj/structure/mineral_door/iron, 20), \
)
+2
View File
@@ -209,6 +209,7 @@
verbs += /client/proc/cmd_admin_remove_plasma
verbs += /client/proc/admin_call_shuttle
verbs += /client/proc/admin_cancel_shuttle
verbs += /client/proc/admin_deny_shuttle
verbs += /obj/admins/proc/show_traitor_panel
verbs += /client/proc/cmd_admin_dress
verbs += /client/proc/cmd_admin_christmas
@@ -346,6 +347,7 @@
verbs -= /client/proc/cmd_admin_remove_plasma
verbs -= /client/proc/admin_call_shuttle
verbs -= /client/proc/admin_cancel_shuttle
verbs -= /client/proc/admin_deny_shuttle
verbs -= /obj/admins/proc/show_traitor_panel
verbs -= /client/proc/cmd_admin_dress
verbs -= /client/proc/cmd_admin_christmas
+2
View File
@@ -11,9 +11,11 @@
if(!input || input == "")
custom_event_msg = null
log_admin("[usr.key] has cleared the custom event text.")
message_admins("[key_name_admin(usr)] has cleared the custom event text.")
return
log_admin("[usr.key] has changed the custom event text.")
message_admins("[key_name_admin(usr)] has changed the custom event text.")
custom_event_msg = input
+16
View File
@@ -789,6 +789,22 @@ Traitors and the like can also be revived with the previous role mostly intact.
return
/client/proc/admin_deny_shuttle()
set category = "Admin"
set name = "Toggle Deny Shuttle"
if (!ticker)
return
if (!holder)
src << "Only administrators may use this command."
return
emergency_shuttle.deny_shuttle = !emergency_shuttle.deny_shuttle
log_admin("[key_name(src)] has [emergency_shuttle.deny_shuttle ? "denied" : "allowed"] the shuttle to be called.")
message_admins("[key_name_admin(usr)] has [emergency_shuttle.deny_shuttle ? "denied" : "allowed"] the shuttle to be called.")
/client/proc/cmd_admin_attack_log(mob/M as mob in world)
set category = "Special Verbs"
set name = "Attack Log"
+37 -1
View File
@@ -339,6 +339,42 @@ datum
materials = list("$glass" = 2000, "acid" = 20)
build_path = "/obj/item/weapon/circuitboard/mining"
firealarm
name = "Circuit Design (Fire Alarm)"
desc = "Allows for the construction of circuit boards used to build fire alarms."
id = "firealarm"
req_tech = list("engineering" = 2)
build_type = IMPRINTER
materials = list("$glass" = 2000, "acid" = 20)
build_path = "/obj/item/weapon/circuitboard/firealarm"
alarm
name = "Circuit Design (Atmospheric Alarm)"
desc = "Allows for the construction of circuit boards used to build atmos alarms."
id = "alarm"
req_tech = list("engineering" = 2, "programming" = 2)
build_type = IMPRINTER
materials = list("$glass" = 2000, "acid" = 20)
build_path = "/obj/item/weapon/circuitboard/alarm"
status_display
name = "Circuit Design (Status Display)"
desc = "Allows for the construction of circuit boards used to build status displays."
id = "status_display"
req_tech = list("engineering" = 2, "programming" = 2)
build_type = IMPRINTER
materials = list("$glass" = 2000, "acid" = 20)
build_path = "/obj/item/weapon/circuitboard/status_display"
light_switch
name = "Circuit Design (Light Switch)"
desc = "Allows for the construction of circuit boards used to build light switches."
id = "status_display"
req_tech = list("engineering" = 2)
build_type = IMPRINTER
materials = list("$glass" = 2000, "acid" = 20)
build_path = "/obj/item/weapon/circuitboard/light_switch"
///////////////////////////////////
//////////AI Module Disks//////////
///////////////////////////////////
@@ -1104,7 +1140,7 @@ datum
req_tech = list("combat" = 4, "materials" = 5, "engineering" = 3, "biotech" = 4, "syndicate" = 3)
build_type = PROTOLATHE
materials = list("$metal" = 5000, "$glass" = 1000, "$uranium" = 1000, "$silver" = 1000)
build_path = "/obj/item/weapon/gun/energy/largecrossbow"
build_path = "/obj/item/weapon/gun/energy/crossbow/largecrossbow"
temp_gun
name = "Temperature Gun"