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
Pathfinder RPG Universal Sheet
Author:
Karelzarath
Slug:
kpfrpg
System:
Pathfinder RPG
DST Source Code
HTML Template
<div class="basicbox fancybox pin"> <h3 class="title">Basic Information</h3> <table width="100%"> <col width="125"/> <col /> <col /> <col /> <tr> <td rowspan="10"><div class="dsf dsf_avatar_image readonly"></div></td> <td class="dsf dsf_name readonly"></td> <td class="dsf dsf_race"></td> <td class="dsf dsf_class"></td> </tr><tr> <th>Character Name</th> <th>Race</th> <th>Favored Class</th> </tr><tr> <td class="dsf dsf_gender"></td> <td class="dsf dsf_age"></td> <td class="dsf dsf_size"></td> </tr><tr> <th>Gender</th> <th>Age</th> <th>Size</th> </tr><tr> <td class="dsf dsf_alignment"></td> <td class="dsf dsf_deity"></td> <td class="dsf dsf_reputation"></td> </tr><tr> <th>Alignment</th> <th>Deity</th> <th>Fame/Infamy</th> </tr><tr> <td class="dsf dsf_level"></td> <td class="dsf dsf_mythic"></td> <td class="dsf dsf_experience_points"></td> </tr><tr> <th>Class Levels</th> <th>Mythic Tier</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 class="corebox pin"> <div class="fancybox statsbox"> <h3 class="title">Abilities</h3> <table width="195"> <tr> <th>Name</th> <th>Score</th> <th>Mod</th> <th>Item</th> <th>Dmg</th> <th>Drain</th> <th>Temp.</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_magic"></td> <td class="dsf dsf_str_damage"></td> <td class="dsf dsf_str_drain"></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_magic"></td> <td class="dsf dsf_dex_damage"></td> <td class="dsf dsf_dex_drain"></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_magic"></td> <td class="dsf dsf_con_damage"></td> <td class="dsf dsf_con_drain"></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_magic"></td> <td class="dsf dsf_int_damage"></td> <td class="dsf dsf_int_drain"></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_magic"></td> <td class="dsf dsf_wis_damage"></td> <td class="dsf dsf_wis_drain"></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_magic"></td> <td class="dsf dsf_cha_damage"></td> <td class="dsf dsf_cha_drain"></td> <td class="dsf dsf_cha_boost"></td> </tr> </table> </div> <div class="miscbox"> <div class="fancybox hpbox"> <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"> <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"> <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 defensebox"> <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> <td class="dsf dsf_acid_resist"></td> <td class="dsf dsf_cold_resist"></td> <td class="dsf dsf_elec_resist"></td> <td class="dsf dsf_fire_resist"></td> <td class="dsf dsf_sonic_resist"></td> </tr><tr> <th>Miss %</th> <th>DR</th> <th>SR</th> <th>Acid</th> <th>Cold</th> <th>Elec.</th> <th>Fire</th> <th>Sonic</th> </tr> </table> </div> <div class="fancybox attackbox"> <h4 class="title">Attack Bonuses</h4> <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> <div class="fancybox halfwidth 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 halfwidth"> <h3 class="title">CMB/CMD</h3> <table width="100%"> <tr> <td class="dsf dsf_cmb_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_cmb_stat_mod readonly"></td> <td class="collapse" rowspan="2">+</td> <td class="dsf dsf_size_mod_cmb readonly"></td> <td colspan="4" rowspan="2"></td> <td class="dsf dsf_conditional_cmb_mod" rowspan="3"></td> </tr><tr> <th>CMB</th> <th>Base Att.</th> <th class="dsf dsf_cmb_stat"></th> <th>Size</th> </tr><tr> <td class="dsf dsf_cmd_total readonly" title="Value includes Dodge and Deflection bonuses."></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_dex_mod readonly"></td> <td class="collapse" rowspan="2">+</td> <td class="dsf dsf_size_mod_cmb readonly"></td> <td class="collapse" rowspan="2">+</td> <td class="dsf dsf_misc_mod_cmd"></td> </tr><tr> <th>CMD</th> <th>Base Att.</th> <th>Str Mod</th> <th>Dex Mod</th> <th>Size</th> <th>Misc</th> <th>Conditional</th> </tr> </table> </div> </div> <div class="fancybox acbox pin"> <h3 class="title">Armor Class</h3> <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_dodge_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>Dodge</th> <th>Misc</th> </tr> </table> </div> <div class="fancybox armorbox pin"> <h3 class="title">Armor / Shield</h3> <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><tr> <td class="dsf dsf_shield18"></td> <td class="dsf dsf_shield1_type"></td> <td class="dsf dsf_shield1_ac_bonus"></td> <td class="dsf dsf_shield1_max_dex"></td> <td class="dsf dsf_shield1_penalty"></td> <td class="dsf dsf_shield1_spell_failure"></td> <td class="dsf dsf_shield1_speed"></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_max_dex"></td> <td class="dsf dsf_shield2_penalty"></td> <td class="dsf dsf_shield2_spell_failure"></td> <td class="dsf dsf_shield2_speed"></td> <td class="dsf dsf_shield2_special_properties"></td> </tr> </table> </div> <div class="fancybox weaponbox pin"> <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="skillfeatabilitybox pin"> <div class="fancybox halfwidth 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>CS</th> <th>Skill</th> <th>Key<br />Abil.</th> <th>Total</th> <th>Abil.<br />Mod</th> <th>Ranks</th> <th>Misc</th> </tr> </table> </div> <div class="fancybox halfwidth featbox"> <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="fancybox halfwidth abilitybox"> <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="fancybox halfwidth traitbox"> <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> <div class="fancybox magicitembox pin"> <h3 class="title">Magic Items<span class="ctlAddMagicItem addButton">+ Add</span></h3> <div class="dsf dsf_ctlMagicItemCount" style="display:none"></div> <table width="100%" class="magicItemTable" prefix="magicItem"> <colgroup> <col width="90" /> <col /> <col width="110" /> <col /> </colgroup> <tr> <th>Slot</th> <th>Name</th> <th>Type</th> <th>Special Qualities</th> </tr><tr> <td>Armor</td> <td class="dsf dsf_protitem17"></td> <td class="dsf dsf_protitem17_type"></td> <td class="dsf dsf_protitem17_special_properties"></td> </tr><tr> <td>Belt</td> <td class="dsf dsf_protitem1"></td> <td class="dsf dsf_protitem1_type"></td> <td class="dsf dsf_protitem1_special_properties"></td> </tr><tr> <td>Body</td> <td class="dsf dsf_protitem3"></td> <td class="dsf dsf_protitem3_type"></td> <td class="dsf dsf_protitem3_special_properties"></td> </tr><tr> <td>Chest</td> <td class="dsf dsf_protitem5"></td> <td class="dsf dsf_protitem5_type"></td> <td class="dsf dsf_protitem5_special_properties"></td> </tr><tr> <td>Eyes</td> <td class="dsf dsf_protitem7"></td> <td class="dsf dsf_protitem7_type"></td> <td class="dsf dsf_protitem7_special_properties"></td> </tr><tr> <td>Feet</td> <td class="dsf dsf_protitem9"></td> <td class="dsf dsf_protitem9_type"></td> <td class="dsf dsf_protitem9_special_properties"></td> </tr><tr> <td>Hands</td> <td class="dsf dsf_protitem11"></td> <td class="dsf dsf_protitem11_type"></td> <td class="dsf dsf_protitem11_special_properties"></td> </tr><tr> <td>Head</td> <td class="dsf dsf_protitem13"></td> <td class="dsf dsf_protitem13_type"></td> <td class="dsf dsf_protitem13_special_properties"></td> </tr><tr> <td>Headband</td> <td class="dsf dsf_protitem15"></td> <td class="dsf dsf_protitem15_type"></td> <td class="dsf dsf_protitem15_special_properties"></td> </tr><tr> <td>Neck</td> <td class="dsf dsf_protitem2"></td> <td class="dsf dsf_protitem2_type"></td> <td class="dsf dsf_protitem2_special_properties"></td> </tr><tr> <td>Ring</td> <td class="dsf dsf_protitem4"></td> <td class="dsf dsf_protitem4_type"></td> <td class="dsf dsf_protitem4_special_properties"></td> </tr><tr> <td>Ring</td> <td class="dsf dsf_protitem6"></td> <td class="dsf dsf_protitem6_type"></td> <td class="dsf dsf_protitem6_special_properties"></td> </tr><tr> <td>Shield</td> <td class="dsf dsf_protitem18"></td> <td class="dsf dsf_protitem18_type"></td> <td class="dsf dsf_protitem18_special_properties"></td> </tr><tr> <td>Shoulders</td> <td class="dsf dsf_protitem8"></td> <td class="dsf dsf_protitem8_type"></td> <td class="dsf dsf_protitem8_special_properties"></td> </tr><tr> <td>Wrist</td> <td class="dsf dsf_protitem10"></td> <td class="dsf dsf_protitem10_type"></td> <td class="dsf dsf_protitem10_special_properties"></td> </tr><tr> <td></td> <td class="dsf dsf_protitem12"></td> <td class="dsf dsf_protitem12_type"></td> <td class="dsf dsf_protitem12_special_properties"></td> </tr><tr> <td></td> <td class="dsf dsf_protitem14"></td> <td class="dsf dsf_protitem14_type"></td> <td class="dsf dsf_protitem14_special_properties"></td> </tr><tr> <td></td> <td class="dsf dsf_protitem16"></td> <td class="dsf dsf_protitem16_type"></td> <td class="dsf dsf_protitem16_special_properties"></td> </tr> </table> </div> <div class="fancybox inventorybox pin"> <h3 class="title">Inventory<span class="ctlAddInventory addButton">+ Add</span></h3> <div class="dsf dsf_ctlInventoryCount" style="display:none"></div> <div class="fancybox subbox halfwidth" style="height:70px;"> <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 subbox halfwidth" style="height:70px;"> <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> <div class="fancybox spellbox pin"> <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" /> Spell Levels<span class="ctlAddSpellSection addButton">+ Add</span></div> <div class="dsf dsf_ctlSpellSectionCount" style="display:none"></div> </div> <div class="biobox fancybox pin"> <h3 class="title">Description And Bio</h3> <table width="100%"> <col width="25%"/> <col width="25%"/> <col /> <tr> <td class="dsf dsf_height"></td> <td class="dsf dsf_weight"></td> <td class="dsf dsf_eyes"></td> </tr> <tr> <th>Height</th> <th>Weight</th> <th>Eyes</th> </tr> <tr> <td colspan="2" class="dsf dsf_hair"></td> <td class="dsf dsf_skin"></td> </tr> <tr> <th colspan="2">Hair</th> <th>Skin</th> </tr> <tr> <td colspan="2" class="dsf dsf_homeland"></td> </tr> <tr> <th colspan="2">Homeland</th> </tr> </table> <div class="dsf dsf_bio readonly"></div> </div> <br /> <br /> <div class="campaign">Campaign: <span class="dsf readonly dsf_campaign"></span></div> <div>Pathfinder RPG Universal Sheet by: <span class="dsf dsf_dst_author readonly"></span></div>
CSS
@import url(https://fonts.googleapis.com/css?family=Arapey%7CBitter); .ds_kpfrpg { line-height: 14px; font-size: 12px !important; } .ds_kpfrpg th, .ds_kpfrpg td { font-family: 'Bitter',georgia,times,'times new roman',serif !important; } .ds_kpfrpg .dsf { height: 14px; vertical-align: bottom; } .ds_kpfrpg.editable span.dsf { min-width: 20px; display: inline-block; } .ds_kpfrpg .noborder { border: none !important; } .ds_kpfrpg table { margin: 0; border-collapse: separate; border-spacing: 2px; border-bottom-left-radius: inherit; border-bottom-right-radius: inherit; } .ds_kpfrpg th { font-size: 10px !important; border-top: 1px solid black; padding: 0 !important; text-align: center; background: none; vertical-align: top !important; line-height: 11px !important; } .ds_kpfrpg td { padding: 5px 5px 0 5px; text-align: center; font-size: 12px; } .ds_kpfrpg td, .ds_kpfrpg th { margin: 0 3px; } .ds_kpfrpg .title { width: 100%; color: #ddd !important; text-align: center; margin: -1px 0 0 !important; padding: 1px 0 5px !important; border-top-left-radius: inherit; border-top-right-radius: inherit; text-shadow: 1px 1px 1px #000 !important; line-height: normal !important; } .ds_kpfrpg .spellSection .title { border-top-left-radius: 0; border-top-right-radius: 0; } .ds_kpfrpg h3.title { font-family: Arapey,georgia,times,'times new roman',serif !important; background: #003c9f; /* Old browsers */ background: -moz-radial-gradient(center, ellipse cover, #008cff 0%, #000000 73%); /* FF3.6+ */ background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,#008cff), color-stop(73%,#000000)); /* Chrome,Safari4+ */ background: -webkit-radial-gradient(center, ellipse cover, #008cff 0%,#000000 73%); /* Chrome10+,Safari5.1+ */ background: -o-radial-gradient(center, ellipse cover, #008cff 0%,#000000 73%); /* Opera 12+ */ background: -ms-radial-gradient(center, ellipse cover, #008cff 0%,#000000 73%); /* IE10+ */ background: radial-gradient(center, ellipse cover, #008cff 0%,#000000 73%); /* W3C */ font-size: 18px; height: 18px; } .ds_kpfrpg h4.title { font-family: Arapey,georgia,times,'times new roman',serif !important; background: #3c008f; /* Old browsers */ background: -moz-radial-gradient(center, ellipse cover, #604ccf 0%, #000000 73%); /* FF3.6+ */ background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,#604ccf), color-stop(73%,#000000)); /* Chrome,Safari4+ */ background: -webkit-radial-gradient(center, ellipse cover, #604ccf 0%,#000000 73%); /* Chrome10+,Safari5.1+ */ background: -o-radial-gradient(center, ellipse cover, #604ccf 0%,#000000 73%); /* Opera 12+ */ background: -ms-radial-gradient(center, ellipse cover, #604ccf 0%,#000000 73%); /* IE10+ */ background: radial-gradient(center, ellipse cover, #604ccf 0%,#000000 73%); /* W3C */ font-size: 14px; height: 14px; } .ds_kpfrpg .newSpellsDialog { font-family: Arapey,georgia,times,'times new roman',serif !important; background: #008f00; /* Old browsers */ background: -moz-radial-gradient(center, ellipse cover, #009f00 0%, #000000 73%); /* FF3.6+ */ background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,#009f00), color-stop(73%,#000000)); /* Chrome,Safari4+ */ background: -webkit-radial-gradient(center, ellipse cover, #009f00 0%,#000000 73%); /* Chrome10+,Safari5.1+ */ background: -o-radial-gradient(center, ellipse cover, #009f00 0%,#000000 73%); /* Opera 12+ */ background: -ms-radial-gradient(center, ellipse cover, #009f00 0%,#000000 73%); /* IE10+ */ background: radial-gradient(center, ellipse cover, #009f00 0%,#000000 73%); /* W3C */ font-size: 14px; border-bottom-left-radius: inherit; border-bottom-right-radius: inherit; width: 100%; color: #ddd; text-align: center; margin: 0; padding: 2px 0; text-shadow: 1px 1px 1px #000; } .ds_kpfrpg .newSpellsDialog label { display: inline; font: inherit; } .ds_kpfrpg .newSpellsDialog input { padding: 0 2px; font: inherit; } .ds_kpfrpg .collapse { width: 1px !important; padding: 0 !important; margin: 0 !important; border-spacing: 0 !important; border: none !important; } .ds_kpfrpg .addButton, .ds_kpfrpg .removeButton { display: none; } .ds_kpfrpg.editable .addButton { display: inline; float: right; min-width: 14px; height: 14px; margin: 1px 5px 1px 0; padding: 1px 5px 0 5px; border-radius: 8px; background-color: #272; color: #fff; cursor: pointer; font-weight: normal; font-size: 12px; } .ds_kpfrpg.editable .removeButton { display: inline; float: right; min-width: 14px; height: 14px; margin: 1px 5px 1px 0; padding: 1px 5px 0 5px; border-radius: 8px; background-color: #722; color: #fff; cursor: pointer; font-weight: normal; font-size: 12px; } .ds_kpfrpg.editable .dsf { background-color: #CDF; color: #000; border-radius: 2px; } .ds_kpfrpg.editable .dsf.readonly, .ds_kpfrpg.editable .dsf.checkbox { background-color: #fff; color: #000; border-radius: 0; } .ds_kpfrpg .fancybox { padding: 0 0 2px 0; margin: 5px 0 0 0; display: inline-block; width: 730px; vertical-align: top; border: 1px solid black; box-shadow: 3px 3px 3px #999; border-radius: 20px / 8px; background: #FFF; color: #000; } .ds_kpfrpg .statsbox { width: 240px; height: 194px; } .ds_kpfrpg .miscbox { width: 485px; display: inline-block; } .ds_kpfrpg .attackbox, .ds_kpfrpg .defensebox { width: 100%; } .ds_kpfrpg .hpbox { width: 138px; } .ds_kpfrpg .speedbox { width: 196px; } .ds_kpfrpg .grapplebox { width: 259px; } .ds_kpfrpg .halfwidth { width: 49.5%; /*362px;*/ display: inline-block; } .ds_kpfrpg .quarterwidth { width: 25%; /*180px;*/ display: inline-block; margin-top: 0; } .ds_kpfrpg .threequarterwidth { width: 75%; display: inline-block; margin-top: 0; } .ds_kpfrpg .domain { border-top-left-radius: 0; border-top-right-radius: 0; margin-left: -1px; margin-bottom: 3px; margin-top: -1px; width: 181px; box-shadow: none; min-height: 300px; } .ds_kpfrpg .dcbox { width: 185px; margin: 0; position: absolute; right: -1px; top: 24px; } .ds_kpfrpg .spellSection { border-top-left-radius: 0; border-top-right-radius: 0; position: relative; min-height: 327px; } .ds_kpfrpg .subbox.halfwidth { width: 365px; } .ds_kpfrpg .inventorybox .item { width: 237px; margin: 0 2px; display: inline-block; } .ds_kpfrpg .subbox { border-top-left-radius: 0; border-top-right-radius: 0; margin: -1px -2px 5px -1px; box-shadow: none; } .ds_kpfrpg .subbox + .subbox { margin-left: -2px; } .ds_kpfrpg .featbox, .ds_kpfrpg .abilitybox, .ds_kpfrpg .traitbox { margin-right: 0; } .ds_kpfrpg .skillbox { margin-right: 3px; float: left; } .ds_kpfrpg table tr:nth-of-type(2n) { background: transparent; } .ds_kpfrpg .statsbox table tr:nth-of-type(2n), .ds_kpfrpg .savesbox table tr:nth-of-type(2n), .ds_kpfrpg .armorbox table tr:nth-of-type(2n), .ds_kpfrpg .magicitembox table tr:nth-of-type(2n), .ds_kpfrpg .weaponbox table tr:nth-of-type(2n), .ds_kpfrpg .dcTable tr:nth-of-type(2n), .ds_kpfrpg .skillbox table tr:nth-of-type(2n), .ds_kpfrpg .featbox table tr:nth-of-type(2n), .ds_kpfrpg .abilitybox table tr:nth-of-type(2n) { background: #f0f0f0; } .ds_kpfrpg .statsbox table, .ds_kpfrpg .savesbox table, .ds_kpfrpg .attackbox table, .ds_kpfrpg .armorbox table, .ds_kpfrpg .magicitembox table, .ds_kpfrpg .weaponbox table, .ds_kpfrpg .dcTable, .ds_kpfrpg .skillbox table, .ds_kpfrpg .featbox table, .ds_kpfrpg .abilitybox table { border-spacing: 0 !important; border-collapse: collapse; width: 99%; margin-bottom: 4px; } .ds_kpfrpg .armorbox table, .ds_kpfrpg .weaponbox table { margin-left: 3px; width: 99%; } .ds_kpfrpg .magicitembox table { margin-left: 0; width: 99%; } .ds_kpfrpg .attackbox table { margin-top: 8px; } .ds_kpfrpg .dcTable { width: 182px; } .ds_kpfrpg .statsbox th, .ds_kpfrpg .savesbox th, .ds_kpfrpg .armorbox th, .ds_kpfrpg .magicitembox th, .ds_kpfrpg .featTable th, .ds_kpfrpg .traitTable th, .ds_kpfrpg .abilityTable th, .ds_kpfrpg .skillTable th, .ds_kpfrpg .weaponbox th, .ds_kpfrpg .dcTable th { border: none !important; vertical-align: bottom !important; padding: 4px 2px !important; } .ds_kpfrpg .skillTable tr > td:first-child { text-align: left; } .ds_kpfrpg .statsbox th.stat, .ds_kpfrpg .savesbox th.stat { font-size: 12px; font-variant: small-caps; vertical-align: middle; } .ds_kpfrpg .statsbox td, .ds_kpfrpg .savesbox td, .ds_kpfrpg .attackbox td, .ds_kpfrpg .armorbox td, .ds_kpfrpg .magicitembox td, .ds_kpfrpg .weaponbox td, .ds_kpfrpg .dcTable td { border: 1px solid black; padding: 3px; vertical-align: middle; } .ds_kpfrpg .magicItemTable tr > td:first-child, .ds_kpfrpg .dcTable tr > td:first-child { border: none; } .ds_kpfrpg .featTable td, .ds_kpfrpg .abilityTable td, .ds_kpfrpg .skillTable td, .ds_kpfrpg .traitTable td { border-bottom: 1px solid black; padding: 3px; vertical-align: middle; } .ds_kpfrpg .skillTable td { font-size: 11px; line-height: 10px; } .ds_kpfrpg .spellList { width: 100%; margin: 2px 1px 2px 2px; display: inline-block; border-bottom: 1px solid black; position: relative; min-height: 14px; } .ds_kpfrpg .spellList .dsf { height: 100%; margin-left: 15px; } .ds_kpfrpg .spellList .spellLevel { width: 15px; position: absolute; top: 0; left: 0; } .ds_kpfrpg .dsf_bio { height: 100%; padding: 5px; border-bottom-left-radius: inherit !important; border-bottom-right-radius: inherit !important; } .ds_kpfrpg .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_kpfrpg .dsf_avatar_image { display: block; height: 100%; max-width: 250px; } .ds_kpfrpg input, .ds_kpfrpg select { margin: 0; width: auto; height: auto; display: inline; } .ds_kpfrpg .pin { width: 99.5%; display: inline-block; background: #FFF; opacity: 1; } .ds_kpfrpg .dsf.dsf_cmd_total { font-weight: bold; border: 1px dashed #009900; } .dynamic_sheet_container { overflow: auto !important; max-width: 860px; }
Javascript
var $ = jQuery; aisleten.characters.jeditablePlaceholder = " "; var shouldRecalc = false; function kpfrpg_dataPreLoad(options) { //console.time("dataPreLoad"); if ($.browser.msie) { } var defaultSkills = { skill1: "Acrobatics", skill1_ability: "Dex", skill2: "Appraise", skill2_ability: "Int", skill3: "Bluff", skill3_ability: "Cha", skill4: "Climb", skill4_ability: "Str", skill5: "Craft", skill5_ability: "Int", skill6: "Craft", skill6_ability: "Int", skill7: "Craft", skill7_ability: "Int", skill8: "Diplomacy", skill8_ability: "Cha", skill9: "Disable Device", skill9_ability: "Dex", skill10: "Disguise", skill10_ability: "Cha", skill11: "Escape Artist", skill11_ability: "Dex", skill12: "Fly", skill12_ability: "Dex", skill13: "Handle Animal", skill13_ability: "Cha", skill14: "Heal", skill14_ability: "Wis", skill15: "Intimidate", skill15_ability: "Cha", skill16: "Knowledge", skill16_ability: "Int", skill17: "Knowledge", skill17_ability: "Int", skill18: "Knowledge", skill18_ability: "Int", skill19: "Knowledge", skill19_ability: "Int", skill20: "Knowledge", skill20_ability: "Int", skill21: "Linguistics", skill21_ability: "Int", skill22: "Perception", skill22_ability: "Wis", skill23: "Perform", skill23_ability: "Cha", skill24: "Perform", skill24_ability: "Cha", skill25: "Perform", skill25_ability: "Cha", skill26: "Profession", skill26_ability: "Wis", skill27: "Profession", skill27_ability: "Wis", skill28: "Ride", skill28_ability: "Dex", skill29: "Sense Motive", skill29_ability: "Wis", skill30: "Sleight of Hand", skill30_ability: "Dex", skill31: "Spellcraft", skill31_ability: "Int", skill32: "Stealth", skill32_ability: "Dex", skill33: "Survival", skill33_ability: "Wis", skill34: "Swim", skill34_ability: "Str", skill35: "Use Magic Device", skill35_ability: "Cha" }; 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", cmb_stat: "Str", ctlFeatCount: 2, //Default to give some room for new characters ctlAbilityCount: 2, //Default to give some room for new characters ctlInventoryCount: 12, //Four lines of three entries to start with ctlSkillCount: 0, //35 standard skill lines, including 3 Craft, 5 Knowledge, 3 Perform, 2 Profession ctlTraitCount: 2, //A little extra padding to fill space ctlWeaponCount: 2, //Two rows, primary and backup ctlSpellSectionCount: 0, ctlMagicItemCount: 0 } dynamic_sheet_attrs = $.extend(defaults, dynamic_sheet_attrs); //Check for old skill format and transition to new if (dynamic_sheet_attrs.acrobatics_cs != undefined) { kpfrpg_transitionSkills(defaultSkills, dynamic_sheet_attrs.ctlSkillCount); shouldRecalc = true; } if (dynamic_sheet_attrs.ctlInventoryCount < 9) { dynamic_sheet_attrs.ctlInventoryCount = 9; } if (dynamic_sheet_attrs.ctlWeaponCount < 2) { dynamic_sheet_attrs.ctlWeaponCount = 2; } 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 < 2) { dynamic_sheet_attrs.ctlFeatCount = 2; } if (dynamic_sheet_attrs.ctlAbilityCount < 2) { dynamic_sheet_attrs.ctlAbilityCount = 2; } if (dynamic_sheet_attrs.ctlTraitCount < 2) { dynamic_sheet_attrs.ctlTraitCount = 2; } if (dynamic_sheet_attrs.ctlMagicItemCount < 0) { dynamic_sheet_attrs.ctlMagicItemCount = 0; } if (dynamic_sheet_attrs.ctlSkillCount < 5) { dynamic_sheet_attrs.ctlSkillCount = 35; dynamic_sheet_attrs = $.extend(defaultSkills, dynamic_sheet_attrs); shouldRecalc = true; } //Loading in editing mode, so wire up the event handlers $(containerId + " .ctlAddFeat").bind("click.kpfrpg", function () { var ctl = $(containerId + " .dsf_ctlFeatCount"); var count = Number(ctl.text())+1; ctl.text(count); kpfrpg_addFeatRow('featTable', 'feat', count, containerId, true); }); $(containerId + " .ctlAddAbility").bind("click.kpfrpg", function () { var ctl = $(containerId + " .dsf_ctlAbilityCount"); var count = Number(ctl.text())+1; ctl.text(count); kpfrpg_addFeatRow('abilityTable', 'special_ability', count, containerId, true); }); $(containerId + " .ctlAddTrait").bind("click.kpfrpg", function () { var ctl = $(containerId + " .dsf_ctlTraitCount"); var count = Number(ctl.text())+1; ctl.text(count); kpfrpg_addFeatRow('traitTable', 'trait', count, containerId, true); }); $(containerId + " .ctlAddMagicItem").bind("click.kpfrpg", function () { var ctl = $(containerId + " .dsf_ctlMagicItemCount"); var count = Number(ctl.text())+1; ctl.text(count); kpfrpg_addMagicItemRow('magicItemTable', count, containerId, true); }); $(containerId + " .ctlAddSkill").bind("click.kpfrpg", function () { var ctl = $(containerId + " .dsf_ctlSkillCount"); var count = Number(ctl.text())+1; ctl.text(count); kpfrpg_addSkillRow('skillTable', count, containerId, true); }); $(containerId + " .ctlAddWeapon").bind("click.kpfrpg", function () { var ctl = $(containerId + " .dsf_ctlWeaponCount"); var count = Number(ctl.text())+1; ctl.text(count); kpfrpg_addWeaponRow('weaponTable', count, containerId, true); }); $(containerId + " .ctlAddInventory").bind("click.kpfrpg", function () { var ctl = $(containerId + " .dsf_ctlInventoryCount"); var count = Number(ctl.text())+1; ctl.text(count); kpfrpg_addInventoryRow('inventorybox', count, containerId, true); }); $(containerId + " .ctlAddSpellSection").bind("click.kpfrpg", function () { var ctl = $(containerId + " .dsf_ctlSpellSectionCount"); var count = Number(ctl.text()); ctl.text(count + 1); kpfrpg_addSpellSection('spellbox', count, containerId, true); }); $(containerId).on("click", ".ctlRemoveSpellSection", function () { var ctl = $(containerId + " .dsf_ctlSpellSectionCount"); var count = Number(ctl.text()) - 1; ctl.text(count); ctl = $(this).parents(".spellSectionContainer").next(); $(this).parents(".spellSectionContainer").remove(); kpfrpg_renumberSpellSections(ctl); }); $(containerId + " .skillTable").on("change.kpfrpg", "input[type=checkbox]", function() { var ctl = $(this).parent().next(); //Get the skill name because it's easier to parse var skill = ctl[0].className.substring(4); kpfrpg_updateSkill(containerId, skill); }); } //Now, we initialize the dynamic rows to hold the incoming data for (var i=1; i<=dynamic_sheet_attrs.ctlFeatCount; i++) { kpfrpg_addFeatRow('featTable', 'feat', i, containerId, options.isEditable); } for (var i=1; i<=dynamic_sheet_attrs.ctlAbilityCount; i++) { kpfrpg_addFeatRow('abilityTable', 'special_ability', i, containerId, options.isEditable); } for (var i=1; i<=dynamic_sheet_attrs.ctlTraitCount; i++) { kpfrpg_addFeatRow('traitTable', 'trait', i, containerId, options.isEditable); } for (var i=1; i<=dynamic_sheet_attrs.ctlSkillCount; i++) { kpfrpg_addSkillRow('skillTable', i, containerId, options.isEditable); } for (var i=1; i<=dynamic_sheet_attrs.ctlMagicItemCount; i++) { kpfrpg_addMagicItemRow('magicItemTable', i, containerId, options.isEditable); } for (var i=1; i<=dynamic_sheet_attrs.ctlWeaponCount; i++) { kpfrpg_addWeaponRow('weaponTable', i, containerId, options.isEditable); } for (var i=1; i<=dynamic_sheet_attrs.ctlInventoryCount; i++) { kpfrpg_addInventoryRow('inventorybox', i, containerId, options.isEditable); } for (var i=0; i<dynamic_sheet_attrs.ctlSpellSectionCount; i++) { kpfrpg_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"]); } //console.timeEnd("dataPreLoad"); } function kpfrpg_dataPostLoad(options) { // Called just after the data is loaded. //console.time("dataPostLoad"); var containerId = "#" + options['containerId']; if (shouldRecalc || options.isEditable) { //since we're editing, make sure that all the data is recalculated and correct kpfrpg_updateStat("str", containerId); kpfrpg_updateStat("dex", containerId); kpfrpg_updateStat("con", containerId); kpfrpg_updateStat("int", containerId); kpfrpg_updateStat("wis", containerId); kpfrpg_updateStat("cha", containerId); kpfrpg_updateInventoryStuff(containerId); } if (options.isEditable) { 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: kpfrpg_renumberTable }); $(containerId + " .skillTable").sortable({ items: "tr:not(:first)", helper: fixHelper, update: kpfrpg_renumberTable }); $(containerId + " .abilityTable").sortable({ items: "tr:not(:first)", helper: fixHelper, update: kpfrpg_renumberTable }); $(containerId + " .traitTable").sortable({ items: "tr:not(:first)", helper: fixHelper, update: kpfrpg_renumberTable }); $(containerId + " .inventorybox").sortable({ items: "div.item", helper: fixHelper, update: kpfrpg_renumberItems }); $(containerId + " .featTable tr, " + containerId + " .abilityTable tr, " + containerId + " .traitTable tr, " + containerId + " .inventorybox div.item").disableSelection(); } var skillBoxHeight = $(containerId + " .skillbox").height(); var featBox = $(containerId + " .featbox"); if (featBox.height() - skillBoxHeight >= -100) { featBox.after("<br style='clear:both' />"); } //console.timeEnd("dataPostLoad"); } function kpfrpg_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 //but exclude checkboxes if ((field.substr(field.length - 3) != '_cs')) { $(containerId + " .dsf_" + field).text(val); } switch (field) { case "str": case "str_damage": case "str_drain": case "str_magic": case "str_boost": kpfrpg_updateStat("str", containerId); break; case "int": case "int_damage": case "int_drain": case "int_magic": case "int_boost": kpfrpg_updateStat("int", containerId); break; case "wis": case "wis_damage": case "wis_drain": case "wis_magic": case "wis_boost": kpfrpg_updateStat("wis", containerId); break; case "dex": case "dex_damage": case "dex_drain": case "dex_magic": case "dex_boost": kpfrpg_updateStat("dex", containerId); break; case "con": case "con_damage": case "con_drain": case "con_magic": case "con_boost": kpfrpg_updateStat("con", containerId); break; case "cha": case "cha_damage": case "cha_drain": case "cha_magic": case "cha_boost": kpfrpg_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": kpfrpg_updateSaves(containerId); break; case "misc_init_mod": kpfrpg_updateInit(containerId); break; case "size_mod": kpfrpg_updateAC(containerId); case "bab": kpfrpg_updateAttacks(containerId); case "misc_mod_cmd": case "cmb_stat": kpfrpg_updateGrapple(containerId); break; case "deflection_mod": case "dodge_mod": kpfrpg_updateGrapple(containerId); case "armor_bonus": case "shield_bonus": case "dex_mod_armor": case "misc_mod": case "natural_armor": kpfrpg_updateAC(containerId); break; case "pp": case "gp": case "sp": case "cp": case "light_load": kpfrpg_updateInventoryStuff(containerId); break; } if ((field.substr(field.length - 6) == '_ranks')) { kpfrpg_updateSkill(containerId, "dsf_" + field.substr(0, field.length - 6)); } else if ((field.substr(field.length - 9) == '_misc_mod')) { kpfrpg_updateSkill(containerId, "dsf_" + field.substr(0, field.length - 9)); } else if ((field.substr(field.length - 3) == '_cs')) { kpfrpg_updateSkill(containerId, "dsf_" + field.substr(0, field.length - 3)); } else if ((field.substr(field.length - 8) == '_ability')) { kpfrpg_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 kpfrpg_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 kpfrpg_cleanTable("feat", "Feat", containerId); kpfrpg_cleanTable("ability", "Ability", containerId); kpfrpg_cleanTable("trait", "Trait", containerId); kpfrpg_cleanSkillTable(containerId); kpfrpg_cleanTable("weapon", "Weapon", containerId); kpfrpg_cleanTable("magicItem", "MagicItem", containerId); kpfrpg_cleanInventoryTable(containerId); } // You can define your own variables...just make sure to namespace them! function kpfrpg_updateStat(stat, containerId) { var value = Number($(containerId + " .dsf_" + stat).text()) - Number($(containerId + " .dsf_" + stat + "_damage").text()) - Number($(containerId + " .dsf_" + stat + "_drain").text()) + Number($(containerId + " .dsf_" + stat + "_magic").text()) + Number($(containerId + " .dsf_" + stat + "_boost").text()); if (kpfrpg_isNumeric(value)) { $(containerId + " .dsf_" + stat + "_mod").text(Math.floor((parseInt(value) - 10) / 2)); switch (stat) { case "str": kpfrpg_updateAttacks(containerId); break; case "wis": kpfrpg_updateSaves(containerId); break; case "dex": kpfrpg_updateSaves(containerId); kpfrpg_updateInit(containerId); kpfrpg_updateAttacks(containerId); kpfrpg_updateAC(containerId); break; case "con": kpfrpg_updateSaves(containerId); break; } kpfrpg_updateGrapple(containerId); kpfrpg_updateSkills(containerId, stat); } } function kpfrpg_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 kpfrpg_updateInit(containerId) { $(containerId + " .dsf_initative_total").text(Number($(containerId + " .dsf_dex_mod:first").text()) + Number($(containerId + " .dsf_misc_init_mod").text())); } function kpfrpg_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_dodge_mod").text()) + Number($(containerId + " .dsf_misc_mod").text()) + Number($(containerId + " .dsf_natural_armor").text())); } function kpfrpg_updateGrapple(containerId) { var val = $(containerId + " .dsf_size_mod:first").text(); var strmod, dexmod, sizemod, bab; if (kpfrpg_isNumeric(val)) { sizemod = -1 * parseInt(val); $(containerId + " .dsf_size_mod_cmb").text(sizemod); } else { sizemod = 0; $(containerId + " .dsf_size_mod_cmb").text(""); } strmod = Number($(containerId + " .dsf_str_mod:first").text()); dexmod = Number($(containerId + " .dsf_dex_mod:first").text()); bab = Number($(containerId + " .dsf_bab:first").text()); var cmb_mod = $(containerId + " .dsf_" + $(containerId + " .dsf_cmb_stat").text().toLowerCase() + "_mod:first"); if (cmb_mod.length < 1) { //Not selected or not a valid value $(containerId + " .dsf_cmb_stat").text("Str"); cmb_mod = strmod; } else { cmb_mod = Number(cmb_mod.text()); } $(containerId + " .dsf_cmb_stat_mod").text(cmb_mod); $(containerId + " .dsf_cmb_total").text(cmb_mod + bab + sizemod); $(containerId + " .dsf_cmd_total").text(10 + bab + strmod + dexmod + sizemod + Number($(containerId + " .dsf_deflection_mod").text()) + Number($(containerId + " .dsf_dodge_mod").text()) + Number($(containerId + " .dsf_misc_mod_cmd").text()) ); } function kpfrpg_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(kpfrpg_signedInt(melee)); $(containerId + " .dsf_attack_ranged_total").text(kpfrpg_signedInt(ranged)); } else if (bab < 11) { $(containerId + " .dsf_attack_melee_total").text(kpfrpg_signedInt(melee) + "/" + kpfrpg_signedInt(melee-5)); $(containerId + " .dsf_attack_ranged_total").text(kpfrpg_signedInt(ranged) + "/" + kpfrpg_signedInt(ranged-5)); } else if (bab < 16) { $(containerId + " .dsf_attack_melee_total").text(kpfrpg_signedInt(melee) + "/" + kpfrpg_signedInt(melee-5) + "/" + kpfrpg_signedInt(melee-10)); $(containerId + " .dsf_attack_ranged_total").text(kpfrpg_signedInt(ranged) + "/" + kpfrpg_signedInt(ranged-5) + "/" + kpfrpg_signedInt(ranged-10)); } else { $(containerId + " .dsf_attack_melee_total").text(kpfrpg_signedInt(melee) + "/" + kpfrpg_signedInt(melee-5) + "/" + kpfrpg_signedInt(melee-10) + "/" + kpfrpg_signedInt(melee-15)); $(containerId + " .dsf_attack_ranged_total").text(kpfrpg_signedInt(ranged) + "/" + kpfrpg_signedInt(ranged-5) + "/" + kpfrpg_signedInt(ranged-10) + "/" + kpfrpg_signedInt(ranged-15)); } } function kpfrpg_updateSkills(containerId, stat) { var id; stat = stat[0].toUpperCase() + stat.substr(1).toLowerCase(); $(containerId + " .skillTable td:contains(" + stat + ")").each(function (i, c) { id = kpfrpg_findDsfClass($(c).next()); if (id) { kpfrpg_updateSkill(containerId, id.substr(0, id.length - 4)); } }); } function kpfrpg_updateSkill(containerId, skill) { var modtype = $(containerId + " ." + skill + "_mod").prev().text().toLowerCase(); var classmod = Number($(containerId + " ." + skill + "_cs input").val()) ? 3 : 0; var ranks = Number($(containerId + " ." + skill + "_ranks").text()); var abilMod = Number($(containerId + " .dsf_" + modtype + "_mod:first").text()); if (ranks <= 0) { ranks = 0; classmod = 0; } var ctl = $(containerId + " ." + skill + "_ability_mod"); if (ctl.length) { //Custom field, so fill in the stat mod ctl.text(kpfrpg_signedInt(abilMod)); } $(containerId + " ." + skill + "_mod").text(kpfrpg_signedInt(classmod + ranks + Number($(containerId + " ." + skill + "_misc_mod").text()) + abilMod)); } function kpfrpg_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 kpfrpg_updateInventoryStuff(containerId) { var val = $(containerId + " .dsf_light_load").text(); if (kpfrpg_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( Math.round(100 * (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)) / 100.0 ); } function kpfrpg_bindRow(newRow, containerId) { //Force-bind the new elements. Ah, sweet hax containerId = containerId.replace("#", ""); newRow.find(".dsf").each(function (i, c) { var name = kpfrpg_findDsfClass(c); if (name) aisleten.characters.bindField(name.replace("dsf_", ""), containerId, 'kpfrpg'); }); } function kpfrpg_addFeatRow(table, prefix, num, containerId, isEditable) { var newRow = $('<tr class="kpfrpg_' + 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(); kpfrpg_bindRow(newRow, containerId); } } function kpfrpg_addSkillRow(table, num, containerId, isEditable) { var newRow = $('<tr class="kpfrpg_skillRow' + num +'"><td class="dsf dsf_skill' + num + '_cs checkbox"></td><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(); kpfrpg_bindRow(newRow, containerId); } } function kpfrpg_addMagicItemRow(table, num, containerId, isEditable) { var newRow = $('<tr class="kpfrpg_magicItemRow' + num +'"><td></td><td class="dsf dsf_misc_magic_item' + num + '"></td><td class="dsf dsf_misc_magic_item' + num + '_type"></td><td class="dsf dsf_misc_magic_item' + num + '_special_properties"></td></tr>'); $(containerId + " ." + table).append(newRow); if (isEditable) { kpfrpg_bindRow(newRow, containerId); } } function kpfrpg_addWeaponRow(table, num, containerId, isEditable) { var newRow = $('<tr class="kpfrpg_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(); kpfrpg_bindRow(newRow, containerId); } } function kpfrpg_addInventoryRow(table, num, containerId, isEditable) { var newRow = $('<div class="item kpfrpg_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(); kpfrpg_bindRow(newRow, containerId); } } function kpfrpg_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 spellSectionContainer kpfrpg_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="fancybox 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><td class="dsf dsf_spsSec' + num + '_Concentration"></td></tr><tr><th>Base DC</th><th>Fail %</th><th>Conc.</th></tr></table><table class="dcTable"><col width="15" /><col /><col /><col />'; if (isSpontaneous) dcTable += '<col />'; dcTable += '<tr><th>Lvl</th><th>DC</th>' if (isSpontaneous) dcTable += '<th>Known</th>'; dcTable += '<th>Per Day</th>'; if (isSpontaneous) dcTable += '<th>Left</th>' dcTable += '<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>'; if (l == 0) { dcTable += '<td>—</td><td>—</td>'; if (isSpontaneous) dcTable += '<td>—</td>'; } else { dcTable += '<td class="dsf dsf_spsSec' + num + '_PerDayNumber' + l + '"></td>' if (isSpontaneous) dcTable += '<td class="dsf dsf_spsSec' + num + '_Left' + l + '"></td>' 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="fancybox 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 + '_Power1"></td></tr><tr><th colspan="2">Domain Power</th></tr><tr><td colspan="2" class="dsf dsf_spsSec' + num + '_Domain' + d + '_Power2"></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">' + 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">' + 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) { kpfrpg_bindRow(newSection, containerId); } } function kpfrpg_cleanTable(prefix, title, containerId) { var max = Number($(containerId + " .dsf_ctl" + title + "Count").text()); var rowPrefix = $(containerId + " ." + prefix + "Table").attr("prefix"); var count = 0; for (var i=1; i<=max; i++) { var row = $(containerId + " tr.kpfrpg_" + rowPrefix + "Row" + i); var obj = row.find("td.dsf: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) kpfrpg_renumberTable(null, { item: $(containerId + " ." + prefix + "Table td:first") }); $(containerId + " .dsf_ctl" + title + "Count").text(count); } function kpfrpg_cleanSkillTable(containerId) { var max = Number($(containerId + " .dsf_ctlSkillCount").text()); var count = 0; for (var i=1; i<=max; i++) { var row = $(containerId + " tr.kpfrpg_skillRow" + i); var obj = row.find("td:nth(1)"); 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) kpfrpg_renumberTable(null, { item: $(containerId + " .skillTable td:first") }); $(containerId + " .dsf_ctlSkillCount").text(count); } function kpfrpg_cleanInventoryTable(containerId) { var max = Number($(containerId + " .dsf_ctlInventoryCount").text()); var count = 0; for (var i=1; i<=max; i++) { var box = $(containerId + " div.kpfrpg_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) kpfrpg_renumberItems(null, { item: $(containerId + " .inventorybox div.item:first") }); $(containerId + " .dsf_ctlInventoryCount").text(count); } function kpfrpg_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 kpfrpg_isNumeric(n) { return ($.isNumeric && $.isNumeric(n)) || (!isNaN(parseFloat(n)) && isFinite(n)); } function kpfrpg_signedInt(n) { return (n < 0) ? n : ("+" + n) } function kpfrpg_renumberTable(e, ui) { //ui.item is the tr tag that got moved var parent = ui.item.parents("table"); var prefix = parent.attr("prefix"); var partialClass = "kpfrpg_" + prefix + "Row"; var baserow = parent.find("tr[class*=" + partialClass + "]:first"); var rowId = "1"; var classNames = baserow[0].className.split(/\s+/); for (var i=0; i<classNames.length; i++) { if (classNames[i].indexOf(partialClass) == 0) { rowId = classNames[i].substring(partialClass.length); break; } } baserow = baserow.children(); baserow.each(function (i, c) { baserow[i] = $(c).prop("class").replace(rowId, "{0}"); }); //Now that we have the templates, reorder things parent.find("tr[class*=" + partialClass + "]").each(function (i, c) { $(c).prop("class", partialClass + (i+1)); $(c).find("td").each(function (j, cc) { var str = baserow[j]; $(cc).prop("class", str.replace(/\{0\}/g, (i+1))); }); }); } function kpfrpg_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 kpfrpg_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 kpfrpg_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(".kpfrpg_spellSection" + i).each(function (j, c) { $(c).prop("class", "spellSection spellSectionContainer kpfrpg_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))); }); }); } } function kpfrpg_transitionSkills(defaultSkills, customSkillCount) { var max = dynamic_sheet_attrs.ctlSkillCount = 35 + (kpfrpg_isNumeric(customSkillCount) ? parseInt(customSkillCount) : 0); var oldSkills = [ "acrobatics", "appraise", "bluff", "climb", "craft1", "craft2", "craft3", "diplomacy", "disable_device", "disguise", "escape_artist", "fly", "handle_animal", "heal", "intimidate", "knowledge1", "knowledge2", "knowledge3", "knowledge4", "knowledge5", "linguistics", "perception", "perform1", "perform2", "perform3", "profession1", "profession2", "ride", "sense_motive", "sleght_of_hand", "spellcraft", "stealth", "survival", "use_magic_device" ]; //First, move the old custom skills to the end for (var i = 1; i <= customSkillCount; i++) { defaultSkills['skill' + (i + 35) + '_cs'] = dynamic_sheet_attrs['skill' + i + '_cs']; defaultSkills['skill' + (i + 35) + ''] = dynamic_sheet_attrs['skill' + i + '']; defaultSkills['skill' + (i + 35) + '_ability'] = dynamic_sheet_attrs['skill' + i + '_ability']; defaultSkills['skill' + (i + 35) + '_mod'] = dynamic_sheet_attrs['skill' + i + '_mod']; defaultSkills['skill' + (i + 35) + '_ability_mod'] = dynamic_sheet_attrs['skill' + i + '_ability_mod']; defaultSkills['skill' + (i + 35) + '_ranks'] = dynamic_sheet_attrs['skill' + i + '_ranks']; defaultSkills['skill' + (i + 35) + '_misc_mod'] = dynamic_sheet_attrs['skill' + i + '_misc_mod']; dynamic_sheet_attrs['skill' + i + '_cs'] = null; dynamic_sheet_attrs['skill' + i + ''] = null; dynamic_sheet_attrs['skill' + i + '_ability'] = null; dynamic_sheet_attrs['skill' + i + '_mod'] = null; dynamic_sheet_attrs['skill' + i + '_ability_mod'] = null; dynamic_sheet_attrs['skill' + i + '_ranks'] = null; dynamic_sheet_attrs['skill' + i + '_misc_mod'] = null; } for (var i = 1; i <= oldSkills.length; i++) { var skillName = oldSkills[i-1]; defaultSkills['skill' + i + '_cs'] = dynamic_sheet_attrs[skillName + '_cs']; defaultSkills['skill' + i + '_mod'] = dynamic_sheet_attrs[skillName + '_mod']; defaultSkills['skill' + i + '_ranks'] = dynamic_sheet_attrs[skillName + '_ranks']; defaultSkills['skill' + i + '_misc_mod'] = dynamic_sheet_attrs[skillName + '_misc_mod']; var subskill; if ((skillName.indexOf("craft") == 0) || (skillName.indexOf("knowledge")) == 0 || (skillName.indexOf("perform")) == 0 || (skillName.indexOf("profession") == 0)) { subskill = dynamic_sheet_attrs[skillName]; defaultSkills['skill' + i] = defaultSkills['skill' + i] + " (" + (subskill == undefined ? " " : subskill) + ")"; } } //Copy the new skills over the old custom skills dynamic_sheet_attrs = $.extend(dynamic_sheet_attrs, defaultSkills); }
Submit Notes
Back