@@ -0,0 +1,130 @@
|
||||
//Vars that will not be copied when using /DuplicateObject
|
||||
GLOBAL_LIST_INIT(duplicate_forbidden_vars,list(
|
||||
"tag", "datum_components", "area", "type", "loc", "locs", "vars", "parent", "parent_type", "verbs", "ckey", "key",
|
||||
"power_supply", "contents", "reagents", "stat", "x", "y", "z", "group", "atmos_adjacent_turfs", "comp_lookup"
|
||||
))
|
||||
|
||||
/proc/DuplicateObject(atom/original, perfectcopy = TRUE, sameloc = FALSE, atom/newloc = null, nerf = FALSE, holoitem=FALSE)
|
||||
RETURN_TYPE(original.type)
|
||||
if(!original)
|
||||
return
|
||||
var/atom/O
|
||||
|
||||
if(sameloc)
|
||||
O = new original.type(original.loc)
|
||||
else
|
||||
O = new original.type(newloc)
|
||||
|
||||
if(perfectcopy && O && original)
|
||||
for(var/V in original.vars - GLOB.duplicate_forbidden_vars)
|
||||
if(islist(original.vars[V]))
|
||||
var/list/L = original.vars[V]
|
||||
O.vars[V] = L.Copy()
|
||||
else if(istype(original.vars[V], /datum))
|
||||
continue // this would reference the original's object, that will break when it is used or deleted.
|
||||
else
|
||||
O.vars[V] = original.vars[V]
|
||||
|
||||
if(isobj(O))
|
||||
var/obj/N = O
|
||||
if(holoitem)
|
||||
N.resistance_flags = LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF // holoitems do not burn
|
||||
|
||||
if(nerf && isitem(O))
|
||||
var/obj/item/I = O
|
||||
I.damtype = STAMINA // thou shalt not
|
||||
|
||||
N.update_icon()
|
||||
if(ismachinery(O))
|
||||
var/obj/machinery/M = O
|
||||
M.power_change()
|
||||
|
||||
if(holoitem)
|
||||
O.flags_1 |= HOLOGRAM_1
|
||||
return O
|
||||
|
||||
|
||||
/area/proc/copy_contents_to(var/area/A , var/platingRequired = 0, var/nerf_weapons = 0 )
|
||||
//Takes: Area. Optional: If it should copy to areas that don't have plating
|
||||
//Returns: Nothing.
|
||||
//Notes: Attempts to move the contents of one area to another area.
|
||||
// Movement based on lower left corner. Tiles that do not fit
|
||||
// into the new area will not be moved.
|
||||
|
||||
if(!A || !src)
|
||||
return 0
|
||||
|
||||
var/list/turfs_src = get_area_turfs(src.type)
|
||||
var/list/turfs_trg = get_area_turfs(A.type)
|
||||
|
||||
var/src_min_x = 99999
|
||||
var/src_min_y = 99999
|
||||
var/list/refined_src = new/list()
|
||||
|
||||
for (var/turf/T in turfs_src)
|
||||
src_min_x = min(src_min_x,T.x)
|
||||
src_min_y = min(src_min_y,T.y)
|
||||
for (var/turf/T in turfs_src)
|
||||
refined_src[T] = "[T.x - src_min_x].[T.y - src_min_y]"
|
||||
|
||||
var/trg_min_x = 99999
|
||||
var/trg_min_y = 99999
|
||||
var/list/refined_trg = new/list()
|
||||
|
||||
for (var/turf/T in turfs_trg)
|
||||
trg_min_x = min(trg_min_x,T.x)
|
||||
trg_min_y = min(trg_min_y,T.y)
|
||||
for (var/turf/T in turfs_trg)
|
||||
refined_trg["[T.x - trg_min_x].[T.y - trg_min_y]"] = T
|
||||
|
||||
var/list/toupdate = new/list()
|
||||
|
||||
var/copiedobjs = list()
|
||||
|
||||
for (var/turf/T in refined_src)
|
||||
var/coordstring = refined_src[T]
|
||||
var/turf/B = refined_trg[coordstring]
|
||||
if(!istype(B))
|
||||
continue
|
||||
|
||||
if(platingRequired)
|
||||
if(isspaceturf(B))
|
||||
continue
|
||||
|
||||
var/old_dir1 = T.dir
|
||||
var/old_icon_state1 = T.icon_state
|
||||
var/old_icon1 = T.icon
|
||||
|
||||
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
|
||||
copiedobjs += O2.GetAllContents()
|
||||
|
||||
for(var/mob/M in T)
|
||||
if(iscameramob(M))
|
||||
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()
|
||||
|
||||
for(var/V in T.vars - GLOB.duplicate_forbidden_vars)
|
||||
if(V == "air")
|
||||
var/turf/open/O1 = B
|
||||
var/turf/open/O2 = T
|
||||
O1.air.copy_from(O2.return_air())
|
||||
continue
|
||||
B.vars[V] = T.vars[V]
|
||||
toupdate += B
|
||||
|
||||
if(toupdate.len)
|
||||
for(var/turf/T1 in toupdate)
|
||||
CALCULATE_ADJACENT_TURFS(T1)
|
||||
SSair.add_to_active(T1,1)
|
||||
|
||||
|
||||
return copiedobjs
|
||||
@@ -0,0 +1,173 @@
|
||||
/turf/open/floor/holofloor
|
||||
icon_state = "floor"
|
||||
thermal_conductivity = 0
|
||||
flags_1 = NONE
|
||||
|
||||
/turf/open/floor/holofloor/attackby(obj/item/I, mob/living/user)
|
||||
return // HOLOFLOOR DOES NOT GIVE A FUCK
|
||||
|
||||
/turf/open/floor/holofloor/tool_act(mob/living/user, obj/item/I, tool_type)
|
||||
return
|
||||
|
||||
/turf/open/floor/holofloor/burn_tile()
|
||||
return //you can't burn a hologram!
|
||||
|
||||
/turf/open/floor/holofloor/break_tile()
|
||||
return //you can't break a hologram!
|
||||
|
||||
/turf/open/floor/holofloor/plating
|
||||
name = "holodeck projector floor"
|
||||
icon_state = "engine"
|
||||
|
||||
/turf/open/floor/holofloor/plating/burnmix
|
||||
name = "burn-mix floor"
|
||||
initial_gas_mix = BURNMIX_ATMOS
|
||||
|
||||
/turf/open/floor/holofloor/grass
|
||||
gender = PLURAL
|
||||
name = "lush grass"
|
||||
icon_state = "grass"
|
||||
bullet_bounce_sound = null
|
||||
tiled_dirt = FALSE
|
||||
|
||||
/turf/open/floor/holofloor/beach
|
||||
gender = PLURAL
|
||||
name = "sand"
|
||||
icon = 'icons/misc/beach.dmi'
|
||||
icon_state = "sand"
|
||||
bullet_bounce_sound = null
|
||||
tiled_dirt = FALSE
|
||||
|
||||
/turf/open/floor/holofloor/beach/coast_t
|
||||
gender = NEUTER
|
||||
name = "coastline"
|
||||
icon_state = "sandwater_t"
|
||||
|
||||
/turf/open/floor/holofloor/beach/coast_b
|
||||
gender = NEUTER
|
||||
name = "coastline"
|
||||
icon_state = "sandwater_b"
|
||||
|
||||
/turf/open/floor/holofloor/beach/water
|
||||
name = "water"
|
||||
icon_state = "water"
|
||||
bullet_sizzle = TRUE
|
||||
|
||||
/turf/open/floor/holofloor/asteroid
|
||||
name = "asteroid"
|
||||
icon_state = "asteroid0"
|
||||
tiled_dirt = FALSE
|
||||
|
||||
/turf/open/floor/holofloor/asteroid/Initialize()
|
||||
icon_state = "asteroid[rand(0, 12)]"
|
||||
. = ..()
|
||||
|
||||
/turf/open/floor/holofloor/basalt
|
||||
gender = PLURAL
|
||||
name = "basalt"
|
||||
icon_state = "basalt0"
|
||||
tiled_dirt = FALSE
|
||||
|
||||
/turf/open/floor/holofloor/basalt/Initialize()
|
||||
. = ..()
|
||||
if(prob(15))
|
||||
icon_state = "basalt[rand(0, 12)]"
|
||||
set_basalt_light(src)
|
||||
|
||||
/turf/open/floor/holofloor/space
|
||||
name = "\proper space"
|
||||
icon = 'icons/turf/space.dmi'
|
||||
icon_state = "0"
|
||||
|
||||
/turf/open/floor/holofloor/space/Initialize()
|
||||
icon_state = SPACE_ICON_STATE // so realistic
|
||||
. = ..()
|
||||
|
||||
/turf/open/floor/holofloor/hyperspace
|
||||
name = "\proper hyperspace"
|
||||
icon = 'icons/turf/space.dmi'
|
||||
icon_state = "speedspace_ns_1"
|
||||
bullet_bounce_sound = null
|
||||
tiled_dirt = FALSE
|
||||
|
||||
/turf/open/floor/holofloor/hyperspace/Initialize()
|
||||
icon_state = "speedspace_ns_[(x + 5*y + (y%2+1)*7)%15+1]"
|
||||
. = ..()
|
||||
|
||||
/turf/open/floor/holofloor/hyperspace/ns/Initialize()
|
||||
. = ..()
|
||||
icon_state = "speedspace_ns_[(x + 5*y + (y%2+1)*7)%15+1]"
|
||||
|
||||
/turf/open/floor/holofloor/carpet
|
||||
name = "carpet"
|
||||
desc = "Electrically inviting."
|
||||
icon = 'icons/turf/floors/carpet.dmi'
|
||||
icon_state = "carpet"
|
||||
floor_tile = /obj/item/stack/tile/carpet
|
||||
smooth = SMOOTH_TRUE
|
||||
canSmoothWith = null
|
||||
bullet_bounce_sound = null
|
||||
tiled_dirt = FALSE
|
||||
|
||||
/turf/open/floor/holofloor/carpet/Initialize()
|
||||
. = ..()
|
||||
addtimer(CALLBACK(src, .proc/update_icon), 1)
|
||||
|
||||
/turf/open/floor/holofloor/carpet/update_icon()
|
||||
if(!..())
|
||||
return 0
|
||||
if(intact)
|
||||
queue_smooth(src)
|
||||
|
||||
/turf/open/floor/holofloor/wood
|
||||
icon_state = "wood"
|
||||
tiled_dirt = FALSE
|
||||
|
||||
/turf/open/floor/holofloor/snow
|
||||
gender = PLURAL
|
||||
name = "snow"
|
||||
desc = "Looks cold."
|
||||
icon = 'icons/turf/snow.dmi'
|
||||
icon_state = "snow"
|
||||
slowdown = 2
|
||||
bullet_sizzle = TRUE
|
||||
bullet_bounce_sound = null
|
||||
tiled_dirt = FALSE
|
||||
baseturfs = /turf/open/floor/holofloor/snow
|
||||
|
||||
/turf/open/floor/holofloor/snow/attack_hand(mob/living/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
user.visible_message("<span class='notice'>[user] scroops up some snow from [src].</span>", "<span class='notice'>You scoop up some snow from [src].</span>")
|
||||
var/obj/item/toy/snowball/S = new(get_turf(src))
|
||||
user.put_in_hands(S)
|
||||
|
||||
/turf/open/floor/holofloor/snow/cold
|
||||
initial_gas_mix = "nob=7500;TEMP=2.7"
|
||||
|
||||
/turf/open/floor/holofloor/asteroid
|
||||
gender = PLURAL
|
||||
name = "asteroid sand"
|
||||
icon = 'icons/turf/floors.dmi'
|
||||
icon_state = "asteroid"
|
||||
tiled_dirt = FALSE
|
||||
|
||||
/turf/open/floor/holofloor/ice
|
||||
name = "ice sheet"
|
||||
desc = "A sheet of solid ice. Looks slippery."
|
||||
icon = 'icons/turf/floors/ice_turf.dmi'
|
||||
icon_state = "unsmooth"
|
||||
baseturfs = /turf/open/floor/holofloor/ice
|
||||
slowdown = 1
|
||||
footstep = FOOTSTEP_FLOOR
|
||||
|
||||
/turf/open/floor/holofloor/ice/smooth
|
||||
icon_state = "smooth"
|
||||
smooth = SMOOTH_MORE | SMOOTH_BORDER
|
||||
canSmoothWith = list(/turf/open/floor/plating/ice/smooth, /turf/open/floor/plating/ice, /turf/open/floor/holofloor/ice)
|
||||
baseturfs = /turf/open/floor/holofloor/ice/smooth
|
||||
|
||||
/turf/open/floor/holofloor/ice/Initialize()
|
||||
. = ..()
|
||||
MakeSlippery(TURF_WET_PERMAFROST, INFINITY, 0, INFINITY, TRUE)
|
||||
Reference in New Issue
Block a user