bump version + doc updates

This commit is contained in:
Chen Asraf
2020-06-17 01:14:19 +03:00
parent d6f9692998
commit 43f61843f9
13 changed files with 89 additions and 63 deletions

View File

@@ -1,3 +1,10 @@
# v2.0.5
* DW data updates/fixes
# v2.0.4
* File structure changes
* Bugfixes
# v2.0.3+2
* Bugfix in exporting spell tags

View File

View File

@@ -12,15 +12,17 @@ There is more information in the doc directory.
## Available data
* `List<Move>` basicMoves - Dungeon World's basic moves, such as Hack & Slash, Defy Danger, etc.
* `List<Move>` specialMoves - Dungeon World's special moves, such as Make Camp, Take Watch, etc.
* `List<PlayerClass>` classes - All of Dungeon World's classes, plus some homebrews.
See `PlayerClass` class for a full description of the usable properties.
* `List<Equipment>` equipment - Dungeon World's main list of items.
* `List<Spell>` spells - Dungeon World's main spellbook list. Each class can have its own spells
list, see `PlayerClass` in the docs for more information.
* `List<Monster>` monsters - Dungeon World's main monster list.
* `List<Tag>` tags - List of all basic tags, along with descriptions.
| Name | Type | Description |
| ---- | ---- | ----------- |
| basicMoves | `List<Move>` | Dungeon World's basic moves, such as Hack & Slash, Defy Danger, etc. |
| specialMoves | `List<Move>` | Dungeon World's special moves, such as Make Camp, Take Watch, etc. |
| classes | `List<PlayerClass>` | All of Dungeon World's classes, plus some homebrews.
See `PlayerClass` class for a full description of the usable properties. |
| equipment | `List<Equipment>` | Dungeon World's main list of items. |
| spells | `List<Spell>` | Dungeon World's main spellbook list. Each class can have its own spells
list, see `PlayerClass` in the docs for more information. |
| monsters | `List<Monster>` | Dungeon World's main monster list. |
| tags | `List<Tag>` | List of all basic tags, along with descriptions. |
There is also a `Dice` class, with simple dice rolling functionality for your use.
@@ -32,6 +34,6 @@ The data is from there, this package simply wraps it up for Dart.
## Contributing
1. Make your changes
1. Make a PR, explain what your changes do, what could break.
1. ???
1. Run tests, and add new tests if appropriate. Make sure nothing breaks.
1. Create a PR, explain what your changes do.
1. Profit!

View File

@@ -2,7 +2,9 @@
# projects at Google. For details and rationale,
# see https://github.com/dart-lang/pedantic#enabled-lints.
include: package:pedantic/analysis_options.yaml
analyzer:
exclude:
- example/*.dart
# For lint rules and documentation, see http://dart-lang.github.io/linter/lints.
# Uncomment to specify additional rules.
# linter:

9
example/classes.dart Normal file
View File

@@ -0,0 +1,9 @@
import 'package:dungeon_world_data/dw_data.dart';
void main() {
// Get bard class
var bard = dungeonWorld.classes.firstWhere((k) => k.key == 'bard');
// Get all bard advanced moves
var moves = bard.advancedMoves1;
}

12
example/equipment.dart Normal file
View File

@@ -0,0 +1,12 @@
import 'package:dungeon_world_data/dw_data.dart';
void main() {
// Get inventory items
var equipment1 = dungeonWorld.equipment.first;
// Get gear choices for class
var bard = dungeonWorld.classes.firstWhere((k) => k.key == 'bard');
var gearChoices1 = bard.gearChoices.map((i) => i.toJSON()).toList();
;
}

View File

@@ -1,47 +0,0 @@
import 'package:dungeon_world_data/dw_data.dart';
void main() {
// Get all monsters
print(dungeonWorld.monsters.map((monster) => monster.name));
print('');
// Get all bard advanced moves
var bard = dungeonWorld.classes.firstWhere((k) {
print(k.key);
return k.key == 'bard';
});
print(bard.advancedMoves1.map((move) => move.name));
print('');
// Get fighter class
print(bard);
print('');
// Get all spells
print(dungeonWorld.spells.first);
print('');
// Get all inventory items
print(dungeonWorld.equipment
.where((i) => i.description != null)
.toList()
.join('\n\n'));
print('');
// Get gear choices for class
print(bard.gearChoices.map((i) => i.toJSON()).toList());
// Get starting moves for classs
var thief = dungeonWorld.classes.firstWhere((k) => k.key == 'thief');
var wizard = dungeonWorld.classes.firstWhere((k) => k.key == 'wizard');
print(thief.startingMoves);
print(wizard.spells);
// Parse tags from objects or strings
print(Tag.fromJSON({'weight': 1}));
print(Tag.fromJSON('{coins: 3}'));
print(Tag.fromJSON('close'));
// All info tags
print(dungeonWorld.tags);
}

6
example/monsters.dart Normal file
View File

@@ -0,0 +1,6 @@
import 'package:dungeon_world_data/dw_data.dart';
void main() {
// Get all monsters
var monsters = dungeonWorld.monsters.map((monster) => monster.name);
}

11
example/moves.dart Normal file
View File

@@ -0,0 +1,11 @@
import 'package:dungeon_world_data/dw_data.dart';
void main() {
var bard = dungeonWorld.classes.firstWhere((k) => k.key == 'bard');
var thief = dungeonWorld.classes.firstWhere((k) => k.key == 'thief');
// Flattened move lists
var moves1 = bard.advancedMoves1;
var moves2 = dungeonWorld.basicMoves.first;
var moves3 = thief.startingMoves;
}

10
example/spells.dart Normal file
View File

@@ -0,0 +1,10 @@
import 'package:dungeon_world_data/dw_data.dart';
void main() {
// Get all spells
var spell1 = dungeonWorld.spells.first;
// Get spells for class
var wizard = dungeonWorld.classes.firstWhere((k) => k.key == 'wizard');
var spells1 = wizard.spells;
}

14
example/tags.dart Normal file
View File

@@ -0,0 +1,14 @@
import 'package:dungeon_world_data/dw_data.dart';
void main() {
// Parse tags from objects or strings
var tag1 = Tag.fromJSON({'weight': 1});
var tag2 = Tag.fromJSON('{coins: 3}');
var tag3 = Tag.fromJSON('close');
// All info tags
var tagInfos = dungeonWorld.tags;
// Get tags from spells, equipment
var tags1 = dungeonWorld.spells.first.tags;
}

View File

@@ -4,6 +4,7 @@ import 'package:quiver/core.dart';
class Dice {
num amount;
num sides;
DiceResult lastResult;
/// Simple dice, with sides and die count.
/// You can multiply, add or subtract Dice objects to change the amount of rolls (notice dice must
@@ -109,8 +110,7 @@ class Dice {
for (num i = 0; i < amount; i++) {
results.add(Random().nextInt(sides) + 1);
}
return DiceResult(this, results);
return lastResult = DiceResult(this, results);
}
Dice get single => this / amount;

View File

@@ -1,7 +1,7 @@
name: dungeon_world_data
homepage: https://github.com/chenasraf/dungeon_world_data
homepage: https://github.com/DungeonPaper/dungeon_world_data
description: Data dump of Dungeon World classes, moves, equipment, and more. Also mirrored as NPM package.
version: 2.0.4
version: 2.0.5
environment:
sdk: ">=2.3.0 <3.0.0"