April sync (#360)
* Maps and things no code/icons * helpers defines globalvars * Onclick world.dm orphaned_procs * subsystems Round vote and shuttle autocall done here too * datums * Game folder * Admin - chatter modules * clothing - mining * modular computers - zambies * client * mob level 1 * mob stage 2 + simple_animal * silicons n brains * mob stage 3 + Alien/Monkey * human mobs * icons updated * some sounds * emitter y u no commit * update tgstation.dme * compile fixes * travis fixes Also removes Fast digest mode, because reasons. * tweaks for travis Mentors are broke again Also fixes Sizeray guns * oxygen loss fix for vore code. * removes unused code * some code updates * bulk fixes * further fixes * outside things * whoops. * Maint bar ported * GLOBs.
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
/proc/DuplicateObject(var/atom/original, var/perfectcopy = TRUE, var/sameloc = FALSE, var/atom/newloc = null, var/nerf = FALSE, var/holoitem=FALSE)
|
||||
//Vars that will not be copied when using /DuplicateObject
|
||||
GLOBAL_LIST_INIT(duplicate_forbidden_vars,list("area","type","loc","locs","vars", "parent","parent_type", "verbs","ckey","key","power_supply","contents","reagents","stat","x","y","z","group","atmos_adjacent_turfs"))
|
||||
|
||||
/proc/DuplicateObject(atom/original, perfectcopy = TRUE, sameloc = FALSE, atom/newloc = null, nerf = FALSE, holoitem=FALSE)
|
||||
if(!original)
|
||||
return null
|
||||
var/atom/O
|
||||
@@ -9,9 +12,7 @@
|
||||
O = new original.type(newloc)
|
||||
|
||||
if(perfectcopy && O && original)
|
||||
var/global/list/forbidden_vars = list("type","loc","locs","vars", "parent","parent_type", "verbs","ckey","key","power_supply","contents","reagents","stat","x","y","z","group")
|
||||
|
||||
for(var/V in original.vars - forbidden_vars)
|
||||
for(var/V in original.vars - GLOB.duplicate_forbidden_vars)
|
||||
if(istype(original.vars[V],/list))
|
||||
var/list/L = original.vars[V]
|
||||
O.vars[V] = L.Copy()
|
||||
@@ -90,23 +91,24 @@
|
||||
var/old_icon_state1 = T.icon_state
|
||||
var/old_icon1 = T.icon
|
||||
|
||||
B.ChangeTurf(T.type)
|
||||
B = B.ChangeTurf(T.type)
|
||||
B.setDir(old_dir1)
|
||||
B.icon = old_icon1
|
||||
B.icon_state = old_icon_state1
|
||||
|
||||
for(var/obj/O in T)
|
||||
var/obj/O2 = DuplicateObject(O , perfectcopy=TRUE, newloc = B, nerf=nerf_weapons, holoitem=TRUE)
|
||||
if(!O2) continue
|
||||
if(!O2)
|
||||
continue
|
||||
copiedobjs += O2.GetAllContents()
|
||||
|
||||
for(var/mob/M in T)
|
||||
if(istype(M, /mob/camera)) continue // If we need to check for more mobs, I'll add a variable
|
||||
if(istype(M, /mob/camera))
|
||||
continue // If we need to check for more mobs, I'll add a variable
|
||||
var/mob/SM = DuplicateObject(M , perfectcopy=TRUE, newloc = B, holoitem=TRUE)
|
||||
copiedobjs += SM.GetAllContents()
|
||||
|
||||
var/global/list/forbidden_vars = list("type","stat","loc","locs","vars", "parent", "parent_type","verbs","ckey","key","x","y","z","contents", "light_range", "light_power", "light_color", "light", "light_sources")
|
||||
for(var/V in T.vars - forbidden_vars)
|
||||
for(var/V in T.vars - GLOB.duplicate_forbidden_vars)
|
||||
if(V == "air")
|
||||
var/turf/open/O1 = B
|
||||
var/turf/open/O2 = T
|
||||
|
||||
@@ -45,34 +45,42 @@
|
||||
var/list/effects = list()
|
||||
var/last_change = 0
|
||||
|
||||
/obj/machinery/computer/holodeck/New()
|
||||
|
||||
if(ispath(holodeck_type,/area))
|
||||
linked = locate(holodeck_type)
|
||||
if(ispath(offline_program,/area))
|
||||
offline_program = locate(offline_program)
|
||||
// the following is necessary for power reasons
|
||||
var/area/AS = get_area(src)
|
||||
if(istype(AS,/area/holodeck))
|
||||
log_world("### MAPPING ERROR")
|
||||
log_world("Holodeck computer cannot be in a holodeck.")
|
||||
log_world("This would cause circular power dependency.")
|
||||
qdel(src) // todo handle constructed computers
|
||||
return //l-lewd...
|
||||
else
|
||||
linked.linked = src // todo detect multiple/constructed computers
|
||||
..()
|
||||
|
||||
|
||||
/obj/machinery/computer/holodeck/Initialize(mapload)
|
||||
. = mapload //late-initialize, area_copy need turfs to have air
|
||||
if(!mapload)
|
||||
..()
|
||||
|
||||
if(ispath(holodeck_type,/area))
|
||||
var/list/possible = get_areas(holodeck_type,subtypes = FALSE)
|
||||
linked = pop(possible)
|
||||
if(ispath(offline_program,/area))
|
||||
var/list/possible = get_areas(offline_program,subtypes = FALSE)
|
||||
offline_program = pop(possible)
|
||||
// the following is necessary for power reasons
|
||||
if(!linked || !offline_program)
|
||||
log_world("No matching holodeck area found")
|
||||
qdel(src)
|
||||
return
|
||||
var/area/AS = get_area(src)
|
||||
if(istype(AS,/area/holodeck))
|
||||
log_world("### MAPPING ERROR")
|
||||
log_world("Holodeck computer cannot be in a holodeck.")
|
||||
log_world("This would cause circular power dependency.")
|
||||
qdel(src) // todo handle constructed computers
|
||||
return //l-lewd...
|
||||
else
|
||||
linked.linked = src // todo detect multiple/constructed computers
|
||||
|
||||
program_cache = list()
|
||||
emag_programs = list()
|
||||
for(var/typekey in subtypesof(program_type))
|
||||
var/area/holodeck/A = locate(typekey)
|
||||
if(!A || A == offline_program) continue
|
||||
if(A.contents.len == 0) continue // not loaded
|
||||
if(!A || A == offline_program)
|
||||
continue
|
||||
if(A.contents.len == 0)
|
||||
continue // not loaded
|
||||
if(A.restricted)
|
||||
emag_programs += A
|
||||
else
|
||||
@@ -191,8 +199,9 @@
|
||||
nerf(!emagged)
|
||||
|
||||
/obj/machinery/computer/holodeck/Destroy()
|
||||
emergency_shutdown()
|
||||
linked.linked = null
|
||||
if(linked)
|
||||
emergency_shutdown()
|
||||
linked.linked = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/computer/holodeck/emp_act(severity)
|
||||
|
||||
@@ -124,10 +124,10 @@
|
||||
if(istype(I, /obj/item/projectile))
|
||||
return
|
||||
if(prob(50))
|
||||
I.loc = src.loc
|
||||
visible_message("<span class='warning'> Swish! \the [I] lands in \the [src].</span>")
|
||||
I.forceMove(get_turf(src))
|
||||
visible_message("<span class='warning'>Swish! [I] lands in [src].</span>")
|
||||
else
|
||||
visible_message("<span class='danger'> \the [I] bounces off of \the [src]'s rim!</span>")
|
||||
visible_message("<span class='danger'>[I] bounces off of [src]'s rim!</span>")
|
||||
return 0
|
||||
else
|
||||
return ..()
|
||||
|
||||
Reference in New Issue
Block a user