From d3179bb5b5524da1c3e3a97d3c311b371c4f5539 Mon Sep 17 00:00:00 2001 From: SkyMarshal Date: Tue, 14 Aug 2012 09:55:57 -0700 Subject: [PATCH] Random not much finished bullshit work on mapdata. --- baystation12.dme | 18 ++- .../SkyMarshal/DebuggingNTesting.dm | 11 ++ code/WorkInProgress/new_explosion.dm | 152 ++++++++++++++++++ code/datums/configuration.dm | 4 +- code/defines/global.dm | 31 +--- code/game/jobs/job/job.dm | 6 - code/game/json.dm | 3 +- code/game/landmarks.dm | 16 +- code/setup_3d.dm | 2 +- maps/map_controller/map_controller.dm | 0 maps/map_controller/maps.dm | 47 ++++++ .../maps => maps/map_editing}/SwapMaps.dm | 0 .../maps => maps/map_editing}/dmm_suite.dm | 0 .../maps => maps/map_editing}/fromdmp.dm | 0 .../maps => maps/map_editing}/randomZlevel.dm | 0 .../maps => maps/map_editing}/reader.dm | 0 .../maps => maps/map_editing}/writer.dm | 0 .../assistantChamber.dmm | 0 18 files changed, 233 insertions(+), 57 deletions(-) create mode 100644 code/WorkInProgress/SkyMarshal/DebuggingNTesting.dm create mode 100644 code/WorkInProgress/new_explosion.dm create mode 100644 maps/map_controller/map_controller.dm create mode 100644 maps/map_controller/maps.dm rename {code/modules/maps => maps/map_editing}/SwapMaps.dm (100%) rename {code/modules/maps => maps/map_editing}/dmm_suite.dm (100%) rename {code/modules/maps => maps/map_editing}/fromdmp.dm (100%) rename {code/modules/maps => maps/map_editing}/randomZlevel.dm (100%) rename {code/modules/maps => maps/map_editing}/reader.dm (100%) rename {code/modules/maps => maps/map_editing}/writer.dm (100%) rename maps/{RandomZLevels => map_storage}/assistantChamber.dmm (100%) diff --git a/baystation12.dme b/baystation12.dme index 7da86180317..17e852ff08b 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -105,7 +105,6 @@ #define FILE_DIR "code/modules/flufftext" #define FILE_DIR "code/modules/food" #define FILE_DIR "code/modules/icon generation" -#define FILE_DIR "code/modules/maps" #define FILE_DIR "code/modules/mining" #define FILE_DIR "code/modules/mob" #define FILE_DIR "code/modules/mob/dead" @@ -173,7 +172,6 @@ #define FILE_DIR "code/WorkInProgress/Cael_Aislinn/BirdMan" #define FILE_DIR "code/WorkInProgress/Cael_Aislinn/Rust" #define FILE_DIR "code/WorkInProgress/Cael_Aislinn/Supermatter" -#define FILE_DIR "code/WorkInProgress/Cael_Aislinn/Supermatter/backup" #define FILE_DIR "code/WorkInProgress/Cael_Aislinn/Tajara" #define FILE_DIR "code/WorkInProgress/Chinsky" #define FILE_DIR "code/WorkInProgress/mapload" @@ -211,7 +209,9 @@ #define FILE_DIR "icons/vending_icons" #define FILE_DIR "interface" #define FILE_DIR "maps" -#define FILE_DIR "maps/RandomZLevels" +#define FILE_DIR "maps/map_controller" +#define FILE_DIR "maps/map_editing" +#define FILE_DIR "maps/map_storage" #define FILE_DIR "sound" #define FILE_DIR "sound/AI" #define FILE_DIR "sound/ambience" @@ -907,11 +907,6 @@ #include "code\modules\food\food.dm" #include "code\modules\food\meat.dm" #include "code\modules\food\recipes_microwave.dm" -#include "code\modules\maps\dmm_suite.dm" -#include "code\modules\maps\randomZlevel.dm" -#include "code\modules\maps\reader.dm" -#include "code\modules\maps\SwapMaps.dm" -#include "code\modules\maps\writer.dm" #include "code\modules\mining\machine_input_output_plates.dm" #include "code\modules\mining\machine_processing.dm" #include "code\modules\mining\machine_stacking.dm" @@ -1282,4 +1277,11 @@ #include "interface\interface.dm" #include "interface\skin.dmf" #include "maps\tgstation.2.0.8.dmm" +#include "maps\map_controller\map_controller.dm" +#include "maps\map_controller\maps.dm" +#include "maps\map_editing\dmm_suite.dm" +#include "maps\map_editing\randomZlevel.dm" +#include "maps\map_editing\reader.dm" +#include "maps\map_editing\SwapMaps.dm" +#include "maps\map_editing\writer.dm" // END_INCLUDE diff --git a/code/WorkInProgress/SkyMarshal/DebuggingNTesting.dm b/code/WorkInProgress/SkyMarshal/DebuggingNTesting.dm new file mode 100644 index 00000000000..04778ffd808 --- /dev/null +++ b/code/WorkInProgress/SkyMarshal/DebuggingNTesting.dm @@ -0,0 +1,11 @@ +mob/verb/add_z() + set usr = src + set category = "TEST" + + world.maxz++ + +mob/verb/remove_z() + set usr = src + set category = "TEST" + + world.maxz-- \ No newline at end of file diff --git a/code/WorkInProgress/new_explosion.dm b/code/WorkInProgress/new_explosion.dm new file mode 100644 index 00000000000..7d47ae1b819 --- /dev/null +++ b/code/WorkInProgress/new_explosion.dm @@ -0,0 +1,152 @@ +/* - uncomment this to test it out! */ +/mob/verb/kaboom() + var/power = input(src, "power?", "power?") as num + var/turf/T = get_turf(src) + explosion_rec(T, power) + +/obj + var/explosion_resistance + +/datum/explosion_turf + var/turf/turf //The turf which will get ex_act called on it + var/max_power //The largest amount of power the turf sustained + + New() + ..() + max_power = 0 + + proc/save_power_if_larger(power) + if(power > max_power) + max_power = power + return 1 + return 0 + +var/list/datum/explosion_turf/explosion_turfs = list() +var/explosion_in_progress = 0 + +proc/get_explosion_turf(var/turf/T) + for( var/datum/explosion_turf/ET in explosion_turfs ) + if( T == ET.turf ) + return ET + var/datum/explosion_turf/ET = new() + ET.turf = T + explosion_turfs += ET + return ET + +proc/explosion_rec(turf/epicenter, power) + + var/loopbreak = 0 + while(explosion_in_progress) + if(loopbreak >= 15) return + sleep(10) + loopbreak++ + + if(power <= 0) return + epicenter = get_turf(epicenter) + if(!epicenter) return + + message_admins("Explosion with size ([power]) in area [epicenter.loc.name] ([epicenter.x],[epicenter.y],[epicenter.z])") + log_game("Explosion with size ([power]) in area [epicenter.loc.name] ") + + playsound(epicenter, 'explosionfar.ogg', 100, 1, round(power*2,1) ) + playsound(epicenter, "explosion", 100, 1, round(power,1) ) + + explosion_in_progress = 1 + explosion_turfs = list() + var/datum/explosion_turf/ETE = get_explosion_turf() + ETE.turf = epicenter + ETE.max_power = power + + //This steap handles the gathering of turfs which will be ex_act() -ed in the next step. It also ensures each turf gets the maximum possible amount of power dealt to it. + for(var/direction in cardinal) + var/turf/T = get_step(epicenter, direction) + T.explosion_spread(power - epicenter.explosion_resistance, direction) + + //This step applies the ex_act effects for the explosion, as planned in the previous step. + for( var/datum/explosion_turf/ET in explosion_turfs ) + if(ET.max_power <= 0) continue + if(!ET.turf) continue + + var/severity = 4 - round(max(min( 3, (ET.max_power / 3) ) ,1), 1) + var/x = ET.turf.x + var/y = ET.turf.y + var/z = ET.turf.z + ET.turf.ex_act(severity) + if(!ET.turf) + ET.turf = locate(x,y,z) + for( var/atom/A in ET.turf ) + A.ex_act(severity) + + explosion_in_progress = 0 + +/turf + var/explosion_resistance + +/turf/space + explosion_resistance = 10 + +/turf/simulated/floor + explosion_resistance = 1 + +/turf/simulated/mineral + explosion_resistance = 2 + +/turf/simulated/shuttle/floor + explosion_resistance = 1 + +/turf/simulated/shuttle/floor4 + explosion_resistance = 1 + +/turf/simulated/shuttle/plating + explosion_resistance = 1 + +/turf/simulated/shuttle/wall + explosion_resistance = 5 + +/turf/simulated/wall + explosion_resistance = 5 + +/turf/simulated/r_wall + explosion_resistance = 25 + +/turf/simulated/wall/r_wall + explosion_resistance = 25 + +//Code-wise, a safe value for power is something up to ~25 or ~30.. This does quite a bit of damage to the station. +//direction is the direction that the spread took to come to this tile. So it is pointing in the main blast direction - meaning where this tile should spread most of it's force. +/turf/proc/explosion_spread(power, direction) + if(power <= 0) + return + + /* + sleep(2) + new/obj/effect/debugging/marker(src) + */ + + var/datum/explosion_turf/ET = get_explosion_turf(src) + if(ET.max_power >= power) + return //The turf already sustained and spread a power greated than what we are dealing with. No point spreading again. + ET.max_power = power + + var/spread_power = power - src.explosion_resistance //This is the amount of power that will be spread to the tile in the direction of the blast + var/side_spread_power = power - 2 * src.explosion_resistance //This is the amount of power that will be spread to the side tiles + for(var/obj/O in src) + if(O.explosion_resistance) + spread_power -= O.explosion_resistance + side_spread_power -= O.explosion_resistance + + var/turf/T = get_step(src, direction) + T.explosion_spread(spread_power, direction) + T = get_step(src, turn(direction,90)) + T.explosion_spread(side_spread_power, turn(direction,90)) + T = get_step(src, turn(direction,-90)) + T.explosion_spread(side_spread_power, turn(direction,90)) + + /* + for(var/direction in cardinal) + var/turf/T = get_step(src, direction) + T.explosion_spread(spread_power) + */ + +/turf/unsimulated/explosion_spread(power) + return //So it doesn't get to the parent proc, which simulates explosions \ No newline at end of file diff --git a/code/datums/configuration.dm b/code/datums/configuration.dm index 67dec25042e..0b1fabd5a6d 100644 --- a/code/datums/configuration.dm +++ b/code/datums/configuration.dm @@ -32,7 +32,6 @@ var/traitor_scaling = 0 //if amount of traitors scales based on amount of players var/protect_roles_from_antagonist = 0// If security and such can be tratior/cult/other var/Tensioner_Active = 0 // If the tensioner is running. - var/allow_Metadata = 0 // Metadata is supported. var/popup_admin_pm = 0 //adminPMs to non-admins show in a pop-up 'reply' window when set to 1. var/Ticklag = 0.9 var/Tickcomp = 0 @@ -50,6 +49,7 @@ var/kick_inactive = 0 //force disconnect for inactive players var/load_jobs_from_txt = 0 var/usealienwhitelist = 0 + var/allow_Metadata = 0 var/server var/banappeals @@ -185,7 +185,7 @@ if ("allow_admin_jump") config.allow_admin_jump = 1 - if("allow_admin_rev") + if ("allow_admin_rev") config.allow_admin_rev = 1 if ("allow_admin_spawning") diff --git a/code/defines/global.dm b/code/defines/global.dm index f5d4266cddb..df5fbc420e6 100644 --- a/code/defines/global.dm +++ b/code/defines/global.dm @@ -1,31 +1,18 @@ //This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 -var/global/obj/effect/datacore/data_core = null -var/global/obj/effect/overlay/plmaster = null -var/global/obj/effect/overlay/slmaster = null +var/obj/effect/datacore/data_core = null +var/obj/effect/overlay/plmaster = null +var/obj/effect/overlay/slmaster = null //obj/hud/main_hud1 = null -var/global/list/machines = list() -var/global/list/processing_objects = list() -var/global/list/active_diseases = list() +var/list/machines = list() +var/list/processing_objects = list() +var/list/active_diseases = list() //items that ask to be called every cycle -var/global/defer_powernet_rebuild = 0 // true if net rebuild will be called manually after an event +var/defer_powernet_rebuild = 0 // true if net rebuild will be called manually after an event - //list/global_map = null //Borked, do not touch. DMTG - //list/global_map = list(list(1,5),list(4,3))//an array of map Z levels. - //Resulting sector map looks like - //|_1_|_4_| - //|_5_|_3_| - // - //1 - SS13 - //4 - Derelict - //3 - AI satellite - //5 - empty space - - - ////////////// var/BLINDBLOCK = 0 var/DEAFBLOCK = 0 @@ -104,10 +91,6 @@ var/list/reg_dna = list( ) var/CELLRATE = 0.002 // multiplier for watts per tick <> cell storage (eg: .002 means if there is a load of 1000 watts, 20 units will be taken from a cell per second) var/CHARGELEVEL = 0.001 // Cap for how fast cells charge, as a percentage-per-tick (.001 means cellcharge is capped to 1% per second) -var/shuttle_z = 2 //default -var/airtunnel_start = 68 // default -var/airtunnel_stop = 68 // default -var/airtunnel_bottom = 72 // default var/list/monkeystart = list() var/list/wizardstart = list() var/list/newplayer_start = list() diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm index 07b1a4ee1a3..3dcc2ebc531 100644 --- a/code/game/jobs/job/job.dm +++ b/code/game/jobs/job/job.dm @@ -10,12 +10,6 @@ //Players will be allowed to spawn in as jobs that are set to "Station" var/faction = "None" - //How many players can be this job - var/total_positions = 0 - - //How many players can spawn in as this job - var/spawn_positions = 0 - //How many players have this job var/current_positions = 0 diff --git a/code/game/json.dm b/code/game/json.dm index fa237e675c0..31c90341a3d 100644 --- a/code/game/json.dm +++ b/code/game/json.dm @@ -40,7 +40,7 @@ proc/makejson() players += "[C.key];" F << "{\"mode\":\"[mode]\",\"players\" : \"[players]\",\"playercount\" : \"[playerscount]\",\"admin\" : \"[admins]\",\"time\" : \"[time2text(world.realtime,"MM/DD - hh:mm")]\"}" fcopy("info.json","[jsonpath]/info.json") - +/* /proc/switchmap(newmap,newpath) var/oldmap var/obj/mapinfo/M = locate() @@ -95,6 +95,7 @@ client/proc/ChangeMap(var/X as text) set name = "Change Map" set category = "Admin" switchmap(X,X) + */ proc/send2irc(msg,msg2) shell("python nudge.py [msg] [msg2]") proc/send2adminirc(channel,msg) diff --git a/code/game/landmarks.dm b/code/game/landmarks.dm index 31cd58b45ce..67367bd8df4 100644 --- a/code/game/landmarks.dm +++ b/code/game/landmarks.dm @@ -4,19 +4,6 @@ tag = text("landmark*[]", name) invisibility = 101 - if (name == "shuttle") - shuttle_z = z - del(src) - - if (name == "airtunnel_stop") - airtunnel_stop = x - - if (name == "airtunnel_start") - airtunnel_start = x - - if (name == "airtunnel_bottom") - airtunnel_bottom = y - if (name == "monkey") monkeystart += loc del(src) @@ -36,8 +23,7 @@ if (name == "prisonwarp") prisonwarp += loc del(src) -// if (name == "mazewarp") -// mazewarp += loc + if (name == "Holding Facility") holdingfacility += loc if (name == "tdome1") diff --git a/code/setup_3d.dm b/code/setup_3d.dm index 607e350f153..676579c6131 100644 --- a/code/setup_3d.dm +++ b/code/setup_3d.dm @@ -9,7 +9,7 @@ var/list/levels_3d = list(1,2) //To expediate calculations, just do "z in levels_3d" -var/list/global_adjacent_z_levels = list("1" = list("up" = 2), "2" = list("down" = 1)) //Example. 2 is above 1 +var/list/global_adjacent_z_levels = list(list("up" = 2),list("down" = 1),null,null,null,null) //Example. 2 is above 1 //Commented out ones are incomplete. //#include "TriDimension\Pipes.dm" //Example diff --git a/maps/map_controller/map_controller.dm b/maps/map_controller/map_controller.dm new file mode 100644 index 00000000000..e69de29bb2d diff --git a/maps/map_controller/maps.dm b/maps/map_controller/maps.dm new file mode 100644 index 00000000000..41c27a96b70 --- /dev/null +++ b/maps/map_controller/maps.dm @@ -0,0 +1,47 @@ + ///////////////////////////////////////////////////////////////////////////// + //Contents: Map datums for use with runtime map loading, and voteable maps.// +///////////////////////////////////////////////////////////////////////////// + +map + var + name = "Default/Debug Map" + desc = "You should not see this, tell a coder." + is_playable = 1 + is_flotilla = 0 + relative_path = "maps/tgstation.2.0.8.dmm" //Path from the .dmb file to the map. Set to TG station in case of derp. + + x = 1 + y = 1 + z = 1 + + engsec_job_flags = 0 + list/engsec_spawn_positions = list() + list/engsec_total_positions = list() + + medsci_job_flags = 0 + list/medsci_spawn_positions = list() + list/medsci_total_positions = list() + + civilian_job_flags = 0 + list/civilian_spawn_positions = list() + list/civilian_total_positions = list() + + + +map/tg_station + name = "/TG/'s SS13 map, TGstation 2.0.8" + desc = "A large map featuring a space station, derelict, mining asteroid, and communication satelite." + relative_path = "maps/tgstation.2.0.8.dmm" + x = 255 + y = 255 + z = 6 + +//All possible jobs availible. + engsec_job_flags = CAPTAIN|HOS|WARDEN|DETECTIVE|OFFICER|CHIEF|ENGINEER|ATMOSTECH|ROBOTICIST|AI|CYBORG + engsec_spawn_positions = list("[CAPTAIN]" = 1, + + + medsci_job_flags = RD|SCIENTIST|CHEMIST|CMO|DOCTOR|GENETICIST + + + civilian_job_flags = HOP|BARTENDER|BOTANIST|CHEF|JANITOR|LIBRARIAN|QUARTERMASTER|CARGOTECH|MINER|LAWYER|CHAPLAIN|CLOWN|MIME|ASSISTANT \ No newline at end of file diff --git a/code/modules/maps/SwapMaps.dm b/maps/map_editing/SwapMaps.dm similarity index 100% rename from code/modules/maps/SwapMaps.dm rename to maps/map_editing/SwapMaps.dm diff --git a/code/modules/maps/dmm_suite.dm b/maps/map_editing/dmm_suite.dm similarity index 100% rename from code/modules/maps/dmm_suite.dm rename to maps/map_editing/dmm_suite.dm diff --git a/code/modules/maps/fromdmp.dm b/maps/map_editing/fromdmp.dm similarity index 100% rename from code/modules/maps/fromdmp.dm rename to maps/map_editing/fromdmp.dm diff --git a/code/modules/maps/randomZlevel.dm b/maps/map_editing/randomZlevel.dm similarity index 100% rename from code/modules/maps/randomZlevel.dm rename to maps/map_editing/randomZlevel.dm diff --git a/code/modules/maps/reader.dm b/maps/map_editing/reader.dm similarity index 100% rename from code/modules/maps/reader.dm rename to maps/map_editing/reader.dm diff --git a/code/modules/maps/writer.dm b/maps/map_editing/writer.dm similarity index 100% rename from code/modules/maps/writer.dm rename to maps/map_editing/writer.dm diff --git a/maps/RandomZLevels/assistantChamber.dmm b/maps/map_storage/assistantChamber.dmm similarity index 100% rename from maps/RandomZLevels/assistantChamber.dmm rename to maps/map_storage/assistantChamber.dmm