Skip to content

ethanjurman/discorpg

Repository files navigation

DISCORPG

pronouced dis-core-pppggge(?)

A discord bot, that manages and runs an RPG game!

Created by Ethan Jurman

discorpg mp4

Add bot to your channel!

https://discordapp.com/api/oauth2/authorize?client_id=613904977215356939&permissions=9280&scope=bot

Making your own campaign

The game has a easy to manage architecture- with a good amount of flexibility for creating your own campaign.

Campaign (Array)

A campaign is an Array of Event objects. You must pass through each one before going onto the next one.

[
  { event: START_CAMPAIGN },
  {
    event: ENEMY_BATTLE,
    enemy: BAT,
    intro:
      'A giant bat flies in and you see violent intention in their eyes!',
  },
  {
    event: SHOP,
    items: [POWER_ARROWS, HEAVY_AXE, JAGGED_DAGGER, FLAMING_SWORD],
    intro:
      'A novice blacksmith sees you travel by. He hears of your great adventure and offers some weapons (to hopefully spread his brand!)',
  }
]

Event (Object)

An event object contains an eventType, intro, and a number of other options depending on the eventType.

EventType (Enum)

EventType can be one of the following - START_CAMPAIGN, ENEMY_BATTLE, SHOP, MESSAGE, PLAYER_EVENT

START_CAMPAIGN

  • params: none starts the game. Asks player what classes they want, and then starts campaign.
{ event: START_CAMPAIGN }

ENEMY_BATTLE

{
  event: ENEMY_BATTLE,
  enemy: BAT,
  intro:
    'A giant bat flies in and you see violent intention in their eyes!',
}

SHOP

  • params: items, intro starts a shop encounter. Only one player can grab each item. Each item shows up before closing the shop.
{
  event: SHOP,
  items: [POWER_ARROWS, HEAVY_AXE, JAGGED_DAGGER, FLAMING_SWORD],
  intro:
    'A novice blacksmith sees you travel by!',
}

MESSAGE

  • params: message, just posts a message, then continues to next campaign event.
{
  event: MESSAGE,
  message:
    'Congratulations! You were victorious over your challenges, and you reap the rewards!',
}

PLAYER_EVENT

{
  event: PLAYER_EVENT,
  color: 'RED',
  intro:
    'There is a rope that will allow your party to cross a dangerous river, but one must traverse the sickening waves to reach it for the rest to go unharms',
  options: [
    {
      emoji: '💀',
      title: 'Cross the river to fetch the rope',
      message: 'Take 30 damage so that the others my pass freely.',
      maxRespondents: 1,
    },
  ],
  onFinish: (playerReactionMap, playerDataMap) => {
    for (const playerId in playerReactionMap) {
      if (playerReactionMap[playerId] === '💀') {
        playerDataMap[playerId].currentHP -= 30;
      }
    }
  },
},

Dev guide

Start by running install script $ npm install

To run: $ npm start

and then in discord channel where the bot is allows run the message: !discorpg

Releases

No releases published

Packages

No packages published