Giter Club home page Giter Club logo

5th's Introduction

5th

This project creates objects which anyone can use with another JavaScript-based 5th edition application to handle common use cases, like making a character, handling combat or even planning an encounter.

Usage

To use this library in your application, simply include it with npm:

npm i --save 5th

You will need to provide your own response handler, handler factory, entity gateway and gateway factory objects if required. They will need to respond to a specific set of methods. We will denote details here later.

Handler Factory

You must implement a single object in your codebase with a "make" method which takes a string and generates an object with a "handle" method which takes an object and operates on it. An example:

// HandlerFactory.js
const handlers = {
  'select race': {
    handle({ character }) {
      // do something with the character and its newly created race
    }
  }
}

module.exports = class {
  make(type) {
    if (!handlers.hasOwnProperty(type)) {
      // throw an error of some sort
    }
    return handlers[type]
  }
}

5th's People

Contributors

ryayak1460 avatar

5th's Issues

Roll Height

Players may randomly roll for their height based on race and optional subrace.

Request:

{
  character // object
}

Response:

{
  character: {
    height // number of inches tall the character is
  }
}

Estimate:

Select Background Specialty

Players may, depending on background, choose a specialty for their background which gives them a bit more direction in their orign story.

Request:

{
  character, // object
  specialty // string of specialty name
}

Response:

{
  character: {
    background: {
      specialty // string of specialty name
    }
  }
}

Estimate:

Choose Eye Colour

Players may record their character's eye colour.

Request:

{
  character, // object
  eye // string of eye colour
}

Response:

{
  character: {
    eye // string of eye colour
  }
}

Estimate:

Select Trait Options

Players can choose different options for certain racial traits for their characters.

Request:

{
  character, // object
  traits // object, keys as trait names, values as choices.
}

Response:

{
  character // object with trait choices
}

Estimate:
Tasks:

  • Dwarf
    • Tool Proficiency
  • Elf
    • High Elf
      • Cantrip
      • Extra Language
  • Human
    • Languages
    • Ability Score Increase
    • Skills
    • Feat
  • Dragonborn
    • Draconic Ancestry
  • Half-Elf
    • Ability Score Increase
    • Skill Versatility
    • Languages

Select Race

Players can select a race for their character. This transaction uses the base races in the Player's Guide to create characters.

Request:

{
  character, // object
  race // string
}

Response:

{
  character // object
}

Estimate: 2h
Actual: 4h

Roll Flaw

Players may roll for their character's flaw, given a background.

Request:

{
  character // object
}

Response:

{
  character: {
    background: {
      flaw // string of flaw name
    }
  }
}

Estimate:

Buy Equipment

Players can buy equipment for their character, using the gold they have. This will reduce their gold based on each piece of equipment they specify.

Request:

{
  character, // object
  equipment // array of strings of equipment names
}

Response:

{
  character: {
    gold, // number of gold pieces remaining
    equipment // array of strings of equipment owned through purchases
  }
}

Estimate:

Select Class Skills

Players can, based on the class, select skills they want proficiency in.

Request:

{
  character, // object
  skills // array of skill names
}

Response:

{
  character: {
    class: {
      name,
      skills // array of skill names
    }
  }
}

Estimate:

Choose Flaw

Players may instead choose the flaw for their character, based on his or her background.

Request:

{
  character, // object
  flaw // string of flaw name
}

Response:

{
  character: {
    background: {
      flaw // string of flaw name
    }
  }
}

Estimate:

Select Subrace

Players, if applicable to the race they selected, can select a subrace for their character. This will allow a player to associated a subrace with their character.

Request:

{
  character, // object
  subrace // string
}

Response:

{
  character // object with correct subrace
}

Estimate: 6h
Actual: 3h

Tasks:

  • Dwarf:
    • Hill Dwarf
    • Mountain Dwarf
  • Elf
    • High Elf
    • Wood Elf
    • Dark Elf
  • Halfling
    • Lightfoot
    • Stout
  • Gnome
    • Forest Gnome
    • Rock Gnome

Select Class Archetype

Players can select a specialty archetype for their character. Some classes call them different things (Clerics call them Domains, for example), but all classes eventually allow for specialisation.

Request:

{
  character, // object
  archetype // string
}

Response:

{
  character: {
    class: {
      archetype // string
    }
  }
}

Estimate:

Roll Weight

Players may, after rolling for height, roll for their character's weight as well.

Request:

{
  character // object
}

Response:

{
  character: {
    weight // number of pounds the character weighs
  }
}

Estimate:

Choose Sex

Players can choose their character's sex.

Request:

{
  character, // object
  sex // string of sex name
}

Response:

{
  character: {
    sex // string of sex name
  }
}

Estimate:

Select Class Tool Proficiencies

Players can, based on their class, choose certain proficiencies with tools or musical instruments.

Request:

{
  character, // object
  proficiencies // array of strings
}

Response:

{
  character: {
    class: {
      tools // array of strings
    }
  }
}

Estimate:

Choose Bond

Players may instead, given a background, choose a given bond for their character.

Request:

{
  character, // object
  bond // string of bond name
}

Response:

{
  character: {
    background: {
      bond // string of bond name
    }
  }
}

Estimate:

Choose Background

Players can choose a background for their character, which gives them extra languages, skills, tool proficiencies and even equipment.

Request:

{
  character, // object
  background // string of background name
}

Response:

{
  character: {
    background // string of background name
  }
}

Estimate:

Roll Bond

Players may roll the bond for their character.

Request:

{
  character // object
}

Response:

{
  character: {
    background: {
      bond // string of bond name
    }
  }
}

Estimate:

Select Class Feature Options

Players can sometimes select different features and different options for features once they attain them, even at level 1.

Request:

{
  character, // object
  features // array of feature options
}

Response:

{
  character: {
    class: {
      features // array of features with options present
    }
  }
}

Estimate:

Choose Age

Players may record their character's age.

Request:

{
  character, // object
  age // number of years old the character is
}

Response:

{
  character: {
    age // number of years old
  }
}

Estimate:

Roll Gold

Players can roll for starting gold for their character instead, based on class.

Request:

{
  character // object
}

Response:

{
  character: {
    gold // number of gold pieces starting out
  }
}

Estimate:

Choose Ideal

Players may instead, given a specific background, choose their ideal directly instead of rolling for it.

Request:

{
  character, // object
  ideal // string of ideal name
}

Response:

{
  character: {
    background: {
      ideal // string of ideal name
    }
  }
}

Estimate:

Choose Hair Colour

Players may record their character's hair colour.

Request:

{
  character, // object
  hair // string of hair colour
}

Response:

{
  character: {
    hair // string of hair colour
  }
}

Estimate:

Select Background Equipment

Players can sometimes choose specific equipment for their character based on their background.

Request:

{
  character, // object
  equipment // array of strings of equipment names
}

Response:

{
  character: {
    background: {
      equipment // array of strings of equipment names
    }
  }
}

Estimate:

Select Background Tool Proficiencies

Players may, depending on background, choose new tool proficiencies.

Request:

{
  character, // object
  tools // array of strings of tool names
}

Response:

{
  character: {
    background: {
      tools // array of strings of tool names
    }
  }
}

Estimate:

Select Spells Known

Players, based on class, can choose which spells they know.

Request:

{
  character, // object
  spells // an array of arrays, with the index of the first array as the spell level
}

Response:

{
  character: {
    spells: [
      [], // cantrips
      []  // level 1
    ]
  }
}

Estimate:

Roll Abilities

Players can roll their ability scores for their character using this transaction. No die required!

Request:

{
  character // object
}

Response:

{
  character: {
    abilities: {
      strength, // number
      dexterity, // number
      constitution, // number
      intelligence, // number
      wisdom, // number
      charisma // number
    }
  }
}

Estimate:

Spend Points for Abilities

Players may optionally spend points to determine their ability scores using the system from the Player's Guide.

Request:

{
  character, // object
  abilities // an object with points in each ability
}

Response:

{
  character: {
    abilities: {
      strength, // number
      dexterity, // number
      constitution, // number
      intelligence, // number
      wisdom, // number
      charisma // number
    }
  }
}

Estimate:

Choose Alignment

Players can select an alignment for their characters from the following list:

  • Lawful Good
  • Neutral Good
  • Chaotic Good
  • Lawful Neutral
  • Neutral
  • Chaotic Neutral
  • Lawful Evil
  • Neutral Evil
  • Chaotic Evil

Their race and class may tend toward a specific alignment.

Request:

{
  character, // object
  alignment // string of alignment name
}

Response:

{
  character: {
    alignment // string of alignment name
  }
}

Estimate:

Choose Names

Players can choose names for their characters. Some races have more than one name associated with them.

Request:

{
  character, // object
  names // object, keys are name types, values are the names
}

Response:

{
  character: {
    names: {} // object,  keys are name types, values are the names
  }
}

Estimate: 6h
Actual:
Tasks:

  • Dwarf
    • Given Name
    • Clan Name
  • Elf
    • Child Name
    • Adult Name
    • Family Name
  • Halfling
    • Given Name
    • Family Name
    • Nickname
  • Human
    • Given Name
    • Surname
  • Dragonborn
    • Childhood Name
    • Given Name
    • Clan Name
  • Gnome
    • Given Name 1 (mother)
    • Given Name 2 (father)
    • Given Name 3 (clan elder)
    • Given Name 4 (aunt)
    • Clan Name
    • Nickname
  • Half-Elf (raised among humans)
    • Child Name
    • Adult Name
    • Family Name
  • Half-Elf (raised among elfs)
    • Given Name
    • Surname
  • Half-Orc (human)
    • Given Name
    • Surname
  • Half-Orc (orc)
    • Orc Name
  • Tiefling (human)
    • Given Name
  • Tiefling (heritage)
    • Infernal Name
  • Tiefling (chosen)
    • Virtue Name

Select Background Languages

Players may, as a consequence of their background, choose new languages to speak for their character.

Request:

{
  character, // object
  languages // array of strings of language names
}

Response:

{
  character: {
    background: {
      languages // array of strings of language names
    }
  }
}

Estimate:

Roll Ideal

Players may roll for their background ideal.

Request:

{
  character // object
}

Response:

{
  character: {
    background: {
      ideal // string of ideal name
    }
  }
}

Estimate:

Choose Skin Colour

Players may record their character's skin colour.

Request:

{
  character, // object
  skin // string of skin colour
}

Response:

{
  character: {
    skin // string of skin colour
  }
}

Estimate:

Choose Starting Equipment

Players can choose their starting equipment based off of their character class.

Request:

{
  character, // object
  equipment // array of strings of starting equipment
}

Response:

{
  character: {
    class: {
      equipment // array of strings of equipment
    }
  }
}

Estimate:

Select Class

Players can select their character's class.

Request:

{
  character, // object
  class // string
}

Response:

{
  character // object with class attribute
}

Estimate:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.