matthileo

Attack Macro: Modifiers and Display

May 28th, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ^^ user.attackModifiers = {
  2.     na: function(toHit) {
  3.         toHit.dieCount = 0;
  4.     },
  5.     adv: function(toHit) {
  6.         toHit.dieCount = 2;
  7.         toHit.diceMod = '-H';
  8.     },
  9.     dis: function(toHit) {
  10.         toHit.dieCount = 2;
  11.         toHit.diceMod = '-L';
  12.     },
  13.     bless: function(toHit) {
  14.         toHit.modifier += "+1d4 [Bless]";
  15.     },
  16.     sharp: function(toHit) {
  17.         toHit.modifier += "-5";
  18.     },
  19. };
  20.  
  21. ^^ user.damageModifiers = {
  22.     hex: function(damage) {
  23.         damage.push(
  24.             {
  25.                 dieCount: 1,
  26.                 dieSize: 6,
  27.                 comment: 'Hex'
  28.             }
  29.         )
  30.     },
  31.     sneak: function(damage) {
  32.         damage.push(
  33.             {
  34.                 dieCount: 3,
  35.                 dieSize: 6,
  36.                 comment: 'Sneak Attack',
  37.                 phrase: 'makes a sneak attack'
  38.             }
  39.         )
  40.     },
  41.     dark: function(damage) {
  42.         damage.push(
  43.             {
  44.                 modifier: 2,
  45.                 comment: '',
  46.                 phrase: '',
  47.                 effect: ''
  48.             }
  49.         )
  50.     },
  51.     purplepoison: function(damage) {
  52.         damage.push(
  53.             {
  54.                 effect: '**Poison Effect:** Target takes `12d6` poison damage on a failed `DC 19` Constitution Save, or half as much on a success.'
  55.             }
  56.         )
  57.     },
  58.     slowpoison: function(damage) {
  59.         damage.push(
  60.             {
  61.                 effect: '**Poison Effect:** Target must succeed on a `DC 15` Constitution saving throw. On a failure the target is poisoned for `1 minute`, and takes `1d4+7` poison damage per round. Their movement speed is also reduced by 10 feet for the duration.'
  62.             }
  63.         )
  64.     }
  65. }
  66.  
  67. ^^ user.formatAttack = function(attack, damage, phrase, effect, target) {
  68.     echo("\n");
  69.     if (phrase)
  70.     {
  71.         if (!target) echo("*" + user.character.name + " " + phrase +".*");
  72.         else echo("*" + user.character.name + " " + phrase +" at " + target +".*");
  73.         echo("\n");
  74.     }
  75.     if (attack)
  76.     {
  77.         echo("**To Hit:** " + attack.string);
  78.         echo("\n");
  79.     }
  80.     if (damage)
  81.     {
  82.         echo("**Damage: **" + damage.string);
  83.     }
  84.     if (effect!="")
  85.     {
  86.         echo("\n");
  87.         if (!target) echo(effect);
  88.         else echo(effect.split("Target").join(target));
  89.     }
  90. }
Add Comment
Please, Sign In to add comment