Basic character generator with all races, archetypes, careers, and adventuring companies from the FMF Core Rules.

This commit is contained in:
Yord 2015-09-25 14:47:23 +02:00
parent 69ef1c4b7b
commit 212898aa5f
11 changed files with 3088 additions and 3259 deletions

File diff suppressed because it is too large Load diff

View file

@ -87,7 +87,7 @@ var ikrpg = ikrpg || {};
"r1m2": false,
"r2": false,
"m2": false,
"ability1": { "title": "ability/benefit", "description": "description", "page": "" },
"ability1": { "title": "ability/benefit", "description": "", "page": "" },
"ability2": { "title": "", "description": "", "page": "" },
"ability3": { "title": "", "description": "", "page": "" },
"ability4": { "title": "", "description": "", "page": "" },
@ -139,7 +139,7 @@ var ikrpg = ikrpg || {};
"benefit9": { "title": "", "description": "", "page": "" },
"benefit10": { "title": "", "description": "", "page": "" },
"benefit11": { "title": "", "description": "", "page": "" },
"spell1": { "title": "spell", "cost": 0, "rng": 0, "aoe": "-", "pow": 0, "up": "NO", "off": "YES", "description": "description" },
"spell1": { "title": "spell", "cost": "", "rng": "", "aoe": "", "pow": "", "up": "", "off": "", "description": "" },
"spell2": { "title": "", "cost": "", "rng": "", "aoe": "", "pow": "", "up": "", "off": "", "description": "" },
"spell3": { "title": "", "cost": "", "rng": "", "aoe": "", "pow": "", "up": "", "off": "", "description": "" },
"spell4": { "title": "", "cost": "", "rng": "", "aoe": "", "pow": "", "up": "", "off": "", "description": "" },
@ -150,7 +150,7 @@ var ikrpg = ikrpg || {};
"spell9": { "title": "", "cost": "", "rng": "", "aoe": "", "pow": "", "up": "", "off": "", "description": "" },
"spell10": { "title": "", "cost": "", "rng": "", "aoe": "", "pow": "", "up": "", "off": "", "description": "" },
"spell11": { "title": "", "cost": "", "rng": "", "aoe": "", "pow": "", "up": "", "off": "", "description": "" },
"gear1": { "title": "gear", "benefit": "benefit" },
"gear1": { "title": "gear", "benefit": "" },
"gear2": { "title": "", "benefit": "" },
"gear3": { "title": "", "benefit": "" },
"gear4": { "title": "", "benefit": "" },
@ -195,11 +195,11 @@ var ikrpg = ikrpg || {};
"capacitor2": { "title": "", "charges": "" }, // sheet
"capacitor3": { "title": "", "charges": "" }, // sheet
"capacitor4": { "title": "", "charges": "" }, // sheet
"note1": { "title": "Permanent Injuries", "text": "None" },
"note1": { "title": "Permanent Injuries", "text": "" },
"note2": { "title": "Spoken Languages", "text": "" },
"note3": { "title": "Religious Beliefs", "text": "" },
"note4": { "title": "Connections", "text": "None" },
"note5": { "title": "Gold", "text": "0 gc" },
"note4": { "title": "Connections", "text": "" },
"note5": { "title": "Gold", "text": "" },
"note6": { "title": "", "text": "" },
"note7": { "title": "", "text": "" },
"note8": { "title": "", "text": "" },

View file

@ -8606,14 +8606,6 @@ var ikrpg = ikrpg || {};
subcategory: "Armor",
game: "FMF"
},
{
name: "Naval Warcaster Armor",
publication: "Kings, Nations, and Gods",
page: "307",
category: "Armory",
subcategory: "Armor",
game: "FMF"
},
{
name: "Nyss Leather Armor",
publication: "Unleashed Core Rules",
@ -15378,6 +15370,14 @@ var ikrpg = ikrpg || {};
game: "FMF"
},
// ##### Mechanika > Mechanikal Armor ##### \\
{
name: "Naval Warcaster Armor",
publication: "Kings, Nations, and Gods",
page: "307",
category: "Mechanika",
subcategory: "Mechanikal Armor",
game: "FMF"
},
{
name: "Opifex Armor",
publication: "No Quarter #48",
@ -15386,6 +15386,14 @@ var ikrpg = ikrpg || {};
subcategory: "Mechanikal Armor",
game: "FMF"
},
{
name: "Warcaster Armor, heavy",
publication: "Core Rules",
page: "290",
category: "Mechanika",
subcategory: "Mechanikal Armor",
game: "FMF"
},
{
name: "Warcaster Armor, light",
publication: "Core Rules",
@ -15402,14 +15410,6 @@ var ikrpg = ikrpg || {};
subcategory: "Mechanikal Armor",
game: "FMF"
},
{
name: "Warcaster Armor, heavy",
publication: "Core Rules",
page: "290",
category: "Mechanika",
subcategory: "Mechanikal Armor",
game: "FMF"
},
// ##### Mechanika > Ironhead Armor ##### \\
{
name: "Ablative Armor",
@ -20595,7 +20595,7 @@ var ikrpg = ikrpg || {};
{
name: "Chymistry",
publication: "Skorne Empire",
page: "69",
page: "68",
category: "Skill",
subcategory: "Occupational Skill",
game: "IKU"

114
static/javascripts/sheet.js Normal file
View file

@ -0,0 +1,114 @@
// global
// var ikrpg
var ikrpg = ikrpg || {};
(function() {
ikrpg.sheet = ikrpg.sheet || {};
var sheet = ikrpg.sheet;
ikrpg.cards.init();
// # Manage characters # \\
(function() {
var db2 = new PouchDB('characters.ikrpg');
var hero = ikrpg.cards.data;
listCharacters();
function saveHero() {
ikrpg.cards.updateData();
hero = ikrpg.cards.data;
var _id = hero["hero-name"].replace(/["']/g, "");
db2.get(_id, function(error, doc) {
if(error) { // hero not in db yet
doc = hero;
doc["_id"] = _id;
db2.put(doc);
} else { // hero already in db
hero["_id"] = doc["_id"];
hero["_rev"] = doc["_rev"];
db2.put(hero);
}
listCharacters();
});
}
function listCharacters() {
$("#characters > tbody").remove();
$("#characters").append("<tbody>");
db2.allDocs({include_docs: true}, function(error, results) {
var rows = results.rows;
$.each(rows, function(index, row) {
var character = row.doc;
function appendTr() {
$("#characters > tbody").append("<tr>");
}
function appendTd() {
$("#characters > tbody > tr:last-of-type").append("<td>");
}
function lastTd() {
return $("#characters > tbody > tr:last-of-type > td:last-of-type");
}
appendTr();
appendTd();
lastTd().text(character["hero-name"]);
appendTd();
lastTd().text(character["archetype"]);
appendTd();
lastTd().text(character["race"]);
appendTd();
lastTd().text(character["careers"]);
appendTd();
lastTd().html("<a href=\"javascript:ikrpg.sheet.showCharacter('"+character["_id"]+"')\">Load</a>");
appendTd();
lastTd().html("<a href=\"javascript:ikrpg.sheet.deleteCharacter('"+character["_id"]+"', '"+character["_rev"]+"')\"><strong>Delete</strong></a>");
});
});
}
function fill(error, character) {
if(!error) {
ikrpg.cards.data = $.extend(ikrpg.cards.data, character);
ikrpg.cards.init();
ikrpg.cards.switchWeapons();
ikrpg.cards.heroNameHack();
ikrpg.cards.setPortrait();
}
}
function showCharacter(characterId) {
db2.get(characterId, sheet.fill);
}
function deleteCharacter(characterId, characterRev) {
db2.remove(characterId, characterRev, function(error, code) {
listCharacters();
});
}
// ## Initialize variables ## \\
sheet.saveHero = saveHero;
sheet.fill = fill;
sheet.showCharacter = showCharacter;
sheet.deleteCharacter = deleteCharacter;
})();
})();