Merge pull request #160 from Tastyfish/master

improved lobby/pregame music code, buildable lights!, AI not forced, doors
This commit is contained in:
Albert Iordache
2011-12-28 00:30:31 -08:00
10 changed files with 181 additions and 22 deletions
+5 -1
View File
@@ -103,6 +103,10 @@ var/global/datum/controller/occupations/job_master
proc/FillAIPosition()
// this now only forces AI if malf mode
if(ticker.mode.name != "AI malfunction")
return
var/ai_selected = 0
var/datum/job/job = GetJob("AI")
if(!job) return 0
@@ -167,7 +171,7 @@ var/global/datum/controller/occupations/job_master
FillHeadPosition()
Debug("DO, Head Check end")
//Check for an AI
//Check for an AI, now purely just for malf mode
Debug("DO, Running AI Check")
FillAIPosition()
Debug("DO, AI Check end")
@@ -12,6 +12,8 @@
list/conf_access = null
last_configurator = null
locked = 1
style_name = "General"
style = /obj/structure/door_assembly/door_assembly_0
attack_self(mob/user as mob)
if (!ishuman(user))
@@ -32,6 +34,8 @@
else
t1 += "<a href='?src=\ref[src];logout=1'>Block</a><hr>"
t1 += "Style: <a href='?src=\ref[src];style=1'>[style_name]</a><br><br>"
t1 += conf_access == null ? "<font color=red>All</font><br>" : "<a href='?src=\ref[src];access=all'>All</a><br>"
@@ -80,6 +84,28 @@
if (href_list["access"])
toggle_access(href_list["access"])
if (href_list["style"])
style_name = input("Select the door's paint scheme.", "Door Style", style_name) in \
list("General", "Command", "Security", "Engineering", "Medical", "Maintenance", "Airlock", "Freezer")
switch(style_name)
if("General")
style = /obj/structure/door_assembly/door_assembly_0
if("Command")
style = /obj/structure/door_assembly/door_assembly_com
if("Security")
style = /obj/structure/door_assembly/door_assembly_sec
if("Engineering")
style = /obj/structure/door_assembly/door_assembly_eng
if("Medical")
style = /obj/structure/door_assembly/door_assembly_med
if("Maintenance")
style = /obj/structure/door_assembly/door_assembly_mai
if("Airlock")
style = /obj/structure/door_assembly/door_assembly_ext
if("Freezer")
style = /obj/structure/door_assembly/door_assembly_fre
attack_self(usr)
proc
+24 -8
View File
@@ -87,6 +87,7 @@ obj/structure/door_assembly
door_assembly_mai
name = "Maintenance Airlock Assembly"
icon_state = "door_as_mai1"
glass_type = null
airlock_type = /obj/machinery/door/airlock/maintenance
anchored = 1
density = 1
@@ -96,6 +97,7 @@ obj/structure/door_assembly
door_assembly_ext
name = "External Airlock Assembly"
icon_state = "door_as_ext1"
glass_type = null
airlock_type = /obj/machinery/door/airlock/external
anchored = 1
density = 1
@@ -105,6 +107,7 @@ obj/structure/door_assembly
door_assembly_fre
name = "Freezer Airlock Assembly"
icon_state = "door_as_fre1"
glass_type = null
airlock_type = /obj/machinery/door/airlock/freezer
anchored = 1
density = 1
@@ -114,6 +117,7 @@ obj/structure/door_assembly
door_assembly_mhatch
name = "Airtight Maintenance Hatch Assembly"
icon_state = "door_as_mhatch1"
glass_type = null
airlock_type = /obj/machinery/door/airlock/maintenance_hatch
anchored = 1
density = 1
@@ -192,13 +196,26 @@ obj/structure/door_assembly
sleep(40)
if(get_turf(user) == T)
user << "\blue You installed the airlock electronics!"
src.state = 2
src.name = "Near finished Airlock Assembly"
src.electronics = W
var/obj/item/weapon/airlock_electronics/E = W
var/obj/structure/door_assembly/D = new E.style(loc)
D.state = 2
D.glass = glass
if(glass)
// just in case user is setting a glass door to a type that doesn't have a glass version
if(ispath(D.glass_type))
D.icon_state = "[D.glass_base_icon_state]2"
else
D.icon_state = "[D.base_icon_state]2"
// type doesn't support glass, drop it
D.glass = 0
new/obj/item/stack/sheet/rglass(get_turf(src))
D.name = "Near finished Airlock Assembly"
E.loc = D
D.electronics = W
del(src)
else
W.loc = src.loc
//del(W)
else if(istype(W, /obj/item/weapon/crowbar) && state == 2 )
playsound(src.loc, 'Crowbar.ogg', 100, 1)
var/turf/T = get_turf(user)
@@ -215,7 +232,7 @@ obj/structure/door_assembly
ae = electronics
electronics = null
ae.loc = src.loc
else if(istype(W, /obj/item/stack/sheet/rglass) && glass == 0)
else if(istype(W, /obj/item/stack/sheet/rglass) && glass == 0 && ispath(glass_type))
playsound(src.loc, 'Crowbar.ogg', 100, 1)
user.visible_message("[user] adds reinforced glass windows to the airlock assembly.", "You start to install reinforced glass windows into the airlock assembly.")
var/obj/item/stack/sheet/rglass/G = W
@@ -224,8 +241,7 @@ obj/structure/door_assembly
G.use(1)
src.glass = 1
src.name = "Near finished Window Airlock Assembly"
src.airlock_type = /obj/machinery/door/airlock/glass
src.base_icon_state = "door_as_g" //this will be applied to the icon_state with the correct state number at the proc's end.
src.airlock_type = glass_type
else if(istype(W, /obj/item/weapon/screwdriver) && state == 2 )
playsound(src.loc, 'Screwdriver.ogg', 100, 1)
var/turf/T = get_turf(user)
+3
View File
@@ -76,6 +76,9 @@ var/global/list/datum/stack_recipe/metal_recipes = list ( \
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("iron door", /obj/structure/mineral_door/iron, 20), \
+3 -3
View File
@@ -15,8 +15,7 @@
M << "You will now [M.client.midis? "start":"stop"] receiving any sounds uploaded by admins[M.client.midis? "":", and any current midis playing have been disabled"]."
return
/* why is something that only is usable in the lobby a mob verb?
/mob/verb/toggletitlemusic()
set category = "Special Verbs"
set name = "Toggle Pregame Music"
@@ -28,4 +27,5 @@
if(M.client)
M << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1) // stop the jamsz
return
return
*/
+18 -2
View File
@@ -21,8 +21,6 @@
mind.key = key
mind.current = src
spawn() Playmusic() // git some tunes up in heeyaa~
var/starting_loc = pick(newplayer_start)
if(!starting_loc) starting_loc = locate(1,1,1)
loc = starting_loc
@@ -47,6 +45,9 @@
preferences.lastchangelog = lastchangelog
preferences.savefile_save(src, 1)
if(preferences.pregame_music)
spawn() Playmusic() // git some tunes up in heeyaa~
new_player_panel()
//PDA Resource Initialisation =======================================================>
/*
@@ -125,6 +126,8 @@
output += "<BR><a href='byond://?src=\ref[src];observe=1'>Observe</A><BR>"
output += "<BR><a href='byond://?src=\ref[src];pregame_music=1'>Lobby Music</A><BR>"
src << browse(output,"window=playersetup;size=250x233;can_close=0")
return
@@ -143,6 +146,9 @@
src << sound(ticker.login_music, repeat = 0, wait = 0, volume = 85, channel = 1) // MAD JAMS
proc/Stopmusic()
src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1) // stop the jamsz
Stat()
..()
@@ -208,6 +214,16 @@
del(src)
return 1
if(href_list["pregame_music"])
preferences.pregame_music = !preferences.pregame_music
if(preferences.pregame_music)
Playmusic()
else
Stopmusic()
// only save this 1 pref, so current slot doesn't get saved w/o user's knowledge
var/savefile/F = new(preferences.savefile_path(src))
F["pregame_music"] << preferences.pregame_music
if(href_list["late_join"])
LateChoices()
@@ -52,6 +52,8 @@ datum/preferences
be_special = 0
//Play admin midis
midis = 1
//Play pregame music
pregame_music = 1
//Saved changlog filesize to detect if there was a change
lastchangelog = 0
+2
View File
@@ -134,6 +134,7 @@ datum/preferences/proc/savefile_save(mob/user, slot)
F["be_special"] << src.be_special
F["UI"] << src.UI
F["midis"] << src.midis
F["pregame_music"] << src.pregame_music
F["ooccolor"] << src.ooccolor
F["lastchangelog"] << src.lastchangelog
@@ -193,6 +194,7 @@ datum/preferences/proc/savefile_load(mob/user, slot)
F["underwear"] >> src.underwear
F["name_is_always_random"] >> src.be_random_name
F["midis"] >> src.midis
F["pregame_music"] >> src.pregame_music
F["ooccolor"] >> src.ooccolor
F["lastchangelog"] >> src.lastchangelog
F["UI"] >> src.UI
+90
View File
@@ -196,6 +196,25 @@
user << "This type of light requires a [fitting]."
return
// attempt to take light apart
else if(istype(W, /obj/item/weapon/wirecutters))
if(status == LIGHT_EMPTY)
playsound(src.loc, 'Wirecutter.ogg', 100, 1)
var/turf/T = get_turf(user)
user.visible_message("[user] cuts the light's wiring.", "You start to cut the light's wiring.")
sleep(40)
if(get_turf(user) == T)
usr << "\blue You cut the light's wiring."
var/obj/structure/light_frame/F = new(loc)
F.anchored = 1
F.name = "Secured Light Fixture Frame"
F.dir = dir
F.light_type = type
F.icon_state = icon_state
del(src)
else
user << "\blue You need to remove the [fitting] first!"
// attempt to break the light
//If xenos decide they want to smash a light bulb with a toolbox, who am I to stop them? /N
@@ -561,3 +580,74 @@
new /obj/item/weapon/light/tube(src)
new /obj/item/weapon/light/tube(src)
new /obj/item/weapon/light/tube(src)
/obj/structure/light_frame
name = "Light Fixture Frame"
icon = 'lighting.dmi'
icon_state = "tube-empty"
desc = "A lighting fixture frame."
anchored = 0
layer = 5
var/light_type = /obj/machinery/light
var/wired = 0
m_amt = 1000
/obj/structure/light_frame/small
light_type = /obj/machinery/light/small
icon_state = "bulb-empty"
/obj/structure/light_frame/lamp
light_type = /obj/machinery/light/lamp
icon_state = "lamp-empty"
/obj/structure/light_frame/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/wrench) && !anchored)
playsound(src.loc, 'Ratchet.ogg', 100, 1)
var/turf/T = get_turf(user)
user.visible_message("[user] secures the light fixture.", "You start to secure the light fixture.")
sleep(40)
if(get_turf(user) == T)
usr << "\blue You secure the light fixture."
anchored = 1
name = "Secured Light Fixture Frame"
else if(istype(W, /obj/item/weapon/wrench) && anchored)
playsound(src.loc, 'Ratchet.ogg', 100, 1)
var/turf/T = get_turf(user)
user.visible_message("[user] unsecures the light fixture.", "You start to unsecure the light fixture.")
sleep(40)
if(get_turf(user) == T)
usr << "\blue You unsecure the light fixture."
anchored = 0
name = "Light Fixture Frame"
else if(istype(W, /obj/item/weapon/cable_coil) && anchored)
var/turf/T = get_turf(user)
user.visible_message("[user] wires the light fixture.", "You start to wire the light fixture.")
sleep(40)
if(get_turf(user) == T)
var/obj/item/weapon/cable_coil/C = W
C.use(1)
usr << "\blue You wire the light fixture."
var/obj/machinery/light/L = new light_type(loc)
L.dir = dir
L.status = LIGHT_EMPTY
L.update()
del(src)
else if(istype(W, /obj/item/weapon/screwdriver) && !anchored)
playsound(src.loc, 'Screwdriver.ogg', 100, 1)
usr << "\blue You take apart the light fixture."
new /obj/item/stack/sheet/metal(loc)
del(src)
else
..()
/obj/structure/light_frame/verb/rotate()
set name = "Rotate Light"
set category = "Object"
set src in oview(1)
if (src.anchored)
usr << "It is fastened to the wall; therefore, you can't rotate it!"
return 0
src.dir = turn(src.dir, 90)
return
+8 -8
View File
@@ -4961,7 +4961,7 @@
"bRu" = (/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; pixel_y = 0; tag = "Streight"},/turf/simulated/floor{icon_state = "floorgrime"},/area/maintenance/incinerator)
"bRv" = (/obj/machinery/atmospherics/portables_connector{dir = 2; name = "Gas Input"},/obj/machinery/light{dir = 1},/turf/simulated/floor{icon_state = "floorgrime"},/area/maintenance/incinerator)
"bRw" = (/obj/structure/reagent_dispensers/fueltank,/turf/simulated/floor{icon_state = "floorgrime"},/area/maintenance/incinerator)
"bRx" = (/obj/structure/table,/obj/item/device/radio/intercom{pixel_x = -25},/obj/item/weapon/virusdish/random{pixel_x = -6; pixel_y = 5},/obj/item/weapon/virusdish/random{step_x = 3; step_y = 2},/obj/item/weapon/virusdish/random,/turf/simulated/floor{icon_state = "white"},/area/medical/virology)
"bRx" = (/obj/structure/table,/obj/item/device/radio/intercom{pixel_x = -25},/obj/item/weapon/virusdish/random{pixel_x = -6; pixel_y = 5},/obj/item/weapon/virusdish/random{pixel_x = 3; pixel_y = 2; step_x = 0; step_y = 0},/obj/item/weapon/virusdish/random,/turf/simulated/floor{icon_state = "white"},/area/medical/virology)
"bRy" = (/obj/machinery/atmospherics/pipe/simple/supply/hidden,/turf/simulated/floor{icon_state = "white"},/area/medical/virology)
"bRz" = (/obj/machinery/disposal,/obj/structure/disposalpipe/trunk{dir = 4},/turf/simulated/floor{icon_state = "white"},/area/medical/virology)
"bRA" = (/obj/structure/grille,/obj/structure/window/reinforced,/obj/structure/window/reinforced{dir = 4},/obj/structure/window/reinforced{dir = 8},/obj/structure/disposalpipe/segment{dir = 2; icon_state = "pipe-c"},/turf/simulated/floor/plating,/area/medical/virology)
@@ -5537,7 +5537,7 @@
"ccy" = (/obj/effect/landmark/start,/turf/unsimulated/floor,/area/start)
"ccz" = (/turf/unsimulated/wall{icon = 'icons/misc/fullscreen.dmi'; icon_state = "title"; name = "Space Station 13"},/area/start)
"ccA" = (/turf/space,/turf/simulated/shuttle/wall{dir = 8; icon_state = "diagonalWall3"},/area/syndicate_mothership)
"ccB" = (/turf/unsimulated/wall{desc = "Why it no open!"; icon = 'rapid_pdoor.dmi'; icon_state = "pdoor1"; name = "Shuttle Bay Blast Door"},/area/syndicate_mothership)
"ccB" = (/turf/unsimulated/wall{desc = "Why it no open!"; icon = 'icons/obj/doors/rapid_pdoor.dmi'; icon_state = "pdoor1"; name = "Shuttle Bay Blast Door"},/area/syndicate_mothership)
"ccC" = (/turf/simulated/shuttle/wall{icon_state = "wall3"},/area/syndicate_mothership)
"ccD" = (/turf/space,/turf/simulated/shuttle/wall{dir = 8; icon_state = "diagonalWall3"},/area/shuttle/syndicate_elite/mothership)
"ccE" = (/obj/structure/shuttle/engine/propulsion{tag = "icon-propulsion_r (NORTH)"; icon_state = "propulsion_r"; dir = 1},/turf/space,/area/shuttle/syndicate_elite/mothership)
@@ -5609,8 +5609,8 @@
"cdS" = (/obj/structure/table,/turf/unsimulated/floor{icon = 'shuttle.dmi'; icon_state = "floor4"},/area/syndicate_station/start)
"cdT" = (/turf/unsimulated/wall,/area/centcom)
"cdU" = (/obj/effect/landmark{name = "Nuclear-Closet"},/turf/unsimulated/floor{icon = 'shuttle.dmi'; icon_state = "floor4"},/area/syndicate_station/start)
"cdV" = (/turf/unsimulated/wall{desc = "Why it no open!"; icon = 'rapid_pdoor.dmi'; icon_state = "pdoor1"; name = "External Airlock"},/area)
"cdW" = (/turf/unsimulated/wall{desc = "Why it no open!"; icon = 'rapid_pdoor.dmi'; icon_state = "pdoor1"; name = "Shuttle Bay Blast Door"},/area/centcom)
"cdV" = (/turf/unsimulated/wall{desc = "Why it no open!"; icon = 'icons/obj/doors/rapid_pdoor.dmi'; icon_state = "pdoor1"; name = "External Airlock"},/area)
"cdW" = (/turf/unsimulated/wall{desc = "Why it no open!"; icon = 'icons/obj/doors/rapid_pdoor.dmi'; icon_state = "pdoor1"; name = "Shuttle Bay Blast Door"},/area/centcom)
"cdX" = (/turf/unsimulated/floor{tag = "icon-warnplate (WEST)"; icon_state = "warnplate"; dir = 8},/area/centcom)
"cdY" = (/turf/unsimulated/floor{name = "plating"},/area/centcom)
"cdZ" = (/obj/structure/stool/chair{dir = 4},/turf/unsimulated/floor{icon = 'shuttle.dmi'; icon_state = "floor4"},/area/syndicate_station/start)
@@ -5672,7 +5672,7 @@
"cfd" = (/turf/unsimulated/floor{tag = "icon-warnplate (WEST)"; icon_state = "warnplate"; dir = 8},/area/centcom/suppy)
"cfe" = (/turf/unsimulated/floor{name = "plating"},/area/centcom/suppy)
"cff" = (/turf/unsimulated/floor{tag = "icon-warnplate (EAST)"; icon_state = "warnplate"; dir = 4},/area/centcom/suppy)
"cfg" = (/turf/unsimulated/wall{desc = "Why it no open!"; icon = 'rapid_pdoor.dmi'; icon_state = "pdoor1"; name = "Shuttle Bay Blast Door"},/area/centcom/suppy)
"cfg" = (/turf/unsimulated/wall{desc = "Why it no open!"; icon = 'icons/obj/doors/rapid_pdoor.dmi'; icon_state = "pdoor1"; name = "Shuttle Bay Blast Door"},/area/centcom/suppy)
"cfh" = (/obj/machinery/sleeper{icon_state = "sleeper_0-r"; orient = "RIGHT"},/turf/unsimulated/floor{icon = 'shuttle.dmi'; icon_state = "floor3"},/area/syndicate_station/start)
"cfi" = (/obj/effect/landmark{name = "Syndicate-Spawn"},/turf/unsimulated/floor{icon = 'shuttle.dmi'; icon_state = "floor3"},/area/syndicate_station/start)
"cfj" = (/turf/unsimulated/floor{icon = 'shuttle.dmi'; icon_state = "floor3"},/area/syndicate_station/start)
@@ -5689,7 +5689,7 @@
"cfu" = (/obj/structure/table,/obj/machinery/juicer{pixel_y = 6},/turf/unsimulated/floor{tag = "icon-redyellowfull"; icon_state = "redyellowfull"},/area/centcom/living)
"cfv" = (/obj/machinery/door/airlock/external,/turf/unsimulated/floor{name = "plating"},/area/centcom/living)
"cfw" = (/turf/unsimulated/floor{name = "plating"},/area/centcom/living)
"cfx" = (/turf/unsimulated/wall{desc = "Why it no open!"; icon = 'rapid_pdoor.dmi'; icon_state = "pdoor1"; name = "Shuttle Bay Blast Door"},/area/centcom/living)
"cfx" = (/turf/unsimulated/wall{desc = "Why it no open!"; icon = 'icons/obj/doors/rapid_pdoor.dmi'; icon_state = "pdoor1"; name = "Shuttle Bay Blast Door"},/area/centcom/living)
"cfy" = (/turf/simulated/shuttle/wall{tag = "icon-swall_s6"; icon_state = "swall_s6"; dir = 2},/area/supply/dock)
"cfz" = (/turf/simulated/shuttle/wall{tag = "icon-swall12"; icon_state = "swall12"; dir = 2},/area/supply/dock)
"cfA" = (/turf/simulated/shuttle/wall{tag = "icon-swall_s10"; icon_state = "swall_s10"; dir = 2},/area/supply/dock)
@@ -6061,7 +6061,7 @@
"cmC" = (/turf/simulated/shuttle/floor,/area/shuttle/escape/centcom)
"cmD" = (/obj/structure/stool/chair{dir = 4},/turf/simulated/shuttle/floor{icon_state = "floor3"},/area/shuttle/escape/centcom)
"cmE" = (/obj/machinery/computer/security,/turf/simulated/shuttle/floor{icon_state = "floor3"},/area/shuttle/escape/centcom)
"cmF" = (/turf/unsimulated/wall{desc = "Why it no open!"; icon = 'rapid_pdoor.dmi'; icon_state = "pdoor1"; name = "Shuttle Bay Blast Door"},/area/centcom/ferry)
"cmF" = (/turf/unsimulated/wall{desc = "Why it no open!"; icon = 'icons/obj/doors/rapid_pdoor.dmi'; icon_state = "pdoor1"; name = "Shuttle Bay Blast Door"},/area/centcom/ferry)
"cmG" = (/turf/unsimulated/floor{tag = "icon-warnplate (WEST)"; icon_state = "warnplate"; dir = 8},/area/centcom/ferry)
"cmH" = (/turf/unsimulated/floor{name = "plating"},/area/centcom/ferry)
"cmI" = (/obj/structure/grille,/obj/structure/window/reinforced{dir = 8},/obj/structure/window/reinforced,/obj/structure/window/reinforced{dir = 1},/obj/structure/window/reinforced{dir = 4},/turf/unsimulated/floor{name = "plating"},/area/centcom/ferry)
@@ -6071,7 +6071,7 @@
"cmM" = (/obj/structure/stool/chair{dir = 8},/turf/unsimulated/floor{icon_state = "green"; dir = 4},/area/centcom/control)
"cmN" = (/obj/machinery/computer/crew,/turf/simulated/shuttle/floor{icon_state = "floor3"},/area/shuttle/escape/centcom)
"cmO" = (/obj/machinery/computer/communications,/turf/simulated/shuttle/floor{icon_state = "floor3"},/area/shuttle/escape/centcom)
"cmP" = (/turf/unsimulated/wall{desc = "Why it no open!"; icon = 'rapid_pdoor.dmi'; icon_state = "pdoor1"; name = "Shuttle Bay Blast Door"},/turf/simulated/shuttle/wall{dir = 1; icon_state = "diagonalWall3"},/area/centcom/ferry)
"cmP" = (/turf/unsimulated/wall{desc = "Why it no open!"; icon = 'icons/obj/doors/rapid_pdoor.dmi'; icon_state = "pdoor1"; name = "Shuttle Bay Blast Door"},/turf/simulated/shuttle/wall{dir = 1; icon_state = "diagonalWall3"},/area/centcom/ferry)
"cmQ" = (/turf/simulated/shuttle/wall{tag = "icon-swall_s6"; icon_state = "swall_s6"; dir = 2},/area/shuttle/transport1/centcom)
"cmR" = (/turf/simulated/shuttle/wall{tag = "icon-swall12"; icon_state = "swall12"; dir = 2},/area/shuttle/transport1/centcom)
"cmS" = (/turf/simulated/shuttle/wall{tag = "icon-swall_s10"; icon_state = "swall_s10"; dir = 2},/area/shuttle/transport1/centcom)