mirror of
https://github.com/raeleus/Hashtag-DnD.git
synced 2025-07-05 21:20:27 -04:00
Added #clonecharacter.
This commit is contained in:
parent
9afe8b489e
commit
0d6d80e6c0
4 changed files with 42 additions and 2 deletions
24
Input.js
24
Input.js
|
@ -1,7 +1,7 @@
|
|||
const rollSynonyms = ["roll"]
|
||||
const createSynonyms = ["create", "generate", "start", "begin", "setup", "party", "member", "new"]
|
||||
const renameCharacterSynonyms = ["renamecharacter", "renameperson"]
|
||||
const cloneCharacterSynonyms = ["clonecharacter", "cloneperson", "copycharacter", "copyperson"]
|
||||
const cloneCharacterSynonyms = ["clone", "clonecharacter", "cloneperson", "copycharacter", "copyperson", "duplicatecharacter", "duplicateperson", "dupecharacter", "dupeperson"]
|
||||
const bioSynonyms = ["bio", "biography", "summary", "character", "charactersheet", "statsheet"]
|
||||
const setClassSynonyms = ["setclass", "class"]
|
||||
const setSummarySynonyms = ["setsummary", "summary"]
|
||||
|
@ -151,7 +151,7 @@ const modifier = (text) => {
|
|||
if (text == null) text = processCommandSynonyms(command, commandName, showDefaultDifficultySynonyms, doShowDefaultDifficulty)
|
||||
if (text == null) text = processCommandSynonyms(command, commandName, generateNameSynonyms, doGenerateName)
|
||||
if (text == null) text = processCommandSynonyms(command, commandName, renameCharacterSynonyms, doRenameCharacter)
|
||||
// if (text == null) text = processCommandSynonyms(command, commandName, cloneCharacterSynonyms, doCloneCharacter)
|
||||
if (text == null) text = processCommandSynonyms(command, commandName, cloneCharacterSynonyms, doCloneCharacter)
|
||||
if (text == null) text = processCommandSynonyms(command, commandName, helpSynonyms, doHelp)
|
||||
if (text == null) {
|
||||
var character = getCharacter()
|
||||
|
@ -590,6 +590,26 @@ function doRenameCharacter(command) {
|
|||
return text
|
||||
}
|
||||
|
||||
function doCloneCharacter(command) {
|
||||
var character = getCharacter()
|
||||
var possessiveName = getPossessiveName(character.name)
|
||||
|
||||
var arg0 = getArgumentRemainder(command, 0)
|
||||
if (arg0 == null) {
|
||||
state.show = "none"
|
||||
return "\n[Error: Not enough parameters. See #help]\n"
|
||||
}
|
||||
|
||||
if (!hasCharacter(arg0)) createCharacter(arg0)
|
||||
var newCharacter = getCharacter(arg0)
|
||||
copyCharacter(character, newCharacter)
|
||||
|
||||
state.show = "none"
|
||||
var text = `\n[${character.name} has been cloned to a new character called ${newCharacter.name}]\n`
|
||||
|
||||
return text
|
||||
}
|
||||
|
||||
function doSetStat(command) {
|
||||
var character = getCharacter()
|
||||
var arg0 = getArgument(command, 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue