Compare commits
318 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
54f055d3ef | ||
|
|
2bacb296ba | ||
|
|
8b061f7aa9 | ||
|
|
6a84c83644 | ||
|
|
3227cd0934 | ||
|
|
089feae26f | ||
|
|
99c72d1e10 | ||
|
|
1e67afbe6f | ||
|
|
1cfec1ca45 | ||
|
|
09d1ac9ba3 | ||
|
|
834b9cf384 | ||
|
|
37291b347a | ||
|
|
efdfbeb59e | ||
|
|
a165f9b253 | ||
|
|
4a6fca98bc | ||
|
|
35464128a0 | ||
|
|
398f8a8a2a | ||
|
|
812a1784b2 | ||
|
|
8fa9cd0148 | ||
|
|
0e0662cc9a | ||
|
|
ad4e3f5b20 | ||
|
|
4cd058e1fe | ||
|
|
8f30cee4d3 | ||
|
|
d7f7eb2e6a | ||
|
|
a59cf1162f | ||
|
|
7bc80da99e | ||
|
|
2ddc520bb6 | ||
|
|
d92bb0f4d4 | ||
|
|
abcfe57add | ||
|
|
cdae75beef | ||
|
|
e7bcc2224c | ||
|
|
b591c66dd5 | ||
|
|
402bc0e5ed | ||
|
|
ac772531ee | ||
|
|
9a3edb07e4 | ||
|
|
fea45d2398 | ||
|
|
18aa1b2040 | ||
|
|
9afe38d043 | ||
|
|
5ddbecf97e | ||
|
|
7b573ca86e | ||
|
|
a9256fed05 | ||
|
|
8ec10e7a6a | ||
|
|
5ee1f0a169 | ||
|
|
b0652b0102 | ||
|
|
47b68c777d | ||
|
|
16feaaa6ca | ||
|
|
8a38c167c0 | ||
|
|
1835d968f3 | ||
|
|
2a9d170647 | ||
|
|
b4649d8c87 | ||
|
|
e50bcca7ce | ||
|
|
492b5d4bf1 | ||
|
|
6add127db4 | ||
|
|
d2762ae4ee | ||
|
|
7996fa4370 | ||
|
|
cd7702cf4f | ||
|
|
9975a13a70 | ||
|
|
a459610c09 | ||
|
|
7b6c59fa6c | ||
|
|
357166063a | ||
|
|
2540278787 | ||
|
|
5ed1977082 | ||
|
|
a750101765 | ||
|
|
aa08a9b57a | ||
|
|
a8960e26ec | ||
|
|
eefb3895ad | ||
|
|
5b1caa7e95 | ||
|
|
21fdad1054 | ||
|
|
c482395426 | ||
|
|
cb493a9f16 | ||
|
|
576c1f953b | ||
|
|
eb4336b3e9 | ||
|
|
03cb32bf34 | ||
|
|
a869772238 | ||
|
|
9c61493a12 | ||
|
|
7af3b8e06e | ||
|
|
fd21f4f7d7 | ||
|
|
3530eefb2a | ||
|
|
d710579025 | ||
|
|
f7a3929c05 | ||
|
|
1af15eff3c | ||
|
|
33ca60c2e6 | ||
|
|
4261776d8c | ||
|
|
b44fe33b30 | ||
|
|
c4a488a176 | ||
|
|
137a94f251 | ||
|
|
817020bea8 | ||
|
|
420de9b005 | ||
|
|
b8fdc27df9 | ||
|
|
bdc64dfb10 | ||
|
|
d4bec4f5e7 | ||
|
|
041186059c | ||
|
|
01535a414c | ||
|
|
d9e180bac0 | ||
|
|
235089e790 | ||
|
|
c560d80c26 | ||
|
|
a67b13f659 | ||
|
|
c416adc85b | ||
|
|
dbbb3739d0 | ||
|
|
38ea89995a | ||
|
|
37268495ae | ||
|
|
042b67dd77 | ||
|
|
07cb3859db | ||
|
|
b1fdaa726c | ||
|
|
a333b0bdc8 | ||
|
|
c32680a15a | ||
|
|
d1950b4598 | ||
|
|
af20eb4f3c | ||
|
|
be0283a342 | ||
|
|
e05561dcf9 | ||
|
|
3c776ed018 | ||
|
|
ebecb46935 | ||
|
|
7af2e80ec1 | ||
|
|
d83fe917d0 | ||
|
|
f526de88a7 | ||
|
|
55adca36d5 | ||
|
|
be6f54e53a | ||
|
|
d41c27c86d | ||
|
|
f4397e65ab | ||
|
|
c00c69a0c7 | ||
|
|
6737983782 | ||
|
|
78441439c3 | ||
|
|
9b72e1aea2 | ||
|
|
684eca8603 | ||
|
|
868e5f96a4 | ||
|
|
6fe368cde7 | ||
|
|
2ffacb88e0 | ||
|
|
af3af0e550 | ||
|
|
81f50d94c1 | ||
|
|
49e6d51b95 | ||
|
|
1e4e1a3b11 | ||
|
|
4440c88417 | ||
|
|
98047ca806 | ||
|
|
051cabc712 | ||
|
|
636fa504f1 | ||
|
|
ff9fc916f6 | ||
|
|
2206a607b2 | ||
|
|
ce224301b2 | ||
|
|
e6a9911dfc | ||
|
|
8a1871ee18 | ||
|
|
402f885f85 | ||
|
|
d07c118d47 | ||
|
|
103d44eeec | ||
|
|
33196c6771 | ||
|
|
80dc862047 | ||
|
|
314da14ad1 | ||
|
|
e5dbe81ac1 | ||
|
|
7e68ef64cc | ||
|
|
c9d71cad52 | ||
|
|
d79a808c81 | ||
|
|
1016c39bdf | ||
|
|
5f4923e049 | ||
|
|
e83237a728 | ||
|
|
9f323738bf | ||
|
|
1fc76fa50d | ||
|
|
36d5ff0a88 | ||
|
|
d05874ed13 | ||
|
|
df2521e69c | ||
|
|
3c6a685fe8 | ||
|
|
a77e560284 | ||
|
|
4cec83918f | ||
|
|
fec95c51c6 | ||
|
|
425c42d049 | ||
|
|
ab6f0c4f5b | ||
|
|
5d6e57b896 | ||
|
|
7c0a8125f2 | ||
|
|
7481ef08a8 | ||
|
|
b578dd5fb0 | ||
|
|
5d6f934d88 | ||
|
|
337f0bfa8a | ||
|
|
c62784894b | ||
|
|
75fff43d7d | ||
|
|
a9eeeac0df | ||
|
|
c8af0ff0a9 | ||
|
|
9e200db7b9 | ||
|
|
c08cf83096 | ||
|
|
d9368b06d0 | ||
|
|
2703367681 | ||
|
|
d419442549 | ||
|
|
99df01c950 | ||
|
|
d76349b3bb | ||
|
|
39c061f4e8 | ||
|
|
6d167ddb22 | ||
|
|
037acbd459 | ||
|
|
4d3fc3bb09 | ||
|
|
4b984d4fac | ||
|
|
58843613ba | ||
|
|
39b549b24b | ||
|
|
c79177de72 | ||
|
|
11d09b1487 | ||
|
|
0e4918d57d | ||
|
|
949f313af2 | ||
|
|
85b63f152f | ||
|
|
2141d52a7a | ||
|
|
4c84235064 | ||
|
|
0e194a5408 | ||
|
|
4b60eac330 | ||
|
|
cb017c359d | ||
|
|
15aaaa5c14 | ||
|
|
290bee83b4 | ||
|
|
fcd2461205 | ||
|
|
52198d0249 | ||
|
|
ba7ccfdfa0 | ||
|
|
92d3b086fa | ||
|
|
e180595dcd | ||
|
|
ed708bdde0 | ||
|
|
d7852d640f | ||
|
|
a2fdee88b6 | ||
|
|
af070b1578 | ||
|
|
83a8eeef0f | ||
|
|
34f8e7402b | ||
|
|
1b7e2cd850 | ||
|
|
463b7f0fc9 | ||
|
|
266495abc8 | ||
|
|
453d4365d3 | ||
|
|
e0ce6275bf | ||
|
|
16b16ce6c6 | ||
|
|
80c72a274e | ||
|
|
91f0f7954c | ||
|
|
c74abcb608 | ||
|
|
da8b91594e | ||
|
|
fc26f5a73e | ||
|
|
4f60766d5d | ||
|
|
e992aeebef | ||
|
|
4108346a98 | ||
|
|
946fadadc2 | ||
|
|
d2cc2833a9 | ||
|
|
af57326194 | ||
|
|
98c69e9e17 | ||
|
|
395edd0563 | ||
|
|
43e87e7786 | ||
|
|
ad347504c6 | ||
|
|
4e6e99b695 | ||
|
|
104624a322 | ||
|
|
79d166e6af | ||
|
|
86c934e8ac | ||
|
|
a034cbf30e | ||
|
|
d5680ebf8a | ||
|
|
53f2fcc945 | ||
|
|
612e127be4 | ||
|
|
2b0d975cee | ||
|
|
248ab9bb6b | ||
|
|
314ce85410 | ||
|
|
9ff45dbcc2 | ||
|
|
6caf19bc99 | ||
|
|
c2b04d0977 | ||
|
|
9012c4a558 | ||
|
|
65a84937f2 | ||
|
|
eebb88b6b1 | ||
|
|
06ab7c5116 | ||
|
|
89f03c7601 | ||
|
|
9d2eb14c0c | ||
|
|
7b3cb54983 | ||
|
|
a09bad2fed | ||
|
|
afd897edfe | ||
|
|
efc79cb6e7 | ||
|
|
35efe39ea7 | ||
|
|
034067bd6e | ||
|
|
0d75cd5d15 | ||
|
|
4f1376a666 | ||
|
|
78b1d71b9d | ||
|
|
1323d8006c | ||
|
|
87d722adaf | ||
|
|
90e511eb00 | ||
|
|
5b8c25f5de | ||
|
|
2fbc54fee8 | ||
|
|
a064ae3fe8 | ||
|
|
ba9b518d7e | ||
|
|
2f729070b2 | ||
|
|
7aedb9451c | ||
|
|
c6886dd49e | ||
|
|
038ce490e4 | ||
|
|
52bef57637 | ||
|
|
29e9f8c8dc | ||
|
|
fea02811ff | ||
|
|
73cee52fff | ||
|
|
b58c006ed4 | ||
|
|
ef44f6c1a5 | ||
|
|
f455cea43f | ||
|
|
e4083bc744 | ||
|
|
baffafb62a | ||
|
|
4143929667 | ||
|
|
18286d1b9c | ||
|
|
9f51567162 | ||
|
|
66d8a3bfbf | ||
|
|
a9648c10cc | ||
|
|
679292373c | ||
|
|
ae416458b5 | ||
|
|
0ff4a887ea | ||
|
|
955794b5c0 | ||
|
|
b0ac1dcc29 | ||
|
|
83150bc527 | ||
|
|
061f1fd0a5 | ||
|
|
e40dd196e6 | ||
|
|
5dbb59ef80 | ||
|
|
49e25d7304 | ||
|
|
85df0257e2 | ||
|
|
b88bb95928 | ||
|
|
2122e543d5 | ||
|
|
a71519aaa7 | ||
|
|
2404845d51 | ||
|
|
bf032bcdf3 | ||
|
|
ff8ae89722 | ||
|
|
80ca7307ce | ||
|
|
a539b0bc6c | ||
|
|
c6b3cad9c8 | ||
|
|
95b7b66390 | ||
|
|
43c4122fe3 | ||
|
|
3f4dcc146a | ||
|
|
e4600decd0 | ||
|
|
f6df716870 | ||
|
|
b99da301cd | ||
|
|
0a01885300 | ||
|
|
5cb1515235 | ||
|
|
7430c2c795 | ||
|
|
39f7548b8d | ||
|
|
c4a8c4b7ba | ||
|
|
263aba596c |
14
.codio
14
.codio
@@ -1,14 +0,0 @@
|
||||
{
|
||||
// Configure your Run and Preview buttons here.
|
||||
|
||||
// Run button configuration
|
||||
"commands": {
|
||||
"Run Meteor": "cd rpg-docs \n ROOT_URL=http://period-sheriff.codio.io:3000 meteor"
|
||||
},
|
||||
|
||||
// Preview button configuration
|
||||
"preview": {
|
||||
"Prieview": "http://period-sheriff-3000.codio.io",
|
||||
"Ungit": "https://period-sheriff-9501.codio.io/#/repository?path=/home/codio/workspace"
|
||||
}
|
||||
}
|
||||
4
.jscsrc
4
.jscsrc
@@ -13,7 +13,7 @@
|
||||
"disallowMixedSpacesAndTabs": "smart",
|
||||
"disallowTrailingWhitespace": true,
|
||||
"disallowSpaceAfterPrefixUnaryOperators": true,
|
||||
"disallowMultipleVarDecl": true,
|
||||
"disallowMultipleVarDecl": false,
|
||||
"disallowNewlineBeforeBlockStatements": true,
|
||||
"disallowKeywordsOnNewLine": ["else"],
|
||||
|
||||
@@ -53,4 +53,4 @@
|
||||
|
||||
"disallowMultipleLineBreaks": true,
|
||||
"disallowNewlineBeforeBlockStatements": true
|
||||
}
|
||||
}
|
||||
|
||||
674
License.md
Normal file
674
License.md
Normal file
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
{one line to give the program's name and a brief idea of what it does.}
|
||||
Copyright (C) {year} {name of author}
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
{project} Copyright (C) {year} {fullname}
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
65
README.md
65
README.md
@@ -1,58 +1,13 @@
|
||||
TODO
|
||||
====
|
||||
RPG Docs
|
||||
========
|
||||
|
||||
* Get Polymer installed using bower.
|
||||
* Install Vulcanize package listed below
|
||||
* Copy the differential polymer demo to get polymer implemented nicely
|
||||
* Update Meteor
|
||||
* Install and use LESS
|
||||
This is the repo for [DiceCloud](dicecloud.com).
|
||||
|
||||
Packages used
|
||||
=============
|
||||
Getting started
|
||||
---------------
|
||||
|
||||
* meteor-platform
|
||||
* Base Meteor.
|
||||
* [Docs](http://docs.meteor.com/#/full/)
|
||||
* autopublish
|
||||
* Publishes everything to the client.
|
||||
* Must be removed before release
|
||||
* insecure
|
||||
* Allows the client the freedom to modify any colleciton.
|
||||
* Must be removed before release
|
||||
* iron:router
|
||||
* Enables pagination and URL's to direct to specific templates.
|
||||
* [Tutorial](http://www.manuel-schoebel.com/blog/iron-router-tutorial)
|
||||
* accounts-password
|
||||
* Lets users create accounts with a simple password
|
||||
* accounts-ui
|
||||
* Adds simple UI for logging in
|
||||
* random
|
||||
* Somewhat decent cryptographically strong psuedo random number generation.
|
||||
* [readme](https://atmospherejs.com/meteor/random)
|
||||
* dburles:collection-helpers
|
||||
* Adds template-style helpers to collections. [github page](https://github.com/dburles/meteor-collection-helpers)
|
||||
* reactive-var
|
||||
* Friendly reactive variables
|
||||
* [Meteor Docs](http://docs.meteor.com/#/full/reactivevar_pkg)
|
||||
* cw4gn3r:jquery-event-drag
|
||||
* Adds jquery drag events
|
||||
* underscore
|
||||
* Handy javascript utilities
|
||||
* [Docs](http://underscorejs.org/)
|
||||
* aldeed:collection2
|
||||
* Extends collections with Schemas
|
||||
* [(gitHub page)](https://github.com/aldeed/meteor-collection2)
|
||||
* uses [SimpleSchema](https://github.com/aldeed/meteor-simple-schema)
|
||||
* aldeed:autoform
|
||||
* Automatically generates bootstrap forms for collection2 Schemas.
|
||||
* [github](https://github.com/aldeed/meteor-autoform)
|
||||
* differential:vulcanize
|
||||
* Bakes all the polymer imports into one file
|
||||
* [github](https://github.com/Differential/meteor-vulcanize)
|
||||
|
||||
************
|
||||
|
||||
Resources
|
||||
=========
|
||||
|
||||
[differential's polymer demo](https://github.com/Differential/polymer-demo)
|
||||
`git clone https://github.com/ThaumRystra/DiceCloud1 dicecloud`
|
||||
`cd dicecloud`
|
||||
`cd rpg-docs`
|
||||
`bower install`
|
||||
`meteor`
|
||||
|
||||
709
dataSources/srd/adventuringGear.json
Normal file
709
dataSources/srd/adventuringGear.json
Normal file
@@ -0,0 +1,709 @@
|
||||
[
|
||||
{
|
||||
"name": "Abacus",
|
||||
"plural": "Abaci",
|
||||
"description": "",
|
||||
"value": 2,
|
||||
"weight": 2
|
||||
},
|
||||
{
|
||||
"name": "Acid (vial)",
|
||||
"plural": "Acid (vials)",
|
||||
"description": "As an action, you can splash the contents of this vial onto a creature within 5 feet of you or throw the vial up to 20 feet, shattering it on impact. In either case, make a ranged attack against a creature or object, treating the acid as an improvised weapon. On a hit, the target takes 2d6 acid damage.",
|
||||
"value": 25,
|
||||
"weight": 1
|
||||
},
|
||||
{
|
||||
"name": "Alchemist’s fire (flask)",
|
||||
"plural": "Alchemist’s fire (flasks)",
|
||||
"description": "This sticky, adhesive fluid ignites when exposed to air. As an action, you can throw this flask up to 20 feet, shattering it on impact. Make a ranged attack against a creature or object, treating the alchemist’s fire as an improvised weapon. On a hit, the target takes 1d4 fire damage at the start of each of its turns. A creature can end this damage by using its action to make a DC 10 Dexterity check to extinguish the flames.",
|
||||
"value": 50,
|
||||
"weight": 1
|
||||
},
|
||||
{
|
||||
"name": "Arrows (20)",
|
||||
"plural": "Arrows (20)",
|
||||
"description": "",
|
||||
"value": 1,
|
||||
"weight": 1
|
||||
},
|
||||
{
|
||||
"name": "Blowgun needles (5)",
|
||||
"plural": "Blowgun needles (5)",
|
||||
"description": "",
|
||||
"value": 1,
|
||||
"weight": 1
|
||||
},
|
||||
{
|
||||
"name": "Crossbow bolts (20)",
|
||||
"plural": "Crossbow bolts (20)",
|
||||
"description": "",
|
||||
"value": 1,
|
||||
"weight": 1.5
|
||||
},
|
||||
{
|
||||
"name": "Sling bullets (20)",
|
||||
"plural": "Sling bullets (20)",
|
||||
"description": "",
|
||||
"value": 0.04,
|
||||
"weight": 1.5
|
||||
},
|
||||
{
|
||||
"name": "Antitoxin (vial)",
|
||||
"plural": "Antitoxin (vials)",
|
||||
"description": "A creature that drinks this vial of liquid gains advantage on saving throws against poison for 1 hour. It confers no benefit to undead or constructs.",
|
||||
"value": 50,
|
||||
"weight": 0
|
||||
},
|
||||
{
|
||||
"name": "Arcane focus Crystal",
|
||||
"plural": "Arcane focus Crystals",
|
||||
"description": "An arcane focus is a special item — an orb, a crystal, a rod, a specially constructed staff, a wand-like length of wood, or some similar item — designed to channel the power of arcane spells. A sorcerer, warlock, or wizard can use such an item as a spellcasting focus.",
|
||||
"value": 10,
|
||||
"weight": 1
|
||||
},
|
||||
{
|
||||
"name": "Arcane focus Orb",
|
||||
"plural": "Arcane focus Orbs",
|
||||
"description": "An arcane focus is a special item — an orb, a crystal, a rod, a specially constructed staff, a wand-like length of wood, or some similar item — designed to channel the power of arcane spells. A sorcerer, warlock, or wizard can use such an item as a spellcasting focus.",
|
||||
"value": 20,
|
||||
"weight": 3
|
||||
},
|
||||
{
|
||||
"name": "Arcane focus Rod",
|
||||
"plural": "Arcane focus Rods",
|
||||
"description": "An arcane focus is a special item — an orb, a crystal, a rod, a specially constructed staff, a wand-like length of wood, or some similar item — designed to channel the power of arcane spells. A sorcerer, warlock, or wizard can use such an item as a spellcasting focus.",
|
||||
"value": 10,
|
||||
"weight": 2
|
||||
},
|
||||
{
|
||||
"name": "Arcane focus Staff",
|
||||
"plural": "Arcane focus Staffs",
|
||||
"description": "An arcane focus is a special item — an orb, a crystal, a rod, a specially constructed staff, a wand-like length of wood, or some similar item — designed to channel the power of arcane spells. A sorcerer, warlock, or wizard can use such an item as a spellcasting focus.",
|
||||
"value": 5,
|
||||
"weight": 4
|
||||
},
|
||||
{
|
||||
"name": "Arcane focus Wand",
|
||||
"plural": "Arcane focus Wands",
|
||||
"description": "An arcane focus is a special item — an orb, a crystal, a rod, a specially constructed staff, a wand-like length of wood, or some similar item — designed to channel the power of arcane spells. A sorcerer, warlock, or wizard can use such an item as a spellcasting focus.",
|
||||
"value": 10,
|
||||
"weight": 1
|
||||
},
|
||||
{
|
||||
"name": "Backpack",
|
||||
"plural": "Backpacks",
|
||||
"description": "",
|
||||
"value": 2,
|
||||
"weight": 5
|
||||
},
|
||||
{
|
||||
"name": "Ball bearings (bag of 1,000)",
|
||||
"plural": "Ball bearings (bags of 1,000)",
|
||||
"description": "As an action, you can spill these tiny metal balls from their pouch to cover a level, square area that is 10 feet on a side. A creature moving across the covered area must succeed on a DC 10 Dexterity saving throw or fall Prone. A creature moving through the area at half speed doesn’t need to make the save.",
|
||||
"value": 1,
|
||||
"weight": 2
|
||||
},
|
||||
{
|
||||
"name": "Barrel",
|
||||
"plural": "Barrels",
|
||||
"description": "",
|
||||
"value": 2,
|
||||
"weight": 70
|
||||
},
|
||||
{
|
||||
"name": "Basket",
|
||||
"plural": "Baskets",
|
||||
"description": "",
|
||||
"value": 0.4,
|
||||
"weight": 2
|
||||
},
|
||||
{
|
||||
"name": "Bedroll",
|
||||
"plural": "Bedrolls",
|
||||
"description": "",
|
||||
"value": 1,
|
||||
"weight": 7
|
||||
},
|
||||
{
|
||||
"name": "Bell",
|
||||
"plural": "Bells",
|
||||
"description": "",
|
||||
"value": 1,
|
||||
"weight": 0
|
||||
},
|
||||
{
|
||||
"name": "Blanket",
|
||||
"plural": "Blankets",
|
||||
"description": "",
|
||||
"value": 0.5,
|
||||
"weight": 3
|
||||
},
|
||||
{
|
||||
"name": "Block and tackle",
|
||||
"plural": "Block and tackle sets",
|
||||
"description": "A set of pulleys with a cable threaded through them and a hook to attach to objects, a block and tackle allows you to hoist up to four times the weight you can normally lift.",
|
||||
"value": 1,
|
||||
"weight": 5
|
||||
},
|
||||
{
|
||||
"name": "Book",
|
||||
"plural": "Books",
|
||||
"description": "A book might contain poetry, historical accounts, information pertaining to a particular field of lore, diagrams and notes on gnomish contraptions, or just about anything else that can be represented using text or pictures. A book of spells is a spellbook.",
|
||||
"value": 25,
|
||||
"weight": 5
|
||||
},
|
||||
{
|
||||
"name": "Bottle, glass",
|
||||
"plural": "Bottles, glass",
|
||||
"description": "",
|
||||
"value": 2,
|
||||
"weight": 2
|
||||
},
|
||||
{
|
||||
"name": "Bucket",
|
||||
"plural": "Buckets",
|
||||
"description": "",
|
||||
"value": 0.05,
|
||||
"weight": 2
|
||||
},
|
||||
{
|
||||
"name": "Caltrops (bag of 20)",
|
||||
"plural": "Caltrops (bags of 20)",
|
||||
"description": "As an action, you can spread a bag of caltrops to cover a square area that is 5 feet on a side. Any creature that enters the area must succeed on a DC 15 Dexterity saving throw or stop moving this turn and take 1 piercing damage. Taking this damage reduces the creature’s walking speed by 10 feet until the creature regains at least 1 hit point. A creature moving through the area at half speed doesn’t need to make the save.",
|
||||
"value": 1,
|
||||
"weight": 2
|
||||
},
|
||||
{
|
||||
"name": "Candle",
|
||||
"plural": "Candles",
|
||||
"description": "For 1 hour, a candle sheds bright light in a 5-foot radius and dim light for an additional 5 feet.",
|
||||
"value": 0.01,
|
||||
"weight": 0
|
||||
},
|
||||
{
|
||||
"name": "Case, crossbow bolt",
|
||||
"plural": "Cases, crossbow bolt",
|
||||
"description": "This wooden case can hold up to twenty crossbow bolts.",
|
||||
"value": 1,
|
||||
"weight": 1
|
||||
},
|
||||
{
|
||||
"name": "Case, map or scroll",
|
||||
"plural": "Cases, map or scroll",
|
||||
"description": "This cylindrical leather case can hold up to ten rolled-up sheets of paper or five rolled-up sheets of parchment.",
|
||||
"value": 1,
|
||||
"weight": 1
|
||||
},
|
||||
{
|
||||
"name": "Chain (10 feet)",
|
||||
"plural": "Chains (10 feet)",
|
||||
"description": "A chain has 10 hit points. It can be burst with a successful DC 20 Strength check.",
|
||||
"value": 5,
|
||||
"weight": 10
|
||||
},
|
||||
{
|
||||
"name": "Chalk (1 piece)",
|
||||
"plural": "Pieces of chalk",
|
||||
"description": "",
|
||||
"value": 0.01,
|
||||
"weight": 0
|
||||
},
|
||||
{
|
||||
"name": "Chest",
|
||||
"plural": "Chests",
|
||||
"description": "",
|
||||
"value": 5,
|
||||
"weight": 25
|
||||
},
|
||||
{
|
||||
"name": "Climber’s kit",
|
||||
"plural": "Climber’s kits",
|
||||
"description": "A climber’s kit includes special pitons, boot tips, gloves, and a harness. You can use the climber’s kit as an action to anchor yourself; when you do, you can’t fall more than 25 feet from the point where you anchored yourself, and you can’t climb more than 25 feet away from that point without undoing the anchor.",
|
||||
"value": 25,
|
||||
"weight": 12
|
||||
},
|
||||
{
|
||||
"name": "Clothes, common",
|
||||
"plural": "Clothes, common",
|
||||
"description": "",
|
||||
"value": 0.5,
|
||||
"weight": 3
|
||||
},
|
||||
{
|
||||
"name": "Clothes, costume",
|
||||
"plural": "Clothes, costume",
|
||||
"description": "",
|
||||
"value": 5,
|
||||
"weight": 4
|
||||
},
|
||||
{
|
||||
"name": "Clothes, fine",
|
||||
"plural": "Clothes, fine",
|
||||
"description": "",
|
||||
"value": 15,
|
||||
"weight": 6
|
||||
},
|
||||
{
|
||||
"name": "Clothes, traveler’s",
|
||||
"plural": "Clothes, traveler’s",
|
||||
"description": "",
|
||||
"value": 2,
|
||||
"weight": 4
|
||||
},
|
||||
{
|
||||
"name": "Component pouch",
|
||||
"plural": "Component pouches",
|
||||
"description": "A component pouch is a small, watertight leather belt pouch that has compartments to hold all the material components and other special items you need to cast your spells, except for those components that have a specific cost (as indicated in a spell’s description).",
|
||||
"value": 25,
|
||||
"weight": 2
|
||||
},
|
||||
{
|
||||
"name": "Crowbar",
|
||||
"plural": "Crowbars",
|
||||
"description": "Using a crowbar grants advantage to Strength checks where the crowbar’s leverage can be applied.",
|
||||
"value": 2,
|
||||
"weight": 5
|
||||
},
|
||||
{
|
||||
"name": "Sprig of mistletoe",
|
||||
"plural": "Sprigs of mistletoe",
|
||||
"description": "A druidic focus might be a sprig of mistletoe or holly, a wand or scepter made of yew or another special wood, a staff drawn whole out of a living tree, or a totem object incorporating feathers, fur, bones, and teeth from sacred animals. A druid can use such an object as a spellcasting focus.",
|
||||
"value": 1,
|
||||
"weight": 0
|
||||
},
|
||||
{
|
||||
"name": "Totem",
|
||||
"plural": "Totems",
|
||||
"description": "A druidic focus might be a sprig of mistletoe or holly, a wand or scepter made of yew or another special wood, a staff drawn whole out of a living tree, or a totem object incorporating feathers, fur, bones, and teeth from sacred animals. A druid can use such an object as a spellcasting focus.",
|
||||
"value": 1,
|
||||
"weight": 0
|
||||
},
|
||||
{
|
||||
"name": "Wooden staff",
|
||||
"plural": "Wooden staffs",
|
||||
"description": "A druidic focus might be a sprig of mistletoe or holly, a wand or scepter made of yew or another special wood, a staff drawn whole out of a living tree, or a totem object incorporating feathers, fur, bones, and teeth from sacred animals. A druid can use such an object as a spellcasting focus.",
|
||||
"value": 5,
|
||||
"weight": 4
|
||||
},
|
||||
{
|
||||
"name": "Yew wand",
|
||||
"plural": "Yew wands",
|
||||
"description": "A druidic focus might be a sprig of mistletoe or holly, a wand or scepter made of yew or another special wood, a staff drawn whole out of a living tree, or a totem object incorporating feathers, fur, bones, and teeth from sacred animals. A druid can use such an object as a spellcasting focus.",
|
||||
"value": 10,
|
||||
"weight": 1
|
||||
},
|
||||
{
|
||||
"name": "Fishing tackle",
|
||||
"plural": "Fishing tackles",
|
||||
"description": "This kit includes a wooden rod, silken line, corkwood bobbers, steel hooks, lead sinkers, velvet lures, and narrow netting.",
|
||||
"value": 1,
|
||||
"weight": 4
|
||||
},
|
||||
{
|
||||
"name": "Flask",
|
||||
"plural": "Flasks",
|
||||
"description": "",
|
||||
"value": 0.02,
|
||||
"weight": 1
|
||||
},
|
||||
{
|
||||
"name": "Tankard",
|
||||
"plural": "Tankards",
|
||||
"description": "",
|
||||
"value": 0.02,
|
||||
"weight": 1
|
||||
},
|
||||
{
|
||||
"name": "Grappling hook",
|
||||
"plural": "Grappling hooks",
|
||||
"description": "",
|
||||
"value": 2,
|
||||
"weight": 4
|
||||
},
|
||||
{
|
||||
"name": "Hammer",
|
||||
"plural": "Hammers",
|
||||
"description": "",
|
||||
"value": 1,
|
||||
"weight": 3
|
||||
},
|
||||
{
|
||||
"name": "Hammer, sledge",
|
||||
"plural": "Hammers, sledge",
|
||||
"description": "",
|
||||
"value": 2,
|
||||
"weight": 10
|
||||
},
|
||||
{
|
||||
"name": "Healer’s kit",
|
||||
"plural": "Healer’s kits",
|
||||
"description": "This kit is a leather pouch containing bandages, salves, and splints. The kit has ten uses. As an action, you can expend one use of the kit to stabilize a creature that has 0 hit points, without needing to make a Wisdom (Medicine) check.",
|
||||
"value": 5,
|
||||
"weight": 3
|
||||
},
|
||||
{
|
||||
"name": "Holy amulet",
|
||||
"plural": "Holy amulets",
|
||||
"description": "A holy symbol is a representation of a god or pantheon. It might be an amulet depicting a symbol representing a deity, the same symbol carefully engraved or inlaid as an emblem on a shield, or a tiny box holding a fragment of a sacred relic. Fantasy-Historical Pantheons lists the symbols commonly associated with many gods in the multiverse. A cleric or paladin can use a holy symbol as a spellcasting focus. To use the symbol in this way, the caster must hold it in hand, wear it visibly, or bear it on a shield.",
|
||||
"value": 5,
|
||||
"weight": 1
|
||||
},
|
||||
{
|
||||
"name": "Holy emblem",
|
||||
"plural": "Holy emblems",
|
||||
"description": "A holy symbol is a representation of a god or pantheon. It might be an amulet depicting a symbol representing a deity, the same symbol carefully engraved or inlaid as an emblem on a shield, or a tiny box holding a fragment of a sacred relic. Fantasy-Historical Pantheons lists the symbols commonly associated with many gods in the multiverse. A cleric or paladin can use a holy symbol as a spellcasting focus. To use the symbol in this way, the caster must hold it in hand, wear it visibly, or bear it on a shield.",
|
||||
"value": 5,
|
||||
"weight": 0
|
||||
},
|
||||
{
|
||||
"name": "Holy reliquary",
|
||||
"plural": "Holy reliquaries",
|
||||
"description": "A holy symbol is a representation of a god or pantheon. It might be an amulet depicting a symbol representing a deity, the same symbol carefully engraved or inlaid as an emblem on a shield, or a tiny box holding a fragment of a sacred relic. Fantasy-Historical Pantheons lists the symbols commonly associated with many gods in the multiverse. A cleric or paladin can use a holy symbol as a spellcasting focus. To use the symbol in this way, the caster must hold it in hand, wear it visibly, or bear it on a shield.",
|
||||
"value": 5,
|
||||
"weight": 2
|
||||
},
|
||||
{
|
||||
"name": "Holy water (flask)",
|
||||
"plural": "Holy water (flasks)",
|
||||
"description": "As an action, you can splash the contents of this flask onto a creature within 5 feet of you or throw it up to 20 feet, shattering it on impact. In either case, make a ranged attack against a target creature, treating the holy water as an improvised weapon. If the target is a fiend or undead, it takes 2d6 radiant damage. A cleric or paladin may create holy water by performing a special ritual. The ritual takes 1 hour to perform, uses 25 gp worth of powdered silver, and requires the caster to expend a 1st-level spell slot.",
|
||||
"value": 25,
|
||||
"weight": 1
|
||||
},
|
||||
{
|
||||
"name": "Hourglass",
|
||||
"plural": "Hourglasses",
|
||||
"description": "",
|
||||
"value": 25,
|
||||
"weight": 1
|
||||
},
|
||||
{
|
||||
"name": "Hunting trap",
|
||||
"plural": "Hunting traps",
|
||||
"description": "When you use your action to set it, this trap forms a saw-toothed steel ring that snaps shut when a creature steps on a pressure plate in the center. The trap is affixed by a heavy chain to an immobile object, such as a tree or a spike driven into the ground. A creature that steps on the plate must succeed on a DC 13 Dexterity saving throw or take 1d4 piercing damage and stop moving. Thereafter, until the creature breaks free of the trap, its movement is limited by the length of the chain (typically 3 feet long). A creature can use its action to make a DC 13 Strength check, freeing itself or another creature within its reach on a success. Each failed check deals 1 piercing damage to the trapped creature.",
|
||||
"value": 5,
|
||||
"weight": 25
|
||||
},
|
||||
{
|
||||
"name": "Ink (1 ounce bottle)",
|
||||
"plural": "Ink (1 ounce bottles)",
|
||||
"description": "",
|
||||
"value": 10,
|
||||
"weight": 0
|
||||
},
|
||||
{
|
||||
"name": "Ink pen",
|
||||
"plural": "Ink pens",
|
||||
"description": "",
|
||||
"value": 0.02,
|
||||
"weight": 0
|
||||
},
|
||||
{
|
||||
"name": "Jug",
|
||||
"plural": "Jugs",
|
||||
"description": "",
|
||||
"value": 0.02,
|
||||
"weight": 4
|
||||
},
|
||||
{
|
||||
"name": "Pitcher",
|
||||
"plural": "Pitchers",
|
||||
"description": "",
|
||||
"value": 0.02,
|
||||
"weight": 4
|
||||
},
|
||||
{
|
||||
"name": "Ladder (10-foot)",
|
||||
"plural": "Ladders (10-foot)",
|
||||
"description": "",
|
||||
"value": 0.1,
|
||||
"weight": 25
|
||||
},
|
||||
{
|
||||
"name": "Lamp",
|
||||
"plural": "Lamps",
|
||||
"description": "A lamp casts bright light in a 15-foot radius and dim light for an additional 30 feet. Once lit, it burns for 6 hours on a flask (1 pint) of oil.",
|
||||
"value": 0.5,
|
||||
"weight": 1
|
||||
},
|
||||
{
|
||||
"name": "Lantern, bullseye",
|
||||
"plural": "Lanterns, bullseye",
|
||||
"description": "A bullseye lantern casts bright light in a 60-foot cone and dim light for an additional 60 feet. Once lit, it burns for 6 hours on a flask (1 pint) of oil.",
|
||||
"value": 10,
|
||||
"weight": 2
|
||||
},
|
||||
{
|
||||
"name": "Lantern, hooded",
|
||||
"plural": "Lanterns, hooded",
|
||||
"description": "A hooded lantern casts bright light in a 30-foot radius and dim light for an additional 30 feet. Once lit, it burns for 6 hours on a flask (1 pint) of oil. As an action, you can lower the hood, reducing the light to dim light in a 5-foot radius.",
|
||||
"value": 5,
|
||||
"weight": 2
|
||||
},
|
||||
{
|
||||
"name": "Lock",
|
||||
"plural": "Locks",
|
||||
"description": "A key is provided with the lock. Without the key, a creature proficient with thieves’ tools can pick this lock with a successful DC 15 Dexterity check. Your GM may decide that better locks are available for higher prices.",
|
||||
"value": 10,
|
||||
"weight": 1
|
||||
},
|
||||
{
|
||||
"name": "Magnifying glass",
|
||||
"plural": "Magnifying glasses",
|
||||
"description": "This lens allows a closer look at small objects. It is also useful as a substitute for flint and steel when starting fires. Lighting a fire with a magnifying glass requires light as bright as sunlight to focus, tinder to ignite, and about 5 minutes for the fire to ignite. A magnifying glass grants advantage on any ability check made to appraise or inspect an item that is small or highly detailed.",
|
||||
"value": 100,
|
||||
"weight": 0
|
||||
},
|
||||
{
|
||||
"name": "Manacles",
|
||||
"plural": "Sets of manacles",
|
||||
"description": "These metal restraints can bind a Small or Medium creature. Escaping the manacles requires a successful DC 20 Dexterity check. Breaking them requires a successful DC 20 Strength check. Each set of manacles comes with one key. Without the key, a creature proficient with thieves’ tools can pick the manacles’ lock with a successful DC 15 Dexterity check. Manacles have 15 hit points.",
|
||||
"value": 2,
|
||||
"weight": 6
|
||||
},
|
||||
{
|
||||
"name": "Mess kit",
|
||||
"plural": "Mess kits",
|
||||
"description": "This tin box contains a cup and simple cutlery. The box clamps together, and one side can be used as a cooking pan and the other as a plate or shallow bowl.",
|
||||
"value": 0.2,
|
||||
"weight": 1
|
||||
},
|
||||
{
|
||||
"name": "Mirror, steel",
|
||||
"plural": "Mirrors, steel",
|
||||
"description": "",
|
||||
"value": 5,
|
||||
"weight": 0.5
|
||||
},
|
||||
{
|
||||
"name": "Oil (flask)",
|
||||
"plural": "Oil (flasks)",
|
||||
"description": "Oil usually comes in a clay flask that holds 1 pint. As an action, you can splash the oil in this flask onto a creature within 5 feet of you or throw it up to 20 feet, shattering it on impact. Make a ranged attack against a target creature or object, treating the oil as an improvised weapon. On a hit, the target is covered in oil. If the target takes any fire damage before the oil dries (after 1 minute), the target takes an additional 5 fire damage from the burning oil. You can also pour a flask of oil on the ground to cover a 5-foot-square area, provided that the surface is level. If lit, the oil burns for 2 rounds and deals 5 fire damage to any creature that enters the area or ends its turn in the area. A creature can take this damage only once per turn.",
|
||||
"value": 0.1,
|
||||
"weight": 1
|
||||
},
|
||||
{
|
||||
"name": "Paper (one sheet)",
|
||||
"plural": "Sheets of paper",
|
||||
"description": "",
|
||||
"value": 0.2,
|
||||
"weight": 0
|
||||
},
|
||||
{
|
||||
"name": "Parchment (one sheet)",
|
||||
"plural": "Sheets of parchment",
|
||||
"description": "",
|
||||
"value": 0.1,
|
||||
"weight": 0
|
||||
},
|
||||
{
|
||||
"name": "Perfume (vial)",
|
||||
"plural": "Perfume (vials)",
|
||||
"description": "",
|
||||
"value": 5,
|
||||
"weight": 0
|
||||
},
|
||||
{
|
||||
"name": "Pick, miner’s",
|
||||
"plural": "Picks, miner’s",
|
||||
"description": "",
|
||||
"value": 2,
|
||||
"weight": 10
|
||||
},
|
||||
{
|
||||
"name": "Piton",
|
||||
"plural": "Pitons",
|
||||
"description": "",
|
||||
"value": 0.05,
|
||||
"weight": 0.25
|
||||
},
|
||||
{
|
||||
"name": "Poison, basic (vial)",
|
||||
"plural": "Poison, basic (vials)",
|
||||
"description": "You can use the poison in this vial to coat one slashing or piercing weapon or up to three pieces of ammunition. Applying the poison takes an action. A creature hit by the poisoned weapon or ammunition must make a DC 10 Constitution saving throw or take 1d4 poison damage. Once applied, the poison retains potency for 1 minute before drying.",
|
||||
"value": 100,
|
||||
"weight": 0
|
||||
},
|
||||
{
|
||||
"name": "Pole (10-foot)",
|
||||
"plural": "Poles (10-foot)",
|
||||
"description": "",
|
||||
"value": 0.05,
|
||||
"weight": 7
|
||||
},
|
||||
{
|
||||
"name": "Pot, iron",
|
||||
"plural": "Pots, iron",
|
||||
"description": "",
|
||||
"value": 2,
|
||||
"weight": 10
|
||||
},
|
||||
{
|
||||
"name": "Potion of healing",
|
||||
"plural": "Potions of healing",
|
||||
"description": "A character who drinks the magical red fluid in this vial regains 2d4 + 2 hit points. Drinking or administering a potion takes an action.",
|
||||
"value": 50,
|
||||
"weight": 0.5
|
||||
},
|
||||
{
|
||||
"name": "Pouch",
|
||||
"plural": "Pouches",
|
||||
"description": "A cloth or leather pouch can hold up to 20 sling bullets or 50 blowgun needles, among other things. A compartmentalized pouch for holding spell components is called a component pouch (described earlier in this section).",
|
||||
"value": 0.5,
|
||||
"weight": 1
|
||||
},
|
||||
{
|
||||
"name": "Quiver",
|
||||
"plural": "Quivers",
|
||||
"description": "A quiver can hold up to 20 arrows.",
|
||||
"value": 1,
|
||||
"weight": 1
|
||||
},
|
||||
{
|
||||
"name": "Ram, portable",
|
||||
"plural": "Rams, portable",
|
||||
"description": "You can use a portable ram to break down doors. When doing so, you gain a +4 bonus on the Strength check. One other character can help you use the ram, giving you advantage on this check.",
|
||||
"value": 4,
|
||||
"weight": 35
|
||||
},
|
||||
{
|
||||
"name": "Rations (1 day)",
|
||||
"plural": "Days of rations",
|
||||
"description": "Rations consist of dry foods suitable for extended travel, including jerky, dried fruit, hardtack, and nuts.",
|
||||
"value": 0.5,
|
||||
"weight": 2
|
||||
},
|
||||
{
|
||||
"name": "Robes",
|
||||
"plural": "Robes",
|
||||
"description": "",
|
||||
"value": 1,
|
||||
"weight": 4
|
||||
},
|
||||
{
|
||||
"name": "Rope, hempen (50 feet)",
|
||||
"plural": "Ropes, hempen (50 feet)",
|
||||
"description": "Rope, whether made of hemp or silk, has 2 hit points and can be burst with a DC 17 Strength check.",
|
||||
"value": 1,
|
||||
"weight": 10
|
||||
},
|
||||
{
|
||||
"name": "Rope, silk (50 feet)",
|
||||
"plural": "Ropes, silk (50 feet)",
|
||||
"description": "Rope, whether made of hemp or silk, has 2 hit points and can be burst with a DC 17 Strength check.",
|
||||
"value": 10,
|
||||
"weight": 5
|
||||
},
|
||||
{
|
||||
"name": "Sack",
|
||||
"plural": "Sacks",
|
||||
"description": "",
|
||||
"value": 0.01,
|
||||
"weight": 0.5
|
||||
},
|
||||
{
|
||||
"name": "Scale, merchant’s",
|
||||
"plural": "Scales, merchant’s",
|
||||
"description": "A scale includes a small balance, pans, and a suitable assortment of weights up to 2 pounds. With it, you can measure the exact weight of small objects, such as raw precious metals or trade goods, to help determine their worth.",
|
||||
"value": 5,
|
||||
"weight": 3
|
||||
},
|
||||
{
|
||||
"name": "Sealing wax",
|
||||
"plural": "Sealing waxes",
|
||||
"description": "",
|
||||
"value": 0.5,
|
||||
"weight": 0
|
||||
},
|
||||
{
|
||||
"name": "Shovel",
|
||||
"plural": "Shovels",
|
||||
"description": "",
|
||||
"value": 2,
|
||||
"weight": 5
|
||||
},
|
||||
{
|
||||
"name": "Signal whistle",
|
||||
"plural": "Signal whistles",
|
||||
"description": "",
|
||||
"value": 0.05,
|
||||
"weight": 0
|
||||
},
|
||||
{
|
||||
"name": "Signet ring",
|
||||
"plural": "Signet rings",
|
||||
"description": "",
|
||||
"value": 5,
|
||||
"weight": 0
|
||||
},
|
||||
{
|
||||
"name": "Soap",
|
||||
"plural": "Soaps",
|
||||
"description": "",
|
||||
"value": 0.02,
|
||||
"weight": 0
|
||||
},
|
||||
{
|
||||
"name": "Spellbook",
|
||||
"plural": "Spellbooks",
|
||||
"description": "Essential for wizards, a spellbook is a leather-bound tome with 100 blank vellum pages suitable for recording spells.",
|
||||
"value": 50,
|
||||
"weight": 3
|
||||
},
|
||||
{
|
||||
"name": "Spikes, iron (10)",
|
||||
"plural": "Spikes, iron (10)",
|
||||
"description": "",
|
||||
"value": 1,
|
||||
"weight": 5
|
||||
},
|
||||
{
|
||||
"name": "Spyglass",
|
||||
"plural": "Spyglasses",
|
||||
"description": "Objects viewed through a spyglass are magnified to twice their size.",
|
||||
"value": 1000,
|
||||
"weight": 1
|
||||
},
|
||||
{
|
||||
"name": "Tent, two-person",
|
||||
"plural": "Tents, two-person",
|
||||
"description": "A simple and portable canvas shelter, a tent sleeps two.",
|
||||
"value": 2,
|
||||
"weight": 20
|
||||
},
|
||||
{
|
||||
"name": "Tinderbox",
|
||||
"plural": "Tinderboxes",
|
||||
"description": "This small container holds flint, fire steel, and tinder (usually dry cloth soaked in light oil) used to kindle a fire. Using it to light a torch — or anything else with abundant, exposed fuel — takes an action. Lighting any other fire takes 1 minute.",
|
||||
"value": 0.5,
|
||||
"weight": 1
|
||||
},
|
||||
{
|
||||
"name": "Torch",
|
||||
"plural": "Torches",
|
||||
"description": "A torch burns for 1 hour, providing bright light in a 20-foot radius and dim light for an additional 20 feet. If you make a melee attack with a burning torch and hit, it deals 1 fire damage.",
|
||||
"value": 0.01,
|
||||
"weight": 1
|
||||
},
|
||||
{
|
||||
"name": "Vial",
|
||||
"plural": "Vials",
|
||||
"description": "",
|
||||
"value": 1,
|
||||
"weight": 0
|
||||
},
|
||||
{
|
||||
"name": "Waterskin",
|
||||
"plural": "Waterskins",
|
||||
"description": "",
|
||||
"value": 0.2,
|
||||
"weight": 5
|
||||
},
|
||||
{
|
||||
"name": "Whetstone",
|
||||
"plural": "Whetstones",
|
||||
"description": "",
|
||||
"value": 0.01,
|
||||
"weight": 1
|
||||
}
|
||||
]
|
||||
244
dataSources/srd/armor.json
Normal file
244
dataSources/srd/armor.json
Normal file
@@ -0,0 +1,244 @@
|
||||
[
|
||||
{
|
||||
"name": "Padded Armor",
|
||||
"value": 5,
|
||||
"weight": 8,
|
||||
"description": "Padded armor consists of quilted layers of cloth and batting.",
|
||||
"effects": [
|
||||
{
|
||||
"operation": "base",
|
||||
"value": 11,
|
||||
"stat": "armor"
|
||||
},
|
||||
{
|
||||
"operation": "disadvantage",
|
||||
"stat": "stealth"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Leather Armor",
|
||||
"value": 10,
|
||||
"weight": 10,
|
||||
"description": "The breastplate and shoulder protectors of this armor are made of leather that has been stiffened by being boiled in oil. The rest of the armor is made of softer and more flexible materials.",
|
||||
"effects": [
|
||||
{
|
||||
"operation": "base",
|
||||
"value": 11,
|
||||
"stat": "armor"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Studded leather Armor",
|
||||
"value": 45,
|
||||
"weight": 13,
|
||||
"description": "Made from tough but flexible leather, studded leather is reinforced with close-set rivets or spikes.",
|
||||
"effects": [
|
||||
{
|
||||
"operation": "base",
|
||||
"value": 12,
|
||||
"stat": "armor"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Hide Armor",
|
||||
"value": 10,
|
||||
"weight": 12,
|
||||
"description": "This crude armor consists of thick furs and pelts. It is commonly worn by barbarian tribes, evil humanoids, and other folk who lack access to the tools and materials needed to create better armor.",
|
||||
"effects": [
|
||||
{
|
||||
"operation": "base",
|
||||
"value": 12,
|
||||
"stat": "armor"
|
||||
},
|
||||
{
|
||||
"operation": "max",
|
||||
"value": 2,
|
||||
"stat": "dexterityArmor"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Chain shirt",
|
||||
"value": 50,
|
||||
"weight": 20,
|
||||
"description": "Made of interlocking metal rings, a chain shirt is worn between layers of clothing or leather. This armor offers modest protection to the wearer’s upper body and allows the sound of the rings rubbing against one another to be muffled by outer layers.",
|
||||
"effects": [
|
||||
{
|
||||
"operation": "base",
|
||||
"value": 13,
|
||||
"stat": "armor"
|
||||
},
|
||||
{
|
||||
"operation": "max",
|
||||
"value": 2,
|
||||
"stat": "dexterityArmor"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Scale mail",
|
||||
"value": 50,
|
||||
"weight": 45,
|
||||
"description": "This armor consists of a coat and leggings (and perhaps a separate skirt) of leather covered with overlapping pieces of metal, much like the scales of a fish. The suit includes gauntlets.",
|
||||
"effects": [
|
||||
{
|
||||
"operation": "base",
|
||||
"value": 14,
|
||||
"stat": "armor"
|
||||
},
|
||||
{
|
||||
"operation": "disadvantage",
|
||||
"stat": "stealth"
|
||||
},
|
||||
{
|
||||
"operation": "max",
|
||||
"value": 2,
|
||||
"stat": "dexterityArmor"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Breastplate",
|
||||
"value": 400,
|
||||
"weight": 20,
|
||||
"description": "This armor consists of a fitted metal chest piece worn with supple leather. Although it leaves the legs and arms relatively unprotected, this armor provides good protection for the wearer’s vital organs while leaving the wearer relatively unencumbered.",
|
||||
"effects": [
|
||||
{
|
||||
"operation": "base",
|
||||
"value": 14,
|
||||
"stat": "armor"
|
||||
},
|
||||
{
|
||||
"operation": "max",
|
||||
"value": 2,
|
||||
"stat": "dexterityArmor"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Half plate",
|
||||
"value": 750,
|
||||
"weight": 40,
|
||||
"description": "Half plate consists of shaped metal plates that cover most of the wearer’s body. It does not include leg protection beyond simple greaves that are attached with leather straps.",
|
||||
"effects": [
|
||||
{
|
||||
"operation": "base",
|
||||
"value": 15,
|
||||
"stat": "armor"
|
||||
},
|
||||
{
|
||||
"operation": "max",
|
||||
"value": 2,
|
||||
"stat": "dexterityArmor"
|
||||
},
|
||||
{
|
||||
"operation": "disadvantage",
|
||||
"stat": "stealth"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Ring mail",
|
||||
"value": 30,
|
||||
"weight": 40,
|
||||
"description": "This armor is leather armor with heavy rings sewn into it. The rings help reinforce the armor against blows from swords and axes. Ring mail is inferior to chain mail, and it’s usually worn only by those who can’t afford better armor.",
|
||||
"effects": [
|
||||
{
|
||||
"operation": "base",
|
||||
"value": 14,
|
||||
"stat": "armor"
|
||||
},
|
||||
{
|
||||
"operation": "mul",
|
||||
"value": 0,
|
||||
"stat": "dexterityArmor"
|
||||
},
|
||||
{
|
||||
"operation": "disadvantage",
|
||||
"stat": "stealth"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Chain mail",
|
||||
"value": 75,
|
||||
"weight": 55,
|
||||
"description": "Made of interlocking metal rings, chain mail includes a layer of quilted fabric worn underneath the mail to prevent chafing and to cushion the impact of blows. The suit includes gauntlets.",
|
||||
"effects": [
|
||||
{
|
||||
"operation": "base",
|
||||
"value": 16,
|
||||
"stat": "armor"
|
||||
},
|
||||
{
|
||||
"operation": "mul",
|
||||
"value": 0,
|
||||
"stat": "dexterityArmor"
|
||||
},
|
||||
{
|
||||
"operation": "disadvantage",
|
||||
"stat": "stealth"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Splint Armor",
|
||||
"value": 200,
|
||||
"weight": 60,
|
||||
"description": "This armor is made of narrow vertical strips of metal riveted to a backing of leather that is worn over cloth padding. Flexible chain mail protects the joints.",
|
||||
"effects": [
|
||||
{
|
||||
"operation": "base",
|
||||
"value": 17,
|
||||
"stat": "armor"
|
||||
},
|
||||
{
|
||||
"operation": "mul",
|
||||
"value": 0,
|
||||
"stat": "dexterityArmor"
|
||||
},
|
||||
{
|
||||
"operation": "disadvantage",
|
||||
"stat": "stealth"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Plate Armor",
|
||||
"value": 1500,
|
||||
"weight": 65,
|
||||
"description": "Plate consists of shaped, interlocking metal plates to cover the entire body. A suit of plate includes gauntlets, heavy leather boots, a visored helmet, and thick layers of padding underneath the armor. Buckles and straps distribute the weight over the body.",
|
||||
"effects": [
|
||||
{
|
||||
"operation": "base",
|
||||
"value": 18,
|
||||
"stat": "armor"
|
||||
},
|
||||
{
|
||||
"operation": "mul",
|
||||
"value": 0,
|
||||
"stat": "dexterityArmor"
|
||||
},
|
||||
{
|
||||
"operation": "disadvantage",
|
||||
"stat": "stealth"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Shield",
|
||||
"value": 10,
|
||||
"weight": 6,
|
||||
"description": "A shield is made from wood or metal and is carried in one hand. Wielding a shield increases your Armor Class by 2. You can benefit from only one shield at a time.",
|
||||
"effects": [
|
||||
{
|
||||
"operation": "add",
|
||||
"value": 2,
|
||||
"stat": "armor"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
4739
dataSources/srd/spells.json
Normal file
4739
dataSources/srd/spells.json
Normal file
File diff suppressed because it is too large
Load Diff
17
dataSources/srd/srdimport.js
Normal file
17
dataSources/srd/srdimport.js
Normal file
@@ -0,0 +1,17 @@
|
||||
// Only do if the library doesn't exist yet
|
||||
id = Libraries.insert({
|
||||
_id: "SRDLibraryGA3XWsd",
|
||||
owner: Meteor.userId(),
|
||||
name: "SRD Library",
|
||||
});
|
||||
|
||||
_.each(items, (item) => {
|
||||
item.settings = {category: }; // "adventuringGear", "armor", "weapons", "tools"
|
||||
item.library = "SRDLibraryGA3XWsd"
|
||||
LibraryItems.insert(item)
|
||||
});
|
||||
|
||||
_.each(spells, (spell) => {
|
||||
spell.library = "SRDLibraryGA3XWsd"
|
||||
LibrarySpells.insert(spell)
|
||||
});
|
||||
247
dataSources/srd/tools.json
Normal file
247
dataSources/srd/tools.json
Normal file
@@ -0,0 +1,247 @@
|
||||
[
|
||||
{
|
||||
"name": "Alchemist’s supplies",
|
||||
"plural": "Alchemist’s supplies",
|
||||
"description": "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan’s tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan’s tools requires a separate proficiency.",
|
||||
"value": 50,
|
||||
"weight": 8
|
||||
},
|
||||
{
|
||||
"name": "Brewer’s supplies",
|
||||
"plural": "Brewer’s supplies",
|
||||
"description": "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan’s tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan’s tools requires a separate proficiency.",
|
||||
"value": 20,
|
||||
"weight": 9
|
||||
},
|
||||
{
|
||||
"name": "Calligrapher’s supplies",
|
||||
"plural": "Calligrapher’s supplies",
|
||||
"description": "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan’s tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan’s tools requires a separate proficiency.",
|
||||
"value": 10,
|
||||
"weight": 5
|
||||
},
|
||||
{
|
||||
"name": "Carpenter’s tools",
|
||||
"plural": "Carpenter’s tools",
|
||||
"description": "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan’s tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan’s tools requires a separate proficiency.",
|
||||
"value": 8,
|
||||
"weight": 6
|
||||
},
|
||||
{
|
||||
"name": "Cartographer’s tools",
|
||||
"plural": "Cartographer’s tools",
|
||||
"description": "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan’s tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan’s tools requires a separate proficiency.",
|
||||
"value": 15,
|
||||
"weight": 6
|
||||
},
|
||||
{
|
||||
"name": "Cobbler’s tools",
|
||||
"plural": "Cobbler’s tools",
|
||||
"description": "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan’s tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan’s tools requires a separate proficiency.",
|
||||
"value": 5,
|
||||
"weight": 5
|
||||
},
|
||||
{
|
||||
"name": "Cook’s utensils",
|
||||
"plural": "Cook’s utensils",
|
||||
"description": "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan’s tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan’s tools requires a separate proficiency.",
|
||||
"value": 1,
|
||||
"weight": 8
|
||||
},
|
||||
{
|
||||
"name": "Glassblower’s tools",
|
||||
"plural": "Glassblower’s tools",
|
||||
"description": "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan’s tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan’s tools requires a separate proficiency.",
|
||||
"value": 30,
|
||||
"weight": 5
|
||||
},
|
||||
{
|
||||
"name": "Jeweler’s tools",
|
||||
"plural": "Jeweler’s tools",
|
||||
"description": "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan’s tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan’s tools requires a separate proficiency.",
|
||||
"value": 25,
|
||||
"weight": 2
|
||||
},
|
||||
{
|
||||
"name": "Leatherworker’s tools",
|
||||
"plural": "Leatherworker’s tools",
|
||||
"description": "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan’s tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan’s tools requires a separate proficiency.",
|
||||
"value": 5,
|
||||
"weight": 5
|
||||
},
|
||||
{
|
||||
"name": "Mason’s tools",
|
||||
"plural": "Mason’s tools",
|
||||
"description": "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan’s tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan’s tools requires a separate proficiency.",
|
||||
"value": 10,
|
||||
"weight": 8
|
||||
},
|
||||
{
|
||||
"name": "Painter’s supplies",
|
||||
"plural": "Painter’s supplies",
|
||||
"description": "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan’s tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan’s tools requires a separate proficiency.",
|
||||
"value": 10,
|
||||
"weight": 5
|
||||
},
|
||||
{
|
||||
"name": "Potter’s tools",
|
||||
"plural": "Potter’s tools",
|
||||
"description": "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan’s tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan’s tools requires a separate proficiency.",
|
||||
"value": 10,
|
||||
"weight": 3
|
||||
},
|
||||
{
|
||||
"name": "Smith’s tools",
|
||||
"plural": "Smith’s tools",
|
||||
"description": "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan’s tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan’s tools requires a separate proficiency.",
|
||||
"value": 20,
|
||||
"weight": 8
|
||||
},
|
||||
{
|
||||
"name": "Tinker’s tools",
|
||||
"plural": "Tinker’s tools",
|
||||
"description": "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan’s tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan’s tools requires a separate proficiency.",
|
||||
"value": 50,
|
||||
"weight": 10
|
||||
},
|
||||
{
|
||||
"name": "Weaver’s tools",
|
||||
"plural": "Weaver’s tools",
|
||||
"description": "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan’s tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan’s tools requires a separate proficiency.",
|
||||
"value": 1,
|
||||
"weight": 5
|
||||
},
|
||||
{
|
||||
"name": "Woodcarver’s tools",
|
||||
"plural": "Woodcarver’s tools",
|
||||
"description": "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan’s tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan’s tools requires a separate proficiency.",
|
||||
"value": 1,
|
||||
"weight": 5
|
||||
},
|
||||
{
|
||||
"name": "Dice set",
|
||||
"plural": "Dice sets",
|
||||
"description": "This item encompasses a wide range of game pieces, including dice and decks of cards (for games such as Three-Dragon Ante). A few common examples appear on the Tools table, but other kinds of gaming sets exist. If you are proficient with a gaming set, you can add your proficiency bonus to ability checks you make to play a game with that set. Each type of gaming set requires a separate proficiency.",
|
||||
"value": 0.1,
|
||||
"weight": 0
|
||||
},
|
||||
{
|
||||
"name": "Playing card set",
|
||||
"plural": "Playing card sets",
|
||||
"description": "This item encompasses a wide range of game pieces, including dice and decks of cards (for games such as Three-Dragon Ante). A few common examples appear on the Tools table, but other kinds of gaming sets exist. If you are proficient with a gaming set, you can add your proficiency bonus to ability checks you make to play a game with that set. Each type of gaming set requires a separate proficiency.",
|
||||
"value": 0.5,
|
||||
"weight": 0
|
||||
},
|
||||
{
|
||||
"name": "Bagpipes",
|
||||
"plural": "Bagpipes",
|
||||
"description": "If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus.",
|
||||
"value": 30,
|
||||
"weight": 6
|
||||
},
|
||||
{
|
||||
"name": "Drum",
|
||||
"plural": "Drums",
|
||||
"description": "If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus.",
|
||||
"value": 6,
|
||||
"weight": 3
|
||||
},
|
||||
{
|
||||
"name": "Dulcimer",
|
||||
"plural": "Dulcimers",
|
||||
"description": "If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus.",
|
||||
"value": 25,
|
||||
"weight": 10
|
||||
},
|
||||
{
|
||||
"name": "Flute",
|
||||
"plural": "Flutes",
|
||||
"description": "If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus.",
|
||||
"value": 2,
|
||||
"weight": 1
|
||||
},
|
||||
{
|
||||
"name": "Lute",
|
||||
"plural": "Lutes",
|
||||
"description": "If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus.",
|
||||
"value": 35,
|
||||
"weight": 2
|
||||
},
|
||||
{
|
||||
"name": "Lyre",
|
||||
"plural": "Lyres",
|
||||
"description": "If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus.",
|
||||
"value": 30,
|
||||
"weight": 2
|
||||
},
|
||||
{
|
||||
"name": "Horn",
|
||||
"plural": "Horns",
|
||||
"description": "If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus.",
|
||||
"value": 3,
|
||||
"weight": 2
|
||||
},
|
||||
{
|
||||
"name": "Pan flute",
|
||||
"plural": "Pan flutes",
|
||||
"description": "If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus.",
|
||||
"value": 12,
|
||||
"weight": 2
|
||||
},
|
||||
{
|
||||
"name": "Shawm",
|
||||
"plural": "Shawms",
|
||||
"description": "If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus.",
|
||||
"value": 2,
|
||||
"weight": 1
|
||||
},
|
||||
{
|
||||
"name": "Viol",
|
||||
"plural": "Viols",
|
||||
"description": "If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus.",
|
||||
"value": 30,
|
||||
"weight": 1
|
||||
},
|
||||
{
|
||||
"name": "Disguise Kit",
|
||||
"plural": "Disguise Kits",
|
||||
"description": "This pouch of cosmetics, hair dye, and small props lets you create disguises that change your physical appearance. Proficiency with this kit lets you add your proficiency bonus to any ability checks you make to create a visual disguise.",
|
||||
"value": 25,
|
||||
"weight": 3
|
||||
},
|
||||
{
|
||||
"name": "Forgery Kit",
|
||||
"plural": "Forgery Kits",
|
||||
"description": "This small box contains a variety of papers and parchments, pens and inks, seals and sealing wax, gold and silver leaf, and other supplies necessary to create convincing forgeries of physical documents. Proficiency with this kit lets you add your proficiency bonus to any ability checks you make to create a physical forgery of a document.",
|
||||
"value": 15,
|
||||
"weight": 5
|
||||
},
|
||||
{
|
||||
"name": "Herbalism Kit",
|
||||
"plural": "Herbalism Kits",
|
||||
"description": "This kit contains a variety of instruments such as clippers, mortar and pestle, and pouches and vials used by herbalists to create remedies and potions. Proficiency with this kit lets you add your proficiency bonus to any ability checks you make to identify or apply herbs. Also, proficiency with this kit is required to create antitoxin and potions of healing.",
|
||||
"value": 5,
|
||||
"weight": 3
|
||||
},
|
||||
{
|
||||
"name": "Navigator’s tools",
|
||||
"plural": "Navigator’s tools",
|
||||
"description": "This set of instruments is used for navigation at sea. Proficiency with navigator’s tools lets you chart a ship’s course and follow navigation charts. In addition, these tools allow you to add your proficiency bonus to any ability check you make to avoid getting lost at sea.",
|
||||
"value": 25,
|
||||
"weight": 2
|
||||
},
|
||||
{
|
||||
"name": "Thieves’ tools",
|
||||
"plural": "Thieves’ tools",
|
||||
"description": "This set of tools includes a small file, a set of lock picks, a small mirror mounted on a metal handle, a set of narrow-bladed scissors, and a pair of pliers. Proficiency with these tools lets you add your proficiency bonus to any ability checks you make to disarm traps or open locks.",
|
||||
"value": 25,
|
||||
"weight": 1
|
||||
},
|
||||
{
|
||||
"name": "Poisoner's Kit",
|
||||
"plural": "Poisoner's Kits",
|
||||
"description": "A poisoner’s kit includes the vials, chemicals, and other equipment necessary for the creation of poisons. Proficiency with this kit lets you add your proficiency bonus to any ability checks you make to craft or use poisons.",
|
||||
"value": 50,
|
||||
"weight": 2
|
||||
}
|
||||
]
|
||||
481
dataSources/srd/weapons.json
Normal file
481
dataSources/srd/weapons.json
Normal file
@@ -0,0 +1,481 @@
|
||||
[
|
||||
{
|
||||
"name": "Club",
|
||||
"value": 0.1,
|
||||
"weight": 2,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "strengthMod + proficiencyBonus",
|
||||
"damage": "1d4 + {strengthMod}",
|
||||
"details": "Light",
|
||||
"damageType": "bludgeoning"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Dagger",
|
||||
"value": 2,
|
||||
"weight": 1,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "max(strengthMod, dexterityMod) + proficiencyBonus",
|
||||
"damage": "1d4 + {max(strengthMod, dexterityMod)}",
|
||||
"details": "Finesse, light, thrown (range 20/60)",
|
||||
"damageType": "piercing"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Greatclub",
|
||||
"value": 0.2,
|
||||
"weight": 10,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "strengthMod + proficiencyBonus",
|
||||
"damage": "1d8 + {strengthMod}",
|
||||
"details": "Two-handed",
|
||||
"damageType": "bludgeoning"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Handaxe",
|
||||
"value": 5,
|
||||
"weight": 2,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "strengthMod + proficiencyBonus",
|
||||
"damage": "1d6 + {strengthMod}",
|
||||
"details": "Light, thrown (range 20/60)",
|
||||
"damageType": "slashing"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Javelin",
|
||||
"value": 0.5,
|
||||
"weight": 2,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "strengthMod + proficiencyBonus",
|
||||
"damage": "1d6 + {strengthMod}",
|
||||
"details": "Thrown (range 30/120)",
|
||||
"damageType": "piercing"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Light hammer",
|
||||
"value": 2,
|
||||
"weight": 2,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "strengthMod + proficiencyBonus",
|
||||
"damage": "1d4 + {strengthMod}",
|
||||
"details": "Light, thrown (range 20/60)",
|
||||
"damageType": "bludgeoning"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Mace",
|
||||
"value": 5,
|
||||
"weight": 4,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "strengthMod + proficiencyBonus",
|
||||
"damage": "1d6 + {strengthMod}",
|
||||
"damageType": "bludgeoning"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Quarterstaff",
|
||||
"value": 0.5,
|
||||
"weight": 4,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "strengthMod + proficiencyBonus",
|
||||
"damage": "1d6 + {strengthMod}",
|
||||
"details": "Versatile (1d8)",
|
||||
"damageType": "bludgeoning"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Sickle",
|
||||
"value": 1,
|
||||
"weight": 2,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "strengthMod + proficiencyBonus",
|
||||
"damage": "1d4 + {strengthMod}",
|
||||
"details": "Light",
|
||||
"damageType": "slashing"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Spear",
|
||||
"value": 1,
|
||||
"weight": 3,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "strengthMod + proficiencyBonus",
|
||||
"damage": "1d6 + {strengthMod}",
|
||||
"details": "Thrown (range 20/60), versatile (1d8)",
|
||||
"damageType": "piercing"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Crossbow, light",
|
||||
"value": 25,
|
||||
"weight": 5,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "dexterityMod + proficiencyBonus",
|
||||
"damage": "1d8 + {dexterityMod}",
|
||||
"details": "Ammunition (range 80/320), loading, two-handed",
|
||||
"damageType": "piercing"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Dart",
|
||||
"value": 0.05,
|
||||
"weight": 0.25,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "max(strengthMod, dexterityMod) + proficiencyBonus",
|
||||
"damage": "1d4 + {max(strengthMod, dexterityMod)}",
|
||||
"details": "Finesse, thrown (range 20/60)",
|
||||
"damageType": "piercing"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Shortbow",
|
||||
"value": 25,
|
||||
"weight": 2,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "dexterityMod + proficiencyBonus",
|
||||
"damage": "1d6 + {dexterityMod}",
|
||||
"details": "Ammunition (range 80/320), two-handed",
|
||||
"damageType": "piercing"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Sling",
|
||||
"value": 0.1,
|
||||
"weight": 0,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "dexterityMod + proficiencyBonus",
|
||||
"damage": "1d4 + {dexterityMod}",
|
||||
"details": "Ammunition (range 30/120)",
|
||||
"damageType": "bludgeoning"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Battleaxe",
|
||||
"value": 10,
|
||||
"weight": 4,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "strengthMod + proficiencyBonus",
|
||||
"damage": "1d8 + {strengthMod}",
|
||||
"details": "Versatile (1d10)",
|
||||
"damageType": "slashing"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Flail",
|
||||
"value": 10,
|
||||
"weight": 2,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "strengthMod + proficiencyBonus",
|
||||
"damage": "1d8 + {strengthMod}",
|
||||
"damageType": "bludgeoning"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Glaive",
|
||||
"value": 20,
|
||||
"weight": 6,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "strengthMod + proficiencyBonus",
|
||||
"damage": "1d10 + {strengthMod}",
|
||||
"details": "Heavy, reach, two-handed",
|
||||
"damageType": "slashing"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Greataxe",
|
||||
"value": 30,
|
||||
"weight": 7,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "strengthMod + proficiencyBonus",
|
||||
"damage": "1d12 + {strengthMod}",
|
||||
"details": "Heavy, two-handed",
|
||||
"damageType": "slashing"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Greatsword",
|
||||
"value": 50,
|
||||
"weight": 6,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "strengthMod + proficiencyBonus",
|
||||
"damage": "2d6 + {strengthMod}",
|
||||
"details": "Heavy, two-handed",
|
||||
"damageType": "slashing"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Halberd",
|
||||
"value": 20,
|
||||
"weight": 6,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "strengthMod + proficiencyBonus",
|
||||
"damage": "1d10 + {strengthMod}",
|
||||
"details": "Heavy, reach, two-handed",
|
||||
"damageType": "slashing"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Lance",
|
||||
"value": 10,
|
||||
"weight": 6,
|
||||
"description": "You have disadvantage when you use a lance to attack a target within 5 feet of you. Also, a lance requires two hands to wield when you aren’t mounted.",
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "strengthMod + proficiencyBonus",
|
||||
"damage": "1d12 + {strengthMod}",
|
||||
"details": "Reach, special",
|
||||
"damageType": "piercing"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Longsword",
|
||||
"value": 15,
|
||||
"weight": 3,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "strengthMod + proficiencyBonus",
|
||||
"damage": "1d8 + {strengthMod}",
|
||||
"details": "Versatile (1d10)",
|
||||
"damageType": "slashing"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Maul",
|
||||
"value": 10,
|
||||
"weight": 10,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "strengthMod + proficiencyBonus",
|
||||
"damage": "2d6 + {strengthMod}",
|
||||
"details": "Heavy, two-handed",
|
||||
"damageType": "bludgeoning"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Morningstar",
|
||||
"value": 15,
|
||||
"weight": 4,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "strengthMod + proficiencyBonus",
|
||||
"damage": "1d8 + {strengthMod}",
|
||||
"damageType": "piercing"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Pike",
|
||||
"value": 5,
|
||||
"weight": 18,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "strengthMod + proficiencyBonus",
|
||||
"damage": "1d10 + {strengthMod}",
|
||||
"details": "Heavy, reach, two-handed",
|
||||
"damageType": "piercing"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Rapier",
|
||||
"value": 25,
|
||||
"weight": 2,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "max(strengthMod, dexterityMod) + proficiencyBonus",
|
||||
"damage": "1d8 + {max(strengthMod, dexterityMod)}",
|
||||
"details": "Finesse",
|
||||
"damageType": "piercing"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Scimitar",
|
||||
"value": 25,
|
||||
"weight": 3,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "strengthMod + proficiencyBonus",
|
||||
"damage": "1d6 + {strengthMod}",
|
||||
"details": "Finesse, light",
|
||||
"damageType": "slashing"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Shortsword",
|
||||
"value": 10,
|
||||
"weight": 2,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "max(strengthMod, dexterityMod) + proficiencyBonus",
|
||||
"damage": "1d6 + {max(strengthMod, dexterityMod)}",
|
||||
"details": "Finesse, light",
|
||||
"damageType": "piercing"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Trident",
|
||||
"value": 5,
|
||||
"weight": 4,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "strengthMod + proficiencyBonus",
|
||||
"damage": "1d6 + {strengthMod}",
|
||||
"details": "Thrown (range 20/60), versatile (1d8)",
|
||||
"damageType": "piercing"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "War pick",
|
||||
"value": 5,
|
||||
"weight": 2,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "strengthMod + proficiencyBonus",
|
||||
"damage": "1d8 + {strengthMod}",
|
||||
"damageType": "piercing"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Warhammer",
|
||||
"value": 15,
|
||||
"weight": 2,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "strengthMod + proficiencyBonus",
|
||||
"damage": "1d8 + {strengthMod}",
|
||||
"details": "Versatile (1d10)",
|
||||
"damageType": "bludgeoning"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Whip",
|
||||
"value": 2,
|
||||
"weight": 3,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "max(strengthMod, dexterityMod) + proficiencyBonus",
|
||||
"damage": "1d4 + {max(strengthMod, dexterityMod)}",
|
||||
"details": "Finesse, reach",
|
||||
"damageType": "slashing"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Blowgun",
|
||||
"value": 10,
|
||||
"weight": 1,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "dexterityMod + proficiencyBonus",
|
||||
"damage": "1 + {dexterityMod}",
|
||||
"details": "Ammunition (range 25/100), loading",
|
||||
"damageType": "piercing"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Crossbow, hand",
|
||||
"value": 75,
|
||||
"weight": 3,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "dexterityMod + proficiencyBonus",
|
||||
"damage": "1d6 + {dexterityMod}",
|
||||
"details": "Ammunition (range 30/120), light, loading",
|
||||
"damageType": "piercing"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Crossbow, heavy",
|
||||
"value": 50,
|
||||
"weight": 18,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "dexterityMod + proficiencyBonus",
|
||||
"damage": "1d10 + {dexterityMod}",
|
||||
"details": "Ammunition (range 100/400), heavy, loading, two-handed",
|
||||
"damageType": "piercing"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Longbow",
|
||||
"value": 50,
|
||||
"weight": 2,
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "dexterityMod + proficiencyBonus",
|
||||
"damage": "1d8 + {dexterityMod}",
|
||||
"details": "Ammunition (range 150/600), heavy, two-handed",
|
||||
"damageType": "piercing"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Net",
|
||||
"value": 1,
|
||||
"weight": 3,
|
||||
"description": "A Large or smaller creature hit by a net is Restrained until it is freed. A net has no effect on creatures that are formless, or creatures that are Huge or larger. A creature can use its action to make a DC 10 Strength check, freeing itself or another creature within its reach on a success. Dealing 5 slashing damage to the net (AC 10) also frees the creature without harming it, ending the effect and destroying the net.\n\nWhen you use an action, bonus action, or reaction to attack with a net, you can make only one attack regardless of the number of attacks you can normally make.",
|
||||
"attacks": [
|
||||
{
|
||||
"attackBonus": "strengthMod + proficiencyBonus",
|
||||
"damage": "0",
|
||||
"details": "Special, thrown (range 5/15)",
|
||||
"damageType": "bludgeoning"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
6
rpg-docs/.gitignore
vendored
6
rpg-docs/.gitignore
vendored
@@ -1,5 +1,9 @@
|
||||
.meteor/local
|
||||
.meteor/meteorite
|
||||
.demeteorized
|
||||
settings.json
|
||||
public/components
|
||||
public/_imports.html
|
||||
nohup.out
|
||||
dump
|
||||
node_modules
|
||||
dump
|
||||
|
||||
@@ -6,3 +6,10 @@ notices-for-0.9.0
|
||||
notices-for-0.9.1
|
||||
0.9.4-platform-file
|
||||
notices-for-facebook-graph-api-2
|
||||
1.2.0-standard-minifiers-package
|
||||
1.2.0-meteor-platform-split
|
||||
1.2.0-cordova-changes
|
||||
1.2.0-breaking-changes
|
||||
1.3.0-split-minifiers-package
|
||||
1.4.0-remove-old-dev-bundle-link
|
||||
1.4.1-add-shell-server-package
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
|
||||
|
||||
@@ -3,20 +3,49 @@
|
||||
# 'meteor add' and 'meteor remove' will edit this file for you,
|
||||
# but you can also edit it by hand.
|
||||
|
||||
meteor-platform
|
||||
iron:router
|
||||
accounts-password
|
||||
accounts-ui
|
||||
random
|
||||
accounts-password@1.3.3
|
||||
accounts-ui@1.1.9
|
||||
random@1.0.10
|
||||
dburles:collection-helpers
|
||||
reactive-var
|
||||
underscore
|
||||
reactive-var@1.0.11
|
||||
underscore@1.0.10
|
||||
aldeed:collection2
|
||||
differential:vulcanize
|
||||
matb33:collection-hooks
|
||||
zimme:collection-softremovable
|
||||
momentjs:moment
|
||||
mike:mocha
|
||||
dburles:mongo-collection-instances
|
||||
percolate:migrations
|
||||
ecwyne:mathjs
|
||||
useraccounts:polymer
|
||||
accounts-google@1.0.11
|
||||
splendido:accounts-meld
|
||||
email@1.1.18
|
||||
meteorhacks:subs-manager
|
||||
chuangbo:marked
|
||||
reywood:iron-router-ga
|
||||
meteor-base@1.0.4
|
||||
mobile-experience@1.0.4
|
||||
mongo@1.1.14
|
||||
blaze-html-templates
|
||||
session@1.1.7
|
||||
jquery@1.11.10
|
||||
tracker@1.1.1
|
||||
logging@1.1.16
|
||||
reload@1.1.11
|
||||
ejson@1.0.13
|
||||
spacebars
|
||||
check@1.2.4
|
||||
useraccounts:iron-routing
|
||||
wizonesolutions:canonical
|
||||
standard-minifier-js@1.2.1
|
||||
shell-server@0.2.1
|
||||
seba:minifiers-autoprefixer
|
||||
nikogosovd:multiple-uihooks
|
||||
templates:array
|
||||
ecmascript@0.6.1
|
||||
es5-shim@4.6.15
|
||||
differential:vulcanize
|
||||
reactive-dict
|
||||
percolate:synced-cron
|
||||
ongoworks:speakingurl
|
||||
|
||||
@@ -1 +1 @@
|
||||
METEOR@1.1.0.2
|
||||
METEOR@1.4.2.6
|
||||
|
||||
@@ -1,91 +1,130 @@
|
||||
accounts-base@1.2.0
|
||||
accounts-password@1.1.1
|
||||
accounts-ui@1.1.5
|
||||
accounts-ui-unstyled@1.1.7
|
||||
aldeed:collection2@2.3.3
|
||||
aldeed:simple-schema@1.3.2
|
||||
amplify@1.0.0
|
||||
autoupdate@1.2.1
|
||||
base64@1.0.3
|
||||
binary-heap@1.0.3
|
||||
blaze@2.1.2
|
||||
blaze-tools@1.0.3
|
||||
boilerplate-generator@1.0.3
|
||||
callback-hook@1.0.3
|
||||
check@1.0.5
|
||||
coffeescript@1.0.6
|
||||
dburles:collection-helpers@1.0.3
|
||||
dburles:mongo-collection-instances@0.3.3
|
||||
ddp@1.1.0
|
||||
deps@1.0.7
|
||||
differential:vulcanize@0.0.5
|
||||
accounts-base@1.2.14
|
||||
accounts-google@1.0.11
|
||||
accounts-oauth@1.1.15
|
||||
accounts-password@1.3.3
|
||||
accounts-ui@1.1.9
|
||||
accounts-ui-unstyled@1.1.13
|
||||
aldeed:collection2@2.10.0
|
||||
aldeed:collection2-core@1.2.0
|
||||
aldeed:schema-deny@1.1.0
|
||||
aldeed:schema-index@1.1.1
|
||||
aldeed:simple-schema@1.5.3
|
||||
allow-deny@1.0.5
|
||||
autoupdate@1.3.12
|
||||
babel-compiler@6.13.0
|
||||
babel-runtime@1.0.1
|
||||
base64@1.0.10
|
||||
binary-heap@1.0.10
|
||||
blaze@2.3.0
|
||||
blaze-html-templates@1.1.0
|
||||
blaze-tools@1.0.10
|
||||
boilerplate-generator@1.0.11
|
||||
caching-compiler@1.1.9
|
||||
caching-html-compiler@1.1.0
|
||||
callback-hook@1.0.10
|
||||
check@1.2.4
|
||||
chuangbo:marked@0.3.5_1
|
||||
coffeescript@1.11.1_4
|
||||
dburles:collection-helpers@1.1.0
|
||||
dburles:mongo-collection-instances@0.3.5
|
||||
ddp@1.2.5
|
||||
ddp-client@1.3.2
|
||||
ddp-common@1.2.8
|
||||
ddp-rate-limiter@1.0.6
|
||||
ddp-server@1.3.12
|
||||
deps@1.0.12
|
||||
diff-sequence@1.0.7
|
||||
differential:vulcanize@3.0.0
|
||||
ecmascript@0.6.1
|
||||
ecmascript-runtime@0.3.15
|
||||
ecwyne:mathjs@0.25.0
|
||||
ejson@1.0.6
|
||||
email@1.0.6
|
||||
fastclick@1.0.3
|
||||
geojson-utils@1.0.3
|
||||
html-tools@1.0.4
|
||||
htmljs@1.0.4
|
||||
http@1.1.0
|
||||
id-map@1.0.3
|
||||
iron:controller@1.0.7
|
||||
iron:core@1.0.7
|
||||
iron:dynamic-template@1.0.7
|
||||
iron:layout@1.0.7
|
||||
iron:location@1.0.7
|
||||
iron:middleware-stack@1.0.7
|
||||
iron:router@1.0.7
|
||||
iron:url@1.0.7
|
||||
jquery@1.11.3_2
|
||||
json@1.0.3
|
||||
lai:collection-extensions@0.1.3
|
||||
launch-screen@1.0.2
|
||||
less@1.0.14
|
||||
livedata@1.0.13
|
||||
localstorage@1.0.3
|
||||
logging@1.0.7
|
||||
matb33:collection-hooks@0.7.11
|
||||
meteor@1.1.6
|
||||
meteor-platform@1.2.2
|
||||
mike:mocha@0.5.3
|
||||
minifiers@1.1.5
|
||||
minimongo@1.0.8
|
||||
mobile-status-bar@1.0.3
|
||||
momentjs:moment@2.10.3
|
||||
mongo@1.1.0
|
||||
npm-bcrypt@0.7.8_2
|
||||
observe-sequence@1.0.6
|
||||
ordered-dict@1.0.3
|
||||
package-version-parser@3.0.3
|
||||
percolate:migrations@0.7.3
|
||||
practicalmeteor:chai@1.9.2_3
|
||||
practicalmeteor:loglevel@1.1.0_3
|
||||
random@1.0.3
|
||||
reactive-dict@1.1.0
|
||||
reactive-var@1.0.5
|
||||
reload@1.1.3
|
||||
retry@1.0.3
|
||||
routepolicy@1.0.5
|
||||
sanjo:long-running-child-process@1.0.3
|
||||
sanjo:meteor-files-helpers@1.1.0_4
|
||||
sanjo:meteor-version@1.0.0
|
||||
service-configuration@1.0.4
|
||||
session@1.1.0
|
||||
sha@1.0.3
|
||||
spacebars@1.0.6
|
||||
spacebars-compiler@1.0.6
|
||||
srp@1.0.3
|
||||
templating@1.1.1
|
||||
tracker@1.0.7
|
||||
ui@1.0.6
|
||||
underscore@1.0.3
|
||||
url@1.0.4
|
||||
velocity:chokidar@0.12.6_1
|
||||
velocity:core@0.6.0
|
||||
velocity:html-reporter@0.5.3
|
||||
velocity:meteor-internals@1.1.0_7
|
||||
velocity:shim@0.1.0
|
||||
webapp@1.2.0
|
||||
webapp-hashing@1.0.3
|
||||
zimme:collection-behaviours@1.0.4
|
||||
zimme:collection-softremovable@1.0.4
|
||||
ejson@1.0.13
|
||||
email@1.1.18
|
||||
es5-shim@4.6.15
|
||||
fastclick@1.0.13
|
||||
geojson-utils@1.0.10
|
||||
google@1.1.15
|
||||
hot-code-push@1.0.4
|
||||
html-tools@1.0.11
|
||||
htmljs@1.0.11
|
||||
http@1.2.10
|
||||
id-map@1.0.9
|
||||
iron:controller@1.0.12
|
||||
iron:core@1.0.11
|
||||
iron:dynamic-template@1.0.12
|
||||
iron:layout@1.0.12
|
||||
iron:location@1.0.11
|
||||
iron:middleware-stack@1.1.0
|
||||
iron:router@1.1.1
|
||||
iron:url@1.0.11
|
||||
jquery@1.11.10
|
||||
lai:collection-extensions@0.2.1_1
|
||||
launch-screen@1.1.0
|
||||
less@2.7.9
|
||||
livedata@1.0.18
|
||||
localstorage@1.0.12
|
||||
logging@1.1.16
|
||||
matb33:collection-hooks@0.8.4
|
||||
mdg:validation-error@0.5.1
|
||||
meteor@1.6.0
|
||||
meteor-base@1.0.4
|
||||
meteorhacks:subs-manager@1.6.4
|
||||
minifier-css@1.2.16
|
||||
minifier-js@1.2.17
|
||||
minimongo@1.0.19
|
||||
mobile-experience@1.0.4
|
||||
mobile-status-bar@1.0.13
|
||||
modules@0.7.7
|
||||
modules-runtime@0.7.8
|
||||
momentjs:moment@2.17.1
|
||||
mongo@1.1.14
|
||||
mongo-id@1.0.6
|
||||
nikogosovd:multiple-uihooks@0.1.8
|
||||
npm-bcrypt@0.9.2
|
||||
npm-mongo@2.2.16_1
|
||||
oauth@1.1.12
|
||||
oauth2@1.1.11
|
||||
observe-sequence@1.0.14
|
||||
ongoworks:speakingurl@9.0.0
|
||||
ordered-dict@1.0.9
|
||||
percolate:migrations@0.9.8
|
||||
percolate:synced-cron@1.3.2
|
||||
promise@0.8.8
|
||||
raix:eventemitter@0.1.3
|
||||
random@1.0.10
|
||||
rate-limit@1.0.6
|
||||
reactive-dict@1.1.8
|
||||
reactive-var@1.0.11
|
||||
reload@1.1.11
|
||||
retry@1.0.9
|
||||
reywood:iron-router-ga@0.7.1
|
||||
routepolicy@1.0.12
|
||||
seba:minifiers-autoprefixer@1.0.1
|
||||
service-configuration@1.0.11
|
||||
session@1.1.7
|
||||
sha@1.0.9
|
||||
shell-server@0.2.1
|
||||
softwarerero:accounts-t9n@1.3.7
|
||||
spacebars@1.0.13
|
||||
spacebars-compiler@1.1.0
|
||||
splendido:accounts-emails-field@1.2.0
|
||||
splendido:accounts-meld@1.3.1
|
||||
srp@1.0.10
|
||||
standard-minifier-js@1.2.2
|
||||
templates:array@1.0.3
|
||||
templating@1.3.0
|
||||
templating-compiler@1.3.0
|
||||
templating-runtime@1.3.0
|
||||
templating-tools@1.1.0
|
||||
tracker@1.1.1
|
||||
ui@1.0.12
|
||||
underscore@1.0.10
|
||||
url@1.0.11
|
||||
useraccounts:core@1.14.2
|
||||
useraccounts:iron-routing@1.14.2
|
||||
useraccounts:polymer@1.14.2
|
||||
webapp@1.3.12
|
||||
webapp-hashing@1.0.9
|
||||
wizonesolutions:canonical@0.0.5
|
||||
zimme:collection-behaviours@1.1.3
|
||||
zimme:collection-softremovable@1.0.5
|
||||
|
||||
@@ -7,13 +7,16 @@ Schemas.Action = new SimpleSchema({
|
||||
charId: {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
index: 1,
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
optional: true,
|
||||
trim: false,
|
||||
},
|
||||
description: {
|
||||
type: String,
|
||||
optional: true,
|
||||
trim: false,
|
||||
},
|
||||
type: {
|
||||
|
||||
@@ -7,10 +7,12 @@ Schemas.Attack = new SimpleSchema({
|
||||
charId: {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
index: 1,
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
defaultValue: "New Attack",
|
||||
optional: true,
|
||||
trim: false,
|
||||
},
|
||||
details: {
|
||||
@@ -24,18 +26,12 @@ Schemas.Attack = new SimpleSchema({
|
||||
optional: true,
|
||||
trim: false,
|
||||
},
|
||||
damageBonus: {
|
||||
damage: {
|
||||
type: String,
|
||||
defaultValue: "strengthMod",
|
||||
defaultValue: "1d8 + {strengthMod}",
|
||||
optional: true,
|
||||
trim: false,
|
||||
},
|
||||
damageDice: {
|
||||
type: String,
|
||||
optional: true,
|
||||
defaultValue: "1d8",
|
||||
allowedValues: DAMAGE_DICE,
|
||||
},
|
||||
damageType: {
|
||||
type: String,
|
||||
allowedValues: [
|
||||
@@ -75,5 +71,17 @@ Attacks.attachSchema(Schemas.Attack);
|
||||
Attacks.attachBehaviour("softRemovable");
|
||||
makeChild(Attacks, ["name", "enabled"]); //children of lots of things
|
||||
|
||||
Attacks.after.insert(function (userId, attack) {
|
||||
//Check to see if this attack's parent is a spell, if so, mirror prepared state to enabled
|
||||
if (attack.parent.collection === "Spells") {
|
||||
var parentSpell = Spells.findOne(attack.parent.id);
|
||||
if (parentSpell.prepared === "unprepared") {
|
||||
Attacks.update(attack._id, {$set: {enabled: false}});
|
||||
} else if (parentSpell.prepared === "prepared" || "always") {
|
||||
Attacks.update(attack._id, {$set: {enabled: true}});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Attacks.allow(CHARACTER_SUBSCHEMA_ALLOW);
|
||||
Attacks.deny(CHARACTER_SUBSCHEMA_DENY);
|
||||
|
||||
@@ -1,28 +1,53 @@
|
||||
Buffs = new Mongo.Collection("buffs");
|
||||
|
||||
//buffs are temporary once applied and store things which expire and their expiry time
|
||||
Schemas.Buff = new SimpleSchema({
|
||||
//buff id
|
||||
_id: {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
autoValue: function(){
|
||||
if (!this.isSet) return Random.id();
|
||||
},
|
||||
},
|
||||
charId: {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
index: 1,
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
optional: true,
|
||||
trim: false,
|
||||
},
|
||||
description: {
|
||||
type: String,
|
||||
optional: true,
|
||||
trim: false,
|
||||
},
|
||||
enabled: {
|
||||
type: Boolean,
|
||||
defaultValue: true,
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
allowedValues: [
|
||||
"inate",
|
||||
"custom",
|
||||
],
|
||||
},
|
||||
"lifeTime.total": {
|
||||
type: Number,
|
||||
defaultValue: 0, //0 is infinite
|
||||
min: 0,
|
||||
},
|
||||
"lifeTime.spent": {
|
||||
type: Number,
|
||||
defaultValue: 0,
|
||||
min: 0,
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
allowedValues: _.pluck(colorOptions, "key"),
|
||||
defaultValue: "q",
|
||||
},
|
||||
//expiry time
|
||||
expiry: {type: Number, optional: true},
|
||||
duration: {type: Number},
|
||||
});
|
||||
|
||||
Buffs.attachSchema(Schemas.Buff);
|
||||
|
||||
Buffs.attachBehaviour("softRemovable");
|
||||
makeParent(Buffs, "name"); //parents of effects and attacks
|
||||
makeParent(Buffs, ["name", "enabled"]); //parents of effects
|
||||
|
||||
Buffs.allow(CHARACTER_SUBSCHEMA_ALLOW);
|
||||
Buffs.deny(CHARACTER_SUBSCHEMA_DENY);
|
||||
|
||||
@@ -3,16 +3,18 @@ Characters = new Mongo.Collection("characters");
|
||||
|
||||
Schemas.Character = new SimpleSchema({
|
||||
//strings
|
||||
name: {type: String, defaultValue: "", trim: false},
|
||||
alignment: {type: String, defaultValue: "", trim: false},
|
||||
gender: {type: String, defaultValue: "", trim: false},
|
||||
race: {type: String, defaultValue: "", trim: false},
|
||||
description: {type: String, defaultValue: "", trim: false},
|
||||
personality: {type: String, defaultValue: "", trim: false},
|
||||
ideals: {type: String, defaultValue: "", trim: false},
|
||||
bonds: {type: String, defaultValue: "", trim: false},
|
||||
flaws: {type: String, defaultValue: "", trim: false},
|
||||
backstory: {type: String, defaultValue: "", trim: false},
|
||||
name: {type: String, defaultValue: "", trim: false, optional: true},
|
||||
urlName: {type: String, defaultValue: "", trim: false, optional: true},
|
||||
alignment: {type: String, defaultValue: "", trim: false, optional: true},
|
||||
gender: {type: String, defaultValue: "", trim: false, optional: true},
|
||||
race: {type: String, defaultValue: "", trim: false, optional: true},
|
||||
picture: {type: String, defaultValue: "", trim: true, optional: true},
|
||||
description: {type: String, defaultValue: "", trim: false, optional: true},
|
||||
personality: {type: String, defaultValue: "", trim: false, optional: true},
|
||||
ideals: {type: String, defaultValue: "", trim: false, optional: true},
|
||||
bonds: {type: String, defaultValue: "", trim: false, optional: true},
|
||||
flaws: {type: String, defaultValue: "", trim: false, optional: true},
|
||||
backstory: {type: String, defaultValue: "", trim: false, optional: true},
|
||||
|
||||
//attributes
|
||||
//ability scores
|
||||
@@ -32,6 +34,7 @@ Schemas.Character = new SimpleSchema({
|
||||
age: {type: Schemas.Attribute},
|
||||
ageRate: {type: Schemas.Attribute},
|
||||
armor: {type: Schemas.Attribute},
|
||||
carryMultiplier: {type: Schemas.Attribute},
|
||||
|
||||
//resources
|
||||
level1SpellSlots: {type: Schemas.Attribute},
|
||||
@@ -159,6 +162,7 @@ Schemas.Character = new SimpleSchema({
|
||||
deathSave: {type: Schemas.DeathSave},
|
||||
|
||||
//permissions
|
||||
party: {type: String, regEx: SimpleSchema.RegEx.Id, optional: true},
|
||||
owner: {type: String, regEx: SimpleSchema.RegEx.Id},
|
||||
readers: {type: [String], regEx: SimpleSchema.RegEx.Id, defaultValue: []},
|
||||
writers: {type: [String], regEx: SimpleSchema.RegEx.Id, defaultValue: []},
|
||||
@@ -168,61 +172,128 @@ Schemas.Character = new SimpleSchema({
|
||||
defaultValue: "q",
|
||||
},
|
||||
//TODO add per-character settings
|
||||
"settings.experiencesInc": {type: Number, defaultValue: 20}, //how many experiences to load at a time in XP table
|
||||
//how many experiences to load at a time in XP table
|
||||
"settings.experiencesInc": {type: Number, defaultValue: 20},
|
||||
//slowed down by carrying too much?
|
||||
"settings.useVariantEncumbrance": {type: Boolean, defaultValue: false},
|
||||
"settings.useStandardEncumbrance": {type: Boolean, defaultValue: true},
|
||||
//hide spellcasting
|
||||
"settings.hideSpellcasting": {type: Boolean, defaultValue: false},
|
||||
//show to anyone with link
|
||||
"settings.viewPermission": {
|
||||
type: String,
|
||||
defaultValue: "whitelist",
|
||||
allowedValues: ["whitelist", "public"],
|
||||
},
|
||||
"settings.exportFeatures": {type: Boolean, defaultValue: true},
|
||||
"settings.exportAttacks": {type: Boolean, defaultValue: true},
|
||||
"settings.exportDescription": {type: Boolean, defaultValue: true},
|
||||
});
|
||||
|
||||
Characters.attachSchema(Schemas.Character);
|
||||
|
||||
var attributeBase = function(charId, statName){
|
||||
var attributeBase = preventLoop(function(charId, statName){
|
||||
check(statName, String);
|
||||
var effects = Effects.find(
|
||||
{charId: charId, stat: statName, enabled: true}
|
||||
).fetch();
|
||||
effects = _.groupBy(effects, "operation");
|
||||
var value = _.contains(DAMAGE_MULTIPLIERS, statName) ? 1 : 0;
|
||||
//if it's a damage multiplier, we treat it specially
|
||||
if (_.contains(DAMAGE_MULTIPLIERS, statName)){
|
||||
var invulnerabilityCount = Effects.find({
|
||||
charId: charId,
|
||||
stat: statName,
|
||||
enabled: true,
|
||||
operation: "mul",
|
||||
value: 0,
|
||||
}).count();
|
||||
if (invulnerabilityCount) return 0;
|
||||
var resistCount = Effects.find({
|
||||
charId: charId,
|
||||
stat: statName,
|
||||
enabled: true,
|
||||
operation: "mul",
|
||||
value: 0.5,
|
||||
}).count();
|
||||
var vulnCount = Effects.find({
|
||||
charId: charId,
|
||||
stat: statName,
|
||||
enabled: true,
|
||||
operation: "mul",
|
||||
value: 2,
|
||||
}).count();
|
||||
if (!resistCount && !vulnCount){
|
||||
return 1;
|
||||
} else if (resistCount && !vulnCount){
|
||||
return 0.5;
|
||||
} else if (!resistCount && vulnCount){
|
||||
return 2;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
var value;
|
||||
var base = 0;
|
||||
var add = 0;
|
||||
var mul = 1;
|
||||
var min = Number.NEGATIVE_INFINITY;
|
||||
var max = Number.POSITIVE_INFINITY;
|
||||
|
||||
//start with the highest base value
|
||||
_.each(effects.base, function(effect){
|
||||
var efv = evaluateEffect(charId, effect);
|
||||
if (efv > value){
|
||||
value = efv;
|
||||
Effects.find({
|
||||
charId: charId,
|
||||
stat: statName,
|
||||
enabled: true,
|
||||
operation: {$in: ["base", "add", "mul", "min", "max"]},
|
||||
}).forEach(function(effect) {
|
||||
value = evaluateEffect(charId, effect);
|
||||
if (effect.operation === "base"){
|
||||
if (value > base) base = value;
|
||||
} else if (effect.operation === "add"){
|
||||
add += value;
|
||||
} else if (effect.operation === "mul"){
|
||||
mul *= value;
|
||||
} else if (effect.operation === "min"){
|
||||
if (value > min) min = value;
|
||||
} else if (effect.operation === "max"){
|
||||
if (value < max) max = value;
|
||||
}
|
||||
});
|
||||
|
||||
//add all the add values
|
||||
_.each(effects.add, function(effect){
|
||||
value += evaluateEffect(charId, effect);
|
||||
});
|
||||
var result = (base + add) * mul;
|
||||
if (result < min) result = min;
|
||||
if (result > max) result = max;
|
||||
// Don't round carry multiplier
|
||||
if (statName === "carryMultiplier"){
|
||||
return result;
|
||||
}
|
||||
return Math.floor(result);
|
||||
});
|
||||
|
||||
//multiply all the mul values
|
||||
_.each(effects.mul, function(effect){
|
||||
value *= evaluateEffect(charId, effect);
|
||||
if (Meteor.isClient) {
|
||||
Template.registerHelper("characterCalculate", function(func, charId, input) {
|
||||
try {
|
||||
return Characters.calculate[func](charId, input);
|
||||
} catch (e){
|
||||
if (!Characters.calculate[func]){
|
||||
throw new Error(func + "is not a function name");
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//ensure value is >= all mins
|
||||
_.each(effects.min, function(effect){
|
||||
var min = evaluateEffect(charId, effect);
|
||||
value = value > min ? value : min;
|
||||
//create a local memoize with a argument concatenating hash function
|
||||
var memoize = function(f) {
|
||||
return Tracker.memoize(f, function() {
|
||||
return _.reduce(arguments, function(memo, arg) {
|
||||
return memo + arg;
|
||||
}, "");
|
||||
});
|
||||
|
||||
//ensure value is <= all maxes
|
||||
_.each(effects.max, function(effect){
|
||||
var max = evaluateEffect(charId, effect);
|
||||
value = value < max ? value : max;
|
||||
});
|
||||
return value;
|
||||
};
|
||||
|
||||
//functions and calculated values.
|
||||
//These functions can only rely on this._id since no other
|
||||
//field is likely to be attached to all returned characters
|
||||
Characters.helpers({
|
||||
//returns the value stored in the field requested
|
||||
//will set up dependencies on just that field
|
||||
getField : function(fieldName){
|
||||
//memoize funcitons that have finds and slow loops
|
||||
Characters.calculate = {
|
||||
getField: function(charId, fieldName) {
|
||||
var fieldSelector = {};
|
||||
fieldSelector[fieldName] = 1;
|
||||
var char = Characters.findOne(this._id, {fields: fieldSelector});
|
||||
var char = Characters.findOne(charId, {fields: fieldSelector});
|
||||
var field = char[fieldName];
|
||||
if (field === undefined){
|
||||
throw new Meteor.Error(
|
||||
@@ -235,8 +306,7 @@ Characters.helpers({
|
||||
}
|
||||
return field;
|
||||
},
|
||||
//returns the value of a field
|
||||
fieldValue : function(fieldName){
|
||||
fieldValue: function(charId, fieldName) {
|
||||
if (!Schemas.Character.schema(fieldName)){
|
||||
throw new Meteor.Error(
|
||||
"Field not found",
|
||||
@@ -246,102 +316,92 @@ Characters.helpers({
|
||||
//duck typing to get the right value function
|
||||
//.ability implies skill
|
||||
if (Schemas.Character.schema(fieldName + ".ability")){
|
||||
return this.skillMod(fieldName);
|
||||
return Characters.calculate.skillMod(charId, fieldName);
|
||||
}
|
||||
//adjustment implies attribute
|
||||
if (Schemas.Character.schema(fieldName + ".adjustment")){
|
||||
return this.attributeValue(fieldName);
|
||||
return Characters.calculate.attributeValue(charId, fieldName);
|
||||
}
|
||||
//fall back to just returning the field itself
|
||||
return this.getField(fieldName);
|
||||
return Characters.calculate.getField(charId, fieldName);
|
||||
},
|
||||
|
||||
attributeValue: function(attributeName){
|
||||
var charId = this._id;
|
||||
var attribute = this.getField(attributeName);
|
||||
attributeValue: memoize(function(charId, attributeName){
|
||||
var attribute = Characters.calculate.getField(charId, attributeName);
|
||||
//base value
|
||||
var value = this.attributeBase(attributeName);
|
||||
var value = Characters.calculate.attributeBase(charId, attributeName);
|
||||
//plus adjustment
|
||||
value += attribute.adjustment;
|
||||
return value;
|
||||
},
|
||||
|
||||
attributeBase: preventLoop(function(attributeName){
|
||||
var charId = this._id;
|
||||
//base value
|
||||
}),
|
||||
attributeBase: memoize(function(charId, attributeName){
|
||||
return attributeBase(charId, attributeName);
|
||||
}),
|
||||
|
||||
skillMod: preventLoop(function(skillName){
|
||||
var charId = this._id;
|
||||
var skill = this.getField(skillName);
|
||||
skillMod: memoize(preventLoop(function(charId, skillName){
|
||||
var skill = Characters.calculate.getField(charId, skillName);
|
||||
//get the final value of the ability score
|
||||
var ability = this.attributeValue(skill.ability);
|
||||
var ability = Characters.calculate.attributeValue(charId, skill.ability);
|
||||
|
||||
//base modifier
|
||||
var mod = +getMod(ability);
|
||||
|
||||
//multiply proficiency bonus by largest value in proficiency array
|
||||
var prof = this.proficiency(skillName);
|
||||
var prof = Characters.calculate.proficiency(charId, skillName);
|
||||
|
||||
//add multiplied proficiency bonus to modifier
|
||||
mod += prof * this.attributeValue("proficiencyBonus");
|
||||
mod += prof * Characters.calculate.attributeValue(charId, "proficiencyBonus");
|
||||
|
||||
//apply all effects
|
||||
var rawEffects = Effects.find(
|
||||
{charId: charId, stat: skillName, enabled: true}
|
||||
).fetch();
|
||||
var effects = _.groupBy(rawEffects, "operation");
|
||||
_.forEach(effects.add, function(effect){
|
||||
mod += evaluateEffect(charId, effect);
|
||||
});
|
||||
_.forEach(effects.mul, function(effect){
|
||||
mod *= evaluateEffect(charId, effect);
|
||||
});
|
||||
_.forEach(effects.min, function(effect){
|
||||
var min = evaluateEffect(charId, effect);
|
||||
mod = mod > min ? mod : min;
|
||||
});
|
||||
_.forEach(effects.max, function(effect){
|
||||
var max = evaluateEffect(charId, effect);
|
||||
mod = mod < max ? mod : max;
|
||||
});
|
||||
return signedString(mod);
|
||||
}),
|
||||
var value;
|
||||
var add = 0;
|
||||
var mul = 1;
|
||||
var min = Number.NEGATIVE_INFINITY;
|
||||
var max = Number.POSITIVE_INFINITY;
|
||||
|
||||
proficiency: function(skillName){
|
||||
var charId = this._id;
|
||||
//return largest value in proficiency array
|
||||
var prof = 0;
|
||||
Proficiencies.find(
|
||||
{charId: charId, name: skillName, enabled: true}
|
||||
).forEach(function(proficiency){
|
||||
var newProf = proficiency.value;
|
||||
if (newProf > prof){
|
||||
prof = newProf;
|
||||
Effects.find({
|
||||
charId: charId,
|
||||
stat: skillName,
|
||||
enabled: true,
|
||||
operation: {$in: ["base", "add", "mul", "min", "max"]},
|
||||
}).forEach(function(effect) {
|
||||
value = evaluateEffect(charId, effect);
|
||||
if (effect.operation === "add"){
|
||||
add += value;
|
||||
} else if (effect.operation === "mul"){
|
||||
mul *= value;
|
||||
} else if (effect.operation === "min"){
|
||||
if (value > min) min = value;
|
||||
} else if (effect.operation === "max"){
|
||||
if (value < max) max = value;
|
||||
}
|
||||
});
|
||||
return prof;
|
||||
},
|
||||
var result = (mod + add) * mul;
|
||||
if (result < min) result = min;
|
||||
if (result > max) result = max;
|
||||
|
||||
passiveSkill: function(skillName){
|
||||
if (_.isString(skillName)){
|
||||
var skill = this.getField(skillName);
|
||||
}
|
||||
var charId = this._id;
|
||||
var mod = +this.skillMod(skillName);
|
||||
return Math.floor(result);
|
||||
})),
|
||||
proficiency: memoize(function(charId, skillName){
|
||||
//return largest value in proficiency array
|
||||
var prof = Proficiencies.findOne(
|
||||
{charId: charId, name: skillName, enabled: true},
|
||||
{sort: {value: -1}}
|
||||
);
|
||||
return prof && prof.value || 0;
|
||||
}),
|
||||
passiveSkill: memoize(function(charId, skillName){
|
||||
var skill = Characters.calculate.getField(charId, skillName);
|
||||
var mod = +Characters.calculate.skillMod(charId, skillName);
|
||||
var value = 10 + mod;
|
||||
Effects.find(
|
||||
{charId: charId, stat: skillName, enabled: true, operation: "passiveAdd"}
|
||||
).forEach(function(effect){
|
||||
value += evaluateEffect(charId, effect);
|
||||
});
|
||||
return value;
|
||||
//TODO decide whether (dis)advantage gives (-)+5 to passive checks
|
||||
},
|
||||
|
||||
advantage: function(skillName){
|
||||
var charId = this._id;
|
||||
var advantage = Characters.calculate.advantage(charId, skillName);
|
||||
value += 5 * advantage;
|
||||
return Math.floor(value);
|
||||
}),
|
||||
advantage: memoize(function(charId, skillName){
|
||||
var advantage = Effects.find(
|
||||
{charId: charId, stat: skillName, enabled: true, operation: "advantage"}
|
||||
).count();
|
||||
@@ -351,19 +411,18 @@ Characters.helpers({
|
||||
if (advantage && !disadvantage) return 1;
|
||||
if (disadvantage && !advantage) return -1;
|
||||
return 0;
|
||||
}),
|
||||
abilityMod: function(charId, attribute){
|
||||
return getMod(
|
||||
Characters.calculate.attributeValue(charId, attribute)
|
||||
);
|
||||
},
|
||||
|
||||
abilityMod: function(attribute){
|
||||
return signedString(getMod(this.attributeValue(attribute)));
|
||||
},
|
||||
|
||||
passiveAbility: function(attribute){
|
||||
var mod = +getMod(this.attributeValue(attribute));
|
||||
passiveAbility: function(charId, attribute){
|
||||
var mod = +getMod(Characters.calculate.attributeValue(charId, attribute));
|
||||
return 10 + mod;
|
||||
},
|
||||
|
||||
xpLevel: function(){
|
||||
var xp = this.experience();
|
||||
xpLevel: function(charId){
|
||||
var xp = Characters.calculate.experience(charId);
|
||||
for (var i = 0; i < 19; i++){
|
||||
if (xp < XP_TABLE[i]){
|
||||
return i;
|
||||
@@ -372,30 +431,103 @@ Characters.helpers({
|
||||
if (xp > 355000) return 20;
|
||||
return 0;
|
||||
},
|
||||
|
||||
level: function(){
|
||||
level: memoize(function(charId){
|
||||
var level = 0;
|
||||
Classes.find({charId: this._id}).forEach(function(cls){
|
||||
Classes.find({charId: charId}).forEach(function(cls){
|
||||
level += cls.level;
|
||||
});
|
||||
return level;
|
||||
},
|
||||
|
||||
experience: function(){
|
||||
}),
|
||||
experience: memoize(function(charId){
|
||||
var xp = 0;
|
||||
Experiences.find(
|
||||
{charId: this._id},
|
||||
{charId: charId},
|
||||
{fields: {value: 1}}
|
||||
).forEach(function(e){
|
||||
xp += e.value;
|
||||
});
|
||||
return xp;
|
||||
}),
|
||||
};
|
||||
|
||||
var deprecated = function() {
|
||||
//var err = new Error("this function has been deprecated");
|
||||
var name = "";
|
||||
if (Template.instance()){
|
||||
name = Template.instance().view.name;
|
||||
}
|
||||
var logString = "this function has been deprecated \n";
|
||||
if (name){
|
||||
logString += "View: " + name + "\n\n";
|
||||
}
|
||||
//logString += err.stack + "\n\n---------------------\n\n";
|
||||
console.log(logString);
|
||||
};
|
||||
|
||||
//functions and calculated values.
|
||||
//These functions can only rely on this._id since no other
|
||||
//field is likely to be attached to all returned characters
|
||||
Characters.helpers({
|
||||
//returns the value stored in the field requested
|
||||
//will set up dependencies on just that field
|
||||
getField : function(fieldName){
|
||||
deprecated();
|
||||
return Characters.calculate.getField(this._id, fieldName);
|
||||
},
|
||||
//returns the value of a field
|
||||
fieldValue : function(fieldName){
|
||||
deprecated();
|
||||
return Characters.calculate.fieldValue(this._id, fieldName);
|
||||
},
|
||||
attributeValue: function(attributeName){
|
||||
deprecated();
|
||||
return Characters.calculate.attributeValue(this._id, attributeName);
|
||||
},
|
||||
attributeBase: function(attributeName){
|
||||
deprecated();
|
||||
return Characters.calculate.attributeBase(this._id, attributeName);
|
||||
},
|
||||
skillMod: function(skillName){
|
||||
deprecated();
|
||||
return Characters.calculate.skillMod(this._id, skillName);
|
||||
},
|
||||
proficiency: function(skillName){
|
||||
deprecated();
|
||||
return Characters.calculate.proficiency(this._id, skillName);
|
||||
},
|
||||
passiveSkill: function(skillName){
|
||||
deprecated();
|
||||
return Characters.calculate.passiveSkill(this._id, skillName);
|
||||
},
|
||||
advantage: function(skillName){
|
||||
deprecated();
|
||||
return Characters.calculate.advantage(this._id, skillName);
|
||||
},
|
||||
abilityMod: function(attribute){
|
||||
deprecated();
|
||||
return Characters.calculate.abilityMod(this._id, attribute);
|
||||
},
|
||||
passiveAbility: function(attribute){
|
||||
deprecated();
|
||||
return Characters.calculate.passiveAbility(this._id, attribute);
|
||||
},
|
||||
xpLevel: function(){
|
||||
deprecated();
|
||||
return Characters.calculate.xpLevel(this._id);
|
||||
},
|
||||
level: function(){
|
||||
deprecated();
|
||||
return Characters.calculate.level(this._id);
|
||||
},
|
||||
experience: function(){
|
||||
deprecated();
|
||||
return Characters.calculate.experience(this._id);
|
||||
},
|
||||
});
|
||||
|
||||
//clean up all data related to that character before removing it
|
||||
Characters.after.remove(function(userId, character) {
|
||||
if (Meteor.isServer){
|
||||
if (Meteor.isServer){
|
||||
Characters.after.remove(function(userId, character) {
|
||||
Actions .remove({charId: character._id});
|
||||
Attacks .remove({charId: character._id});
|
||||
Buffs .remove({charId: character._id});
|
||||
@@ -408,8 +540,14 @@ Characters.after.remove(function(userId, character) {
|
||||
SpellLists .remove({charId: character._id});
|
||||
Items .remove({charId: character._id});
|
||||
Containers .remove({charId: character._id});
|
||||
}
|
||||
});
|
||||
});
|
||||
Characters.after.update(function(userId, doc, fieldNames, modifier, options) {
|
||||
if (_.contains(fieldNames, "name")){
|
||||
var urlName = getSlug(doc.name, {maintainCase: true});
|
||||
Characters.update(doc._id, {$set: {urlName}});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Characters.allow({
|
||||
insert: function(userId, doc) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
Classes = new Mongo.Collection("classes");
|
||||
|
||||
Schemas.Class = new SimpleSchema({
|
||||
charId: {type: String, regEx: SimpleSchema.RegEx.Id},
|
||||
name: {type: String, trim: false},
|
||||
charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1},
|
||||
name: {type: String, optional: true, trim: false},
|
||||
level: {type: Number},
|
||||
createdAt: {
|
||||
type: Date,
|
||||
|
||||
@@ -8,6 +8,7 @@ Schemas.Effect = new SimpleSchema({
|
||||
charId: {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
index: 1,
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
@@ -58,59 +59,74 @@ Schemas.Effect = new SimpleSchema({
|
||||
|
||||
Effects.attachSchema(Schemas.Effect);
|
||||
|
||||
if (Meteor.isServer) Characters.after.insert(function(userId, char) {
|
||||
Effects.insert({
|
||||
charId: char._id,
|
||||
type: "inate",
|
||||
name: "Constitution modifier for each level",
|
||||
stat: "hitPoints",
|
||||
operation: "add",
|
||||
calculation: "level * constitutionMod",
|
||||
parent: {
|
||||
id: char._id,
|
||||
collection: "Characters",
|
||||
},
|
||||
});
|
||||
Effects.insert({
|
||||
charId: char._id,
|
||||
type: "inate",
|
||||
name: "Proficiency bonus by level",
|
||||
stat: "proficiencyBonus",
|
||||
operation: "add",
|
||||
calculation: "floor(level / 4 + 1.75)",
|
||||
parent: {
|
||||
id: char._id,
|
||||
collection: "Characters",
|
||||
},
|
||||
});
|
||||
Effects.insert({
|
||||
charId: char._id,
|
||||
type: "inate",
|
||||
name: "Dexterity Armor Bonus",
|
||||
stat: "armor",
|
||||
operation: "add",
|
||||
calculation: "dexterityArmor",
|
||||
parent: {
|
||||
id: char._id,
|
||||
collection: "Characters",
|
||||
},
|
||||
});
|
||||
Effects.insert({
|
||||
charId: char._id,
|
||||
type: "inate",
|
||||
name: "Natural Armor",
|
||||
stat: "armor",
|
||||
operation: "base",
|
||||
value: 10,
|
||||
parent: {
|
||||
id: char._id,
|
||||
collection: "Characters",
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
Effects.attachBehaviour("softRemovable");
|
||||
makeChild(Effects, ["enabled"]); //children of lots of things
|
||||
|
||||
Effects.allow(CHARACTER_SUBSCHEMA_ALLOW);
|
||||
Effects.deny(CHARACTER_SUBSCHEMA_DENY);
|
||||
|
||||
//give characters default character effects
|
||||
Characters.after.insert(function(userId, char) {
|
||||
if (Meteor.isServer) {
|
||||
Effects.insert({
|
||||
charId: char._id,
|
||||
name: "Constitution modifier for each level",
|
||||
stat: "hitPoints",
|
||||
operation: "add",
|
||||
calculation: "level * constitutionMod",
|
||||
parent: {
|
||||
id: char._id,
|
||||
collection: "Characters",
|
||||
group: "Inate",
|
||||
},
|
||||
});
|
||||
Effects.insert({
|
||||
charId: char._id,
|
||||
name: "Proficiency bonus by level",
|
||||
stat: "proficiencyBonus",
|
||||
operation: "add",
|
||||
calculation: "floor(level / 4 + 1.75)",
|
||||
parent: {
|
||||
id: char._id,
|
||||
collection: "Characters",
|
||||
group: "Inate",
|
||||
},
|
||||
});
|
||||
Effects.insert({
|
||||
charId: char._id,
|
||||
name: "Dexterity Armor Bonus",
|
||||
stat: "armor",
|
||||
operation: "add",
|
||||
calculation: "dexterityArmor",
|
||||
parent: {
|
||||
id: char._id,
|
||||
collection: "Characters",
|
||||
group: "Inate",
|
||||
},
|
||||
});
|
||||
Effects.insert({
|
||||
charId: char._id,
|
||||
name: "Natural Armor",
|
||||
stat: "armor",
|
||||
operation: "base",
|
||||
value: 10,
|
||||
parent: {
|
||||
id: char._id,
|
||||
collection: "Characters",
|
||||
group: "Inate",
|
||||
},
|
||||
});
|
||||
Effects.insert({
|
||||
charId: char._id,
|
||||
name: "Natural Carrying Capacity",
|
||||
stat: "carryMultiplier",
|
||||
operation: "base",
|
||||
value: "1",
|
||||
parent: {
|
||||
id: char._id,
|
||||
collection: "Characters",
|
||||
group: "Inate",
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
Experiences = new Mongo.Collection("experience");
|
||||
|
||||
Schemas.Experience = new SimpleSchema({
|
||||
charId: {type: String, regEx: SimpleSchema.RegEx.Id},
|
||||
name: {type: String, defaultValue: "New Experience", trim: false},
|
||||
charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1},
|
||||
name: {type: String, optional: true, trim: false, defaultValue: "New Experience"},
|
||||
description: {type: String, optional: true, trim: false},
|
||||
value: {type: Number, defaultValue: 0},
|
||||
dateAdded: {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
Features = new Mongo.Collection("features");
|
||||
|
||||
Schemas.Feature = new SimpleSchema({
|
||||
charId: {type: String, regEx: SimpleSchema.RegEx.Id},
|
||||
name: {type: String, trim: false},
|
||||
charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1},
|
||||
name: {type: String, optional: true, trim: false},
|
||||
description: {type: String, optional: true, trim: false},
|
||||
uses: {type: String, optional: true, trim: false},
|
||||
used: {type: Number, defaultValue: 0},
|
||||
@@ -35,3 +35,81 @@ makeParent(Features, ["name", "enabled"]); //parents of effects and attacks
|
||||
|
||||
Features.allow(CHARACTER_SUBSCHEMA_ALLOW);
|
||||
Features.deny(CHARACTER_SUBSCHEMA_DENY);
|
||||
|
||||
//give characters default feature of base ability scores of 10
|
||||
Characters.after.insert(function(userId, char) {
|
||||
if (Meteor.isServer){
|
||||
var featureId = Features.insert({
|
||||
name: "Base Ability Scores",
|
||||
charId: char._id,
|
||||
enabled: true,
|
||||
alwaysEnabled: true,
|
||||
});
|
||||
Effects.insert({
|
||||
stat: "strength",
|
||||
charId: char._id,
|
||||
parent: {
|
||||
id: featureId,
|
||||
collection: "Features",
|
||||
},
|
||||
operation: "base",
|
||||
value: 10,
|
||||
enabled: true,
|
||||
});
|
||||
Effects.insert({
|
||||
stat: "dexterity",
|
||||
charId: char._id,
|
||||
parent: {
|
||||
id: featureId,
|
||||
collection: "Features",
|
||||
},
|
||||
operation: "base",
|
||||
value: 10,
|
||||
enabled: true,
|
||||
});
|
||||
Effects.insert({
|
||||
stat: "constitution",
|
||||
charId: char._id,
|
||||
parent: {
|
||||
id: featureId,
|
||||
collection: "Features",
|
||||
},
|
||||
operation: "base",
|
||||
value: 10,
|
||||
enabled: true,
|
||||
});
|
||||
Effects.insert({
|
||||
stat: "intelligence",
|
||||
charId: char._id,
|
||||
parent: {
|
||||
id: featureId,
|
||||
collection: "Features",
|
||||
},
|
||||
operation: "base",
|
||||
value: 10,
|
||||
enabled: true,
|
||||
});
|
||||
Effects.insert({
|
||||
stat: "wisdom",
|
||||
charId: char._id,
|
||||
parent: {
|
||||
id: featureId,
|
||||
collection: "Features",
|
||||
},
|
||||
operation: "base",
|
||||
value: 10,
|
||||
enabled: true,
|
||||
});
|
||||
Effects.insert({
|
||||
stat: "charisma",
|
||||
charId: char._id,
|
||||
parent: {
|
||||
id: featureId,
|
||||
collection: "Features",
|
||||
},
|
||||
operation: "base",
|
||||
value: 10,
|
||||
enabled: true,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
Notes = new Mongo.Collection("notes");
|
||||
|
||||
Schemas.Note = new SimpleSchema({
|
||||
charId: {type: String, regEx: SimpleSchema.RegEx.Id},
|
||||
name: {type: String, trim: false},
|
||||
charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1},
|
||||
name: {type: String, optional: true, trim: false},
|
||||
description: {type: String, optional: true, trim: false},
|
||||
color: {
|
||||
type: String,
|
||||
|
||||
@@ -4,6 +4,7 @@ Schemas.Proficiency = new SimpleSchema({
|
||||
charId: {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
index: 1,
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
@@ -30,7 +31,7 @@ Schemas.Proficiency = new SimpleSchema({
|
||||
Proficiencies.attachSchema(Schemas.Proficiency);
|
||||
|
||||
Proficiencies.attachBehaviour("softRemovable");
|
||||
makeChild(Proficiencies);
|
||||
makeChild(Proficiencies, ["enabled"]);
|
||||
|
||||
Proficiencies.allow(CHARACTER_SUBSCHEMA_ALLOW);
|
||||
Proficiencies.deny(CHARACTER_SUBSCHEMA_DENY);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
SpellLists = new Mongo.Collection("spellLists");
|
||||
|
||||
Schemas.SpellLists = new SimpleSchema({
|
||||
charId: {type: String, regEx: SimpleSchema.RegEx.Id},
|
||||
name: {type: String, trim: false},
|
||||
charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1},
|
||||
name: {type: String, optional: true, trim: false},
|
||||
description: {type: String, optional: true, trim: false},
|
||||
saveDC: {type: String, optional: true, trim: false},
|
||||
attackBonus: {type: String, optional: true, trim: false},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Spells = new Mongo.Collection("spells");
|
||||
|
||||
Schemas.Spell = new SimpleSchema({
|
||||
charId: {type: String, regEx: SimpleSchema.RegEx.Id},
|
||||
charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1},
|
||||
prepared: {
|
||||
type: String,
|
||||
defaultValue: "prepared",
|
||||
@@ -9,6 +9,7 @@ Schemas.Spell = new SimpleSchema({
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
optional: true,
|
||||
trim: false,
|
||||
defaultValue: "New Spell",
|
||||
},
|
||||
@@ -62,6 +63,23 @@ Spells.attachSchema(Schemas.Spell);
|
||||
|
||||
Spells.attachBehaviour("softRemovable");
|
||||
makeChild(Spells); //children of spell lists
|
||||
makeParent(Spells, ["name", "enabled"]); //parents of attacks
|
||||
|
||||
Spells.after.update(function (userId, spell, fieldNames) {
|
||||
//Update prepared state of spell and child attacks to be enabled or not
|
||||
if (_.contains(fieldNames, "prepared")) {
|
||||
var childAttacks = Attacks.find({"parent.id": spell._id}).fetch();
|
||||
if (spell.prepared === "unprepared") {
|
||||
_.each(childAttacks, function(attack){
|
||||
Attacks.update(attack._id, {$set: {enabled: false}});
|
||||
});
|
||||
} else if (spell.prepared === "prepared" || "always") {
|
||||
_.each(childAttacks, function(attack){
|
||||
Attacks.update(attack._id, {$set: {enabled: true}});
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Spells.allow(CHARACTER_SUBSCHEMA_ALLOW);
|
||||
Spells.deny(CHARACTER_SUBSCHEMA_DENY);
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
* Damage, healing and resource cost/recovery are all adjustments
|
||||
*/
|
||||
Schemas.Adjustment = new SimpleSchema({
|
||||
name: {
|
||||
type: String,
|
||||
optional: true,
|
||||
},
|
||||
//which stat the adjustment is applied to
|
||||
stat: {
|
||||
type: String,
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
TemporaryHitPoints = new Mongo.Collection("temporaryHitPoints");
|
||||
|
||||
Schemas.TemporaryHitPoints = new SimpleSchema({
|
||||
charId: {type: String, regEx: SimpleSchema.RegEx.Id},
|
||||
charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1},
|
||||
name: {type: String, optional: true},
|
||||
maximum: {type: Number, defaultValue: 0},
|
||||
used: {type: Number, defaultValue: 0},
|
||||
deleteOnZero:{type: Boolean, defaultValue: true},
|
||||
maximum: {type: Number, defaultValue: 0, min: 0, max: 500},
|
||||
used: {type: Number, defaultValue: 0, min: 0, max: 500},
|
||||
deleteOnZero:{type: Boolean, defaultValue: false},
|
||||
dateAdded: {
|
||||
type: Date,
|
||||
autoValue: function() {
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
Containers = new Mongo.Collection("containers");
|
||||
|
||||
Schemas.Container = new SimpleSchema({
|
||||
name: {type: String, trim: false},
|
||||
charId: {type: String, regEx: SimpleSchema.RegEx.Id},
|
||||
name: {type: String, optional: true, trim: false},
|
||||
charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1},
|
||||
isCarried: {type: Boolean},
|
||||
weight: {type: Number, min: 0, defaultValue: 0, decimal: true},
|
||||
value: {type: Number, min: 0, defaultValue: 0, decimal: true},
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
Items = new Mongo.Collection("items");
|
||||
|
||||
Schemas.Item = new SimpleSchema({
|
||||
name: {type: String, defaultValue: "New Item", trim: false},
|
||||
name: {type: String, optional: true, trim: false, defaultValue: "New Item"},
|
||||
plural: {type: String, optional: true, trim: false},
|
||||
description:{type: String, optional: true, trim: false},
|
||||
charId: {type: String, regEx: SimpleSchema.RegEx.Id}, //id of owner
|
||||
charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1}, //id of owner
|
||||
quantity: {type: Number, min: 0, defaultValue: 1},
|
||||
weight: {type: Number, min: 0, defaultValue: 0, decimal: true},
|
||||
value: {type: Number, min: 0, defaultValue: 0, decimal: true},
|
||||
enabled: {type: Boolean, defaultValue: false},
|
||||
requiresAttunement: {type: Boolean, defaultValue: false},
|
||||
"settings.showIncrement": {type: Boolean, defaultValue: false},
|
||||
color: {
|
||||
type: String,
|
||||
allowedValues: _.pluck(colorOptions, "key"),
|
||||
@@ -19,6 +20,156 @@ Schemas.Item = new SimpleSchema({
|
||||
|
||||
Items.attachSchema(Schemas.Item);
|
||||
|
||||
var checkMovePermission = function(itemId, parent) {
|
||||
var item = Items.findOne(itemId);
|
||||
if (!item)
|
||||
throw new Meteor.Error("No such item",
|
||||
"An item could not be found to move");
|
||||
//handle permissions
|
||||
var permission = Meteor.call("canWriteCharacter", item.charId);
|
||||
if (!permission){
|
||||
throw new Meteor.Error("Access denied",
|
||||
"Not permitted to move items from this character");
|
||||
}
|
||||
if (parent.collection === "Characters"){
|
||||
permission = Meteor.call("canWriteCharacter", parent.id);
|
||||
if (!permission){
|
||||
throw new Meteor.Error("Access denied",
|
||||
"Not permitted to move items to this character");
|
||||
}
|
||||
} else {
|
||||
var parentCollectionObject = global[parent.collection];
|
||||
var parentObject = null;
|
||||
if (parentCollectionObject)
|
||||
parentObject = parentCollectionObject.findOne(
|
||||
parent.id, {fields: {_id: 1, charId: 1}}
|
||||
);
|
||||
if (!parentObject) throw new Meteor.Error(
|
||||
"Invalid parent",
|
||||
"The destination parent " + parent.id +
|
||||
" does not exist in the collection " + parent.collection
|
||||
);
|
||||
if (parentObject.charId){
|
||||
permission = Meteor.call("canWriteCharacter", parentObject.charId);
|
||||
if (!permission){
|
||||
throw new Meteor.Error("Access denied",
|
||||
"Not permitted to move items to this character");
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var moveItem = function(itemId, enable, parentCollection, parentId) {
|
||||
var item = Items.findOne(itemId);
|
||||
if (!item) return;
|
||||
parentCollection = parentCollection || item.parent.collection;
|
||||
parentId = parentId || item.parent.id;
|
||||
|
||||
if (Meteor.isServer) {
|
||||
checkMovePermission(itemId, {collection: parentCollection, id: parentId});
|
||||
}
|
||||
|
||||
//update the item provided the update will actually change something
|
||||
if (
|
||||
item.parent.collection !== parentCollection ||
|
||||
item.parent.id !== parentId ||
|
||||
item.enabled !== enable
|
||||
){
|
||||
Items.update(
|
||||
itemId,
|
||||
{$set: {
|
||||
"parent.collection": parentCollection,
|
||||
"parent.id": parentId,
|
||||
enabled: enable,
|
||||
}}
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
Meteor.methods({
|
||||
moveItemToParent: function(itemId, parent) {
|
||||
check(itemId, String);
|
||||
check(parent, {collection: String, id: String});
|
||||
moveItem(itemId, false, parent.collection, parent.id);
|
||||
},
|
||||
moveItemToCharacter: function(itemId, charId) {
|
||||
check(itemId, String);
|
||||
check(charId, String);
|
||||
moveItem(itemId, false, "Characters", charId);
|
||||
},
|
||||
moveItemToContainer: function(itemId, containerId) {
|
||||
check(itemId, String);
|
||||
check(containerId, String);
|
||||
moveItem(itemId, false, "Containers", containerId);
|
||||
},
|
||||
equipItem: function(itemId, charId){
|
||||
check(itemId, String);
|
||||
check(charId, String);
|
||||
moveItem(itemId, true, "Characters", charId);
|
||||
},
|
||||
unequipItem: function(itemId, charId){
|
||||
check(itemId, String);
|
||||
check(charId, String);
|
||||
moveItem(itemId, false, "Characters", charId);
|
||||
},
|
||||
splitItemToParent: function(itemId, moveQuantity, parent){
|
||||
check(itemId, String);
|
||||
check(moveQuantity, Number);
|
||||
check(parent, {id: String, collection: String});
|
||||
|
||||
//get the item
|
||||
var item = Items.findOne(itemId);
|
||||
if (!item) return;
|
||||
|
||||
//don't bother moving nothing
|
||||
if (moveQuantity <= 0 || item.quantity <= 0){
|
||||
return;
|
||||
}
|
||||
//ensure we are only moving up to the current stack size
|
||||
if (item.quantity < moveQuantity){
|
||||
moveQuantity = this.quantity;
|
||||
}
|
||||
|
||||
if (Meteor.isServer) {
|
||||
checkMovePermission(itemId, parent);
|
||||
}
|
||||
|
||||
//create a new item stack
|
||||
var newStack = _.omit(EJSON.clone(item), "_id");
|
||||
newStack.parent = parent;
|
||||
newStack.quantity = moveQuantity;
|
||||
|
||||
//find out if we have an exact replica in the destination
|
||||
var query = _.omit(newStack, ["parent", "quantity"]);
|
||||
query["parent.collection"] = newStack.parent.collection;
|
||||
query["parent.id"] = newStack.parent.id;
|
||||
query._id = {$ne: itemId}; //make sure we don't join it to itself
|
||||
var existingStack = Items.findOne(query);
|
||||
if (existingStack){
|
||||
//increase the existing stack's size
|
||||
Items.update(
|
||||
existingStack._id,
|
||||
{$inc: {quantity: moveQuantity}}
|
||||
);
|
||||
} else {
|
||||
//insert the new stack
|
||||
Items.insert(newStack, function(err, id){
|
||||
if (err) throw err;
|
||||
//copy the children also
|
||||
Meteor.call("cloneChildren", item._id, {collection: "Items", id: id});
|
||||
});
|
||||
}
|
||||
|
||||
//reduce the old stack's size
|
||||
var oldQuantity = item.quantity - moveQuantity;
|
||||
if (oldQuantity === 0){
|
||||
Items.remove(itemId);
|
||||
} else {
|
||||
Items.update(itemId, {$set: {quantity: oldQuantity}});
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Items.helpers({
|
||||
totalValue: function(){
|
||||
return this.value * this.quantity;
|
||||
@@ -33,103 +184,6 @@ Items.helpers({
|
||||
return this.name;
|
||||
}
|
||||
},
|
||||
equip: function(characterId){
|
||||
var charId = characterId || this.charId;
|
||||
if (!charId || !Characters.findOne(charId)) throw "Invalid character";
|
||||
if (this.parent.collection === "Characters" &&
|
||||
this.parent.id === charId &&
|
||||
this.enabled) {
|
||||
return;
|
||||
}
|
||||
Items.update(
|
||||
this._id,
|
||||
{$set: {
|
||||
"parent.collection": "Characters",
|
||||
"parent.id": charId,
|
||||
enabled: true,
|
||||
}}
|
||||
);
|
||||
},
|
||||
unequip: function(){
|
||||
if (!this.enabled) return;
|
||||
Items.update(this._id, {$set: {enabled: false}});
|
||||
},
|
||||
moveToContainer: function(containerId){
|
||||
if (!containerId || !Containers.findOne(containerId)){
|
||||
throw "Invalid container";
|
||||
}
|
||||
if (this.parent.collection === "Containers" &&
|
||||
this.parent.id === containerId &&
|
||||
!this.enabled) return;
|
||||
Items.update(
|
||||
this._id,
|
||||
{$set: {
|
||||
"parent.collection": "Containers",
|
||||
"parent.id": containerId,
|
||||
enabled: false,
|
||||
}}
|
||||
);
|
||||
},
|
||||
moveToCharacter: function(characterId){
|
||||
if (!characterId || !Characters.findOne(characterId)) {
|
||||
throw "Invalid character";
|
||||
}
|
||||
if (this.parent.collection === "Characters" &&
|
||||
this.parent.id === characterId &&
|
||||
!this.enabled) return;
|
||||
Items.update(
|
||||
this._id,
|
||||
{$set: {
|
||||
"parent.collection": "Characters",
|
||||
"parent.id": characterId,
|
||||
charId: characterId,
|
||||
enabled: false,
|
||||
}}
|
||||
);
|
||||
},
|
||||
splitToParent: function(parent, moveQuantity){
|
||||
check(parent, {id: String, collection: String});
|
||||
check(moveQuantity, Number);
|
||||
var parentCollection = Meteor.isClient ?
|
||||
window[parent.collection] : global[parent.collection];
|
||||
if (!parent.id || !parentCollection.findOne(parent.id)){
|
||||
throw "Invalid parent";
|
||||
}
|
||||
var oldStack = this;
|
||||
//we can only move as much as we have, leaving 0 behind at worst
|
||||
if (oldStack.quantity < moveQuantity) moveQuantity = oldStack.quantity;
|
||||
var oldQuantity = oldStack.quantity - moveQuantity;
|
||||
|
||||
var newStack = _.pick(oldStack, Schemas.Item.objectKeys());
|
||||
newStack.parent = parent;
|
||||
newStack.quantity = moveQuantity;
|
||||
|
||||
var existingStack = Items.findOne(_.omit(newStack, "quantity"));
|
||||
var updateStackSize = function(){
|
||||
if (oldQuantity > 0){
|
||||
Items.update(oldStack._id, {$set: {quantity: oldQuantity}});
|
||||
} else {
|
||||
Items.remove(oldStack._id);
|
||||
}
|
||||
};
|
||||
if (existingStack){
|
||||
Items.update(
|
||||
existingStack._id,
|
||||
{$inc: {quantity: moveQuantity}},
|
||||
{},
|
||||
function(){
|
||||
updateStackSize();
|
||||
}
|
||||
);
|
||||
} else {
|
||||
Items.insert(newStack, function(err, id){
|
||||
if (err) throw err;
|
||||
updateStackSize();
|
||||
//copy the children also
|
||||
Meteor.call("cloneChildren", oldStack._id, {collection: "Items", id: id});
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Items.before.update(function(userId, doc, fieldNames, modifier, options){
|
||||
@@ -174,6 +228,9 @@ Characters.after.insert(function(userId, char) {
|
||||
id: containerId,
|
||||
collection: "Containers",
|
||||
},
|
||||
settings: {
|
||||
showIncrement: true,
|
||||
},
|
||||
});
|
||||
Items.insert({
|
||||
name: "Silver piece",
|
||||
@@ -187,6 +244,9 @@ Characters.after.insert(function(userId, char) {
|
||||
id: containerId,
|
||||
collection: "Containers",
|
||||
},
|
||||
settings: {
|
||||
showIncrement: true,
|
||||
},
|
||||
});
|
||||
Items.insert({
|
||||
name: "Copper piece",
|
||||
@@ -200,6 +260,9 @@ Characters.after.insert(function(userId, char) {
|
||||
id: containerId,
|
||||
collection: "Containers",
|
||||
},
|
||||
settings: {
|
||||
showIncrement: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
47
rpg-docs/Model/Library/Library.js
Normal file
47
rpg-docs/Model/Library/Library.js
Normal file
@@ -0,0 +1,47 @@
|
||||
Libraries = new Mongo.Collection("library");
|
||||
|
||||
Schemas.Library = new SimpleSchema({
|
||||
name: {type: String},
|
||||
owner: {type: String, regEx: SimpleSchema.RegEx.Id},
|
||||
readers: {type: [String], regEx: SimpleSchema.RegEx.Id, defaultValue: []},
|
||||
writers: {type: [String], regEx: SimpleSchema.RegEx.Id, defaultValue: []},
|
||||
public: {type: Boolean, defaultValue: false},
|
||||
});
|
||||
|
||||
Libraries.attachSchema(Schemas.Library);
|
||||
|
||||
Libraries.allow({
|
||||
insert(userId, doc) {
|
||||
return userId && doc.owner === userId;
|
||||
},
|
||||
update(userId, doc, fields, modifier) {
|
||||
return canEdit(userId, doc);
|
||||
},
|
||||
remove(userId, doc) {
|
||||
return canEdit(userId, doc);
|
||||
},
|
||||
fetch: ["owner", "writers"],
|
||||
});
|
||||
|
||||
Libraries.deny({
|
||||
// For now, only admins can manage libraries
|
||||
insert(userId, doc){
|
||||
var user = Meteor.users.findOne(userId);
|
||||
return !user || !_.contains(user.roles, "admin");
|
||||
},
|
||||
update(userId, doc, fields, modifier) {
|
||||
// Can't change owners
|
||||
return _.contains(fields, "owner")
|
||||
},
|
||||
fetch: [],
|
||||
});
|
||||
|
||||
const canEdit = function(userId, library){
|
||||
if (!userId || !library) return;
|
||||
return library.owner === userId || _.contains(library.writers, userId);
|
||||
};
|
||||
|
||||
Libraries.canEdit = function(userId, libraryId){
|
||||
const library = Libraries.findOne(libraryId);
|
||||
return canEdit(userId, library);
|
||||
};
|
||||
43
rpg-docs/Model/Library/LibraryAttacks.js
Normal file
43
rpg-docs/Model/Library/LibraryAttacks.js
Normal file
@@ -0,0 +1,43 @@
|
||||
Schemas.LibraryAttacks = new SimpleSchema({
|
||||
name: {
|
||||
type: String,
|
||||
defaultValue: "New Attack",
|
||||
trim: false,
|
||||
},
|
||||
details: {
|
||||
type: String,
|
||||
optional: true,
|
||||
trim: false,
|
||||
},
|
||||
attackBonus: {
|
||||
type: String,
|
||||
defaultValue: "strengthMod + proficiencyBonus",
|
||||
optional: true,
|
||||
trim: false,
|
||||
},
|
||||
damage: {
|
||||
type: String,
|
||||
defaultValue: "1d8 + {strengthMod}",
|
||||
optional: true,
|
||||
trim: false,
|
||||
},
|
||||
damageType: {
|
||||
type: String,
|
||||
allowedValues: [
|
||||
"bludgeoning",
|
||||
"piercing",
|
||||
"slashing",
|
||||
"acid",
|
||||
"cold",
|
||||
"fire",
|
||||
"force",
|
||||
"lightning",
|
||||
"necrotic",
|
||||
"poison",
|
||||
"psychic",
|
||||
"radiant",
|
||||
"thunder",
|
||||
],
|
||||
defaultValue: "slashing",
|
||||
},
|
||||
});
|
||||
40
rpg-docs/Model/Library/LibraryEffects.js
Normal file
40
rpg-docs/Model/Library/LibraryEffects.js
Normal file
@@ -0,0 +1,40 @@
|
||||
Schemas.LibraryEffects = new SimpleSchema({
|
||||
name: {
|
||||
type: String,
|
||||
optional: true, //TODO make necessary if there is no owner
|
||||
trim: false,
|
||||
},
|
||||
operation: {
|
||||
type: String,
|
||||
defaultValue: "add",
|
||||
allowedValues: [
|
||||
"base",
|
||||
"proficiency",
|
||||
"add",
|
||||
"mul",
|
||||
"min",
|
||||
"max",
|
||||
"advantage",
|
||||
"disadvantage",
|
||||
"passiveAdd",
|
||||
"fail",
|
||||
"conditional",
|
||||
],
|
||||
},
|
||||
// Effects either have a value OR a calculation
|
||||
value: {
|
||||
type: Number,
|
||||
decimal: true,
|
||||
optional: true,
|
||||
},
|
||||
calculation: {
|
||||
type: String,
|
||||
optional: true,
|
||||
trim: false,
|
||||
},
|
||||
//which stat the effect is applied to
|
||||
stat: {
|
||||
type: String,
|
||||
optional: true,
|
||||
},
|
||||
});
|
||||
43
rpg-docs/Model/Library/LibraryItems.js
Normal file
43
rpg-docs/Model/Library/LibraryItems.js
Normal file
@@ -0,0 +1,43 @@
|
||||
LibraryItems = new Mongo.Collection("libraryItems");
|
||||
|
||||
Schemas.LibraryItems = new SimpleSchema({
|
||||
name: {type: String, defaultValue: "New Item", trim: false},
|
||||
plural: {type: String, optional: true, trim: false},
|
||||
description:{type: String, optional: true, trim: false},
|
||||
quantity: {type: Number, min: 0, defaultValue: 1},
|
||||
weight: {type: Number, min: 0, defaultValue: 0, decimal: true},
|
||||
value: {type: Number, min: 0, defaultValue: 0, decimal: true},
|
||||
requiresAttunement: {type: Boolean, defaultValue: false},
|
||||
|
||||
library: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1},
|
||||
|
||||
"settings.category": {
|
||||
type: String,
|
||||
optional: true,
|
||||
allowedValues: [
|
||||
"adventuringGear", "armor", "weapons", "tools",
|
||||
],
|
||||
},
|
||||
"settings.showIncrement": {
|
||||
type: Boolean,
|
||||
defaultValue: false,
|
||||
},
|
||||
|
||||
effects: {type: [Schemas.LibraryEffects], defaultValue: []},
|
||||
attacks: {type: [Schemas.LibraryAttacks], defaultValue: []},
|
||||
});
|
||||
|
||||
LibraryItems.attachSchema(Schemas.LibraryItems);
|
||||
|
||||
LibraryItems.allow({
|
||||
insert(userId, doc) {
|
||||
return Libraries.canEdit(userId, doc.library);
|
||||
},
|
||||
update(userId, doc, fields, modifier) {
|
||||
return Libraries.canEdit(userId, doc.library);
|
||||
},
|
||||
remove(userId, doc) {
|
||||
return Libraries.canEdit(userId, doc.library);
|
||||
},
|
||||
fetch: ["library"],
|
||||
});
|
||||
66
rpg-docs/Model/Library/LibrarySpells.js
Normal file
66
rpg-docs/Model/Library/LibrarySpells.js
Normal file
@@ -0,0 +1,66 @@
|
||||
LibrarySpells = new Mongo.Collection("librarySpells");
|
||||
|
||||
Schemas.LibrarySpells = new SimpleSchema({
|
||||
name: {
|
||||
type: String,
|
||||
trim: false,
|
||||
defaultValue: "New Spell",
|
||||
},
|
||||
description: {
|
||||
type: String,
|
||||
optional: true,
|
||||
trim: false,
|
||||
},
|
||||
castingTime: {
|
||||
type: String,
|
||||
optional: true,
|
||||
defaultValue: "action",
|
||||
trim: false,
|
||||
},
|
||||
range: {
|
||||
type: String,
|
||||
optional: true,
|
||||
trim: false,
|
||||
},
|
||||
duration: {
|
||||
type: String,
|
||||
optional: true,
|
||||
trim: false,
|
||||
defaultValue: "Instantaneous",
|
||||
},
|
||||
"components.verbal": {type: Boolean, defaultValue: false},
|
||||
"components.somatic": {type: Boolean, defaultValue: false},
|
||||
"components.concentration": {type: Boolean, defaultValue: false},
|
||||
"components.material": {type: String, optional: true},
|
||||
ritual: {
|
||||
type: Boolean,
|
||||
defaultValue: false,
|
||||
},
|
||||
level: {
|
||||
type: Number,
|
||||
defaultValue: 1,
|
||||
},
|
||||
school: {
|
||||
type: String,
|
||||
defaultValue: "Abjuration",
|
||||
allowedValues: magicSchools,
|
||||
},
|
||||
library: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1},
|
||||
effects: {type: [Schemas.LibraryEffects], defaultValue: []},
|
||||
attacks: {type: [Schemas.LibraryAttacks], defaultValue: []},
|
||||
});
|
||||
|
||||
LibrarySpells.attachSchema(Schemas.LibrarySpells);
|
||||
|
||||
LibrarySpells.allow({
|
||||
insert(userId, doc) {
|
||||
return Libraries.canEdit(userId, doc.library);
|
||||
},
|
||||
update(userId, doc, fields, modifier) {
|
||||
return Libraries.canEdit(userId, doc.library);
|
||||
},
|
||||
remove(userId, doc) {
|
||||
return Libraries.canEdit(userId, doc.library);
|
||||
},
|
||||
fetch: ["library"],
|
||||
});
|
||||
27
rpg-docs/Model/Meta/ChangeLogs.js
Normal file
27
rpg-docs/Model/Meta/ChangeLogs.js
Normal file
@@ -0,0 +1,27 @@
|
||||
ChangeLogs = new Mongo.Collection("changeLogs");
|
||||
|
||||
Schemas.ChangeLog = new SimpleSchema({
|
||||
version: {
|
||||
type: String,
|
||||
},
|
||||
changes: {
|
||||
type: [String],
|
||||
},
|
||||
});
|
||||
|
||||
ChangeLogs.attachSchema(Schemas.ChangeLog);
|
||||
|
||||
ChangeLogs.allow({
|
||||
insert: function(userId, doc) {
|
||||
var user = Meteor.users.findOne(userId);
|
||||
if (user) return _.contains(user.roles, "admin");
|
||||
},
|
||||
update: function(userId, doc, fields, modifier) {
|
||||
var user = Meteor.users.findOne(userId);
|
||||
if (user) return _.contains(user.roles, "admin");
|
||||
},
|
||||
remove: function(userId, doc) {
|
||||
var user = Meteor.users.findOne(userId);
|
||||
if (user) return _.contains(user.roles, "admin");
|
||||
},
|
||||
});
|
||||
79
rpg-docs/Model/Meta/Reports.js
Normal file
79
rpg-docs/Model/Meta/Reports.js
Normal file
@@ -0,0 +1,79 @@
|
||||
Reports = new Mongo.Collection("reports");
|
||||
|
||||
Schemas.Report = new SimpleSchema({
|
||||
owner: {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
trim: false,
|
||||
optional: true,
|
||||
},
|
||||
description: {
|
||||
type: String,
|
||||
trim: false,
|
||||
optional: true,
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
allowedValues: ["General Feedback", "Bug", "Suggested Change", "Feature Request"],
|
||||
defaultValue: "General Feedback",
|
||||
},
|
||||
//the immediate impact of doing this action (eg. -1 rages)
|
||||
severity: {
|
||||
type: Number,
|
||||
defaultValue: 5,
|
||||
min: 1,
|
||||
max: 10,
|
||||
},
|
||||
metaData: {
|
||||
type: Object,
|
||||
blackbox: true,
|
||||
},
|
||||
});
|
||||
|
||||
Reports.attachSchema(Schemas.Report);
|
||||
|
||||
Meteor.methods({
|
||||
insertReport: function(report) {
|
||||
check(report, {
|
||||
title: String,
|
||||
description: String,
|
||||
type: String,
|
||||
severity: Number,
|
||||
metaData: Object,
|
||||
});
|
||||
report.owner = this.userId;
|
||||
var id = Reports.insert(report);
|
||||
var user = Meteor.users.findOne(this.userId);
|
||||
var sender = user &&
|
||||
user.emails &&
|
||||
user.emails[0] &&
|
||||
user.emails[0].address ||
|
||||
user.services &&
|
||||
user.services.google &&
|
||||
user.services.google.email ||
|
||||
"reports@dicecloud.com";
|
||||
var bodyText = "Report ID: " + id +
|
||||
"\nSeverity: " + report.severity +
|
||||
"\nType: " + report.type +
|
||||
"\n\n" + report.description;
|
||||
Email.send({
|
||||
from: sender,
|
||||
to: "stefan.zermatten@gmail.com",
|
||||
subject: "DiceCloud feedback - " + report.title,
|
||||
text: bodyText,
|
||||
});
|
||||
},
|
||||
deleteReport: function(id) {
|
||||
var user = Meteor.users.findOne(this.userId);
|
||||
if (!_.contains(user.roles, "admin")){
|
||||
throw new Meteor.Error(
|
||||
"not admin",
|
||||
"The user must be an administrator to delete feedback"
|
||||
);
|
||||
}
|
||||
Reports.remove(id);
|
||||
},
|
||||
});
|
||||
@@ -1,44 +1,23 @@
|
||||
Schema = {};
|
||||
|
||||
Schema.User = new SimpleSchema({
|
||||
username: {
|
||||
type: String,
|
||||
regEx: /^[a-z0-9A-Z_]{3,15}$/,
|
||||
optional: true,
|
||||
},
|
||||
emails: {
|
||||
type: [Object],
|
||||
// this must be optional if you also use other login services like facebook,
|
||||
// but if you use only accounts-password, then it can be required
|
||||
optional: true,
|
||||
},
|
||||
"emails.$.address": {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Email,
|
||||
},
|
||||
"emails.$.verified": {
|
||||
type: Boolean
|
||||
},
|
||||
createdAt: {
|
||||
type: Date
|
||||
},
|
||||
services: {
|
||||
type: Object,
|
||||
optional: true,
|
||||
blackbox: true,
|
||||
},
|
||||
roles: {
|
||||
type: [String],
|
||||
optional: true,
|
||||
},
|
||||
});
|
||||
|
||||
Meteor.users.attachSchema(Schema.User);
|
||||
|
||||
Meteor.users.allow({
|
||||
update: function(userId, doc, fields, modifier) {
|
||||
return userId === doc._id &&
|
||||
fields.length === 1 &&
|
||||
fields[0] === "username";
|
||||
if (
|
||||
doc._id === userId &&
|
||||
_.contains(fields, "username") &&
|
||||
_.contains(fields, "profile") &&
|
||||
fields.length === 2 &&
|
||||
_.keys(modifier).length === 1 &&
|
||||
modifier.$set &&
|
||||
modifier.$set["profile.username"] &&
|
||||
modifier.$set.username &&
|
||||
_.keys(modifier.$set).length === 2
|
||||
){
|
||||
var expectedUsername = modifier.$set["profile.username"];
|
||||
expectedUsername = expectedUsername.toLowerCase().replace(/\s+/gm, "");
|
||||
if (modifier.$set.username !== expectedUsername){
|
||||
return false;
|
||||
}
|
||||
var foundUser = Meteor.call("getUserId", expectedUsername);
|
||||
return !foundUser || foundUser === userId;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,39 +1,64 @@
|
||||
Router.configure({
|
||||
loadingTemplate: "loading",
|
||||
layoutTemplate: "layout",
|
||||
trackPageView: true,
|
||||
});
|
||||
|
||||
Router.plugin("ensureSignedIn", {
|
||||
only: [
|
||||
"profile",
|
||||
"characterList",
|
||||
]
|
||||
});
|
||||
|
||||
Router.plugin("dataNotFound", {notFoundTemplate: "notFound"});
|
||||
|
||||
Router.map(function() {
|
||||
this.route("/", {
|
||||
name: "home",
|
||||
});
|
||||
|
||||
this.route("characterList", {
|
||||
path: "/characterList",
|
||||
waitOn: function(){
|
||||
return Meteor.subscribe("characterList", Meteor.userId());
|
||||
},
|
||||
data: {
|
||||
characters: function(){
|
||||
return Characters.find({}, {fields: {_id: 1}});
|
||||
}
|
||||
},
|
||||
onAfterAction: function() {
|
||||
document.title = appName;
|
||||
},
|
||||
});
|
||||
|
||||
this.route("characterSheet", {
|
||||
path: "/character/:_id",
|
||||
this.route("characterList", {
|
||||
path: "/characterList",
|
||||
waitOn: function(){
|
||||
return subsManager.subscribe("characterList");
|
||||
},
|
||||
onAfterAction: function() {
|
||||
document.title = appName + " - Characters";
|
||||
},
|
||||
fastRender: true,
|
||||
});
|
||||
|
||||
this.route("characterSheetNaked", {
|
||||
path: "/character/:_id/",
|
||||
waitOn: function(){
|
||||
return [
|
||||
Meteor.subscribe("singleCharacter", this.params._id, Meteor.userId()),
|
||||
subsManager.subscribe("singleCharacter", this.params._id),
|
||||
];
|
||||
},
|
||||
action: function(){
|
||||
var _id = this.params._id
|
||||
var character = Characters.findOne(_id);
|
||||
var urlName = character && character.urlName;
|
||||
var path = `\/character\/${_id}\/${urlName}`;
|
||||
Router.go(path,{},{replaceState:true});
|
||||
},
|
||||
});
|
||||
|
||||
this.route("characterSheet", {
|
||||
path: "/character/:_id/:urlName",
|
||||
waitOn: function(){
|
||||
return [
|
||||
subsManager.subscribe("singleCharacter", this.params._id),
|
||||
];
|
||||
},
|
||||
data: function() {
|
||||
var data = Characters.findOne(
|
||||
{_id: this.params._id},
|
||||
{fields: {_id: 1, name: 1, color: 1}}
|
||||
{fields: {_id: 1, name: 1, color: 1, writers: 1, readers: 1}}
|
||||
);
|
||||
return data;
|
||||
},
|
||||
@@ -44,6 +69,24 @@ Router.map(function() {
|
||||
document.title = name;
|
||||
}
|
||||
},
|
||||
//analytics
|
||||
trackPageView: false,
|
||||
onRun: function() {
|
||||
window.ga && window.ga("send", "pageview", "/character");
|
||||
this.next();
|
||||
},
|
||||
fastRender: true,
|
||||
});
|
||||
|
||||
this.route("library", {
|
||||
path: "/library",
|
||||
waitOn: function(){
|
||||
return subsManager.subscribe("standardLibraries");
|
||||
},
|
||||
onAfterAction: function() {
|
||||
document.title = appName + " - Library";
|
||||
},
|
||||
fastRender: true,
|
||||
});
|
||||
|
||||
this.route("loading", {
|
||||
@@ -56,4 +99,29 @@ Router.map(function() {
|
||||
document.title = appName + " Account";
|
||||
},
|
||||
});
|
||||
|
||||
this.route("/changelog", {
|
||||
name: "changeLog",
|
||||
waitOn: function() {
|
||||
return [
|
||||
subsManager.subscribe("changeLog"),
|
||||
]
|
||||
},
|
||||
data: {
|
||||
changeLogs: function() {
|
||||
return ChangeLogs.find({}, {sort: {version: -1}});
|
||||
}
|
||||
},
|
||||
onAfterAction: function() {
|
||||
document.title = appName;
|
||||
},
|
||||
fastRender: true,
|
||||
});
|
||||
|
||||
this.route("/guide", {
|
||||
name: "guide",
|
||||
onAfterAction: function() {
|
||||
document.title = appName;
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
"name": "RPG Docs",
|
||||
"version": "0.0.0",
|
||||
"homepage": "",
|
||||
"authors": ["Stefan Zermatten"],
|
||||
"authors": [
|
||||
"Stefan Zermatten"
|
||||
],
|
||||
"license": "none",
|
||||
"private": true,
|
||||
"ignore": [
|
||||
@@ -13,14 +15,16 @@
|
||||
"tests"
|
||||
],
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#~0.5.4",
|
||||
"core-elements": "Polymer/core-elements#~0.5.4",
|
||||
"paper-elements": "Polymer/paper-elements#~0.5.4",
|
||||
"paper-fab-menu": "cwdoh/paper-fab-menu"
|
||||
"polymer": "Polymer/polymer#^1.0.0",
|
||||
"iron-elements": "PolymerElements/iron-elements#^1.0.0",
|
||||
"platinum-elements": "PolymerElements/platinum-elements#^1.0.1",
|
||||
"neon-elements": "PolymerElements/neon-elements#^1.0.0",
|
||||
"paper-elements": "PolymerElements/paper-elements#^1.0.7",
|
||||
"app-elements": "PolymerElements/app-elements#^0.10.1",
|
||||
"marked-element": "PolymerElements/marked-element#^1.2.0",
|
||||
"paper-swatch-picker": "PolymerElements/paper-swatch-picker#~1.0.2"
|
||||
},
|
||||
"resolutions": {
|
||||
"core-component-page": "^0.5.0",
|
||||
"polymer": "^0.5.0",
|
||||
"webcomponentsjs": "^0.5.0"
|
||||
"webcomponentsjs": "0.7.24"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
this.GlobalUI = (function() {
|
||||
function GlobalUI() {}
|
||||
|
||||
GlobalUI.dialog = {};
|
||||
|
||||
var toast;
|
||||
GlobalUI.toast = function(opts) {
|
||||
var toast;
|
||||
toast = $("[global-toast]")[0];
|
||||
toast.text = opts.text;
|
||||
Session.set("global.ui.toastTemplate", opts.template);
|
||||
Session.set("global.ui.toastData", opts.data);
|
||||
if (!toast) toast = $("#global-toast")[0];
|
||||
if (_.isObject(opts)){
|
||||
toast.text = opts.text;
|
||||
Session.set("global.ui.toastTemplate", opts.template);
|
||||
Session.set("global.ui.toastData", opts.data);
|
||||
} else {
|
||||
toast.text = opts;
|
||||
Session.set("global.ui.toastTemplate");
|
||||
Session.set("global.ui.toastData");
|
||||
}
|
||||
return toast.show();
|
||||
};
|
||||
|
||||
@@ -18,147 +21,18 @@ this.GlobalUI = (function() {
|
||||
template: "undoToast",
|
||||
data: {
|
||||
id: id,
|
||||
collection: collection
|
||||
}
|
||||
collection: collection,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
GlobalUI.setDialog = function(opts) {
|
||||
this.dialog = $("[global-dialog]")[0];
|
||||
Session.set("global.ui.dialogHeader", opts.heading);
|
||||
Session.set("global.ui.dialogData", opts.data);
|
||||
Session.set("global.ui.dialogTemplate", opts.template);
|
||||
Session.set("global.ui.dialogFullOnMobile", opts.fullOnMobile !== null);
|
||||
};
|
||||
|
||||
GlobalUI.showDialog = function(opts) {
|
||||
this.dialog = $("[global-dialog]")[0];
|
||||
Session.set("global.ui.dialogHeader", opts.heading);
|
||||
Session.set("global.ui.dialogData", opts.data);
|
||||
Session.set("global.ui.dialogTemplate", opts.template);
|
||||
Session.set("global.ui.dialogFullOnMobile", opts.fullOnMobile !== null);
|
||||
return Tracker.afterFlush((function(_this) {
|
||||
return function() {
|
||||
return _this.dialog.open();
|
||||
};
|
||||
})(this));
|
||||
};
|
||||
|
||||
GlobalUI.closeDialog = function() {
|
||||
return this.dialog.close();
|
||||
};
|
||||
|
||||
//To show a detail, first animate the click, with raising z-depth
|
||||
//then call this function with a template and data
|
||||
//the element should have a hero-id of detail-main
|
||||
GlobalUI.showDetail = function(opts) {
|
||||
Session.set("global.ui.detailData", opts.data);
|
||||
Session.set("global.ui.detailTemplate", opts.template);
|
||||
Session.set("global.ui.detailHeroId", opts.heroId);
|
||||
Session.set("global.ui.detailShow", true);
|
||||
};
|
||||
|
||||
//if setting the detail rather than showing it,
|
||||
//the template should contain the following in template.rendered
|
||||
//
|
||||
//if (!this.alreadyRendered){
|
||||
// Session.set("global.ui.detailShow", true);
|
||||
// this.alreadyRendered = true;
|
||||
//}
|
||||
GlobalUI.setDetail = function(opts) {
|
||||
Session.set("global.ui.detailData", opts.data);
|
||||
Session.set("global.ui.detailTemplate", opts.template);
|
||||
Session.set("global.ui.detailHeroId", opts.heroId);
|
||||
if (window.history && window.history.pushState) {
|
||||
history.replaceState({detail: "closed", opts: opts}, "Detail Dialog");
|
||||
history.pushState({detail: "opened", opts: opts}, "Detail Dialog");
|
||||
}
|
||||
};
|
||||
|
||||
var throttleBack = _.throttle(function() {
|
||||
history.back();
|
||||
}, 800, {trailing: false});
|
||||
|
||||
GlobalUI.closeDetail = function() {
|
||||
if (!!(window.history && window.history.pushState)) {
|
||||
throttleBack();
|
||||
} else {
|
||||
Session.set("global.ui.detailShow", false);
|
||||
}
|
||||
};
|
||||
|
||||
GlobalUI.popStateHandler = function(e) {
|
||||
var state = e.originalEvent.state;
|
||||
if (state) {
|
||||
if (state.detail === "closed") {
|
||||
Session.set("global.ui.detailShow", false);
|
||||
} else if (state.detail === "opened") {
|
||||
var opts = state.opts;
|
||||
Session.set("global.ui.detailData", opts.data);
|
||||
Session.set("global.ui.detailTemplate", opts.template);
|
||||
Session.set("global.ui.detailHeroId", opts.heroId);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return GlobalUI;
|
||||
|
||||
})();
|
||||
|
||||
Template.layout.helpers({
|
||||
globalDialogTemplate: function() {
|
||||
return Session.get("global.ui.dialogTemplate");
|
||||
},
|
||||
globalDialogData: function() {
|
||||
return Session.get("global.ui.dialogData");
|
||||
},
|
||||
globalDialogFullOnMobile: function() {
|
||||
return Session.get("global.ui.dialogFullOnMobile");
|
||||
},
|
||||
globalDialogHeader: function() {
|
||||
return Session.get("global.ui.dialogHeader");
|
||||
},
|
||||
globalDetailSelected: function() {
|
||||
return Session.get("global.ui.detailShow") ? 1 : 0;
|
||||
},
|
||||
globalDetailTemplate: function() {
|
||||
return Session.get("global.ui.detailTemplate");
|
||||
},
|
||||
globalDetailData: function() {
|
||||
return Session.get("global.ui.detailData");
|
||||
},
|
||||
globalToastTemplate: function() {
|
||||
return Session.get("global.ui.toastTemplate");
|
||||
},
|
||||
globalToastData: function() {
|
||||
return Session.get("global.ui.toastData");
|
||||
}
|
||||
});
|
||||
|
||||
Template.layout.events({
|
||||
"core-overlay-close-completed [global-dialog]": function(e) {
|
||||
Session.set("global.ui.dialogTemplate", null);
|
||||
Session.set("global.ui.dialogData", null);
|
||||
return Session.set("global.ui.dialogFullOnMobile", null);
|
||||
},
|
||||
"core-animated-pages-transition-end [detail-pages]": function(e) {
|
||||
var detailOpened = Session.get("global.ui.detailShow");
|
||||
if (!detailOpened) {
|
||||
Session.set("global.ui.detailData", null);
|
||||
Session.set("global.ui.detailTemplate", null);
|
||||
Session.set("global.ui.detailHeroId", null);
|
||||
}
|
||||
},
|
||||
"core-animated-pages-transition-prepare": function(e) {
|
||||
var detailOpened = Session.get("global.ui.detailShow");
|
||||
if (detailOpened) {
|
||||
//set up the transition
|
||||
} else {
|
||||
//undo hack
|
||||
$("#mainContentSection").removeClass("fake-selected");
|
||||
}
|
||||
},
|
||||
"tap #screenDim": function(e) {
|
||||
GlobalUI.closeDetail();
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
10
rpg-docs/client/globalHelpers/canEditCharacter.js
Normal file
10
rpg-docs/client/globalHelpers/canEditCharacter.js
Normal file
@@ -0,0 +1,10 @@
|
||||
Template.registerHelper("canEditCharacter", function(charId) {
|
||||
return canEditCharacter(charId);
|
||||
});
|
||||
|
||||
canEditCharacter = function(charId) {
|
||||
var char = Characters.findOne(charId)
|
||||
var userId = Meteor.userId();
|
||||
return char.owner === userId ||
|
||||
_.contains(char.writers, userId);
|
||||
};
|
||||
@@ -23,3 +23,15 @@ Template.registerHelper("evaluateSignedSpaced", function(charId, string) {
|
||||
Template.registerHelper("evaluateString", function(charId, string) {
|
||||
return evaluateString(charId, string);
|
||||
});
|
||||
|
||||
Template.registerHelper("evaluateSpellString", function(charId, spellListId, string) {
|
||||
return evaluateSpellString(charId, spellListId, string);
|
||||
});
|
||||
|
||||
Template.registerHelper("evaluateShortString", function(charId, string) {
|
||||
if (_.isString(string)){
|
||||
return evaluateString(
|
||||
charId, string.split(/^( *[-*_]){3,} *(?:\n+|$)/m)[0]
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,27 +1,23 @@
|
||||
openParentDialog = function(parent, charId, heroId) {
|
||||
var detail;
|
||||
openParentDialog = function({
|
||||
parent, charId, element, returnElement, callback,
|
||||
}) {
|
||||
let template;
|
||||
let data;
|
||||
if (parent.collection === "Characters" && parent.group === "racial") {
|
||||
detail = {
|
||||
template: "raceDialog",
|
||||
data: {charId: parent.id},
|
||||
};
|
||||
template = "raceDialog";
|
||||
data = {charId: parent.id};
|
||||
} else if (parent.collection === "Features") {
|
||||
detail = {
|
||||
template: "featureDialog",
|
||||
data: {featureId: parent.id},
|
||||
};
|
||||
template = "featureDialog";
|
||||
data = {featureId: parent.id};
|
||||
} else if (parent.collection === "Classes") {
|
||||
detail = {
|
||||
template: "classDialog",
|
||||
data: {classId: parent.id},
|
||||
};
|
||||
template = "classDialog";
|
||||
data = {classId: parent.id};
|
||||
} else if (parent.collection === "Items") {
|
||||
detail = {
|
||||
template: "itemDialog",
|
||||
data: {itemId: parent.id},
|
||||
};
|
||||
template = "itemDialog";
|
||||
data = {itemId: parent.id};
|
||||
} else if (parent.collection === "Spells") {
|
||||
template = "spellDialog";
|
||||
data = {spellId: parent.id};
|
||||
}
|
||||
detail.heroId = heroId;
|
||||
detail.charId = charId;
|
||||
GlobalUI.setDetail(detail);
|
||||
pushDialogStack({template, data, element, returnElement, callback});
|
||||
};
|
||||
|
||||
@@ -1,25 +1,27 @@
|
||||
Template.registerHelper("valueString", function(value) {
|
||||
var intValue = Math.round(value * 100);
|
||||
var cp = intValue % 10;
|
||||
intValue -= cp;
|
||||
cp = Math.round(cp);
|
||||
sp = intValue % 100;
|
||||
intValue -= sp;
|
||||
sp = Math.round(sp / 10)
|
||||
gp = Math.floor(value);
|
||||
|
||||
var resultArray = [];
|
||||
//sp
|
||||
var gp = Math.floor(value);
|
||||
if (gp > 0) {
|
||||
resultArray.push(gp + "gp");
|
||||
resultArray.push(gp + " gp");
|
||||
}
|
||||
//sp
|
||||
var sp = Math.floor(10 * (value % 1));
|
||||
if (sp > 0) {
|
||||
resultArray.push(sp + "sp");
|
||||
resultArray.push(sp + " sp");
|
||||
}
|
||||
//cp
|
||||
var cp = 10 * ((value * 10) % 1);
|
||||
cp = Math.round(cp * 1000) / 1000;
|
||||
if (cp > 0) {
|
||||
resultArray.push(cp + "cp");
|
||||
resultArray.push(cp + " cp");
|
||||
}
|
||||
|
||||
//build string with correct spacing
|
||||
var result = "";
|
||||
for (var i = 0; i < resultArray.length; i++) {
|
||||
for (var i = 0, l = resultArray.length; i < l; i++) {
|
||||
//add a space between values
|
||||
if (i !== 0) {
|
||||
result += " ";
|
||||
@@ -34,18 +36,18 @@ Template.registerHelper("longValueString", function(value) {
|
||||
//sp
|
||||
var gp = Math.floor(value);
|
||||
if (gp > 0) {
|
||||
resultArray.push(gp + "gp");
|
||||
resultArray.push(gp + " gp");
|
||||
}
|
||||
//sp
|
||||
var sp = Math.floor(10 * (value % 1));
|
||||
if (sp > 0 || resultArray.length) {
|
||||
resultArray.push(sp + "sp");
|
||||
resultArray.push(sp + " sp");
|
||||
}
|
||||
//cp
|
||||
var cp = 10 * ((value * 10) % 1);
|
||||
cp = Math.round(cp * 1000) / 1000;
|
||||
if (cp > 0 || resultArray.length) {
|
||||
resultArray.push(cp + "cp");
|
||||
resultArray.push(cp + " cp");
|
||||
}
|
||||
|
||||
//build string with correct spacing
|
||||
|
||||
24
rpg-docs/client/lib/bindProperty.js
Normal file
24
rpg-docs/client/lib/bindProperty.js
Normal file
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Take in a map like this:
|
||||
* {
|
||||
* "#someId": {
|
||||
* proprty1() { return someReactiveValue()}
|
||||
* }
|
||||
* }
|
||||
* and bind the properties to the DOM on autorun.
|
||||
*
|
||||
* Useful for polymer components where you need to set the order of property updating
|
||||
* or alter properties that don't bind well to their attributes
|
||||
*/
|
||||
Blaze.Template.prototype.binding = function(bindingMap){
|
||||
this.onRendered(function(){
|
||||
_.each(bindingMap, (propertyMap, cssPattern) => {
|
||||
node = this.find(cssPattern);
|
||||
_.each(propertyMap, (func, property) => {
|
||||
this.autorun(() => {
|
||||
node[property] = func && func.call && func.call(this, node);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
195
rpg-docs/client/lib/improvedInitiativeJson.js
Normal file
195
rpg-docs/client/lib/improvedInitiativeJson.js
Normal file
@@ -0,0 +1,195 @@
|
||||
improvedInitiativeJson = function(charId, options){
|
||||
options = options || {
|
||||
features: true,
|
||||
attacks: true,
|
||||
description: true,
|
||||
};
|
||||
var char = Characters.findOne(charId);
|
||||
if (!char) return;
|
||||
var baseValue = function(attributeName){
|
||||
return Characters.calculate.attributeBase(charId, attributeName);
|
||||
};
|
||||
var skillMod = function(skillName){
|
||||
return Characters.calculate.skillMod(charId, skillName);
|
||||
};
|
||||
var damageMods = getDamageMods(charId);
|
||||
return JSON.stringify({
|
||||
"Id": char._id,
|
||||
"Name": char.name,
|
||||
"Source": "DiceCloud",
|
||||
"Type": char.race,
|
||||
"HP": {
|
||||
"Value": baseValue("hitPoints"),
|
||||
"Notes": getHitDiceString(charId) || "",
|
||||
},
|
||||
"AC": {
|
||||
"Value": baseValue("armor"),
|
||||
"Notes": getArmorString(charId) || "",
|
||||
},
|
||||
"InitiativeModifier": skillMod("initiative"),
|
||||
"Speed": ["" + baseValue("speed")],
|
||||
"Abilities": {
|
||||
"Str": baseValue("strength"),
|
||||
"Dex": baseValue("dexterity"),
|
||||
"Con": baseValue("constitution"),
|
||||
"Cha": baseValue("charisma"),
|
||||
"Int": baseValue("intelligence"),
|
||||
"Wis": baseValue("wisdom"),
|
||||
},
|
||||
"DamageVulnerabilities": damageMods.vulnerabilities,
|
||||
"DamageResistances": damageMods.resistances,
|
||||
"DamageImmunities": damageMods.immunities,
|
||||
"ConditionImmunities": [],
|
||||
"Saves": [
|
||||
{"Name": "Str", "Modifier": skillMod("strengthSave")},
|
||||
{"Name": "Dex", "Modifier": skillMod("dexteritySave")},
|
||||
{"Name": "Con", "Modifier": skillMod("constitutionSave")},
|
||||
{"Name": "Int", "Modifier": skillMod("intelligenceSave")},
|
||||
{"Name": "Wis", "Modifier": skillMod("wisdomSave")},
|
||||
{"Name": "Cha", "Modifier": skillMod("charismaSave")},
|
||||
],
|
||||
"Skills": getSkills(charId),
|
||||
"Senses": [
|
||||
"passive Perception " +
|
||||
Characters.calculate.passiveSkill(charId, "perception")
|
||||
],
|
||||
"Languages": getLanguages(charId),
|
||||
"Challenge": "",
|
||||
"Traits": options.features ? getTraits(charId) : [],
|
||||
"Actions": options.attacks ? getActions(charId) : [],
|
||||
"Reactions": [],
|
||||
"LegendaryActions": [],
|
||||
"Description": options.description ? char.description : "",
|
||||
"Player": Meteor.user().username,
|
||||
}, null, 2);
|
||||
}
|
||||
|
||||
var getHitDiceString = function(charId){
|
||||
var d6 = Characters.calculate.attributeBase(charId, "d6HitDice");
|
||||
var d8 = Characters.calculate.attributeBase(charId, "d8HitDice");
|
||||
var d10 = Characters.calculate.attributeBase(charId, "d10HitDice");
|
||||
var d12 = Characters.calculate.attributeBase(charId, "d12HitDice");
|
||||
var con = Characters.calculate.abilityMod(charId,"constitution");
|
||||
var string = "" +
|
||||
(d6 ? `${d6}d6 + ` : "") +
|
||||
(d8 ? `${d8}d8 + ` : "") +
|
||||
(d10 ? `${d10}d10 + ` : "") +
|
||||
(d12 ? `${d12}d12 + ` : "") +
|
||||
con;
|
||||
}
|
||||
|
||||
var getArmorString = function(charId){
|
||||
var bases = Effects.find({
|
||||
charId: charId,
|
||||
stat: "armor",
|
||||
operation: "base",
|
||||
enabled: true,
|
||||
}).map(e => ({
|
||||
ame: e.name,
|
||||
value: evaluateEffect(charId, e),
|
||||
}));
|
||||
var base = bases.length && _.max(bases, b => b.value).name || "";
|
||||
var effects = Effects.find({
|
||||
charId: charId,
|
||||
stat: "armor",
|
||||
operation: {$ne: "base"},
|
||||
enabled: true,
|
||||
}).map(e => e.name);
|
||||
var strings = base ? [base] : [];
|
||||
strings = strings.concat(effects);
|
||||
return strings.join(", ");
|
||||
}
|
||||
|
||||
var getDamageMods = function(charId){
|
||||
// jscs:disable maximumLineLength
|
||||
var multipliers = [
|
||||
{name: "Acid", value: Characters.calculate.attributeValue(charId, "acidMultiplier")},
|
||||
{name: "Bludgeoning", value: Characters.calculate.attributeValue(charId, "bludgeoningMultiplier")},
|
||||
{name: "Cold", value: Characters.calculate.attributeValue(charId, "coldMultiplier")},
|
||||
{name: "Fire", value: Characters.calculate.attributeValue(charId, "fireMultiplier")},
|
||||
{name: "Force", value: Characters.calculate.attributeValue(charId, "forceMultiplier")},
|
||||
{name: "Lightning", value: Characters.calculate.attributeValue(charId, "lightningMultiplier")},
|
||||
{name: "Necrotic", value: Characters.calculate.attributeValue(charId, "necroticMultiplier")},
|
||||
{name: "Piercing", value: Characters.calculate.attributeValue(charId, "piercingMultiplier")},
|
||||
{name: "Poison", value: Characters.calculate.attributeValue(charId, "poisonMultiplier")},
|
||||
{name: "Psychic", value: Characters.calculate.attributeValue(charId, "psychicMultiplier")},
|
||||
{name: "Radiant", value: Characters.calculate.attributeValue(charId, "radiantMultiplier")},
|
||||
{name: "Slashing", value: Characters.calculate.attributeValue(charId, "slashingMultiplier")},
|
||||
{name: "Thunder", value: Characters.calculate.attributeValue(charId, "thunderMultiplier")},
|
||||
];
|
||||
// jscs:enable maximumLineLength
|
||||
multipliers = _.groupBy(multipliers, "value");
|
||||
var names = o => o.name;
|
||||
return {
|
||||
"immunities": _.map(multipliers["0"], names),
|
||||
"resistances": _.map(multipliers["0.5"], names),
|
||||
"vulnerabilities": _.map(multipliers["2"], names),
|
||||
};
|
||||
}
|
||||
|
||||
var getSkills = function(charId){
|
||||
var allSkills = [
|
||||
{name: "acrobatics", attribute: "dexterity"},
|
||||
{name: "animalHandling", attribute: "wisdom"},
|
||||
{name: "arcana", attribute: "intelligence"},
|
||||
{name: "athletics", attribute: "strength"},
|
||||
{name: "deception", attribute: "charisma"},
|
||||
{name: "history", attribute: "intelligence"},
|
||||
{name: "insight", attribute: "wisdom"},
|
||||
{name: "intimidation", attribute: "charisma"},
|
||||
{name: "investigation", attribute: "intelligence"},
|
||||
{name: "medicine", attribute: "wisdom"},
|
||||
{name: "nature", attribute: "intelligence"},
|
||||
{name: "perception", attribute: "wisdom"},
|
||||
{name: "performance", attribute: "charisma"},
|
||||
{name: "persuasion", attribute: "charisma"},
|
||||
{name: "religion", attribute: "intelligence"},
|
||||
{name: "sleightOfHand", attribute: "dexterity"},
|
||||
{name: "stealth", attribute: "dexterity"},
|
||||
{name: "survival", attribute: "wisdom"},
|
||||
];
|
||||
var skills = [];
|
||||
_.each(allSkills, skill => {
|
||||
var value = Characters.calculate.skillMod(charId, skill.name);
|
||||
var mod = Characters.calculate.abilityMod(charId, skill.attribute);
|
||||
if (value !== mod){
|
||||
skills.push({Name: skill.name, Modifier: value});
|
||||
}
|
||||
});
|
||||
return skills;
|
||||
};
|
||||
|
||||
var getLanguages = function(charId){
|
||||
return Proficiencies.find({
|
||||
charId,
|
||||
enabled: true,
|
||||
type: "language",
|
||||
}).map(l => l.name);
|
||||
};
|
||||
|
||||
var getTraits = function(charId){
|
||||
return Features.find(
|
||||
{charId: charId},
|
||||
{sort: {color: 1, name: 1}}
|
||||
).map(f => ({
|
||||
Name: f.name,
|
||||
// evaluateShortString helper
|
||||
Content: evaluateString(
|
||||
charId, f.description && f.description.split(/^( *[-*_]){3,} *(?:\n+|$)/m)[0]
|
||||
) || "",
|
||||
Usage: "",
|
||||
}));
|
||||
}
|
||||
|
||||
var getActions = function(charId){
|
||||
return Attacks.find(
|
||||
{charId, enabled: true},
|
||||
{sort: {color: 1, name: 1}}
|
||||
).map(a => ({
|
||||
Name: a.name,
|
||||
Content: `+${evaluate(charId, a.attackBonus)} to hit, ` +
|
||||
`${evaluateString(charId, a.damage)} ${a.damageType} damage, ` +
|
||||
`${a.details}`,
|
||||
Usage: "",
|
||||
}));
|
||||
}
|
||||
28
rpg-docs/client/lib/requestAnimationFramePolyfill.js
Normal file
28
rpg-docs/client/lib/requestAnimationFramePolyfill.js
Normal file
@@ -0,0 +1,28 @@
|
||||
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
|
||||
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
|
||||
|
||||
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
|
||||
|
||||
// MIT license
|
||||
var lastTime = 0;
|
||||
var vendors = ["ms", "moz", "webkit", "o"];
|
||||
for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
|
||||
window.requestAnimationFrame = window[vendors[x] + "RequestAnimationFrame"];
|
||||
window.cancelAnimationFrame = window[vendors[x] + "CancelAnimationFrame"] ||
|
||||
window[vendors[x] + "CancelRequestAnimationFrame"];
|
||||
}
|
||||
|
||||
if (!window.requestAnimationFrame)
|
||||
window.requestAnimationFrame = function(callback, element) {
|
||||
var currTime = new Date().getTime();
|
||||
var timeToCall = Math.max(0, 16 - (currTime - lastTime));
|
||||
var id = window.setTimeout(function() { callback(currTime + timeToCall); },
|
||||
timeToCall);
|
||||
lastTime = currTime + timeToCall;
|
||||
return id;
|
||||
};
|
||||
|
||||
if (!window.cancelAnimationFrame)
|
||||
window.cancelAnimationFrame = function(id) {
|
||||
clearTimeout(id);
|
||||
};
|
||||
87
rpg-docs/client/style/cards.css
Normal file
87
rpg-docs/client/style/cards.css
Normal file
@@ -0,0 +1,87 @@
|
||||
/*Column layout*/
|
||||
.column-container {
|
||||
column-fill: balance;
|
||||
column-gap: 0px;
|
||||
column-width: 304px;
|
||||
padding: 4px;
|
||||
transform: translateZ(0);
|
||||
}
|
||||
|
||||
.column-container.thin-columns {
|
||||
column-count: 4;
|
||||
column-width: 240px;
|
||||
}
|
||||
|
||||
.column-container > div {
|
||||
padding: 4px;
|
||||
-webkit-column-break-inside: avoid;
|
||||
page-break-inside: avoid;
|
||||
break-inside: avoid;
|
||||
}
|
||||
|
||||
/*Cards*/
|
||||
.card {
|
||||
background: white;
|
||||
border-radius: 2px;
|
||||
position: initial;
|
||||
}
|
||||
|
||||
.card .top {
|
||||
cursor: pointer;
|
||||
padding: 16px;
|
||||
border-radius: 2px 2px 0 0;
|
||||
}
|
||||
|
||||
.card .top.white {
|
||||
cursor: auto;
|
||||
padding: 16px;
|
||||
border-bottom: rgba(0,0,0,0.12) solid 1px;
|
||||
}
|
||||
|
||||
.card .bottom {
|
||||
padding: 16px;
|
||||
border-radius: 0 0 2px 2px;
|
||||
}
|
||||
|
||||
.card .bottom.list {
|
||||
padding: 16px 0;
|
||||
}
|
||||
|
||||
.card .bottom.list .paper-font-subhead {
|
||||
color: rgba(0,0,0,0.54);
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
letter-spacing: 0.010em;
|
||||
padding: 12px 16px 12px 16px;
|
||||
}
|
||||
|
||||
.card .bottom.text {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.card .left {
|
||||
padding: 16px;
|
||||
border-radius: 2px 0 0 2px;
|
||||
text-align: center;
|
||||
min-width: 72px;
|
||||
}
|
||||
|
||||
.card .right {
|
||||
padding: 16px;
|
||||
border-radius: 0 2px 2px 0;
|
||||
}
|
||||
|
||||
.card .left paper-icon-button {
|
||||
display: block;
|
||||
height: 32px;
|
||||
padding: 0;
|
||||
width: 32px;
|
||||
}
|
||||
|
||||
.card .left paper-icon-button[disabled] {
|
||||
color: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.card img, .card iron-image {
|
||||
max-width: 100%;
|
||||
}
|
||||
@@ -74,10 +74,14 @@
|
||||
background-color: #607D8B;
|
||||
}
|
||||
|
||||
.app-grey {
|
||||
background-color: #424242;
|
||||
}
|
||||
|
||||
.white {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.black {
|
||||
background-color: #262626;
|
||||
}
|
||||
}
|
||||
43
rpg-docs/client/style/listItem.css
Normal file
43
rpg-docs/client/style/listItem.css
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
List items
|
||||
*/
|
||||
.item-slot {
|
||||
background-color: rgb(232, 232, 232);
|
||||
background-color: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.item {
|
||||
background: white;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
height: 40px;
|
||||
margin: 1px 0 1px 0;
|
||||
padding: 0 16px 0 16px;
|
||||
position: relative;
|
||||
transition: box-shadow 0.3s ease, opacity 0.5s ease-in-out;
|
||||
}
|
||||
|
||||
.item > .itemName {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.item.small {
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
.item.tall {
|
||||
height: 56px;
|
||||
}
|
||||
|
||||
.item.flexible {
|
||||
height: auto;
|
||||
padding-top: 16px;
|
||||
padding-bottom: 16px;
|
||||
}
|
||||
|
||||
.item iron-icon, .item paper-icon-button {
|
||||
color: #747474;
|
||||
color: rgba(0,0,0,0.54);
|
||||
}
|
||||
115
rpg-docs/client/style/main.css
Normal file
115
rpg-docs/client/style/main.css
Normal file
@@ -0,0 +1,115 @@
|
||||
/*apply a natural box layout model to all elements*/
|
||||
*, *:before, *:after {
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
root {
|
||||
display: block;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial;
|
||||
margin: 0;
|
||||
overflow-x: hidden;
|
||||
background-color: #E0E0E0;
|
||||
}
|
||||
|
||||
/*Paragraphs*/
|
||||
p {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
//Horizontal rule
|
||||
hr {
|
||||
background-color: #444;
|
||||
opacity: 0.12;
|
||||
border-width: 0;
|
||||
color: #444;
|
||||
height: 1px;
|
||||
line-height: 0;
|
||||
margin: 16px 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
display: inline-block;
|
||||
box-sizing: border-box;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 50%;
|
||||
font-size: 26px;
|
||||
font-color: rgba(255, 255, 255, 0.58) !important;
|
||||
}
|
||||
|
||||
/*
|
||||
temporary fix for https://github.com/PolymerElements/paper-item/issues/71
|
||||
*/
|
||||
paper-icon-item::shadow #contentIcon {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/*FABs*/
|
||||
.floatyButton {
|
||||
position: fixed;
|
||||
bottom: 24px;
|
||||
right: 24px;
|
||||
/* stop the fab from flashing during animation */
|
||||
transform: scale(1) translateZ(0px);
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
paper-fab {
|
||||
background-color: #d13b2e;
|
||||
}
|
||||
|
||||
paper-fab.keyboard-focus {
|
||||
background: #630c05;
|
||||
}
|
||||
|
||||
.red-button:not([disabled]) {
|
||||
background: #d23f31;
|
||||
color: #fff;
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
/*Buttons*/
|
||||
paper-button {
|
||||
color: #000;
|
||||
color: rgba(0,0,0,0.87);
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
letter-spacing: 0.010;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
dicecloud-selector paper-item {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/*Style shortcuts*/
|
||||
.scroll-y {
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.clickable, core-item, paper-tab {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.pre-wrap, .prewrap{
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.padded {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.fullwidth {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.fab-buffer {
|
||||
height: 100px;
|
||||
}
|
||||
15
rpg-docs/client/style/tables.css
Normal file
15
rpg-docs/client/style/tables.css
Normal file
@@ -0,0 +1,15 @@
|
||||
td {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.strengthTable{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.strengthTable td:nth-child(2){
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.summaryTable td:nth-child(3){
|
||||
text-align: right;
|
||||
}
|
||||
@@ -1,268 +0,0 @@
|
||||
root {
|
||||
display: block;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial;
|
||||
margin: 0;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
body.core-narrow {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
body /deep/ core-menu {
|
||||
overflow-x: hidden !important;
|
||||
}
|
||||
|
||||
.calculatedValue {
|
||||
color: #021C33;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
td {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
table {
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
.summaryTable td{
|
||||
text-align: right;
|
||||
padding: 4px;
|
||||
min-width: 80px;
|
||||
}
|
||||
|
||||
.summaryTable td:first-child {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
hr {
|
||||
background-color: #444;
|
||||
opacity: 0.12;
|
||||
border-width: 0;
|
||||
color: #444;
|
||||
height: 1px;
|
||||
line-height: 0;
|
||||
margin: 0 -16px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
paper-button {
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
text-transform: uppercase;
|
||||
color: #000;
|
||||
color: rgba(0,0,0,0.87);
|
||||
letter-spacing: 0.010;
|
||||
}
|
||||
|
||||
core-item {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.listRow {
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
.card {
|
||||
margin-bottom: 8px;
|
||||
/*hack to stop flickering*/
|
||||
-webkit-backface-visibility: hidden;
|
||||
-webkit-transform: translateX(0);
|
||||
/*stop divs breaking over divide*/
|
||||
-webkit-column-break-inside: avoid;
|
||||
page-break-inside: avoid;
|
||||
break-inside: avoid;
|
||||
/*Fixes extra margin at top of columns*/
|
||||
display: inline-block;
|
||||
|
||||
width: 100%;
|
||||
|
||||
font-size: 14px;
|
||||
border-radius: 2px;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.card.double {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.card paper-button {
|
||||
font-size: 14px;
|
||||
letter-spacing: 0.01em;
|
||||
}
|
||||
|
||||
.cardHeader {
|
||||
height: 48px;
|
||||
padding: 0 16px 0 16px;
|
||||
align-content: center;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: rgba(0, 0, 0, 0.54);
|
||||
}
|
||||
|
||||
.clickable, .statCard, .abilityMiniCard {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.skillRow {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.resourceCards {
|
||||
padding: 4px 4px 0 4px;
|
||||
margin-bottom: -4px;
|
||||
}
|
||||
|
||||
.resourceCards .card {
|
||||
width: 180px;
|
||||
margin: 4px;
|
||||
flex-grow: 1;
|
||||
flex-shrink: 1;
|
||||
}
|
||||
|
||||
.grey-background, body {
|
||||
background-color: #E0E0E0;
|
||||
}
|
||||
|
||||
.center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.screen-center {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
-webkit-transform: translate(-50%, -50%);
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
.scroll-y {
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.fab-buffer {
|
||||
height: 88px;
|
||||
width: 100%;
|
||||
order: 999;
|
||||
}
|
||||
|
||||
*[hidden] {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.hidden{
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
html /deep/ paper-action-dialog[global-dialog] {
|
||||
top: 0 !important;
|
||||
left: 0 !important;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.floatyButton {
|
||||
position: absolute;
|
||||
bottom: 24px;
|
||||
right: 24px;
|
||||
}
|
||||
|
||||
.wideTable td {
|
||||
padding: 4px 8px 4px 8px;
|
||||
}
|
||||
|
||||
.wideTable table {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
paper-fab-menu /deep/ .container {
|
||||
padding: 24px !important;
|
||||
}
|
||||
|
||||
paper-slider {
|
||||
margin-left: -8px;
|
||||
}
|
||||
|
||||
.list-subhead {
|
||||
color: rgba(0,0,0,0.54);
|
||||
font-size: 14px;
|
||||
height: 40px;
|
||||
padding-left: 16px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.whiteTop {
|
||||
cursor: initial;
|
||||
border-bottom: black solid 0.5px;
|
||||
border-bottom: rgba(0,0,0,0.12) solid 1px;
|
||||
background: white;
|
||||
padding: 16px;
|
||||
position: relative;
|
||||
border-radius: 2px 2px 0 0;
|
||||
}
|
||||
|
||||
.whiteTop paper-icon-button {
|
||||
margin: -8px;
|
||||
}
|
||||
|
||||
.fullwidth {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.padded {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.listPadded {
|
||||
padding: 0 0 16px 0;
|
||||
}
|
||||
|
||||
.rightPadded {
|
||||
padding-right: 16px;
|
||||
}
|
||||
|
||||
.bottomPadded {
|
||||
padding-bottom: 16px;
|
||||
}
|
||||
|
||||
.sideMargin {
|
||||
margin-left: 16px;
|
||||
margin-right: 16px;
|
||||
}
|
||||
|
||||
.vertMargin {
|
||||
margin-top: 16px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.spaceAfter {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.s {
|
||||
padding: 0 0 16px 0;
|
||||
}
|
||||
|
||||
.leftRound{
|
||||
border-radius: 2px 0 0 2px;
|
||||
}
|
||||
|
||||
.preline {
|
||||
white-space: pre-line;
|
||||
}
|
||||
|
||||
.prewrap{
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
#detailScreenFiller {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 2;
|
||||
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#screenDim {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background-color: grey;
|
||||
background-color: rgba(0,0,0,0.35);
|
||||
}
|
||||
|
||||
#fadeDummy {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.detailContent {
|
||||
padding: 24px;
|
||||
}
|
||||
|
||||
html /deep/ .red-button:not([disabled]) {
|
||||
background: #d23f31;
|
||||
color: #fff;
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
#globalDetail {
|
||||
background-color: white;
|
||||
width: 624px;
|
||||
height: 500px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
#globalDetail core-toolbar {
|
||||
border-radius: 2px 2px 0 0;
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
#globalDetail core-toolbar {
|
||||
border-radius: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
#globalDetail {
|
||||
top: 0 !important;
|
||||
left: 0 !important;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.not-selected [hero] {
|
||||
visibility: hidden;
|
||||
}
|
||||
@@ -1,113 +1,68 @@
|
||||
.display2 {
|
||||
font-size: 45px;
|
||||
font-weight: 400;
|
||||
color: #000;
|
||||
color: rgba(0,0,0,0.54);
|
||||
letter-spacing: 0;
|
||||
body .paper-font-display4, body .paper-font-display3, body .paper-font-title, body .paper-font-caption{
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.white-text .display2{
|
||||
.white-text {
|
||||
color: #dedede;
|
||||
color: rgba(255,255,255,0.87);
|
||||
}
|
||||
|
||||
.white-text .paper-font-display2{
|
||||
color: #8a8a8a;
|
||||
color: rgba(255,255,255,0.54);
|
||||
}
|
||||
|
||||
.display1 {
|
||||
font-size: 34px;
|
||||
font-weight: 400;
|
||||
color: #000;
|
||||
color: rgba(0,0,0,0.54);
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
.white-text .display1{
|
||||
.white-text .paper-font-display1, .white-text.paper-font-display1{
|
||||
color: #8a8a8a;
|
||||
color: rgba(255,255,255,0.54);
|
||||
}
|
||||
|
||||
h1, .headline {
|
||||
font-size: 24px;
|
||||
font-weight: 400;
|
||||
margin: 0;
|
||||
color: #000;
|
||||
color: rgba(0,0,0,0.87);
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
.white-text h1, .white-text .headline, .white-text.headline{
|
||||
.white-text h1, .white-text .paper-font-headline, .white-text.paper-font-headline{
|
||||
color: #dedede;
|
||||
color: rgba(255,255,255,0.87);
|
||||
}
|
||||
|
||||
h2, .title {
|
||||
font-size: 20px;
|
||||
font-weight: 500;
|
||||
margin: 0;
|
||||
color: #000;
|
||||
color: rgba(0,0,0,0.87);
|
||||
letter-spacing: 0.005em;
|
||||
}
|
||||
|
||||
.white-text h2, .white-text .title, .white-text.title{
|
||||
.white-text h2, .white-text .paper-font-title, .white-text.paper-font-title{
|
||||
color: #dedede;
|
||||
color: rgba(255,255,255,0.87);
|
||||
}
|
||||
|
||||
h3, .subhead {
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
margin: 0;
|
||||
color: #000;
|
||||
color: rgba(0,0,0,0.87);
|
||||
letter-spacing: 0.010em;
|
||||
}
|
||||
|
||||
.white-text h3, .white-text .subhead{
|
||||
.white-text h3, .white-text .paper-font-subhead{
|
||||
color: #dedede;
|
||||
color: rgba(255,255,255,0.87);
|
||||
}
|
||||
|
||||
.body2 {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #000;
|
||||
color: rgba(0,0,0,0.87);
|
||||
letter-spacing: 0.010em;
|
||||
}
|
||||
|
||||
.white-text .body2{
|
||||
.white-text .paper-font-body2{
|
||||
color: #dedede;
|
||||
color: rgba(255,255,255,0.87);
|
||||
}
|
||||
|
||||
p, .body1, body {
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
margin: 0;
|
||||
color: #000;
|
||||
color: rgba(0,0,0,0.87);
|
||||
letter-spacing: 0.010em;
|
||||
}
|
||||
|
||||
.white-text p, .white-text .body1{
|
||||
.white-text p, .white-text .paper-font-body1{
|
||||
color: #dedede;
|
||||
color: rgba(255,255,255,0.87);
|
||||
}
|
||||
|
||||
.caption{
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
color: #000;
|
||||
color: rgba(0,0,0,0.54);
|
||||
letter-spacing: 0.020em;
|
||||
}
|
||||
|
||||
.white-text .caption{
|
||||
.white-text .paper-font-caption{
|
||||
color: #8a8a8a;
|
||||
color: rgba(255,255,255,0.54);
|
||||
}
|
||||
|
||||
html /deep/ .white-text{
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.black54 {
|
||||
color: #444;
|
||||
color: #757575;
|
||||
color: rgba(0,0,0,0.54);
|
||||
}
|
||||
|
||||
.white54 {
|
||||
color: #eee;
|
||||
color: #8a8a8a;
|
||||
color: rgba(255,255,255,0.54);
|
||||
}
|
||||
|
||||
.black87 {
|
||||
color: #212121;
|
||||
color: rgba(0,0,0,0.87);
|
||||
}
|
||||
|
||||
.white87 {
|
||||
color: #dedede;
|
||||
color: rgba(255,255,255,0.87);
|
||||
}
|
||||
|
||||
@@ -1,49 +1,33 @@
|
||||
<template name="attackEdit">
|
||||
<div layout horizontal>
|
||||
<div layout vertical flex>
|
||||
<div layout horizontal>
|
||||
<div class="layout horizontal">
|
||||
<div class="layout vertical flex">
|
||||
<div class="layout horizontal wrap">
|
||||
<!--attackBonus-->
|
||||
<paper-input id="attackBonusInput"
|
||||
label="Attack Bonus"
|
||||
floatinglabel
|
||||
value={{attackBonus}}
|
||||
flex></paper-input>
|
||||
<paper-input class="attackBonusInput flex" label="Attack Bonus" value={{attackBonus}}
|
||||
style="flex-basis: 200px; margin-right: 16px;">
|
||||
{{> formulaSuffix}}
|
||||
</paper-input>
|
||||
<!--details-->
|
||||
<paper-input id="detailInput"
|
||||
label="Details"
|
||||
floatinglabel
|
||||
value={{details}}></paper-input>
|
||||
<paper-input class="detailInput" label="Details" value={{details}} style="flex-basis: 200px;">
|
||||
</paper-input>
|
||||
</div>
|
||||
<div layout horizontal>
|
||||
<!--DamageType-->
|
||||
<paper-dropdown-menu id="damageDiceDropdown" label="Damage Dice">
|
||||
<paper-dropdown layered class="dropdown">
|
||||
<core-menu class="menu" selected={{damageDice}}>
|
||||
{{#each DAMAGE_DICE}}
|
||||
<paper-item name={{this}} class="containerMenuItem">{{this}}</paper-item>
|
||||
{{/each}}
|
||||
</core-menu>
|
||||
</paper-dropdown>
|
||||
</paper-dropdown-menu>
|
||||
<div class="layout horizontal wrap">
|
||||
<!--damageBonus-->
|
||||
<paper-input id="damageInput"
|
||||
label="Damage Bonus"
|
||||
floatinglabel
|
||||
value={{damageBonus}}
|
||||
flex></paper-input>
|
||||
<paper-input class="damageInput flex" label="Damage" value={{damage}}
|
||||
style="flex-basis: 200px; margin-right: 16px;">
|
||||
{{> bracketSuffix}}
|
||||
</paper-input>
|
||||
<!--DamageType-->
|
||||
<paper-dropdown-menu id="damageTypeDropdown" label="Damage Type">
|
||||
<paper-dropdown layered class="dropdown">
|
||||
<core-menu class="menu" selected={{damageType}}>
|
||||
{{#each damageTypes}}
|
||||
<paper-item name={{this}} class="containerMenuItem">{{this}}</paper-item>
|
||||
{{/each}}
|
||||
</core-menu>
|
||||
</paper-dropdown>
|
||||
<paper-dropdown-menu label="Damage Type" dynamic-align>
|
||||
<dicecloud-selector class="dropdown-content damageTypeDropdown" selected={{damageType}}>
|
||||
{{#each damageTypes}}
|
||||
<paper-item name={{this}} class="containerMenuItem">{{this}}</paper-item>
|
||||
{{/each}}
|
||||
</dicecloud-selector>
|
||||
</paper-dropdown-menu>
|
||||
</div>
|
||||
</div>
|
||||
<!--Delete Button-->
|
||||
<paper-icon-button id="deleteAttack" role="button" tabindex="0" icon="delete" aria-label="Delete"></paper-icon-button>
|
||||
<paper-icon-button class="deleteAttack" icon="delete"></paper-icon-button>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
@@ -1,45 +1,46 @@
|
||||
var damageTypes = ["bludgeoning", "piercing", "slashing",
|
||||
"acid", "cold", "fire", "force", "lightning", "necrotic",
|
||||
"poison", "psychic", "radiant", "thunder"];
|
||||
var damageTypes = [
|
||||
"bludgeoning",
|
||||
"piercing",
|
||||
"slashing",
|
||||
"acid",
|
||||
"cold",
|
||||
"fire",
|
||||
"force",
|
||||
"lightning",
|
||||
"necrotic",
|
||||
"poison",
|
||||
"psychic",
|
||||
"radiant",
|
||||
"thunder",
|
||||
];
|
||||
|
||||
Template.attackEdit.events({
|
||||
"tap #deleteAttack": function(event, instance) {
|
||||
"click .deleteAttack": function(event, instance) {
|
||||
Attacks.softRemoveNode(this._id);
|
||||
GlobalUI.deletedToast(this._id, "Attacks", "Attack");
|
||||
},
|
||||
"change #attackBonusInput": function(event) {
|
||||
"change .attackBonusInput": function(event) {
|
||||
var value = event.currentTarget.value;
|
||||
Attacks.update(this._id, {$set: {attackBonus: value}});
|
||||
},
|
||||
"change #damageInput": function(event) {
|
||||
"change .damageInput": function(event) {
|
||||
var value = event.currentTarget.value;
|
||||
Attacks.update(this._id, {$set: {damageBonus: value}});
|
||||
Attacks.update(this._id, {$set: {damage: value}});
|
||||
},
|
||||
"change #detailInput": function(event) {
|
||||
"change .detailInput": function(event) {
|
||||
var value = event.currentTarget.value;
|
||||
Attacks.update(this._id, {$set: {details: value}});
|
||||
},
|
||||
"core-select #damageTypeDropdown": function(event) {
|
||||
"iron-select .damageTypeDropdown": function(event) {
|
||||
var detail = event.originalEvent.detail;
|
||||
if (!detail.isSelected) return;
|
||||
var value = detail.item.getAttribute("name");
|
||||
if (value == this.damageType) return;
|
||||
Attacks.update(this._id, {$set: {damageType: value}});
|
||||
},
|
||||
"core-select #damageDiceDropdown": function(event) {
|
||||
var detail = event.originalEvent.detail;
|
||||
if (!detail.isSelected) return;
|
||||
var value = detail.item.getAttribute("name");
|
||||
if (value == this.damageDice) return;
|
||||
Attacks.update(this._id, {$set: {damageDice: value}});
|
||||
}
|
||||
});
|
||||
|
||||
Template.attackEdit.helpers({
|
||||
damageTypes: function() {
|
||||
return damageTypes;
|
||||
},
|
||||
DAMAGE_DICE: function() {
|
||||
return DAMAGE_DICE;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
{{#if attacks.count}}
|
||||
<hr style="margin: 16px 0 16px 0;">
|
||||
<div id="attacks">
|
||||
<h2>Attacks</h2>
|
||||
<div class="paper-font-title">Attacks</div>
|
||||
{{#each attacks}}
|
||||
{{>attackEdit}}
|
||||
{{/each}}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<template name="attackView">
|
||||
<div class="attackView" layout horizontal>
|
||||
<div class="headline rightPadded" layout horizontal center>
|
||||
<div class="attackView layout horizontal">
|
||||
<div class="paper-font-headline layout horizontal center" style="margin-right: 16px;">
|
||||
{{evaluateSigned charId attackBonus}}
|
||||
</div>
|
||||
<div layout vertical>
|
||||
<div class="layout vertical">
|
||||
<div>
|
||||
{{damageDice}} {{{evaluateSignedSpaced charId damageBonus}}} {{damageType}}
|
||||
{{evaluateString charId damage}} {{damageType}}
|
||||
</div>
|
||||
{{#if details}}
|
||||
<div class="caption">
|
||||
<div class="paper-font-caption">
|
||||
{{details}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
{{#if attacks.count}}
|
||||
<hr style="margin: 16px 0 16px 0;">
|
||||
<div class="attacks">
|
||||
<h2 class="spaceAfter">Attacks</h2>
|
||||
<div class="spaceAfter paper-font-title">Attacks</div>
|
||||
{{#each attacks}}
|
||||
{{> attackView}}
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</template>
|
||||
</template>
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<template name="buffDialog">
|
||||
{{#with buff}}
|
||||
{{#baseDialog title=name class=colorClass hideEdit=true}}
|
||||
{{> buffDetails}}
|
||||
{{/baseDialog}}
|
||||
{{/with}}
|
||||
</template>
|
||||
|
||||
<template name="buffDetails">
|
||||
{{#if description}}
|
||||
<div class="pre-wrap">{{evaluateString charId description}}</div>
|
||||
{{/if}}
|
||||
|
||||
{{> effectsViewList charId=charId parentId=_id}}
|
||||
</template>
|
||||
@@ -0,0 +1,5 @@
|
||||
Template.buffDialog.helpers({
|
||||
buff: function(){
|
||||
return Buffs.findOne(this.buffId);
|
||||
},
|
||||
});
|
||||
@@ -1,3 +1,24 @@
|
||||
<template name="characterSettings">
|
||||
|
||||
{{#with character}}
|
||||
<div class="fit layout vertical">
|
||||
<app-header-layout has-scrolling-region class="feedback flex">
|
||||
<app-header fixed effects="waterfall">
|
||||
<app-toolbar>
|
||||
<div main-title>Character Settings</div>
|
||||
</app-toolbar>
|
||||
</app-header>
|
||||
<div class="form flex">
|
||||
<paper-toggle-button id="hideSpellcasting" checked={{settings.hideSpellcasting}}>
|
||||
Hide Spells tab
|
||||
</paper-toggle-button>
|
||||
<paper-toggle-button id="variantEncumbrance" checked={{settings.useVariantEncumbrance}}>
|
||||
Use variant encumbrance
|
||||
</paper-toggle-button>
|
||||
</div>
|
||||
</app-header-layout>
|
||||
<div class="buttons layout horizontal end-justified">
|
||||
<paper-button class="doneButton"> Done </paper-button>
|
||||
</div>
|
||||
</div>
|
||||
{{/with}}
|
||||
</template>
|
||||
|
||||
@@ -1,3 +1,29 @@
|
||||
Template.characterSettings.events({
|
||||
|
||||
Template.characterSettings.helpers({
|
||||
character: function() {
|
||||
return Characters.findOne(this._id, {fields: {settings: 1}});
|
||||
}
|
||||
});
|
||||
|
||||
Template.characterSettings.events({
|
||||
"change #variantEncumbrance": function(event, instance){
|
||||
var value = instance.find("#variantEncumbrance").checked;
|
||||
if (this.settings.useVariantEncumbrance !== value){
|
||||
Characters.update(
|
||||
this._id,
|
||||
{$set: {"settings.useVariantEncumbrance": value}}
|
||||
);
|
||||
}
|
||||
},
|
||||
"change #hideSpellcasting": function(event, instance){
|
||||
var value = instance.find("#hideSpellcasting").checked;
|
||||
if (this.settings.hideSpellcasting !== value){
|
||||
Characters.update(
|
||||
this._id,
|
||||
{$set: {"settings.hideSpellcasting": value}}
|
||||
);
|
||||
}
|
||||
},
|
||||
"click .doneButton": function(event, instance){
|
||||
popDialogStack();
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,9 +1,20 @@
|
||||
<template name="deleteCharacterConfirmation">
|
||||
<div>
|
||||
Deleting a character cannot be undone.<br>
|
||||
To continue type "{{name}}" into the box below.<br>
|
||||
<paper-input id="nameInput" label="type the characters's name here" style="width: 100%;"></paper-input><br>
|
||||
<paper-button id="deleteButton" style={{getStyle}} disabled={{cantDelete}}>Delete Character</paper-button>
|
||||
<div class="fit layout vertical">
|
||||
<app-header-layout has-scrolling-region class="feedback flex">
|
||||
<app-header fixed effects="waterfall">
|
||||
<app-toolbar>
|
||||
<div main-title>Delete Character</div>
|
||||
</app-toolbar>
|
||||
</app-header>
|
||||
<div class="form flex">
|
||||
Deleting a character cannot be undone.<br>
|
||||
To continue type "{{name}}" into the box below.<br>
|
||||
<paper-input id="nameInput" label="type the characters's name here" style="width: 100%;"></paper-input><br>
|
||||
<paper-button id="deleteButton" style={{getStyle}} disabled={{cantDelete}}>Delete Character</paper-button>
|
||||
</div>
|
||||
</app-header-layout>
|
||||
<div class="buttons layout horizontal end-justified">
|
||||
<paper-button class="cancelButton"> Cancel </paper-button>
|
||||
</div>
|
||||
</div>
|
||||
<paper-button id="cancelButton" affirmative> Cancel </paper-button>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
@@ -18,11 +18,14 @@ Template.deleteCharacterConfirmation.events({
|
||||
var canDel = instance.find("#nameInput").value === this.name;
|
||||
instance.canDelete.set(canDel);
|
||||
},
|
||||
"tap #deleteButton": function(event, instance) {
|
||||
"click #deleteButton": function(event, instance) {
|
||||
if (instance.find("#nameInput").value === this.name) {
|
||||
GlobalUI.closeDialog();
|
||||
Router.go("/");
|
||||
popDialogStack();
|
||||
Router.go("/characterList");
|
||||
Characters.remove(this._id);
|
||||
}
|
||||
}
|
||||
},
|
||||
"click .cancelButton": function(event, instance){
|
||||
popDialogStack();
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,42 +1,65 @@
|
||||
<template name="shareDialog">
|
||||
<div style="width: 360px;">
|
||||
<div>
|
||||
{{#if readers.count}}
|
||||
<div style="font-weight: 500;">
|
||||
Can View
|
||||
</div>
|
||||
{{#each readers}}
|
||||
<div layout horizontal center>
|
||||
<div flex>{{username}}</div>
|
||||
<paper-icon-button class="deleteShare" icon="delete"></paper-icon-button>
|
||||
</div>
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
{{#if writers.count}}
|
||||
<div style="font-weight: 500;">
|
||||
Can Edit
|
||||
</div>
|
||||
{{#each writers}}
|
||||
<div layout horizontal center>
|
||||
<div flex>{{username}}</div>
|
||||
<paper-icon-button class="deleteShare" icon="delete"></paper-icon-button>
|
||||
</div>
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
<div class="fit layout vertical">
|
||||
<app-header-layout has-scrolling-region class="feedback flex">
|
||||
<app-header fixed effects="waterfall">
|
||||
<app-toolbar>
|
||||
<div main-title>Share</div>
|
||||
</app-toolbar>
|
||||
</app-header>
|
||||
<div class="form flex">
|
||||
<paper-dropdown-menu label="Who can view this character">
|
||||
<dicecloud-selector class="visibilityDropdown dropdown-content" selected={{viewPermission}}>
|
||||
<paper-item name="whitelist">Only people I share with</paper-item>
|
||||
<paper-item name="public">Anyone with link</paper-item>
|
||||
</dicecloud-selector>
|
||||
</paper-dropdown-menu>
|
||||
<div class="layout horizontal center wrap">
|
||||
<paper-input class="flex" id="userNameOrEmailInput" label="Share with username or email" floatinglabel></paper-input>
|
||||
<paper-button id="shareButton"
|
||||
class="red-button"
|
||||
style="width: 80px; height: 37px; margin-top: 16px;"
|
||||
raised
|
||||
disabled={{shareButtonDisabled}}>Share</paper-button>
|
||||
<paper-radio-group id="accessLevelMenu" selected="read">
|
||||
<paper-radio-button name="read">View Only</paper-radio-button>
|
||||
<paper-radio-button name="write">Can Edit</paper-radio-button>
|
||||
</paper-radio-group>
|
||||
</div>
|
||||
<p style="color: red;">{{userFindError}}</p>
|
||||
<div>
|
||||
{{#if readers.length}}
|
||||
<div class="paper-font-subhead">
|
||||
Can View
|
||||
</div>
|
||||
{{#each id in readers}}
|
||||
<div class="layout horizontal center">
|
||||
{{#with id=id}}
|
||||
<paper-icon-button class="deleteShare" icon="delete">
|
||||
</paper-icon-button>
|
||||
{{/with}}
|
||||
<div class="flex">{{username id}}</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
{{#if writers.length}}
|
||||
<div class="paper-font-subhead">
|
||||
Can Edit
|
||||
</div>
|
||||
{{#each id in writers}}
|
||||
<div class="layout horizontal center">
|
||||
{{#with id=id}}
|
||||
<paper-icon-button class="deleteShare" icon="delete">
|
||||
</paper-icon-button>
|
||||
{{/with}}
|
||||
<div class="flex">{{username id}}</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</app-header-layout>
|
||||
<div class="buttons layout horizontal end-justified">
|
||||
<paper-button class="doneButton"> Done </paper-button>
|
||||
</div>
|
||||
<div layout horizontal center>
|
||||
<paper-input flex id="userNameOrEmailInput" label="Username or email" floatinglabel></paper-input>
|
||||
<paper-button id="shareButton"
|
||||
class="red-button"
|
||||
style="width: 80px; height: 37px; margin-top: 16px;"
|
||||
raised
|
||||
disabled={{shareButtonDisabled}}>Share</paper-button>
|
||||
</div>
|
||||
<p style="color: red;">{{userFindError}}</p>
|
||||
<paper-radio-group id="accessLevelMenu" selected="read">
|
||||
<paper-radio-button name="read" label="View Only"></paper-radio-button>
|
||||
<paper-radio-button name="write" label="Can Edit"></paper-radio-button>
|
||||
</paper-radio-group>
|
||||
</div>
|
||||
<paper-button id="doneButton" affirmative> Done </paper-button>
|
||||
</template>
|
||||
|
||||
@@ -1,15 +1,38 @@
|
||||
Template.shareDialog.onCreated(function(){
|
||||
this.userId = new ReactiveVar();
|
||||
this.autorun(() => {
|
||||
var char = Characters.findOne(Template.currentData()._id, {
|
||||
fields: {readers: 1, writers: 1}
|
||||
});
|
||||
if (!char) return;
|
||||
this.subscribe("userNames", _.union(char.readers, char.writers));
|
||||
});
|
||||
});
|
||||
|
||||
Template.shareDialog.onRendered(function(){
|
||||
// Polymer not mirroring selected attribute properly
|
||||
this.$("paper-listbox").each(function(){
|
||||
this.selected = this.getAttribute("selected");
|
||||
});
|
||||
});
|
||||
|
||||
Template.shareDialog.helpers({
|
||||
viewPermission: function() {
|
||||
var char = Characters.findOne(this._id, {fields: {settings: 1}});
|
||||
return char.settings.viewPermission || "whitelist";
|
||||
},
|
||||
readers: function(){
|
||||
var char = Characters.findOne(this._id, {fields: {readers: 1}});
|
||||
return Meteor.users.find({_id: {$in: char.readers}});
|
||||
return char.readers;
|
||||
},
|
||||
writers: function(){
|
||||
var char = Characters.findOne(this._id, {fields: {writers: 1}});
|
||||
return Meteor.users.find({_id: {$in: char.writers}});
|
||||
//Meteor.users.find({_id: {$in: char.writers}});
|
||||
return char.writers
|
||||
},
|
||||
username: function(id){
|
||||
const user = Meteor.users.findOne(id);
|
||||
return user && user.username || "user: " + id;
|
||||
},
|
||||
shareButtonDisabled: function(){
|
||||
return !Template.instance().userId.get();
|
||||
@@ -22,6 +45,13 @@ Template.shareDialog.helpers({
|
||||
});
|
||||
|
||||
Template.shareDialog.events({
|
||||
"iron-select .visibilityDropdown": function(event){
|
||||
var detail = event.originalEvent.detail;
|
||||
var value = detail.item.getAttribute("name");
|
||||
var char = Characters.findOne(this._id, {fields: {settings: 1}});
|
||||
if (value == char.settings.viewPermission) return;
|
||||
Characters.update(this._id, {$set: {"settings.viewPermission": value}});
|
||||
},
|
||||
"input #userNameOrEmailInput":
|
||||
function(event, instance){
|
||||
var userName = instance.find("#userNameOrEmailInput").value;
|
||||
@@ -35,7 +65,7 @@ Template.shareDialog.events({
|
||||
}
|
||||
});
|
||||
},
|
||||
"tap #shareButton": function(event, instance){
|
||||
"click #shareButton": function(event, instance){
|
||||
var self = this;
|
||||
var permission = instance.find("#accessLevelMenu").selected;
|
||||
if (!permission) throw "no permission set";
|
||||
@@ -53,9 +83,12 @@ Template.shareDialog.events({
|
||||
});
|
||||
}
|
||||
},
|
||||
"tap .deleteShare": function(event, instance) {
|
||||
"click .deleteShare": function(event, instance) {
|
||||
Characters.update(instance.data._id, {
|
||||
$pull: {writers: this._id, readers: this._id}
|
||||
$pull: {writers: this.id, readers: this.id}
|
||||
});
|
||||
},
|
||||
"click .doneButton": function(event, instance){
|
||||
popDialogStack();
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,28 +1,24 @@
|
||||
paper-tabs, core-toolbar {
|
||||
box-shadow: 0px 3px 2px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
core-toolbar paper-tabs {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
paper-tabs[noink][nobar] paper-tab.core-selected {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
paper-tabs /deep/ #selectionBar, #onRadio {
|
||||
background-color: #d50000;
|
||||
}
|
||||
|
||||
paper-tabs ::shadow #ink {
|
||||
color: #b22 !important;
|
||||
}
|
||||
|
||||
paper-tabs.transparent-brown {
|
||||
background-color: transparent;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
core-toolbar.medium-tall {
|
||||
app-toolbar.medium-tall {
|
||||
height: 108px;
|
||||
}
|
||||
|
||||
.character-name {
|
||||
padding-left: 16px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.character-menu paper-icon-item{
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.character-sheet app-header {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.character-sheet iron-pages > div {
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
@@ -1,41 +1,62 @@
|
||||
<template name="characterSheet">
|
||||
<!--<div tool horizontal layout flex end-justified class="bottom">Title-bottom</div>-->
|
||||
<core-toolbar class="medium-tall {{colorClass}}">
|
||||
<core-icon-button icon="menu" core-drawer-toggle></core-icon-button>
|
||||
<div flex>
|
||||
{{name}}
|
||||
<div class="fit layout vertical character-sheet">
|
||||
<app-header fixed effects="waterfall">
|
||||
<app-toolbar class="medium-tall {{colorClass}}">
|
||||
<div top-item class="layout horizontal center">
|
||||
<paper-icon-button icon="menu" drawer-toggle></paper-icon-button>
|
||||
<div class="flex character-name">
|
||||
{{name}}
|
||||
</div>
|
||||
{{#if canEditCharacter _id}}
|
||||
{{> colorDropdown}}
|
||||
<paper-menu-button class="character-menu" horizontal-align="right">
|
||||
<paper-icon-button icon="more-vert" class="dropdown-trigger"></paper-icon-button>
|
||||
<paper-menu class="dropdown-content black87">
|
||||
<paper-icon-item id="deleteCharacter">
|
||||
<iron-icon icon="delete" item-icon></iron-icon>
|
||||
Delete
|
||||
</paper-icon-item>
|
||||
<paper-icon-item id="shareCharacter">
|
||||
<iron-icon icon="social:share" item-icon></iron-icon>
|
||||
Share
|
||||
</paper-icon-item>
|
||||
<paper-icon-item id="characterSettings">
|
||||
<iron-icon icon="settings" item-icon></iron-icon>
|
||||
Settings
|
||||
</paper-icon-item>
|
||||
<paper-icon-item id="characterExport">
|
||||
<iron-icon icon="content-copy" item-icon></iron-icon>
|
||||
Export to Improved Initiative
|
||||
</paper-icon-item>
|
||||
</paper-menu>
|
||||
</paper-menu-button>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div bottom-item>
|
||||
<paper-tabs id="characterSheetTabs" selected={{selectedTab}} class="{{colorClass}}">
|
||||
<paper-tab name="stats">Stats</paper-tab>
|
||||
<paper-tab name="features">Features</paper-tab>
|
||||
<paper-tab name="inventory">Inventory</paper-tab>
|
||||
{{#unless hideSpellcasting}}
|
||||
<paper-tab name="spells">Spells</paper-tab>
|
||||
{{/unless}}
|
||||
<paper-tab name="persona">Persona</paper-tab>
|
||||
<paper-tab name="journal">Journal</paper-tab>
|
||||
</paper-tabs>
|
||||
</div>
|
||||
</app-toolbar>
|
||||
</app-header>
|
||||
<div class="flex" style="position: relative;">
|
||||
<iron-pages id="tabPages" class="fit" selected={{selectedTab}}>
|
||||
<div name="stats" class="tab-page fit">{{> stats}}</div>
|
||||
<div name="features" class="tab-page fit">{{> features}}</div>
|
||||
<div name="inventory" class="tab-page fit">{{> inventory}}</div>
|
||||
{{#unless hideSpellcasting}}
|
||||
<div name="spells" class="tab-page fit">{{> spells}}</div>
|
||||
{{/unless}}
|
||||
<div name="persona" class="tab-page fit">{{> persona}}</div>
|
||||
<div name="journal" class="tab-page fit">{{> journal}}</div>
|
||||
</iron-pages>
|
||||
</div>
|
||||
<div>
|
||||
{{> colorDropdown}}
|
||||
</div>
|
||||
<paper-menu-button>
|
||||
<paper-icon-button icon="more-vert" noink></paper-icon-button>
|
||||
<paper-dropdown class="dropdown" halign="right">
|
||||
<core-menu class="menu" style="color: black; color: rgba(0,0,0,0.87);">
|
||||
<paper-item id="deleteCharacter"><core-icon icon="delete"></core-icon>Delete</paper-item>
|
||||
<paper-item id="shareCharacter"><core-icon icon="social:share"></core-icon>Share</paper-item>
|
||||
</core-menu>
|
||||
</paper-dropdown>
|
||||
</paper-menu-button>
|
||||
<div class="bottom fit" horizontal layout>
|
||||
<paper-tabs flex horizontal center layout id="characterSheetTabs" selected={{selectedTab}} class="{{colorClass}}">
|
||||
<paper-tab name="stats">Stats</paper-tab>
|
||||
<paper-tab name="features">Features</paper-tab>
|
||||
<paper-tab name="inventory">Inventory</paper-tab>
|
||||
<paper-tab name="spells">Spells</paper-tab>
|
||||
<paper-tab name="persona">Persona</paper-tab>
|
||||
<paper-tab name="journal">Journal</paper-tab>
|
||||
</paper-tabs>
|
||||
</div>
|
||||
</core-toolbar>
|
||||
<div fit>
|
||||
<core-animated-pages id="tabPages" selected={{selectedTab}} transitions="slide-from-right" fit>
|
||||
<section flex name="stats">{{> stats}}</section>
|
||||
<section flex name="features">{{> features}}</section>
|
||||
<section flex name="inventory">{{> inventory}}</section>
|
||||
<section flex name="spells">{{> spells}}</section>
|
||||
<section flex name="persona">{{> persona}}</section>
|
||||
<section flex name="journal">{{> journal}}</section>
|
||||
</core-animated-pages>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1,8 +1,162 @@
|
||||
Template.characterSheet.created = function(){
|
||||
Session.setDefault(this.data._id + ".selectedTab", "stats");
|
||||
};
|
||||
let tabPages, tabSliders, tabFabs, tabFabMenus;
|
||||
Template.characterSheet.onRendered(function() {
|
||||
//default to the stats tab
|
||||
Session.setDefault(this.data._id + ".selectedTab", "0");
|
||||
|
||||
// Keep the header's scroll target up to date with the currently selected tab
|
||||
let header;
|
||||
this.autorun(() => {
|
||||
const tab = getTab(Template.currentData()._id);
|
||||
header = header || this.find("app-header");
|
||||
if (!header) return;
|
||||
Tracker.afterFlush(() => {
|
||||
header.scrollTarget = this.find("#tabPages .iron-selected");
|
||||
header._scrollHandler && header._scrollHandler();
|
||||
});
|
||||
});
|
||||
|
||||
_.defer(() => {
|
||||
// Store all the tab page components for use in animations
|
||||
tabPages = _.times(6, (n) =>
|
||||
this.$(`.tab-page:nth-child(${n + 1})`)
|
||||
);
|
||||
tabSliders = _.times(6, (n) =>
|
||||
tabPages[n].find(".animation-slider")
|
||||
);
|
||||
tabFabs = _.times(6, (n) =>
|
||||
tabPages[n].find(".floatyButton")
|
||||
);
|
||||
tabFabMenus = _.times(6, (n) =>
|
||||
tabPages[n].find(".mini-holder")
|
||||
);
|
||||
})
|
||||
|
||||
//watch this character and make sure their encumbrance is updated
|
||||
//trackEncumbranceConditions(this.data._id, this);
|
||||
});
|
||||
|
||||
/**
|
||||
* Page change animations that suck less than neon-animated-pages
|
||||
*/
|
||||
const tabAnimation = ({oldTab, newTab, duration}) => {
|
||||
if (newTab === oldTab) return;
|
||||
duration = duration || 400;
|
||||
const delay = (element, f) => {
|
||||
element.on(
|
||||
"transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",
|
||||
(event) => {
|
||||
if (event.target == event.currentTarget){
|
||||
f();
|
||||
$(this).off(event);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
const isForward = newTab > oldTab;
|
||||
const entryAnimation = {
|
||||
before: {
|
||||
transform: isForward ? "translateX(100%)" : "translateX(-100%)",
|
||||
},
|
||||
during: {
|
||||
transition: `transform ${duration}ms ease`,
|
||||
transform: "",
|
||||
},
|
||||
after: {
|
||||
transition: "",
|
||||
transform: "",
|
||||
},
|
||||
}
|
||||
const exitAnimation = {
|
||||
before: {
|
||||
transform: "translateZ(0)",
|
||||
},
|
||||
during: {
|
||||
transition: `transform ${duration}ms ease`,
|
||||
transform: isForward ? "translateX(-100%)" : "translateX(100%)",
|
||||
},
|
||||
after: {
|
||||
transition: "",
|
||||
transform: "",
|
||||
display: "",
|
||||
},
|
||||
}
|
||||
const oldPage = tabPages[oldTab];
|
||||
const newPage = tabPages[newTab];
|
||||
if (oldPage.length && newPage.length){
|
||||
oldPage[0].style.setProperty("display", "initial", "important");
|
||||
oldPage.css({zIndex: "1"});
|
||||
newPage.css({zIndex: "0"});
|
||||
_.defer(() => {
|
||||
oldPage.css({
|
||||
transition: `z-index ${duration}ms linear`,
|
||||
zIndex: "0",
|
||||
});
|
||||
newPage.css({
|
||||
transition: `z-index ${duration}ms linear`,
|
||||
zIndex: "1",
|
||||
});
|
||||
});
|
||||
delay(oldPage, () => oldPage.css({
|
||||
display: "",
|
||||
transition: "",
|
||||
zIndex: "",
|
||||
}));
|
||||
delay(newPage, () => newPage.css({
|
||||
transition: "",
|
||||
zIndex: "",
|
||||
}));
|
||||
}
|
||||
const oldSlider = tabSliders[oldTab];
|
||||
if (oldSlider.length){
|
||||
oldSlider.css(exitAnimation.before);
|
||||
_.defer(() => oldSlider.css(exitAnimation.during));
|
||||
delay(oldSlider, () => oldSlider.css(exitAnimation.after));
|
||||
}
|
||||
const newSlider = tabSliders[newTab];
|
||||
if (newSlider.length){
|
||||
newSlider.css(entryAnimation.before);
|
||||
_.defer(() => newSlider.css(entryAnimation.during));
|
||||
delay(newSlider, () => newSlider.css(entryAnimation.after));
|
||||
}
|
||||
slideDown = ({element, reverse}) => {
|
||||
element.css({
|
||||
transform: reverse ? "translateY(80px)" : "",
|
||||
});
|
||||
const fraction = duration / 4;
|
||||
_.defer(() => element.css({
|
||||
transition: reverse ?
|
||||
`transform ${fraction}ms ease-out ${duration - fraction}ms` :
|
||||
`transform ${fraction}ms ease-in`,
|
||||
transform: reverse ? "" : "translateY(80px)",
|
||||
}));
|
||||
delay(element, () => element.css({
|
||||
transition: "",
|
||||
}));
|
||||
}
|
||||
|
||||
const oldFab = tabFabs[oldTab];
|
||||
const newFab = tabFabs[newTab];
|
||||
if (oldFab.length && !newFab.length){
|
||||
slideDown({element: oldFab});
|
||||
}
|
||||
if (newFab.length && !oldFab.length){
|
||||
slideDown({element: newFab, reverse: true});
|
||||
}
|
||||
if (newFab.length && oldFab.length){
|
||||
newFab.css({transform: ""});
|
||||
}
|
||||
|
||||
const oldFabMenu = tabFabMenus[oldTab];
|
||||
if (oldFabMenu.length) {
|
||||
Blaze.getView(oldFabMenu[0]).templateInstance().active.set(false);
|
||||
}
|
||||
}
|
||||
|
||||
var setTab = function(charId, tab){
|
||||
tabAnimation({
|
||||
oldTab: +Session.get(charId + ".selectedTab"),
|
||||
newTab: +tab,
|
||||
});
|
||||
return Session.set(charId + ".selectedTab", tab);
|
||||
};
|
||||
|
||||
@@ -13,31 +167,47 @@ var getTab = function(charId){
|
||||
Template.characterSheet.helpers({
|
||||
selectedTab: function(){
|
||||
return getTab(this._id);
|
||||
}
|
||||
},
|
||||
hideSpellcasting: function() {
|
||||
var char = Characters.findOne(this._id);
|
||||
return char && char.settings.hideSpellcasting;
|
||||
},
|
||||
});
|
||||
|
||||
Template.characterSheet.events({
|
||||
"core-animated-pages-transition-end #tabPages": function(event) {
|
||||
event.stopPropagation();
|
||||
},
|
||||
"tap #characterSheetTabs paper-tab": function(event, instance){
|
||||
setTab(this._id, event.currentTarget.getAttribute("name"));
|
||||
"iron-select #characterSheetTabs": function(event, instance){
|
||||
setTab(this._id, event.target.selected);
|
||||
},
|
||||
"color-change": function(event, instance){
|
||||
console.log("character color change")
|
||||
Characters.update(this._id, {$set: {color: event.color}});
|
||||
},
|
||||
"tap #deleteCharacter": function(event, instance){
|
||||
GlobalUI.showDialog({
|
||||
heading: "Delete " + this.name,
|
||||
"click #deleteCharacter": function(event, instance){
|
||||
pushDialogStack({
|
||||
data: this,
|
||||
template: "deleteCharacterConfirmation",
|
||||
element: event.currentTarget.parentElement.parentElement,
|
||||
});
|
||||
},
|
||||
"tap #shareCharacter": function(event, instance){
|
||||
GlobalUI.showDialog({
|
||||
heading: "Share " + this.name,
|
||||
"click #shareCharacter": function(event, instance){
|
||||
pushDialogStack({
|
||||
data: this,
|
||||
template: "shareDialog",
|
||||
element: event.currentTarget.parentElement.parentElement,
|
||||
});
|
||||
},
|
||||
"click #characterSettings": function(event, instance){
|
||||
pushDialogStack({
|
||||
data: this,
|
||||
template: "characterSettings",
|
||||
element: event.currentTarget.parentElement.parentElement,
|
||||
});
|
||||
},
|
||||
"click #characterExport": function(event, instance){
|
||||
pushDialogStack({
|
||||
data: this,
|
||||
template: "exportDialog",
|
||||
element: event.currentTarget.parentElement.parentElement,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,29 +1,25 @@
|
||||
body /deep/ #statGroupDropDown {
|
||||
width: 120px;
|
||||
.effectEdit .operationDropDown {
|
||||
width: 152px;
|
||||
}
|
||||
|
||||
body /deep/ #statDropDown {
|
||||
width: 120px;
|
||||
.effectEdit .statDropDown {
|
||||
width: 152px;
|
||||
}
|
||||
|
||||
body /deep/ #operationDropDown {
|
||||
width: 100px;
|
||||
.effectEdit .damageMultiplierDropDown {
|
||||
width: 152px;
|
||||
}
|
||||
|
||||
body /deep/ #damageMultiplierDropDown {
|
||||
width: 120px;
|
||||
.effectEdit .deleteEffect {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
body /deep/ #proficiencyDropDown {
|
||||
width: 120px;
|
||||
.effectEdit .effect-table-view {
|
||||
align-self: center;
|
||||
color: #757575;
|
||||
color: rgba(0,0,0,0.54);
|
||||
}
|
||||
|
||||
html /deep/ .effectEdit paper-input {
|
||||
position: relative;
|
||||
bottom: 5px;
|
||||
}
|
||||
|
||||
html /deep/ .effectEdit {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
.effectEdit .iron-selected {
|
||||
color: #ad2a1f;
|
||||
}
|
||||
|
||||
@@ -1,54 +1,64 @@
|
||||
<template name="effectEdit">
|
||||
<div class="effectEdit" layout horizontal center>
|
||||
<paper-dropdown-menu class="statGroupDropDown" label="Stat Group" flex>
|
||||
<paper-dropdown layered class="dropdown">
|
||||
<core-menu class="menu statGroupMenu" selected={{selectedStatGroup}}>
|
||||
{{#with effect}}
|
||||
{{#baseEditDialog hideColor=true title="Effect"}}
|
||||
<div class="fit layout vertical effectEdit" style="padding: 24px;">
|
||||
<table class="paper-font-display1 effect-table-view">
|
||||
<tr>
|
||||
{{> effectView}}
|
||||
</tr>
|
||||
</table>
|
||||
<hr class="vertMargin" style="width: 100%;">
|
||||
{{#if showEffectValueInput}}
|
||||
<paper-input class="effectValueInput"
|
||||
label="Value"
|
||||
floatinglabel
|
||||
value={{effectValue}}>
|
||||
</paper-input>
|
||||
{{else}}
|
||||
<div style="height: 62px;"></div>
|
||||
{{/if}}
|
||||
<div class="effectEdit layout horizontal flex">
|
||||
<dicecloud-selector class="statMenu flex" selected={{stat}} selectable="paper-item" style="height: 100%; overflow-y: auto;">
|
||||
{{#each statGroups}}
|
||||
<paper-item class="statGroupSelect" name={{this}}>{{this}}</paper-item>
|
||||
<div class="statGroupTitle clickable" style="font-weight: bold; margin-top: 16px; padding-left: 8px;">
|
||||
{{this}}
|
||||
</div>
|
||||
<iron-collapse opened={{isGroupSelected this ../stat}}>
|
||||
{{#each stats}}
|
||||
<paper-item name={{stat}} class="clickable">{{name}}</paper-item>
|
||||
{{/each}}
|
||||
</iron-collapse>
|
||||
{{/each}}
|
||||
</core-menu>
|
||||
</paper-dropdown>
|
||||
</paper-dropdown-menu>
|
||||
{{#if stats}}
|
||||
<paper-dropdown-menu class="statDropDown" label="Stat" flex>
|
||||
<paper-dropdown layered class="dropdown">
|
||||
<core-menu class="menu statMenu" selected={{stat}} on-tap="onStatMenuTap">
|
||||
{{#each stats}}
|
||||
<paper-item name={{stat}}>{{name}}</paper-item>
|
||||
{{/each}}
|
||||
</core-menu>
|
||||
</paper-dropdown>
|
||||
</paper-dropdown-menu>
|
||||
{{/if}}
|
||||
{{#if operations}}
|
||||
<paper-dropdown-menu class="operationDropDown" label="Operation" flex>
|
||||
<paper-dropdown layered class="dropdown">
|
||||
<core-menu class="menu operationMenu" selected={{operation}}>
|
||||
</dicecloud-selector>
|
||||
{{#if operations}}
|
||||
<dicecloud-selector class="operationMenu flex" selected={{operation}} style="height: 100%; overflow-y: auto;">
|
||||
{{#each operations}}
|
||||
<paper-item name={{operation}}>{{name}}</paper-item>
|
||||
<paper-item name={{operation}} class="clickable">{{name}}</paper-item>
|
||||
{{/each}}
|
||||
</core-menu>
|
||||
</paper-dropdown>
|
||||
</paper-dropdown-menu>
|
||||
{{/if}}
|
||||
{{> Template.dynamic template=effectValueTemplate}}
|
||||
<paper-icon-button class="deleteEffect" role="button" tabindex="0" icon="delete" aria-label="Delete"></paper-icon-button>
|
||||
<br>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template name="regularEffectValue">
|
||||
<paper-input class="effectValueInput" label="Value" floatinglabel value={{effectValue}} flex></paper-input>
|
||||
</dicecloud-selector>
|
||||
{{else}} {{#if showMultiplierOperations}}
|
||||
<dicecloud-selector class="multiplierMenu flex"
|
||||
selected={{value}}>
|
||||
<paper-item name="0.5" class="clickable">Resistance</paper-item>
|
||||
<paper-item name="2" class="clickable">Vulnerability</paper-item>
|
||||
<paper-item name="0" class="clickable">Immunity</paper-item>
|
||||
</dicecloud-selector>
|
||||
{{else}}
|
||||
<div class="flex" style="height: 100%;"></div>
|
||||
{{/if}} {{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{/baseEditDialog}}
|
||||
{{/with}}
|
||||
</template>
|
||||
|
||||
<template name="multiplierEffectValue">
|
||||
<paper-dropdown-menu class="damageMultiplierDropDown" label="Damage Multiplier" flex>
|
||||
<paper-dropdown layered class="dropdown">
|
||||
<core-menu class="menu multiplierMenu" selected={{value}}>
|
||||
<paper-dropdown-menu class="damageMultiplierDropDown" label="Damage Multiplier" dynamic-align>
|
||||
<dicecloud-selector class="menu multiplierMenu dropdown-content"
|
||||
selected={{value}}>
|
||||
<paper-item name="0.5">Resistance</paper-item>
|
||||
<paper-item name="2">Vulnerability</paper-item>
|
||||
<paper-item name="0">Immunity</paper-item>
|
||||
</core-menu>
|
||||
</paper-dropdown>
|
||||
</dicecloud-selector>
|
||||
</paper-dropdown-menu>
|
||||
</template>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//TODO add dexterity armor
|
||||
// jscs:disable maximumLineLength
|
||||
var stats = [
|
||||
{stat: "strength", name: "Strength", group: "Ability Scores"},
|
||||
{stat: "dexterity", name: "Dexterity", group: "Ability Scores"},
|
||||
@@ -42,6 +43,7 @@ var stats = [
|
||||
{stat: "rageDamage", name: "Rage Damage", group: "Stats"},
|
||||
{stat: "expertiseDice", name: "Expertise Dice", group: "Stats"},
|
||||
{stat: "superiorityDice", name: "Superiority Dice", group: "Stats"},
|
||||
{stat: "carryMultiplier", name: "Carry Capacity Multiplier", group: "Stats"},
|
||||
{stat: "level1SpellSlots", name: "level 1", group: "Spell Slots"},
|
||||
{stat: "level2SpellSlots", name: "level 2", group: "Spell Slots"},
|
||||
{stat: "level3SpellSlots", name: "level 3", group: "Spell Slots"},
|
||||
@@ -67,9 +69,11 @@ var stats = [
|
||||
{stat: "psychicMultiplier", name: "Psychic", group: "Weakness/Resistance"},
|
||||
{stat: "radiantMultiplier", name: "Radiant", group: "Weakness/Resistance"},
|
||||
{stat: "slashingMultiplier", name: "Slashing", group: "Weakness/Resistance"},
|
||||
{stat: "thunderMultiplier", name: "Thunder", group: "Weakness/Resistance"}
|
||||
{stat: "thunderMultiplier", name: "Thunder", group: "Weakness/Resistance"},
|
||||
];
|
||||
|
||||
// jscs:enable maximumLineLength
|
||||
|
||||
var statsDict = _.indexBy(stats, "stat");
|
||||
var statGroups = _.groupBy(stats, "group");
|
||||
var statGroupNames = _.keys(statGroups);
|
||||
@@ -79,7 +83,7 @@ var attributeOperations = [
|
||||
{name: "Add", operation: "add"},
|
||||
{name: "Multiply", operation: "mul"},
|
||||
{name: "Min", operation: "min"},
|
||||
{name: "Max", operation: "max"}
|
||||
{name: "Max", operation: "max"},
|
||||
];
|
||||
var skillOperations = [
|
||||
{name: "Add", operation: "add"},
|
||||
@@ -90,27 +94,32 @@ var skillOperations = [
|
||||
{name: "Disadvantage", operation: "disadvantage"},
|
||||
{name: "Passive Bonus", operation: "passiveAdd"},
|
||||
{name: "Automatically Fail", operation: "fail"},
|
||||
{name: "Conditional Benefit", operation: "conditional"}
|
||||
{name: "Conditional Benefit", operation: "conditional"},
|
||||
];
|
||||
|
||||
Template.effectEdit.created = function(){
|
||||
var statGroup = statsDict[this.data.stat] && statsDict[this.data.stat].group;
|
||||
this.selectedStatGroup = new ReactiveVar(statGroup);
|
||||
};
|
||||
Template.effectEdit.onRendered(function(){
|
||||
_.defer(() => {
|
||||
const statElement = this.find(".statMenu .iron-selected");
|
||||
statElement && statElement.scrollIntoView();
|
||||
const opElement = this.find(".operationMenu .iron-selected");
|
||||
opElement && opElement.scrollIntoView();
|
||||
});
|
||||
});
|
||||
|
||||
Template.effectEdit.helpers({
|
||||
selectedStatGroup: function(){
|
||||
return Template.instance().selectedStatGroup.get();
|
||||
effect: function(){
|
||||
return Effects.findOne(this.id);
|
||||
},
|
||||
statGroups: function(){
|
||||
return statGroupNames;
|
||||
},
|
||||
stats: function(){
|
||||
var group = Template.instance().selectedStatGroup.get();
|
||||
var group = this;
|
||||
return statGroups[group];
|
||||
},
|
||||
operations: function(){
|
||||
var group = Template.instance().selectedStatGroup.get();
|
||||
var stat = statsDict[this.stat];
|
||||
var group = stat && stat.group;
|
||||
if (group === "Weakness/Resistance") return null;
|
||||
if (group === "Saving Throws" || group === "Skills"){
|
||||
return skillOperations;
|
||||
@@ -118,85 +127,129 @@ Template.effectEdit.helpers({
|
||||
return attributeOperations;
|
||||
}
|
||||
},
|
||||
effectValueTemplate: function(){
|
||||
//resistance/vulnerability template
|
||||
var group = Template.instance().selectedStatGroup.get();
|
||||
if (group === "Weakness/Resistance") return "multiplierEffectValue";
|
||||
|
||||
showMultiplierOperations: function(){
|
||||
var stat = statsDict[this.stat];
|
||||
return stat && stat.group === "Weakness/Resistance"
|
||||
},
|
||||
showEffectValueInput: function(){
|
||||
var stat = statsDict[this.stat];
|
||||
var group = stat && stat.group;
|
||||
if (
|
||||
group === "Weakness/Resistance"
|
||||
) return false;
|
||||
var op = this.operation;
|
||||
if (!op) return null;
|
||||
//operations that don't need templates
|
||||
if (op === "advantage" || op === "disadvantage" || op === "fail") return null;
|
||||
|
||||
//default template
|
||||
return "regularEffectValue";
|
||||
}
|
||||
});
|
||||
|
||||
Template.regularEffectValue.helpers({
|
||||
if (
|
||||
!op ||
|
||||
op === "advantage" ||
|
||||
op === "disadvantage" ||
|
||||
op === "fail"
|
||||
) return false;
|
||||
return true;
|
||||
},
|
||||
effectValue: function(){
|
||||
return this.calculation || this.value;
|
||||
}
|
||||
},
|
||||
isGroupSelected: function(groupName, statName){
|
||||
var stat = statsDict[statName]
|
||||
return stat && (stat.group === groupName);
|
||||
},
|
||||
});
|
||||
|
||||
Template.effectEdit.events({
|
||||
"tap .deleteEffect": function(event){
|
||||
Effects.softRemoveNode(this._id);
|
||||
GlobalUI.deletedToast(this._id, "Effects", "Effect");
|
||||
},
|
||||
"core-select .statGroupDropDown": function(event, instance){
|
||||
var detail = event.originalEvent.detail;
|
||||
if (!detail.isSelected) return;
|
||||
var groupName = detail.item.getAttribute("name");
|
||||
var oldName = Template.instance().selectedStatGroup.get();
|
||||
if (oldName != groupName){
|
||||
instance.selectedStatGroup.set(groupName);
|
||||
if (groupName === "Weakness/Resistance"){
|
||||
Effects.update(this._id, {$set: {
|
||||
value: 0.5,
|
||||
calculation: "",
|
||||
operation: "mul"}, $unset: {stat: ""}});
|
||||
} else {
|
||||
Effects.update(this._id,
|
||||
{$set: {operation: "add"},
|
||||
$unset: {stat: "", value: "", calculation: ""}});
|
||||
}
|
||||
var setStat = function(statName, effectId){
|
||||
var setter = {stat: statName};
|
||||
var effect = Effects.findOne(this._id);
|
||||
var group = statsDict[statName].group;
|
||||
if (group === "Saving Throws" || group === "Skills"){
|
||||
// Skills must have a valid skill operation
|
||||
if (!_.contains(
|
||||
_.map(skillOperations, ao => ao.operation),
|
||||
effect.operation
|
||||
)){
|
||||
setter.operation = "add";
|
||||
}
|
||||
} else if (group !== "Weakness/Resistance"){
|
||||
// Attributes must have a valid attribute operation
|
||||
if (!_.contains(
|
||||
_.map(attributeOperations, ao => ao.operation),
|
||||
effect.operation
|
||||
)){
|
||||
setter.operation = "base";
|
||||
}
|
||||
} else {
|
||||
// Weakness/Resistance must have a mul operation and value
|
||||
if (effect.operation !== "mul"){
|
||||
setter.operation = "mul";
|
||||
}
|
||||
if (!_.contains([0, 0.5, 2], effect.value)){
|
||||
setter.value = 0.5;
|
||||
}
|
||||
}
|
||||
Effects.update(effectId, {$set: setter});
|
||||
};
|
||||
|
||||
var scrollAnimationId;
|
||||
var scrollElementToView = element => {
|
||||
var scrollFunction = function(){
|
||||
element.scrollIntoView();
|
||||
scrollAnimationId = requestAnimationFrame(scrollFunction);
|
||||
};
|
||||
return scrollFunction;
|
||||
}
|
||||
|
||||
Template.effectEdit.events({
|
||||
"click #deleteButton": function(event, instance){
|
||||
Effects.softRemoveNode(instance.data.id);
|
||||
GlobalUI.deletedToast(instance.data.id, "Effects", "Effect");
|
||||
popDialogStack();
|
||||
},
|
||||
"core-select .statDropDown": function(event){
|
||||
"click .statGroupTitle": function(event, instance){
|
||||
var groupName = this.toString();
|
||||
var firstStat = statGroups[groupName][0].stat;
|
||||
setStat(firstStat, instance.data.id);
|
||||
scrollAnimationId = requestAnimationFrame(scrollElementToView(event.target));
|
||||
_.delay(() => cancelAnimationFrame(scrollAnimationId), 300);
|
||||
},
|
||||
"iron-select .statMenu": function(event){
|
||||
var detail = event.originalEvent.detail;
|
||||
if (!detail.isSelected) return;
|
||||
var statName = detail.item.getAttribute("name");
|
||||
if (statName == this.stat) return;
|
||||
Effects.update(this._id, {$set: {stat: statName}});
|
||||
setStat(statName, this._id);
|
||||
},
|
||||
"core-select .operationDropDown": function(event){
|
||||
"iron-select .operationMenu": function(event){
|
||||
var detail = event.originalEvent.detail;
|
||||
if (!detail.isSelected) return;
|
||||
var opName = detail.item.getAttribute("name");
|
||||
if (opName == this.operation) return;
|
||||
Effects.update(this._id, {$set: {operation: opName}});
|
||||
},
|
||||
"core-select .damageMultiplierDropDown": function(event){
|
||||
"iron-select .multiplierMenu": function(event){
|
||||
var detail = event.originalEvent.detail;
|
||||
if (!detail.isSelected) return;
|
||||
var value = +detail.item.getAttribute("name");
|
||||
if (value == this.value) return;
|
||||
Effects.update(this._id, {$set: {
|
||||
value: value,
|
||||
calculation: "",
|
||||
operation: "mul"
|
||||
operation: "mul",
|
||||
}});
|
||||
},
|
||||
"change .effectValueInput": function(event){
|
||||
"change .effectValueInput, input .effectValueInput":
|
||||
_.debounce(function(event){
|
||||
var value = event.currentTarget.value;
|
||||
var numValue = +value;
|
||||
var numValue = value === "" ? NaN : +value;
|
||||
if (_.isFinite(numValue)){
|
||||
if (this.value === numValue) return;
|
||||
Effects.update(this._id, {$set: {value: numValue, calculation: ""}});
|
||||
Effects.update(this._id, {
|
||||
$set: {value: numValue},
|
||||
$unset: {calculation: ""},
|
||||
});
|
||||
} else if (_.isString(value)){
|
||||
if (this.calculation === value) return;
|
||||
Effects.update(this._id, {$set: {value: "", calculation: value}});
|
||||
Effects.update(this._id, {
|
||||
$set: {calculation: value},
|
||||
$unset: {value: ""},
|
||||
}, {
|
||||
removeEmptyStrings: false,
|
||||
trimStrings: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
}, 400),
|
||||
});
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
<template name="effectView">
|
||||
<tr>
|
||||
<td>{{statName}}</td>
|
||||
<td>{{operationName}}{{statValue}}</td>
|
||||
</tr>
|
||||
<td>{{statName}}</td>
|
||||
<td>{{operationName}}{{statValue}}</td>
|
||||
</template>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
//TODO add dexterity armor
|
||||
var stats = {
|
||||
"strength":{"name":"Strength"},
|
||||
"dexterity":{"name":"Dexterity"},
|
||||
@@ -42,6 +41,7 @@ var stats = {
|
||||
"rageDamage":{"name":"Rage Damage"},
|
||||
"expertiseDice":{"name":"Expertise Dice"},
|
||||
"superiorityDice":{"name":"Superiority Dice"},
|
||||
"carryMultiplier": {"name": "Carry Capacity Multiplier"},
|
||||
"level1SpellSlots":{"name":"level 1 Spell Slots"},
|
||||
"level2SpellSlots":{"name":"level 2 Spell Slots"},
|
||||
"level3SpellSlots":{"name":"level 3 Spell Slots"},
|
||||
@@ -57,40 +57,40 @@ var stats = {
|
||||
"d12HitDice":{"name":"d12 Hit Dice"},
|
||||
"acidMultiplier":{"name":"Acid damage", "group": "Weakness/Resistance"},
|
||||
"bludgeoningMultiplier":{
|
||||
"name":"Bludgeoning damage", "group": "Weakness/Resistance"
|
||||
"name":"Bludgeoning damage", "group": "Weakness/Resistance",
|
||||
},
|
||||
"coldMultiplier":{
|
||||
"name":"Cold damage", "group": "Weakness/Resistance"
|
||||
"name":"Cold damage", "group": "Weakness/Resistance",
|
||||
},
|
||||
"fireMultiplier":{
|
||||
"name":"Fire damage", "group": "Weakness/Resistance"
|
||||
"name":"Fire damage", "group": "Weakness/Resistance",
|
||||
},
|
||||
"forceMultiplier":{
|
||||
"name":"Force damage", "group": "Weakness/Resistance"
|
||||
"name":"Force damage", "group": "Weakness/Resistance",
|
||||
},
|
||||
"lightningMultiplier":{
|
||||
"name":"Lightning damage", "group": "Weakness/Resistance"
|
||||
"name":"Lightning damage", "group": "Weakness/Resistance",
|
||||
},
|
||||
"necroticMultiplier":{
|
||||
"name":"Necrotic damage", "group": "Weakness/Resistance"
|
||||
"name":"Necrotic damage", "group": "Weakness/Resistance",
|
||||
},
|
||||
"piercingMultiplier":{
|
||||
"name":"Piercing damage", "group": "Weakness/Resistance"
|
||||
"name":"Piercing damage", "group": "Weakness/Resistance",
|
||||
},
|
||||
"poisonMultiplier":{
|
||||
"name":"Poison damage", "group": "Weakness/Resistance"
|
||||
"name":"Poison damage", "group": "Weakness/Resistance",
|
||||
},
|
||||
"psychicMultiplier":{
|
||||
"name":"Psychic damage", "group": "Weakness/Resistance"
|
||||
"name":"Psychic damage", "group": "Weakness/Resistance",
|
||||
},
|
||||
"radiantMultiplier":{
|
||||
"name":"Radiant damage", "group": "Weakness/Resistance"
|
||||
"name":"Radiant damage", "group": "Weakness/Resistance",
|
||||
},
|
||||
"slashingMultiplier":{
|
||||
"name":"Slashing damage", "group": "Weakness/Resistance"
|
||||
"name":"Slashing damage", "group": "Weakness/Resistance",
|
||||
},
|
||||
"thunderMultiplier":{
|
||||
"name":"Thunder damage", "group": "Weakness/Resistance"
|
||||
"name":"Thunder damage", "group": "Weakness/Resistance",
|
||||
},
|
||||
};
|
||||
|
||||
@@ -98,7 +98,7 @@ var operations = {
|
||||
base: {name: "Base Value: "},
|
||||
proficiency: {name: "Proficiency"},
|
||||
add: {name: "+"},
|
||||
mul: {name: "x"},
|
||||
mul: {name: "×"},
|
||||
min: {name: "Min: "},
|
||||
max: {name: "Max: "},
|
||||
advantage: {name: "Advantage"},
|
||||
@@ -110,8 +110,8 @@ var operations = {
|
||||
Template.effectView.helpers({
|
||||
sourceName: function(){
|
||||
var id = this.parent.id;
|
||||
if(!id) return;
|
||||
switch(this.parent.collection){
|
||||
if (!id) return;
|
||||
switch (this.parent.collection){
|
||||
case "Features":
|
||||
return "Feature - " + Features.findOne(id, {fields: {name: 1}}).name;
|
||||
case "Classes":
|
||||
@@ -130,33 +130,43 @@ Template.effectView.helpers({
|
||||
return stats[this.stat] && stats[this.stat].name || "No Stat";
|
||||
},
|
||||
operationName: function(){
|
||||
if(this.operation === "proficiency" ||
|
||||
this.operation === "conditional") return null;
|
||||
if(stats[this.stat].group === "Weakness/Resistance") return null;
|
||||
if(this.operation === "add" && evaluateEffect(this.charId, this) < 0) return null;
|
||||
return operations[this.operation] && operations[this.operation].name || "No Operation";
|
||||
if (
|
||||
this.operation === "proficiency" ||
|
||||
this.operation === "conditional"
|
||||
) return null;
|
||||
if (stats[this.stat] && stats[this.stat].group === "Weakness/Resistance")
|
||||
return null;
|
||||
if (this.operation === "add" && evaluateEffect(this.charId, this) < 0)
|
||||
return null;
|
||||
return operations[this.operation] &&
|
||||
operations[this.operation].name || "No Operation";
|
||||
},
|
||||
statValue: function(){
|
||||
if(this.operation === "advantage" ||
|
||||
this.operation === "disadvantage" ||
|
||||
this.operation === "fail"){
|
||||
if (
|
||||
this.operation === "advantage" ||
|
||||
this.operation === "disadvantage" ||
|
||||
this.operation === "fail"
|
||||
){
|
||||
return null;
|
||||
}
|
||||
if(this.operation === "proficiency"){
|
||||
if(this.value == 0.5 || this.calculation == 0.5) return "Half Proficiency";
|
||||
if(this.value == 1 || this.calculation == 1) return "Proficiency";
|
||||
if(this.value == 2 || this.calculation == 2) return "Double Proficiency";
|
||||
if (this.operation === "proficiency"){
|
||||
if (this.value == 0.5 || this.calculation == 0.5)
|
||||
return "Half Proficiency";
|
||||
if (this.value == 1 || this.calculation == 1)
|
||||
return "Proficiency";
|
||||
if (this.value == 2 || this.calculation == 2)
|
||||
return "Double Proficiency";
|
||||
}
|
||||
if(this.operation === "conditional"){
|
||||
if (this.operation === "conditional"){
|
||||
return this.calculation || this.value;
|
||||
}
|
||||
if(stats[this.stat].group === "Weakness/Resistance"){
|
||||
if(this.value === 0.5) return "Resistance";
|
||||
if(this.value === 2) return "Vulnerability";
|
||||
if(this.value === 0) return "Immunity";
|
||||
if (stats[this.stat] && stats[this.stat].group === "Weakness/Resistance"){
|
||||
if (this.value === 0.5) return "Resistance";
|
||||
if (this.value === 2) return "Vulnerability";
|
||||
if (this.value === 0) return "Immunity";
|
||||
}
|
||||
var value = evaluateEffect(this.charId, this);
|
||||
if(_.isNumber(value)) return value;
|
||||
if (_.isNumber(value)) return value;
|
||||
return this.calculation || this.value;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
.effectsEditList .effect {
|
||||
background: white;
|
||||
}
|
||||
@@ -1,13 +1,20 @@
|
||||
<!--needs to be given charId, parentId and parentCollection-->
|
||||
<template name="effectsEditList">
|
||||
{{#if effects.count}}
|
||||
<hr class="vertMargin">
|
||||
<div id="effects">
|
||||
<h2>Effects</h2>
|
||||
{{#each effects}}
|
||||
{{>effectEdit}}
|
||||
{{/each}}
|
||||
{{#if effects.length}}
|
||||
<div class="effectsEditList">
|
||||
<div class="paper-font-title">Effects</div>
|
||||
<table class="wideTable" style="width: 100%;">
|
||||
{{#each effects}}
|
||||
<tr class="effect" data-id={{_id}}>
|
||||
{{>effectView}}
|
||||
<td>
|
||||
<paper-icon-button class="edit-effect" icon="create">
|
||||
</paper-icon-button>
|
||||
</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</table>
|
||||
</div>
|
||||
{{/if}}
|
||||
<paper-button id="addEffectButton" class="red-button" raised>Add Effect</paper-button>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
@@ -8,17 +8,17 @@ Template.effectsEditList.helpers({
|
||||
if (this.parentGroup){
|
||||
selector["parent.group"] = this.parentGroup;
|
||||
}
|
||||
var cursor = Effects.find(selector);
|
||||
return cursor;
|
||||
var effects = Effects.find(selector).fetch();
|
||||
return _.sortBy(effects, effect => statOrder[effect.stat] || 999);
|
||||
}
|
||||
});
|
||||
|
||||
Template.effectsEditList.events({
|
||||
"tap #addEffectButton": function(){
|
||||
"tap #addEffectButton": function(event, instance){
|
||||
if (!_.isBoolean(this.enabled)) {
|
||||
this.enabled = true;
|
||||
}
|
||||
Effects.insert({
|
||||
const effectId = Effects.insert({
|
||||
name: this.name,
|
||||
charId: this.charId,
|
||||
parent: {
|
||||
@@ -29,5 +29,18 @@ Template.effectsEditList.events({
|
||||
operation: "add",
|
||||
enabled: this.enabled,
|
||||
});
|
||||
pushDialogStack({
|
||||
template: "effectEdit",
|
||||
data: {id: effectId},
|
||||
element: event.currentTarget,
|
||||
returnElement: () => instance.find(`tr.effect[data-id='${effectId}']`),
|
||||
});
|
||||
},
|
||||
"tap .edit-effect": function(event, template){
|
||||
pushDialogStack({
|
||||
template: "effectEdit",
|
||||
data: {id: this._id},
|
||||
element: event.currentTarget.parentElement.parentElement,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
<!--needs to be given charId, (parentId or stat) and type-->
|
||||
<template name="effectsViewList">
|
||||
{{#if effects.count}}
|
||||
<hr style="margin: 16px 0 16px 0;">
|
||||
{{#if effects.length}}
|
||||
<div class="effects">
|
||||
<h2 class="spaceAfter">Effects</h2>
|
||||
<div class="spaceAfter paper-font-title">Effects</div>
|
||||
<table class="wideTable">
|
||||
{{#each effects}}
|
||||
{{>effectView}}
|
||||
<tr>{{>effectView}}</tr>
|
||||
{{/each}}
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -2,11 +2,14 @@ Template.effectsViewList.helpers({
|
||||
effects: function(){
|
||||
var selector = {
|
||||
"parent.id": this.parentId,
|
||||
"charId": this.charId
|
||||
"charId": this.charId,
|
||||
};
|
||||
if (this.parentGroup){
|
||||
selector["parent.group"] = this.parentGroup;
|
||||
}
|
||||
return Effects.find(selector, {fields: {parent: 0}});
|
||||
let effects = Effects.find(selector, {
|
||||
fields: {parent: 0},
|
||||
}).fetch();
|
||||
return _.sortBy(effects, effect => statOrder[effect.stat] || 999);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
.exportDialog .iiexport {
|
||||
overflow-y: auto;
|
||||
width: 100% !important;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<template name="exportDialog">
|
||||
<div class="exportDialog fit layout vertical">
|
||||
{{#with character}}
|
||||
<app-header fixed effects="waterfall">
|
||||
<app-toolbar>
|
||||
<div main-title>Export Character to Improved Initiative</div>
|
||||
</app-toolbar>
|
||||
</app-header>
|
||||
<div class="form flex layout vertical">
|
||||
<paper-toggle-button id="exportFeatures" checked={{settings.exportFeatures}}>
|
||||
Features
|
||||
</paper-toggle-button>
|
||||
<paper-toggle-button id="exportAttacks" checked={{settings.exportAttacks}}>
|
||||
Attacks
|
||||
</paper-toggle-button>
|
||||
<paper-toggle-button id="exportDescription" checked={{settings.exportDescription}}>
|
||||
Description
|
||||
</paper-toggle-button>
|
||||
<div class="paper-font-title padded">JSON</div>
|
||||
<textarea class="flex iiexport">{{improvedInitiativeJson}}</textarea>
|
||||
<paper-button id="copyExportButton" class="red-button" raised>
|
||||
<iron-icon icon="content-copy"></iron-icon>
|
||||
Copy to Clipboard
|
||||
</paper-button>
|
||||
</div>
|
||||
<div class="buttons layout horizontal end-justified">
|
||||
<paper-button class="doneButton"> Done </paper-button>
|
||||
</div>
|
||||
{{/with}}
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,60 @@
|
||||
Template.exportDialog.helpers({
|
||||
character: function(){
|
||||
return Characters.findOne(this._id);
|
||||
},
|
||||
improvedInitiativeJson: function(){
|
||||
var options = {
|
||||
features: this.settings.exportFeatures,
|
||||
attacks: this.settings.exportAttacks,
|
||||
description: this.settings.exportDescription,
|
||||
}
|
||||
return improvedInitiativeJson(this._id, options);
|
||||
},
|
||||
});
|
||||
|
||||
Template.exportDialog.events({
|
||||
"change #exportFeatures": function(event, template){
|
||||
Characters.update(this._id, {$set: {
|
||||
"settings.exportFeatures": event.target.checked,
|
||||
}});
|
||||
},
|
||||
"change #exportAttacks": function(event, template){
|
||||
Characters.update(this._id, {$set: {
|
||||
"settings.exportAttacks": event.target.checked,
|
||||
}});
|
||||
},
|
||||
"change #exportDescription": function(event, template){
|
||||
Characters.update(this._id, {$set: {
|
||||
"settings.exportDescription": event.target.checked,
|
||||
}});
|
||||
},
|
||||
"click #copyExportButton": function(event, template){
|
||||
var copyTextarea = template.find(".iiexport");
|
||||
copyTextarea.select();
|
||||
var msg;
|
||||
try {
|
||||
var successful = document.execCommand("copy");
|
||||
var msg = successful ? "JSON copied to clipboard" : "Unable to copy JSON";
|
||||
} catch (err) {
|
||||
msg = "Unable to copy JSON";
|
||||
} finally {
|
||||
clearSelection();
|
||||
GlobalUI.toast(msg);
|
||||
}
|
||||
},
|
||||
"click .doneButton": function(event, instance){
|
||||
popDialogStack();
|
||||
},
|
||||
});
|
||||
|
||||
var clearSelection = function(){
|
||||
if (window.getSelection) {
|
||||
if (window.getSelection().empty) { // Chrome
|
||||
window.getSelection().empty();
|
||||
} else if (window.getSelection().removeAllRanges) { // Firefox
|
||||
window.getSelection().removeAllRanges();
|
||||
}
|
||||
} else if (document.selection) { // IE?
|
||||
document.selection.empty();
|
||||
}
|
||||
};
|
||||
@@ -10,10 +10,9 @@
|
||||
|
||||
<template name="featureDetails">
|
||||
{{#if or canEnable hasUses}}
|
||||
<div layout horizontal center justified wrap>
|
||||
<div class="layout horizontal center justified wrap">
|
||||
{{#if canEnable}}
|
||||
<div>enabled:</div>
|
||||
<paper-checkbox class="sideMargin" checked={{enabled}}></paper-checkbox>
|
||||
<paper-checkbox class="sideMargin" checked={{enabled}}>enabled</paper-checkbox>
|
||||
{{/if}}
|
||||
{{#if hasUses}}
|
||||
<div class="subhead" style="margin-right: 16px">
|
||||
@@ -21,7 +20,7 @@
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if hasUses}}
|
||||
<div layout horizontal>
|
||||
<div class="layout horizontal">
|
||||
<paper-button class="useFeature" disabled={{noUsesLeft}}>Use</paper-button>
|
||||
<paper-button class="resetFeature" disabled={{usesFull}}>Reset</paper-button>
|
||||
</div>
|
||||
@@ -32,7 +31,7 @@
|
||||
{{/if}}
|
||||
|
||||
{{#if description}}
|
||||
<div class="prewrap">{{description}}</div>
|
||||
<div>{{#markdown}}{{evaluateString charId description}}{{/markdown}}</div>
|
||||
{{/if}}
|
||||
|
||||
{{> effectsViewList charId=charId parentId=_id}}
|
||||
@@ -41,44 +40,36 @@
|
||||
|
||||
<template name="featureEdit">
|
||||
<!--name-->
|
||||
<paper-input id="featureNameInput" class="fullwidth" label="Name" floatinglabel value={{name}}></paper-input>
|
||||
<paper-input id="featureNameInput" class="fullwidth" label="Name" value={{name}}></paper-input>
|
||||
|
||||
<hr class="vertMargin">
|
||||
|
||||
<div layout horizontal center style="height: 60px;">
|
||||
<paper-dropdown-menu id="enabledDropdown" label="Enable Feature">
|
||||
<paper-dropdown layered class="dropdown">
|
||||
<core-menu id="enabledMenu" class="menu" selected={{enabledSelection}} on-tap="onStatMenuTap">
|
||||
<paper-item name="alwaysEnabled"> Always Enabled </paper-item>
|
||||
<paper-item name="enabled"> Enabled </paper-item>
|
||||
<paper-item name="disabled"> Disabled </paper-item>
|
||||
</core-menu>
|
||||
</paper-dropdown>
|
||||
<div class="layout horizontal center wrap justified">
|
||||
<paper-dropdown-menu class=flex label="Enable Feature" style="flex-basis: 150px; max-width: 200px;">
|
||||
<dicecloud-selector selected={{enabledSelection}} class="dropdown-content enabled-dropdown">
|
||||
<paper-item name="alwaysEnabled" style="width: 150px;">
|
||||
Always Enabled
|
||||
</paper-item>
|
||||
<paper-item name="enabled">
|
||||
Enabled
|
||||
</paper-item>
|
||||
<paper-item name="disabled">
|
||||
Disabled
|
||||
</paper-item>
|
||||
</dicecloud-selector>
|
||||
</paper-dropdown-menu>
|
||||
<div layout horizontal center class="sideMargin">
|
||||
<div>Limit Uses: </div>
|
||||
<paper-toggle-button id="limitUseCheck"
|
||||
class="sideMargin"
|
||||
checked={{usesSet}}
|
||||
role="button"
|
||||
aria-pressed="false"
|
||||
tabindex="0"
|
||||
touch-action="pan-y">
|
||||
</paper-toggle-button>
|
||||
</div>
|
||||
<paper-toggle-button id="limitUseCheck" checked={{usesSet}} style="margin: 0 16px; height: 62px;">
|
||||
Limit uses
|
||||
</paper-toggle-button>
|
||||
{{#if usesSet}}
|
||||
<paper-input flex id="usesInput" label="Uses" floatinglabel value={{uses}}></paper-input>
|
||||
<paper-input id="usesInput" class="flex" label="Uses" value={{uses}} style="flex-basis: 100px; max-width: 200px">
|
||||
{{> formulaSuffix}}
|
||||
</paper-input>
|
||||
{{else}}
|
||||
<div class="flex" style="flex-basis: 100px; max-width: 200px"></div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<hr class="vertMargin">
|
||||
|
||||
<!--description-->
|
||||
<paper-input-decorator label="Description" floatinglabel layout vertical>
|
||||
<paper-autogrow-textarea>
|
||||
<textarea id="featureDescriptionInput" placeholder aria-label="Description" value={{description}}></textarea>
|
||||
</paper-autogrow-textarea>
|
||||
</paper-input-decorator>
|
||||
<paper-textarea label="Description" id="featureDescriptionInput" value={{description}}></paper-textarea>
|
||||
|
||||
{{> effectsEditList parentId=_id parentCollection="Features" charId=charId name=name enabled=enabled}}
|
||||
{{> proficiencyEditList parentId=_id parentCollection="Features" charId=charId enabled=enabled}}
|
||||
|
||||
@@ -11,7 +11,7 @@ Template.featureDialog.events({
|
||||
"tap #deleteButton": function(event, instance){
|
||||
Features.softRemoveNode(instance.data.featureId);
|
||||
GlobalUI.deletedToast(instance.data.featureId, "Features", "Feature");
|
||||
GlobalUI.closeDetail();
|
||||
popDialogStack();
|
||||
},
|
||||
});
|
||||
|
||||
@@ -31,11 +31,11 @@ Template.featureDetails.helpers({
|
||||
});
|
||||
|
||||
Template.featureDetails.events({
|
||||
"tap .useFeature": function(event){
|
||||
"click .useFeature": function(event){
|
||||
var featureId = this._id;
|
||||
Features.update(featureId, {$inc: {used: 1}});
|
||||
},
|
||||
"tap .resetFeature": function(event){
|
||||
"click .resetFeature": function(event){
|
||||
var featureId = this._id;
|
||||
Features.update(featureId, {$set: {used: 0}});
|
||||
},
|
||||
@@ -46,10 +46,6 @@ Template.featureDetails.events({
|
||||
},
|
||||
});
|
||||
|
||||
Template.featureEdit.onRendered(function(){
|
||||
updatePolymerInputs(this);
|
||||
});
|
||||
|
||||
Template.featureEdit.helpers({
|
||||
usesSet: function(){
|
||||
return _.isString(this.uses);
|
||||
@@ -67,32 +63,60 @@ Template.featureEdit.helpers({
|
||||
},
|
||||
});
|
||||
|
||||
const debounce = (f) => _.debounce(f, 300);
|
||||
|
||||
Template.featureEdit.events({
|
||||
"change #featureNameInput": function(event){
|
||||
var name = Template.instance().find("#featureNameInput").value;
|
||||
Features.update(this._id, {$set: {name: name}});
|
||||
},
|
||||
"change #featureDescriptionInput": function(event){
|
||||
var description = Template.instance().find("#featureDescriptionInput").value;
|
||||
Features.update(this._id, {$set: {description: description}});
|
||||
},
|
||||
"change #limitUseCheck": function(event){
|
||||
"input #featureNameInput": debounce(function(event){
|
||||
const input = event.currentTarget;
|
||||
var name = input.value;
|
||||
if (!name){
|
||||
input.invalid = true;
|
||||
input.errorMessage = "Name is required";
|
||||
} else {
|
||||
input.invalid = false;
|
||||
Features.update(this._id, {
|
||||
$set: {name: name}
|
||||
}, {
|
||||
removeEmptyStrings: false,
|
||||
trimStrings: false,
|
||||
});
|
||||
}
|
||||
}),
|
||||
"input #featureDescriptionInput": debounce(function(event){
|
||||
var description = event.currentTarget.value;
|
||||
Features.update(this._id, {
|
||||
$set: {description: description}
|
||||
}, {
|
||||
removeEmptyStrings: false,
|
||||
trimStrings: false,
|
||||
});
|
||||
}),
|
||||
"change #limitUseCheck": debounce(function(event){
|
||||
var currentUses = this.uses;
|
||||
var featureId = this._id;
|
||||
if (event.target.checked && !_.isString(currentUses)){
|
||||
Features.update(featureId, {$set: {uses: ""}}, {removeEmptyStrings: false});
|
||||
Features.update(featureId, {
|
||||
$set: {uses: ""}
|
||||
}, {
|
||||
removeEmptyStrings: false
|
||||
});
|
||||
} else if (!event.target.checked && _.isString(currentUses)){
|
||||
Features.update(featureId, {$unset: {uses: ""}});
|
||||
Features.update(featureId, {
|
||||
$unset: {uses: ""}
|
||||
});
|
||||
}
|
||||
},
|
||||
"change #usesInput, input #quantityInput": function(event){
|
||||
var value = event.target.value;
|
||||
}),
|
||||
"input #usesInput, input #quantityInput": debounce(function(event){
|
||||
var value = event.currentTarget.value;
|
||||
var featureId = this._id;
|
||||
Features.update(featureId, {$set: {uses: value}});
|
||||
},
|
||||
"core-select #enabledDropdown": function(event){
|
||||
Features.update(featureId, {
|
||||
$set: {uses: value}
|
||||
}, {
|
||||
removeEmptyStrings: false,
|
||||
});
|
||||
}),
|
||||
"iron-select .enabled-dropdown": function(event){
|
||||
var detail = event.originalEvent.detail;
|
||||
if (!detail.isSelected) return;
|
||||
var value = detail.item.getAttribute("name");
|
||||
var setter;
|
||||
if (value === "enabled"){
|
||||
|
||||
@@ -2,14 +2,6 @@
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.features {
|
||||
display: flex !important;
|
||||
justify-content: center;
|
||||
align-items: stretch;
|
||||
flex-wrap: wrap;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
.featureCardTop {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
@@ -18,7 +10,7 @@
|
||||
white-space: pre-line;
|
||||
}
|
||||
|
||||
.resourceCards paper-shadow.healthCard {
|
||||
.resourceCards paper-material.healthCard {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,135 +1,158 @@
|
||||
<template name="features">
|
||||
<div fit>
|
||||
<div class="scroll-y" fit>
|
||||
<div class="containers">
|
||||
<!--expertiseDice-->
|
||||
{{>resource name="expertiseDice" title="Expertise Dice" color="teal" char=this}}
|
||||
<!--ki-->
|
||||
{{>resource name="ki" title="Ki Points" color="teal" char=this}}
|
||||
<!--rages-->
|
||||
{{>resource name="rages" title="Rages" color="teal" char=this}}
|
||||
<!--sorceryPoints-->
|
||||
{{>resource name="sorceryPoints" title="Sorcery Points" color="teal" char=this}}
|
||||
<!--superiorityDice-->
|
||||
{{>resource name="superiorityDice" title="Superiority Dice" color="teal" char=this}}
|
||||
|
||||
<!--Attacks-->
|
||||
<paper-shadow class="card container" hero-id="main" {{detailHero}}>
|
||||
<div class="whiteTop" hero-id="toolbar" layout horizontal center {{detailHero}}>
|
||||
<div flex>
|
||||
<div class="containerName subhead">Attacks</div>
|
||||
</div>
|
||||
<!--<paper-icon-button class="black54" id="addAttackButton" icon="add"></paper-icon-button>-->
|
||||
<div class="features">
|
||||
<div class="column-container animation-slider">
|
||||
<!--expertiseDice-->
|
||||
{{>resource name="expertiseDice" title="Expertise Dice" color="teal" char=this}}
|
||||
<!--ki-->
|
||||
{{>resource name="ki" title="Ki Points" color="teal" char=this}}
|
||||
<!--rages-->
|
||||
{{>resource name="rages" title="Rages" color="teal" char=this}}
|
||||
<!--sorceryPoints-->
|
||||
{{>resource name="sorceryPoints" title="Sorcery Points" color="teal" char=this}}
|
||||
<!--superiorityDice-->
|
||||
{{>resource name="superiorityDice" title="Superiority Dice" color="teal" char=this}}
|
||||
|
||||
<!--Attacks-->
|
||||
<div>
|
||||
<paper-material class="card">
|
||||
<div class="top white">
|
||||
Attacks
|
||||
</div>
|
||||
<div class="containerMain listPadded">
|
||||
<div class="bottom list">
|
||||
{{#each attacks}}
|
||||
<div class="itemSlot">
|
||||
<paper-item class="white attack" hero-id="main" {{detailHero}}>
|
||||
<div layout horizontal class="fullwidth">
|
||||
<div class="headline rightPadded" layout horizontal center>
|
||||
<div class="item-slot">
|
||||
<div class="flexible attack item">
|
||||
<div class="layout horizontal">
|
||||
<div class="paper-font-headline layout horizontal center"
|
||||
style="margin-right: 16px;">
|
||||
{{evaluateSigned ../_id attackBonus}}
|
||||
</div>
|
||||
<div layout vertical flex>
|
||||
<div class="body2">
|
||||
<div class="flex layout vertical">
|
||||
<div class="paper-font-body2">
|
||||
{{name}}
|
||||
</div>
|
||||
<div>
|
||||
{{damageDice}} {{{evaluateSignedSpaced ../_id damageBonus}}} {{damageType}}
|
||||
{{evaluateString ../_id damage}} {{damageType}}
|
||||
</div>
|
||||
{{#if details}}
|
||||
<div class="caption">
|
||||
<div>
|
||||
{{details}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</paper-item>
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
</paper-shadow>
|
||||
</paper-material>
|
||||
</div>
|
||||
|
||||
<!--Proficiencies-->
|
||||
<paper-shadow class="card container" hero-id="main" {{detailHero "proficiencies"}}>
|
||||
<div id="proficiencies"
|
||||
class="whiteTop"
|
||||
layout horizontal center>
|
||||
<div class="containerName subhead">Proficiencies</div>
|
||||
<!--Proficiencies-->
|
||||
<div>
|
||||
<paper-material class="card">
|
||||
<div class="white top">
|
||||
Proficiencies
|
||||
</div>
|
||||
<div flex class="containerMain listPadded">
|
||||
<div flex class="bottom list">
|
||||
{{#if weaponProfs.count}}
|
||||
<div class="list-subhead" layout horizontal center>Weapons</div>
|
||||
<div class="paper-font-subhead">Weapons</div>
|
||||
{{/if}}
|
||||
{{#each weaponProfs}}
|
||||
{{> proficiencyListItem}}
|
||||
{{/each}}
|
||||
{{#if armorProfs.count}}
|
||||
<div class="list-subhead" layout horizontal center>Armor</div>
|
||||
<div class="paper-font-subhead">Armor</div>
|
||||
{{/if}}
|
||||
{{#each armorProfs}}
|
||||
{{> proficiencyListItem}}
|
||||
{{/each}}
|
||||
{{#if toolProfs.count}}
|
||||
<div class="list-subhead" layout horizontal center>Tools</div>
|
||||
<div class="paper-font-subhead">Tools</div>
|
||||
{{/if}}
|
||||
{{#each toolProfs}}
|
||||
{{> proficiencyListItem}}
|
||||
{{/each}}
|
||||
</div>
|
||||
</paper-shadow>
|
||||
</paper-material>
|
||||
</div>
|
||||
|
||||
<!--features-->
|
||||
{{#each features}}
|
||||
<paper-shadow class="card container featureCard" hero-id="main" {{detailHero}}>
|
||||
<div class="containerTop {{colorClass}}" hero-id="toolbar" layout horizontal center {{detailHero}}>
|
||||
<paper-ripple fit></paper-ripple>
|
||||
<div class="containerName subhead" hero-id="title" flex {{detailHero}}>{{name}}</div>
|
||||
{{#if hasUses}}<div class="subhead" style="margin-right: 8px">{{usesLeft}}/{{usesValue}}</div>{{/if}}
|
||||
<paper-ripple fit></paper-ripple>
|
||||
<!--features-->
|
||||
{{#each features}}
|
||||
<div>
|
||||
<paper-material class="card featureCard" data-id={{_id}}>
|
||||
<div class="top {{colorClass}} paper-font-subhead layout horizontal">
|
||||
<div class="flex">
|
||||
{{name}}
|
||||
</div>
|
||||
{{#if hasUses}}
|
||||
<div style="margin-right: 8px">
|
||||
{{usesLeft}}/{{usesValue}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if canEnable}}
|
||||
<core-tooltip label="Feature enabled" position="left">
|
||||
<paper-checkbox class="enabledCheckbox" checked={{enabled}}></paper-checkbox>
|
||||
</core-tooltip>
|
||||
<div>
|
||||
<paper-checkbox class="enabledCheckbox"
|
||||
checked={{enabled}}
|
||||
disabled={{#unless canEditCharacter charId}}true{{/unless}}>
|
||||
</paper-checkbox>
|
||||
<paper-tooltip position="left">Feature enabled</paper-tooltip>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{#if description}}<div flex class="containerMain body1 featureDescription">{{description}}</div>{{/if}}
|
||||
{{#if hasUses}}
|
||||
<div class="containerFoot" layout horizontal center end-justified>
|
||||
<paper-button class="useFeature" disabled={{noUsesLeft}}>Use</paper-button>
|
||||
<paper-button class="resetFeature" disabled={{usesFull}}>Reset</paper-button>
|
||||
{{#if description}}
|
||||
<div class="bottom flex">
|
||||
{{#markdown}}{{evaluateShortString charId description}}{{/markdown}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</paper-shadow>
|
||||
{{/each}}
|
||||
</div>
|
||||
<div class="fab-buffer"></div>
|
||||
{{#if hasUses}}
|
||||
<div class="layout horizontal center end-justified">
|
||||
<paper-button class="useFeature"
|
||||
disabled={{noUsesLeft}}>
|
||||
Use
|
||||
</paper-button>
|
||||
<paper-button class="resetFeature"
|
||||
disabled={{usesFull}}>
|
||||
Reset
|
||||
</paper-button>
|
||||
</div>
|
||||
{{/if}}
|
||||
</paper-material>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
<paper-fab id="addFeature"
|
||||
class="floatyButton"
|
||||
icon="add"
|
||||
title="Add"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
aria-label="Add"
|
||||
hero-id="main"></paper-fab>
|
||||
{{#if canEditCharacter _id}}
|
||||
<paper-fab id="addFeature"
|
||||
class="floatyButton"
|
||||
icon="add">
|
||||
<paper-tooltip position="left">Add Feature</paper-tooltip>
|
||||
</paper-fab>
|
||||
{{/if}}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template name="resource">
|
||||
{{#if char.attributeBase name}}
|
||||
<paper-shadow class="card container" hero-id="main" {{detailHero name char._id}} layout horizontal>
|
||||
<div class="containerLeft {{getColor}}" hero-id="toolbar" {{detailHero name char._id}} >
|
||||
<div class="resourceButtons">
|
||||
<paper-icon-button class="resourceUp" icon="arrow-drop-up" disabled={{cantIncrement}}></paper-icon-button>
|
||||
<paper-icon-button class="resourceDown" icon="arrow-drop-down" disabled={{cantDecrement}}></paper-icon-button>
|
||||
{{#if characterCalculate "attributeBase" char._id name}}
|
||||
<div>
|
||||
<paper-material class="card layout horizontal">
|
||||
<div class="left {{getColor}} paper-font-display1 white-text layout horizontal center">
|
||||
<div style="margin-right: 8px;">
|
||||
<paper-icon-button class="resourceUp"
|
||||
icon="arrow-drop-up"
|
||||
disabled={{cantIncrement}}>
|
||||
</paper-icon-button>
|
||||
<paper-icon-button class="resourceDown"
|
||||
icon="arrow-drop-down"
|
||||
disabled={{cantDecrement}}>
|
||||
</paper-icon-button>
|
||||
</div>
|
||||
<div class="resourceValue">{{char.attributeValue name}}</div>
|
||||
<!--<div class="resourceMax">{{char.attributeBase name}}</div>-->
|
||||
<div>{{characterCalculate "attributeValue" char._id name}}</div>
|
||||
<!--<div>/{{char.attributeBase name}}</div>-->
|
||||
</div>
|
||||
<div class="containerRight clickable" flex relative horizontal layout center>
|
||||
<div class="right clickable flex layout horizontal center">
|
||||
{{title}}
|
||||
<paper-ripple fit></paper-ripple>
|
||||
</div>
|
||||
</paper-shadow>
|
||||
</paper-material>
|
||||
</div>
|
||||
{{/if}}
|
||||
</template>
|
||||
|
||||
@@ -7,10 +7,10 @@ Template.features.helpers({
|
||||
return this.usesValue() > 0;
|
||||
},
|
||||
noUsesLeft: function(){
|
||||
return this.usesLeft() <= 0;
|
||||
return this.usesLeft() <= 0 || !canEditCharacter(this.charId);
|
||||
},
|
||||
usesFull: function(){
|
||||
return this.usesLeft() >= this.usesValue();
|
||||
return this.usesLeft() >= this.usesValue() || !canEditCharacter(this.charId);
|
||||
},
|
||||
colorClass: function(){
|
||||
return getColorClass(this.color);
|
||||
@@ -38,54 +38,45 @@ Template.features.helpers({
|
||||
});
|
||||
|
||||
Template.features.events({
|
||||
"tap #addFeature": function(event){
|
||||
"click #addFeature": function(event, instance){
|
||||
var featureId = Features.insert({
|
||||
name: "New Feature",
|
||||
charId: this._id,
|
||||
enabled: true,
|
||||
alwaysEnabled: true,
|
||||
});
|
||||
GlobalUI.setDetail({
|
||||
pushDialogStack({
|
||||
template: "featureDialog",
|
||||
data: {featureId: featureId, charId: this._id, startEditing: true},
|
||||
heroId: featureId,
|
||||
element: event.currentTarget,
|
||||
returnElement: () => instance.find(`.featureCard[data-id='${featureId}']`),
|
||||
});
|
||||
},
|
||||
"tap #addAttackButton": function(event){
|
||||
var charId = this._id;
|
||||
Attacks.insert({
|
||||
charId: charId
|
||||
}, function(error, id){
|
||||
if (!error){
|
||||
GlobalUI.setDetail({
|
||||
template: "attackDialog",
|
||||
data: {attackId: id, charId: charId},
|
||||
heroId: id,
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
"tap .featureCard .containerTop": function(event){
|
||||
"click .featureCard .top": function(event){
|
||||
var featureId = this._id;
|
||||
var charId = Template.parentData()._id;
|
||||
GlobalUI.setDetail({
|
||||
pushDialogStack({
|
||||
template: "featureDialog",
|
||||
data: {featureId: featureId, charId: charId},
|
||||
heroId: featureId,
|
||||
element: event.currentTarget.parentElement,
|
||||
});
|
||||
},
|
||||
"tap .attack": function(event){
|
||||
openParentDialog(this.parent, this.charId, this._id);
|
||||
"click .attack": function(event){
|
||||
openParentDialog({
|
||||
parent: this.parent,
|
||||
charId: this.charId,
|
||||
element: event.currentTarget,
|
||||
});
|
||||
},
|
||||
"tap .useFeature": function(event){
|
||||
"click .useFeature": function(event){
|
||||
var featureId = this._id;
|
||||
Features.update(featureId, {$inc: {used: 1}});
|
||||
},
|
||||
"tap .resetFeature": function(event){
|
||||
"click .resetFeature": function(event){
|
||||
var featureId = this._id;
|
||||
Features.update(featureId, {$set: {used: 0}});
|
||||
},
|
||||
"tap .enabledCheckbox": function(event){
|
||||
"click .enabledCheckbox": function(event){
|
||||
event.stopPropagation();
|
||||
},
|
||||
"change .enabledCheckbox": function(event){
|
||||
@@ -96,16 +87,19 @@ Template.features.events({
|
||||
|
||||
Template.resource.helpers({
|
||||
cantIncrement: function(){
|
||||
var baseBigger = this.char.attributeValue(this.name) <
|
||||
this.char.attributeBase(this.name);
|
||||
return !baseBigger;
|
||||
var value = Characters.calculate.attributeValue(this.char._id, this.name);
|
||||
var base = Characters.calculate.attributeBase(this.char._id, this.name);
|
||||
var baseBigger = value < base;
|
||||
return !baseBigger || !canEditCharacter(this.char._id);
|
||||
},
|
||||
cantDecrement: function(){
|
||||
var valuePositive = this.char.attributeValue(this.name) > 0;
|
||||
return !valuePositive;
|
||||
var value = Characters.calculate.attributeValue(this.char._id, this.name);
|
||||
var valuePositive = value > 0;
|
||||
return !valuePositive || !canEditCharacter(this.char._id);
|
||||
},
|
||||
getColor: function(){
|
||||
if (this.char.attributeValue(this.name) > 0){
|
||||
var value = Characters.calculate.attributeValue(this.char._id, this.name);
|
||||
if (value > 0){
|
||||
return this.color;
|
||||
} else {
|
||||
return "grey";
|
||||
@@ -114,25 +108,28 @@ Template.resource.helpers({
|
||||
});
|
||||
|
||||
Template.resource.events({
|
||||
"tap .resourceUp": function(event){
|
||||
if (this.char.attributeValue(this.name) < this.char.attributeBase(this.name)){
|
||||
"click .resourceUp": function(event){
|
||||
var value = Characters.calculate.attributeValue(this.char._id, this.name);
|
||||
var base = Characters.calculate.attributeBase(this.char._id, this.name);
|
||||
if (value < base){
|
||||
var modifier = {$inc: {}};
|
||||
modifier.$inc[this.name + ".adjustment"] = 1;
|
||||
Characters.update(this.char._id, modifier, {validate: false});
|
||||
}
|
||||
},
|
||||
"tap .resourceDown": function(event){
|
||||
if (this.char.attributeValue(this.name) > 0){
|
||||
"click .resourceDown": function(event){
|
||||
var value = Characters.calculate.attributeValue(this.char._id, this.name);
|
||||
if (value > 0){
|
||||
var modifier = {$inc: {}};
|
||||
modifier.$inc[this.name + ".adjustment"] = -1;
|
||||
Characters.update(this.char._id, modifier, {validate: false});
|
||||
}
|
||||
},
|
||||
"tap .containerRight": function(event, instance) {
|
||||
GlobalUI.setDetail({
|
||||
"click .right": function(event, instance) {
|
||||
pushDialogStack({
|
||||
template: "attributeDialog",
|
||||
data: {name: this.title, statName: this.name, charId: this.char._id},
|
||||
heroId: this.char._id + this.name,
|
||||
element: event.currentTarget.parentElement,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
.carryCapacityBar {
|
||||
background-color: #7DC580;
|
||||
background-color: rgba(255,255,255,0.27);
|
||||
position: relative;
|
||||
height: 4px;
|
||||
}
|
||||
|
||||
.carryCapacityBar div{
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
}
|
||||
.carryCapacityBar .tick {
|
||||
border-right: solid 2px #E5E5E5;
|
||||
border-right-color: rgba(255,255,255,0.54);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<template name="carryCapacityBar">
|
||||
<div class="carryCapacityBar">
|
||||
<div class="carriedWeightBar"
|
||||
style="width: {{carriedPercent}}%;
|
||||
background-color: {{carriedColor}}">
|
||||
</div>
|
||||
<div class="tick"
|
||||
style="width: 33.333%;">
|
||||
</div>
|
||||
<div class="tick"
|
||||
style="width: 66.666%;">
|
||||
</div>
|
||||
</div>
|
||||
{{#if overCarriedPercent}}
|
||||
<div class="carryCapacityBar">
|
||||
<div class="carriedWeightBar"
|
||||
style="width: {{overCarriedPercent}}%;
|
||||
background-color: {{overCarriedColor}}">
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
</template>
|
||||
@@ -0,0 +1,67 @@
|
||||
var getFractionCarried = function(char) {
|
||||
//find out the weight
|
||||
var weight = 0;
|
||||
Containers.find(
|
||||
{charId: char._id, isCarried: true}
|
||||
).forEach(function(container){
|
||||
weight += container.totalWeight();
|
||||
});
|
||||
Items.find(
|
||||
{charId: char._id, "parent.id": char._id},
|
||||
{fields: {weight : 1, quantity: 1}}
|
||||
).forEach(function(item){
|
||||
weight += item.totalWeight();
|
||||
});
|
||||
//get strength
|
||||
var strength = Characters.calculate.attributeValue(char._id, "strength");
|
||||
var carryMultiplier = Characters.calculate
|
||||
.attributeValue(char._id, "carryMultiplier");
|
||||
var capacity = strength * 15 * carryMultiplier;
|
||||
return weight / capacity;
|
||||
};
|
||||
|
||||
Template.carryCapacityBar.onCreated(function() {
|
||||
var self = this;
|
||||
self.carriedFraction = new ReactiveVar(0);
|
||||
self.autorun(function() {
|
||||
self.carriedFraction.set(getFractionCarried(Template.currentData()));
|
||||
});
|
||||
});
|
||||
|
||||
Template.carryCapacityBar.helpers({
|
||||
carriedPercent: function() {
|
||||
var percent = 100 * Template.instance().carriedFraction.get();
|
||||
return percent > 100 ? 100 : percent;
|
||||
},
|
||||
overCarriedPercent: function() {
|
||||
var percent = 100 * Template.instance().carriedFraction.get();
|
||||
var overPercent = percent - 100;
|
||||
if (overPercent < 0) return 0;
|
||||
if (overPercent > 100) return 100;
|
||||
return overPercent;
|
||||
},
|
||||
carriedColor: function() {
|
||||
var frac = Template.instance().carriedFraction.get();
|
||||
if (frac < 1 / 3){
|
||||
return "#2196F3";
|
||||
} else if (frac < 2 / 3){
|
||||
return "#CDDC39";
|
||||
} else if (frac < 1) {
|
||||
return "#FFC107";
|
||||
} else {
|
||||
return "#F44336";
|
||||
}
|
||||
},
|
||||
overCarriedColor: function() {
|
||||
var frac = Template.instance().carriedFraction.get();
|
||||
if (frac < 1 / 3){
|
||||
return "#2196F3";
|
||||
} else if (frac < 2 / 3){
|
||||
return "#CDDC39";
|
||||
} else if (frac < 1) {
|
||||
return "#FFC107";
|
||||
} else {
|
||||
return "#F44336";
|
||||
}
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,17 @@
|
||||
<template name="carryDialog">
|
||||
{{#baseDialog title="Weight Carried" class=color hideEdit=true}}
|
||||
<div class="layout horizontal center-justified end">
|
||||
<div class="paper-font-display2">
|
||||
{{round carriedWeight 1}}
|
||||
</div>
|
||||
<div class="paper-font-display1">
|
||||
lbs
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="vertMargin">
|
||||
|
||||
{{> carryCapacityTable}}
|
||||
|
||||
{{/baseDialog}}
|
||||
</template>
|
||||
@@ -0,0 +1,20 @@
|
||||
Template.carryDialog.helpers({
|
||||
carriedWeight: function() {
|
||||
var weight = 0;
|
||||
Containers.find(
|
||||
{charId: this.charId, isCarried: true}
|
||||
).forEach(function(container){
|
||||
weight += container.totalWeight();
|
||||
});
|
||||
Items.find(
|
||||
{charId: this.charId, "parent.id": this.charId},
|
||||
{fields: {weight : 1, quantity: 1}}
|
||||
).forEach(function(item){
|
||||
weight += item.totalWeight();
|
||||
});
|
||||
return weight;
|
||||
},
|
||||
color: function() {
|
||||
if (this.color) return this.color + " white-text";
|
||||
},
|
||||
});
|
||||
@@ -11,36 +11,30 @@
|
||||
<template name="containerEdit">
|
||||
<paper-input id="containerNameInput"
|
||||
label="Name"
|
||||
floatinglabel
|
||||
value={{name}}></paper-input>
|
||||
<div layout horizontal around-justified wrap>
|
||||
<paper-input-decorator label="Weight" floatinglabel>
|
||||
<input id="weightInput" type="number" value={{weight}}>
|
||||
</paper-input-decorator>
|
||||
<paper-input-decorator label="Value" floatinglabel>
|
||||
<input id="valueInput" type="number" value={{value}}>
|
||||
</paper-input-decorator>
|
||||
<div class="layout horizontal around-justified wrap">
|
||||
<paper-input id="weightInput" label="Weight" type="number" value={{weight}}>
|
||||
</paper-input>
|
||||
<paper-input id="valueInput" label="Value" type="number" value={{value}}>
|
||||
</paper-input>
|
||||
</div>
|
||||
|
||||
<hr class="vertMargin">
|
||||
|
||||
<paper-input-decorator label="Description" floatinglabel layout vertical>
|
||||
<paper-autogrow-textarea>
|
||||
<textarea id="containerDescriptionInput" placeholder aria-label="Description" value={{description}}></textarea>
|
||||
</paper-autogrow-textarea>
|
||||
</paper-input-decorator>
|
||||
<paper-textarea label="Description" id="containerDescriptionInput" value={{description}}>
|
||||
</paper-textarea>
|
||||
</template>
|
||||
|
||||
<template name="containerView">
|
||||
<div layout horizontal wrap center justified>
|
||||
<div class="layout horizontal wrap center justified">
|
||||
<table class="summaryTable fullwidth">
|
||||
<tr><td>Container</td><td>{{weight}}lbs</td><td>{{longValueString value}}</td></tr>
|
||||
<tr><td>Contents</td><td>{{contentsWeight}}lbs</td><td>{{longValueString contentsValue}}</td></tr>
|
||||
<tr class="body2"><td>Total</td><td>{{totalWeight}}lbs</td><td>{{longValueString totalValue}}</td></tr>
|
||||
<tr><td>Container</td><td>{{round weight}} lbs</td><td>{{longValueString value}}</td></tr>
|
||||
<tr><td>Contents</td><td>{{round contentsWeight}} lbs</td><td>{{longValueString contentsValue}}</td></tr>
|
||||
<tr class="paper-font-body2"><td>Total</td><td>{{round totalWeight}} lbs</td><td>{{longValueString totalValue}}</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
{{#if description}}
|
||||
<hr class="vertMargin">
|
||||
<div class="prewrap">{{description}}</div>
|
||||
<div>{{#markdown}}{{evaluateString charId description}}{{/markdown}}</div>
|
||||
{{/if}}
|
||||
</template>
|
||||
|
||||
@@ -14,30 +14,44 @@ Template.containerDialog.events({
|
||||
instance.data.containerId,
|
||||
"Containers", "Container and contents"
|
||||
);
|
||||
GlobalUI.closeDetail();
|
||||
popDialogStack();
|
||||
},
|
||||
});
|
||||
|
||||
Template.containerEdit.onRendered(function(){
|
||||
updatePolymerInputs(this);
|
||||
});
|
||||
|
||||
Template.containerEdit.events({
|
||||
//TODO validate input (integer, non-negative, etc) for these inputs and give validation errors
|
||||
"change #containerNameInput": function(event){
|
||||
"input #containerNameInput": function(event){
|
||||
var name = Template.instance().find("#containerNameInput").value;
|
||||
Containers.update(this._id, {$set: {name: name}});
|
||||
Containers.update(this._id, {
|
||||
$set: {name: name}
|
||||
}, {
|
||||
removeEmptyStrings: false,
|
||||
trimStrings: false,
|
||||
});
|
||||
},
|
||||
"change #weightInput, input #weightInput": function(event){
|
||||
var weight = +Template.instance().find("#weightInput").value;
|
||||
Containers.update(this._id, {$set: {weight: weight}});
|
||||
Containers.update(this._id, {
|
||||
$set: {weight: weight}
|
||||
}, {
|
||||
removeEmptyStrings: false,
|
||||
});
|
||||
},
|
||||
"change #valueInput, input #valueInput": function(event){
|
||||
var value = +Template.instance().find("#valueInput").value;
|
||||
Containers.update(this._id, {$set: {value: value}});
|
||||
Containers.update(this._id, {
|
||||
$set: {value: value}
|
||||
}, {
|
||||
removeEmptyStrings: false,
|
||||
});
|
||||
},
|
||||
"change #containerDescriptionInput": function(event, instance){
|
||||
"input #containerDescriptionInput": function(event, instance){
|
||||
var description = instance.find("#containerDescriptionInput").value;
|
||||
Containers.update(this._id, {$set: {description: description}});
|
||||
Containers.update(this._id, {
|
||||
$set: {description: description}
|
||||
}, {
|
||||
removeEmptyStrings: false,
|
||||
trimStrings: false,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user