Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
614284c73d | ||
|
|
6528fc8bab | ||
|
|
020930b2e4 | ||
|
|
dcd76e06e1 | ||
|
|
8a58002415 | ||
|
|
535fcd77cf | ||
|
|
7c2aed26a4 |
@@ -13,3 +13,5 @@ notices-for-facebook-graph-api-2
|
|||||||
1.3.0-split-minifiers-package
|
1.3.0-split-minifiers-package
|
||||||
1.4.0-remove-old-dev-bundle-link
|
1.4.0-remove-old-dev-bundle-link
|
||||||
1.4.1-add-shell-server-package
|
1.4.1-add-shell-server-package
|
||||||
|
1.4.3-split-account-service-packages
|
||||||
|
1.5-add-dynamic-import-package
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
# but you can also edit it by hand.
|
# but you can also edit it by hand.
|
||||||
|
|
||||||
iron:router
|
iron:router
|
||||||
accounts-password@1.3.3
|
accounts-password@1.4.0
|
||||||
accounts-ui@1.1.9
|
accounts-ui@1.1.9
|
||||||
random@1.0.10
|
random@1.0.10
|
||||||
dburles:collection-helpers
|
dburles:collection-helpers
|
||||||
@@ -18,35 +18,37 @@ dburles:mongo-collection-instances
|
|||||||
percolate:migrations
|
percolate:migrations
|
||||||
ecwyne:mathjs
|
ecwyne:mathjs
|
||||||
useraccounts:polymer
|
useraccounts:polymer
|
||||||
accounts-google@1.0.11
|
accounts-google@1.2.0
|
||||||
splendido:accounts-meld
|
splendido:accounts-meld
|
||||||
email@1.1.18
|
email@1.2.3
|
||||||
meteorhacks:subs-manager
|
meteorhacks:subs-manager
|
||||||
chuangbo:marked
|
chuangbo:marked
|
||||||
reywood:iron-router-ga
|
reywood:iron-router-ga
|
||||||
meteor-base@1.0.4
|
meteor-base@1.1.0
|
||||||
mobile-experience@1.0.4
|
mobile-experience@1.0.4
|
||||||
mongo@1.1.14
|
mongo@1.2.0
|
||||||
blaze-html-templates
|
blaze-html-templates
|
||||||
session@1.1.7
|
session@1.1.7
|
||||||
jquery@1.11.10
|
jquery@1.11.10
|
||||||
tracker@1.1.1
|
tracker@1.1.3
|
||||||
logging@1.1.16
|
logging@1.1.17
|
||||||
reload@1.1.11
|
reload@1.1.11
|
||||||
ejson@1.0.13
|
ejson@1.0.14
|
||||||
spacebars
|
spacebars
|
||||||
check@1.2.4
|
check@1.2.5
|
||||||
useraccounts:iron-routing
|
useraccounts:iron-routing
|
||||||
wizonesolutions:canonical
|
wizonesolutions:canonical
|
||||||
standard-minifier-js@1.2.1
|
standard-minifier-js@2.1.1
|
||||||
shell-server@0.2.1
|
shell-server@0.2.4
|
||||||
seba:minifiers-autoprefixer
|
seba:minifiers-autoprefixer
|
||||||
nikogosovd:multiple-uihooks
|
nikogosovd:multiple-uihooks
|
||||||
templates:array
|
templates:array
|
||||||
ecmascript@0.6.1
|
ecmascript@0.8.2
|
||||||
es5-shim@4.6.15
|
es5-shim@4.6.15
|
||||||
differential:vulcanize
|
differential:vulcanize
|
||||||
reactive-dict
|
reactive-dict@1.1.9
|
||||||
percolate:synced-cron
|
percolate:synced-cron
|
||||||
ongoworks:speakingurl
|
ongoworks:speakingurl
|
||||||
service-configuration
|
service-configuration@1.0.11
|
||||||
|
google-config-ui
|
||||||
|
dynamic-import
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
METEOR@1.4.2.6
|
METEOR@1.5.2
|
||||||
|
|||||||
@@ -1,53 +1,57 @@
|
|||||||
accounts-base@1.2.14
|
accounts-base@1.3.3
|
||||||
accounts-google@1.0.11
|
accounts-google@1.2.0
|
||||||
accounts-oauth@1.1.15
|
accounts-oauth@1.1.15
|
||||||
accounts-password@1.3.3
|
accounts-password@1.4.0
|
||||||
accounts-ui@1.1.9
|
accounts-ui@1.1.9
|
||||||
accounts-ui-unstyled@1.1.13
|
accounts-ui-unstyled@1.2.1
|
||||||
aldeed:collection2@2.10.0
|
aldeed:collection2@2.10.0
|
||||||
aldeed:collection2-core@1.2.0
|
aldeed:collection2-core@1.2.0
|
||||||
aldeed:schema-deny@1.1.0
|
aldeed:schema-deny@1.1.0
|
||||||
aldeed:schema-index@1.1.1
|
aldeed:schema-index@1.1.1
|
||||||
aldeed:simple-schema@1.5.3
|
aldeed:simple-schema@1.5.3
|
||||||
allow-deny@1.0.5
|
allow-deny@1.0.9
|
||||||
autoupdate@1.3.12
|
autoupdate@1.3.12
|
||||||
babel-compiler@6.13.0
|
babel-compiler@6.20.0
|
||||||
babel-runtime@1.0.1
|
babel-runtime@1.0.1
|
||||||
base64@1.0.10
|
base64@1.0.10
|
||||||
binary-heap@1.0.10
|
binary-heap@1.0.10
|
||||||
blaze@2.3.0
|
blaze@2.3.2
|
||||||
blaze-html-templates@1.1.0
|
blaze-html-templates@1.1.2
|
||||||
blaze-tools@1.0.10
|
blaze-tools@1.0.10
|
||||||
boilerplate-generator@1.0.11
|
boilerplate-generator@1.2.0
|
||||||
caching-compiler@1.1.9
|
caching-compiler@1.1.9
|
||||||
caching-html-compiler@1.1.0
|
caching-html-compiler@1.1.2
|
||||||
callback-hook@1.0.10
|
callback-hook@1.0.10
|
||||||
check@1.2.4
|
check@1.2.5
|
||||||
chuangbo:marked@0.3.5_1
|
chuangbo:marked@0.3.5_1
|
||||||
coffeescript@1.11.1_4
|
coffeescript@1.11.1_4
|
||||||
dburles:collection-helpers@1.1.0
|
dburles:collection-helpers@1.1.0
|
||||||
dburles:mongo-collection-instances@0.3.5
|
dburles:mongo-collection-instances@0.3.5
|
||||||
ddp@1.2.5
|
ddp@1.3.1
|
||||||
ddp-client@1.3.2
|
ddp-client@2.1.3
|
||||||
ddp-common@1.2.8
|
ddp-common@1.2.9
|
||||||
ddp-rate-limiter@1.0.6
|
ddp-rate-limiter@1.0.7
|
||||||
ddp-server@1.3.12
|
ddp-server@2.0.2
|
||||||
deps@1.0.12
|
deps@1.0.12
|
||||||
diff-sequence@1.0.7
|
diff-sequence@1.0.7
|
||||||
differential:vulcanize@3.0.0
|
differential:vulcanize@3.0.0
|
||||||
ecmascript@0.6.1
|
dynamic-import@0.1.3
|
||||||
ecmascript-runtime@0.3.15
|
ecmascript@0.8.2
|
||||||
|
ecmascript-runtime@0.4.1
|
||||||
|
ecmascript-runtime-client@0.4.3
|
||||||
|
ecmascript-runtime-server@0.4.1
|
||||||
ecwyne:mathjs@0.25.0
|
ecwyne:mathjs@0.25.0
|
||||||
ejson@1.0.13
|
ejson@1.0.14
|
||||||
email@1.1.18
|
email@1.2.3
|
||||||
es5-shim@4.6.15
|
es5-shim@4.6.15
|
||||||
fastclick@1.0.13
|
fastclick@1.0.13
|
||||||
geojson-utils@1.0.10
|
geojson-utils@1.0.10
|
||||||
google@1.1.15
|
google-config-ui@1.0.0
|
||||||
|
google-oauth@1.2.4
|
||||||
hot-code-push@1.0.4
|
hot-code-push@1.0.4
|
||||||
html-tools@1.0.11
|
html-tools@1.0.11
|
||||||
htmljs@1.0.11
|
htmljs@1.0.11
|
||||||
http@1.2.10
|
http@1.2.12
|
||||||
id-map@1.0.9
|
id-map@1.0.9
|
||||||
iron:controller@1.0.12
|
iron:controller@1.0.12
|
||||||
iron:core@1.0.11
|
iron:core@1.0.11
|
||||||
@@ -55,45 +59,46 @@ iron:dynamic-template@1.0.12
|
|||||||
iron:layout@1.0.12
|
iron:layout@1.0.12
|
||||||
iron:location@1.0.11
|
iron:location@1.0.11
|
||||||
iron:middleware-stack@1.1.0
|
iron:middleware-stack@1.1.0
|
||||||
iron:router@1.1.1
|
iron:router@1.1.2
|
||||||
iron:url@1.0.11
|
iron:url@1.1.0
|
||||||
jquery@1.11.10
|
jquery@1.11.10
|
||||||
lai:collection-extensions@0.2.1_1
|
lai:collection-extensions@0.2.1_1
|
||||||
launch-screen@1.1.0
|
launch-screen@1.1.1
|
||||||
less@2.7.9
|
less@2.7.9
|
||||||
livedata@1.0.18
|
livedata@1.0.18
|
||||||
localstorage@1.0.12
|
localstorage@1.1.1
|
||||||
logging@1.1.16
|
logging@1.1.17
|
||||||
matb33:collection-hooks@0.8.4
|
matb33:collection-hooks@0.8.4
|
||||||
mdg:validation-error@0.5.1
|
mdg:validation-error@0.5.1
|
||||||
meteor@1.6.0
|
meteor@1.7.2
|
||||||
meteor-base@1.0.4
|
meteor-base@1.1.0
|
||||||
meteorhacks:subs-manager@1.6.4
|
meteorhacks:subs-manager@1.6.4
|
||||||
minifier-css@1.2.16
|
minifier-css@1.2.16
|
||||||
minifier-js@1.2.17
|
minifier-js@2.1.3
|
||||||
minimongo@1.0.19
|
minimongo@1.3.1
|
||||||
mobile-experience@1.0.4
|
mobile-experience@1.0.4
|
||||||
mobile-status-bar@1.0.13
|
mobile-status-bar@1.0.14
|
||||||
modules@0.7.7
|
modules@0.10.0
|
||||||
modules-runtime@0.7.8
|
modules-runtime@0.8.0
|
||||||
momentjs:moment@2.17.1
|
momentjs:moment@2.18.1
|
||||||
mongo@1.1.14
|
mongo@1.2.2
|
||||||
|
mongo-dev-server@1.0.1
|
||||||
mongo-id@1.0.6
|
mongo-id@1.0.6
|
||||||
nikogosovd:multiple-uihooks@0.1.8
|
nikogosovd:multiple-uihooks@0.1.8
|
||||||
npm-bcrypt@0.9.2
|
npm-bcrypt@0.9.3
|
||||||
npm-mongo@2.2.16_1
|
npm-mongo@2.2.30
|
||||||
oauth@1.1.12
|
oauth@1.1.13
|
||||||
oauth2@1.1.11
|
oauth2@1.1.11
|
||||||
observe-sequence@1.0.14
|
observe-sequence@1.0.16
|
||||||
ongoworks:speakingurl@9.0.0
|
ongoworks:speakingurl@9.0.0
|
||||||
ordered-dict@1.0.9
|
ordered-dict@1.0.9
|
||||||
percolate:migrations@0.9.8
|
percolate:migrations@0.9.8
|
||||||
percolate:synced-cron@1.3.2
|
percolate:synced-cron@1.3.2
|
||||||
promise@0.8.8
|
promise@0.9.0
|
||||||
raix:eventemitter@0.1.3
|
raix:eventemitter@0.1.3
|
||||||
random@1.0.10
|
random@1.0.10
|
||||||
rate-limit@1.0.6
|
rate-limit@1.0.8
|
||||||
reactive-dict@1.1.8
|
reactive-dict@1.1.9
|
||||||
reactive-var@1.0.11
|
reactive-var@1.0.11
|
||||||
reload@1.1.11
|
reload@1.1.11
|
||||||
retry@1.0.9
|
retry@1.0.9
|
||||||
@@ -103,27 +108,27 @@ seba:minifiers-autoprefixer@1.0.1
|
|||||||
service-configuration@1.0.11
|
service-configuration@1.0.11
|
||||||
session@1.1.7
|
session@1.1.7
|
||||||
sha@1.0.9
|
sha@1.0.9
|
||||||
shell-server@0.2.1
|
shell-server@0.2.4
|
||||||
softwarerero:accounts-t9n@1.3.7
|
softwarerero:accounts-t9n@1.3.11
|
||||||
spacebars@1.0.13
|
spacebars@1.0.15
|
||||||
spacebars-compiler@1.1.0
|
spacebars-compiler@1.1.3
|
||||||
splendido:accounts-emails-field@1.2.0
|
splendido:accounts-emails-field@1.2.0
|
||||||
splendido:accounts-meld@1.3.1
|
splendido:accounts-meld@1.3.1
|
||||||
srp@1.0.10
|
srp@1.0.10
|
||||||
standard-minifier-js@1.2.2
|
standard-minifier-js@2.1.1
|
||||||
templates:array@1.0.3
|
templates:array@1.0.3
|
||||||
templating@1.3.0
|
templating@1.3.2
|
||||||
templating-compiler@1.3.0
|
templating-compiler@1.3.3
|
||||||
templating-runtime@1.3.0
|
templating-runtime@1.3.2
|
||||||
templating-tools@1.1.0
|
templating-tools@1.1.2
|
||||||
tracker@1.1.1
|
tracker@1.1.3
|
||||||
ui@1.0.12
|
ui@1.0.13
|
||||||
underscore@1.0.10
|
underscore@1.0.10
|
||||||
url@1.0.11
|
url@1.1.0
|
||||||
useraccounts:core@1.14.2
|
useraccounts:core@1.14.2
|
||||||
useraccounts:iron-routing@1.14.2
|
useraccounts:iron-routing@1.14.2
|
||||||
useraccounts:polymer@1.14.2
|
useraccounts:polymer@1.14.2
|
||||||
webapp@1.3.12
|
webapp@1.3.19
|
||||||
webapp-hashing@1.0.9
|
webapp-hashing@1.0.9
|
||||||
wizonesolutions:canonical@0.0.5
|
wizonesolutions:canonical@0.0.5
|
||||||
zimme:collection-behaviours@1.1.3
|
zimme:collection-behaviours@1.1.3
|
||||||
|
|||||||
@@ -1,10 +1,18 @@
|
|||||||
Router.map(function() {
|
Router.map(function() {
|
||||||
this.route("vmixAPI", {
|
this.route("vmixCharacter", {
|
||||||
path: "/vmix-character/:_id/",
|
path: "/vmix-character/:_id/",
|
||||||
where: "server",
|
where: "server",
|
||||||
action: function() {
|
action: function() {
|
||||||
this.response.setHeader("Content-Type", "application/json");
|
this.response.setHeader("Content-Type", "application/json");
|
||||||
this.response.end(vMixJson(this.params._id));
|
this.response.end(vMixCharacter(this.params._id));
|
||||||
|
},
|
||||||
|
});
|
||||||
|
this.route("vmixParty", {
|
||||||
|
path: "/vmix-party/:_id/",
|
||||||
|
where: "server",
|
||||||
|
action: function() {
|
||||||
|
this.response.setHeader("Content-Type", "application/json");
|
||||||
|
this.response.end(vMixParty(this.params._id));
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -267,9 +267,11 @@ Template.spells.events({
|
|||||||
//loop through all returned spells
|
//loop through all returned spells
|
||||||
_.each(resultArray, (rawSpell, index) =>{
|
_.each(resultArray, (rawSpell, index) =>{
|
||||||
// Make the library spell into a regular spell
|
// Make the library spell into a regular spell
|
||||||
let spell = _.omit(rawSpell, "library", "attacks", "effects");
|
let spell = _.omit(rawSpell, "_id", "library", "attacks", "effects");
|
||||||
|
// Use the ID generated earlier for the first spell so we
|
||||||
|
// can animate to it
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
spell._id = spellId; //only do this for the first spell added
|
spell._id = spellId;
|
||||||
}
|
}
|
||||||
spell.charId = charId;
|
spell.charId = charId;
|
||||||
spell.parent = {
|
spell.parent = {
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ Template.healthCard.onRendered(function(){
|
|||||||
const id = Template.currentData()._id;
|
const id = Template.currentData()._id;
|
||||||
if (oldId !== id){
|
if (oldId !== id){
|
||||||
this.find("#hitPointSlider").resetOldValue();
|
this.find("#hitPointSlider").resetOldValue();
|
||||||
this.find("#temporaryHitPointSlider").resetOldValue();
|
var thpSlider = this.find("#temporaryHitPointSlider");
|
||||||
|
thpSlider && thpSlider.resetOldValue();
|
||||||
oldId = id;
|
oldId = id;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
242
rpg-docs/lib/functions/characterExport.js
Normal file
242
rpg-docs/lib/functions/characterExport.js
Normal file
@@ -0,0 +1,242 @@
|
|||||||
|
characterExport = function(charId){
|
||||||
|
var char = Characters.findOne(charId);
|
||||||
|
if (!char) {
|
||||||
|
return {
|
||||||
|
error: charId + " character not found"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
if (char.settings.viewPermission !== "public" && Meteor.isServer){
|
||||||
|
return {
|
||||||
|
error: charId + " character is not viewable to anyone with link"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
var baseValue = function(attributeName){
|
||||||
|
return Characters.calculate.attributeBase(charId, attributeName);
|
||||||
|
};
|
||||||
|
var attributeValue = function(attributeName){
|
||||||
|
return Characters.calculate.attributeValue(charId, attributeName);
|
||||||
|
};
|
||||||
|
var abilityMod = function(attributeName){
|
||||||
|
return signedString(
|
||||||
|
Characters.calculate.abilityMod(charId, attributeName)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
var skillMod = function(skillName){
|
||||||
|
return signedString(
|
||||||
|
Characters.calculate.skillMod(charId, skillName)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
var proficiency = function(skillName){
|
||||||
|
return Characters.calculate.proficiency(charId, skillName);
|
||||||
|
}
|
||||||
|
var damageMods = getDamageMods(charId);
|
||||||
|
var character = {
|
||||||
|
"Id": char._id,
|
||||||
|
"Name": char.name,
|
||||||
|
"Source": "DiceCloud",
|
||||||
|
"Alignment": char.alignment || "",
|
||||||
|
"Gender": char.gender || "",
|
||||||
|
"Race": char.race || "",
|
||||||
|
"Level": Characters.calculate.level(charId),
|
||||||
|
"Experience": Characters.calculate.experience(charId),
|
||||||
|
"Class": getClasses(charId),
|
||||||
|
"HPBase": baseValue("hitPoints"),
|
||||||
|
"HPValue": attributeValue("hitPoints"),
|
||||||
|
"HitDice": getHitDiceString(charId) || "",
|
||||||
|
"AC": attributeValue("armor"),
|
||||||
|
"Initiative": skillMod("initiative"),
|
||||||
|
"Speed": attributeValue("speed"),
|
||||||
|
"ProficiencyBonus": attributeValue("proficiencyBonus"),
|
||||||
|
"passivePerception": Characters.calculate.passiveSkill(charId, "perception"),
|
||||||
|
|
||||||
|
"Languages": getLanguages(charId),
|
||||||
|
"Description": char.description || "",
|
||||||
|
"Backstory": char.backstory || "",
|
||||||
|
"Personality": char.personality || "" ,
|
||||||
|
"Bonds": char.bonds || "",
|
||||||
|
"Ideals": char.ideals || "",
|
||||||
|
"Flaws": char.flaws || "",
|
||||||
|
"PictureURL": char.picture || "",
|
||||||
|
|
||||||
|
"Strength": attributeValue("strength"),
|
||||||
|
"Dexterity": attributeValue("dexterity"),
|
||||||
|
"Constitution": attributeValue("constitution"),
|
||||||
|
"intelligence": attributeValue("intelligence"),
|
||||||
|
"Wisdom": attributeValue("wisdom"),
|
||||||
|
"Charisma": attributeValue("charisma"),
|
||||||
|
|
||||||
|
"StrengthMod": abilityMod("strength"),
|
||||||
|
"DexterityMod": abilityMod("dexterity"),
|
||||||
|
"ConstitutionMod": abilityMod("constitution"),
|
||||||
|
"intelligenceMod": abilityMod("intelligence"),
|
||||||
|
"WisdomMod": abilityMod("wisdom"),
|
||||||
|
"CharismaMod": abilityMod("charisma"),
|
||||||
|
|
||||||
|
"DamageVulnerabilities": damageMods.vulnerabilities,
|
||||||
|
"DamageResistances": damageMods.resistances,
|
||||||
|
"DamageImmunities": damageMods.immunities,
|
||||||
|
|
||||||
|
"StrengthSave": skillMod("strengthSave"),
|
||||||
|
"StrengthSaveProficiency": proficiency("strengthSave"),
|
||||||
|
"DexteritySave": skillMod("dexteritySave"),
|
||||||
|
"DexteritySaveProficiency": proficiency("dexteritySave"),
|
||||||
|
"ConstitutionSave": skillMod("constitutionSave"),
|
||||||
|
"ConstitutionSaveProficiency": proficiency("constitutionSave"),
|
||||||
|
"intelligenceSave": skillMod("intelligenceSave"),
|
||||||
|
"intelligenceSaveProficiency": proficiency("intelligenceSave"),
|
||||||
|
"WisdomSave": skillMod("wisdomSave"),
|
||||||
|
"WisdomSaveProficiency": proficiency("wisdomSave"),
|
||||||
|
"CharismaSave": skillMod("charismaSave"),
|
||||||
|
"CharismaSaveProficiency": proficiency("charismaSave"),
|
||||||
|
|
||||||
|
"Level1SpellSlots": attributeValue("level1SpellSlots"),
|
||||||
|
"Level2SpellSlots": attributeValue("level2SpellSlots"),
|
||||||
|
"Level3SpellSlots": attributeValue("level3SpellSlots"),
|
||||||
|
"Level4SpellSlots": attributeValue("level4SpellSlots"),
|
||||||
|
"Level5SpellSlots": attributeValue("level5SpellSlots"),
|
||||||
|
"Level6SpellSlots": attributeValue("level6SpellSlots"),
|
||||||
|
"Level7SpellSlots": attributeValue("level7SpellSlots"),
|
||||||
|
"Level8SpellSlots": attributeValue("level8SpellSlots"),
|
||||||
|
"Level9SpellSlots": attributeValue("level9SpellSlots"),
|
||||||
|
"Ki": attributeValue("ki"),
|
||||||
|
"Rages": attributeValue("rages"),
|
||||||
|
"RageDamage": attributeValue("rageDamage"),
|
||||||
|
"SorceryPoints": attributeValue("sorceryPoints"),
|
||||||
|
|
||||||
|
"DeathSavePasses": char.deathSave.pass,
|
||||||
|
"DeathSaveFails": char.deathSave.fail,
|
||||||
|
"DeathSaveStable": char.deathSave.stable,
|
||||||
|
};
|
||||||
|
_.extend(character, getSkills(charId));
|
||||||
|
_.extend(character, getAttacks(charId));
|
||||||
|
return character;
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
return string;
|
||||||
|
}
|
||||||
|
|
||||||
|
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).join(", "),
|
||||||
|
"resistances": _.map(multipliers["0.5"], names).join(", "),
|
||||||
|
"vulnerabilities": _.map(multipliers["2"], names).join(", "),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
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 = signedString(
|
||||||
|
Characters.calculate.skillMod(charId, skill.name)
|
||||||
|
);
|
||||||
|
var prof = Characters.calculate.proficiency(charId, skill.name);
|
||||||
|
var name = skill.name.charAt(0).toUpperCase() + skill.name.slice(1);
|
||||||
|
skills[name] = value;
|
||||||
|
skills[name + "Proficiency"] = prof;
|
||||||
|
});
|
||||||
|
return skills;
|
||||||
|
};
|
||||||
|
|
||||||
|
var getLanguages = function(charId){
|
||||||
|
return Proficiencies.find({
|
||||||
|
charId,
|
||||||
|
enabled: true,
|
||||||
|
type: "language",
|
||||||
|
}).map(l => l.name).join(", ");
|
||||||
|
};
|
||||||
|
|
||||||
|
var getClasses = function(charId){
|
||||||
|
return Classes.find({charId}).map(c => `${c.name} ${c.level}`).join(", ");
|
||||||
|
};
|
||||||
|
|
||||||
|
var getAttacks = function(charId){
|
||||||
|
var attacks = {};
|
||||||
|
var i = 1;
|
||||||
|
Attacks.find(
|
||||||
|
{charId, enabled: true},
|
||||||
|
{sort: {color: 1, name: 1}}
|
||||||
|
).forEach(a => {
|
||||||
|
attacks[`Attack${i++}`] = a.name +
|
||||||
|
` +${evaluate(charId, a.attackBonus)} to hit, ` +
|
||||||
|
`${evaluateString(charId, a.damage)} ${a.damageType} damage, ` +
|
||||||
|
`${a.details}`;
|
||||||
|
});
|
||||||
|
return attacks;
|
||||||
|
};
|
||||||
|
|
||||||
|
var signedString = function(number) {
|
||||||
|
return number >= 0 ? "+" + number : "" + number;
|
||||||
|
};
|
||||||
@@ -1,164 +1,9 @@
|
|||||||
vMixJson = function(charId){
|
vMixCharacter = function(charId){
|
||||||
var char = Characters.findOne(charId);
|
return JSON.stringify([characterExport(charId)], null, 2);
|
||||||
if (!char) {
|
|
||||||
return JSON.stringify({
|
|
||||||
error: "character not found"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (char.settings.viewPermission !== "public"){
|
|
||||||
return JSON.stringify({
|
|
||||||
error: "character is not viewable to anyone with link"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
var baseValue = function(attributeName){
|
|
||||||
return Characters.calculate.attributeBase(charId, attributeName);
|
|
||||||
};
|
|
||||||
var attributeValue = function(attributeName){
|
|
||||||
return Characters.calculate.attributeValue(charId, attributeName);
|
|
||||||
};
|
|
||||||
var skillMod = function(skillName){
|
|
||||||
return Characters.calculate.skillMod(charId, skillName);
|
|
||||||
};
|
|
||||||
var damageMods = getDamageMods(charId);
|
|
||||||
var json = [
|
|
||||||
{attribute: "Id", value: char._id},
|
|
||||||
{attribute: "Name", value: char.name},
|
|
||||||
{attribute: "Source", value: "DiceCloud"},
|
|
||||||
{attribute: "Type", value: char.race},
|
|
||||||
{attribute: "HPBase", value: baseValue("hitPoints")},
|
|
||||||
{attribute: "HPValue", value: attributeValue("hitPoints")},
|
|
||||||
{attribute: "HitDice", value: getHitDiceString(charId) || ""},
|
|
||||||
{attribute: "AC", value: attributeValue("armor")},
|
|
||||||
{attribute: "Initiative", value: skillMod("initiative")},
|
|
||||||
{attribute: "Speed", value: attributeValue("speed")},
|
|
||||||
|
|
||||||
{attribute: "Str", value: attributeValue("strength")},
|
|
||||||
{attribute: "Dex", value: attributeValue("dexterity")},
|
|
||||||
{attribute: "Con", value: attributeValue("constitution")},
|
|
||||||
{attribute: "Cha", value: attributeValue("charisma")},
|
|
||||||
{attribute: "Int", value: attributeValue("intelligence")},
|
|
||||||
{attribute: "Wis", value: attributeValue("wisdom")},
|
|
||||||
|
|
||||||
{attribute: "DamageVulnerabilities", value: damageMods.vulnerabilities},
|
|
||||||
{attribute: "DamageResistances", value: damageMods.resistances},
|
|
||||||
{attribute: "DamageImmunities", value: damageMods.immunities},
|
|
||||||
|
|
||||||
{attribute: "StrSave", value: skillMod("strengthSave")},
|
|
||||||
{attribute: "DexSave", value: skillMod("dexteritySave")},
|
|
||||||
{attribute: "ConSave", value: skillMod("constitutionSave")},
|
|
||||||
{attribute: "IntSave", value: skillMod("intelligenceSave")},
|
|
||||||
{attribute: "WisSave", value: skillMod("wisdomSave")},
|
|
||||||
{attribute: "ChaSave", value: skillMod("charismaSave")},
|
|
||||||
{
|
|
||||||
attribute: "passivePerception",
|
|
||||||
value: Characters.calculate.passiveSkill(charId, "perception"),
|
|
||||||
},
|
|
||||||
{attribute: "Languages", value: getLanguages(charId)},
|
|
||||||
{attribute: "Description", value: char.description || ""},
|
|
||||||
];
|
|
||||||
json.push(...getSkills(charId));
|
|
||||||
return JSON.stringify(json, 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).join(", "),
|
|
||||||
"resistances": _.map(multipliers["0.5"], names).join(", "),
|
|
||||||
"vulnerabilities": _.map(multipliers["2"], names).join(", "),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
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({"attribute": skill.name, value});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return skills;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var getLanguages = function(charId){
|
vMixParty = function(partyId){
|
||||||
return Proficiencies.find({
|
var party = Parties.findOne(partyId);
|
||||||
charId,
|
var chars = _.map(party.characters, charId => characterExport(charId));
|
||||||
enabled: true,
|
return JSON.stringify(chars, null, 2);
|
||||||
type: "language",
|
|
||||||
}).map(l => l.name).join(", ");
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user