[charactermanager] r361 committed - spells

0 views
Skip to first unread message

codesite...@google.com

unread,
Oct 14, 2009, 5:51:09 PM10/14/09
to characterman...@googlegroups.com
Revision: 361
Author: todd.chambery
Date: Wed Oct 14 14:50:27 2009
Log: spells
http://code.google.com/p/charactermanager/source/detail?r=361

Modified:
/trunk/charmgrjs/classes.js
/trunk/charmgrjs/common.js
/trunk/charmgrjs/edit.js
/trunk/charmgrjs/edit_spells.js
/trunk/charmgrjs/edit_weapons.js
/trunk/charmgrjs/main.js
/trunk/charmgrjs/resources/felonious.grendel
/trunk/charmgrjs/special_abilities.js

=======================================
--- /trunk/charmgrjs/classes.js Tue Oct 13 14:07:39 2009
+++ /trunk/charmgrjs/classes.js Wed Oct 14 14:50:27 2009
@@ -57,7 +57,8 @@
bonus_feats_levels: [6, 12, 18],
class_feats: {
1: [6, 7, 58, 43, 61]
- }
+ },
+ hd: 12
}, {
id: 1,
name: "Bard",
@@ -74,7 +75,8 @@
bonus_feats_levels: [5, 10],
class_feats: {
1: [6, 58, 61]
- }
+ },
+ hd: 6
}, {
id: 2,
name: "Cleric",
@@ -92,7 +94,8 @@
class_feats: {
1: [5, 6, 7, 58, 61]
},
- languages: [0, 3, 14]
+ languages: [0, 3, 14],
+ hd: 8
}, {
id: 3,
name: "Druid",
@@ -110,7 +113,8 @@
class_feats: {
1: [6, 7]
},
- languages: [16]
+ languages: [16],
+ hd: 8
}, {
id: 4,
name: "Fighter",
@@ -128,7 +132,8 @@
bonus_feats: [9, 11, 13, 19, 20, 24, 27, 29, 32, 33, 34, 36, 37, 38,
45, 46, 48, 48, 49, 50, 51, 52, 54, 55, 59, 65, 66, 68, 72, 73, 74, 75, 76,
77, 78, 79, 80, 89, 90, 91, 92, 93, 94, 95, 102, 104],
class_feats: {
1: [5, 6, 7, 43, 58, 61]
- }
+ },
+ hd: 10
}, {
id: 5,
name: "Monk",
@@ -143,7 +148,8 @@
spells_known: [],
skill_points_per_level: 4,
bonus_feats_levels: [0, 1, 5],
- class_feats: {}
+ class_feats: {},
+ hd: 8
}, {
// TODO - Impl turn undead (55)
id: 6,
@@ -161,7 +167,8 @@
bonus_feats_levels: [4, 9, 15],
class_feats: {
1: [5, 6, 7, 43, 58, 61]
- }
+ },
+ hd: 10
}, {
id: 7,
name: "Ranger",
@@ -179,7 +186,8 @@
class_feats: {
1: [6, 43, 58, 61, 71],
3: [22]
- }
+ },
+ hd: 8
}, {
// TODO - handle rogue special ability(s) (how to?) (not listed below)
id: 8,
@@ -198,7 +206,8 @@
special_abilities_levels: [9, 12, 15, 19],
class_feats: {
1: [6]
- }
+ },
+ hd: 6
}, {
id: 9,
name: "Sorceror",
@@ -213,7 +222,8 @@
spells_known: [[4, 2, '-', '-', '-', '-', '-', '-', '-', '-'], [5,
2, '-', '-', '-', '-', '-', '-', '-', '-'], [5,
3, '-', '-', '-', '-', '-', '-', '-', '-'], [6, 3,
1, '-', '-', '-', '-', '-', '-', '-'], [6, 4,
2, '-', '-', '-', '-', '-', '-', '-'], [7, 4, 2,
1, '-', '-', '-', '-', '-', '-'], [7, 5, 3,
2, '-', '-', '-', '-', '-', '-'], [8, 5, 3, 2, 1, '-', '-', '-', '-', '-'],
[8, 5, 4, 3, 2, '-', '-', '-', '-', '-'], [9, 5, 4, 3, 2,
1, '-', '-', '-', '-'], [9, 5, 5, 4, 3, 2, '-', '-', '-', '-'], [9, 5, 5,
4, 3, 2, 1, '-', '-', '-'], [9, 5, 5, 4, 4, 3, 2, '-', '-', '-'], [9, 5, 5,
4, 4, 3, 2, 1, '-', '-'], [9, 5, 5, 4, 4, 4, 3, 2, '-', '-'], [9, 5, 5, 4,
4, 4, 3, 2, 1, '-'], [9, 5, 5, 4, 4, 4, 3, 3, 2, '-'], [9, 5, 5, 4, 4, 4,
3, 3, 2, 1], [9, 5, 5, 4, 4, 4, 3, 3, 3, 2], [9, 5, 5, 4, 4, 4, 3, 3, 3,
3]],
skill_points_per_level: 2,
bonus_feats_levels: [2, 5, 8, 11, 14, 17],
- class_feats: {}
+ class_feats: {},
+ hd: 4
}, {
id: 10,
name: "Wizard",
@@ -229,5 +239,6 @@
skill_points_per_level: 2,
bonus_feats_levels: [4, 9, 14, 19],
class_feats: {},
- languages: [16]
+ languages: [16],
+ hd: 4
}]);
=======================================
--- /trunk/charmgrjs/common.js Tue Oct 13 14:07:39 2009
+++ /trunk/charmgrjs/common.js Wed Oct 14 14:50:27 2009
@@ -42,7 +42,7 @@
$('#linkspart')
.html(
links_html
- + "<td class='view box'><a id='load' class='view'
onclick='import_character()'>Load</a></td><td class='view box'><a id='load'
class='view' onclick='export_character()'>Save</a></td><td class='view
box'><a id='load' class='view'
onclick='update_log(chardata)'>Log</a></td><td align='right' style='width:
100%; color: blue'>"
+ + "<td class='view box'><a id='load' class='view'
onclick='import_character()'>Load</a></td><td class='view box'><a id='load'
class='view' onclick='export_character()'>Save</a></td><td class='view
box'><a id='load' class='view'
onclick='update_log(chardata)'>Log</a></td><td align='right' style='width:
35%; color: blue'>"
+ chardata['name'] + "</td><td style='color: blue'>" +
race.shortname + "</td><td style='color: blue'>" + clazz.shortname
+ "</td><td style='color: blue'>(" + (calc_level(chardata['xp']) + 1)
+ ")</td></tr></table>");
}

@@ -345,9 +345,9 @@
return newO;
}

-function sav(chardata) {
- if (chardata != null) {
- var cookieData = clone(chardata);
+function sav(data, cookie_name) {
+ if (data != null) {
+ var cookieData = clone(data);
if (cookieData.skills != null) {
cookieData.skills = cookieData.skills.get();
}
@@ -357,7 +357,7 @@
cookieData = TAFFY.JSON.stringify(cookieData);

var d = new Date(2020, 02, 02);
- document.cookie = 'chardata=' + cookieData + ';expires=' +
d.toUTCString();
+ document.cookie = cookie_name + '=' + cookieData + ';expires=' +
d.toUTCString();
}
}

@@ -390,7 +390,7 @@
var json_data = prompt("Paste your character data below:");
if (json_data != null && json_data.replace(/^\s+|\s+$/g,"").length > 0) {
parse_character_data(json_data);
- sav(chardata);
+ sav(chardata, 'chardata');
window.location.reload();
}
}
@@ -441,12 +441,12 @@
}

// log
- if(chardata.xp_log != null) {
- var xp_log = [];
- for(var entry in chardata.xp_log) {
- xp_log.push(chardata.xp_log[entry]);
- }
- chardata.xp_log = xp_log;
+ if(chardata.log != null) {
+ var log = [];
+ for(var entry in chardata.log) {
+ log.push(chardata.log[entry]);
+ }
+ chardata.log = log;
}

// rogue special abilities
=======================================
--- /trunk/charmgrjs/edit.js Tue Oct 13 14:07:39 2009
+++ /trunk/charmgrjs/edit.js Wed Oct 14 14:50:27 2009
@@ -33,7 +33,7 @@
// topline
var name_html = "<input id='charname' value='' size='6' type='text' />";
var class_html = create_select('clazz',
classes.get(), 'recalc_edit_page(chardata)', false, "width: 95px;");
- var race_html = create_select('race',
races.get(), 'recalc_edit_page(chardata)', false, "width: 85px;");
+ var race_html = create_select('race',
races.get(), 'recalc_edit_page(chardata)', false, "width: 75px;");
var hp_html = "<b>HP</b> <input id='hp' size='1' value='' type='text' />";
$('#topline').html(name_html + "&nbsp;" + class_html + "&nbsp;" +
race_html + "&nbsp;" + hp_html);

@@ -196,15 +196,25 @@

function recalc_edit_page(chardata) {
chardata.name = $('#charname').val();
- chardata.xp = $('#xp').val();
- chardata.hp = $('#hp').val();
-
- chardata.race_id = $('#race').val();
- // change your class, lose your feat selections
+ // change your class, lose your feat, spell selections
if(chardata.class_id != $('#clazz').val()) {
chardata.feats = null;
+ chardata.spells = null;
}
chardata.class_id = $('#clazz').val();
+ var clazz = classes.first({ id: chardata.class_id });
+
+ // up a level
+ if(calc_level(chardata.xp) < calc_level($('#xp').val())) {
+ var ability_increase = (parseInt(calc_level($('#xp').val())) + 1) % 4 ==
0;
+ // hp increase of at least 1
+ var hp_increase = Math.max(((Math.floor(Math.random() * clazz.hd)) + 1)
+ calc_ability_modifier($('ability_Con').val()), 1);
+ alert("Level Advance:\n" + (ability_increase ? "+1 to ability
score\n" : "") + "HP increase: " + hp_increase);
+ }
+ chardata.xp = $('#xp').val();
+ chardata.hp = $('#hp').val();
+
+ chardata.race_id = $('#race').val();

chardata.alignment_id = $('#alignment').val().split(',')[0];
chardata.goodness_id = $('#alignment').val().split(',')[1];
@@ -252,11 +262,10 @@
var skill = skills.first( {
id : i
});
- // TODO - resize sections to accomodate emboldening
// embolden class skills
$('#skill_' + i).attr("style", (skill.class_data[chardata.class_id]
== 'C' ? 'font-weight: bold' : ''));
if ($(element).val() != '' && parseInt($(element).val()) > 0) {
- // TODO - ugly
+ // TODO - ugly, need a "save()" function
if (chardata.skills == null) {
chardata.skills = new TAFFY( [ {
skill_id : i,
@@ -300,7 +309,7 @@
build_data_part(chardata, "armor", "armor");

set_links_part(chardata, 1);
- sav(chardata);
+ sav(chardata, 'chardata');
}

//function update_armor(select_id) {
=======================================
--- /trunk/charmgrjs/edit_spells.js Fri Oct 9 11:32:13 2009
+++ /trunk/charmgrjs/edit_spells.js Wed Oct 14 14:50:27 2009
@@ -87,5 +87,5 @@
}
}

- sav(chardata);
-}
+ sav(chardata,'chardata');
+}
=======================================
--- /trunk/charmgrjs/edit_weapons.js Fri Oct 9 11:32:13 2009
+++ /trunk/charmgrjs/edit_weapons.js Wed Oct 14 14:50:27 2009
@@ -25,7 +25,7 @@
// populate_data_part(chardata, weapons, "weapons", "weapon")
populate_data_part(chardata, window[data_name], data_name, id_name);

- sav(chardata);
+ sav(chardata, 'chardata');
}

function add_data (chardata, data_name, id_name) {
@@ -36,7 +36,7 @@
chardata[data_name].push(populate_object(new Object(), id_name + '_id',
item_id));
build_data_part(chardata, data_name, id_name);

- sav(chardata);
+ sav(chardata, 'chardata');
}

function build_data_part(chardata, data_name, id_name) {
@@ -91,7 +91,7 @@
}
}

- sav(chardata);
+ sav(chardata, 'chardata');
}

function get_available_weapons(chardata) {
=======================================
--- /trunk/charmgrjs/main.js Tue Oct 13 14:07:39 2009
+++ /trunk/charmgrjs/main.js Wed Oct 14 14:50:27 2009
@@ -78,7 +78,7 @@
$('#skillspart').html(skill_html);

// AC, etc
- var ac_html = "<table><tr><td>HP</td><td id='hp' align='left'></td><td
align='right' colspan='2' style='width: 100%'><input id='hp_input' size='1'
type='text' value='' /></td></tr>";
+ var ac_html = "<table><tr><td>HP</td><td id='hp' class='two_digit'
align='left'></td><td align='right' colspan='2' style='width: 100%'><input
id='hp_input' size='1' type='text' value='' /></td></tr>";
ac_html += "<tr><td>AC</td><td class='box numeric' id='ac'></td>";
var init_html = "<td>Init</td><td id='init' class='box
numeric'></td></tr>";
var spacer = "<tr><td colspan='4'><hr/></td></tr>";
@@ -139,7 +139,7 @@
}
}
if (conditional_feats.length > 0) {
- feats_html += "<table width='100%' border='0' margin='0'><tbody><tr><td
colspan='3' bgcolor='#8DC3E9' onclick='show_feats()'><a class='fake_link'
onclick='show_feats()'>Feats</a><span id='feat_expand_flag' style='float:
right; font-family: monospace; font-size: larger'>+
</span></td></tr></tbody><tbody id='conditional_feats'>";
+ feats_html += "<table width='100%' border='0' margin='0'><tbody><tr><td
colspan='3' bgcolor='#8DC3E9' onclick='show_feats()'><a class='fake_link'
onclick='show_feats()'>Feats</a><span id='feat_expand_flag' style='float:
right; font-family: monospace; font-size:
larger'>[+]</span></td></tr></tbody><tbody id='conditional_feats'>";
for ( var i in conditional_feats) {
var checkbox = (conditional_feats[i].op != null ?
"<input id='feat_" + conditional_feats[i].id + "_conditional'
type='checkbox' onclick=\"" + conditional_feats[i].op + "\"/>" :
@@ -157,7 +157,7 @@
var class_specials = get_special_abilities(chardata);
var special_html = "";
if (count_attrs(class_specials) > 0) {
- special_html += "<table width='100%' border='0'
margin='0'><tbody><tr><td colspan='2' bgcolor='#8DC3E9'
onclick='show_specials()'><a class='fake_link'
onclick='show_specials()'>Special Abilities</a><span
id='specials_expand_flag' style='float: right; font-family: monospace;
font-size: larger'>+</span></td></tr></tbody><tbody id='specials'>";
+ special_html += "<table width='100%' border='0'
margin='0'><tbody><tr><td colspan='2' bgcolor='#8DC3E9'
onclick='show_specials()'><a class='fake_link'
onclick='show_specials()'>Special Abilities</a><span
id='specials_expand_flag' style='float: right; font-family: monospace;
font-size: larger'>[+]</span></td></tr></tbody><tbody id='specials'>";
for (var i in class_specials) {
if(class_specials[i] != null) {
var checkbox = (class_specials[i].op != null ?
@@ -186,14 +186,13 @@
+ j
+ "_name' weapon_id='"
+ chardata.weapons[j]['weapon_id']
- + "' colspan='2' bgcolor='#C5C6F6'></td></tr>";
+ + "' colspan='4' bgcolor='#C5C6F6'></td></tr>";

// TODO - populate with char overrides
// TODO - create links on Att/Dam/Crit to dialog with breakdown
calculations
- weapon_html += "<tr><td>Att</td><td id='weapon_" + j + "_att'
class='box' width='100%'></td></tr>";
- weapon_html += "<tr><td>Dam</td><td id='weapon_" + j + "_dam'
class='box' width='100%'></td></tr>";
- weapon_html += "<tr><td>Crit</td><td id='weapon_" + j + "_crit'
width='100%'></td></tr>";
- weapon_html += "<tr><td valign='top'>Note</td><td id='weapon_" + j
+ "_note' width='100%'></td></tr></table>";
+ weapon_html += "<tr><td>Att</td><td id='weapon_" + j + "_att'
class='box' width='50%'></td><td>Crit</td><td id='weapon_" + j + "_crit'
class='box' width='50%'></td></tr>";
+ weapon_html += "<tr><td>Dam</td><td id='weapon_" + j + "_dam'
class='box' width='50%'></td><td></td><td></td></tr>";
+ weapon_html += "<tr><td valign='top'>Note</td><td id='weapon_" + j
+ "_note' colspan='3' width='100%'></td></tr></table>";
}
$('#weaponspart').html(weapon_html);
// $('#weaponspart').addClass('box');
@@ -305,35 +304,44 @@

function save_log(chardata) {
if($('#log_note').val() != null && $('#log_note').val().length > 0) {
- if(chardata.xp_log == null) {
- chardata.xp_log = [];
+ if(chardata.log == null) {
+ chardata.log = [];
}
var entry_id = $('#entry_id').val();
+ // new entry
if(entry_id == '') {
- chardata.xp_log.push({xp: chardata.xp, hp: chardata.hp, date: (new
Date()).toDateString(), note: htmlize($('#log_note').val())});
- } else {
- chardata.xp_log[entry_id].note = htmlize($('#log_note').val());
- // restore to new entry
- $('#entry_id').val('');
- $('#save_log').val('save');
- $('#log_date').text((new Date()).toDateString());
- $('#log_xp').text(chardata.xp);
- $('#log_hp').text(chardata.hp);
- }
- sav(chardata);
+ entry_id = Math.floor(Math.random()*4294967295).toString(16);
+ chardata.log.push(entry_id);
+ }
+ // edit entry
+ sav({xp: $('#log_xp').text(), hp: $('#log_hp').text(), date:
$('#log_date').text(), note:
htmlize($('#log_note').val())}, 'chardata_log_' + entry_id);
+
+ $('#entry_id').val('');
+ $('#save_log').val('save');
+ $('#log_date').text((new Date()).toDateString());
+ $('#log_xp').text(chardata.xp);
+ $('#log_hp').text($('#hp_input') != null && $('#hp_input').val().length
> 0 ? $('#hp_input').val() : chardata.hp);
+
+ sav(chardata, 'chardata');
$('#history').html(populate_log_history(chardata));
$('#log_note').val('');
}
}

function update_log(chardata) {
- if (chardata.xp_log == null) {
- chardata.xp_log = [];
+ // get number of entries
+ if (chardata.log == null) {
+ chardata.log = [];
}
var title = "Log";
- var content = "<div id='history' class='box' style='max-height: 150px;
overflow: auto; border-color: #D0D0D0;'>" + populate_log_history(chardata)
+ "</div>";
+ var content = "";
+ if(chardata.log.length > 0) {
+ content += "<div id='history' class='box' style='max-height: 150px;
overflow: auto; border-color: #D0D0D0;'>" + populate_log_history(chardata)
+ "</div>";
+ }
+ // use the "live" hp value if it's populated
+ var log_hp = ($('#hp_input').val().length > 0 ? $('#hp_input').val() :
(chardata.hp == null ? 0 : chardata.hp));
content += "<div id='new_entry' style='height: 50%'><input
id='entry_id' type='hidden' value='' /><table style='width: 100%'>";
- content += "<tr><td id='log_date' style='font-size: xx-small'>" + (new
Date()).toDateString() + "</td><td id='log_hp' class='numeric'
style='font-size: xx-small'>" + (chardata.hp == null ? 0 : chardata.hp)
+ "</td><td id='log_xp' class='numeric' style='font-size: xx-small'>" +
(chardata.xp == null ? 0 : chardata.xp) + "</td><td style='text-align:
right;'><input id='save_log' type='button' value='save'
onclick='save_log(chardata)'/></td></tr>";
+ content += "<tr><td id='log_date' style='font-size: xx-small'>" + (new
Date()).toDateString() + "</td><td id='log_hp' class='numeric'
style='font-size: xx-small'>" + log_hp + "</td><td id='log_xp'
class='numeric' style='font-size: xx-small'>" + (chardata.xp == null ? 0 :
chardata.xp) + "</td><td style='text-align: right;'><input id='save_log'
type='button' value='save' onclick='save_log(chardata)'/></td></tr>";
content += "<tr><td colspan=4><textarea id='log_note' style='width:
100%'/></td></tr></table>";
show_dialog(title, content);
return false;
@@ -341,9 +349,32 @@

function populate_log_history(chardata) {
var history = "<table style='width: 100%'>";
- for (var entry=chardata.xp_log.length-1; entry>=0; entry--) {
- history += "<tr><td style='font-size: xx-small'>" +
chardata.xp_log[entry].date + "</td><td class='numeric' style='font-size:
xx-small'>" + chardata.xp_log[entry].hp + "</td><td class='numeric'
style='font-size: xx-small'>" + chardata.xp_log[entry].xp + "</td><td
style='text-align: right; font-size: xx-small''><a class='fake_link'
onclick='edit_log_entry(chardata, " + entry + ")'>edit</a> <a
class='fake_link' onclick='delete_log_entry(chardata, " + entry
+ ")'>delete</a></td></tr>";
- history += "<tr><td colspan=4 style='border: 1px solid; padding:
5px;' >" + chardata.xp_log[entry].note + "</td></tr>";
+ var entries = [];
+ // TODO - refactor to generalize lod()
+ for(var i=0; i<chardata.log.length; i++) {
+ var log = {};
+ if (document.cookie.length > 0) {
+ c_start = document.cookie.indexOf("chardata_log_" + chardata.log[i]
+ "=");
+ if (c_start != -1) {
+ c_start = c_start + 14 + chardata.log[i].length; // c_name.length + 1
+ c_end = document.cookie.indexOf(";", c_start);
+ if (c_end == -1) {
+ c_end = document.cookie.length;
+ }
+ log = TAFFY.JSON.parse(unescape(document.cookie.substring(c_start,
c_end)));
+ log.id = chardata.log[i];
+ }
+ }
+ entries.push(log);
+ }
+ entries.sort(function(a, b) {
+ return a.date > b.date ? -1 : 1;
+ });
+
+ for(var i=0; i<entries.length; i++) {
+ history += "<tr style='background-color: #EFF1F1; border: 1px
solid #EFF1F1;'><td style='font-size: xx-small'>" + entries[i].date
+ "</td><td class='numeric' style='font-size: xx-small'>" + entries[i].hp
+ "</td><td class='numeric' style='font-size: xx-small'>" + entries[i].xp
+ "</td><td style='text-align: right; font-size: xx-small''><a
class='fake_link' onclick=\"edit_log_entry(chardata, '" + entries[i].id
+ "')\")\">edit</a> <a class='fake_link'
onclick=\"delete_log_entry(chardata, '" + entries[i].id
+ "')\">delete</a></td></tr>";
+ history += "<tr><td colspan=4 style='border: 1px solid; padding:
5px;' >" + entries[i].note + "</td></tr>";
+ history += "<tr><td colspan=4 style='padding-bottom:
1em;'></td></tr>";
}
history += "</table>";

@@ -351,17 +382,32 @@
}

function delete_log_entry(chardata, entry) {
- chardata.xp_log.splice(entry, 1);
+ var entry_idx = jQuery.inArray(entry, chardata.log);
+ chardata.log.splice(entry_idx, 1);
+ document.cookie = 'chardata_log_' + entry + '=foo;expires=Fri, 31 Dec
1999 23:00:00 GMT;';
sav(chardata);
$('#history').html(populate_log_history(chardata));
}

function edit_log_entry(chardata, entry) {
+ var log = {};
+ if (document.cookie.length > 0) {
+ c_start = document.cookie.indexOf("chardata_log_" + entry + "=");
+ if (c_start != -1) {
+ c_start = c_start + 14 + entry.length; // c_name.length + 1
+ c_end = document.cookie.indexOf(";", c_start);
+ if (c_end == -1) {
+ c_end = document.cookie.length;
+ }
+ log = TAFFY.JSON.parse(unescape(document.cookie.substring(c_start,
c_end)));
+ }
+ }
+
$('#entry_id').val(entry);
- $('#log_date').text(chardata.xp_log[entry].date);
- $('#log_hp').text(chardata.xp_log[entry].hp);
- $('#log_xp').text(chardata.xp_log[entry].xp);
- $('#log_note').val(dehtmlize(chardata.xp_log[entry].note));
+ $('#log_date').text(log.date);
+ $('#log_hp').text(log.hp);
+ $('#log_xp').text(log.xp);
+ $('#log_note').val(dehtmlize(log.note));
$('#save_log').val('update');
}

@@ -638,14 +684,14 @@
function show_feats() {
$('#conditional_feats').toggle();
var hidden = $('#conditional_feats').is(':hidden');
- $('#feat_expand_flag').text(hidden ? '+ ' : '- ');
+ $('#feat_expand_flag').text(hidden ? '[+]' : '[-]');
}

//TODO - refactor this
function show_specials() {
$('#specials').toggle();
var hidden = $('#specials').is(':hidden');
- $('#specials_expand_flag').text(hidden ? '+ ' : '- ');
+ $('#specials_expand_flag').text(hidden ? '[+]' : '[-]');
}

function calc_critical(weapon_critical, char_weapon, char_feats) {
=======================================
--- /trunk/charmgrjs/resources/felonious.grendel Fri Oct 9 03:40:47 2009
+++ /trunk/charmgrjs/resources/felonious.grendel Wed Oct 14 14:50:27 2009
@@ -1,1 +1,1 @@
-{"name":"Felonious","xp":"28340","hp":"46","race_id":"4","class_id":"7","alignment_id":"0","goodness_id":"0","deity_id":"0","domain_id":"0","weapon_style":"archery","abilities":{"0":"16","1":"22","2":"10","3":"13","4":"12","5":"13"},"weapons":{"0":{"weapon_id":"34","name":"Mithrandir's","damage":"1d8","critical":"x3","note":"+3
vs
Giant/Goblin kin,
light/dark/fire","attack":"+2","dam":"1d8","crit":"x3"},"1":{"weapon_id":"48"}},"armor":{"0":{"armor_id":"1"}},"feats":[{"feat_id":35},{"feat_id":49},{"feat_id":51},{"feat_id":74}],"xp_log":{"0":{"xp":"27340","hp":"42","date":"Thu
Oct 08 2009","note":"outpost and journey to
Rockholm"}},"languages":{"0":7},"skills":[{"skill_id":0,"ranks":"2"},{"skill_id":3,"ranks":"2"},{"skill_id":4,"ranks":"7"},{"skill_id":10,"ranks":"4"},{"skill_id":13,"ranks":"2"},{"skill_id":15,"ranks":"7"},{"skill_id":17,"ranks":"5"},{"skill_id":21,"ranks":"1"},{"skill_id":24,"ranks":"1"},{"skill_id":28,"ranks":"6"},{"skill_id":29,"ranks":"4"},{"skill_id":34,"ranks":"2"},{"skill_id":35,"ranks":"3"},{"skill_id":39,"ranks":"7"},{"skill_id":42,"ranks":"5"},{"skill_id":44,"ranks":"1"},{"skill_id":1,"ranks":"2"},{"skill_id":33,"ranks":"2"},{"skill_id":43,"ranks":"2"}]}
+{"name":"Felonious","xp":"30990","hp":"46","race_id":"4","class_id":"7","alignment_id":"0","goodness_id":"0","deity_id":"0","domain_id":"0","weapon_style":"archery","abilities":{"0":"16","1":"22","2":"10","3":"13","4":"12","5":"13"},"weapons":{"0":{"weapon_id":"34","name":"Mithrandir's","damage":"1d8","critical":"x3","note":"+1
(more)
vs Giant/Goblin kin,
light/dark/fire","attack":"+2","dam":"1d8+2","crit":"x3","att":"+2"},"1":{"weapon_id":"48","name":"Rapier","dam":"1d6","crit":"18-20/x2"}},"armor":{"0":{"armor_id":"1"}},"feats":[{"feat_id":49},{"feat_id":51},{"feat_id":35},{"feat_id":74}],"xp_log":{},"languages":{"0":7},"skills":[{"skill_id":0,"ranks":"2"},{"skill_id":3,"ranks":"2"},{"skill_id":4,"ranks":"7"},{"skill_id":10,"ranks":"4"},{"skill_id":13,"ranks":"2"},{"skill_id":15,"ranks":"7"},{"skill_id":17,"ranks":"5"},{"skill_id":21,"ranks":"1"},{"skill_id":24,"ranks":"1"},{"skill_id":28,"ranks":"6"},{"skill_id":29,"ranks":"4"},{"skill_id":34,"ranks":"2"},{"skill_id":35,"ranks":"3"},{"skill_id":39,"ranks":"7"},{"skill_id":42,"ranks":"5"},{"skill_id":44,"ranks":"1"},{"skill_id":1,"ranks":"2"},{"skill_id":33,"ranks":"2"},{"skill_id":43,"ranks":"2"}]}
=======================================
--- /trunk/charmgrjs/special_abilities.js Tue Oct 13 14:07:39 2009
+++ /trunk/charmgrjs/special_abilities.js Wed Oct 14 14:50:27 2009
@@ -77,59 +77,72 @@
}, {
id: 17,
name: "Inspire Greatness",
- detail: ""
+ description: "Grants 2 bonus Hit Dice, +2 attack, and +1 Fortitude",
+ detail: "A bard of 9th level or higher with 12 or more ranks in a Perform
skill can use music or poetics to inspire greatness in himself or a single
willing ally within 30 feet, granting him or her extra fighting capability.
For every three levels a bard attains beyond 9th, he can target one
additional ally with a single use of this ability (two at 12th level, three
at 15th, four at 18th). To inspire greatness, a bard must sing and an ally
must hear him sing. The effect lasts for as long as the ally hears the bard
sing and for 5 rounds thereafter. A creature inspired with greatness gains
2 bonus Hit Dice (d10s), the commensurate number of temporary hit points
(apply the target’s Constitution modifier, if any, to these bonus Hit
Dice), a +2 competence bonus on attack rolls, and a +1 competence bonus on
Fortitude saves. The bonus Hit Dice count as regular Hit Dice for
determining the effect of spells such as <i>sleep</i>. Inspire greatness is
a mind-affecting ability."
}, {
id: 18,
name: "Song of Freedom",
- detail: ""
+ description: "Break enchantment as the spell",
+ detail: "A bard of 12th level or higher with 15 or more ranks in a
Perform skill can use music or poetics to create an effect equivalent to
the <i>break enchantment</i> spell (caster level equals the character’s
bard level). Using this ability requires 1 minute of uninterrupted
concentration and music, and it functions on a single target within 30
feet. A bard can’t use <i>song of freedom</i> on himself."
}, {
id: 19,
name: "Inspire Heroics",
- detail: ""
+ description: "Grants listeners a +4 to AC and +4 to saving throws",
+ detail: "A bard of 15th level or higher with 18 or more ranks in a
Perform skill can use music or poetics to inspire tremendous heroism in
himself or a single willing ally within 30 feet, allowing that creature to
fight bravely even against overwhelming odds. For every three bard levels
the character attains beyond 15th, he can inspire heroics in one additional
creature. To inspire heroics, a bard must sing and an ally must hear the
bard sing for a full round. A creature so inspired gains a +4 morale bonus
on saving throws and a +4 dodge bonus to AC. The effect lasts for as long
as the ally hears the bard sing and for up to 5 rounds thereafter. Inspire
heroics is a mind-affecting ability."
}, {
id: 20,
name: "Mass Suggestion",
- detail: ""
+ detail: "This ability functions like <i>suggestion</i>, above, except
that a bard of 18th level or higher with 21 or more ranks in a Perform
skill can make the <i>suggestion</i> simultaneously to any number of
creatures that he has already fascinated (see above). <i>Mass
suggestion</i> is an enchantment (compulsion), mind-affecting,
language-dependent ability."
}, {
id: 21,
name: "Animal Companion",
- detail: ""
+ description: "Keep an animal buddy",
+ detail: "A druid may begin play with an animal companion selected from
the following list: badger, camel, dire rat, dog, riding dog, eagle, hawk,
horse (light or heavy), owl, pony, snake (Small or Medium viper), or wolf.
If the DM’s campaign takes place wholly or partly in an aquatic
environment, the DM may add the following creatures to the druid’s list of
options: crocodile, porpoise, Medium shark, and squid. This animal is a
loyal companion that accompanies the druid on her adventures as appropriate
for its kind.<p class=sub>A 1st-level druid’s companion is completely
typical for its kind except as noted in the sidebar on page 36. As a druid
advances in level, the animal’s power increases as shown on the table in
the sidebar. <p class=sub>If a druid releases her companion from service,
she may gain a new one by performing a ceremony requiring 24 uninterrupted
hours of prayer. This ceremony can also replace an animal companion that
has perished. <p class=sub>A druid of 4th level or higher may select from
alternative lists of animals (see the sidebar). Should she select an animal
companion from one of these alternative lists, the creature gains abilities
as if the character’s druid level were lower than it actually is. Subtract
the value indicated in the appropriate list header from the character’s
druid level and compare the result with the druid level entry on the table
in the sidebar to determine the animal companion’s powers. (If this
adjustment would reduce the druid’s effective level to 0 or lower, she
can’t have that animal as a companion.) For example, a 6th-level druid
could select a leopard as an animal companion. The leopard would have
characteristics and special abilities as if the druid were 3rd level
(taking into account the -3 adjustment) instead of 6th level."
}, {
id: 22,
name: "Nature Sense",
- detail: ""
+ description: "+2 on Knowledge (nature) and Survival checks",
+ detail: "A druid gains a +2 bonus on Knowledge (nature) and Survival
checks."
}, {
id: 23,
name: "Wild Empathy",
- detail: ""
+ description: "Improve an animals attitude",
+ detail: "A druid can use body language, vocalizations, and demeanor to
improve the attitude of an animal (such as a bear or a monitor lizard).
This ability functions just like a Diplomacy check made to improve the
attitude of a person (see Chapter 4: Skills). The druid rolls 1d20 and adds
her druid level and her Charisma modifier to determine the wild empathy
check result. The typical domestic animal has a starting attitude of
indifferent, while wild animals are usually unfriendly. <p class=sub>To use
wild empathy, the druid and the animal must be able to study each other,
which means that they must be within 30 feet of one another under normal
conditions. Generally, influencing an animal in this way takes 1 minute
but, as with influencing people, it might take more or less time. <p
class=sub>A druid can also use this ability to influence a magical beast
with an Intelligence score of 1 or 2 (such as a basilisk or a girallon),
but she takes a -4 penalty on the check."
}, {
id: 24,
name: "Woodland Stride",
- detail: ""
+ description: "Move through natural undergrowth at normal speed",
+ detail: "Starting at 2nd level, a druid may move through any sort of
undergrowth (such as natural thorns, briars, overgrown areas, and similar
terrain) at her normal speed and without taking damage or suffering any
other impairment. However, thorns, briars, and overgrown areas that have
been magically manipulated to impede motion still affect her."
}, {
id: 25,
name: "Trackless Step",
- detail: ""
+ description: "Move with no trace of passage",
+ detail: "Starting at 3rd level, a druid leaves no trail in natural
surroundings and cannot be tracked. She may choose to leave a trail if so
desired."
}, {
id: 26,
name: "Resist Nature's Lure",
- detail: ""
+ description: "Immunity to fey spells",
+ detail: "Starting at 4th level, a druid gains a +4 bonus on saving throws
against the spell-like abilities of fey (such as dryads, pixies, and
sprites). "
}, {
id: 27,
name: "Wild Shape",
- detail: ""
+ description: "Change into wild creature",
+ detail: "At 5th level, a druid gains the ability to turn herself into any
Small or Medium animal and back again once per day. Her options for new
forms include all creatures with the animal type (see the <i>Monster
Manual</i>). This ability functions like the polymorph spell, except as
noted here. The effect lasts for 1 hour per druid level, or until she
changes back. Changing form (to animal or back) is a standard action and
doesn’t provoke an attack of opportunity. <p class=sub>The form chosen must
be that of an animal the druid is familiar with. For example, a druid who
has never been outside a temperate forest could not become a polar bear. <p
class=sub>A druid loses her ability to speak while in animal form because
she is limited to the sounds that a normal, untrained animal can make, but
she can communicate normally with other animals of the same general
grouping as her new form. (The normal sound a wild parrot makes is a
squawk, so changing to this form does not permit speech.) <p class=sub><i>A
druid can use this ability more times per day at 6th, 7th, 10th, 14th, and
18th level, as noted on Table 3-8</i>: The Druid. In addition, she gains
the ability to take the shape of a Large animal at 8th level, a Tiny animal
at 11th level, and a Huge animal at 15th level. The new form’s Hit Dice
can’t exceed the character’s druid level. For instance, a druid can’t take
the form of a dire bear (a Large creature that always has at least 12 HD)
until 12th level, even though she can begin taking Large forms at 8th
level. <p class=sub>At 12th level, a druid becomes able to use wild shape
to change into a plant creature, such as a shambling mound, with the same
size restrictions as for animal forms. (A druid can’t use this ability to
take the form of a plant that isn’t a creature, such as a tree or a rose
bush.) <p class=sub>At 16th level, a druid becomes able to use wild shape
to change into a Small, Medium, or Large elemental (air, earth, fire, or
water) once per day. These elemental forms are in addition to her normal
wild shape usage. In addition to the normal effects of wild shape, the
druid gains all the elemental’s extraordinary, supernatural, and spell-like
abilities. She also gains the elemental’s feats for as long as she
maintains the wild shape, but she retains her own creature type (humanoid,
in most cases). <p class=sub>At 18th level, a druid becomes able to assume
elemental form twice per day, and at 20th level she can do so three times
per day. At 20th level, a druid may use this wild shape ability to change
into a Huge elemental."
}, {
id: 28,
name: "Venom Immunity",
- detail: ""
+ description: "Immunity to poison",
+ detail: "At 9th level, a druid gains immunity to all poisons. "
}, {
id: 29,
name: "A Thousand Faces",
- detail: ""
+ description: "Change appearance as with <i>alter self</i>",
+ detail: "At 13th level, a druid gains the ability to change her
appearance at will, as if using the <i>alter self</i> spell (page 197), but
only while in her normal form."
}, {
id: 30,
name: "Timeless body",
- detail: ""
+ description: "",
+ detail: "After attaining 15th level, a druid no longer takes ability
score penalties for aging (see Table 6-5: Aging Effects, page 109) and
cannot be magically aged. Any penalties she may have already incurred,
however, remain in place. Bonuses still accrue, and the druid still dies of
old age when her time is up."
}, {
id: 31,
name: "Flurry of Blows",
@@ -313,9 +326,4 @@
name: "Slippery Mind",
description: "Escape magical control",
detail: "This ability represents the rogue's ability to wriggle free from
magical effects that would otherwise control or compel her. If a rogue with
slippery mind is affected by an enchantment spell or effect and fails her
saving throw, she can attempt it again 1 round later at the same DC. She
gets only this one extra chance to succeed on her saving throw."
-}, {
- id: 74,
- name: "Suggestion",
- description: "Make a suggestion as the spell",
- detail: "A bard of 6th level or higher with 9 or more ranks in a Perform
skill can make a <i>suggestion</i> (as the spell) to a creature that he has
already fascinated (see above). Using this ability does not break the
bard’s concentration on the <i>fascinate</i> effect, nor does it allow a
second saving throw against the <i>fascinate</i> effect. Making a
<i>suggestion</i> doesn’t count against a bard’s daily limit on bardic
music performances. A Will saving throw (DC 10 + 1/2 bard’s level + bard’s
Cha modifier) negates the effect. This ability affects only a single
creature (but see <i>mass suggestion</i>, below). <i>Suggestion</i> is an
enchantment (compulsion), mind-affecting, language dependent ability."
}]);
Reply all
Reply to author
Forward
0 new messages