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

View File

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