Obsidian Portal
Menu
Sign In / Create Account
JavaScript is currently disabled. Obsidian Portal has a lot of really cool features that use JavaScript. You should check them out. We think you'll have a much more enjoyable experience.
Home
Campaigns
Games Nearby
Plans
Community
Help
Resources
D&D 3.5 Revised v0.1
Author:
Romeo
Slug:
dnd35rev
Type:
GameCharacter
System:
D&D (3.5)
DST Source Code
HTML Template
<div class="character-sheet clearfix"> <div class="fancybox"> <h3 class="title">Basic Information</h3> <div class="quarterwidth"> <div class="dsf dsf_avatar_image readonly"></div> </div> <div class="threequarterwidth"> <table width="100%"> <tr> <td class="dsf dsf_name readonly"></td> <td class="dsf dsf_player readonly"></td> <td class="dsf dsf_race"></td> <td class="dsf dsf_class"></td> </tr> <tr> <th>Character Name</th> <th>Player</th> <th>Race</th> <th>Class</th> </tr> <tr> <td class="dsf dsf_level"></td> <td class="dsf dsf_alignment"></td> <td class="dsf dsf_deity"></td> <td class="dsf dsf_gender"></td> </tr> <tr> <th>Level</th> <th>Alignment</th> <th>Deity</th> <th>Gender</th> </tr> <tr> <td class="dsf dsf_age"></td> <td class="dsf dsf_size"></td> <td class="dsf dsf_height"></td> <td class="dsf dsf_weight"></td> </tr> <tr> <th>Age</th> <th>Size</th> <th>Height</th> <th>Weight</th> </tr> <tr> <td class="dsf dsf_eyes"></td> <td class="dsf dsf_hair"></td> <td class="dsf dsf_skin"></td> <td class="dsf dsf_experience_points"></td> </tr> <tr> <th>Eyes</th> <th>Hair</th> <th>Skin</th> <th>Experience Points</th> </tr> <tr> <td colspan="4" class="dsf dsf_languages"></td> </tr> <tr> <th colspan="4">Languages</th> </tr> </table> </div> </div> <div class="fancybox statsbox"> <h3 class="title">Abilities</h3> <table width="195"> <tr> <th>Name</th> <th>Score</th> <th>Mod</th> <th>Temp<br />Dmg</th> <th>Temp<br />Boost</th> </tr><tr> <th class="stat">Str</th> <td class="dsf dsf_str"></td> <td class="dsf dsf_str_mod readonly"></td> <td class="dsf dsf_str_damage"></td> <td class="dsf dsf_str_boost"></td> </tr><tr> <th class="stat">Dex</th> <td class="dsf dsf_dex"></td> <td class="dsf dsf_dex_mod readonly"></td> <td class="dsf dsf_dex_damage"></td> <td class="dsf dsf_dex_boost"></td> </tr><tr> <th class="stat">Con</th> <td class="dsf dsf_con"></td> <td class="dsf dsf_con_mod readonly"></td> <td class="dsf dsf_con_damage"></td> <td class="dsf dsf_con_boost"></td> </tr><tr> <th class="stat">Int</th> <td class="dsf dsf_int"></td> <td class="dsf dsf_int_mod readonly"></td> <td class="dsf dsf_int_damage"></td> <td class="dsf dsf_int_boost"></td> </tr><tr> <th class="stat">Wis</th> <td class="dsf dsf_wis"></td> <td class="dsf dsf_wis_mod readonly"></td> <td class="dsf dsf_wis_damage"></td> <td class="dsf dsf_wis_boost"></td> </tr><tr> <th class="stat">Cha</th> <td class="dsf dsf_cha"></td> <td class="dsf dsf_cha_mod readonly"></td> <td class="dsf dsf_cha_damage"></td> <td class="dsf dsf_cha_boost"></td> </tr> </table> </div> <div class="fancybox hpbox thirdwidth"> <h4 class="title">Hit Points</h4> <table width="100%"> <col /> <col width="33%" /> <col width="33%" /> <tr> <td class="dsf dsf_hp"></td> <td class="dsf dsf_wounds"></td> <td class="dsf dsf_nonlethal"></td> </tr><tr> <th>Max</th> <th>Current</th> <th>Nonlethal</th> </tr> </table> </div> <div class="fancybox hpbox thirdwidth"> <h4 class="title">Initiative</h4> <table width="100%"> <tr> <td class="dsf dsf_initative_total readonly"></td> <td class="dsf dsf_dex_mod readonly"></td> <td class="dsf dsf_misc_init_mod"></td> </tr><tr> <th>Total</th> <th>Dex Mod</th> <th>Misc</th> </tr> </table> </div> <div class="fancybox speedbox thirdwidth"> <h4 class="title">Speed</h4> <table width="100%"> <tr> <td class="dsf dsf_speed"></td> <td class="dsf dsf_speed_burrow"></td> <td class="dsf dsf_speed_climb"></td> <td class="dsf dsf_speed_fly"></td> <td class="dsf dsf_speed_swim"></td> </tr><tr> <th>Land</th> <th>Burrow</th> <th>Climb</th> <th>Fly</th> <th>Swim</th> </tr> </table> </div> <div class="fancybox acbox"> <h4 class="title">Armor Class</h4> <table width="100%"> <tr> <td class="dsf dsf_ac readonly"></td> <td class="dsf dsf_touch_ac"></td> <td class="dsf dsf_flat_footed_ac"></td> <td class="collapse" rowspan="2">=</td> <td class="dsf dsf_armor_bonus"></td> <td class="collapse" rowspan="2">+</td> <td class="dsf dsf_shield_bonus"></td> <td class="collapse" rowspan="2">+</td> <td class="dsf dsf_dex_mod_armor"></td> <td class="collapse" rowspan="2">+</td> <td class="dsf dsf_size_mod"></td> <td class="collapse" rowspan="2">+</td> <td class="dsf dsf_natural_armor"></td> <td class="collapse" rowspan="2">+</td> <td class="dsf dsf_deflection_mod"></td> <td class="collapse" rowspan="2">+</td> <td class="dsf dsf_misc_mod"></td> </tr><tr> <th>Total</th> <th>Touch</th> <th>Flat-F.</th> <th>Armor</th> <th>Shield</th> <th>Dex Mod</th> <th>Size</th> <th>Natural</th> <th>Defl.</th> <th>Misc</th> </tr> </table> </div> <div class="fancybox grapplebox"> <h4 class="title">Defenses</h4> <table width="100%"> <tr> <td class="dsf dsf_miss_chance"></td> <td class="dsf dsf_damage_reduction"></td> <td class="dsf dsf_sr"></td> </tr><tr> <th>Miss %</th> <th>Damage Red.</th> <th>Spell Res.</th> </tr> </table> </div> <div class="fancybox grapplebox"> <h4 class="title">Grapple</h4> <table width="100%"> <tr> <td class="dsf dsf_grapple_total readonly"></td> <td class="collapse" rowspan="2">=</td> <td class="dsf dsf_bab"></td> <td class="collapse" rowspan="2">+</td> <td class="dsf dsf_str_mod readonly"></td> <td class="collapse" rowspan="2">+</td> <td class="dsf dsf_size_mod_grapple readonly"></td> <td class="collapse" rowspan="2">+</td> <td class="dsf dsf_misc_grapple_mod"></td> </tr><tr> <th>Total</th> <th>Base Att.</th> <th>Str Mod</th> <th>Size</th> <th>Misc</th> </tr> </table> </div> <div class="fancybox savesbox"> <h3 class="title">Saving Throws</h3> <table> <tr> <th> </th> <th>Total</th> <th>Base</th> <th>Abil. Mod</th> <th>Magic</th> <th>Misc.</th> <th>Temp.</th> <th>Conditional</th> </tr><tr> <th class="stat">Fort</th> <td class="dsf dsf_fortitude_total readonly"></td> <td class="dsf dsf_base_fort_save"></td> <td class="dsf dsf_con_mod readonly"></td> <td class="dsf dsf_magic_fort_mod"></td> <td class="dsf dsf_misc_fort_mod"></td> <td class="dsf dsf_temp_fort_mod"></td> <td class="dsf dsf_saves_conditional" rowspan="3"></td> </tr><tr> <th class="stat">Reflex</th> <td class="dsf dsf_reflex_total readonly"></td> <td class="dsf dsf_base_reflex_save"></td> <td class="dsf dsf_dex_mod readonly"></td> <td class="dsf dsf_magic_reflex_mod"></td> <td class="dsf dsf_misc_reflex_mod"></td> <td class="dsf dsf_temp_reflex_mod"></td> </tr><tr> <th class="stat">Will</th> <td class="dsf dsf_willpower_total readonly"></td> <td class="dsf dsf_base_willpower_save"></td> <td class="dsf dsf_wis_mod readonly"></td> <td class="dsf dsf_magic_willpower_mod"></td> <td class="dsf dsf_misc_willpower_mod"></td> <td class="dsf dsf_temp_willpower_mod"></td> </tr> </table> </div> <div class="fancybox attackbox"> <h3 class="title">Attack Bonuses</h3> <table width="100%"> <col width="50" /> <col width="150" /> <col width="1" /> <col /> <col width="1" /> <col /> <col width="1" /> <col /> <col width="1" /> <col /> <tr> <td class="noborder">Melee</td> <td class="dsf dsf_attack_melee_total readonly"></td> <td class="collapse">=</td> <td class="dsf dsf_bab" rowspan="2"></td> <td class="collapse">+</td> <td class="dsf dsf_str_mod readonly"></td> <td class="collapse">+</td> <td class="dsf dsf_size_mod" rowspan="2"></td> <td class="collapse">+</td> <td class="dsf dsf_attack_melee_misc"></td> </tr><tr> <td class="noborder">Ranged</td> <td class="dsf dsf_attack_ranged_total readonly"></td> <td class="collapse">=</td> <td class="collapse">+</td> <td class="dsf dsf_dex_mod readonly"></td> <td class="collapse">+</td> <td class="collapse">+</td> <td class="dsf dsf_attack_ranged_misc"></td> </tr><tr> <td class="noborder"></td> <th class="noborder">Total</th> <td class="noborder"></td> <th class="noborder">Base Attack Bonus</th> <td class="noborder"></td> <th class="noborder">Abil. Mod</th> <td class="noborder"></td> <th class="noborder">Size</th> <td class="noborder"></td> <th class="noborder">Misc</th> </tr> </table> </div> <div class="fancybox weaponbox"> <h3 class="title">Weapons<span class="ctlAddWeapon addButton">+ Add</span></h3> <div class="dsf dsf_ctlWeaponCount" style="display:none"></div> <table class="weaponTable" prefix="weapon"> <tr> <th>Name</th> <th>Attack Bonus</th> <th>Damage</th> <th>Critical</th> <th>Range</th> <th>Type</th> <th>Special Qualities</th> </tr> </table> </div> <div class="fancybox armorbox"> <h3 class="title">Protective Items</h3> <div> <h4 class="title">Armor</h4> <table width="100%"> <tr> <th>Name</th> <th>Type</th> <th>Bonus</th> <th>Max Dex</th> <th>Check Penalty</th> <th>Spell Failure</th> <th>Max Speed</th> <th>Special Qualities</th> </tr><tr> <td class="dsf dsf_armor1"></td> <td class="dsf dsf_armor1_type"></td> <td class="dsf dsf_armor1_ac_bonus"></td> <td class="dsf dsf_armor1_max_dex"></td> <td class="dsf dsf_armor1_penalty"></td> <td class="dsf dsf_armor1_spell_failure"></td> <td class="dsf dsf_armor1_speed"></td> <td class="dsf dsf_armor1_special_properties"></td> </tr><tr> <td class="dsf dsf_armor2"></td> <td class="dsf dsf_armor2_type"></td> <td class="dsf dsf_armor2_ac_bonus"></td> <td class="dsf dsf_armor2_max_dex"></td> <td class="dsf dsf_armor2_penalty"></td> <td class="dsf dsf_armor2_spell_failure"></td> <td class="dsf dsf_armor2_speed"></td> <td class="dsf dsf_armor2_special_properties"></td> </tr> </table> <h4 class="title">Shield</h4> <table width="100%"> <tr> <th>Name</th> <th>Type</th> <th>Bonus</th> <th>Check Penalty</th> <th>Spell Failure</th> <th>Special Qualities</th> </tr><tr> <td class="dsf dsf_shield1"></td> <td class="dsf dsf_shield1_type"></td> <td class="dsf dsf_shield1_ac_bonus"></td> <td class="dsf dsf_shield1_penalty"></td> <td class="dsf dsf_shield1_spell_failure"></td> <td class="dsf dsf_shield1_special_properties"></td> </tr><tr> <td class="dsf dsf_shield2"></td> <td class="dsf dsf_shield2_type"></td> <td class="dsf dsf_shield2_ac_bonus"></td> <td class="dsf dsf_shield2_penalty"></td> <td class="dsf dsf_shield2_spell_failure"></td> <td class="dsf dsf_shield2_special_properties"></td> </tr> </table> <h4 class="title">Ring / Amulet / Etc.</h4> <table width="100%"> <tr> <th>Name</th> <th>Type</th> <th>Bonus</th> <th>Special Qualities</th> <th rowspan="4" class="collapse" style="width: 2px !important;"></th> <th rowspan="4" class="collapse" style="width: 2px !important;border-left: 1px solid #000 !important;"></th> <th>Name</th> <th>Type</th> <th>Bonus</th> <th>Special Qualities</th> </tr><tr> <td class="dsf dsf_protitem1"></td> <td class="dsf dsf_protitem1_type"></td> <td class="dsf dsf_protitem1_ac_bonus"></td> <td class="dsf dsf_protitem1_special_properties"></td> <td class="dsf dsf_protitem2"></td> <td class="dsf dsf_protitem2_type"></td> <td class="dsf dsf_protitem2_ac_bonus"></td> <td class="dsf dsf_protitem2_special_properties"></td> </tr><tr> <td class="dsf dsf_protitem3"></td> <td class="dsf dsf_protitem3_type"></td> <td class="dsf dsf_protitem3_ac_bonus"></td> <td class="dsf dsf_protitem3_special_properties"></td> <td class="dsf dsf_protitem4"></td> <td class="dsf dsf_protitem4_type"></td> <td class="dsf dsf_protitem4_ac_bonus"></td> <td class="dsf dsf_protitem4_special_properties"></td> </tr><tr> <td class="dsf dsf_protitem5"></td> <td class="dsf dsf_protitem5_type"></td> <td class="dsf dsf_protitem5_ac_bonus"></td> <td class="dsf dsf_protitem5_special_properties"></td> <td class="dsf dsf_protitem6"></td> <td class="dsf dsf_protitem6_type"></td> <td class="dsf dsf_protitem6_ac_bonus"></td> <td class="dsf dsf_protitem6_special_properties"></td> </tr> </table> </div> </div> <div class="fancybox skillbox"> <h3 class="title">Skills<span class="ctlAddSkill addButton">+ Add</span></h3> <div class="dsf dsf_ctlSkillCount" style="display:none"></div> <table width="100%" class="skillTable" prefix="skill"> <tr> <th>Skill</th> <th>Key<br />Abil.</th> <th>Total</th> <th>Abil.<br />Mod</th> <th>Ranks</th> <th>Misc</th> </tr><tr> <td>Appraise</td> <td>Int</td> <td class="dsf dsf_appraise_mod readonly"></td> <td class="dsf dsf_int_mod readonly"></td> <td class="dsf dsf_appraise_ranks"></td> <td class="dsf dsf_appraise_misc_mod"></td> </tr><tr> <td>Balance</td> <td>Dex</td> <td class="dsf dsf_balance_mod readonly"></td> <td class="dsf dsf_dex_mod readonly"></td> <td class="dsf dsf_balance_ranks"></td> <td class="dsf dsf_balance_misc_mod"></td> </tr><tr> <td>Bluff</td> <td>Cha</td> <td class="dsf dsf_bluff_mod readonly"></td> <td class="dsf dsf_cha_mod readonly"></td> <td class="dsf dsf_bluff_ranks"></td> <td class="dsf dsf_bluff_misc_mod"></td> </tr><tr> <td>Climb</td> <td>Str</td> <td class="dsf dsf_climb_mod readonly"></td> <td class="dsf dsf_str_mod readonly"></td> <td class="dsf dsf_climb_ranks"></td> <td class="dsf dsf_climb_misc_mod"></td> </tr><tr> <td>Concentration</td> <td>Con</td> <td class="dsf dsf_concentration_mod readonly"></td> <td class="dsf dsf_con_mod readonly"></td> <td class="dsf dsf_concentration_ranks"></td> <td class="dsf dsf_concentration_misc_mod"></td> </tr><tr> <td>Craft (<span class="dsf dsf_craft1"></span>)</td> <td>Int</td> <td class="dsf dsf_craft1_mod readonly"></td> <td class="dsf dsf_int_mod readonly"></td> <td class="dsf dsf_craft1_ranks"></td> <td class="dsf dsf_craft1_misc_mod"></td> </tr><tr> <td>Craft (<span class="dsf dsf_craft2"></span>)</td> <td>Int</td> <td class="dsf dsf_craft2_mod readonly"></td> <td class="dsf dsf_int_mod readonly"></td> <td class="dsf dsf_craft2_ranks"></td> <td class="dsf dsf_craft2_misc_mod"></td> </tr><tr> <td>Craft (<span class="dsf dsf_craft3"></span>)</td> <td>Int</td> <td class="dsf dsf_craft3_mod readonly"></td> <td class="dsf dsf_int_mod readonly"></td> <td class="dsf dsf_craft3_ranks"></td> <td class="dsf dsf_craft3_misc_mod"></td> </tr><tr> <td>Decipher Script</td> <td>Int</td> <td class="dsf dsf_decipher_script_mod readonly"></td> <td class="dsf dsf_int_mod readonly"></td> <td class="dsf dsf_decipher_script_ranks"></td> <td class="dsf dsf_decipher_script_misc_mod"></td> </tr><tr> <td>Diplomacy</td> <td>Cha</td> <td class="dsf dsf_diplomacy_mod readonly"></td> <td class="dsf dsf_cha_mod readonly"></td> <td class="dsf dsf_diplomacy_ranks"></td> <td class="dsf dsf_diplomacy_misc_mod"></td> </tr><tr> <td>Disable Device</td> <td>Int</td> <td class="dsf dsf_disable_device_mod readonly"></td> <td class="dsf dsf_int_mod readonly"></td> <td class="dsf dsf_disable_device_ranks"></td> <td class="dsf dsf_disable_device_misc_mod"></td> </tr><tr> <td>Disguise</td> <td>Cha</td> <td class="dsf dsf_disguise_mod readonly"></td> <td class="dsf dsf_cha_mod readonly"></td> <td class="dsf dsf_disguise_ranks"></td> <td class="dsf dsf_disguise_misc_mod"></td> </tr><tr> <td>Escape Artist</td> <td>Dex</td> <td class="dsf dsf_escape_artist_mod readonly"></td> <td class="dsf dsf_dex_mod readonly"></td> <td class="dsf dsf_escape_artist_ranks"></td> <td class="dsf dsf_escape_artist_misc_mod"></td> </tr><tr> <td>Forgery</td> <td>Int</td> <td class="dsf dsf_forgery_mod readonly"></td> <td class="dsf dsf_int_mod readonly"></td> <td class="dsf dsf_forgery_ranks"></td> <td class="dsf dsf_forgery_misc_mod"></td> </tr><tr> <td>Gather Information</td> <td>Cha</td> <td class="dsf dsf_gather_information_mod readonly"></td> <td class="dsf dsf_cha_mod readonly"></td> <td class="dsf dsf_gather_information_ranks"></td> <td class="dsf dsf_gather_information_misc_mod"></td> </tr><tr> <td>Handle Animal</td> <td>Cha</td> <td class="dsf dsf_handle_animal_mod readonly"></td> <td class="dsf dsf_cha_mod readonly"></td> <td class="dsf dsf_handle_animal_ranks"></td> <td class="dsf dsf_handle_animal_misc_mod"></td> </tr><tr> <td>Heal</td> <td>Wis</td> <td class="dsf dsf_heal_mod readonly"></td> <td class="dsf dsf_wis_mod readonly"></td> <td class="dsf dsf_heal_ranks"></td> <td class="dsf dsf_heal_misc_mod"></td> </tr><tr> <td>Hide</td> <td>Dex</td> <td class="dsf dsf_hide_mod readonly"></td> <td class="dsf dsf_dex_mod readonly"></td> <td class="dsf dsf_hide_ranks"></td> <td class="dsf dsf_hide_misc_mod"></td> </tr><tr> <td>Intimidate</td> <td>Cha</td> <td class="dsf dsf_intimidate_mod readonly"></td> <td class="dsf dsf_cha_mod readonly"></td> <td class="dsf dsf_intimidate_ranks"></td> <td class="dsf dsf_intimidate_misc_mod"></td> </tr><tr> <td>Jump</td> <td>Str</td> <td class="dsf dsf_jump_mod readonly"></td> <td class="dsf dsf_str_mod readonly"></td> <td class="dsf dsf_jump_ranks"></td> <td class="dsf dsf_jump_misc_mod"></td> </tr><tr> <td>Knowledge (<span class="dsf dsf_knowledge1"></span>)</td> <td>Int</td> <td class="dsf dsf_knowledge1_mod readonly"></td> <td class="dsf dsf_int_mod readonly"></td> <td class="dsf dsf_knowledge1_ranks"></td> <td class="dsf dsf_knowledge1_misc_mod"></td> </tr><tr> <td>Knowledge (<span class="dsf dsf_knowledge2"></span>)</td> <td>Int</td> <td class="dsf dsf_knowledge2_mod readonly"></td> <td class="dsf dsf_int_mod readonly"></td> <td class="dsf dsf_knowledge2_ranks"></td> <td class="dsf dsf_knowledge2_misc_mod"></td> </tr><tr> <td>Knowledge (<span class="dsf dsf_knowledge3"></span>)</td> <td>Int</td> <td class="dsf dsf_knowledge3_mod readonly"></td> <td class="dsf dsf_int_mod readonly"></td> <td class="dsf dsf_knowledge3_ranks"></td> <td class="dsf dsf_knowledge3_misc_mod"></td> </tr><tr> <td>Knowledge (<span class="dsf dsf_knowledge4"></span>)</td> <td>Int</td> <td class="dsf dsf_knowledge4_mod readonly"></td> <td class="dsf dsf_int_mod readonly"></td> <td class="dsf dsf_knowledge4_ranks"></td> <td class="dsf dsf_knowledge4_misc_mod"></td> </tr><tr> <td>Knowledge (<span class="dsf dsf_knowledge5"></span>)</td> <td>Int</td> <td class="dsf dsf_knowledge5_mod readonly"></td> <td class="dsf dsf_int_mod readonly"></td> <td class="dsf dsf_knowledge5_ranks"></td> <td class="dsf dsf_knowledge5_misc_mod"></td> </tr><tr> <td>Listen</td> <td>Wis</td> <td class="dsf dsf_listen_mod readonly"></td> <td class="dsf dsf_wis_mod readonly"></td> <td class="dsf dsf_listen_ranks"></td> <td class="dsf dsf_listen_misc_mod"></td> </tr><tr> <td>Move Silently</td> <td>Dex</td> <td class="dsf dsf_move_silently_mod readonly"></td> <td class="dsf dsf_dex_mod readonly"></td> <td class="dsf dsf_move_silently_ranks"></td> <td class="dsf dsf_move_silently_misc_mod"></td> </tr><tr> <td>Open Lock</td> <td>Dex</td> <td class="dsf dsf_open_lock_mod readonly"></td> <td class="dsf dsf_dex_mod readonly"></td> <td class="dsf dsf_open_lock_ranks"></td> <td class="dsf dsf_open_lock_misc_mod"></td> </tr><tr> <td>Perform (<span class="dsf dsf_perform1"></span>)</td> <td>Cha</td> <td class="dsf dsf_perform1_mod readonly"></td> <td class="dsf dsf_cha_mod readonly"></td> <td class="dsf dsf_perform1_ranks"></td> <td class="dsf dsf_perform1_misc_mod"></td> </tr><tr> <td>Perform (<span class="dsf dsf_perform2"></span>)</td> <td>Cha</td> <td class="dsf dsf_perform2_mod readonly"></td> <td class="dsf dsf_cha_mod readonly"></td> <td class="dsf dsf_perform2_ranks"></td> <td class="dsf dsf_perform2_misc_mod"></td> </tr><tr> <td>Perform (<span class="dsf dsf_perform3"></span>)</td> <td>Cha</td> <td class="dsf dsf_perform3_mod readonly"></td> <td class="dsf dsf_cha_mod readonly"></td> <td class="dsf dsf_perform3_ranks"></td> <td class="dsf dsf_perform3_misc_mod"></td> </tr><tr> <td>Profession (<span class="dsf dsf_profession1"></span>)</td> <td>Wis</td> <td class="dsf dsf_profession1_mod readonly"></td> <td class="dsf dsf_wis_mod readonly"></td> <td class="dsf dsf_profession1_ranks"></td> <td class="dsf dsf_profession1_misc_mod"></td> </tr><tr> <td>Profession (<span class="dsf dsf_profession2"></span>)</td> <td>Wis</td> <td class="dsf dsf_profession2_mod readonly"></td> <td class="dsf dsf_wis_mod readonly"></td> <td class="dsf dsf_profession2_ranks"></td> <td class="dsf dsf_profession2_misc_mod"></td> </tr><tr> <td>Ride</td> <td>Dex</td> <td class="dsf dsf_ride_mod readonly"></td> <td class="dsf dsf_dex_mod readonly"></td> <td class="dsf dsf_ride_ranks"></td> <td class="dsf dsf_ride_misc_mod"></td> </tr><tr> <td>Search</td> <td>Int</td> <td class="dsf dsf_search_mod readonly"></td> <td class="dsf dsf_int_mod readonly"></td> <td class="dsf dsf_search_ranks"></td> <td class="dsf dsf_search_misc_mod"></td> </tr><tr> <td>Sense Motive</td> <td>Wis</td> <td class="dsf dsf_sense_motive_mod readonly"></td> <td class="dsf dsf_wis_mod readonly"></td> <td class="dsf dsf_sense_motive_ranks"></td> <td class="dsf dsf_sense_motive_misc_mod"></td> </tr><tr> <td>Sleight of Hand</td> <td>Dex</td> <td class="dsf dsf_sleight_of_hand_mod readonly"></td> <td class="dsf dsf_dex_mod readonly"></td> <td class="dsf dsf_sleight_of_hand_ranks"></td> <td class="dsf dsf_sleight_of_hand_misc_mod"></td> </tr><tr> <td>Spellcraft</td> <td>Int</td> <td class="dsf dsf_spellcraft_mod readonly"></td> <td class="dsf dsf_int_mod readonly"></td> <td class="dsf dsf_spellcraft_ranks"></td> <td class="dsf dsf_spellcraft_misc_mod"></td> </tr><tr> <td>Spot</td> <td>Wis</td> <td class="dsf dsf_spot_mod readonly"></td> <td class="dsf dsf_wis_mod readonly"></td> <td class="dsf dsf_spot_ranks"></td> <td class="dsf dsf_spot_misc_mod"></td> </tr><tr> <td>Survival</td> <td>Wis</td> <td class="dsf dsf_survival_mod readonly"></td> <td class="dsf dsf_wis_mod readonly"></td> <td class="dsf dsf_survival_ranks"></td> <td class="dsf dsf_survival_misc_mod"></td> </tr><tr> <td>Swim</td> <td>Str</td> <td class="dsf dsf_swim_mod readonly"></td> <td class="dsf dsf_str_mod readonly"></td> <td class="dsf dsf_swim_ranks"></td> <td class="dsf dsf_swim_misc_mod"></td> </tr><tr> <td>Tumble</td> <td>Dex</td> <td class="dsf dsf_tumble_mod readonly"></td> <td class="dsf dsf_dex_mod readonly"></td> <td class="dsf dsf_tumble_ranks"></td> <td class="dsf dsf_tumble_misc_mod"></td> </tr><tr> <td>Use Magic Device</td> <td>Cha</td> <td class="dsf dsf_use_magic_device_mod readonly"></td> <td class="dsf dsf_cha_mod readonly"></td> <td class="dsf dsf_use_magic_device_ranks"></td> <td class="dsf dsf_use_magic_device_misc_mod"></td> </tr><tr> <td>Use Rope</td> <td>Dex</td> <td class="dsf dsf_use_rope_mod readonly"></td> <td class="dsf dsf_dex_mod readonly"></td> <td class="dsf dsf_use_rope_ranks"></td> <td class="dsf dsf_use_rope_misc_mod"></td> </tr> </table> </div> <div class="featbox fancybox"> <h3 class="title">Feats<span class="ctlAddFeat addButton">+ Add</span></h3> <div class="dsf dsf_ctlFeatCount" style="display:none"></div> <table width="100%" class="featTable" prefix="feat"> <tr><th>Feat</th><th>Description</th></tr> </table> </div> <div class="abilitybox fancybox"> <h3 class="title">Special Abilities<span class="ctlAddAbility addButton">+ Add</span></h3> <div class="dsf dsf_ctlAbilityCount" style="display:none"></div> <table width="100%" class="abilityTable" prefix="special_ability"> <tr><th>Ability</th><th>Description</th></tr> </table> </div> <div class="traitbox fancybox"> <h3 class="title">Traits<span class="ctlAddTrait addButton">+ Add</span></h3> <div class="dsf dsf_ctlTraitCount" style="display:none"></div> <table width="100%" class="traitTable" prefix="trait"> <tr><th>Trait</th><th>Description</th></tr> </table> </div> <div class="fancybox"> <h4 class="title">Carrying Capacity</h4> <table width="100%"> <col /> <col width="20%" /> <col width="20%" /> <col width="20%" /> <col width="20%" /> <tr> <td style="text-align:right;"><span class="dsf dsf_light_load"></span> lbs.</td> <td style="text-align:right;"><span class="dsf dsf_medium_load readonly"></span> lbs.</td> <td style="text-align:right;"><span class="dsf dsf_heavy_load readonly"></span> lbs.</td> <td style="text-align:right;"><span class="dsf dsf_lift_over_head readonly"></span> lbs.</td> <td style="text-align:right;"><span class="dsf dsf_push_or_drag readonly"></span> lbs.</td> </tr><tr> <th>Light Load</th> <th>Medium Load</th> <th>Heavy Load</th> <th>Lift Over Head</th> <th>Push/Drag</th> </tr> </table> </div> <div class="fancybox"> <h4 class="title">Money</h4> <table width="100%"> <col /> <col width="20%" /> <col width="20%" /> <col width="20%" /> <col width="20%" /> <tr> <td style="text-align:right;" class="dsf dsf_wealth_total readonly"></td> <td style="text-align:right;" class="dsf dsf_pp"></td> <td style="text-align:right;" class="dsf dsf_gp"></td> <td style="text-align:right;" class="dsf dsf_sp"></td> <td style="text-align:right;" class="dsf dsf_cp"></td> </tr><tr> <th>Total</th> <th>PP</th> <th>GP</th> <th>SP</th> <th>CP</th> </tr> </table> </div> <div class="fancybox inventorybox"> <h3 class="title">Inventory<span class="ctlAddInventory addButton">+ Add</span></h3> <div class="dsf dsf_ctlInventoryCount" style="display:none"></div> </div> <div class="fancybox spellbox"> <h3 class="title">Spells</h3> <div class="newSpellsDialog"><b>New Spells Section:</b> <input type="checkbox" name="spontaneous" /><label for="spontaneous">Spontaneous Caster</label> <input type="checkbox" name="spellbook" /><label for="spellbook">Uses Spellbook</label> <input type="checkbox" name="domains" /><label for="domains">Domains</label> <input type="text" name="minSpellLevel" size="1" maxlength="1" value="0" /> —<input type="text" name="maxSpellLevel" size="1" maxlength="1" value="9" /> <h3 class="title">Spell Level <span class="ctlAddSpellSection addButton">+ Add</span></h3> </div> <div class="dsf dsf_ctlSpellSectionCount" style="display:none"></div> </div> <div class="fancybox"> <h3 class="title">Character Bio</h3> <div class="dsf dsf_bio readonly"></div> </div> <br /> <br /> <div class="campaign">Campaign: <span class="dsf readonly dsf_campaign"></span></div> <div>D&D 3.5 Universal Sheet by: <span class="dsf dsf_dst_author readonly"></span></div> </div>
CSS
.ds_dnd35rev .clearfix:after { content: "."; display: block; clear: both; visibility: hidden; line-height: 0; height: 0; } .ds_dnd35rev .clearfix { display: inline-block; } * html .clearfix { height: 1%; } .ds_dnd35rev label { color: #fff; } .ds_dnd35rev { line-height: 14px; font-size: 12px; width: 99%; padding: 0; margin: 0; border: 0; } .ds_dnd35rev .fancybox { /*padding: 0 0 2px 0;*/ padding: 2px; margin: 10px 0 0 0; display: inline-block; width: 100%; vertical-align: top; float: left; } /* Tables */ .ds_dnd35rev table { margin: 0; border-collapse: separate; border-spacing: 2px; } .ds_dnd35rev td { padding: 5px 5px 0 5px; text-align: center; font-size: 12px; } .ds_dnd35rev th { font-size: 10px; border-top: 2px solid black; padding-top: 3px; text-align: center; background: none; } .ds_dnd35rev td, .ds_dnd35rev th { vertical-align: top; font-family: Helvetica, Tahoma, Arial; margin: 0 3px; } /* Active Areas */ .ds_dnd35rev .dsf { vertical-align: bottom; } .ds_dnd35rev.editable span.dsf { min-width: 20px; display: inline-block } .ds_dnd35rev .noborder { border: none !important; } /* Titles */ .ds_dnd35rev .title { width: 100%; text-align: center; margin: 0; padding: 2px 0; } .ds_dnd35rev h3.title { font-family: Helvetica, Tahoma, Arial; background: #000000; color: #ffffff; font-size: 18px; padding: 4px 0; font-weight: bold; } .ds_dnd35rev h4.title { font-family: Helvetica, Tahoma, Arial; background: #444; color: #ffffff; font-size: 14px; font-weight: bold; padding: 2px; } .ds_dnd35rev .newSpellsDialog { font-family: Helvetica, Tahoma, Arial; background: #000000; /* Old browsers */ color: #ffffff; font-size: 14px; width: 100%; text-align: center; margin: 0; padding: 2px 0; } .ds_dnd35rev .newSpellsDialog label { display: inline; font: inherit; } .ds_dnd35rev .newSpellsDialog input { padding: 0 2px; font: inherit; } .ds_dnd35rev .collapse { width: 1px !important; padding: 0 !important; margin: 0 !important; border-spacing: 0 !important; border: none !important; } .ds_dnd35rev .addButton, .ds_dnd35rev .removeButton { display: none; } .ds_dnd35rev.editable .addButton { display: inline; float: right; margin: 3px 8px; padding: 4px 5px; border-radius: 4px; background-color: #ccc; color: #111; cursor: pointer; font-weight: normal; font-size: 11px; line-height: 11px; } .ds_dnd35rev.editable .removeButton { display: inline; float: right; margin: 3px 8px; padding: 4px 5px; border-radius: 4px; background-color: #722; color: #fff; cursor: pointer; font-weight: normal; font-size: 11px; line-height: 11px; } .ds_dnd35rev.editable .dsf { background-color: #CDF; color: #000; border-radius: 2px; } .ds_dnd35rev.editable .dsf.readonly, .ds_dnd35rev.editable .dsf.checkbox { background-color: #fff; color: #000; border-radius: 0; } .ds_dnd35rev .quarterwidth { width: 24.5%; display: inline-block; margin-top: 0; vertical-align: top; } .halfwidth.halfwidthright { padding-right: 1%; } .ds_dnd35rev .halfwidth { width: 48.9%; display: inline-block; margin-top: 0; vertical-align: top; } .ds_dnd35rev .thirdwidth { width: 32.5%; display: inline-block; margin-top: 0; vertical-align: top; } .ds_dnd35rev .threequarterwidth { width: 74.5%; display: inline-block; margin-top: 0; vertical-align: top; } .ds_dnd35rev .spellSection .quarterwidth { width: 25%; display: inline-block; margin-top: 0; vertical-align: top; } .ds_dnd35rev .spellSection .threequarterwidth { width: 72.5%; display: inline-block; margin-top: 0; vertical-align: top; margin-right: 2%; } .ds_dnd35rev .domain { border-top-left-radius: 0; border-top-right-radius: 0; margin-left: -1px; width: 181px; box-shadow: none; } .ds_dnd35rev .dcbox { width: 184px; margin-right: -1px; } .ds_dnd35rev .spellSection { margin-top: 5px; border-top-left-radius: inherit; border-top-right-radius: inherit; } .ds_dnd35rev .skillTable tr > td:first-child { text-align: left; } .ds_dnd35rev .statsbox th.stat, .ds_dnd35rev .savesbox th.stat { font-size: 12px; font-variant: small-caps; vertical-align: middle; } .ds_dnd35rev .spellList { margin: 2px 1px 2px 2px; display: inline-block; border-bottom: 1px solid black; } .ds_dnd35rev .spellList .dsf { width: 225px; display: inline-block; height: 100%; } .ds_dnd35rev .spellList .spellLevel { width: 15px; display: inline-block; } .ds_dnd35rev .dsf_bio { min-height: 100px; height: 100%; padding: 5px; } .ds_dnd35rev .sideways { -webkit-transform: rotate(90deg); -moz-transform: rotate(90deg); text-align: left; vertical-align: top; display: block; margin: 10px 0 15px 0; font-size: 10px; } .ds_dnd35rev .dsf_avatar_image { height: 100%; }
Javascript
var $ = jQuery; aisleten.characters.jeditablePlaceholder = " "; function dnd35rev_dataPreLoad(options) { if ($.browser.msie) { } if(typeof dynamic_sheet_attrs == "undefined") dynamic_sheet_attrs = {}; var containerId = "#" + options['containerId']; //Set defaults to keep the editing fields from making the form gross var defaults = { str: "10", dex: "10", "con": "10", "int": "10", wis: "10", cha: "10", languages: "Common", ctlFeatCount: 10, //Default number on Takissis's sheet ctlAbilityCount: 16, //Default number on Takissis's sheet ctlInventoryCount: 36, //Due to poor numbering, the max number on Takissis's sheet ctlSkillCount: 0, //Start with no extra skill lines ctlTraitCount: 2, //A little extra padding to fill space ctlWeaponCount: 2, //Two rows, primary and backup ctlSpellSectionCount: 0 } dynamic_sheet_attrs = $.extend(defaults, dynamic_sheet_attrs); if (!options.isEditable) { //We're in read-only mode, so alter the sheet a little to make it more useful //Can't add if it's not an edit $(containerId + " .newSpellsDialog").hide(); if (dynamic_sheet_attrs.ctlSpellSectionCount <= 0) { //Not a wielder, so hide that section $(containerId + " .spellbox").hide(); } if (dynamic_sheet_attrs.ctlTraitCount <= 0) { //Not a wielder, so hide that section $(containerId + " .traitbox").hide(); } if (dynamic_sheet_attrs.ctlFeatCount <= 0) { //Not a wielder, so hide that section $(containerId + " .featbox").hide(); } if (dynamic_sheet_attrs.ctlAbilityCount <= 0) { //Not a wielder, so hide that section $(containerId + " .abilitybox").hide(); } } else { //First, we ensure that all the dynamic tables show at least one row if (dynamic_sheet_attrs.ctlFeatCount < 5) { dynamic_sheet_attrs.ctlFeatCount = 5; } if (dynamic_sheet_attrs.ctlAbilityCount < 5) { dynamic_sheet_attrs.ctlAbilityCount = 5; } if (dynamic_sheet_attrs.ctlTraitCount < 2) { dynamic_sheet_attrs.ctlTraitCount = 2; } if (dynamic_sheet_attrs.ctlSkillCount < 0) { dynamic_sheet_attrs.ctlSkillCount = 0; } if (dynamic_sheet_attrs.ctlWeaponCount < 2) { dynamic_sheet_attrs.ctlWeaponCount = 2; } if (dynamic_sheet_attrs.ctlInventoryCount < 9) { dynamic_sheet_attrs.ctlInventoryCount = 9; } //Loading in editing mode, so wire up the event handlers $(containerId + " .ctlAddFeat").bind("click.dnd35rev", function () { var ctl = $(containerId + " .dsf_ctlFeatCount"); var count = Number(ctl.text())+1; ctl.text(count); dnd35rev_addFeatRow('featTable', 'feat', count, containerId, true); }); $(containerId + " .ctlAddAbility").bind("click.dnd35rev", function () { var ctl = $(containerId + " .dsf_ctlAbilityCount"); var count = Number(ctl.text())+1; ctl.text(count); dnd35rev_addFeatRow('abilityTable', 'special_ability', count, containerId, true); }); $(containerId + " .ctlAddTrait").bind("click.dnd35rev", function () { var ctl = $(containerId + " .dsf_ctlTraitCount"); var count = Number(ctl.text())+1; ctl.text(count); dnd35rev_addFeatRow('traitTable', 'trait', count, containerId, true); }); $(containerId + " .ctlAddSkill").bind("click.dnd35rev", function () { var ctl = $(containerId + " .dsf_ctlSkillCount"); var count = Number(ctl.text())+1; ctl.text(count); dnd35rev_addSkillRow('skillTable', count, containerId, true); }); $(containerId + " .ctlAddWeapon").bind("click.dnd35rev", function () { var ctl = $(containerId + " .dsf_ctlWeaponCount"); var count = Number(ctl.text())+1; ctl.text(count); dnd35rev_addWeaponRow('weaponTable', count, containerId, true); }); $(containerId + " .ctlAddInventory").bind("click.dnd35rev", function () { var ctl = $(containerId + " .dsf_ctlInventoryCount"); var count = Number(ctl.text())+1; ctl.text(count); dnd35rev_addInventoryRow('inventorybox', count, containerId, true); }); $(containerId + " .ctlAddSpellSection").bind("click.dnd35rev", function () { var ctl = $(containerId + " .dsf_ctlSpellSectionCount"); var count = Number(ctl.text()); ctl.text(count + 1); dnd35rev_addSpellSection('spellbox', count, containerId, true); }); $(containerId).delegate(".ctlRemoveSpellSection", "click", function () { var ctl = $(containerId + " .dsf_ctlSpellSectionCount"); var count = Number(ctl.text()) - 1; ctl.text(count); ctl = $(this).parents(".spellSectionContainer").next(); $(this).parents(".spellSectionContainer").remove(); dnd35rev_renumberSpellSections(ctl); }); } //Now, we initialize the dynamic rows to hold the incoming data for (var i=1; i<=dynamic_sheet_attrs.ctlFeatCount; i++) { dnd35rev_addFeatRow('featTable', 'feat', i, containerId, options.isEditable); } for (var i=1; i<=dynamic_sheet_attrs.ctlAbilityCount; i++) { dnd35rev_addFeatRow('abilityTable', 'special_ability', i, containerId, options.isEditable); } for (var i=1; i<=dynamic_sheet_attrs.ctlTraitCount; i++) { dnd35rev_addFeatRow('traitTable', 'trait', i, containerId, options.isEditable); } for (var i=1; i<=dynamic_sheet_attrs.ctlSkillCount; i++) { dnd35rev_addSkillRow('skillTable', i, containerId, options.isEditable); } for (var i=1; i<=dynamic_sheet_attrs.ctlWeaponCount; i++) { dnd35rev_addWeaponRow('weaponTable', i, containerId, options.isEditable); } for (var i=1; i<=dynamic_sheet_attrs.ctlInventoryCount; i++) { dnd35rev_addInventoryRow('inventorybox', i, containerId, options.isEditable); } for (var i=0; i<dynamic_sheet_attrs.ctlSpellSectionCount; i++) { dnd35rev_addSpellSection('spellbox', i, containerId, options.isEditable, dynamic_sheet_attrs["spsSec" + i + "_Spontaneous"] == '1', dynamic_sheet_attrs["spsSec" + i + "_Spellbook"] == '1', dynamic_sheet_attrs["spsSec" + i + "_Domains"] == '1', dynamic_sheet_attrs["spsSec" + i + "_MinLevel"], dynamic_sheet_attrs["spsSec" + i + "_MaxLevel"]); } } function dnd35rev_dataPostLoad(options) { //alert(JSON.stringify(dynamic_sheet_attrs)); // Called just after the data is loaded. if (options.isEditable) { var containerId = "#" + options['containerId']; //since we're editing, make sure that all the data is recalculated and correct dnd35rev_updateStat("str", containerId); dnd35rev_updateStat("dex", containerId); dnd35rev_updateStat("con", containerId); dnd35rev_updateStat("int", containerId); dnd35rev_updateStat("wis", containerId); dnd35rev_updateStat("cha", containerId); dnd35rev_updateInventoryStuff(containerId); var fixHelper = function(e, ui) { ui.children().each(function() { $(this).width($(this).width()); }); return ui; }; //Wire up sortable tables $(containerId + " .featTable").sortable({ items: "tr:not(:first)", helper: fixHelper, update: dnd35rev_renumberTable }); $(containerId + " .abilityTable").sortable({ items: "tr:not(:first)", helper: fixHelper, update: dnd35rev_renumberTable }); $(containerId + " .traitTable").sortable({ items: "tr:not(:first)", helper: fixHelper, update: dnd35rev_renumberTable }); $(containerId + " .inventorybox").sortable({ items: "div.item", helper: fixHelper, update: dnd35rev_renumberItems }); $(containerId + " .featTable tr, " + containerId + " .abilityTable tr, " + containerId + " .traitTable tr, " + containerId + " .inventorybox div.item").disableSelection(); } } function dnd35rev_dataChange(options) { // Called immediately after a data value is changed. // alert("dataChange. " + options['fieldName'] + " = " + options['fieldValue']); var field = options['fieldName']; var val = options['fieldValue']; var containerId = "#" + options['containerId']; //need to push the values to the other versions of the field //required due to how jEditable works $(containerId + " .dsf_" + field).text(val); switch (field) { case "str": case "str_damage": case "str_boost": dnd35rev_updateStat("str", containerId); break; case "int": case "int_damage": case "int_boost": dnd35rev_updateStat("int", containerId); break; case "wis": case "wis_damage": case "wis_boost": dnd35rev_updateStat("wis", containerId); break; case "dex": case "dex_damage": case "dex_boost": dnd35rev_updateStat("dex", containerId); break; case "con": case "con_damage": case "con_boost": dnd35rev_updateStat("con", containerId); break; case "cha": case "cha_damage": case "cha_boost": dnd35rev_updateStat("cha", containerId); break; case "base_fort_save": case "magic_fort_mod": case "misc_fort_mod": case "temp_fort_mod": case "base_reflex_save": case "magic_reflex_mod": case "misc_reflex_mod": case "temp_reflex_mod": case "base_willpower_save": case "magic_willpower_mod": case "misc_willpower_mod": case "temp_willpower_mod": dnd35rev_updateSaves(containerId); break; case "misc_init_mod": dnd35rev_updateInit(containerId); break; case "size_mod": dnd35rev_updateAC(containerId); case "bab": dnd35rev_updateAttacks(containerId); case "misc_grapple_mod": dnd35rev_updateGrapple(containerId); break; case "armor_bonus": case "shield_bonus": case "dex_mod_armor": case "deflection_mod": case "misc_mod": case "natural_armor": dnd35rev_updateAC(containerId); break; case "pp": case "gp": case "sp": case "cp": case "light_load": dnd35rev_updateInventoryStuff(containerId); break; } if ((field.substr(field.length - 6) == '_ranks')) { dnd35rev_updateSkill(containerId, "dsf_" + field.substr(0, field.length - 6)); } else if ((field.substr(field.length - 9) == '_misc_mod')) { dnd35rev_updateSkill(containerId, "dsf_" + field.substr(0, field.length - 9)); } else if ((field.substr(field.length - 8) == '_ability')) { dnd35rev_updateSkill(containerId, "dsf_" + field.substr(0, field.length - 8)); } else if ((field.length >= 14) && (field.substr(0, 6) == 'spsSec') && (field.substr(field.length - 6) == 'BaseDC')) { for (var l=0; l<=9; l++) { $(containerId + " .dsf_" + field.substr(0, 7) + "_DC" + l).text(Number(val) + l); } } } function dnd35rev_dataPreSave(options) { // Called just before the data is saved to the server. // alert("dataPreSave"); var containerId = "#" + options['containerId']; //Comb through the dynamic tables and remove empty values dnd35rev_cleanTable("feat", "Feat", containerId); dnd35rev_cleanTable("special_ability", "Ability", containerId); dnd35rev_cleanTable("trait", "Trait", containerId); dnd35rev_cleanTable("extra_skill", "Skill", containerId); dnd35rev_cleanTable("weapon", "Weapon", containerId); dnd35rev_cleanInventoryTable(containerId); //Because we're deleting rows, we need to recalculate the relevant cells //dnd35rev_updateTotal("Equipment", "equMass", containerId); } // You can define your own variables...just make sure to namespace them! function dnd35rev_updateStat(stat, containerId) { var value = Number($(containerId + " .dsf_" + stat).text()) - Number($(containerId + " .dsf_" + stat + "_damage").text()) + Number($(containerId + " .dsf_" + stat + "_boost").text()); if (dnd35rev_isNumeric(value)) { $(containerId + " .dsf_" + stat + "_mod").text(Math.floor((parseInt(value) - 10) / 2)); switch (stat) { case "str": dnd35rev_updateAttacks(containerId); dnd35rev_updateGrapple(containerId); break; case "wis": dnd35rev_updateSaves(containerId); break; case "dex": dnd35rev_updateSaves(containerId); dnd35rev_updateInit(containerId); dnd35rev_updateAttacks(containerId); dnd35rev_updateAC(containerId); break; case "con": dnd35rev_updateSaves(containerId); break; } dnd35rev_updateSkills(containerId, stat); } } function dnd35rev_updateSaves(containerId) { $(containerId + " .dsf_fortitude_total").text(Number($(containerId + " .dsf_base_fort_save").text()) + Number($(containerId + " .dsf_con_mod:first").text()) + Number($(containerId + " .dsf_magic_fort_mod").text()) + Number($(containerId + " .dsf_misc_fort_mod").text()) + Number($(containerId + " .dsf_temp_fort_mod").text())); $(containerId + " .dsf_willpower_total").text(Number($(containerId + " .dsf_base_willpower_save").text()) + Number($(containerId + " .dsf_wis_mod:first").text()) + Number($(containerId + " .dsf_magic_willpower_mod").text()) + Number($(containerId + " .dsf_misc_willpower_mod").text()) + Number($(containerId + " .dsf_temp_willpower_mod").text())); $(containerId + " .dsf_reflex_total").text(Number($(containerId + " .dsf_base_reflex_save").text()) + Number($(containerId + " .dsf_dex_mod:first").text()) + Number($(containerId + " .dsf_magic_reflex_mod").text()) + Number($(containerId + " .dsf_misc_reflex_mod").text()) + Number($(containerId + " .dsf_temp_reflex_mod").text())); } function dnd35rev_updateInit(containerId) { $(containerId + " .dsf_initative_total").text(Number($(containerId + " .dsf_dex_mod:first").text()) + Number($(containerId + " .dsf_misc_init_mod").text())); } function dnd35rev_updateAC(containerId) { $(containerId + " .dsf_ac").text(10 + Number($(containerId + " .dsf_armor_bonus").text()) + Number($(containerId + " .dsf_size_mod:first").text()) + Number($(containerId + " .dsf_shield_bonus").text()) + Number($(containerId + " .dsf_dex_mod_armor").text()) + Number($(containerId + " .dsf_deflection_mod").text()) + Number($(containerId + " .dsf_misc_mod").text()) + Number($(containerId + " .dsf_natural_armor").text())); } function dnd35rev_updateGrapple(containerId) { var val = $(containerId + " .dsf_size_mod:first").text(); if (dnd35rev_isNumeric(val)) $(containerId + " .dsf_size_mod_grapple").text(-4 * parseFloat(val)); else $(containerId + " .dsf_size_mod_grapple").text(""); $(containerId + " .dsf_grapple_total").text(Number($(containerId + " .dsf_str_mod:first").text()) + Number($(containerId + " .dsf_bab:first").text()) + Number($(containerId + " .dsf_size_mod_grapple").text()) + Number($(containerId + " .dsf_misc_grapple_mod").text())); } function dnd35rev_updateAttacks(containerId) { var bab = Number($(containerId + " .dsf_bab:first").text()); var ranged = bab + Number($(containerId + " .dsf_size_mod:first").text()) + Number($(containerId + " .dsf_dex_mod:first").text()) + Number($(containerId + " .dsf_attack_ranged_misc").text()); var melee = bab + Number($(containerId + " .dsf_size_mod:first").text()) + Number($(containerId + " .dsf_str_mod:first").text()) + Number($(containerId + " .dsf_attack_melee_misc").text()); if (bab < 6) { $(containerId + " .dsf_attack_melee_total").text(dnd35rev_signedInt(melee)); $(containerId + " .dsf_attack_ranged_total").text(dnd35rev_signedInt(ranged)); } else if (bab < 11) { $(containerId + " .dsf_attack_melee_total").text(dnd35rev_signedInt(melee) + "/" + dnd35rev_signedInt(melee-5)); $(containerId + " .dsf_attack_ranged_total").text(dnd35rev_signedInt(ranged) + "/" + dnd35rev_signedInt(ranged-5)); } else if (bab < 16) { $(containerId + " .dsf_attack_melee_total").text(dnd35rev_signedInt(melee) + "/" + dnd35rev_signedInt(melee-5) + "/" + dnd35rev_signedInt(melee-10)); $(containerId + " .dsf_attack_ranged_total").text(dnd35rev_signedInt(ranged) + "/" + dnd35rev_signedInt(ranged-5) + "/" + dnd35rev_signedInt(ranged-10)); } else { $(containerId + " .dsf_attack_melee_total").text(dnd35rev_signedInt(melee) + "/" + dnd35rev_signedInt(melee-5) + "/" + dnd35rev_signedInt(melee-10) + "/" + dnd35rev_signedInt(melee-15)); $(containerId + " .dsf_attack_ranged_total").text(dnd35rev_signedInt(ranged) + "/" + dnd35rev_signedInt(ranged-5) + "/" + dnd35rev_signedInt(ranged-10) + "/" + dnd35rev_signedInt(ranged-15)); } } function dnd35rev_updateSkills(containerId, stat) { var id; stat = stat[0].toUpperCase() + stat.substr(1).toLowerCase(); $(containerId + " .skillTable td:contains(" + stat + ")").each(function (i, c) { id = dnd35rev_findDsfClass($(c).next()); if (id) { dnd35rev_updateSkill(containerId, id.substr(0, id.length - 4)); } }); } function dnd35rev_updateSkill(containerId, skill) { var modtype = $(containerId + " ." + skill + "_mod").prev().text().toLowerCase(); var ranks = Number($(containerId + " ." + skill + "_ranks").text()); var abilMod = Number($(containerId + " .dsf_" + modtype + "_mod:first").text()); if (ranks <= 0) { ranks = 0; } var ctl = $(containerId + " ." + skill + "_ability_mod"); if (ctl.length) { //Custom field, so fill in the stat mod ctl.text(dnd35rev_signedInt(abilMod)); } $(containerId + " ." + skill + "_mod").text(dnd35rev_signedInt(ranks + Number($(containerId + " ." + skill + "_misc_mod").text()) + abilMod)); } function dnd35rev_updateTotal(countTitle, fieldName, containerId) { var count = Number($(containerId + " .dsf_ctl" + countTitle + "Count").text()); var sum = 0; for (var i=0; i<count; i++) { var val = Number($(containerId + " .dsf_" + fieldName + i).text()); if (!isNaN(val)) sum += val; } $(containerId + " .dsf_" + fieldName + "Total").text(Math.round(100.0 * sum) / 100.0); } function dnd35rev_updateInventoryStuff(containerId) { var val = $(containerId + " .dsf_light_load").text(); if (dnd35rev_isNumeric(val)) { val = Number(val); var heavy = val * 3; //hack to fix 33 * 3 = 100 if (heavy % 10 == 9) heavy++; $(containerId + " .dsf_medium_load").text(val * 2); $(containerId + " .dsf_heavy_load").text(heavy); $(containerId + " .dsf_lift_over_head").text(heavy * 2); $(containerId + " .dsf_push_or_drag").text(heavy * 5); } $(containerId + " .dsf_wealth_total").text( Number($(containerId + " .dsf_pp").text()) * 10 + Number($(containerId + " .dsf_gp").text()) + Number($(containerId + " .dsf_sp").text()) / 10.0 + Number($(containerId + " .dsf_cp").text()) / 100.0 ); } function dnd35rev_bindRow(newRow, containerId) { //Force-bind the new elements. Ah, sweet hax containerId = containerId.replace("#", ""); newRow.find(".dsf").each(function (i, c) { var name = dnd35rev_findDsfClass(c); if (name) aisleten.characters.bindField(name.replace("dsf_", ""), containerId, 'dnd35rev'); }); } function dnd35rev_addFeatRow(table, prefix, num, containerId, isEditable) { var newRow = $('<tr class="dnd35rev_' + prefix + 'Row' + num +'"><td class="dsf dsf_' + prefix + num + '" /><td class="dsf dsf_' + prefix + 'Description' + num + '"> </td></tr>'); $(containerId + " ." + table).append(newRow); if (isEditable) { newRow.disableSelection(); dnd35rev_bindRow(newRow, containerId); } } function dnd35rev_addSkillRow(table, num, containerId, isEditable) { var newRow = $('<tr class="dnd35rev_extra_skillRow' + num +'"><td class="dsf dsf_skill' + num + '" /><td class="dsf dsf_skill' + num + '_ability"> </td><td class="dsf dsf_skill' + num + '_mod readonly"> </td><td class="dsf dsf_skill' + num + '_ability_mod readonly"> </td><td class="dsf dsf_skill' + num + '_ranks"> </td><td class="dsf dsf_skill' + num + '_misc_mod"> </td></tr>'); $(containerId + " ." + table).append(newRow); if (isEditable) { newRow.disableSelection(); dnd35rev_bindRow(newRow, containerId); } } function dnd35rev_addWeaponRow(table, num, containerId, isEditable) { var newRow = $('<tr class="dnd35rev_weaponRow' + num +'"><td class="dsf dsf_weapon' + num + '" /><td class="dsf dsf_weapon' + num + '_attack_bonus"> </td><td class="dsf dsf_weapon' + num + '_damage"> </td><td class="dsf dsf_weapon' + num + '_critical"> </td><td class="dsf dsf_weapon' + num + '_range"> </td><td class="dsf dsf_weapon' + num + '_type"> </td><td class="dsf dsf_weapon' + num + '_notes"> </td></tr>'); $(containerId + " ." + table).append(newRow); if (isEditable) { newRow.disableSelection(); dnd35rev_bindRow(newRow, containerId); } } function dnd35rev_addInventoryRow(table, num, containerId, isEditable) { var newRow = $('<div class="item dnd35rev_item' + num + '"><table><col /><col width="35" /><tr><td class="dsf dsf_item' + num + '" /><td class="dsf dsf_item' + num + '_weight"> </td></tr><tr><th>Name</th><th>Wt.</th></tr></table></div>'); $(containerId + " ." + table).append(newRow); if (isEditable) { newRow.disableSelection(); dnd35rev_bindRow(newRow, containerId); } } function dnd35rev_addSpellSection(table, num, containerId, isEditable, isSpontaneous, usesSpellbook, hasDomains, minLevel, maxLevel) { if (!maxLevel) { //new section, so pull the values from the add dialog isSpontaneous = $(containerId + " .newSpellsDialog input[name=spontaneous]")[0].checked; usesSpellbook = $(containerId + " .newSpellsDialog input[name=spellbook]")[0].checked; hasDomains = $(containerId + " .newSpellsDialog input[name=domains]")[0].checked; minLevel = Number($(containerId + " .newSpellsDialog input[name=minSpellLevel]").val()); maxLevel = Number($(containerId + " .newSpellsDialog input[name=maxSpellLevel]").val()); } //Make sure we have at least some rows to add if (!maxLevel || (maxLevel < 4)) maxLevel = 4; if (!minLevel || (minLevel < 0)) minLevel = 0; if (maxLevel > 9) maxLevel = 9; if (minLevel > maxLevel) { var tmp = minLevel; minLevel = maxLevel; maxLevel = tmp; } var html = '<div class="spellSection clearfix spellSectionContainer dnd35rev_spellSection' + num + '"><div class="dsf dsf_spsSec' + num + '_Spontaneous" style="display:none;">' + (isSpontaneous ? '1' : '0') + '</div><div class="dsf dsf_spsSec' + num + '_Spellbook" style="display:none;">' + (usesSpellbook ? '1' : '0') + '</div><div class="dsf dsf_spsSec' + num + '_Domains" style="display:none;">' + (hasDomains ? '1' : '0') + '</div><div class="dsf dsf_spsSec' + num + '_MaxLevel" style="display:none;">' + maxLevel + '</div><div class="dsf dsf_spsSec' + num + '_MinLevel" style="display:none;">' + minLevel + '</div><div class="spellSection"><h3 class="title"><span class="dsf dsf_spsSec' + num + '_Name"></span><span class="ctlRemoveSpellSection removeButton">- Remove</span></h3>'; var dcTable = '<div class=" domain dcbox quarterwidth"><h4 class="title">DCs / Per-Day</h4><table><tr><td class="dsf dsf_spsSec' + num + '_BaseDC"></td><td class="dsf dsf_spsSec' + num + '_SpellFailure"></td></tr><tr><th>Base DC</th><th>Arcane Spell Failure</th></tr></table><table class="dcTable"><col width="15" /><col /><col /><col /><tr><th>Lvl</th><th>DC</th>' if (isSpontaneous) dcTable += '<th>Known</th>'; dcTable += '<th>Per Day</th><th>Bonus</th></tr>'; for (var l=minLevel; l<=maxLevel; l++) { dcTable += '<tr><td class="spellLevel">' + l + ':</td><td class="dsf readonly dsf_spsSec' + num + '_DC' + l + '"></td>' if (isSpontaneous) dcTable += '<td class="dsf dsf_spsSec' + num + '_KnownNumber' + l + '"></td>'; dcTable += '<td class="dsf dsf_spsSec' + num + '_PerDayNumber' + l + '"></td>' if (l == 0) dcTable += '<td>—</td>'; else dcTable += '<td class="dsf dsf_spsSec' + num + '_BonusNumber' + l + '"></td>'; dcTable += '</tr>'; } dcTable += "</table>"; if (hasDomains) { for (var d=0; d<3; d++) { html += '<div class=" domain quarterwidth"><h4 class="title"><span class="dsf dsf_spsSec' + num + '_Domain' + d + '_Name"></span></h4><table class="domainTable"><col width="13" /><col /><tr><td colspan="2" class="dsf dsf_spsSec' + num + '_Domain' + d + '_Power"></td></tr><tr><th colspan="2">Domain Power</th></tr>'; for (var l=Math.max(1, minLevel); l<=maxLevel; l++) { html += '<tr><td class="spellLevel">' + l + ':</td><td class="dsf dsf_spsSec' + num + '_Domain' + d + '_Spells' + l + '"></td></tr>'; } html += "</table></div>"; } html += dcTable + "</div>"; } else html += '<div class="threequarterwidth">'; if (usesSpellbook) { html += '<h4 class="title">Spellbook</h4>'; for (var l=minLevel; l<=maxLevel; l++) { html += '<div class="spellList"><div class="spellLevel" style="display:inline-block;">' + l + ':</div><div class="dsf dsf_spsSec' + num + '_Known' + l + '"></div></div>'; } } if (isSpontaneous) html += '<h4 class="title">Spells Known</h4>'; else html += '<h4 class="title">Spells Prepared</h4>'; for (var l=minLevel; l<=maxLevel; l++) { html += '<div class="spellList"><div class="spellLevel" style="display:inline-block;">' + l + ':</div><div class="dsf dsf_spsSec' + num + '_Prepared' + l + '"></div></div>'; } if (!hasDomains) html += "</div>" + dcTable; var newSection = $(html); $(containerId + " ." + table).append(newSection); if (isEditable) { dnd35rev_bindRow(newSection, containerId); } } function dnd35rev_cleanTable(prefix, title, containerId) { var max = Number($(containerId + " .dsf_ctl" + title + "Count").text()); var count = 0; for (var i=1; i<=max; i++) { var row = $(containerId + " tr.dnd35rev_" + prefix + "Row" + i); var obj = row.find("td:first"); if ("" == $.trim(obj.text())) { //This row is empty, so find the relevant tr tags and remove them row.remove(); } else { count++; } } //Nothing to renumber if we remove them all if (count > 0) dnd35rev_renumberTable(null, { item: $(containerId + " ." + prefix + "Table td:first") }); $(containerId + " .dsf_ctl" + title + "Count").text(count); } function dnd35rev_cleanInventoryTable(containerId) { var max = Number($(containerId + " .dsf_ctlInventoryCount").text()); var count = 0; for (var i=1; i<=max; i++) { var box = $(containerId + " div.dnd35rev_item" + i); var obj = box.find("td:first"); if ("" == $.trim(obj.text())) { //This row is empty, so find the relevant tr tags and remove them box.remove(); } else { count++; } } //Nothing to renumber if we remove them all if (count > 0) dnd35rev_renumberItems(null, { item: $(containerId + " .inventorybox div.item:first") }); $(containerId + " .dsf_ctlInventoryCount").text(count); } function dnd35rev_findDsfClass(element) { var classes = $(element).attr('class'); if (!classes) return null; classes = classes.split(/\s/); var fieldName = null; $.each(classes, function(i, className) { if(className.substr(0,4) == "dsf_") { fieldName = className; } }); return fieldName; } function dnd35rev_isNumeric(n) { return ($.isNumeric && $.isNumeric(n)) || (!isNaN(parseFloat(n)) && isFinite(n)); } function dnd35rev_signedInt(n) { return (n < 0) ? n : ("+" + n) } function dnd35rev_renumberTable(e, ui) { //ui.item is the tr tag that got moved var parent = ui.item.parents("table"); var prefix = parent.attr("prefix"); var baserow = parent.find(".dnd35rev_" + prefix + "Row1").children(); baserow.each(function (i, c) { baserow[i] = $(c).prop("class").replace("1", "{0}"); }); //Now that we have the templates, reorder things parent.find("tr:not(:first)").each(function (i, c) { $(c).prop("class", "dnd35rev_" + prefix + "Row" + (i+1)); $(c).find("td").each(function (j, cc) { var str = baserow[j]; $(cc).prop("class", str.replace(/\{0\}/g, (i+1))); }); }); } function dnd35rev_renumberItems(e, ui) { //ui.item is the tr tag that got moved var parent = ui.item.parents(".inventorybox"); var baserow = [ "dsf dsf_item{0}", "dsf dsf_item{0}_weight" ]; //Now that we have the templates, reorder things parent.find(".item").each(function (i, c) { $(c).prop("class", "item dnd35rev_item" + (i+1)); $(c).find("tr:first td").each(function (j, cc) { var str = baserow[j]; $(cc).prop("class", str.replace(/\{0\}/g, (i+1))); }); }); } function dnd35rev_renumberSpellSections(ctl) { //ctl is the div tag after the item that got removed if (!ctl.length) return; //Removed the last item, so nothing to do var parent = ctl.parents(".spellbox"); var count = Number(parent.find(".dsf_ctlSpellSectionCount").text()); var start = Number(ctl.prop("class").substr(54)); //Now that we have the templates, reorder things for (var i = start; i <= count; i++) { parent.find(".dnd35rev_spellSection" + i).each(function (j, c) { $(c).prop("class", "spellSection spellSectionContainer dnd35rev_spellSection" + (i-1)); $(c).find(".dsf").each(function (j, cc) { var str = $(cc).prop("class"); $(cc).prop("class", str.replace("dsf_spsSec" + i, "dsf_spsSec" + (i-1))); }); }); } }
Submit Notes
Back