Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $$ user.status = function()
- {
- args = quoteArgs(Array.from(arguments));
- var charName = getNext("-character",user.currentCharacter);
- character = user.characters[charName];
- var hpAdj = getNext("-hp");
- if (hpAdj == "reset") character.sheet.hp = character.sheet.maxHP;
- else if (hpAdj) character.sheet.hp = parseInt(character.sheet.hp) + parseInt(hpAdj);
- var spellName = getNext("-spell");
- if (spellName) character.status.concentration.spellname = spellName;
- var effect = getNext("-effect");
- if (effect) character.status.concentration.effect = effect;
- var target = getNext("-target");
- if (target) character.status.concentration.target = target;
- var ends = getNext("-ends");
- if (ends) character.status.concentration.ends = ends;
- var condition = getNext("-condition");
- if (condition) character.status.condition = condition;
- var conditionEnds = getNext("-conditionends");
- if (conditionEnds) character.status.conditionEnds = conditionEnds;
- var stealth = getNext("-stealth");
- if (stealth) character.status.stealth = stealth;
- var pos = getNext("-pos");
- if (pos) character.status.position = pos;
- if (inArguments(args,"clear"))
- {
- if (inArguments(args,"spell"))
- {
- character.status.concentration.spellname = "none";
- character.status.concentration.effect = "none";
- character.status.concentration.target = "none";
- character.status.concentration.ends = "none";
- }
- if (inArguments(args,"condition"))
- {
- character.status.condition = "none";
- character.status.conditionEnds = "none";
- }
- character.status.stealth = 0;
- character.status.position = "Outside Combat";
- }
- if (!inArguments(args,"silent"))
- {
- displayStatus();
- }
- }
- $$ user.displayStatus = function()
- {
- echo("```"+character.sheet.name+"'s Status```");
- echo("**Hit Points: **" + character.sheet.hp + "/" + character.sheet.maxHP + "\n");
- echo("**Position: **" + character.status.position + "\n");
- if (character.status.condition!="none")
- {
- conditionString = character.status.condition;
- if (character.status.conditionEnds!="none")
- {
- conditionString += " (Ends " + character.status.conditionEnds + ")";
- }
- echo("**Condition: **" + conditionString + "\n");
- }
- if (character.status.stealth!=0)
- {
- echo("**Stealth: **" + character.status.stealth + "\n");
- }
- if (character.status.concentration.spellname!="none")
- {
- spellstring = "**Concentration: **" + character.status.concentration.spellname;
- if (character.status.concentration.effect!="none")
- {
- spellstring+= " [" + character.status.concentration.effect + "]";
- }
- if (character.status.concentration.target!="none")
- {
- spellstring+= " on " + character.status.concentration.target;
- }
- if (character.status.concentration.ends!="none")
- {
- spellstring+= " (Ends " + character.status.concentration.ends + ")";
- }
- echo(spellstring + "\n");
- }
- if (inArguments(args,"end"))
- {
- echo("```END TURN```");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment