Updated meteor, added preset modifiers to some attributes

This commit is contained in:
Thaum
2014-11-03 09:24:28 +00:00
parent ba569194ce
commit e7f7f75436
5 changed files with 143 additions and 116 deletions

View File

@@ -4,3 +4,4 @@
notices-for-0.9.0 notices-for-0.9.0
notices-for-0.9.1 notices-for-0.9.1
0.9.4-platform-file

View File

@@ -0,0 +1,2 @@
server
browser

View File

@@ -1 +1 @@
METEOR@0.9.2.2 METEOR@1.0

View File

@@ -1,66 +1,71 @@
accounts-base@1.1.0 accounts-base@1.1.2
accounts-password@1.0.1 accounts-password@1.0.4
accounts-ui-unstyled@1.1.1 accounts-ui-unstyled@1.1.4
accounts-ui@1.1.0 accounts-ui@1.1.3
application-configuration@1.0.2 application-configuration@1.0.3
autopublish@1.0.0 autopublish@1.0.1
autoupdate@1.1.0 autoupdate@1.1.3
base64@1.0.0 base64@1.0.1
binary-heap@1.0.0 binary-heap@1.0.1
blaze-tools@1.0.0 blaze-tools@1.0.1
blaze@2.0.0 blaze@2.0.3
boilerplate-generator@1.0.0 boilerplate-generator@1.0.1
callback-hook@1.0.0 callback-hook@1.0.1
check@1.0.0 check@1.0.2
ctl-helper@1.0.3 ctl-helper@1.0.4
ctl@1.0.1 ctl@1.0.2
ddp@1.0.8 ddp@1.0.11
deps@1.0.3 deps@1.0.5
ejson@1.0.2 ejson@1.0.4
email@1.0.2 email@1.0.4
fastclick@1.0.0 fastclick@1.0.1
follower-livedata@1.0.1 follower-livedata@1.0.2
geojson-utils@1.0.0 geojson-utils@1.0.1
html-tools@1.0.0 html-tools@1.0.2
htmljs@1.0.1 htmljs@1.0.2
http@1.0.5 http@1.0.8
id-map@1.0.0 id-map@1.0.1
insecure@1.0.0 insecure@1.0.1
iron:core@0.3.4 iron:controller@1.0.0
iron:dynamic-template@0.4.1 iron:core@1.0.0
iron:layout@0.4.1 iron:dynamic-template@1.0.0
iron:router@0.9.4 iron:layout@1.0.0
jquery@1.0.0 iron:location@1.0.0
json@1.0.0 iron:middleware-stack@1.0.0
less@1.0.8 iron:router@1.0.0
livedata@1.0.9 iron:url@1.0.0
localstorage@1.0.0 jquery@1.0.1
logging@1.0.3 json@1.0.1
meteor-platform@1.1.0 launch-screen@1.0.0
meteor@1.1.0 less@1.0.11
minifiers@1.1.0 livedata@1.0.11
minimongo@1.0.3 localstorage@1.0.1
mobile-status-bar@1.0.0 logging@1.0.5
mongo@1.0.5 meteor-platform@1.2.0
meteor@1.1.3
minifiers@1.1.2
minimongo@1.0.5
mobile-status-bar@1.0.1
mongo@1.0.8
npm-bcrypt@0.7.7 npm-bcrypt@0.7.7
observe-sequence@1.0.2 observe-sequence@1.0.3
ordered-dict@1.0.0 ordered-dict@1.0.1
random@1.0.0 random@1.0.1
reactive-dict@1.0.2 reactive-dict@1.0.4
reactive-var@1.0.1 reactive-var@1.0.3
reload@1.1.0 reload@1.1.1
retry@1.0.0 retry@1.0.1
routepolicy@1.0.1 routepolicy@1.0.2
service-configuration@1.0.1 service-configuration@1.0.2
session@1.0.1 session@1.0.4
sha@1.0.0 sha@1.0.1
spacebars-compiler@1.0.2 spacebars-compiler@1.0.3
spacebars@1.0.1 spacebars@1.0.3
srp@1.0.0 srp@1.0.1
templating@1.0.6 templating@1.0.9
tracker@1.0.2 tracker@1.0.3
ui@1.0.2 ui@1.0.4
underscore@1.0.0 underscore@1.0.1
url@1.0.0 url@1.0.2
webapp-hashing@1.0.0 webapp-hashing@1.0.1
webapp@1.1.1 webapp@1.1.4

View File

@@ -22,33 +22,46 @@ Attribute = function(base){
} }
var attributes = [ var attributes = [
"strength", {name: "strength"},
"dexterity", {name: "dexterity"},
"constitution", {name: "constitution"},
"intelligence", {name: "intelligence"},
"wisdom", {name: "wisdom"},
"charisma", {name: "charisma"},
"hitPoints", {name: "hitPoints"},
"experience", {name: "experience"},
"proficiencyBonus", {name: "proficiencyBonus",
"speed", add: [
"armor", {name: "Level 1", value: 2}
"weight", ]
"weightCarried", },
"age", {name: "speed",
"ageRate", add: [
"level1SpellSlots", {name: "Base Speed", value: 30}
"level2SpellSlots", ]
"level3SpellSlots", },
"level4SpellSlots", {name: "armor",
"level5SpellSlots", add: [
"level6SpellSlots", {name: "Base Armor Class", value: 10},
"level7SpellSlots", {name: "Dexterity Modifier", value: "skillMod skills.dexterityArmor"}
"level8SpellSlots", ]
"level9SpellSlots", },
"ki", {name: "weight"},
"sorceryPoints", {name: "weightCarried"},
"rages" {name: "age"},
{name: "ageRate"},
{name: "level1SpellSlots"},
{name: "level2SpellSlots"},
{name: "level3SpellSlots"},
{name: "level4SpellSlots"},
{name: "level5SpellSlots"},
{name: "level6SpellSlots"},
{name: "level7SpellSlots"},
{name: "level8SpellSlots"},
{name: "level9SpellSlots"},
{name: "ki"},
{name: "sorceryPoints"},
{name: "rages"}
]; ];
//Skills are bonuses to rolls: "+2" etc. //Skills are bonuses to rolls: "+2" etc.
@@ -98,9 +111,15 @@ var skills = [
{skill: "survival", ability: "wisdom"}, {skill: "survival", ability: "wisdom"},
{skill: "initiative", ability: "dexterity"}, {skill: "initiative", ability: "dexterity"},
{skill: "strengthAttack", ability: "strength"},
{skill: "dexterityAttack", ability: "dexterity"}, {skill: "strengthAttack", ability: "strength", proficiency: 1},
{skill: "rangedAttack", ability: "dexterity"}, {skill: "dexterityAttack", ability: "dexterity", proficiency: 1},
{skill: "constitutionAttack", ability: "constitution", proficiency: 1},
{skill: "intelligenceAttack", ability: "intelligence", proficiency: 1},
{skill: "wisdomAttack", ability: "wisdom", proficiency: 1},
{skill: "charismaAttack", ability: "charisma", proficiency: 1},
{skill: "rangedAttack", ability: "dexterity", proficiency: 1},
{skill: "dexterityArmor", ability: "dexterity"} {skill: "dexterityArmor", ability: "dexterity"}
]; ];
@@ -124,17 +143,19 @@ Character = function(owner){
//attributes //attributes
this.attributes = {}; this.attributes = {};
for(var i = 0, l = attributes.length; i < l; i++){ for(var i = 0, l = attributes.length; i < l; i++){
this.attributes[attributes[i]] = new Attribute(0); this.attributes[attributes[i].name] = new Attribute(0);
this.attributes[attributes[i].name].add = attributes[i].add || [];
this.attributes[attributes[i].name].mul = attributes[i].mul || [];
this.attributes[attributes[i].name].min = attributes[i].min || [];
this.attributes[attributes[i].name].max = attributes[i].max || [];
} }
//add 10 and dex bonus to armor
this.attributes.armor.add.push({name: "Base Armor Class", value: 10});
this.attributes.armor.add.push({name: "Dexterity Modifier", value: "skillMod skills.dexterityArmor"});
//skills //skills
this.skills = {}; this.skills = {};
for(var i = 0, l = skills.length; i < l; i++){ for(var i = 0, l = skills.length; i < l; i++){
this.skills[skills[i].skill] = new Skill(skills[i].ability); this.skills[skills[i].skill] = new Skill(skills[i].ability);
if(skills[i].proficiency)
this.skills[skills[i].skill].proficiency.push(skills[i].proficiency);
} }
this.deathSave = { this.deathSave = {
@@ -154,8 +175,6 @@ Character = function(owner){
this.classes = []; this.classes = [];
this.experience = new Experience();
this.vulnerability = {}; this.vulnerability = {};
for(var i = 0, l = DamageTypes.length; i < l; i++){ for(var i = 0, l = DamageTypes.length; i < l; i++){
this.vulnerability[DamageTypes[i]] = new Attribute(1); this.vulnerability[DamageTypes[i]] = new Attribute(1);
@@ -276,41 +295,41 @@ signedString = function(number){
// turns dot notation strings into keys of root // turns dot notation strings into keys of root
// argument formats: // argument formats:
// 157, anything -> 157 // 157, anything -> 157
// "some.number", object -> object.some.number // "some.number", object -> object.some.number
// "some.function", object -> object.some.function() // "some.function", object -> object.some.function()
// "some.function arg1 arg2", object -> object.some.function(arg1, arg2) // "some.function arg1 arg2", object -> object.some.function(arg1, arg2)
pop = function(input, root){ pop = function(input, root){
if(typeof(input) === "string"){ if(typeof(input) === "string"){
//we need root for this part //we need root for this part
if(root === undefined) return; if(root === undefined) return;
//this is a likely to fail if the string is malformed //this is a likely to fail if the string is malformed
try{ try{
//split over spaces //split over spaces
var parts = input.split(" "); var parts = input.split(" ");
//for each word //for each word
for (var i = 0; i < parts.length; i++){ for (var i = 0; i < parts.length; i++){
//split over dots //split over dots
var str = parts[i].split("."); var str = parts[i].split(".");
//start at root //start at root
parts[i] = root; parts[i] = root;
//for each word between dots //for each word between dots
for (var j = 0; j < str.length; j++){ for (var j = 0; j < str.length; j++){
parts[i] = parts[i][str[j]]; parts[i] = parts[i][str[j]];
} }
} }
//pull the first word out, might be a function //pull the first word out, might be a function
var func = parts.splice(0, 1)[0]; var func = parts.splice(0, 1)[0];
//if it's a function, apply the arguments to it //if it's a function, apply the arguments to it
if(_.isFunction(func)) return +func.apply(root, parts); if(_.isFunction(func)) return +func.apply(root, parts);
//if it's a number, return it //if it's a number, return it
if(!isNaN(func)) return +func; if(!isNaN(func)) return +func;
} catch (err) { } catch (err) {
@@ -320,6 +339,6 @@ pop = function(input, root){
return; return;
} }
} }
return +input; return +input;
} }