Creating an encounter - ThePix/rpg_web GitHub Wiki

Currently the way to set up an encounter involves editing the JavaScript file. I recognise this is not ideal, and hope to resolve it somehow, though as yet I am unsure how to approach that.

The file to edit is data.js. It must start with these six lines (technically only three are necessary):

'use strict';

const [AttackConsts, Attack, WeaponAttack] = require('./models/attack.js')
const [Char] = require('./models/char.js')

const chars = [

It must end with these three lines:

]

module.exports = [chars, stocks];

In between the start and end you must put all the characters for the encounter. The basic format looks like this:

  new Char({name:"Serpent", attacks:[
    new WeaponAttack("Unarmed", 0),
  ]}),

This is a very simple character, using all the default values, with a single attack. Here is a rather more complicated example, with various attributes set (for example, this has "pc" set to true, as it is a player character). There are also two attacks (there is no limit to the number of attacks you can give a character).

  new Char({name:"Kyle", hits:50, init:3, pc:true, ac:1, reflex:2, attacks:[
    new WeaponAttack("Broad sword", 2, {special:'silver', desc:'The silver sword of Al-Garith', additionalDamage:'2d8', additionalDesc:'If Kyle has combat advantage, he can do a sneak attack, doing additional damage.'}),
    new WeaponAttack("Unarmed", 2),
  ]}),

Go to the Characters page for details on the attributes for characters.

Go to the Attacks page for details on the attributes for attacks.