dungeon_world_data 1.4.5

  • Readme
  • Changelog
  • Example
  • Installing
  • 59

Dungeon World Data #

This dart package contains data for Dungeon World, such as classes, moves, spells, equipment, etc.

How to install #

First, add to your pubspec:

dependencies:
  ..
  dungeon_world_data: ^1.0.0

After importing, access dungeonWorld to access the entire data structure. There is more information in the doc directory.

Available data #

  • Map<String, Move> moves
  • List<Move> basicMoves
  • List<Move> specialMoves
  • Map<String, PlayerClass> classes
  • Map<String, Equipment> equipment
  • Map<String, Spell> spells
  • Map<String, Monster> monsters
  • Map<String, Tag> tags

There is also a Dice class, with simple dice rolling functionality for your use.

Credits #

Credits to ~vindexus who created https://www.npmjs.com/package/dungeonworld-data. The data is from there, this package simply wraps it up for Dart.

Contributing #

  1. Make your changes
  2. Make a PR, explain what your changes do, what could break.
  3. ???
  4. Profit!

v1.4.5 #

  • Fixed case sensitivity in info tag parsing
  • Improved tag parsing from starting gear options

v1.4.4 #

  • Fixed tag toJSON method

v1.4.3 #

  • Fixed info tag mapping in main data

v1.4.2 #

  • Updated tags to allow description

v1.4.1 #

  • Fixed Tags toString() behavior

v1.4.0 #

  • Simplified Tags behavior. This will break some Tag usages

v1.3.4 #

  • Removed test dump file from source

v1.3.3 #

  • Removed test package from dependencies

v1.3.2 #

  • Fixed 'looks' sections in some classes being concatenated and not split
  • Added 2 tests

v1.3.1 #

  • Added missing toJSON() on GearOption

v1.3.0 #

  • Updated gear choice and option mapping

v1.2.6 #

  • Fixed tag JSON output in other classes

v1.2.5 #

  • Turned fields to non final, so they're changable for users

v1.2.4 #

  • Fix JSON output for Equipment item

v1.2.1-v1.2.3 #

  • Tag bugfixes

v1.2.0 #

  • Improved equipment loading (breaks interface for equipment items)

v1.1.7 #

  • Fixed spell loading

v1.1.6 #

  • Reduced min version of meta to increase compatibility

v1.1.4, v1.1.5 #

  • Added key property to some missing classes

v1.1.2, v1.1.3 #

  • Documentation updates

v1.1.1 #

  • Working release

example/example.dart

import 'package:dungeon_world_data/dw_data.dart';
import 'package:dungeon_world_data/tag.dart';

void main() {
  // Get all monsters
  print(dungeonWorld.monsters.values.map((monster) => monster.name));
  print('');

  // Get all bard advanced moves
  print(dungeonWorld.advancedMoves['bard'].map((move) => move.name));
  print('');

  // Get fighter class
  print(dungeonWorld.classes['bard']);
  print('');

  // Get all spells
  print(dungeonWorld.spells.values.first);
  print('');

  // Get all inventory items
  print(dungeonWorld.equipment.values.where((i) => i.description != null).toList().join('\n\n'));
  print('');

  // Get gear choices for class
  print(dungeonWorld.classes['bard'].gearChoices.map((i) => i.toJSON()).toList());

  // Get starting moves for classs
  print(dungeonWorld.classes['thief'].startingMoves);
  print(dungeonWorld.classes['wizard'].spells);

  // Parse tags from objects or strings
  print(Tag.parse({'weight': 1}));
  print(Tag.parse('close'));

  // All info tags
  print(dungeonWorld.tags.values.toList());
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  dungeon_world_data: ^1.4.5

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dungeon_world_data/tag_pre_parser.dart';
import 'package:dungeon_world_data/_base.dart';
import 'package:dungeon_world_data/_data.dart';
import 'package:dungeon_world_data/alignment.dart';
import 'package:dungeon_world_data/dice.dart';
import 'package:dungeon_world_data/dw_data.dart';
import 'package:dungeon_world_data/equipment.dart';
import 'package:dungeon_world_data/gear_choice.dart';
import 'package:dungeon_world_data/mappers.dart';
import 'package:dungeon_world_data/monster.dart';
import 'package:dungeon_world_data/move.dart';
import 'package:dungeon_world_data/player_class.dart';
import 'package:dungeon_world_data/spell.dart';
import 'package:dungeon_world_data/tag.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
18
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
59
Learn more about scoring.

We analyzed this package on Dec 10, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.1+4

Health suggestions

Fix lib/tag.dart. (-1 points)

Analysis of lib/tag.dart reported 2 hints:

line 2 col 60: Use lowercase_with_underscores when specifying a library prefix.

line 15 col 7: DO use curly braces for all flow control structures.

Fix lib/dw_data.dart. (-0.50 points)

Analysis of lib/dw_data.dart reported 1 hint:

line 9 col 60: Use lowercase_with_underscores when specifying a library prefix.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.8.0 <3.0.0
meta ^1.1.0 1.1.8
quiver ^2.0.1 2.1.2+1
Transitive dependencies
matcher 0.12.6
path 1.6.4
stack_trace 1.9.3
Dev dependencies
test ^1.6.4