From 780d7b282981bd397ca08fd9c90f4789b6cdc4cd Mon Sep 17 00:00:00 2001 From: raeleus Date: Sun, 29 Sep 2024 10:40:09 -0700 Subject: [PATCH] Fixed plural of command name used in #take. Resolves #17 --- Input.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Input.js b/Input.js index e06316a..f76f762 100644 --- a/Input.js +++ b/Input.js @@ -1177,16 +1177,17 @@ function doTake(command) { name: getArgumentRemainder(command, isNaN(arg0) ? 0 : 1).replace(/^((the)|(a)|(an))\s/, "").plural(true) } - var commandName = getCommandName(command) var character = getCharacter() + var commandName = getCommandName(command) + var commandNamePlural = commandName.plural(character.name == "You") var haveWord = character.name == "You" ? "have" : "has" var displayItemName = item.name.plural(item.quantity == 1) if (item.quantity < 0) item.quantity = 1 var text = "\n" - if (item.quantity == 1) text += `${character.name} ${commandName} ${displayItemName.toLowerCase().startsWith("the ") ? "" : "the "}${displayItemName}.\n` - else text += `${character.name} ${commandName} ${item.quantity} ${displayItemName}.\n` + if (item.quantity == 1) text += `${character.name} ${commandNamePlural} ${displayItemName.toLowerCase().startsWith("the ") ? "" : "the "}${displayItemName}.\n` + else text += `${character.name} ${commandNamePlural} ${item.quantity} ${displayItemName}.\n` var index = character.inventory.findIndex((element) => element.name.toLowerCase() == item.name.toLowerCase()) if (index == -1) {