mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-03 21:42:06 +00:00
* [no gbp] removes all duplicate armor datums (#72354) closes #72348 Title My bad Heres the script I used this time if you want to ```cs var baseDir = Environment.CurrentDirectory; var allFiles = Directory.EnumerateFiles($@"{baseDir}\code", "*.dm", SearchOption.AllDirectories).ToList(); var known = new Dictionary<string, List<KeyValuePair<string, int>>>(); foreach (var file in allFiles) { var fileLines = File.ReadAllLines(file); for (var i = 0; i < fileLines.Length; i++) { var line = fileLines[i]; if (line.StartsWith("/datum/armor/")) { var armorName = line.Replace("/datum/armor/", "").Trim(); if (!known.ContainsKey(armorName)) known[armorName] = new List<KeyValuePair<string, int>>(); var knownList = known[armorName]; knownList.Add(new KeyValuePair<string, int>(file, i)); } } } Console.WriteLine($"There are {known.Sum(d => d.Value.Count)} duplicate armor datums."); var duplicates = new Dictionary<string, List<int>>(); foreach (var (_, entries) in known) { var actuals = entries.Skip(1).ToList(); foreach (var actual in actuals) { if (!duplicates.ContainsKey(actual.Key)) duplicates[actual.Key] = new List<int>(); duplicates[actual.Key].Add(actual.Value); } } Console.WriteLine($"There are {duplicates.Count} files to update."); foreach (var (file, idxes) in duplicates) { var fileContents = File.ReadAllLines(file).ToList(); foreach (var idx in idxes.OrderByDescending(i => i)) { string line; do { line = fileContents[idx]; fileContents.RemoveAt(idx); } while (!String.IsNullOrWhiteSpace(line)); } File.WriteAllLines(file, fileContents); } ``` * modular Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com>
This commit is contained in:
@@ -55,14 +55,6 @@
|
||||
name = "secure hydroponics crate"
|
||||
icon_state = "hydrosecurecrate"
|
||||
|
||||
/datum/armor/crate_secure
|
||||
melee = 30
|
||||
bullet = 50
|
||||
laser = 50
|
||||
energy = 100
|
||||
fire = 80
|
||||
acid = 80
|
||||
|
||||
/obj/structure/closet/crate/secure/freezer //for consistency with other "freezer" closets/crates
|
||||
desc = "An insulated crate with a lock on it, used to secure perishables."
|
||||
name = "secure kitchen crate"
|
||||
@@ -74,14 +66,6 @@
|
||||
req_access = list(ACCESS_KITCHEN)
|
||||
tamperproof = 10
|
||||
|
||||
/datum/armor/crate_secure
|
||||
melee = 30
|
||||
bullet = 50
|
||||
laser = 50
|
||||
energy = 100
|
||||
fire = 80
|
||||
acid = 80
|
||||
|
||||
/obj/structure/closet/crate/secure/freezer/pizza/PopulateContents()
|
||||
. = ..()
|
||||
new /obj/effect/spawner/random/food_or_drink/pizzaparty(src)
|
||||
@@ -109,14 +93,6 @@
|
||||
///Is the crate being bought by a person, or a budget card?
|
||||
var/department_purchase = FALSE
|
||||
|
||||
/datum/armor/crate_secure
|
||||
melee = 30
|
||||
bullet = 50
|
||||
laser = 50
|
||||
energy = 100
|
||||
fire = 80
|
||||
acid = 80
|
||||
|
||||
/obj/structure/closet/crate/secure/owned/examine(mob/user)
|
||||
. = ..()
|
||||
. += span_notice("It's locked with a privacy lock, and can only be unlocked by the buyer's ID.")
|
||||
|
||||
Reference in New Issue
Block a user