matthileo

Attack Macro Modifiers

May 27th, 2016
92
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.  
  22. ^^ user.damageModifiers = {
  23.     sword: function(damage) {
  24.         damage.push(
  25.             {
  26.                 dieCount: 1,
  27.                 dieSize: 8,
  28.                 modifier: user.character.dexMod,
  29.                 comment: '',
  30.                 phrase: 'slashes with his shadow sword',
  31.                 effect: '**Effect:** Target must make a `DC 13` Constitution saving throw or have their Strength score reduced by 1 until they finish a short or long rest.'
  32.             }
  33.         )
  34.     },
  35.     light: function(damage) {
  36.         damage.push(
  37.             {
  38.                 dieCount: 1,
  39.                 dieSize: 6,
  40.                 modifier: user.character.dexMod,
  41.                 comment: '',
  42.                 phrase: 'slashes with his shadow sword',
  43.                 effect: '**Effect:** Target must make a `DC 13` Constitution saving throw or have their Strength score reduced by 1 until they finish a short or long rest.'
  44.             }
  45.         )
  46.     },
  47.     off: function(damage) {
  48.         damage.push(
  49.             {
  50.                 dieCount: 1,
  51.                 dieSize: 6,
  52.                 comment: 'Off-Hand',
  53.                 phrase: 'stabs with his short sword',
  54.                 effect: ''
  55.             }
  56.         )
  57.     },
  58.     hex: function(damage) {
  59.         damage.push(
  60.             {
  61.                 dieCount: 1,
  62.                 dieSize: 6,
  63.                 comment: 'Hex'
  64.             }
  65.         )
  66.     },
  67.     sneak: function(damage) {
  68.         damage.push(
  69.             {
  70.                 dieCount: 3,
  71.                 dieSize: 6,
  72.                 comment: 'Sneak Attack',
  73.                 phrase: 'makes a sneak attack'
  74.             }
  75.         )
  76.     },
  77.     dark: function(damage) {
  78.         damage.push(
  79.             {
  80.                 modifier: 2,
  81.                 comment: '',
  82.                 phrase: '',
  83.                 effect: ''
  84.             }
  85.         )
  86.     },
  87.     disarm: function(damage) {
  88.         damage.push(
  89.             {
  90.                 phrase: 'makes a disarm attack',
  91.                 effect: ''
  92.             }
  93.         )
  94.     },
  95.     poison: function(damage) {
  96.         damage.push(
  97.             {
  98.                 effect: '**Poison Effect:** Target takes `12d6` poison damage on a failed `DC 19` Constitution Save, or half as much on a success.'
  99.             }
  100.         )
  101.     }
  102. }
  103.  
  104. ^^ user.formatAttack = function(attack, damage, phrase, effect, target) {
  105.     echo("\n");
  106.     if (phrase)
  107.     {
  108.         if (!target) echo("*" + user.character.name + " " + phrase +".*");
  109.         else echo("*" + user.character.name + " " + phrase +" at " + target +".*");
  110.         echo("\n");
  111.     }
  112.     if (attack)
  113.     {
  114.         echo("**To Hit:** " + attack.string);
  115.         echo("\n");
  116.     }
  117.     if (damage)
  118.     {
  119.         echo("**Damage: **" + damage.string);
  120.     }
  121.     if (effect!="")
  122.     {
  123.         echo("\n");
  124.         if (!target) echo(effect);
  125.         else echo(effect.split("Target").join(target));
  126.     }
  127. }
Add Comment
Please, Sign In to add comment