Files
Bubberstation/code/game/objects/items/kitchen.dm
Zonespace 8fabd54ad6 Mirrors #72354 (#18654)
* [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>
2023-01-13 18:05:12 -05:00

173 lines
5.4 KiB
Plaintext

/* Kitchen tools
* Contains:
* Fork
* Kitchen knives
* Rolling Pins
* Plastic Utensils
*/
#define PLASTIC_BREAK_PROBABILITY 25
/obj/item/kitchen
icon = 'icons/obj/kitchen.dmi'
lefthand_file = 'icons/mob/inhands/equipment/kitchen_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/kitchen_righthand.dmi'
/obj/item/kitchen/Initialize(mapload)
. = ..()
ADD_TRAIT(src, TRAIT_APC_SHOCKING, INNATE_TRAIT)
/obj/item/kitchen/fork
name = "fork"
desc = "Pointy."
icon_state = "fork"
force = 4
w_class = WEIGHT_CLASS_TINY
throwforce = 0
throw_speed = 3
throw_range = 5
custom_materials = list(/datum/material/iron=80)
flags_1 = CONDUCT_1
attack_verb_continuous = list("attacks", "stabs", "pokes")
attack_verb_simple = list("attack", "stab", "poke")
hitsound = 'sound/weapons/bladeslice.ogg'
armor_type = /datum/armor/kitchen_fork
sharpness = SHARP_POINTY
var/datum/reagent/forkload //used to eat omelette
custom_price = PAYCHECK_LOWER
/datum/armor/kitchen_fork
fire = 50
acid = 30
/obj/item/kitchen/fork/Initialize(mapload)
. = ..()
AddElement(/datum/element/eyestab)
/obj/item/kitchen/fork/suicide_act(mob/living/carbon/user)
user.visible_message(span_suicide("[user] stabs \the [src] into [user.p_their()] chest! It looks like [user.p_theyre()] trying to take a bite out of [user.p_them()]self!"))
playsound(src, 'sound/items/eatfood.ogg', 50, TRUE)
return BRUTELOSS
/obj/item/kitchen/fork/attack(mob/living/carbon/M, mob/living/carbon/user)
if(!istype(M))
return ..()
if(forkload)
if(M == user)
M.visible_message(span_notice("[user] eats a delicious forkful of omelette!"))
M.reagents.add_reagent(forkload.type, 1)
else
M.visible_message(span_notice("[user] feeds [M] a delicious forkful of omelette!"))
M.reagents.add_reagent(forkload.type, 1)
icon_state = "fork"
forkload = null
else
return ..()
/obj/item/kitchen/fork/plastic
name = "plastic fork"
desc = "Really takes you back to highschool lunch."
icon_state = "plastic_fork"
force = 0
w_class = WEIGHT_CLASS_TINY
throwforce = 0
custom_materials = list(/datum/material/plastic=80)
custom_price = PAYCHECK_LOWER * 2
/obj/item/kitchen/fork/plastic/Initialize(mapload)
. = ..()
AddElement(/datum/element/easily_fragmented, PLASTIC_BREAK_PROBABILITY)
/obj/item/knife/kitchen
name = "kitchen knife"
desc = "A general purpose Chef's Knife made by SpaceCook Incorporated. Guaranteed to stay sharp for years to come."
/obj/item/knife/plastic
name = "plastic knife"
icon_state = "plastic_knife"
inhand_icon_state = "knife"
desc = "A very safe, barely sharp knife made of plastic. Good for cutting food and not much else."
force = 0
w_class = WEIGHT_CLASS_TINY
throwforce = 0
throw_range = 5
custom_materials = list(/datum/material/plastic = 100)
attack_verb_continuous = list("prods", "whiffs", "scratches", "pokes")
attack_verb_simple = list("prod", "whiff", "scratch", "poke")
sharpness = SHARP_EDGED
custom_price = PAYCHECK_LOWER * 2
/obj/item/knife/plastic/Initialize(mapload)
. = ..()
AddElement(/datum/element/easily_fragmented, PLASTIC_BREAK_PROBABILITY)
/obj/item/kitchen/rollingpin
name = "rolling pin"
desc = "Used to knock out the Bartender."
icon_state = "rolling_pin"
worn_icon_state = "rolling_pin"
inhand_icon_state = "rolling_pin"
force = 8
throwforce = 5
throw_speed = 3
throw_range = 7
custom_materials = list(/datum/material/wood = MINERAL_MATERIAL_AMOUNT * 1.5)
w_class = WEIGHT_CLASS_NORMAL
attack_verb_continuous = list("bashes", "batters", "bludgeons", "thrashes", "whacks")
attack_verb_simple = list("bash", "batter", "bludgeon", "thrash", "whack")
custom_price = PAYCHECK_CREW * 1.5
tool_behaviour = TOOL_ROLLINGPIN
/obj/item/kitchen/rollingpin/illegal
name = "metal rolling pin"
desc = "A heavy metallic rolling pin used to bash in those annoying ingredients."
icon_state = "metal_rolling_pin"
inhand_icon_state = "metal_rolling_pin"
force = 12
flags_1 = CONDUCT_1
custom_materials = list(/datum/material/iron = MINERAL_MATERIAL_AMOUNT * 1.5, /datum/material/plastic = MINERAL_MATERIAL_AMOUNT * 1.5)
custom_price = PAYCHECK_CREW * 2
bare_wound_bonus = 14
/obj/item/kitchen/rollingpin/suicide_act(mob/living/carbon/user)
user.visible_message(span_suicide("[user] begins flattening [user.p_their()] head with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!"))
return BRUTELOSS
/* Trays moved to /obj/item/storage/bag */
/obj/item/kitchen/spoon
name = "spoon"
desc = "Just be careful your food doesn't melt the spoon first."
icon_state = "spoon"
w_class = WEIGHT_CLASS_TINY
flags_1 = CONDUCT_1
force = 2
throw_speed = 3
throw_range = 5
attack_verb_simple = list("whack", "spoon", "tap")
attack_verb_continuous = list("whacks", "spoons", "taps")
armor_type = /datum/armor/kitchen_spoon
custom_materials = list(/datum/material/iron=120)
custom_price = PAYCHECK_LOWER * 5
tool_behaviour = TOOL_MINING
toolspeed = 25 // Literally 25 times worse than the base pickaxe
/obj/item/kitchen/spoon/plastic
name = "plastic spoon"
icon_state = "plastic_spoon"
force = 0
custom_materials = list(/datum/material/plastic=120)
custom_price = PAYCHECK_LOWER * 2
toolspeed = 75 // The plastic spoon takes 5 minutes to dig through a single mineral turf... It's one, continuous, breakable, do_after...
/datum/armor/kitchen_spoon
fire = 50
acid = 30
/obj/item/kitchen/spoon/plastic/Initialize(mapload)
. = ..()
AddElement(/datum/element/easily_fragmented, PLASTIC_BREAK_PROBABILITY)
#undef PLASTIC_BREAK_PROBABILITY