mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 03:25:49 +01:00
Merge branch 'master' of https://github.com/ParadiseSS13/Paradise into DWI
This commit is contained in:
@@ -468,7 +468,7 @@
|
||||
dat += "<tr><td><i>Head not found!</i></td></tr>"
|
||||
dat += "</table>"
|
||||
|
||||
if(istype(ticker.mode, /datum/game_mode/blob))
|
||||
if(GAMEMODE_IS_BLOB)
|
||||
var/datum/game_mode/blob/mode = ticker.mode
|
||||
dat += "<br><table cellspacing=5><tr><td><B>Blob</B></td><td></td><td></td></tr>"
|
||||
dat += "<tr><td><i>Progress: [blobs.len]/[mode.blobwincount]</i></td></tr>"
|
||||
|
||||
@@ -1980,8 +1980,7 @@
|
||||
return
|
||||
else
|
||||
for(var/obj/machinery/photocopier/faxmachine/F in allfaxes)
|
||||
// TODO: Tie into space manager
|
||||
if((F.z in config.station_levels))
|
||||
if(is_station_level(F.z))
|
||||
spawn(0)
|
||||
if(!F.receivefax(P))
|
||||
to_chat(src.owner, "\red Message transmission to [F.department] failed.")
|
||||
@@ -2328,8 +2327,7 @@
|
||||
for(var/mob/living/carbon/human/H in mob_list)
|
||||
var/turf/loc = find_loc(H)
|
||||
var/security = 0
|
||||
// TODO: Tie into space manager
|
||||
if(!(loc.z in config.station_levels) || prisonwarped.Find(H))
|
||||
if(!is_station_level(loc.z) || prisonwarped.Find(H))
|
||||
|
||||
//don't warp them if they aren't ready or are already there
|
||||
continue
|
||||
@@ -2375,7 +2373,7 @@
|
||||
if(is_special_character(H)) continue
|
||||
//traitorize(H, objective, 0)
|
||||
ticker.mode.traitors += H.mind
|
||||
H.mind.special_role = "traitor"
|
||||
H.mind.special_role = SPECIAL_ROLE_TRAITOR
|
||||
var/datum/objective/new_objective = new
|
||||
new_objective.owner = H
|
||||
new_objective.explanation_text = objective
|
||||
@@ -2385,7 +2383,7 @@
|
||||
ticker.mode.finalize_traitor(H.mind)
|
||||
for(var/mob/living/silicon/A in player_list)
|
||||
ticker.mode.traitors += A.mind
|
||||
A.mind.special_role = "traitor"
|
||||
A.mind.special_role = SPECIAL_ROLE_TRAITOR
|
||||
var/datum/objective/new_objective = new
|
||||
new_objective.owner = A
|
||||
new_objective.explanation_text = objective
|
||||
@@ -2566,8 +2564,7 @@
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
feedback_add_details("admin_secrets_fun_used","EgL")
|
||||
for(var/obj/machinery/door/airlock/W in airlocks)
|
||||
// TODO: Tie into space manager
|
||||
if((W.z in config.station_levels) && !istype(get_area(W), /area/bridge) && !istype(get_area(W), /area/crew_quarters) && !istype(get_area(W), /area/security/prison))
|
||||
if(is_station_level(W.z) && !istype(get_area(W), /area/bridge) && !istype(get_area(W), /area/crew_quarters) && !istype(get_area(W), /area/security/prison))
|
||||
W.req_access = list()
|
||||
message_admins("[key_name_admin(usr)] activated Egalitarian Station mode")
|
||||
command_announcement.Announce("Centcomm airlock control override activated. Please take this time to get acquainted with your coworkers.", new_sound = 'sound/AI/commandreport.ogg')
|
||||
|
||||
@@ -373,8 +373,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
|
||||
for(var/I in singularities)
|
||||
var/obj/singularity/S = I
|
||||
// TODO: Tie into space manager
|
||||
if(S.z == ZLEVEL_CENTCOMM || S.z >= MAX_Z)
|
||||
if(!is_level_reachable(S.z))
|
||||
continue
|
||||
qdel(S)
|
||||
log_admin("[key_name(src)] has deleted all Singularities and Tesla orbs.")
|
||||
|
||||
@@ -92,7 +92,7 @@ var/global/sent_honksquad = 0
|
||||
//Creates mind stuff.
|
||||
new_honksquad.mind_initialize()
|
||||
new_honksquad.mind.assigned_role = "MODE"
|
||||
new_honksquad.mind.special_role = "HONKsquad"
|
||||
new_honksquad.mind.special_role = SPECIAL_ROLE_HONKSQUAD
|
||||
ticker.mode.traitors |= new_honksquad.mind//Adds them to current traitor list. Which is really the extra antagonist list.
|
||||
new_honksquad.equip_honksquad(honk_leader_selected)
|
||||
return new_honksquad
|
||||
|
||||
@@ -402,7 +402,7 @@ client/proc/one_click_antag()
|
||||
//Creates mind stuff.
|
||||
new_syndicate_commando.mind_initialize()
|
||||
new_syndicate_commando.mind.assigned_role = "MODE"
|
||||
new_syndicate_commando.mind.special_role = "Syndicate Commando"
|
||||
new_syndicate_commando.mind.special_role = SPECIAL_ROLE_SYNDICATE_DEATHSQUAD
|
||||
|
||||
//Adds them to current traitor list. Which is really the extra antagonist list.
|
||||
ticker.mode.traitors += new_syndicate_commando.mind
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
A.copy_to(H)
|
||||
|
||||
ticker.mode.traitors += H.mind
|
||||
H.mind.special_role = "traitor"
|
||||
H.mind.special_role = SPECIAL_ROLE_TRAITOR
|
||||
|
||||
var/datum/objective/hijack/hijack_objective = new
|
||||
hijack_objective.owner = H.mind
|
||||
|
||||
@@ -81,8 +81,7 @@ var/list/sounds_cache = list()
|
||||
|
||||
for(var/O in global_intercoms)
|
||||
var/obj/item/device/radio/intercom/I = O
|
||||
// TODO: Tie into space manager
|
||||
if(I.z != ZLEVEL_STATION && !ignore_z)
|
||||
if(!is_station_level(I.z) && !ignore_z)
|
||||
continue
|
||||
if(!I.on && !ignore_power)
|
||||
continue
|
||||
|
||||
@@ -115,7 +115,7 @@ var/global/sent_strike_team = 0
|
||||
//Creates mind stuff.
|
||||
new_commando.mind_initialize()
|
||||
new_commando.mind.assigned_role = "MODE"
|
||||
new_commando.mind.special_role = "Death Commando"
|
||||
new_commando.mind.special_role = SPECIAL_ROLE_DEATHSQUAD
|
||||
ticker.mode.traitors |= new_commando.mind//Adds them to current traitor list. Which is really the extra antagonist list.
|
||||
new_commando.equip_death_commando(leader_selected)
|
||||
return new_commando
|
||||
|
||||
@@ -118,7 +118,7 @@ var/global/sent_syndicate_strike_team = 0
|
||||
//Creates mind stuff.
|
||||
new_syndicate_commando.mind_initialize()
|
||||
new_syndicate_commando.mind.assigned_role = "MODE"
|
||||
new_syndicate_commando.mind.special_role = "Syndicate Commando"
|
||||
new_syndicate_commando.mind.special_role = SPECIAL_ROLE_SYNDICATE_DEATHSQUAD
|
||||
ticker.mode.traitors |= new_syndicate_commando.mind //Adds them to current traitor list. Which is really the extra antagonist list.
|
||||
new_syndicate_commando.equip_syndicate_commando(syndicate_leader_selected)
|
||||
qdel(spawn_location)
|
||||
|
||||
@@ -59,21 +59,6 @@ var/global/vox_tick = 1
|
||||
W.registered_user = src
|
||||
equip_to_slot_or_del(W, slot_wear_id)
|
||||
|
||||
/*
|
||||
var/obj/item/weapon/implant/cortical/I = new(src)
|
||||
I.imp_in = src
|
||||
I.implanted = 1
|
||||
|
||||
if(ticker.mode && ( istype(ticker.mode,/datum/game_mode/vox/heist) ) )
|
||||
var/datum/game_mode/vox/heist/M = ticker.mode
|
||||
M.cortical_stacks += I
|
||||
M.raiders[mind] = I
|
||||
else if(ticker.mode && ( istype(ticker.mode,/datum/game_mode/vox/trade) ) )
|
||||
var/datum/game_mode/vox/trade/M = ticker.mode
|
||||
M.cortical_stacks += I
|
||||
M.traders[mind] = I
|
||||
|
||||
*/
|
||||
vox_tick++
|
||||
if(vox_tick > 4) vox_tick = 1
|
||||
|
||||
|
||||
@@ -19,8 +19,7 @@
|
||||
'icons/obj/arcade_images/prizeorbs.png')
|
||||
|
||||
/obj/machinery/arcade/claw/New()
|
||||
src.addAtProcessing()
|
||||
|
||||
..()
|
||||
machine_image = pick("_1", "_2")
|
||||
update_icon()
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
to_chat(user, "<B>Your wish is granted, but at a terrible cost...</B>")
|
||||
to_chat(user, "The Wish Granter punishes you for your wickedness, claiming your soul and warping your body to match the darkness in your heart.")
|
||||
ticker.mode.traitors += user.mind
|
||||
user.mind.special_role = "traitor"
|
||||
user.mind.special_role = SPECIAL_ROLE_TRAITOR
|
||||
var/datum/objective/hijack/hijack = new
|
||||
hijack.owner = user.mind
|
||||
user.mind.objectives += hijack
|
||||
|
||||
@@ -59,7 +59,7 @@ var/global/list/potentialRandomZlevels = generateMapList(filename = "config/away
|
||||
var/map = pick(potentialRandomZlevels)
|
||||
var/file = file(map)
|
||||
if(isfile(file))
|
||||
var/zlev = space_manager.add_new_zlevel(AWAY_MISSION, linkage = UNAFFECTED)
|
||||
var/zlev = space_manager.add_new_zlevel(AWAY_MISSION, linkage = UNAFFECTED, traits = list(AWAY_LEVEL,BLOCK_TELEPORT))
|
||||
space_manager.add_dirt(zlev)
|
||||
maploader.load_map(file, z_offset = zlev)
|
||||
late_setup_level(block(locate(1, 1, zlev), locate(world.maxx, world.maxy, zlev)))
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
/obj/item/clothing/gloves/combat
|
||||
desc = "These tactical gloves are somewhat fire and impact resistant."
|
||||
name = "combat gloves"
|
||||
icon_state = "black"
|
||||
icon_state = "combat"
|
||||
item_state = "swat_gl"
|
||||
siemens_coefficient = 0
|
||||
permeability_coefficient = 0.05
|
||||
|
||||
@@ -387,3 +387,14 @@
|
||||
icon_state = "papersack_smile"
|
||||
flags = BLOCKHAIR
|
||||
flags_inv = HIDEFACE|HIDEEARS
|
||||
|
||||
/obj/item/clothing/head/crown
|
||||
name = "crown"
|
||||
desc = "A crown fit for a king, a petty king maybe."
|
||||
icon_state = "crown"
|
||||
armor = list(melee = 15, bullet = 0, laser = 0, energy = 15, bomb = 0, bio = 0, rad = 0) //for a warrior king //energy cause gold is reflective //worse than sec helm overall
|
||||
|
||||
/obj/item/clothing/head/crown/fancy
|
||||
name = "magnificent crown"
|
||||
desc = "A crown worn by only the highest emperors of the land."
|
||||
icon_state = "fancycrown"
|
||||
@@ -115,8 +115,7 @@
|
||||
to_chat(H, "<span class='warning'>You cannot teleport into solid walls.</span>")
|
||||
return 0*///Who the fuck cares? Ninjas in walls are cool.
|
||||
|
||||
// TODO: Tie into space manager
|
||||
if(T.z in config.admin_levels)
|
||||
if(!is_teleport_allowed(T.z))
|
||||
to_chat(H, "<span class='warning'>You cannot use your teleporter on this Z-level.</span>")
|
||||
return 0
|
||||
|
||||
|
||||
@@ -164,6 +164,12 @@
|
||||
body_parts_covered = UPPER_TORSO|LOWER_TORSO
|
||||
armor = list(melee = 50, bullet = 40, laser = 50, energy = 10, bomb = 25, bio = 0, rad = 0)
|
||||
|
||||
/obj/item/clothing/suit/armor/vest/capcarapace/alt
|
||||
name = "captain's parade jacket"
|
||||
desc = "For when an armoured vest isn't fashionable enough."
|
||||
icon_state = "capformal"
|
||||
item_state = "capspacesuit"
|
||||
|
||||
/obj/item/clothing/suit/armor/riot
|
||||
name = "Riot Suit"
|
||||
desc = "A suit of armor with heavy padding to protect against melee attacks. Looks like it might impair movement."
|
||||
|
||||
@@ -463,6 +463,13 @@
|
||||
item_color = "sundress"
|
||||
body_parts_covered = UPPER_TORSO|LOWER_TORSO
|
||||
|
||||
/obj/item/clothing/under/captainparade
|
||||
name = "captain's parade uniform"
|
||||
desc = "A captain's luxury-wear, for special occasions."
|
||||
icon_state = "captain_parade"
|
||||
item_state = "by_suit"
|
||||
item_color = "captain_parade"
|
||||
|
||||
/obj/item/clothing/under/roman
|
||||
name = "roman armor"
|
||||
desc = "An ancient Roman armor. Made of metallic strips and leather straps."
|
||||
|
||||
@@ -181,8 +181,7 @@
|
||||
|
||||
//proc/camera_list(var/datum/file/camnet_key/key)
|
||||
get_machines(var/datum/file/camnet_key/key)
|
||||
// TODO: Tie into space manager
|
||||
if(!computer || computer.z > ZLEVEL_DERELICT)
|
||||
if(!computer || !is_away_level(computer.z))
|
||||
return null
|
||||
|
||||
var/list/L = list()
|
||||
|
||||
@@ -59,8 +59,7 @@
|
||||
Topic(var/href, var/list/href_list)
|
||||
if(!interactable() || !computer.radio || ..(href,href_list) )
|
||||
return
|
||||
// TODO: Tie into space manager
|
||||
if(!(computer.z in config.station_levels))
|
||||
if(!is_station_level(computer.z))
|
||||
to_chat(usr, "<span class='danger'>Unable to establish a connection</span>: You're too far away from the station!")
|
||||
return
|
||||
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
|
||||
|
||||
attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob, params)
|
||||
// TODO: Tie into space manager
|
||||
if(user.z > ZLEVEL_DERELICT)
|
||||
if(is_away_level(user.z))
|
||||
to_chat(user, "<span class='danger'>Unable to establish a connection</span>: You're too far away from the station!")
|
||||
return
|
||||
if(istype(module, /obj/item/weapon/aiModule))
|
||||
|
||||
@@ -49,8 +49,7 @@
|
||||
scan = computer.cardslot.reader
|
||||
if(!interactable())
|
||||
return
|
||||
// TODO: Tie into space manager
|
||||
if(computer.z > ZLEVEL_DERELICT)
|
||||
if(is_away_level(computer.z))
|
||||
to_chat(usr, "<span class='danger'>Unable to establish a connection</span>: You're too far away from the station!")
|
||||
return
|
||||
var/dat
|
||||
|
||||
@@ -43,8 +43,7 @@
|
||||
if(!T.implanted) continue
|
||||
var/loc_display = "Unknown"
|
||||
var/mob/living/carbon/M = T.imp_in
|
||||
// TODO: Tie into space manager
|
||||
if(M.z == ZLEVEL_STATION && !istype(M.loc, /turf/space))
|
||||
if(is_station_level(M.z) && !istype(M.loc, /turf/space))
|
||||
var/turf/mob_loc = get_turf(M)
|
||||
loc_display = mob_loc.loc
|
||||
dat += "ID: [T.id] | Location: [loc_display]<BR>"
|
||||
|
||||
@@ -31,8 +31,7 @@
|
||||
|
||||
|
||||
interact()
|
||||
// TODO: Tie into space manager
|
||||
if(!interactable() || computer.z > ZLEVEL_DERELICT)
|
||||
if(!interactable() || is_away_level(computer.z))
|
||||
return
|
||||
var/dat
|
||||
if(src.temp)
|
||||
|
||||
@@ -57,8 +57,7 @@
|
||||
if(!interactable())
|
||||
return
|
||||
|
||||
// TODO: Tie into space manager
|
||||
if(computer.z > ZLEVEL_DERELICT)
|
||||
if(is_away_level(computer.z))
|
||||
to_chat(usr, "<span class='danger'>Unable to establish a connection</span>: You're too far away from the station!")
|
||||
return
|
||||
var/dat
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
for(var/obj/O in radio_connection.devices)
|
||||
if(istype(O,typekey))
|
||||
T = get_turf(O)
|
||||
// TODO: Tie into space manager
|
||||
// TODO: Make the radio system cooperate with the space manager
|
||||
if(istype(O) && (subspace || (O.z == z_level))) // radio does not work across z-levels
|
||||
result |= O
|
||||
return result
|
||||
|
||||
@@ -306,6 +306,26 @@
|
||||
icon_state = "beret_hos"
|
||||
item_state = "beret_hos"
|
||||
|
||||
/obj/item/clothing/head/pirate/fluff/stumpy //MrFroztee: Stumpy
|
||||
name = "The Sobriety Skullcap"
|
||||
desc = "A hat suited for the king of the pirates"
|
||||
icon_state = "pirate"
|
||||
item_state = "pirate"
|
||||
|
||||
/obj/item/clothing/head/pirate/fluff/stumpy/New()
|
||||
..()
|
||||
processing_objects.Add(src)
|
||||
|
||||
/obj/item/clothing/head/pirate/fluff/stumpy/Destroy()
|
||||
processing_objects.Remove(src)
|
||||
return ..()
|
||||
|
||||
/obj/item/clothing/head/pirate/fluff/stumpy/process()
|
||||
if(ishuman(loc))
|
||||
var/mob/living/carbon/human/H = loc
|
||||
if(H.head == src)
|
||||
H.slurring = max(3, H.slurring) //always slur
|
||||
|
||||
//////////// Suits ////////////
|
||||
/obj/item/clothing/suit/storage/labcoat/fluff/aeneas_rinil //Socialsystem: Lynn Fea
|
||||
name = "Robotics labcoat"
|
||||
|
||||
@@ -17,8 +17,7 @@
|
||||
/datum/event/alien_infestation/start()
|
||||
var/list/vents = list()
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world)
|
||||
// TODO: Tie into space manager
|
||||
if((temp_vent.loc.z in config.station_levels) && !temp_vent.welded)
|
||||
if(is_station_level(temp_vent.loc.z) && !temp_vent.welded)
|
||||
if(temp_vent.parent.other_atmosmch.len > 50) //Stops Aliens getting stuck in small networks. See: Security, Virology
|
||||
vents += temp_vent
|
||||
|
||||
|
||||
@@ -19,8 +19,7 @@
|
||||
var/obj/item/device/radio/beacon/chosen
|
||||
var/list/possible = list()
|
||||
for(var/obj/item/device/radio/beacon/W in world)
|
||||
// TODO: Tie into space manager
|
||||
if(!(W.z in config.station_levels))
|
||||
if(!is_station_level(W.z))
|
||||
continue
|
||||
possible += W
|
||||
|
||||
|
||||
@@ -18,8 +18,7 @@
|
||||
|
||||
/datum/event/brand_intelligence/start()
|
||||
for(var/obj/machinery/vending/V in machines)
|
||||
// TODO: Tie into space manager
|
||||
if(V.z != ZLEVEL_STATION) continue
|
||||
if(!is_station_level(V.z)) continue
|
||||
vendingMachines.Add(V)
|
||||
|
||||
if(!vendingMachines.len)
|
||||
|
||||
@@ -16,13 +16,14 @@
|
||||
for(var/mob/living/carbon/human/H in shuffle(living_mob_list))
|
||||
if(issmall(H)) //don't infect monkies; that's a waste
|
||||
continue
|
||||
if(!H.client)
|
||||
continue
|
||||
if(H.species.virus_immune) //don't let virus immune things get diseases they're not supposed to get.
|
||||
continue
|
||||
var/turf/T = get_turf(H)
|
||||
if(!T)
|
||||
continue
|
||||
// TODO: Tie into space manager
|
||||
if(T.z != ZLEVEL_STATION)
|
||||
if(!is_station_level(T.z))
|
||||
continue
|
||||
var/foundAlready = 0 // don't infect someone that already has the virus
|
||||
for(var/datum/disease/D in H.viruses)
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
goal = locate(endx, endy, 1)
|
||||
src.x = startx
|
||||
src.y = starty
|
||||
src.z = ZLEVEL_STATION
|
||||
src.z = level_name_to_num(MAIN_STATION)
|
||||
spawn(0)
|
||||
walk_towards(src, goal, 1)
|
||||
return
|
||||
|
||||
@@ -22,8 +22,7 @@
|
||||
|
||||
for(var/obj/machinery/power/smes/S in machines)
|
||||
var/area/current_area = get_area(S)
|
||||
// TODO: Tie into space manager
|
||||
if(current_area.type in skipped_areas || !(S.z in config.station_levels))
|
||||
if(current_area.type in skipped_areas || !is_station_level(S.z))
|
||||
continue
|
||||
S.last_charge = S.charge
|
||||
S.last_output_attempt = S.output_attempt
|
||||
@@ -36,8 +35,7 @@
|
||||
|
||||
for(var/obj/machinery/power/apc/C in apcs)
|
||||
var/area/current_area = get_area(C)
|
||||
// TODO: Tie into space manager
|
||||
if(current_area.type in skipped_areas_apc || !(C.z in config.station_levels))
|
||||
if(current_area.type in skipped_areas_apc || !is_station_level(C.z))
|
||||
continue
|
||||
if(C.cell)
|
||||
C.cell.charge = 0
|
||||
@@ -50,15 +48,13 @@
|
||||
command_announcement.Announce("Power has been restored to [station_name()]. We apologize for the inconvenience.", "Power Systems Nominal", new_sound = 'sound/AI/poweron.ogg')
|
||||
for(var/obj/machinery/power/apc/C in apcs)
|
||||
var/area/current_area = get_area(C)
|
||||
// TODO: Tie into space manager
|
||||
if(current_area.type in skipped_areas_apc || !(C.z in config.station_levels))
|
||||
if(current_area.type in skipped_areas_apc || !is_station_level(C.z))
|
||||
continue
|
||||
if(C.cell)
|
||||
C.cell.charge = C.cell.maxcharge
|
||||
for(var/obj/machinery/power/smes/S in machines)
|
||||
var/area/current_area = get_area(S)
|
||||
// TODO: Tie into space manager
|
||||
if(current_area.type in skipped_areas || !(S.z in config.station_levels))
|
||||
if(current_area.type in skipped_areas || !is_station_level(S.z))
|
||||
continue
|
||||
S.charge = S.last_charge
|
||||
S.output_attempt = S.last_output_attempt
|
||||
@@ -70,8 +66,7 @@
|
||||
if(announce)
|
||||
command_announcement.Announce("All SMESs on [station_name()] have been recharged. We apologize for the inconvenience.", "Power Systems Nominal", new_sound = 'sound/AI/poweron.ogg')
|
||||
for(var/obj/machinery/power/smes/S in machines)
|
||||
// TODO: Tie into space manager
|
||||
if(S.z != ZLEVEL_STATION)
|
||||
if(!is_station_level(S.z))
|
||||
continue
|
||||
S.charge = S.capacity
|
||||
S.output_level = S.output_level_max
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/proc/Christmas_Game_Start()
|
||||
for(var/obj/structure/flora/tree/pine/xmas in world)
|
||||
// TODO: Tie into space manager
|
||||
if(!(xmas.z in config.station_levels)) continue
|
||||
if(!is_station_level(xmas.z)) continue
|
||||
for(var/turf/simulated/floor/T in orange(1,xmas))
|
||||
for(var/i=1,i<=rand(1,5),i++)
|
||||
new /obj/item/weapon/a_gift(T)
|
||||
|
||||
@@ -171,7 +171,7 @@ var/global/Holiday = null
|
||||
*/
|
||||
/* var/list/obj/containers = list()
|
||||
for(var/obj/item/weapon/storage/S in world)
|
||||
if(!(S.z in config.station_levels)) continue
|
||||
if(!is_station_level(S.z)) continue
|
||||
containers += S
|
||||
|
||||
message_admins("\blue DEBUG: Event: Egg spawned at [Egg.loc] ([Egg.x],[Egg.y],[Egg.z])")*/
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
command_announcement.Announce("High levels of radiation detected near the station. Please evacuate into one of the shielded maintenance tunnels.", "Anomaly Alert", new_sound = 'sound/AI/radiation.ogg')
|
||||
|
||||
for(var/area/A in world)
|
||||
// TODO: Tie into space manager
|
||||
if(!(A.z in config.station_levels) || is_safe_zone(A))
|
||||
if(!is_station_level(A.z) || is_safe_zone(A))
|
||||
continue
|
||||
A.radiation_alert()
|
||||
|
||||
@@ -43,8 +42,7 @@
|
||||
var/turf/T = get_turf(H)
|
||||
if(!T)
|
||||
continue
|
||||
// TODO: Tie into space manager
|
||||
if(!(T.z in config.station_levels) || is_safe_zone(T.loc))
|
||||
if(!is_station_level(T.z) || is_safe_zone(T.loc))
|
||||
continue
|
||||
|
||||
if(istype(H,/mob/living/carbon/human))
|
||||
@@ -63,8 +61,7 @@
|
||||
command_announcement.Announce("The station has passed the radiation belt. Please report to medbay if you experience any unusual symptoms. Maintenance will lose all access again shortly.", "Anomaly Alert")
|
||||
|
||||
for(var/area/A in world)
|
||||
// TODO: Tie into space manager
|
||||
if(!(A.z in config.station_levels) || is_safe_zone(A))
|
||||
if(!is_station_level(A.z) || is_safe_zone(A))
|
||||
continue
|
||||
A.reset_radiation_alert()
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
var/datum/effect/system/spark_spread/sparks = new /datum/effect/system/spark_spread()
|
||||
sparks.set_up(3, 0, D.loc)
|
||||
sparks.start()
|
||||
D.z = ZLEVEL_CENTCOMM
|
||||
D.z = level_name_to_num(CENTCOMM)
|
||||
D.has_loot = 0
|
||||
|
||||
qdel(D)
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
S.holder = holder
|
||||
player_mind.transfer_to(S)
|
||||
player_mind.assigned_role = "Slaughter Demon"
|
||||
player_mind.special_role = "Slaughter Demon"
|
||||
player_mind.special_role = SPECIAL_ROLE_SLAUGHTER_DEMON
|
||||
message_admins("[key_of_slaughter] has been made into a Slaughter Demon by an event.")
|
||||
log_game("[key_of_slaughter] was spawned as a Slaughter Demon by an event.")
|
||||
return 1
|
||||
|
||||
@@ -16,8 +16,7 @@
|
||||
|
||||
var/list/vents = list()
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world)
|
||||
// TODO: Tie into space manager
|
||||
if((temp_vent.loc.z in config.station_levels) && !temp_vent.welded)
|
||||
if(is_station_level(temp_vent.loc.z) && !temp_vent.welded)
|
||||
if(temp_vent.parent.other_atmosmch.len > 50)
|
||||
vents += temp_vent
|
||||
|
||||
|
||||
@@ -2,12 +2,14 @@
|
||||
for(var/mob/living/carbon/human/H in shuffle(living_mob_list))
|
||||
if(issmall(H)) //don't infect monkies; that's a waste.
|
||||
continue
|
||||
if(!H.client)
|
||||
continue
|
||||
if(H.species.virus_immune) //don't count things that are virus immune; they'll just get picked and auto-cure
|
||||
continue
|
||||
var/foundAlready = 0 //don't infect someone that already has the virus
|
||||
for(var/datum/disease/D in H.viruses)
|
||||
foundAlready = 1
|
||||
if(H.stat == 2 || foundAlready)
|
||||
if(H.stat == DEAD || foundAlready)
|
||||
continue
|
||||
|
||||
var/datum/disease/D = new /datum/disease/appendicitis
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
RS.start()
|
||||
RS.kill()
|
||||
for(var/area/A)
|
||||
// TODO: Tie into space manager
|
||||
if(!(A.z in config.station_levels)) continue //Spook on main station only.
|
||||
if(!is_station_level(A.z)) continue //Spook on main station only.
|
||||
if(A.luminosity) continue
|
||||
// if(A.lighting_space) continue
|
||||
if(A.type == /area) continue
|
||||
|
||||
@@ -11,8 +11,7 @@
|
||||
/datum/event/vent_clog/setup()
|
||||
endWhen = rand(25, 100)
|
||||
for(var/obj/machinery/atmospherics/unary/vent_scrubber/temp_vent in machines)
|
||||
// TODO: Tie into space manager
|
||||
if((temp_vent.loc.z in config.station_levels))
|
||||
if(is_station_level(temp_vent.loc.z))
|
||||
if(temp_vent.parent.other_atmosmch.len > 50)
|
||||
vents += temp_vent
|
||||
|
||||
|
||||
@@ -13,8 +13,7 @@
|
||||
|
||||
/datum/event/wormholes/start()
|
||||
for(var/turf/simulated/floor/T in world)
|
||||
// TODO: Tie into space manager
|
||||
if((T.z in config.station_levels))
|
||||
if(is_station_level(T.z))
|
||||
pick_turfs += T
|
||||
|
||||
for(var/i in 1 to number_of_wormholes)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/datum/holiday/xmas/celebrate()
|
||||
for(var/obj/structure/flora/tree/pine/xmas in world)
|
||||
// TODO: Tie into space manager
|
||||
if(!(xmas.z in config.station_levels)) continue
|
||||
if(!is_station_level(xmas.z)) continue
|
||||
for(var/turf/simulated/floor/T in orange(1,xmas))
|
||||
for(var/i=1,i<=rand(1,5),i++)
|
||||
new /obj/item/weapon/a_gift(T)
|
||||
|
||||
@@ -376,8 +376,7 @@
|
||||
|
||||
// Bluespace tomato code copied over from grown.dm.
|
||||
if(get_trait(TRAIT_TELEPORTING))
|
||||
// TODO: Tie into space manager
|
||||
if(target.z in config.admin_levels)
|
||||
if(!is_teleport_allowed(target.z))
|
||||
return 1
|
||||
|
||||
//Plant potency determines radius of teleport.
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
var/point_upgrade = 1
|
||||
var/list/ore_values = list(("sand" = 1), ("iron" = 1), ("plasma" = 15), ("silver" = 16), ("gold" = 18), ("uranium" = 30), ("diamond" = 50), ("bluespace crystal" = 50), ("bananium" = 60), ("tranquillite" = 60))
|
||||
var/list/supply_consoles = list("Science", "Robotics", "Research Director's Desk", "Mechanic", "Engineering" = list("metal", "glass", "plasma"), "Chief Engineer's Desk" = list("metal", "glass", "plasma"), "Atmospherics" = list("metal", "glass", "plasma"), "Bar" = list("uranium", "plasma"), "Virology" = list("plasma", "uranium", "gold"))
|
||||
speed_process = 1
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/New()
|
||||
..()
|
||||
@@ -528,8 +529,7 @@
|
||||
|
||||
/obj/item/device/wormhole_jaunter/attack_self(mob/user as mob)
|
||||
var/turf/device_turf = get_turf(user)
|
||||
// TODO: Tie into space manager
|
||||
if(!device_turf||device_turf.z==ZLEVEL_CENTCOMM||device_turf.z>=ZLEVEL_EMPTY)
|
||||
if(!device_turf||is_teleport_allowed(device_turf.z))
|
||||
to_chat(user, "<span class='notice'>You're having difficulties getting the [src.name] to work.</span>")
|
||||
return
|
||||
else
|
||||
@@ -537,8 +537,7 @@
|
||||
var/list/L = list()
|
||||
for(var/obj/item/device/radio/beacon/B in world)
|
||||
var/turf/T = get_turf(B)
|
||||
// TODO: Tie into space manager
|
||||
if(T.z == ZLEVEL_STATION)
|
||||
if(is_station_level(T.z))
|
||||
L += B
|
||||
if(!L.len)
|
||||
to_chat(user, "<span class='notice'>The [src.name] failed to create a wormhole.</span>")
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
var/stack_amt = 50; //ammount to stack before releassing
|
||||
input_dir = EAST
|
||||
output_dir = WEST
|
||||
speed_process = 1
|
||||
|
||||
/obj/machinery/mineral/stacking_machine/proc/process_sheet(obj/item/stack/sheet/inp)
|
||||
if(!(inp.type in stack_list)) //It's the first of this sheet added
|
||||
@@ -89,4 +90,4 @@
|
||||
if(T)
|
||||
for(var/obj/item/stack/sheet/S in T)
|
||||
process_sheet(S)
|
||||
|
||||
CHECK_TICK
|
||||
@@ -9,6 +9,7 @@
|
||||
anchored = 1.0
|
||||
input_dir = WEST
|
||||
output_dir = EAST
|
||||
speed_process = 1
|
||||
|
||||
/obj/machinery/mineral/unloading_machine/process()
|
||||
var/turf/T = get_step(src,input_dir)
|
||||
@@ -21,8 +22,11 @@
|
||||
limit++
|
||||
if(limit>=10)
|
||||
return
|
||||
CHECK_TICK
|
||||
CHECK_TICK
|
||||
for(var/obj/item/I in T)
|
||||
unload_mineral(I)
|
||||
limit++
|
||||
if(limit>=10)
|
||||
return
|
||||
return
|
||||
CHECK_TICK
|
||||
@@ -21,6 +21,7 @@
|
||||
var/processing = 0
|
||||
var/chosen = "metal" //which material will be used to make coins
|
||||
var/coinsToProduce = 10
|
||||
speed_process = 1
|
||||
|
||||
/obj/machinery/mineral/mint/process()
|
||||
var/turf/T = get_step(src,input_dir)
|
||||
@@ -28,29 +29,28 @@
|
||||
for(var/obj/item/stack/sheet/O in T)
|
||||
if(istype(O, /obj/item/stack/sheet/mineral/gold))
|
||||
amt_gold += 100 * O.amount
|
||||
O.loc = null
|
||||
qdel(O)
|
||||
if(istype(O, /obj/item/stack/sheet/mineral/silver))
|
||||
amt_silver += 100 * O.amount
|
||||
O.loc = null
|
||||
qdel(O)
|
||||
if(istype(O, /obj/item/stack/sheet/mineral/diamond))
|
||||
amt_diamond += 100 * O.amount
|
||||
O.loc = null
|
||||
qdel(O)
|
||||
if(istype(O, /obj/item/stack/sheet/mineral/plasma))
|
||||
amt_plasma += 100 * O.amount
|
||||
O.loc = null
|
||||
qdel(O)
|
||||
if(istype(O, /obj/item/stack/sheet/mineral/uranium))
|
||||
amt_uranium += 100 * O.amount
|
||||
O.loc = null
|
||||
qdel(O)
|
||||
if(istype(O, /obj/item/stack/sheet/metal))
|
||||
amt_iron += 100 * O.amount
|
||||
O.loc = null
|
||||
qdel(O)
|
||||
if(istype(O, /obj/item/stack/sheet/mineral/bananium))
|
||||
amt_clown += 100 * O.amount
|
||||
O.loc = null
|
||||
qdel(O)
|
||||
if(istype(O, /obj/item/stack/sheet/mineral/tranquillite))
|
||||
amt_mime += 100 * O.amount
|
||||
O.loc = null
|
||||
return
|
||||
qdel(O)
|
||||
|
||||
|
||||
/obj/machinery/mineral/mint/attack_hand(user as mob) //TODO: Adamantine coins! -Durandan
|
||||
|
||||
@@ -240,8 +240,7 @@
|
||||
/obj/item/weapon/ore/New()
|
||||
pixel_x = rand(0,16)-8
|
||||
pixel_y = rand(0,8)-8
|
||||
// TODO: Tie into space manager
|
||||
if(src.z == ZLEVEL_ASTEROID)
|
||||
if(is_mining_level(src.z))
|
||||
score_oremined++ //When ore spawns, increment score. Only include ore spawned on mining asteroid (No Clown Planet)
|
||||
|
||||
/obj/item/weapon/ore/ex_act()
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
ventcrawler = 2
|
||||
|
||||
/mob/living/carbon/alien/New()
|
||||
verbs += /mob/living/carbon/verb/mob_sleep
|
||||
verbs += /mob/living/verb/mob_sleep
|
||||
verbs += /mob/living/verb/lay_down
|
||||
internal_organs += new /obj/item/organ/internal/brain/xeno
|
||||
internal_organs += new /obj/item/organ/internal/xenos/hivenode
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
ticker.mode.xenos += new_xeno.mind
|
||||
new_xeno.mind.name = new_xeno.name
|
||||
new_xeno.mind.assigned_role = "MODE"
|
||||
new_xeno.mind.special_role = "Alien"
|
||||
new_xeno.mind.special_role = SPECIAL_ROLE_XENOMORPH
|
||||
new_xeno << sound('sound/voice/hiss5.ogg',0,0,0,100)//To get the player's attention
|
||||
|
||||
if(gib_on_success)
|
||||
|
||||
@@ -364,7 +364,7 @@
|
||||
traitorType = inPers
|
||||
|
||||
ticker.mode.traitors += mind
|
||||
mind.special_role = "traitor"
|
||||
mind.special_role = SPECIAL_ROLE_TRAITOR
|
||||
var/datum/mindslaves/slaved = new()
|
||||
slaved.masters += mind
|
||||
mind.som = slaved
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
/datum/species/golem/handle_post_spawn(var/mob/living/carbon/human/H)
|
||||
if(H.mind)
|
||||
H.mind.assigned_role = "Golem"
|
||||
H.mind.special_role = "Golem"
|
||||
H.mind.special_role = SPECIAL_ROLE_GOLEM
|
||||
H.real_name = "adamantine golem ([rand(1, 1000)])"
|
||||
H.name = H.real_name
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/golem(H), slot_w_uniform)
|
||||
|
||||
@@ -18,10 +18,7 @@
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T)
|
||||
return 0
|
||||
// TODO: Tie into space manager
|
||||
if(T.z == ZLEVEL_CENTCOMM) //dont detect mobs on centcomm
|
||||
return 0
|
||||
if(T.z >= MAX_Z)
|
||||
if(!is_level_reachable(T.z))
|
||||
return 0
|
||||
if(user != null && src == user)
|
||||
return 0
|
||||
|
||||
@@ -639,15 +639,13 @@ var/list/ai_verbs_default = list(
|
||||
if(check_unable(AI_CHECK_WIRELESS | AI_CHECK_RADIO))
|
||||
return
|
||||
|
||||
var/ai_allowed_Zlevel = list(ZLEVEL_STATION,ZLEVEL_TELECOMMS,ZLEVEL_ASTEROID)
|
||||
var/d
|
||||
var/area/bot_area
|
||||
d += "<A HREF=?src=\ref[src];botrefresh=\ref[Bot]>Query network status</A><br>"
|
||||
d += "<table width='100%'><tr><td width='40%'><h3>Name</h3></td><td width='20%'><h3>Status</h3></td><td width='30%'><h3>Location</h3></td><td width='10%'><h3>Control</h3></td></tr>"
|
||||
|
||||
for(var/mob/living/simple_animal/bot/Bot in simple_animal_list)
|
||||
// TODO: Tie into space manager
|
||||
if((Bot.z in ai_allowed_Zlevel) && !Bot.remote_disabled) //Only non-emagged bots on the allowed Z-level are detected!
|
||||
if(is_ai_allowed(Bot.z) && !Bot.remote_disabled) //Only non-emagged bots on the allowed Z-level are detected!
|
||||
bot_area = get_area(Bot)
|
||||
d += "<tr><td width='30%'>[Bot.hacked ? "<span class='bad'>(!) </span>[Bot.name]" : Bot.name] ([Bot.model])</td>"
|
||||
//If the bot is on, it will display the bot's current mode status. If the bot is not mode, it will just report "Idle". "Inactive if it is not on at all.
|
||||
@@ -1106,7 +1104,7 @@ var/list/ai_verbs_default = list(
|
||||
to_chat(user, "<span class='warning'>No intelligence patterns detected.</span>")//No more magical carding of empty cores, AI RETURN TO BODY!!!11
|
||||
|
||||
return
|
||||
if(mind.special_role == "malfunction") //AI MALF!!
|
||||
if(mind.special_role == SPECIAL_ROLE_MALF) //AI MALF!!
|
||||
to_chat(user, "<span class='boldannounce'>ERROR</span>: Remote transfer interface disabled.")//Do ho ho ho~
|
||||
|
||||
return
|
||||
@@ -1149,4 +1147,4 @@ var/list/ai_verbs_default = list(
|
||||
rendered = "<i><span class='game say'>Relayed Speech: <span class='name'>[name_used]</span> [speaking.format_message(text, verb)]</span></i>"
|
||||
else
|
||||
rendered = "<i><span class='game say'>Relayed Speech: <span class='name'>[name_used]</span> [verb], <span class='message'>\"[text]\"</span></span></i>"
|
||||
show_message(rendered, 2)
|
||||
show_message(rendered, 2)
|
||||
|
||||
@@ -123,6 +123,7 @@
|
||||
on_ui_interact(mob/living/silicon/pai/user, datum/nanoui/ui=null, force_open=1)
|
||||
|
||||
var/data[0]
|
||||
data_core.get_manifest_json()
|
||||
data["manifest"] = PDA_Manifest
|
||||
|
||||
ui = nanomanager.try_update_ui(user, user, id, ui, data, force_open)
|
||||
@@ -499,8 +500,7 @@
|
||||
/mob/living/silicon/pai/proc/hackloop()
|
||||
var/turf/T = get_turf_or_move(src.loc)
|
||||
for(var/mob/living/silicon/ai/AI in player_list)
|
||||
// TODO: Tie into space manager
|
||||
if(!T || !(T.z in config.contact_levels))
|
||||
if(!T || !is_station_contact(T.z))
|
||||
break
|
||||
if(T.loc)
|
||||
to_chat(AI, "<font color = red><b>Network Alert: Brute-force encryption crack in progress in [T.loc].</b></font>")
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
photosync()
|
||||
to_chat(src, "<b>Laws synced with AI, be sure to note any changes.</b>")
|
||||
// TODO: Update to new antagonist system.
|
||||
if(mind && mind.special_role == "traitor" && mind.original == src)
|
||||
if(mind && mind.special_role == SPECIAL_ROLE_TRAITOR && mind.original == src)
|
||||
to_chat(src, "<b>Remember, your AI does NOT share or know about your law 0.")
|
||||
else
|
||||
to_chat(src, "<b>No AI selected to sync laws with, disabling lawsync protocol.</b>")
|
||||
@@ -30,7 +30,7 @@
|
||||
to_chat(who, "<b>Obey these laws:</b>")
|
||||
laws.show_laws(who)
|
||||
// TODO: Update to new antagonist system.
|
||||
if(mind && (mind.special_role == "traitor" && mind.original == src) && connected_ai)
|
||||
if(mind && (mind.special_role == SPECIAL_ROLE_TRAITOR && mind.original == src) && connected_ai)
|
||||
to_chat(who, "<b>Remember, [connected_ai.name] is technically your master, but your objective comes first.</b>")
|
||||
else if(connected_ai)
|
||||
to_chat(who, "<b>Remember, [connected_ai.name] is your master, other AIs can be ignored.</b>")
|
||||
|
||||
@@ -1380,7 +1380,7 @@ var/list/robot_verbs_default = list(
|
||||
var/mob/M = pick(borg_candidates)
|
||||
M.mind.transfer_to(src)
|
||||
M.mind.assigned_role = "MODE"
|
||||
M.mind.special_role = "Death Commando"
|
||||
M.mind.special_role = SPECIAL_ROLE_DEATHSQUAD
|
||||
ticker.mode.traitors |= M.mind // Adds them to current traitor list. Which is really the extra antagonist list.
|
||||
key = M.key
|
||||
else
|
||||
|
||||
@@ -50,8 +50,21 @@ proc/isNonCrewAntag(A)
|
||||
|
||||
var/mob/living/carbon/C = A
|
||||
var/special_role = C.mind.special_role
|
||||
var/list/crew_roles = list("traitor", "Changeling", "Vampire", "Cultist", "Head Revolutionary", "Revolutionary", "malfunctioning AI", "Shadowling", "loyalist", "mutineer", "Response Team")
|
||||
if((special_role in crew_roles))
|
||||
var/list/crew_roles = list(
|
||||
SPECIAL_ROLE_BLOB,
|
||||
SPECIAL_ROLE_CULTIST,
|
||||
SPECIAL_ROLE_CHANGELING,
|
||||
SPECIAL_ROLE_ERT,
|
||||
SPECIAL_ROLE_HEAD_REV,
|
||||
SPECIAL_ROLE_MALF,
|
||||
SPECIAL_ROLE_REV,
|
||||
SPECIAL_ROLE_SHADOWLING,
|
||||
SPECIAL_ROLE_SHADOWLING_THRALL,
|
||||
SPECIAL_ROLE_TRAITOR,
|
||||
SPECIAL_ROLE_VAMPIRE,
|
||||
SPECIAL_ROLE_VAMPIRE_THRALL
|
||||
)
|
||||
if(special_role in crew_roles)
|
||||
return 0
|
||||
|
||||
return 1
|
||||
@@ -340,23 +353,24 @@ var/list/intents = list(I_HELP,I_DISARM,I_GRAB,I_HARM)
|
||||
hud_used.action_intent.icon_state = "help"
|
||||
|
||||
|
||||
/mob/living/carbon/verb/mob_sleep()
|
||||
/mob/living/verb/mob_sleep()
|
||||
set name = "Sleep"
|
||||
set category = "IC"
|
||||
|
||||
if(usr.sleeping)
|
||||
to_chat(usr, "\red You are already sleeping")
|
||||
if(sleeping)
|
||||
to_chat(src, "<span class='notice'>You are already sleeping.</span>")
|
||||
return
|
||||
else
|
||||
if(alert(src,"You sure you want to sleep for a while?","Sleep","Yes","No") == "Yes")
|
||||
usr.sleeping = 20 //Short nap
|
||||
if(alert(src, "You sure you want to sleep for a while?", "Sleep", "Yes", "No") == "Yes")
|
||||
SetSleeping(20) //Short nap
|
||||
|
||||
/mob/living/verb/lay_down()
|
||||
set name = "Rest"
|
||||
set category = "IC"
|
||||
|
||||
resting = !resting
|
||||
to_chat(src, "\blue You are now [resting ? "resting" : "getting up"]")
|
||||
update_canmove()
|
||||
to_chat(src, "<span class='notice'>You are now [resting ? "resting" : "getting up"].</span>")
|
||||
|
||||
/proc/is_blind(A)
|
||||
if(iscarbon(A))
|
||||
|
||||
@@ -211,6 +211,7 @@
|
||||
icobase = H.species.icobase
|
||||
if(H.species.bodyflags & HAS_TAIL)
|
||||
coloured_tail = H.species.tail
|
||||
qdel(H)
|
||||
else
|
||||
icobase = current_species.icobase
|
||||
else
|
||||
|
||||
@@ -41,8 +41,7 @@
|
||||
// Prevents the AI from using Topic on admin levels (by for example viewing through the court/thunderdome cameras)
|
||||
// unless it's on the same level as the object it's interacting with.
|
||||
var/turf/T = get_turf(src_object)
|
||||
// TODO: Tie into space manager
|
||||
if(!T || !(z == T.z || (T.z in config.player_levels)))
|
||||
if(!T || !(atoms_share_level(src,T) || is_level_reachable(T.z)))
|
||||
return STATUS_CLOSE
|
||||
|
||||
// If an object is in view then we can interact with it
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
if(..())
|
||||
return 1
|
||||
var/turf/T = get_turf(nano_host())
|
||||
// TODO: Tie into space manager
|
||||
if(!T || !(T.z in config.player_levels))
|
||||
if(!T || !is_level_reachable(T.z))
|
||||
to_chat(usr, "<span class='warning'>Unable to establish a connection<span>: You're too far away from the station!")
|
||||
return 0
|
||||
if(href_list["track"])
|
||||
|
||||
@@ -316,8 +316,7 @@
|
||||
if(shuttle_master.supply.mode == SHUTTLE_CALL)
|
||||
supplyData["shuttle_moving"] = 1
|
||||
|
||||
// TODO: Tie into space manager
|
||||
if(shuttle_master.supply.z != ZLEVEL_STATION)
|
||||
if(!is_station_level(shuttle_master.supply.z))
|
||||
supplyData["shuttle_loc"] = "station"
|
||||
else
|
||||
supplyData["shuttle_loc"] = "centcom"
|
||||
|
||||
@@ -158,7 +158,7 @@
|
||||
if(signal.data["done"])
|
||||
useTC = 1
|
||||
var/turf/pos = get_turf(P)
|
||||
// TODO: Tie into space manager
|
||||
// TODO: Make the radio system cooperate with the space manager
|
||||
if(pos.z in signal.data["level"])
|
||||
useTC = 2
|
||||
//Let's make this barely readable
|
||||
|
||||
@@ -170,8 +170,7 @@
|
||||
apcs -= src
|
||||
if(malfai && operating)
|
||||
if(ticker.mode.config_tag == "malfunction")
|
||||
// TODO: Tie into space manager
|
||||
if(src.z == ZLEVEL_STATION)
|
||||
if(is_station_level(src.z))
|
||||
ticker.mode:apcs--
|
||||
area.power_light = 0
|
||||
area.power_equip = 0
|
||||
@@ -996,8 +995,7 @@
|
||||
malfai.malfhacking = 0
|
||||
locked = 1
|
||||
if(ticker.mode.config_tag == "malfunction")
|
||||
// TODO: Tie into space manager
|
||||
if((src.z in config.station_levels)) //if(is_type_in_list(get_area(src), the_station_areas))
|
||||
if(is_station_level(src.z)) //if(is_type_in_list(get_area(src), the_station_areas))
|
||||
ticker.mode:apcs++
|
||||
if(usr:parent)
|
||||
src.malfai = usr:parent
|
||||
@@ -1029,8 +1027,7 @@
|
||||
|
||||
if(malfai)
|
||||
if(ticker.mode.config_tag == "malfunction")
|
||||
// TODO: Tie into space manager
|
||||
if((src.z in config.station_levels)) //if(is_type_in_list(get_area(src), the_station_areas))
|
||||
if(is_station_level(src.z)) //if(is_type_in_list(get_area(src), the_station_areas))
|
||||
operating ? ticker.mode:apcs++ : ticker.mode:apcs--
|
||||
|
||||
src.update()
|
||||
@@ -1045,8 +1042,7 @@
|
||||
if(!malf.can_shunt)
|
||||
to_chat(malf, "<span class='warning'>You cannot shunt.</span>")
|
||||
return
|
||||
// TODO: Tie into space manager
|
||||
if(!(src.z in config.station_levels))
|
||||
if(!is_station_level(src.z))
|
||||
return
|
||||
src.occupier = new /mob/living/silicon/ai(src,malf.laws,null,1)
|
||||
src.occupier.adjustOxyLoss(malf.getOxyLoss())
|
||||
@@ -1095,8 +1091,7 @@
|
||||
|
||||
/obj/machinery/power/apc/proc/ion_act()
|
||||
//intended to be exactly the same as an AI malf attack
|
||||
// TODO: Tie into space manager
|
||||
if(!src.malfhack && (src.z in config.station_levels))
|
||||
if(!src.malfhack && is_station_level(src.z))
|
||||
if(prob(3))
|
||||
src.locked = 1
|
||||
if(src.cell.charge > 0)
|
||||
@@ -1371,8 +1366,7 @@
|
||||
/obj/machinery/power/apc/proc/set_broken()
|
||||
if(malfai && operating)
|
||||
if(ticker.mode.config_tag == "malfunction")
|
||||
// TODO: Tie into space manager
|
||||
if((src.z in config.station_levels)) //if(is_type_in_list(get_area(src), the_station_areas))
|
||||
if(is_station_level(src.z)) //if(is_type_in_list(get_area(src), the_station_areas))
|
||||
ticker.mode:apcs--
|
||||
stat |= BROKEN
|
||||
operating = 0
|
||||
|
||||
@@ -124,8 +124,7 @@ var/const/GRAV_NEEDS_WRENCH = 3
|
||||
O.main_part = null
|
||||
qdel(O)
|
||||
for(var/area/A in world)
|
||||
// TODO: Tie into space manager
|
||||
if(!(A.z in config.station_levels)) continue
|
||||
if(!is_station_level(A.z)) continue
|
||||
A.gravitychange(0,A)
|
||||
shake_everyone()
|
||||
return ..()
|
||||
@@ -302,8 +301,7 @@ var/const/GRAV_NEEDS_WRENCH = 3
|
||||
investigate_log("was brought online and is now producing gravity for this level.", "gravity")
|
||||
message_admins("The gravity generator was brought online. (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>[area.name]</a>)")
|
||||
for(var/area/A in world)
|
||||
// TODO: Tie into space manager
|
||||
if(!(A.z in config.station_levels)) continue
|
||||
if(!is_station_level(A.z)) continue
|
||||
A.gravitychange(1,A)
|
||||
else
|
||||
if(gravity_in_level() == 1)
|
||||
@@ -311,8 +309,7 @@ var/const/GRAV_NEEDS_WRENCH = 3
|
||||
investigate_log("was brought offline and there is now no gravity for this level.", "gravity")
|
||||
message_admins("The gravity generator was brought offline with no backup generator. (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>[area.name]</a>)")
|
||||
for(var/area/A in world)
|
||||
// TODO: Tie into space manager
|
||||
if(!(A.z in config.station_levels)) continue
|
||||
if(!is_station_level(A.z)) continue
|
||||
A.gravitychange(0,A)
|
||||
|
||||
update_icon()
|
||||
@@ -380,7 +377,7 @@ var/const/GRAV_NEEDS_WRENCH = 3
|
||||
shake_camera(M, 15, 1)
|
||||
M.playsound_local(our_turf, 'sound/effects/alert.ogg', 100, 1, 0.5)
|
||||
|
||||
// TODO: Tie into space manager
|
||||
// TODO: Make the gravity generator cooperate with the space manager
|
||||
/obj/machinery/gravity_generator/main/proc/gravity_in_level()
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T)
|
||||
@@ -389,7 +386,6 @@ var/const/GRAV_NEEDS_WRENCH = 3
|
||||
return length(gravity_generators["[T.z]"])
|
||||
return 0
|
||||
|
||||
// TODO: Tie into space manager
|
||||
/obj/machinery/gravity_generator/main/proc/update_list()
|
||||
var/turf/T = get_turf(src.loc)
|
||||
if(T)
|
||||
|
||||
@@ -433,8 +433,7 @@
|
||||
return 1
|
||||
|
||||
/obj/machinery/power/smes/proc/ion_act()
|
||||
// TODO: Tie into space manager
|
||||
if(src.z in config.station_levels)
|
||||
if(is_station_level(src.z))
|
||||
if(prob(1)) //explosion
|
||||
for(var/mob/M in viewers(src))
|
||||
M.show_message("\red The [src.name] is making strange noises!", 3, "\red You hear sizzling electronics.", 2)
|
||||
|
||||
@@ -23,8 +23,7 @@
|
||||
var/turf/T = get_turf(R)
|
||||
if(!T)
|
||||
continue
|
||||
// TODO: Tie into space manager
|
||||
if((T.z in config.admin_levels) || T.z > ZLEVEL_EMPTY)
|
||||
if(!is_teleport_allowed(T.z))
|
||||
continue
|
||||
if(R.syndicate == 1)
|
||||
continue
|
||||
|
||||
@@ -276,17 +276,9 @@ obj/item/projectile/kinetic/New()
|
||||
|
||||
/obj/item/projectile/beam/wormhole/on_hit(atom/target)
|
||||
if(ismob(target))
|
||||
var/turf/portal_destination = pick(orange(6, src))
|
||||
do_teleport(target, portal_destination)
|
||||
return ..()
|
||||
if(!gun)
|
||||
qdel(src)
|
||||
gun.create_portal(src)
|
||||
|
||||
/obj/item/projectile/beam/wormhole/on_hit(atom/target)
|
||||
if(ismob(target))
|
||||
var/turf/portal_destination = pick(orange(6, src))
|
||||
do_teleport(target, portal_destination)
|
||||
if(is_teleport_allowed(target.z))
|
||||
var/turf/portal_destination = pick(orange(6, src))
|
||||
do_teleport(target, portal_destination)
|
||||
return ..()
|
||||
if(!gun)
|
||||
qdel(src)
|
||||
|
||||
@@ -201,6 +201,7 @@
|
||||
result = "uplink"
|
||||
required_reagents = list("rum" = 1, "vodka" = 1, "tequila" = 1, "whiskey" = 1, "synthanol" = 1)
|
||||
result_amount = 5
|
||||
mix_message = "The chemicals mix to create a shiny, orange substance."
|
||||
|
||||
/datum/reagent/ethanol/synthanol/synthnsoda
|
||||
name = "Synth 'n Soda"
|
||||
@@ -216,6 +217,7 @@
|
||||
result = "synthnsoda"
|
||||
required_reagents = list("synthanol" = 1, "cola" = 1)
|
||||
result_amount = 2
|
||||
mix_message = "The chemicals mix to create a smooth, fizzy substance."
|
||||
|
||||
/datum/reagent/ethanol/synthanol/synthignon
|
||||
name = "Synthignon"
|
||||
@@ -231,5 +233,6 @@
|
||||
result = "synthignon"
|
||||
required_reagents = list("synthanol" = 1, "wine" = 1)
|
||||
result_amount = 2
|
||||
mix_message = "The chemicals mix to create a fine, red substance."
|
||||
|
||||
// ROBOT ALCOHOL ENDS
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
|
||||
/datum/reagent/mugwort/on_mob_life(mob/living/M)
|
||||
if(ishuman(M) && M.mind)
|
||||
if(M.mind.special_role == "Wizard")
|
||||
if(M.mind.special_role == SPECIAL_ROLE_WIZARD)
|
||||
M.adjustToxLoss(-1*REM)
|
||||
M.adjustOxyLoss(-1*REM)
|
||||
M.adjustBruteLoss(-1*REM)
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
var/list/affecting // the list of all items that will be moved this ptick
|
||||
var/id = "" // the control ID - must match controller ID
|
||||
var/verted = 1 // set to -1 to have the conveyour belt be inverted, so you can use the other corner icons
|
||||
speed_process = 1
|
||||
|
||||
/obj/machinery/conveyor/centcom_auto
|
||||
id = "round_end_belt"
|
||||
@@ -105,15 +106,12 @@
|
||||
use_power(100)
|
||||
|
||||
affecting = loc.contents - src // moved items will be all in loc
|
||||
spawn(1) // slight delay to prevent infinite propagation due to map order //TODO: please no spawn() in process(). It's a very bad idea
|
||||
var/items_moved = 0
|
||||
for(var/atom/movable/A in affecting)
|
||||
if(!A.anchored)
|
||||
if(A.loc == src.loc) // prevents the object from being affected if it's not currently here.
|
||||
step(A,movedir)
|
||||
items_moved++
|
||||
if(items_moved >= 10)
|
||||
break
|
||||
sleep(1)
|
||||
for(var/atom/movable/A in affecting)
|
||||
if(!A.anchored)
|
||||
if(A.loc == loc) // prevents the object from being affected if it's not currently here.
|
||||
step(A,movedir)
|
||||
CHECK_TICK
|
||||
|
||||
// attack with item, place item on conveyor
|
||||
/obj/machinery/conveyor/attackby(var/obj/item/I, mob/user, params)
|
||||
@@ -183,7 +181,7 @@
|
||||
|
||||
var/list/conveyors // the list of converyors that are controlled by this switch
|
||||
anchored = 1
|
||||
|
||||
speed_process = 1
|
||||
|
||||
|
||||
/obj/machinery/conveyor_switch/New()
|
||||
@@ -218,6 +216,7 @@
|
||||
for(var/obj/machinery/conveyor/C in conveyors)
|
||||
C.operating = position
|
||||
C.setmove()
|
||||
CHECK_TICK
|
||||
|
||||
// attack with hand, switch position
|
||||
/obj/machinery/conveyor_switch/attack_hand(mob/user)
|
||||
@@ -241,10 +240,11 @@
|
||||
update()
|
||||
|
||||
// find any switches with same id as this one, and set their positions to match us
|
||||
for(var/obj/machinery/conveyor_switch/S in world)
|
||||
for(var/obj/machinery/conveyor_switch/S in machines)
|
||||
if(S.id == src.id)
|
||||
S.position = position
|
||||
S.update()
|
||||
CHECK_TICK
|
||||
|
||||
/obj/machinery/conveyor_switch/oneway
|
||||
var/convdir = 1 //Set to 1 or -1 depending on which way you want the convayor to go. (In other words keep at 1 and set the proper dir on the belts.)
|
||||
|
||||
@@ -729,7 +729,7 @@
|
||||
to_chat(user, "<span class='notice'>The [src] begins to vibrate!</span>")
|
||||
spawn(rand(10,30))
|
||||
var/turf/userturf = get_turf(user)
|
||||
if(src.loc == user && userturf.z != ZLEVEL_CENTCOMM) //Because Nuke Ops bringing this back on their shuttle, then looting the ERT area is 2fun4you!
|
||||
if(src.loc == user && is_teleport_allowed(userturf.z)) //Because Nuke Ops bringing this back on their shuttle, then looting the ERT area is 2fun4you!
|
||||
visible_message("<span class='notice'>The [src] twists and bends, relocating itself!</span>")
|
||||
throwSmoke(userturf)
|
||||
do_teleport(user, userturf, 8, asoundin = 'sound/effects/phasein.ogg')
|
||||
|
||||
@@ -37,8 +37,7 @@
|
||||
CC.post_status("alert", "outline")
|
||||
|
||||
for(var/obj/machinery/firealarm/FA in world)
|
||||
// TODO: Tie into space manager
|
||||
if((FA.z in config.contact_levels))
|
||||
if(is_station_contact(FA.z))
|
||||
FA.overlays = list()
|
||||
FA.overlays += image('icons/obj/monitors.dmi', "overlay_green")
|
||||
|
||||
@@ -54,8 +53,7 @@
|
||||
CC.post_status("alert", "outline")
|
||||
|
||||
for(var/obj/machinery/firealarm/FA in world)
|
||||
// TODO: Tie into space manager
|
||||
if((FA.z in config.contact_levels))
|
||||
if(is_station_contact(FA.z))
|
||||
FA.overlays = list()
|
||||
FA.overlays += image('icons/obj/monitors.dmi', "overlay_blue")
|
||||
|
||||
@@ -67,8 +65,7 @@
|
||||
security_level = SEC_LEVEL_RED
|
||||
|
||||
var/obj/machinery/door/airlock/highsecurity/red/R = locate(/obj/machinery/door/airlock/highsecurity/red) in world
|
||||
// TODO: Tie into space manager
|
||||
if(R && (R.z in config.station_levels))
|
||||
if(R && is_station_level(R.z))
|
||||
R.locked = 0
|
||||
R.update_icon()
|
||||
|
||||
@@ -77,8 +74,7 @@
|
||||
CC.post_status("alert", "redalert")
|
||||
|
||||
for(var/obj/machinery/firealarm/FA in world)
|
||||
// TODO: Tie into space manager
|
||||
if((FA.z in config.contact_levels))
|
||||
if(is_station_contact(FA.z))
|
||||
FA.overlays = list()
|
||||
FA.overlays += image('icons/obj/monitors.dmi', "overlay_red")
|
||||
|
||||
@@ -90,14 +86,12 @@
|
||||
|
||||
if(security_level < SEC_LEVEL_RED)
|
||||
for(var/obj/machinery/door/airlock/highsecurity/red/R in airlocks)
|
||||
// TODO: Tie into space manager
|
||||
if((R.z in config.station_levels))
|
||||
if(is_station_level(R.z))
|
||||
R.locked = 0
|
||||
R.update_icon()
|
||||
|
||||
for(var/obj/machinery/door/airlock/hatch/gamma/H in airlocks)
|
||||
// TODO: Tie into space manager
|
||||
if((H.z in config.station_levels))
|
||||
if(is_station_level(H.z))
|
||||
H.locked = 0
|
||||
H.update_icon()
|
||||
|
||||
@@ -106,8 +100,7 @@
|
||||
CC.post_status("alert", "gammaalert")
|
||||
|
||||
for(var/obj/machinery/firealarm/FA in world)
|
||||
// TODO: Tie into space manager
|
||||
if((FA.z in config.contact_levels))
|
||||
if(is_station_contact(FA.z))
|
||||
FA.overlays = list()
|
||||
FA.overlays += image('icons/obj/monitors.dmi', "overlay_gamma")
|
||||
FA.update_icon()
|
||||
@@ -121,8 +114,7 @@
|
||||
CC.post_status("alert", "epsilonalert")
|
||||
|
||||
for(var/obj/machinery/firealarm/FA in world)
|
||||
// TODO: Tie into space manager
|
||||
if((FA.z in config.contact_levels))
|
||||
if(is_station_contact(FA.z))
|
||||
FA.overlays = list()
|
||||
FA.overlays += image('icons/obj/monitors.dmi', "overlay_epsilon")
|
||||
|
||||
@@ -135,8 +127,7 @@
|
||||
CC.post_status("alert", "deltaalert")
|
||||
|
||||
for(var/obj/machinery/firealarm/FA in world)
|
||||
// TODO: Tie into space manager
|
||||
if((FA.z in config.contact_levels))
|
||||
if(is_station_contact(FA.z))
|
||||
FA.overlays = list()
|
||||
FA.overlays += image('icons/obj/monitors.dmi', "overlay_delta")
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
height = 7
|
||||
|
||||
/obj/docking_port/mobile/assault_pod/request()
|
||||
// TODO: Tie into space manager
|
||||
if(z == initial(src.z)) //No launching pods that have already launched
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -209,8 +209,7 @@
|
||||
if(time_left <= 0 && !shuttle_master.emergencyNoEscape)
|
||||
//move each escape pod to its corresponding transit dock
|
||||
for(var/obj/docking_port/mobile/pod/M in shuttle_master.mobile)
|
||||
// TODO: Tie into space manager
|
||||
if(M.z == ZLEVEL_STATION) //Will not launch from the mine/planet
|
||||
if(is_station_level(M.z)) //Will not launch from the mine/planet
|
||||
M.enterTransit()
|
||||
//now move the actual emergency shuttle to its transit dock
|
||||
for(var/area/shuttle/escape/E in world)
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
return 1
|
||||
|
||||
/obj/docking_port/mobile/supply/canMove()
|
||||
if(z == ZLEVEL_STATION)
|
||||
if(is_station_level(z))
|
||||
return forbidden_atoms_check(areaInstance)
|
||||
return ..()
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
sell()
|
||||
|
||||
/obj/docking_port/mobile/supply/proc/buy()
|
||||
if(z != ZLEVEL_STATION) //we only buy when we are -at- the station
|
||||
if(!is_station_level(z)) //we only buy when we are -at- the station
|
||||
return 1
|
||||
|
||||
if(!shuttle_master.shoppinglist.len)
|
||||
@@ -93,7 +93,7 @@
|
||||
shuttle_master.shoppinglist.Cut()
|
||||
|
||||
/obj/docking_port/mobile/supply/proc/sell()
|
||||
if(z != ZLEVEL_CENTCOMM) //we only sell when we are -at- centcomm
|
||||
if(z != level_name_to_num(CENTCOMM)) //we only sell when we are -at- centcomm
|
||||
return 1
|
||||
|
||||
var/plasma_count = 0
|
||||
|
||||
@@ -30,9 +30,9 @@
|
||||
|
||||
/obj/machinery/computer/shuttle/syndicate/drop_pod/Topic(href, href_list)
|
||||
if(href_list["move"])
|
||||
if(z != ZLEVEL_CENTCOMM)
|
||||
if(z != level_name_to_num(CENTCOMM))
|
||||
to_chat(usr, "<span class='warning'>Pods are one way!</span>")
|
||||
return 0
|
||||
..()
|
||||
|
||||
#undef SYNDICATE_CHALLENGE_TIMER
|
||||
#undef SYNDICATE_CHALLENGE_TIMER
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
/proc/is_on_level_name(atom/A,name)
|
||||
var/datum/space_level/S = space_manager.get_zlev_by_name(name)
|
||||
return A.z == S.zpos
|
||||
|
||||
// For expansion later
|
||||
/proc/atoms_share_level(atom/A, atom/B)
|
||||
return A.z == B.z
|
||||
@@ -0,0 +1,62 @@
|
||||
/proc/is_level_reachable(z)
|
||||
return check_level_trait(z, REACHABLE)
|
||||
|
||||
/proc/is_station_level(z)
|
||||
return check_level_trait(z, STATION_LEVEL)
|
||||
|
||||
/proc/is_station_contact(z)
|
||||
return check_level_trait(z, STATION_CONTACT)
|
||||
|
||||
/proc/is_teleport_allowed(z)
|
||||
return !check_level_trait(z, BLOCK_TELEPORT)
|
||||
|
||||
/proc/is_admin_level(z)
|
||||
return check_level_trait(z, ADMIN_LEVEL)
|
||||
|
||||
/proc/is_away_level(z)
|
||||
return check_level_trait(z, AWAY_LEVEL)
|
||||
|
||||
/proc/is_mining_level(z)
|
||||
return check_level_trait(z, ORE_LEVEL)
|
||||
|
||||
/proc/is_ai_allowed(z)
|
||||
return check_level_trait(z, AI_OK)
|
||||
|
||||
/proc/level_blocks_magic(z)
|
||||
return check_level_trait(z, IMPEDES_MAGIC)
|
||||
|
||||
/proc/level_boosts_signal(z)
|
||||
return check_level_trait(z, BOOSTS_SIGNAL)
|
||||
|
||||
// Used for the nuke disk, or for checking if players survived through xenos
|
||||
/proc/is_secure_level(z)
|
||||
var/secure = check_level_trait(z, STATION_LEVEL)
|
||||
if(!secure)
|
||||
// This is to allow further admin levels later, other than centcomm
|
||||
secure = (z == level_name_to_num(CENTCOMM))
|
||||
return secure
|
||||
|
||||
var/list/default_map_traits = MAP_TRANSITION_CONFIG
|
||||
/proc/check_level_trait(z, trait)
|
||||
if(z == 0)
|
||||
return 0 // If you're nowhere, you have no traits
|
||||
var/list/trait_list
|
||||
if(space_manager.initialized)
|
||||
var/datum/space_level/S = space_manager.get_zlev(z)
|
||||
trait_list = S.flags
|
||||
else
|
||||
trait_list = default_map_traits[z]
|
||||
trait_list = trait_list["attributes"]
|
||||
return (trait in trait_list)
|
||||
|
||||
/proc/levels_by_trait(trait)
|
||||
var/list/result = list()
|
||||
for(var/A in space_manager.z_list)
|
||||
var/datum/space_level/S = space_manager.z_list[A]
|
||||
if(trait in S.flags)
|
||||
result |= S
|
||||
return result
|
||||
|
||||
/proc/level_name_to_num(name)
|
||||
var/datum/space_level/S = space_manager.get_zlev_by_name(name)
|
||||
return S.zpos
|
||||
@@ -1,12 +1,14 @@
|
||||
/datum/space_level
|
||||
var/name = "Your config settings failed, you need to fix this for the datum space levels to work"
|
||||
var/zpos = 1
|
||||
var/flags = 0 // We'll use this to keep track of whether you can teleport/etc
|
||||
var/flags = list() // We'll use this to keep track of whether you can teleport/etc
|
||||
|
||||
// Map transition stuff
|
||||
var/list/neighbors = list()
|
||||
// # How this level connects with others. See __MAP_DEFINES.dm for defines
|
||||
var/linkage = SELFLOOPING
|
||||
// It's UNAFFECTED by default because none of the space turfs are normally linked up
|
||||
// so we don't need to rebuild transitions if an UNAFFECTED level is requested
|
||||
var/linkage = UNAFFECTED
|
||||
// # imaginary placements on the grid - these reflect the point it is linked to
|
||||
var/xi
|
||||
var/yi
|
||||
@@ -19,45 +21,117 @@
|
||||
var/dirt_count = 0
|
||||
var/list/init_list = list()
|
||||
|
||||
/datum/space_level/New(z, name, transition_type = SELFLOOPING)
|
||||
/datum/space_level/New(z, name, transition_type = SELFLOOPING, traits = list(BLOCK_TELEPORT))
|
||||
zpos = z
|
||||
set_linkage(transition_type)
|
||||
flags = traits
|
||||
build_space_destination_arrays()
|
||||
set_linkage(transition_type)
|
||||
|
||||
/datum/space_level/Destroy()
|
||||
if(linkage == CROSSLINKED)
|
||||
if(space_manager.linkage_map)
|
||||
remove_from_space_network(space_manager.linkage_map)
|
||||
|
||||
space_manager.unbuilt_space_transitions -= src
|
||||
space_manager.z_list -= "[zpos]"
|
||||
return ..()
|
||||
|
||||
/datum/space_level/proc/build_space_destination_arrays()
|
||||
var/timer = start_watch()
|
||||
log_debug("Starting to build space destination arrays for z level '[zpos]'...")
|
||||
for(var/turf/space/S in get_turfs())
|
||||
// We skip `add_to_transit` here because we want to skip the checks in order to save time
|
||||
// Bottom border
|
||||
for(var/turf/space/S in block(locate(1,1,zpos),locate(world.maxx,TRANSITIONEDGE+1,zpos)))
|
||||
transit_south |= S
|
||||
|
||||
// Bottom border
|
||||
if(S.y <= TRANSITIONEDGE)
|
||||
transit_south |= S
|
||||
continue
|
||||
// Top border
|
||||
for(var/turf/space/S in block(locate(1,world.maxy,zpos),locate(world.maxx,world.maxy - TRANSITIONEDGE - 1,zpos)))
|
||||
transit_north |= S
|
||||
|
||||
// Top border
|
||||
if(S.y >= (world.maxy - TRANSITIONEDGE - 1))
|
||||
transit_north |= S
|
||||
continue
|
||||
// Left border
|
||||
for(var/turf/space/S in block(locate(1,TRANSITIONEDGE+1,zpos),locate(TRANSITIONEDGE+1,world.maxy - TRANSITIONEDGE - 2,zpos)))
|
||||
transit_west |= S
|
||||
|
||||
// Left border
|
||||
if(S.x <= TRANSITIONEDGE)
|
||||
transit_west |= S
|
||||
continue
|
||||
// Right border
|
||||
for(var/turf/space/S in block(locate(world.maxx - TRANSITIONEDGE - 1,TRANSITIONEDGE+1,zpos),locate(world.maxx,world.maxy - TRANSITIONEDGE - 2,zpos)))
|
||||
transit_east |= S
|
||||
|
||||
/datum/space_level/proc/add_to_transit(turf/space/S)
|
||||
if(S.y <= TRANSITIONEDGE)
|
||||
transit_south |= S
|
||||
return
|
||||
|
||||
// Top border
|
||||
if(S.y >= (world.maxy - TRANSITIONEDGE - 1))
|
||||
transit_north |= S
|
||||
return
|
||||
|
||||
// Left border
|
||||
if(S.x <= TRANSITIONEDGE)
|
||||
transit_west |= S
|
||||
return
|
||||
|
||||
// Right border
|
||||
if(S.x >= (world.maxx - TRANSITIONEDGE - 1))
|
||||
transit_east |= S
|
||||
|
||||
/datum/space_level/proc/remove_from_transit(turf/space/S)
|
||||
if(S.y <= TRANSITIONEDGE)
|
||||
transit_south -= S
|
||||
return
|
||||
|
||||
// Top border
|
||||
if(S.y >= (world.maxy - TRANSITIONEDGE - 1))
|
||||
transit_north -= S
|
||||
return
|
||||
|
||||
// Left border
|
||||
if(S.x <= TRANSITIONEDGE)
|
||||
transit_west -= S
|
||||
return
|
||||
|
||||
// Right border
|
||||
if(S.x >= (world.maxx - TRANSITIONEDGE - 1))
|
||||
transit_east -= S
|
||||
|
||||
/datum/space_level/proc/apply_transition(turf/space/S)
|
||||
if(src in space_manager.unbuilt_space_transitions)
|
||||
return // Let the space manager handle this one
|
||||
switch(linkage)
|
||||
if(UNAFFECTED)
|
||||
S.remove_transitions()
|
||||
if(SELFLOOPING,CROSSLINKED)
|
||||
var/datum/space_level/E = get_connection()
|
||||
if(S in transit_north)
|
||||
E = get_connection("[NORTH]")
|
||||
S.set_transition_north(E.zpos)
|
||||
if(S in transit_south)
|
||||
E = get_connection("[SOUTH]")
|
||||
S.set_transition_south(E.zpos)
|
||||
if(S in transit_east)
|
||||
E = get_connection("[EAST]")
|
||||
S.set_transition_east(E.zpos)
|
||||
if(S in transit_west)
|
||||
E = get_connection("[WEST]")
|
||||
S.set_transition_west(E.zpos)
|
||||
|
||||
// Right border
|
||||
if(S.x >= (world.maxx - TRANSITIONEDGE - 1))
|
||||
transit_east |= S
|
||||
continue
|
||||
log_debug("Building space destination arrays complete, took [stop_watch(timer)]s.")
|
||||
|
||||
/datum/space_level/proc/get_turfs()
|
||||
return block(locate(1, 1, zpos), locate(world.maxx, world.maxy, zpos))
|
||||
|
||||
/datum/space_level/proc/set_linkage(transition_type)
|
||||
linkage = transition_type
|
||||
if(transition_type == SELFLOOPING)
|
||||
link_to_self() // `link_to_self` is defined in space_transitions.dm
|
||||
if(linkage == transition_type)
|
||||
return
|
||||
// Remove ourselves from the linkage map if we were cross-linked
|
||||
if(linkage == CROSSLINKED)
|
||||
if(space_manager.linkage_map)
|
||||
remove_from_space_network(space_manager.linkage_map)
|
||||
|
||||
space_manager.unbuilt_space_transitions |= src
|
||||
linkage = transition_type
|
||||
switch(transition_type)
|
||||
if(UNAFFECTED)
|
||||
reset_connections()
|
||||
if(SELFLOOPING)
|
||||
link_to_self() // `link_to_self` is defined in space_transitions.dm
|
||||
|
||||
/datum/space_level/proc/resume_init()
|
||||
if(dirt_count > 0)
|
||||
|
||||
@@ -16,15 +16,36 @@
|
||||
if(Z_LEVEL_WEST)
|
||||
return Z_LEVEL_EAST
|
||||
|
||||
/datum/space_level
|
||||
var/list/direction_cache = list()
|
||||
|
||||
// Do this before setting up new connections, or the old ones will haunt you
|
||||
/datum/space_level/proc/reset_connections()
|
||||
neighbors.Cut()
|
||||
|
||||
/datum/space_level/proc/link_to_self()
|
||||
reset_connections()
|
||||
neighbors = list()
|
||||
var/list/L = list(Z_LEVEL_NORTH,Z_LEVEL_SOUTH,Z_LEVEL_EAST,Z_LEVEL_WEST)
|
||||
for(var/A in L)
|
||||
neighbors[A] = src
|
||||
|
||||
// Only call this when the `linkage_map` is already built
|
||||
/datum/space_level/proc/add_to_space_network(datum/spacewalk_grid/SW)
|
||||
// Make sure we don't bring any noise data into the network
|
||||
reset_connections()
|
||||
xi = initial(xi)
|
||||
yi = initial(yi)
|
||||
var/datum/point/P = SW.get_empty_node()
|
||||
P.set_space_level(src)
|
||||
|
||||
/datum/space_level/proc/remove_from_space_network(datum/spacewalk_grid/SW)
|
||||
var/datum/point/P = SW.get(xi,yi)
|
||||
SW.release_node(P)
|
||||
// Only do this when we're done, or we'll trample vars needed for releasing
|
||||
// the level
|
||||
xi = initial(xi)
|
||||
yi = initial(yi)
|
||||
reset_connections()
|
||||
|
||||
// This proc takes another space level, and establishes a connection between the
|
||||
// two depending on how the `xi` and the `yi` values compare
|
||||
/datum/space_level/proc/link_levels(datum/space_level/S)
|
||||
@@ -41,26 +62,18 @@
|
||||
else // yell about evil wizards, this shouldn't happen
|
||||
log_debug("Two z levels attempted to link, but were not adjacent! Our z:([xi],[yi]). Other z:([S.xi],[S.yi])")
|
||||
|
||||
// Do this before setting up new connections, or the old ones will haunt you
|
||||
/datum/space_level/proc/reset_connections()
|
||||
neighbors.Cut()
|
||||
direction_cache.Cut()
|
||||
|
||||
// `direction` here is the direction from `src` to `S`
|
||||
/datum/space_level/proc/add_connection(datum/space_level/S, direction)
|
||||
var/oppose = get_opposite_direction(direction)
|
||||
neighbors[direction] = S
|
||||
S.neighbors[oppose] = src
|
||||
space_manager.unbuilt_space_transitions |= src
|
||||
space_manager.unbuilt_space_transitions |= S
|
||||
|
||||
|
||||
// The "direction cache" will need updating if a
|
||||
/datum/space_level/proc/get_connection(direction)
|
||||
if(direction in neighbors)
|
||||
return neighbors[direction]
|
||||
var/use_direction_cache = 0
|
||||
if(use_direction_cache)
|
||||
if(direction in direction_cache)
|
||||
return direction_cache[direction]
|
||||
|
||||
// It's in a direction that loops - so we step as far in the opposite direction to get where to wrap to
|
||||
var/datum/space_level/S = src
|
||||
@@ -70,9 +83,6 @@
|
||||
if(S.neighbors[oppose] == src) // we've got a tesseract, boys
|
||||
CRASH("Tesseract formed when routing connections between z levels. Culprit: z level '[S.zpos]' to '[src.zpos]', direction [oppose]")
|
||||
S = S.neighbors[oppose]
|
||||
|
||||
if(use_direction_cache)
|
||||
direction_cache[direction] = S
|
||||
return S
|
||||
|
||||
|
||||
@@ -145,8 +155,6 @@
|
||||
// This looks around itself to see if it has any active nodes within the cardinal directions
|
||||
/datum/point/proc/has_no_neighbors(datum/spacewalk_grid/SW)
|
||||
var/result = 1
|
||||
if(spl)
|
||||
return 1
|
||||
if(!isnull(SW.get(x+1,y)))
|
||||
result = 0
|
||||
if(!isnull(SW.get(x-1,y)))
|
||||
@@ -165,6 +173,7 @@
|
||||
var/datum/space_level/S = spl.neighbors[direction]
|
||||
var/oppose = get_opposite_direction(direction)
|
||||
S.neighbors.Remove(oppose)
|
||||
space_manager.unbuilt_space_transitions |= S
|
||||
spl.reset_connections()
|
||||
spl = initial(spl)
|
||||
|
||||
@@ -191,6 +200,14 @@
|
||||
var/datum/point/P = new(0,0)
|
||||
add_available_node(P)
|
||||
|
||||
/datum/spacewalk_grid/Destroy()
|
||||
for(var/datum/point/P in filled_nodes)
|
||||
release_node(P)
|
||||
if(available_nodes.len > 1)
|
||||
log_debug("Multiple nodes left behind after SW grid qdel: [available_nodes.len]")
|
||||
for(var/datum/point/P in available_nodes)
|
||||
log_debug("([P.x],[P.y])")
|
||||
|
||||
/datum/spacewalk_grid/proc/add_available_node(datum/point/P)
|
||||
var/hash = P.hash()
|
||||
if(hash in all_nodes)
|
||||
@@ -225,9 +242,12 @@
|
||||
for(var/datum/point/P2 in P.neighbors)
|
||||
var/isolated = P2.has_no_neighbors(src)
|
||||
if(isolated)
|
||||
available_nodes -= P2
|
||||
all_nodes -= P2.hash()
|
||||
qdel(P)
|
||||
if(!P2.spl)
|
||||
available_nodes -= P2
|
||||
all_nodes -= P2.hash()
|
||||
qdel(P)
|
||||
else
|
||||
log_debug("Isolated z level at ([P2.x],[P2.y]): [P2.spl.zpos]")
|
||||
P.deactivate()
|
||||
P.neighbors.Cut()
|
||||
|
||||
@@ -279,7 +299,7 @@
|
||||
/datum/spacewalk_grid/proc/get_height()
|
||||
return 1 + max_y - min_y
|
||||
|
||||
// This function is called repeatedly to build the map
|
||||
// This function chooses an available point next to any node in the grid
|
||||
/datum/spacewalk_grid/proc/get_empty_node()
|
||||
var/datum/point/P = pick(available_nodes)
|
||||
if(isnull(P))
|
||||
@@ -287,6 +307,12 @@
|
||||
consume_node(P)
|
||||
return P
|
||||
|
||||
// This function is called repeatedly to build the map
|
||||
/datum/spacewalk_grid/proc/add_level(datum/space_level/S)
|
||||
var/datum/point/P = get_empty_node()
|
||||
P.set_space_level(S)
|
||||
|
||||
|
||||
// This proc substantiates the grid of points used to determine routes between levels
|
||||
// Separating this from initialization gives us time in which we can add more crosslink z levels
|
||||
// before we bake in all our connections
|
||||
@@ -307,75 +333,75 @@
|
||||
// `grid` is a flat list of these same above points
|
||||
|
||||
// Each point represents a possible z level position
|
||||
var/datum/spacewalk_grid/point_grid = new
|
||||
// We do this so we can display the way the levels connect later
|
||||
linkage_map = point_grid
|
||||
var/datum/point/P
|
||||
if(linkage_map)
|
||||
qdel(linkage_map)
|
||||
linkage_map = new
|
||||
|
||||
// Now, we pop entries in a random order from our list of space levels
|
||||
// and assign its connections based on the grid
|
||||
while(crosslinks.len)
|
||||
D = pick(crosslinks)
|
||||
crosslinks.Remove(D)
|
||||
// We now choose a point in our imaginary grid adjacent to our current location
|
||||
P = point_grid.get_empty_node()
|
||||
// Let our z level know where in the imaginary grid it is
|
||||
// This will also handle establishing neighborship with other z levels
|
||||
P.set_space_level(D)
|
||||
// Add it to our space grid
|
||||
D.add_to_space_network(linkage_map)
|
||||
|
||||
// A heavy proc - loops through all space turfs and sets its destination
|
||||
// based on its space level's linkage
|
||||
// Takes 0.6 seconds per call on my machine - could have each z level
|
||||
// have its own space turf cache, but I don't want to complicate this more
|
||||
// than is necessary
|
||||
/datum/zlev_manager/proc/setup_space_destinations()
|
||||
// Used to loop through turfs in world, now just goes through each level's
|
||||
// transit turf cache
|
||||
/datum/zlev_manager/proc/setup_space_destinations(force_all_rebuilds = FALSE)
|
||||
var/timer = start_watch()
|
||||
log_debug("Assigning space turf destinations...")
|
||||
var/datum/space_level/D
|
||||
var/datum/space_level/E
|
||||
var/turf/space/S
|
||||
for(var/A in z_list) //Define the transistions of the z levels
|
||||
D = z_list[A]
|
||||
if(!D.neighbors.len)
|
||||
continue
|
||||
// Left border
|
||||
for(var/B in D.transit_west)
|
||||
S = B
|
||||
E = D.get_connection(Z_LEVEL_WEST)
|
||||
S.destination_z = E.zpos
|
||||
S.destination_x = world.maxx - TRANSITIONEDGE - 2
|
||||
S.destination_y = S.y
|
||||
var/list/levels_to_rebuild = unbuilt_space_transitions
|
||||
|
||||
// Right border
|
||||
for(var/B in D.transit_east)
|
||||
S = B
|
||||
E = D.get_connection(Z_LEVEL_EAST)
|
||||
S.destination_x = TRANSITIONEDGE + 2
|
||||
S.destination_y = S.y
|
||||
S.destination_z = E.zpos
|
||||
if(force_all_rebuilds)
|
||||
// Assuming we don't have like 9000 zlevels this shouldn't hurt
|
||||
levels_to_rebuild = list()
|
||||
for(var/A in z_list)
|
||||
levels_to_rebuild.Add(z_list[A])
|
||||
|
||||
// Bottom border
|
||||
for(var/B in D.transit_south)
|
||||
S = B
|
||||
E = D.get_connection(Z_LEVEL_SOUTH)
|
||||
S.destination_x = S.x
|
||||
S.destination_y = world.maxy - TRANSITIONEDGE - 2
|
||||
S.destination_z = E.zpos
|
||||
|
||||
// Top border
|
||||
for(var/B in D.transit_north)
|
||||
S = B
|
||||
E = D.get_connection(Z_LEVEL_NORTH)
|
||||
S.destination_x = S.x
|
||||
S.destination_y = TRANSITIONEDGE + 2
|
||||
S.destination_z = E.zpos
|
||||
for(var/foo in levels_to_rebuild) //Define the transitions of the z levels
|
||||
D = foo
|
||||
log_debug("Z level [D.zpos]")
|
||||
switch(D.linkage)
|
||||
if(UNAFFECTED)
|
||||
for(var/B in D.transit_west | D.transit_east | D.transit_south | D.transit_north)
|
||||
S = B
|
||||
S.remove_transitions()
|
||||
if(SELFLOOPING,CROSSLINKED)
|
||||
// Left border
|
||||
for(var/B in D.transit_west)
|
||||
S = B
|
||||
E = D.get_connection(Z_LEVEL_WEST)
|
||||
S.set_transition_west(E.zpos)
|
||||
|
||||
// Right border
|
||||
for(var/B in D.transit_east)
|
||||
S = B
|
||||
E = D.get_connection(Z_LEVEL_EAST)
|
||||
S.set_transition_east(E.zpos)
|
||||
|
||||
// Bottom border
|
||||
for(var/B in D.transit_south)
|
||||
S = B
|
||||
E = D.get_connection(Z_LEVEL_SOUTH)
|
||||
S.set_transition_south(E.zpos)
|
||||
|
||||
// Top border
|
||||
for(var/B in D.transit_north)
|
||||
S = B
|
||||
E = D.get_connection(Z_LEVEL_NORTH)
|
||||
S.set_transition_north(E.zpos)
|
||||
unbuilt_space_transitions -= D
|
||||
|
||||
log_debug("Assigning space turf destinations complete. Took [stop_watch(timer)]s.")
|
||||
|
||||
// Nothing fancy, just does it all at once
|
||||
/datum/zlev_manager/proc/do_transition_setup()
|
||||
route_linkage()
|
||||
setup_space_destinations()
|
||||
setup_space_destinations(force_all_rebuilds = TRUE)
|
||||
|
||||
// A debugging proc that expresses the map's shape as a bunch of turfs
|
||||
/datum/zlev_manager/proc/map_as_turfs(turf/center)
|
||||
|
||||
@@ -3,9 +3,14 @@ var/global/datum/zlev_manager/space_manager = new
|
||||
/datum/zlev_manager
|
||||
// A list of z-levels
|
||||
var/list/z_list = list()
|
||||
var/list/levels_by_name = list()
|
||||
var/list/heaps = list()
|
||||
|
||||
// Levels that need their transitions rebuilt
|
||||
var/list/unbuilt_space_transitions = list()
|
||||
|
||||
var/datum/spacewalk_grid/linkage_map
|
||||
var/initialized = 0
|
||||
|
||||
// Populate our space level list
|
||||
// and prepare space transitions
|
||||
@@ -14,18 +19,24 @@ var/global/datum/zlev_manager/space_manager = new
|
||||
var/k = 1
|
||||
|
||||
// First take care of "Official" z levels, without visiting levels outside of the list
|
||||
for(var/A in map_transition_config)
|
||||
// `A` is the name
|
||||
// `map_transition_config[A]` is the transition type
|
||||
z_list["[k]"] = new /datum/space_level(k, A, transition_type = map_transition_config[A])
|
||||
for(var/list/features in map_transition_config)
|
||||
if(k > world.maxz)
|
||||
CRASH("More map transitions defined than existent z levels - [num_official_z_levels]")
|
||||
CRASH("More map attributes pre-defined than existent z levels - [num_official_z_levels]")
|
||||
var/name = features["name"]
|
||||
var/linking = features["linkage"]
|
||||
var/list/attributes = features["attributes"]
|
||||
attributes = attributes.Copy() // Clone the list so it can't be changed on accident
|
||||
|
||||
var/datum/space_level/S = new /datum/space_level(k, name, transition_type = linking, traits = attributes)
|
||||
z_list["[k]"] = S
|
||||
levels_by_name[name] = S
|
||||
k++
|
||||
|
||||
// Then, we take care of unmanaged z levels
|
||||
// They get the default linkage of SELFLOOPING
|
||||
for(var/i = k, i <= world.maxz, i++)
|
||||
z_list["[i]"] = new /datum/space_level(i)
|
||||
initialized = 1
|
||||
|
||||
|
||||
/datum/zlev_manager/proc/get_zlev(z)
|
||||
@@ -34,6 +45,11 @@ var/global/datum/zlev_manager/space_manager = new
|
||||
else
|
||||
return z_list["[z]"]
|
||||
|
||||
/datum/zlev_manager/proc/get_zlev_by_name(A)
|
||||
if(!(A in levels_by_name))
|
||||
throw EXCEPTION("Non-existent z level: '[A]'")
|
||||
return levels_by_name[A]
|
||||
|
||||
/*
|
||||
* "Dirt" management
|
||||
* "Dirt" is used to keep track of whether a z level should automatically have
|
||||
@@ -88,10 +104,14 @@ var/global/datum/zlev_manager/space_manager = new
|
||||
|
||||
// Increments the max z-level by one
|
||||
// For convenience's sake returns the z-level added
|
||||
/datum/zlev_manager/proc/add_new_zlevel(name, linkage = SELFLOOPING)
|
||||
/datum/zlev_manager/proc/add_new_zlevel(name, linkage = SELFLOOPING, traits = list(BLOCK_TELEPORT))
|
||||
if(name in levels_by_name)
|
||||
throw EXCEPTION("Name already in use: [name]")
|
||||
world.maxz++
|
||||
var/our_z = world.maxz
|
||||
z_list["[our_z]"] = new /datum/space_level(our_z,name, transition_type = linkage)
|
||||
var/datum/space_level/S = new /datum/space_level(our_z, name, transition_type = linkage, traits = traits)
|
||||
levels_by_name[name] = S
|
||||
z_list["[our_z]"] = S
|
||||
return our_z
|
||||
|
||||
/datum/zlev_manager/proc/cut_levels_downto(new_maxz)
|
||||
|
||||
@@ -48,8 +48,7 @@ var/global/datum/store/centcomm_store=new
|
||||
|
||||
/datum/store/proc/reconnect_database()
|
||||
for(var/obj/machinery/computer/account_database/DB in world)
|
||||
// TODO: Tie into space manager
|
||||
if((DB.z in config.station_levels))
|
||||
if(is_station_level(DB.z))
|
||||
linked_db = DB
|
||||
break
|
||||
|
||||
|
||||
@@ -22,8 +22,7 @@
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/ore/bluespace_crystal/proc/blink_mob(var/mob/living/L)
|
||||
// TODO: Tie into space manager
|
||||
if(L.z in config.admin_levels)
|
||||
if(!is_teleport_allowed(L.z))
|
||||
src.visible_message("<span class=warning>[src]'s fragments begin rapidly vibrating and blink out of existence.<span>")
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user