From ea8a9376686f570ab0c89a74b52bfadf1dae550a Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Wed, 30 May 2018 20:16:04 -0400 Subject: [PATCH] Shoes can be put on before socks. Removing socks or shoes causes stench. --- game.js | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 60 insertions(+), 8 deletions(-) diff --git a/game.js b/game.js index ab4af41..2ddd09c 100644 --- a/game.js +++ b/game.js @@ -2768,6 +2768,32 @@ function remove_shoes() { footwearUpdate(); update([line,summary,newline]); + + if (macro.stenchEnabled) { + remove_shoes_stench(); + } +} + +function remove_shoes_stench() { + let area = macro.pawStenchArea * 2; + let prey = getPrey(biome, area); + let line = describe("paw-stench", prey, macro, verbose); + let linesummary = summarize(prey.sum(), true); + + let people = get_living_prey(prey.sum()); + + if (get_living_prey(prey.sum()) == 0) + return; + + let preyMass = prey.sum_property("mass"); + + macro.addGrowthPoints(preyMass); + + add_victim_people("paw-stench",prey); + + update([line,linesummary,newline]); + + macro.arouse(5); } function wear_socks() { @@ -2799,6 +2825,32 @@ function remove_socks() { footwearUpdate(); update([line,summary,newline]); + + if (macro.stenchEnabled) { + remove_socks_stench(); + } +} + +function remove_socks_stench() { + let area = macro.pawStenchArea * 2; + let prey = getPrey(biome, area); + let line = describe("paw-stench", prey, macro, verbose); + let linesummary = summarize(prey.sum(), true); + + let people = get_living_prey(prey.sum()); + + if (get_living_prey(prey.sum()) == 0) + return; + + let preyMass = prey.sum_property("mass"); + + macro.addGrowthPoints(preyMass); + + add_victim_people("paw-stench",prey); + + update([line,linesummary,newline]); + + macro.arouse(5); } function stuff_shoes() { @@ -2862,23 +2914,23 @@ function footwearUpdate() { } else { enable_button("stuff_shoes"); enable_button("dump_shoes"); - - if (!macro.footSockEnabled || macro.footSockWorn) { - enable_button("wear_shoes"); - } + enable_button("wear_shoes"); } } - if (!macro.footShoeEnabled || !macro.footShoeWorn) { - if (macro.footSockEnabled) { + if (macro.footSockEnabled) { + if (!macro.footShoeEnabled || !macro.footShoeWorn) { if (macro.footSockWorn) { enable_button("remove_socks"); } else { enable_button("wear_socks"); - enable_button("stuff_socks"); - enable_button("dump_socks"); } } + + if (!macro.footSockWorn) { + enable_button("stuff_socks"); + enable_button("dump_socks"); + } } }