matthileo

Untitled

Aug 10th, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. user.maneuver = function()
  2. {
  3.     var args = quoteArgs(Array.from(arguments));
  4.     var character = user.characters[user.currentCharacter];
  5.    
  6.     var atkPhrase = character.sheet.name + " makes a ";
  7.     var APO = atkPhrase;
  8.     var toHitPhrase="";
  9.     var damagePhrase="";
  10.     var effectPhrase="";
  11.    
  12.     var sd = "d10";
  13.     var dice = 1;
  14.     var toHitDie = getDieRoll(character.lastAttack.toHit);
  15.     var isCrit = (toHitDie == 20 || inArguments(args,"crit"));
  16.     var isNat20 = (toHitDie == 20);
  17.    
  18.     if (inArguments(args,"crit") || isCrit) dice *= 2;
  19.    
  20.     sd = dice + sd;
  21.    
  22.     if (inArguments(args,"precision"))
  23.     {
  24.         atkPhrase += "precision";
  25.         proll = roll(character.lastAttack.toHit.plain + " [Original To Hit] + " + "1d10 [Superiority Die]");
  26.         toHitPhrase = "**NEW To Hit: **" +  proll.string;
  27.         damagePhrase = "**Damage: **" + character.lastAttack.damage.string;
  28.     }
  29.     if (inArguments(args,"trip"))
  30.     {
  31.         if (atkPhrase==APO) atkPhrase += "trip";
  32.         else atkPhrase+=", trip";
  33.         proll = roll(character.lastAttack.damage.plain + " [Original Damage] + " + sd + "[Superiority Die]");
  34.         damagePhrase = "**NEW Damage: **" + proll.string;
  35.         effectPhrase = "**Effect:** If Target is Large or smaller, it must make a `DC "+parseInt(8+character.sheet.strMod+character.sheet.proficiencyBonus)+"` Strength saving throw or be knocked prone.";
  36.     }
  37.     if (inArguments(args,"menace"))
  38.     {
  39.         if (atkPhrase==APO) atkPhrase += "menacing";
  40.         else atkPhrase += ", menacing";
  41.         proll = roll(character.lastAttack.damage.plain + " [Original Damage] + " + sd + "[Superiority Die]");
  42.         damagePhrase = "**NEW Damage: **" + proll.string;
  43.         effectPhrase = "**Effect:** Target must make a `DC "+parseInt(8+character.sheet.strMod+character.sheet.proficiencyBonus)+"` Wisdom saving throw or, it is frightened of me until the end of my next turn.";
  44.     }
  45.    
  46.     echo("\n*" + atkPhrase + " attack!*\n");
  47.     if (toHitPhrase!="") echo(toHitPhrase + "\n");
  48.     if (damagePhrase!="") echo(damagePhrase + "\n");
  49.     if (effectPhrase!="") echo(effectPhrase + "\n");
  50. }
Advertisement
Add Comment
Please, Sign In to add comment