Compare commits

...

9 Commits
1.5.0 ... 1.5.3

Author SHA1 Message Date
Stefan Zermatten
614284c73d Updated Meteor and some packages 2017-09-22 12:52:21 +02:00
Stefan Zermatten
6528fc8bab Improved vMix export
closes #138
2017-09-22 11:41:32 +02:00
Stefan Zermatten
020930b2e4 Checked if old hitpoint slider exists before resetting it
closes #135
2017-09-22 11:03:00 +02:00
Stefan Zermatten
dcd76e06e1 Merge branch 'fixbug-137-multiadd-spells-delete-themselves' 2017-09-22 10:43:04 +02:00
Stefan Zermatten
8a58002415 Fixed spells in the library using their library ID's in the spells collection
closes #137
2017-09-22 10:42:34 +02:00
Stefan Zermatten
535fcd77cf Added missing attributes to vmix export 2017-09-13 16:01:05 +02:00
Stefan Zermatten
7c2aed26a4 Fixed vMix export, included vMix parties 2017-09-13 14:01:07 +02:00
Stefan Zermatten
fab052050a Merge branch 'feature-vmix' 2017-09-13 10:01:46 +02:00
Stefan Zermatten
b7bdb141c8 Added basic vMix server side api 2017-09-13 10:01:32 +02:00
10 changed files with 356 additions and 74 deletions

View File

@@ -13,3 +13,5 @@ notices-for-facebook-graph-api-2
1.3.0-split-minifiers-package
1.4.0-remove-old-dev-bundle-link
1.4.1-add-shell-server-package
1.4.3-split-account-service-packages
1.5-add-dynamic-import-package

View File

@@ -4,7 +4,7 @@
# but you can also edit it by hand.
iron:router
accounts-password@1.3.3
accounts-password@1.4.0
accounts-ui@1.1.9
random@1.0.10
dburles:collection-helpers
@@ -18,35 +18,37 @@ dburles:mongo-collection-instances
percolate:migrations
ecwyne:mathjs
useraccounts:polymer
accounts-google@1.0.11
accounts-google@1.2.0
splendido:accounts-meld
email@1.1.18
email@1.2.3
meteorhacks:subs-manager
chuangbo:marked
reywood:iron-router-ga
meteor-base@1.0.4
meteor-base@1.1.0
mobile-experience@1.0.4
mongo@1.1.14
mongo@1.2.0
blaze-html-templates
session@1.1.7
jquery@1.11.10
tracker@1.1.1
logging@1.1.16
tracker@1.1.3
logging@1.1.17
reload@1.1.11
ejson@1.0.13
ejson@1.0.14
spacebars
check@1.2.4
check@1.2.5
useraccounts:iron-routing
wizonesolutions:canonical
standard-minifier-js@1.2.1
shell-server@0.2.1
standard-minifier-js@2.1.1
shell-server@0.2.4
seba:minifiers-autoprefixer
nikogosovd:multiple-uihooks
templates:array
ecmascript@0.6.1
ecmascript@0.8.2
es5-shim@4.6.15
differential:vulcanize
reactive-dict
reactive-dict@1.1.9
percolate:synced-cron
ongoworks:speakingurl
service-configuration
service-configuration@1.0.11
google-config-ui
dynamic-import

View File

@@ -1 +1 @@
METEOR@1.4.2.6
METEOR@1.5.2

View File

@@ -1,53 +1,57 @@
accounts-base@1.2.14
accounts-google@1.0.11
accounts-base@1.3.3
accounts-google@1.2.0
accounts-oauth@1.1.15
accounts-password@1.3.3
accounts-password@1.4.0
accounts-ui@1.1.9
accounts-ui-unstyled@1.1.13
accounts-ui-unstyled@1.2.1
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
allow-deny@1.0.9
autoupdate@1.3.12
babel-compiler@6.13.0
babel-compiler@6.20.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@2.3.2
blaze-html-templates@1.1.2
blaze-tools@1.0.10
boilerplate-generator@1.0.11
boilerplate-generator@1.2.0
caching-compiler@1.1.9
caching-html-compiler@1.1.0
caching-html-compiler@1.1.2
callback-hook@1.0.10
check@1.2.4
check@1.2.5
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
ddp@1.3.1
ddp-client@2.1.3
ddp-common@1.2.9
ddp-rate-limiter@1.0.7
ddp-server@2.0.2
deps@1.0.12
diff-sequence@1.0.7
differential:vulcanize@3.0.0
ecmascript@0.6.1
ecmascript-runtime@0.3.15
dynamic-import@0.1.3
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
ejson@1.0.13
email@1.1.18
ejson@1.0.14
email@1.2.3
es5-shim@4.6.15
fastclick@1.0.13
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
html-tools@1.0.11
htmljs@1.0.11
http@1.2.10
http@1.2.12
id-map@1.0.9
iron:controller@1.0.12
iron:core@1.0.11
@@ -55,45 +59,46 @@ 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
iron:router@1.1.2
iron:url@1.1.0
jquery@1.11.10
lai:collection-extensions@0.2.1_1
launch-screen@1.1.0
launch-screen@1.1.1
less@2.7.9
livedata@1.0.18
localstorage@1.0.12
logging@1.1.16
localstorage@1.1.1
logging@1.1.17
matb33:collection-hooks@0.8.4
mdg:validation-error@0.5.1
meteor@1.6.0
meteor-base@1.0.4
meteor@1.7.2
meteor-base@1.1.0
meteorhacks:subs-manager@1.6.4
minifier-css@1.2.16
minifier-js@1.2.17
minimongo@1.0.19
minifier-js@2.1.3
minimongo@1.3.1
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
mobile-status-bar@1.0.14
modules@0.10.0
modules-runtime@0.8.0
momentjs:moment@2.18.1
mongo@1.2.2
mongo-dev-server@1.0.1
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
npm-bcrypt@0.9.3
npm-mongo@2.2.30
oauth@1.1.13
oauth2@1.1.11
observe-sequence@1.0.14
observe-sequence@1.0.16
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
promise@0.9.0
raix:eventemitter@0.1.3
random@1.0.10
rate-limit@1.0.6
reactive-dict@1.1.8
rate-limit@1.0.8
reactive-dict@1.1.9
reactive-var@1.0.11
reload@1.1.11
retry@1.0.9
@@ -103,27 +108,27 @@ 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
shell-server@0.2.4
softwarerero:accounts-t9n@1.3.11
spacebars@1.0.15
spacebars-compiler@1.1.3
splendido:accounts-emails-field@1.2.0
splendido:accounts-meld@1.3.1
srp@1.0.10
standard-minifier-js@1.2.2
standard-minifier-js@2.1.1
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
templating@1.3.2
templating-compiler@1.3.3
templating-runtime@1.3.2
templating-tools@1.1.2
tracker@1.1.3
ui@1.0.13
underscore@1.0.10
url@1.0.11
url@1.1.0
useraccounts:core@1.14.2
useraccounts:iron-routing@1.14.2
useraccounts:polymer@1.14.2
webapp@1.3.12
webapp@1.3.19
webapp-hashing@1.0.9
wizonesolutions:canonical@0.0.5
zimme:collection-behaviours@1.1.3

View File

@@ -283,6 +283,7 @@ if (Meteor.isClient) {
//create a local memoize with a argument concatenating hash function
var memoize = function(f) {
if (Meteor.isServer) return f;
return Tracker.memoize(f, function() {
return _.reduce(arguments, function(memo, arg) {
return memo + arg;

18
rpg-docs/Routes/API.js Normal file
View File

@@ -0,0 +1,18 @@
Router.map(function() {
this.route("vmixCharacter", {
path: "/vmix-character/:_id/",
where: "server",
action: function() {
this.response.setHeader("Content-Type", "application/json");
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));
},
});
});

View File

@@ -267,9 +267,11 @@ Template.spells.events({
//loop through all returned spells
_.each(resultArray, (rawSpell, index) =>{
// 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) {
spell._id = spellId; //only do this for the first spell added
spell._id = spellId;
}
spell.charId = charId;
spell.parent = {

View File

@@ -16,7 +16,8 @@ Template.healthCard.onRendered(function(){
const id = Template.currentData()._id;
if (oldId !== id){
this.find("#hitPointSlider").resetOldValue();
this.find("#temporaryHitPointSlider").resetOldValue();
var thpSlider = this.find("#temporaryHitPointSlider");
thpSlider && thpSlider.resetOldValue();
oldId = id;
}
});

View 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;
};

View File

@@ -0,0 +1,9 @@
vMixCharacter = function(charId){
return JSON.stringify([characterExport(charId)], null, 2);
};
vMixParty = function(partyId){
var party = Parties.findOne(partyId);
var chars = _.map(party.characters, charId => characterExport(charId));
return JSON.stringify(chars, null, 2);
};