mirror of
https://github.com/raeleus/Hashtag-DnD.git
synced 2025-07-06 05:30:28 -04:00
Fixed plural of command name used in #take. Resolves #17
This commit is contained in:
parent
0d6d80e6c0
commit
780d7b2829
1 changed files with 4 additions and 3 deletions
7
Input.js
7
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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue