Skip to content

Commit

Permalink
First pass on porting /tg/ maploader.
Browse files Browse the repository at this point in the history
  • Loading branch information
thasc committed Nov 8, 2017
1 parent 886e01e commit 095263a
Show file tree
Hide file tree
Showing 36 changed files with 1,054 additions and 289 deletions.
10 changes: 9 additions & 1 deletion baystation12.dme
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
#include "code\__defines\ZAS.dm"
#include "code\_global_vars\configuration.dm"
#include "code\_global_vars\logging.dm"
#include "code\_global_vars\mapping.dm"
#include "code\_global_vars\misc.dm"
#include "code\_global_vars\mobs.dm"
#include "code\_global_vars\radio.dm"
Expand Down Expand Up @@ -171,6 +172,7 @@
#include "code\controllers\subsystems\garbage.dm"
#include "code\controllers\subsystems\legacy.dm"
#include "code\controllers\subsystems\machines.dm"
#include "code\controllers\subsystems\mapping.dm"
#include "code\controllers\subsystems\open_space_controller.dm"
#include "code\controllers\subsystems\processing\airflow.dm"
#include "code\controllers\subsystems\processing\fastprocess.dm"
Expand All @@ -188,6 +190,7 @@
#include "code\datums\mind.dm"
#include "code\datums\progressbar.dm"
#include "code\datums\recipe.dm"
#include "code\datums\ruins.dm"
#include "code\datums\security_state.dm"
#include "code\datums\shackle_law_sets.dm"
#include "code\datums\sound_player.dm"
Expand Down Expand Up @@ -229,6 +232,9 @@
#include "code\datums\helper_datums\global_iterator.dm"
#include "code\datums\helper_datums\teleport.dm"
#include "code\datums\helper_datums\topic_input.dm"
#include "code\datums\map_templates\away_sites.dm"
#include "code\datums\map_templates\exoplanet_ruins.dm"
#include "code\datums\map_templates\space_ruins.dm"
#include "code\datums\observation\_defines.dm"
#include "code\datums\observation\death.dm"
#include "code\datums\observation\density_set.dm"
Expand Down Expand Up @@ -1098,6 +1104,7 @@
#include "code\modules\admin\verbs\dice.dm"
#include "code\modules\admin\verbs\getlogs.dm"
#include "code\modules\admin\verbs\grief_fixers.dm"
#include "code\modules\admin\verbs\map_template_loadverb.dm"
#include "code\modules\admin\verbs\mapping.dm"
#include "code\modules\admin\verbs\massmodvar.dm"
#include "code\modules\admin\verbs\modifyvariables.dm"
Expand Down Expand Up @@ -1489,9 +1496,10 @@
#include "code\modules\locks\lock.dm"
#include "code\modules\locks\lock_construct.dm"
#include "code\modules\maps\dmm_suite.dm"
#include "code\modules\maps\map_template.dm"
#include "code\modules\maps\reader.dm"
#include "code\modules\maps\ruins.dm"
#include "code\modules\maps\swapmaps.dm"
#include "code\modules\maps\writer.dm"
#include "code\modules\materials\material_recipes.dm"
#include "code\modules\materials\material_sheets.dm"
#include "code\modules\materials\material_synth.dm"
Expand Down
2 changes: 2 additions & 0 deletions code/__defines/misc.dm
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#define DEBUG
// Turf-only flags.
#define NOJAUNT 1 // This is used in literally one place, turf.dm, to block ethereal jaunt.
#define NORUINS 2

#define TRANSITIONEDGE 7 // Distance from edge to move to another z-level.
#define RUIN_MAP_EDGE_PAD 15

// Invisibility constants.
#define INVISIBILITY_LIGHTING 20
Expand Down
1 change: 1 addition & 0 deletions code/_global_vars/mapping.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GLOBAL_LIST_EMPTY(ruin_landmarks)
3 changes: 3 additions & 0 deletions code/_helpers/cmp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,6 @@
. = B.failures - A.failures
if (!.)
. = B.qdels - A.qdels

/proc/cmp_ruincost_priority(datum/map_template/ruin/A, datum/map_template/ruin/B)
return initial(A.cost) - initial(B.cost)
35 changes: 10 additions & 25 deletions code/_helpers/global_access.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,18 @@
return global.SSlegacy;
if("SSmachines")
return global.SSmachines;
if("SSmapping")
return global.SSmapping;
if("SSmobs")
return global.SSmobs;
if("SSvines")
return global.SSvines;
if("SSobj")
return global.SSobj;
if("SSopen_space")
return global.SSopen_space;
if("SSprocessing")
return global.SSprocessing;
if("SSvines")
return global.SSvines;
if("Tier1Runes")
return global.Tier1Runes;
if("Tier2Runes")
Expand All @@ -79,8 +81,6 @@
return global._client_preferences_by_key;
if("_client_preferences_by_type")
return global._client_preferences_by_type;
if("_preloader")
return global._preloader;
if("account_hack_attempted")
return global.account_hack_attempted;
if("actor")
Expand Down Expand Up @@ -1112,16 +1112,18 @@
global.SSlegacy=newval;
if("SSmachines")
global.SSmachines=newval;
if("SSmapping")
global.SSmapping=newval;
if("SSmobs")
global.SSmobs=newval;
if("SSvines")
global.SSvines=newval;
if("SSobj")
global.SSobj=newval;
if("SSopen_space")
global.SSopen_space=newval;
if("SSprocessing")
global.SSprocessing=newval;
if("SSvines")
global.SSvines=newval;
if("Tier1Runes")
global.Tier1Runes=newval;
if("Tier2Runes")
Expand All @@ -1140,8 +1142,6 @@
global._client_preferences_by_key=newval;
if("_client_preferences_by_type")
global._client_preferences_by_type=newval;
if("_preloader")
global._preloader=newval;
if("account_hack_attempted")
global.account_hack_attempted=newval;
if("actor")
Expand Down Expand Up @@ -2147,11 +2147,12 @@
"SSgarbage",
"SSlegacy",
"SSmachines",
"SSmapping",
"SSmobs",
"SSvines",
"SSobj",
"SSopen_space",
"SSprocessing",
"SSvines",
"Tier1Runes",
"Tier2Runes",
"Tier3Runes",
Expand All @@ -2161,7 +2162,6 @@
"_client_preferences",
"_client_preferences_by_key",
"_client_preferences_by_type",
"_preloader",
"account_hack_attempted",
"actor",
"additional_antag_types",
Expand Down Expand Up @@ -2235,7 +2235,6 @@
"blocked",
"bomb_set",
"borers",
"button_sound",
"cable_list",
"cached_icons",
"cached_space",
Expand All @@ -2258,7 +2257,6 @@
"church_name",
"client_preference_stats_",
"client_repository",
"clown_sound",
"combatlog",
"comm_message_listeners",
"command_announcement",
Expand Down Expand Up @@ -2313,7 +2311,6 @@
"eventchance",
"exclude_jobs",
"explosion_in_progress",
"explosion_sound",
"explosion_turfs",
"facial_hair_styles_female_list",
"facial_hair_styles_list",
Expand All @@ -2334,7 +2331,6 @@
"fluidtrack_cache",
"follow_repository",
"forced_ambiance_list",
"fracture_sound",
"fruit_icon_cache",
"fuel_injectors",
"fusion_cores",
Expand Down Expand Up @@ -2362,7 +2358,6 @@
"hair_styles_male_list",
"hazard_overlays",
"hidden_skill_types",
"hiss_sound",
"hivemind_bank",
"holder_mob_icon_cache",
"host",
Expand All @@ -2383,7 +2378,6 @@
"jobban_runonce",
"joblist",
"join_motd",
"keyboard_sound",
"landmarks_list",
"language_keys",
"last_chew",
Expand All @@ -2393,7 +2387,6 @@
"license_to_url",
"light_overlay_cache",
"light_type_cache",
"lighter_sound",
"lighting_overlays_initialised",
"lighting_update_corners",
"lighting_update_corners_old",
Expand Down Expand Up @@ -2462,7 +2455,6 @@
"next_station_date_change",
"ninjas",
"ninjastart",
"non_fakeattack_weapons",
"not_incapacitated_turf_state",
"ntnet_card_uid",
"ntnet_global",
Expand All @@ -2478,7 +2470,6 @@
"outfits_decls_by_type_",
"outfits_decls_root_",
"overmap_event_handler",
"page_sound",
"paiController",
"pai_emotions",
"pai_software_by_key",
Expand Down Expand Up @@ -2512,7 +2503,6 @@
"processing_turfs",
"prometheans",
"protected_objects",
"punch_sound",
"rad_collectors",
"radiation_repository",
"radio_controller",
Expand Down Expand Up @@ -2541,7 +2531,6 @@
"roundstart_hour",
"rune_list",
"runtime_diary",
"rustle_sound",
"same_wires",
"scheduler",
"secondary_mode",
Expand All @@ -2550,7 +2539,6 @@
"sent_spiders_to_station",
"server_name",
"severity_to_string",
"shatter_sound",
"ship_engines",
"shuttle_controller",
"side_effects",
Expand All @@ -2564,7 +2552,6 @@
"sound_player",
"sounds_cache",
"spacevines_spawned",
"spark_sound",
"sparring_attack_cache",
"spells",
"splatter_cache",
Expand Down Expand Up @@ -2595,8 +2582,6 @@
"swapmaps_initialized",
"swapmaps_loaded",
"swapmaps_mode",
"swing_hit_sound",
"switch_sound",
"syndicate_access",
"syndicate_code_phrase",
"syndicate_code_response",
Expand Down
10 changes: 10 additions & 0 deletions code/_helpers/lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -701,3 +701,13 @@ proc/dd_sortedTextList(list/incoming)
L.Swap(start++,end--)

return L

//Copies a list, and all lists inside it recusively
//Does not copy any other reference type
/proc/deepCopyList(list/l)
if(!islist(l))
return l
. = l.Copy()
for(var/i = 1 to l.len)
if(islist(.[i]))
.[i] = .(.[i])
58 changes: 57 additions & 1 deletion code/_helpers/text.dm
Original file line number Diff line number Diff line change
Expand Up @@ -397,4 +397,60 @@ proc/TextPreview(var/string,var/len=40)
newKey += pick("the", "if", "of", "as", "in", "a", "you", "from", "to", "an", "too", "little", "snow", "dead", "drunk", "rosebud", "duck", "al", "le")
newKey += pick("diamond", "beer", "mushroom", "assistant", "clown", "captain", "twinkie", "security", "nuke", "small", "big", "escape", "yellow", "gloves", "monkey", "engine", "nuclear", "ai")
newKey += pick("1", "2", "3", "4", "5", "6", "7", "8", "9", "0")
return newKey
return newKey

//Used for applying byonds text macros to strings that are loaded at runtime
/proc/apply_text_macros(string)
var/next_backslash = findtext(string, "\\")
if(!next_backslash)
return string

var/leng = length(string)

var/next_space = findtext(string, " ", next_backslash + 1)
if(!next_space)
next_space = leng - next_backslash

if(!next_space) //trailing bs
return string

var/base = next_backslash == 1 ? "" : copytext(string, 1, next_backslash)
var/macro = lowertext(copytext(string, next_backslash + 1, next_space))
var/rest = next_backslash > leng ? "" : copytext(string, next_space + 1)

//See http://www.byond.com/docs/ref/info.html#/DM/text/macros
switch(macro)
//prefixes/agnostic
if("the")
rest = text("\the []", rest)
if("a")
rest = text("\a []", rest)
if("an")
rest = text("\an []", rest)
if("proper")
rest = text("\proper []", rest)
if("improper")
rest = text("\improper []", rest)
if("roman")
rest = text("\roman []", rest)
//postfixes
if("th")
base = text("[]\th", rest)
if("s")
base = text("[]\s", rest)
if("he")
base = text("[]\he", rest)
if("she")
base = text("[]\she", rest)
if("his")
base = text("[]\his", rest)
if("himself")
base = text("[]\himself", rest)
if("herself")
base = text("[]\herself", rest)
if("hers")
base = text("[]\hers", rest)

. = base
if(rest)
. += .(rest)
Loading

0 comments on commit 095263a

Please sign in to comment.