mirror of
https://github.com/Nighthawk42/roll20-character-sheets.git
synced 2026-08-30 19:52:29 +00:00
1586 lines
81 KiB
HTML
1586 lines
81 KiB
HTML
<div class="container">
|
||
<!-- HEADER -->
|
||
<div class="flex-row justify-end">
|
||
<input type="hidden" name="attr_page">
|
||
<div style="width: 1rem;"></div>
|
||
<button type="action" name="act_show_core" class="tab-button core-btn"><span data-i18n="common.core">Core</span></button>
|
||
<button type="action" name="act_show_bio" class="tab-button bio-btn"><span data-i18n="common.bio">Bio</span></button>
|
||
<button type="action" name="act_show_config" class="tab-button config-btn"><span data-i18n="common.config">Configuration</span></button>
|
||
<div style="width: 1rem;"></div>
|
||
</div>
|
||
<input type="hidden" name="attr_page">
|
||
|
||
<!-- PC Core-->
|
||
<div class="flex-column core">
|
||
<div class="flex-row frame align-center">
|
||
<label class="label w-1 right"><span data-i18n="common.name">Name</span></label>
|
||
<input type="text" class="input w-3" name="attr_character_name"></input>
|
||
<label class="label w-1 right"><span data-i18n="common.roll">Roll</span></label>
|
||
<input type="text" value="2d6" placeholder="2D6H - 3D8L - ..."="w-2" name="attr_roll_base">
|
||
<label class="label fit-content">±</label>
|
||
<input type="number" placeholder="1" class="input w-1" name="attr_bonus_dices"></input>
|
||
<input type="hidden" name="attr_roll"></input>
|
||
<label class="label fit-content">dices</label>
|
||
<label class="label w-1 right"><span data-i18n="common.xp">Xp</span></label>
|
||
<input type="number" class="input w-1" name="attr_xp"></input>
|
||
<label class="label fit-content">/</label>
|
||
<input type="number" class="input w-1" name="attr_xp_max"></input>
|
||
</div>
|
||
<div class="flex-row">
|
||
<div class="flex-column w-6 justify-sb">
|
||
<div class="flex-row grow">
|
||
<div class="flex-column w-6 frame justify-sa">
|
||
<input type="hidden" name="attr_attribute_choose" value="?{common.choose|attributes.strength,@{strength}|attributes.agility,@{agility}|attributes.mind,@{mind}|attributes.appeal,@{appeal}}">
|
||
<div class="flex-row align-center">
|
||
<label class="label w-7"><span data-i18n="attributes.strength">Strength</span></label>
|
||
<div class="flex-row w-5">
|
||
<input type="number" class="bordered-input input w-6" name="attr_strength"></input>
|
||
<input type="hidden" name="attr_strength_rollvalue"
|
||
value="&{template:main} {{titre=^{attributes.strength}}} {{subtitle=@{character_name}}} {{roll=[[@{roll} + @{strength}]]}}">
|
||
<button type="roll" name="attr_strength_roll" value="@{strength_rollvalue}" class="w-6 custom-roll"></button>
|
||
</div>
|
||
</div>
|
||
<div class="flex-row align-center">
|
||
<label class="label w-7"><span data-i18n="attributes.agility">Agility</span></label>
|
||
<div class="flex-row w-5">
|
||
<input type="number" class="bordered-input input w-6" name="attr_agility"></input>
|
||
<input type="hidden" name="attr_agility_rollvalue"
|
||
value="&{template:main} {{titre=^{attributes.agility}}} {{subtitle=@{character_name}}} {{roll=[[@{roll} + @{agility}]]}}">
|
||
<button type="roll" name="attr_agility_roll" value="@{agility_rollvalue}" class="w-6 custom-roll"></button>
|
||
</div>
|
||
</div>
|
||
<div class="flex-row align-center">
|
||
<label class="label w-7"><span data-i18n="attributes.mind">Mind</span></label>
|
||
<div class="flex-row w-5">
|
||
<input type="number" class="bordered-input input w-6" name="attr_mind"></input>
|
||
<input type="hidden" name="attr_mind_rollvalue"
|
||
value="&{template:main} {{titre=^{attributes.mind}}} {{subtitle=@{character_name}}} {{roll=[[@{roll} + @{mind}]]}}">
|
||
<button type="roll" name="attr_mind_roll" value="@{mind_rollvalue}" class="w-6 custom-roll"></button>
|
||
</div>
|
||
</div>
|
||
<div class="flex-row align-center">
|
||
<label class="label w-7"><span data-i18n="attributes.appeal">Appeal</span></label>
|
||
<div class="flex-row w-5">
|
||
<input type="number" class="bordered-input input w-6" name="attr_appeal"></input>
|
||
<input type="hidden" name="attr_appeal_rollvalue"
|
||
value="&{template:main} {{titre=^{attributes.appeal}}} {{subtitle=@{character_name}}} {{roll=[[@{roll} + @{appeal}]]}}">
|
||
<button type="roll" name="attr_appeal_roll" value="@{appeal_rollvalue}" class="w-6 custom-roll"></button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="flex-column w-6 frame justify-sa">
|
||
<div class="flex-row align-center">
|
||
<label class="label w-7"><span data-i18n="combat.initiative">Initiative</span></label>
|
||
<div class="flex-row w-5">
|
||
<input type="number" class="bordered-input input w-6" name="attr_initiative"></input>
|
||
<input type="hidden" name="attr_initiative_rollvalue"
|
||
value="&{template:main} {{titre=^{combat.initiative}}} {{subtitle=@{character_name}}} {{roll=[[@{roll} + @{mind}+ @{initiative}]]}}">
|
||
<button type="roll" name="attr_initiative_roll" value="@{initiative_rollvalue}" class="w-6 custom-roll"></button>
|
||
</div>
|
||
</div>
|
||
<div class="flex-row align-center">
|
||
<label class="label w-7"><span data-i18n="combat.melee">Melee</span></label>
|
||
<div class="flex-row w-5">
|
||
<input type="number" class="bordered-input input w-6" name="attr_melee"></input>
|
||
<input type="hidden" name="attr_melee_rollvalue"
|
||
value="&{template:main} {{titre=^{combat.melee}}} {{subtitle=@{character_name}}} {{roll=[[@{roll} + @{agility} + @{melee}]]}}">
|
||
<button type="roll" name="attr_melee_roll" value="@{melee_rollvalue}" class="w-6 custom-roll"></button>
|
||
</div>
|
||
</div>
|
||
<div class="flex-row align-center">
|
||
<label class="label w-7"><span data-i18n="combat.ranged">Ranged</span></label>
|
||
<div class="flex-row w-5">
|
||
<input type="number" class="bordered-input input w-6" name="attr_ranged"></input>
|
||
<input type="hidden" name="attr_ranged_rollvalue"
|
||
value="&{template:main} {{titre=^{combat.ranged}}} {{subtitle=@{character_name}}} {{roll=[[@{roll} + @{agility} + @{ranged}]]}}">
|
||
<button type="roll" name="attr_ranged_roll" value="@{ranged_rollvalue}" class="w-6 custom-roll"></button>
|
||
</div>
|
||
</div>
|
||
<div class="flex-row align-center">
|
||
<label class="label w-7"><span data-i18n="combat.defense">Defense</span></label>
|
||
<input type="number" class="bordered-input input w-5" name="attr_defense"></input>
|
||
<!--<input type="hidden" name="attr_defense_rollvalue"
|
||
value="&{template:main} {{titre=^{combat.defense}}} {{subtitle=@{character_name}}} {{roll=[[@{roll} + @{defense}]]}}">
|
||
<button type="roll" name="attr_defense_roll" value="@{defense_rollvalue}" class="w-2 custom-roll"></button>-->
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="flex-column w-12 frame">
|
||
<label class="title label"><span data-i18n="common.languages">Languages</span></label>
|
||
<input type="text" class="input w-12 languages" name="attr_languages"></input>
|
||
</div>
|
||
</div>
|
||
<div class="flex-column w-3 justify-sb frame">
|
||
<div class="flex-row">
|
||
<input type="text" class="input w-8" name="attr_career_1_name" placeholder="Career 1"></input>
|
||
<input type="number" class="bordered-input input w-2" name="attr_career_1_rank"></input>
|
||
<button type="roll"
|
||
name="attr_career_1_roll"
|
||
value="&{template:main} {{titre=@{career_1_name}}} {{subtitle=@{character_name}}} {{roll=[[@{roll} + @{career_1_rank} + @{attribute_choose} ]]}}"
|
||
class="w-2 custom-roll"></button>
|
||
</div>
|
||
<div class="flex-row">
|
||
<input type="text" class="input w-8" name="attr_career_2_name" placeholder="Career 2"></input>
|
||
<input type="number" class="bordered-input input w-2" name="attr_career_2_rank"></input>
|
||
<button type="roll"
|
||
name="attr_career_2_roll"
|
||
value="&{template:main} {{titre=@{career_2_name}}} {{subtitle=@{character_name}}} {{roll=[[@{roll} + @{career_2_rank} + @{attribute_choose} ]]}}"
|
||
class="w-2 custom-roll"></button>
|
||
</div>
|
||
<div class="flex-row">
|
||
<input type="text" class="input w-8" name="attr_career_3_name" placeholder="Career 3" ></input>
|
||
<input type="number" class="bordered-input input w-2" name="attr_career_3_rank"></input>
|
||
<button type="roll"
|
||
name="attr_career_3_roll"
|
||
value="&{template:main} {{titre=@{career_3_name}}} {{subtitle=@{character_name}}} {{roll=[[@{roll} + @{career_3_rank} + @{attribute_choose} ]]}}"
|
||
class="w-2 custom-roll"></button>
|
||
</div>
|
||
<div class="flex-row">
|
||
<input type="text" class="input w-8" name="attr_career_4_name" placeholder="Career 4"></input>
|
||
<input type="number" class="bordered-input input w-2" name="attr_career_4_rank"></input>
|
||
<button type="roll"
|
||
name="attr_career_4_roll"
|
||
value="&{template:main} {{titre=@{career_4_name}}} {{subtitle=@{character_name}}} {{roll=[[@{roll} + @{career_4_rank} + @{attribute_choose} ]]}}"
|
||
class="w-2 custom-roll"></button>
|
||
</div>
|
||
<div class="flex-row">
|
||
<input type="text" class="input w-8" name="attr_career_5_name" placeholder="Career 5"></input>
|
||
<input type="number" class="bordered-input input w-2" name="attr_career_5_rank"></input>
|
||
<button type="roll"
|
||
name="attr_career_5_roll"
|
||
value="&{template:main} {{titre=@{career_5_name}}} {{subtitle=@{character_name}}} {{roll=[[@{roll} + @{career_5_rank} + @{attribute_choose} ]]}}"
|
||
class="w-2 custom-roll"></button>
|
||
</div>
|
||
<div class="flex-row">
|
||
<input type="text" class="input w-8" name="attr_career_6_name" placeholder="Career 6"></input>
|
||
<input type="number" class="bordered-input input w-2" name="attr_career_6_rank"></input>
|
||
<button type="roll"
|
||
name="attr_career_6_roll"
|
||
value="&{template:main} {{titre=@{career_6_name}}} {{subtitle=@{character_name}}} {{roll=[[@{roll} + @{career_6_rank} + @{attribute_choose} ]]}}"
|
||
class="w-2 custom-roll"></button>
|
||
</div>
|
||
</div>
|
||
<div class="flex-column w-3 frame align-center">
|
||
<input type="hidden" name="attr_has_faith">
|
||
<input type="hidden" name="attr_has_arcana">
|
||
<input type="hidden" name="attr_has_psionics">
|
||
<input type="hidden" name="attr_has_credit">
|
||
<div class="flex-column">
|
||
<label class="label centered"><span data-i18n="resources.heropoints">Hero Points</span></label>
|
||
<div class="flex-row justify-center">
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_hero_points_1"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_hero_points_2"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_hero_points_3"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_hero_points_4"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_hero_points_5"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_hero_points_6"></input>
|
||
</label>
|
||
</div>
|
||
</div>
|
||
<div class="flex-column conditional-faith">
|
||
<label class="label centered"><span data-i18n="resources.faithpoints">Faith Points</span></label>
|
||
<div class="flex-row justify-center">
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_faith_points_1"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_faith_points_2"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_faith_points_3"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_faith_points_4"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_faith_points_5"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_faith_points_6"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_faith_points_7"></input>
|
||
</label>
|
||
</div>
|
||
</div>
|
||
<div class="flex-column conditional-arcana">
|
||
<label class="label centered"><span data-i18n="resources.arcanepoints">Arcane Points</span></label>
|
||
<div class="flex-row justify-center">
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_arcanepoints_1"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_arcanepoints_2"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_arcanepoints_3"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_arcanepoints_4"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_arcanepoints_5"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_arcanepoints_6"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_arcanepoints_7"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_arcanepoints_8"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_arcanepoints_9"></input>
|
||
</label>
|
||
</div>
|
||
<div class="flex-row justify-center">
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_arcanepoints_10"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_arcanepoints_11"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_arcanepoints_12"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_arcanepoints_13"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_arcanepoints_14"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_arcanepoints_15"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_arcanepoints_16"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_arcanepoints_17"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_arcanepoints_18"></input>
|
||
</label>
|
||
</div>
|
||
</div>
|
||
<div class="flex-column conditional-psionic">
|
||
<label class="label centered"><span data-i18n="resources.psionicpoints">Psionic Points</span></label>
|
||
<div class="flex-row justify-center">
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_psionicpoints_1"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_psionicpoints_2"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_psionicpoints_3"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_psionicpoints_4"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_psionicpoints_5"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_psionicpoints_6"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_psionicpoints_7"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_psionicpoints_8"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_psionicpoints_9"></input>
|
||
</label>
|
||
</div>
|
||
<div class="flex-row justify-center">
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_psionicpoints_10"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_psionicpoints_11"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_psionicpoints_12"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_psionicpoints_13"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_psionicpoints_14"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_psionicpoints_15"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_psionicpoints_16"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_psionicpoints_17"></input>
|
||
</label>
|
||
<label class="box">
|
||
<input type="checkbox" name="attr_psionicpoints_18"></input>
|
||
</label>
|
||
</div>
|
||
</div>
|
||
<div class="flex-column conditional-credit align-center">
|
||
<label class="label centered"><span data-i18n="resources.credit_rating">Credit Rating</span></label>
|
||
<input type="number" class="bordered-input input w-4" name="attr_credit_rating"></input>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="flex-row frame align-center gap-2">
|
||
<div class="flex-column w-2 align-center">
|
||
<label class="label fit-content"><span data-i18n="resources.lifeblood">Lifeblood</span></label>
|
||
<input type="number" class="bordered-input input" name="attr_lifeblood"></input>
|
||
</div>
|
||
<div class="flex-column w-2">
|
||
<button type="action" name="act_damage_fatigue" class="damage-button"><span data-i18n="damage.fatigue">Fatigue</span></button>
|
||
<button type="action" name="act_damage_normal" class="damage-button"><span data-i18n="damage.normal">Normal</span></button>
|
||
</div>
|
||
<div class="flex-column w-2">
|
||
<button type="action" name="act_damage_rest" class="damage-button"><span data-i18n="rest.short">Rest</span></button>
|
||
<button type="action" name="act_damage_heal" class="damage-button"><span data-i18n="rest.heal">Heal</span></button>
|
||
</div>
|
||
<div class="flex-column w-7">
|
||
<div class="flex-row justify-end align-center">
|
||
<input type="hidden" name="attr_lifeblood_1" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_lifeblood_2" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_lifeblood_3" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_lifeblood_4" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_lifeblood_5" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_lifeblood_6" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_lifeblood_7" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_lifeblood_8" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_lifeblood_9" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_lifeblood_10" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_lifeblood_11" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_lifeblood_12" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_lifeblood_13" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_lifeblood_14" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_lifeblood_15" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_lifeblood_16" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_lifeblood_17" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_lifeblood_18" class="lifebox"></input>
|
||
<span></span>
|
||
</div>
|
||
<div class="flex-row justify-end align-center">
|
||
<label class="label fit-content"><span data-i18n="resources.critical">Critical</span></label>
|
||
<label class="large-box">
|
||
<input type="checkbox" name="attr_lifeblood_critical_1"></input>
|
||
</label>
|
||
<label class="large-box">
|
||
<input type="checkbox" name="attr_lifeblood_critical_2"></input>
|
||
</label>
|
||
<label class="large-box">
|
||
<input type="checkbox" name="attr_lifeblood_critical_3"></input>
|
||
</label>
|
||
<label class="large-box">
|
||
<input type="checkbox" name="attr_lifeblood_critical_4"></input>
|
||
</label>
|
||
<label class="large-box">
|
||
<input type="checkbox" name="attr_lifeblood_critical_5"></input>
|
||
</label>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<input type="hidden" name="attr_has_resolve"></input>
|
||
<div class="flex-row frame align-center gap-2 conditional-resolve">
|
||
<div class="flex-column w-2 align-center">
|
||
<label class="label fit-content"><span data-i18n="resources.resolve">resolve</span></label>
|
||
<input type="number" class="bordered-input input" name="attr_resolve"></input>
|
||
</div>
|
||
<div class="flex-column w-2">
|
||
<button type="action" name="act_resolve_fatigue" class="damage-button"><span data-i18n="damage.fatigue">Fatigue</span></button>
|
||
<button type="action" name="act_resolve_normal" class="damage-button"><span data-i18n="damage.normal">Normal</span></button>
|
||
</div>
|
||
<div class="flex-column w-2">
|
||
<button type="action" name="act_resolve_rest" class="damage-button"><span data-i18n="rest.short">Rest</span></button>
|
||
<button type="action" name="act_resolve_heal" class="damage-button"><span data-i18n="rest.heal">Heal</span></button>
|
||
</div>
|
||
<div class="flex-column w-7">
|
||
<div class="flex-row justify-end align-center">
|
||
<input type="hidden" name="attr_resolve_1" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_resolve_2" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_resolve_3" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_resolve_4" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_resolve_5" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_resolve_6" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_resolve_7" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_resolve_8" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_resolve_9" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_resolve_10" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_resolve_11" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_resolve_12" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_resolve_13" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_resolve_14" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_resolve_15" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_resolve_16" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_resolve_17" class="lifebox"></input>
|
||
<span></span>
|
||
<input type="hidden" name="attr_resolve_18" class="lifebox"></input>
|
||
<span></span>
|
||
</div>
|
||
<div class="flex-row justify-end align-center">
|
||
<label class="label fit-content"><span data-i18n="resources.critical">Critical</span></label>
|
||
<label class="large-box">
|
||
<input type="checkbox" name="attr_resolve_critical_1"></input>
|
||
</label>
|
||
<label class="large-box">
|
||
<input type="checkbox" name="attr_resolve_critical_2"></input>
|
||
</label>
|
||
<label class="large-box">
|
||
<input type="checkbox" name="attr_resolve_critical_3"></input>
|
||
</label>
|
||
<label class="large-box">
|
||
<input type="checkbox" name="attr_resolve_critical_4"></input>
|
||
</label>
|
||
<label class="large-box">
|
||
<input type="checkbox" name="attr_resolve_critical_5"></input>
|
||
</label>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="flex-row">
|
||
<div class="flex-column w-6">
|
||
<div class="flex-column frame">
|
||
<label class="title label"><span data-i18n="resources.boons">Boons</span></label>
|
||
|
||
<div class="boons">
|
||
<fieldset class="repeating_boons">
|
||
<div class="hoverable flex-column">
|
||
<input class="options-flag" type="checkbox" name="attr_options-flag" checked><span>y</span>
|
||
<div class="flex-row align-center">
|
||
<input type="hidden" name="attr_boon_rollvalue"
|
||
value="&{template:main} {{titre=@{name}}} {{subtitle=@{character_name}}} {{description=@{description}}}">
|
||
<button type="roll" name="attr_boon_roll" value="@{boon_rollvalue}"
|
||
class="flex-row bold w-12 white-roll">
|
||
<span class="w-12" name="attr_name"> </span>
|
||
</button>
|
||
</div>
|
||
<div class="flex-column options-options option-frame">
|
||
<div class="flex-row align-center">
|
||
<label class="label w-2"><span data-i18n="common.name">Name</span></label>
|
||
<input type="text" class=" text-left w-10" name="attr_name">
|
||
</div>
|
||
<div class="flex-column w-12">
|
||
<label class="label w-12"><span data-i18n="common.description">Description</span></label>
|
||
<textarea class="text-left w-12" name="attr_description"></textarea>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</fieldset>
|
||
</div>
|
||
</div>
|
||
<div class="flex-column frame">
|
||
<label class="title label"><span data-i18n="resources.flaws">Flaws</span></label>
|
||
|
||
<div class="flaws">
|
||
<fieldset class="repeating_flaws">
|
||
<div class="hoverable flex-column">
|
||
<input class="options-flag" type="checkbox" name="attr_options-flag" checked><span>y</span>
|
||
<div class="flex-row align-center">
|
||
<input type="hidden" name="attr_flaw_rollvalue"
|
||
value="&{template:main} {{titre=@{name}}} {{subtitle=@{character_name}}} {{description=@{description}}}">
|
||
<button type="roll" name="attr_flaw_roll" value="@{flaw_rollvalue}"
|
||
class="flex-row bold w-12 white-roll">
|
||
<span class="w-12" name="attr_name"> </span>
|
||
</button>
|
||
</div>
|
||
<div class="flex-column options-options option-frame">
|
||
<div class="flex-row align-center">
|
||
<label class="label w-2"><span data-i18n="common.name">Name</span></label>
|
||
<input type="text" class=" text-left w-10" name="attr_name">
|
||
</div>
|
||
<div class="flex-column w-12">
|
||
<label class="label w-12"><span data-i18n="common.description">Description</span></label>
|
||
<textarea class="text-left w-12" name="attr_description"></textarea>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</fieldset>
|
||
</div>
|
||
</div>
|
||
<div class="flex-column frame">
|
||
<label class="title label"><span data-i18n="resources.tempflaws">Temporary Flaws</span></label>
|
||
<div class="tempflaws">
|
||
<fieldset class="repeating_tempflaws">
|
||
<div class="hoverable flex-column">
|
||
<input class="options-flag" type="checkbox" name="attr_options-flag" checked><span>y</span>
|
||
<div class="flex-row align-center">
|
||
<input type="hidden" name="attr_tempflaw_rollvalue"
|
||
value="&{template:main} {{titre=@{name}}} {{subtitle=@{character_name}}} {{description=@{description}}}">
|
||
<button type="roll" name="attr_tempflaw_roll" value="@{tempflaw_rollvalue}"
|
||
class="flex-row bold w-12 white-roll">
|
||
<span class="w-12" name="attr_name"> </span>
|
||
</button>
|
||
</div>
|
||
<div class="flex-column options-options option-frame">
|
||
<div class="flex-row align-center">
|
||
<label class="label w-2"><span data-i18n="common.name">Name</span></label>
|
||
<input type="text" class=" text-left w-10" name="attr_name">
|
||
</div>
|
||
<div class="flex-column w-12">
|
||
<label class="label w-12"><span data-i18n="common.description">Description</span></label>
|
||
<textarea class="text-left w-12" name="attr_description"></textarea>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</fieldset>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="flex-column w-6">
|
||
<div class="flex-column frame">
|
||
<label class="title label"><span data-i18n="resources.weapons">Weapons</span></label>
|
||
<div class="weapons">
|
||
<fieldset class="repeating_weapons">
|
||
<div class="hoverable flex-column">
|
||
<input class="options-flag" type="checkbox" name="attr_options-flag" checked><span>y</span>
|
||
<div class="flex-row align-center">
|
||
<input type="hidden" name="attr_weapon_rollvalue"
|
||
value="&{template:attack} {{titre=@{name}}} {{subtitle=@{character_name}}} {{attack=@{weapon_attack_value}}} {{damage=@{weapon_damage_value}}} {{notes=@{notes}}}">
|
||
<input type="hidden" name="attr_weapon_attack_value"></input>
|
||
<input type="hidden" name="attr_weapon_damage_value"></input>
|
||
<button type="roll" name="attr_weapon_roll" value="@{weapon_rollvalue}"
|
||
class="flex-row bold w-12 left white-roll ">
|
||
<span class="w-6 small" name="attr_name"> </span>
|
||
<span class="w-3 center small" name="attr_type_label"> </span>
|
||
<span class="w-3 right small" name="attr_damage_label"> </span>
|
||
</button>
|
||
</div>
|
||
<div class="flex-column options-options option-frame">
|
||
<div class="flex-row align-center">
|
||
<label class="label w-2"><span data-i18n="common.name">Name</span></label>
|
||
<input type="text" class=" text-left w-10" name="attr_name">
|
||
</div>
|
||
<div class="flex-row align-center">
|
||
<label class="label w-2"><span data-i18n="attack.type">Type</span></label>
|
||
<select class="w-6" name="attr_type">
|
||
<option value="melee" data-i18n="attack.type.melee">Melee</option>
|
||
<option value="ranged" data-i18n="attack.type.ranged">Ranged</option>
|
||
</select>
|
||
<select class="w-4" name="attr_ability">
|
||
<option value="none" data-i18n="attributes.none">none</option>
|
||
<option value="agility" data-i18n="attributes.agility">Agility</option>
|
||
<option value="strength" data-i18n="attributes.strength">Strength</option>
|
||
<option value="mind" data-i18n="attributes.mind">Mind</option>
|
||
<option value="appeal" data-i18n="attributes.appeal">Appeal</option>
|
||
</select>
|
||
</div>
|
||
<div class="flex-row align-center">
|
||
<label class="label w-2"><span data-i18n="attack.damage">Damage</span></label>
|
||
<input type="text" class="text-left w-4" placeholder="2D6L" name="attr_damage_dice">
|
||
<input type="text" class="text-left w-2" placeholder="+3" name="attr_damage_bonus">
|
||
<select class="w-4" name="attr_damage_ability">
|
||
<option value="none" data-i18n="attributes.none">none</option>
|
||
<option value="agility" data-i18n="attributes.agility">Agility</option>
|
||
<option value="strength" data-i18n="attributes.strength">Strength</option>
|
||
<option value="mind" data-i18n="attributes.mind">Mind</option>
|
||
<option value="appeal" data-i18n="attributes.appeal">Appeal</option>
|
||
</select>
|
||
</div>
|
||
<input type="hidden" name="attr_type"></input>
|
||
<div class="flex-row conditional-range">
|
||
<label class="label w-2"><span data-i18n="attack.range">Range</span></label>
|
||
<input type="text" class="text-left w-10" name="attr_range">
|
||
</div>
|
||
<div class="flex-column w-12">
|
||
<label class="label w-12"><span data-i18n="common.notes">Notes</span></label>
|
||
<textarea class="text-left w-12" name="attr_notes"></textarea>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</fieldset>
|
||
</div>
|
||
</div>
|
||
<div class="flex-column frame">
|
||
<label class="title label"><span data-i18n="resources.armours">Armours</span></label>
|
||
<div class="armours">
|
||
<fieldset class="repeating_armours">
|
||
<div class="hoverable flex-column">
|
||
<input class="options-flag" type="checkbox" name="attr_options-flag" checked><span>y</span>
|
||
<div class="flex-row align-center">
|
||
<input type="hidden" name="attr_armour_rollvalue"
|
||
value="&{template:main} {{titre=@{name}}} {{subtitle=@{character_name}}} {{roll=@{armour_roll_value}}} {{notes=@{notes}}}">
|
||
<input type="hidden" name="attr_armour_roll_value"></input>
|
||
<button type="roll" name="attr_armour_roll" value="@{armour_rollvalue}"
|
||
class="flex-row bold w-12 left white-roll ">
|
||
<span class="w-6 small" name="attr_name_label"> </span>
|
||
<span class="w-6 right small" name="attr_armour_roll_label"> </span>
|
||
</button>
|
||
</div>
|
||
<div class="flex-column options-options option-frame">
|
||
<div class="flex-row align-center">
|
||
<label class="label w-2"><span data-i18n="common.name">Name</span></label>
|
||
<input type="text" class=" text-left w-10" name="attr_name">
|
||
</div>
|
||
<div class="flex-row align-center">
|
||
<label class="label w-2"><span data-i18n="armour.roll">Roll</span></label>
|
||
<input type="text" class="text-left w-4" placeholder="2D6L" name="attr_armour_dice">
|
||
<input type="text" class="text-left w-2" placeholder="-2" name="attr_armour_malus">
|
||
<select class="w-4" name="attr_type">
|
||
<option value="light" data-i18n="armour.light">Light</option>
|
||
<option value="medium" data-i18n="armour.medium">Medium</option>
|
||
<option value="heavy" data-i18n="armour.heavy">Heavy</option>
|
||
</select>
|
||
</div>
|
||
<div class="flex-column w-12">
|
||
<label class="label w-12"><span data-i18n="common.notes">Notes</span></label>
|
||
<textarea class="text-left w-12" name="attr_notes"></textarea>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</fieldset>
|
||
</div>
|
||
</div>
|
||
<div class="flex-column frame">
|
||
<label class="title label"><span data-i18n="resources.gear">Gear</span></label>
|
||
<div class="gears">
|
||
<fieldset class="repeating_gears">
|
||
<div class="hoverable flex-column">
|
||
<input class="options-flag" type="checkbox" name="attr_options-flag" checked><span>y</span>
|
||
<div class="flex-row align-center">
|
||
<input type="hidden" name="attr_gear_rollvalue"
|
||
value="&{template:main} {{titre=@{name}}} {{subtitle=@{character_name}}} {{description=@{description}}}">
|
||
<button type="roll" name="attr_gear_roll" value="@{gear_rollvalue}"
|
||
class="flex-row bold w-12 white-roll">
|
||
<span class="w-12" name="attr_name"> </span>
|
||
</button>
|
||
</div>
|
||
<div class="flex-column options-options option-frame">
|
||
<div class="flex-row align-center">
|
||
<label class="label w-2"><span data-i18n="common.name">Name</span></label>
|
||
<input type="text" class=" text-left w-10" name="attr_name">
|
||
</div>
|
||
<div class="flex-column w-12">
|
||
<label class="label w-12"><span data-i18n="common.description">Description</span></label>
|
||
<textarea class="text-left w-12" name="attr_description"></textarea>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</fieldset>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="flex-column frame">
|
||
<label class="label centered"><span data-i18n="notes.vademecum-1">Dice Roll Modifier</span></label>
|
||
<label class="label centered"><span data-i18n="notes.vademecum-2">Dice Roll Increase / Decrease</span></label>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- PC Bio-->
|
||
<div class="flex-column bio">
|
||
<div class="flex-row frame align-center">
|
||
<label class="label w-1 right"><span data-i18n="common.name">Name</span></label>
|
||
<input type="text" class="input w-3" name="attr_character_name"></input>
|
||
<label class="label w-1 right"><span data-i18n="common.race">Race</span></label>
|
||
<input type="text" class="input w-3" name="attr_character_race"></input>
|
||
<label class="label w-1 right"><span data-i18n="common.origin">Origin</span></label>
|
||
<input type="text" class="input w-3" name="attr_character_origin"></input>
|
||
</div>
|
||
<div class="flex-row">
|
||
<div class="flex-column frame w-6">
|
||
<label class="label title"><span data-i18n="bio.background">Background</span></label>
|
||
<textarea name="attr_bio_background"></textarea>
|
||
</div>
|
||
<div class="flex-column frame w-6">
|
||
<label class="label title"><span data-i18n="bio.friendfoe">Friend & Foes</span></label>
|
||
<textarea name="attr_bio_friendfoe"></textarea>
|
||
</div>
|
||
</div>
|
||
<div class="flex-row frame">
|
||
<label class="label title"><span data-i18n="common.notes">Notes</span></label>
|
||
<textarea name="attr_bio_notes"></textarea>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- PC config-->
|
||
<div class="flex-column config">
|
||
<div class="flex-row frame align-center">
|
||
<label class="label"><span data-i18n="common.config">Configuration</span></label>
|
||
</div>
|
||
<div class="flex-row">
|
||
<div class="flex-column w-6 frame config-frame">
|
||
<label class="label title"><span data-i18n="config.sheet">Sheet Configuration</span></label>
|
||
<div class="flex-row">
|
||
<label class="label w-6 right"><span data-i18n="config.hasfaith">Has Faith</span></label>
|
||
<select class="w-6" name="attr_has_faith">
|
||
<option value="on">Yes</option>
|
||
<option value="off">No</option>
|
||
</select>
|
||
</div>
|
||
<div class="flex-row">
|
||
<label class="label w-6 right"><span data-i18n="config.hasarcana">Has Arcana</span></label>
|
||
<select class="w-6" name="attr_has_arcana">
|
||
<option value="on">Yes</option>
|
||
<option value="off">No</option>
|
||
</select>
|
||
</div>
|
||
<div class="flex-row">
|
||
<label class="label w-6 right"><span data-i18n="config.haspsionic">Has Psionic</span></label>
|
||
<select class="w-6" name="attr_has_psionics">
|
||
<option value="on">Yes</option>
|
||
<option value="off">No</option>
|
||
</select>
|
||
</div>
|
||
<div class="flex-row">
|
||
<label class="label w-6 right"><span data-i18n="config.hasresolve">Has Resolve</span></label>
|
||
<select class="w-6" name="attr_has_resolve">
|
||
<option value="on">Yes</option>
|
||
<option value="off">No</option>
|
||
</select>
|
||
</div>
|
||
<div class="flex-row">
|
||
<label class="label w-6 right"><span data-i18n="config.hascredit">Has Credit Rating</span></label>
|
||
<select class="w-6" name="attr_has_credit">
|
||
<option value="on">Yes</option>
|
||
<option value="off">No</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
<div class="flex-column w-6 frame config-frame">
|
||
<label class="label title"><span data-i18n="config.export">Import / Export</span></label>
|
||
Not yet available
|
||
</div>
|
||
|
||
</div>
|
||
<div class="flex-column frame">
|
||
<label class="label centered"><span data-i18n="help.info">Need info? Look here</span></label>
|
||
<label class="label centered"><span data-i18n="help.bug">Found bug? Look here</span></label>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- ROLL TEMPLATES -->
|
||
<div class="roll-templates">
|
||
<rolltemplate class="sheet-rolltemplate-main">
|
||
<div class="sheet-colu sheet-cadre sheet-template">
|
||
<h4 class="sheet-h4">{{titre}}</h4>
|
||
{{#subtitle}}
|
||
<label class="sheet-w12 sheet-label sheet-text-center">{{subtitle}}</label>
|
||
{{/subtitle}}
|
||
{{#roll}}
|
||
<div class="sheet-line sheet-spacer"></div>
|
||
<div class="sheet-line">
|
||
<div class="sheet-white-colu sheet-w12 sheet-align-center">
|
||
<div class="sheet-roll sheet-w12 sheet-bold sheet-result sheet-text-center">{{roll}}</div>
|
||
<label class="sheet-label sheet-bold sheet-w12 sheet-text-center"><span data-i18n="rolltemplate.result">Roll</span></label>
|
||
</div>
|
||
</div>
|
||
{{/roll}}
|
||
{{#allprops() titre subtitle description roll}}
|
||
<div class="sheet-line sheet-spacer"></div>
|
||
<div class="sheet-white-line sheet-align-center">
|
||
<label class="sheet-label sheet-bold sheet-w4 sheet-text-right">{{key}} :</label>
|
||
<div class="sheet-w8 sheet-colu sheet-justify-center sheet-align-center">{{value}}</div>
|
||
</div>
|
||
{{/allprops() titre subtitle description roll}}
|
||
{{#description}}
|
||
<div class="sheet-line sheet-spacer"></div>
|
||
<div class="sheet-white-line">
|
||
<div>
|
||
{{description}}
|
||
</div>
|
||
</div>
|
||
{{/description}}
|
||
</div>
|
||
</rolltemplate>
|
||
|
||
<rolltemplate class="sheet-rolltemplate-attack">
|
||
<div class="sheet-colu sheet-cadre sheet-template">
|
||
<h4 class="sheet-h4">{{titre}}</h4>
|
||
{{#subtitle}}
|
||
<label class="sheet-w12 sheet-label sheet-text-center">{{subtitle}}</label>
|
||
{{/subtitle}}
|
||
<div class="sheet-line sheet-spacer"></div>
|
||
<div class="sheet-line">
|
||
{{#attack}}
|
||
<div class="sheet-white-colu sheet-w6 sheet-align-center">
|
||
<div class="sheet-roll sheet-w12 sheet-bold sheet-result sheet-text-center">{{attack}}</div>
|
||
<label class="sheet-label sheet-bold sheet-w12 sheet-text-center"><span data-i18n="rolltemplate.attack">Attack</span></label>
|
||
</div>
|
||
{{/attack}}
|
||
{{#damage}}
|
||
<div class="sheet-white-colu sheet-w6 sheet-align-center">
|
||
<div class="sheet-roll sheet-w12 sheet-bold sheet-result sheet-text-center">{{damage}}</div>
|
||
<label class="sheet-label sheet-bold sheet-w12 sheet-text-center"><span data-i18n="rolltemplate.damage">Damage</span></label>
|
||
</div>
|
||
{{/damage}}
|
||
</div>
|
||
{{#notes}}
|
||
<div class="sheet-line sheet-spacer"></div>
|
||
<div class="sheet-white-line">
|
||
<div>
|
||
{{notes}}
|
||
</div>
|
||
</div>
|
||
{{/notes}}
|
||
</div>
|
||
</rolltemplate>
|
||
|
||
<rolltemplate class="sheet-rolltemplate-spell">
|
||
<div class="sheet-colu sheet-cadre sheet-template">
|
||
<h4 class="sheet-h4">{{name}} ({{level}})</h4>
|
||
<label class="sheet-w12 sheet-label sheet-text-center">{{subtitle}}</label>
|
||
{{#school}}
|
||
<label class="sheet-w-12"><span class="sheet-bold"><span class="sheet-bold" data-i18n="spells.school">École</span> : </span>{{school}}</label>
|
||
{{/school}}
|
||
{{#casting-time}}
|
||
<label class="sheet-w-12"><span class="sheet-bold"><span class="sheet-bold" data-i18n="spells.incantation">Temps d'incantation</span> : </span>{{casting-time}}</label>
|
||
{{/casting-time}}
|
||
{{#range}}
|
||
<label class="sheet-w-12"><span class="sheet-bold"><span class="sheet-bold" data-i18n="spells.range">Portée</span> : </span>{{range}}</label>
|
||
{{/range}}
|
||
{{#duration}}
|
||
<label class="sheet-w-12"><span class="sheet-bold"><span class="sheet-bold" data-i18n="spells.duration">Durée</span> : </span>{{duration}}</label>
|
||
{{/duration}}
|
||
{{#innate}}
|
||
<label class="sheet-w-12"><span class="sheet-bold"><span class="sheet-bold" data-i18n="spells.innate">Inné</span> : </span>{{innate}}</label>
|
||
{{/innate}}
|
||
{{#allprops() name subtitle description school casting-time range duration innate level}}
|
||
<div class="sheet-line sheet-border-bottom"></div>
|
||
<div class="sheet-line sheet-align-center">
|
||
<label class="sheet-label sheet-bold sheet-w4 sheet-text-right">{{key}} :</label>
|
||
<div class="sheet-w8 sheet-colu sheet-justify-center sheet-align-center">{{value}}</div>
|
||
</div>
|
||
{{/allprops() name subtitle description school casting-time range duration innate level}}
|
||
{{#description}}
|
||
<div class="sheet-line sheet-border-bottom"></div>
|
||
<div class="sheet-line">
|
||
<div>
|
||
{{description}}
|
||
</div>
|
||
</div>
|
||
{{/description}}
|
||
</div>
|
||
</rolltemplate>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- WORKERS -->
|
||
<script type="text/worker">
|
||
function normalizeDice(input) {
|
||
const regex = /^(\d+)?[dD](\d+)([hHlL])?(?:\s*([+-])\s*(\d+))?$/;
|
||
const match = input.replace(/\s+/g, '').match(regex);
|
||
|
||
if (!match) {
|
||
return "-1";
|
||
}
|
||
|
||
let [, x, y, hl, op, z] = match;
|
||
|
||
x = x ? parseInt(x, 10) : 1;
|
||
y = parseInt(y, 10);
|
||
z = z ? parseInt(z, 10) : null;
|
||
|
||
const newX = hl ? x + 1 : x;
|
||
const keep = hl ? `k${hl.toLowerCase()}${x}` : '';
|
||
|
||
let result = `${newX}d${y}${keep}`;
|
||
|
||
if (z !== null && op) {
|
||
result += `${op}${z}`;
|
||
}
|
||
|
||
return result;
|
||
}
|
||
|
||
function diceValue(input) {
|
||
const regex = /^\s*(\d+)?\s*[dD]\s*(\d+)/;
|
||
const match = input.match(regex);
|
||
|
||
if (!match) {
|
||
throw new Error("Format invalide");
|
||
}
|
||
|
||
return parseInt(match[2], 10);
|
||
}
|
||
|
||
function averageDice(input) {
|
||
const regex = /^\s*(\d+)?\s*[dD]\s*(\d+)\s*([hHlL])?\s*(?:([+-])\s*(\d+))?\s*$/;
|
||
const match = input.match(regex);
|
||
|
||
if (!match) {
|
||
throw new Error("Format invalide");
|
||
}
|
||
|
||
let [, x, y, hl, op, z] = match;
|
||
|
||
x = x ? parseInt(x, 10) : 1;
|
||
y = parseInt(y, 10);
|
||
z = z ? parseInt(z, 10) : 0;
|
||
|
||
// moyenne d’un dé Y faces
|
||
const avgDie = (y + 1) / 2;
|
||
|
||
let avg;
|
||
|
||
if (!hl) {
|
||
// cas simple : X dés
|
||
avg = x * avgDie;
|
||
} else {
|
||
// cas H/L : on lance X+1 dés, on garde X
|
||
const n = x + 1;
|
||
|
||
// approximation : moyenne en retirant min ou max attendu
|
||
const expectedMin = 1 + (y - 1) / (n + 1);
|
||
const expectedMax = y - (y - 1) / (n + 1);
|
||
|
||
if (hl.toLowerCase() === "h") {
|
||
avg = n * avgDie - expectedMin; // drop lowest
|
||
} else {
|
||
avg = n * avgDie - expectedMax; // drop highest
|
||
}
|
||
}
|
||
|
||
if (op === "+") avg += z;
|
||
if (op === "-") avg -= z;
|
||
|
||
return avg;
|
||
}
|
||
|
||
function getPositiveSign(num)
|
||
{
|
||
return num < 0 ? "" : "+";
|
||
}
|
||
|
||
on("clicked:show_core", (eventInfo) => {
|
||
let toUpdate = {}
|
||
toUpdate["page"] = "core";
|
||
setAttrs(toUpdate);
|
||
});
|
||
on("clicked:show_bio", (eventInfo) => {
|
||
let toUpdate = {}
|
||
toUpdate["page"] = "bio";
|
||
setAttrs(toUpdate);
|
||
});
|
||
on("clicked:show_config", (eventInfo) => {
|
||
let toUpdate = {}
|
||
toUpdate["page"] = "config";
|
||
setAttrs(toUpdate);
|
||
});
|
||
on("change:lifeblood", (eventInfo) => {
|
||
let attrsName = ["lifeblood"];
|
||
for(let i = 1 ; i <= 18 ; i++ ) {
|
||
attrsName.push("lifeblood_"+i);
|
||
}
|
||
getAttrs(attrsName, (attrs) => {
|
||
let life = parseInt(attrs["lifeblood"],10) || 0;
|
||
let toUpdate = {}
|
||
for(let i = 1 ; i <= 18 ; i++) {
|
||
let lifebloodI = attrs["lifeblood_"+i];
|
||
if(lifebloodI == null || lifebloodI == undefined) {
|
||
toUpdate["lifeblood_"+i] = (i <= life) ? 0 : -1;
|
||
}
|
||
let lifebloodINum = parseInt(lifebloodI,10) || 0;
|
||
if(i <= life && lifebloodINum == -1) {
|
||
lifebloodINum = 0;
|
||
}
|
||
else if(i > life && lifebloodINum != -1) {
|
||
lifebloodINum = -1;
|
||
}
|
||
toUpdate["lifeblood_"+i] = lifebloodINum;
|
||
}
|
||
setAttrs(toUpdate);
|
||
});
|
||
});
|
||
|
||
on("clicked:damage_fatigue", (eventInfo) => {
|
||
let attrsName = [];
|
||
for(let i = 1 ; i <= 18 ; i++ ) {
|
||
attrsName.push("lifeblood_"+i);
|
||
}
|
||
getAttrs(attrsName, (attrs) => {
|
||
let toUpdate= {};
|
||
for(let i = 18; i > 0 ; i--) {
|
||
let lifebloodI = attrs["lifeblood_"+i];
|
||
if(lifebloodI == null || lifebloodI == undefined) {
|
||
toUpdate["lifeblood_"+i] = 1;
|
||
setAttrs(toUpdate);
|
||
return;
|
||
}
|
||
let lifebloodINum = parseInt(lifebloodI,10) || 0;
|
||
if(lifebloodINum == -1 || lifebloodINum == 1)
|
||
{
|
||
continue;
|
||
}
|
||
if(lifebloodINum == 2 || lifebloodINum == 3)
|
||
{
|
||
return;
|
||
}
|
||
toUpdate["lifeblood_"+i] = 1;
|
||
setAttrs(toUpdate);
|
||
return;
|
||
}
|
||
});
|
||
});
|
||
|
||
on("clicked:damage_normal", (eventInfo) => {
|
||
let attrsName = [];
|
||
for(let i = 1 ; i <= 18 ; i++ ) {
|
||
attrsName.push("lifeblood_"+i);
|
||
}
|
||
getAttrs(attrsName, (attrs) => {
|
||
let toUpdate= {};
|
||
for(let i = 1; i <= 18 ; i++) {
|
||
let lifebloodI = attrs["lifeblood_"+i];
|
||
if(lifebloodI == null || lifebloodI == undefined) {
|
||
toUpdate["lifeblood_"+i] = 2;
|
||
setAttrs(toUpdate);
|
||
return;
|
||
}
|
||
let lifebloodINum = parseInt(lifebloodI,10) || 0;
|
||
if(lifebloodINum == 2 || lifebloodINum == 3)
|
||
{
|
||
continue;
|
||
}
|
||
if(lifebloodINum == -1 || lifebloodINum == 1)
|
||
{
|
||
return;
|
||
}
|
||
toUpdate["lifeblood_"+i] = 2;
|
||
setAttrs(toUpdate);
|
||
return;
|
||
}
|
||
});
|
||
});
|
||
|
||
on("clicked:damage_rest", (eventInfo) => {
|
||
let attrsName = [];
|
||
for(let i = 1 ; i <= 18 ; i++ ) {
|
||
attrsName.push("lifeblood_"+i);
|
||
}
|
||
getAttrs(attrsName, (attrs) => {
|
||
let toUpdate = {};
|
||
let normal_damage = 0;
|
||
//First Pass, Heal Fatigue Damage and sanitize
|
||
for(let i = 1; i <= 18 ; i++) {
|
||
let lifebloodI = attrs["lifeblood_"+i];
|
||
if(lifebloodI == null || lifebloodI == undefined) {
|
||
toUpdate["lifeblood_"+i] = 0;
|
||
continue;
|
||
}
|
||
let lifebloodINum = parseInt(lifebloodI,10) || 0;
|
||
if(lifebloodINum == 1)
|
||
{
|
||
toUpdate["lifeblood_"+i] = 0;
|
||
continue;
|
||
}
|
||
if(lifebloodINum == 2)
|
||
{
|
||
normal_damage++;
|
||
}
|
||
}
|
||
//Second pass, Heal half normal damage, Agravate rest
|
||
normal_damage = Math.ceil(normal_damage / 2);
|
||
for(let i = 18 ; i > 0; i--)
|
||
{
|
||
let lifebloodI = attrs["lifeblood_"+i];
|
||
let lifebloodINum = parseInt(lifebloodI,10) || 0;
|
||
|
||
if(lifebloodINum == 2 && normal_damage > 0)
|
||
{
|
||
toUpdate["lifeblood_"+i] = 0;
|
||
normal_damage--;
|
||
}
|
||
else if(lifebloodINum == 2)
|
||
{
|
||
toUpdate["lifeblood_"+i] = 3;
|
||
}
|
||
}
|
||
setAttrs(toUpdate);
|
||
});
|
||
});
|
||
|
||
on("clicked:damage_heal", (eventInfo) => {
|
||
let attrsName = [];
|
||
for(let i = 1 ; i <= 18 ; i++ ) {
|
||
attrsName.push("lifeblood_"+i);
|
||
}
|
||
getAttrs(attrsName, (attrs) => {
|
||
let toUpdate = {};
|
||
//Heal fatigue & one Normal/Lasting Damage
|
||
let normalDamageLeft;
|
||
let lastingDamageLeft;
|
||
let healed = false;
|
||
//First pass, Set the track clean and count how many normal/lasting damage are left
|
||
for(let i = 18 ; i > 0 && !healed; i--)
|
||
{
|
||
let lifebloodI = attrs["lifeblood_"+i];
|
||
if(lifebloodI == null || lifebloodI == undefined) {
|
||
toUpdate["lifeblood_"+i] = 0;
|
||
continue;
|
||
}
|
||
let lifebloodINum = parseInt(lifebloodI,10) || 0;
|
||
if(lifebloodINum == 1){
|
||
toUpdate["lifeblood_"+i] = 0;
|
||
continue;
|
||
}
|
||
if((lifebloodINum == 3 || lifebloodINum == 2) && !healed)
|
||
{
|
||
toUpdate["lifeblood_"+i] = 0;
|
||
healed = true;
|
||
continue;
|
||
}
|
||
if(lifebloodINum == 3)
|
||
{
|
||
toUpdate["lifeblood_"+i] = 0;
|
||
lastingDamageLeft++;
|
||
continue;
|
||
}
|
||
if(lifebloodINum == 2)
|
||
{
|
||
toUpdate["lifeblood_"+i] = 0;
|
||
normalDamageLeft++;
|
||
continue;
|
||
}
|
||
}
|
||
for(let i = 1 ; i <=18 && normalDamageLeft > 0 && lastingDamageLeft > 0;i++)
|
||
{
|
||
if(lastingDamageLeft > 0)
|
||
{
|
||
toUpdate["lifeblood_"+i] = 3;
|
||
lastingDamageLeft--;
|
||
continue
|
||
}
|
||
toUpdate["lifeblood_"+i] = 2;
|
||
normalDamageLeft--;
|
||
}
|
||
setAttrs(toUpdate);
|
||
return;
|
||
});
|
||
});
|
||
on("change:resolve", (eventInfo) => {
|
||
let attrsName = ["resolve"];
|
||
for(let i = 1 ; i <= 18 ; i++ ) {
|
||
attrsName.push("resolve_"+i);
|
||
}
|
||
getAttrs(attrsName, (attrs) => {
|
||
let life = parseInt(attrs["resolve"],10) || 0;
|
||
let toUpdate = {}
|
||
for(let i = 1 ; i <= 18 ; i++) {
|
||
let resolveI = attrs["resolve_"+i];
|
||
if(resolveI == null || resolveI == undefined) {
|
||
toUpdate["resolve_"+i] = (i <= life) ? 0 : -1;
|
||
}
|
||
let resolveINum = parseInt(resolveI,10) || 0;
|
||
if(i <= life && resolveINum == -1) {
|
||
resolveINum = 0;
|
||
}
|
||
else if(i > life && resolveINum != -1) {
|
||
resolveINum = -1;
|
||
}
|
||
toUpdate["resolve_"+i] = resolveINum;
|
||
}
|
||
setAttrs(toUpdate);
|
||
});
|
||
});
|
||
|
||
on("clicked:resolve_fatigue", (eventInfo) => {
|
||
let attrsName = [];
|
||
for(let i = 1 ; i <= 18 ; i++ ) {
|
||
attrsName.push("resolve_"+i);
|
||
}
|
||
getAttrs(attrsName, (attrs) => {
|
||
let toUpdate= {};
|
||
for(let i = 18; i > 0 ; i--) {
|
||
let resolveI = attrs["resolve_"+i];
|
||
if(resolveI == null || resolveI == undefined) {
|
||
toUpdate["resolve_"+i] = 1;
|
||
setAttrs(toUpdate);
|
||
return;
|
||
}
|
||
let resolveINum = parseInt(resolveI,10) || 0;
|
||
if(resolveINum == -1 || resolveINum == 1)
|
||
{
|
||
continue;
|
||
}
|
||
if(resolveINum == 2 || resolveINum == 3)
|
||
{
|
||
return;
|
||
}
|
||
toUpdate["resolve_"+i] = 1;
|
||
setAttrs(toUpdate);
|
||
return;
|
||
}
|
||
});
|
||
});
|
||
|
||
on("clicked:resolve_normal", (eventInfo) => {
|
||
let attrsName = [];
|
||
for(let i = 1 ; i <= 18 ; i++ ) {
|
||
attrsName.push("resolve_"+i);
|
||
}
|
||
getAttrs(attrsName, (attrs) => {
|
||
let toUpdate= {};
|
||
for(let i = 1; i <= 18 ; i++) {
|
||
let resolveI = attrs["resolve_"+i];
|
||
if(resolveI == null || resolveI == undefined) {
|
||
toUpdate["resolve_"+i] = 2;
|
||
setAttrs(toUpdate);
|
||
return;
|
||
}
|
||
let resolveINum = parseInt(resolveI,10) || 0;
|
||
if(resolveINum == 2 || resolveINum == 3)
|
||
{
|
||
continue;
|
||
}
|
||
if(resolveINum == -1 || resolveINum == 1)
|
||
{
|
||
return;
|
||
}
|
||
toUpdate["resolve_"+i] = 2;
|
||
setAttrs(toUpdate);
|
||
return;
|
||
}
|
||
});
|
||
});
|
||
|
||
on("clicked:resolve_rest", (eventInfo) => {
|
||
let attrsName = [];
|
||
for(let i = 1 ; i <= 18 ; i++ ) {
|
||
attrsName.push("resolve_"+i);
|
||
}
|
||
getAttrs(attrsName, (attrs) => {
|
||
let toUpdate = {};
|
||
let normal_damage = 0;
|
||
//First Pass, Heal Fatigue Damage and sanitize
|
||
for(let i = 1; i <= 18 ; i++) {
|
||
let resolveI = attrs["resolve_"+i];
|
||
if(resolveI == null || resolveI == undefined) {
|
||
toUpdate["resolve_"+i] = 0;
|
||
continue;
|
||
}
|
||
let resolveINum = parseInt(resolveI,10) || 0;
|
||
if(resolveINum == 1)
|
||
{
|
||
toUpdate["resolve_"+i] = 0;
|
||
continue;
|
||
}
|
||
if(resolveINum == 2)
|
||
{
|
||
normal_damage++;
|
||
}
|
||
}
|
||
//Second pass, Heal half normal damage, Agravate rest
|
||
normal_damage = Math.ceil(normal_damage / 2);
|
||
for(let i = 18 ; i > 0; i--)
|
||
{
|
||
let resolveI = attrs["resolve_"+i];
|
||
let resolveINum = parseInt(resolveI,10) || 0;
|
||
|
||
if(resolveINum == 2 && normal_damage > 0)
|
||
{
|
||
toUpdate["resolve_"+i] = 0;
|
||
normal_damage--;
|
||
}
|
||
else if(resolveINum == 2)
|
||
{
|
||
toUpdate["resolve_"+i] = 3;
|
||
}
|
||
}
|
||
setAttrs(toUpdate);
|
||
});
|
||
});
|
||
|
||
on("clicked:resolve_heal", (eventInfo) => {
|
||
let attrsName = [];
|
||
for(let i = 1 ; i <= 18 ; i++ ) {
|
||
attrsName.push("resolve_"+i);
|
||
}
|
||
getAttrs(attrsName, (attrs) => {
|
||
let toUpdate = {};
|
||
//Heal fatigue & one Normal/Lasting Damage
|
||
let normalDamageLeft;
|
||
let lastingDamageLeft;
|
||
let healed = false;
|
||
//First pass, Set the track clean and count how many normal/lasting damage are left
|
||
for(let i = 18 ; i > 0 && !healed; i--)
|
||
{
|
||
let resolveI = attrs["resolve_"+i];
|
||
if(resolveI == null || resolveI == undefined) {
|
||
toUpdate["resolve_"+i] = 0;
|
||
continue;
|
||
}
|
||
let resolveINum = parseInt(resolveI,10) || 0;
|
||
if(resolveINum == 1){
|
||
toUpdate["resolve_"+i] = 0;
|
||
continue;
|
||
}
|
||
if((resolveINum == 3 || resolveINum == 2) && !healed)
|
||
{
|
||
toUpdate["resolve_"+i] = 0;
|
||
healed = true;
|
||
continue;
|
||
}
|
||
if(resolveINum == 3)
|
||
{
|
||
toUpdate["resolve_"+i] = 0;
|
||
lastingDamageLeft++;
|
||
continue;
|
||
}
|
||
if(resolveINum == 2)
|
||
{
|
||
toUpdate["resolve_"+i] = 0;
|
||
normalDamageLeft++;
|
||
continue;
|
||
}
|
||
}
|
||
for(let i = 1 ; i <=18 && normalDamageLeft > 0 && lastingDamageLeft > 0;i++)
|
||
{
|
||
if(lastingDamageLeft > 0)
|
||
{
|
||
toUpdate["resolve_"+i] = 3;
|
||
lastingDamageLeft--;
|
||
continue
|
||
}
|
||
toUpdate["resolve_"+i] = 2;
|
||
normalDamageLeft--;
|
||
}
|
||
setAttrs(toUpdate);
|
||
return;
|
||
});
|
||
});
|
||
//Armour Changes
|
||
on("change:repeating_armours", (eventInfo) => {
|
||
let armourId = eventInfo.triggerName;
|
||
if (eventInfo.sourceAttribute.includes("options-flag")
|
||
|| eventInfo.sourceAttribute.includes("armour_roll_value")
|
||
|| eventInfo.sourceAttribute.includes("armour_roll_label")
|
||
|| eventInfo.sourceAttribute.includes("name_label")
|
||
|| eventInfo.sourceAttribute.includes("armour_fixed_label")
|
||
) {
|
||
return;
|
||
}
|
||
// Get the weapon values
|
||
let name = armourId + "_name";
|
||
let type = armourId + "_type";
|
||
let armour_dice = armourId + "_armour_dice";
|
||
let armour_malus = armourId + "_armour_malus";
|
||
getAttrs([name,type,armour_dice,armour_malus], (attrs) => {
|
||
let nameVal = attrs[name];
|
||
let typeVal = attrs[type];
|
||
let armourDiceVal = attrs[armour_dice];
|
||
let armourMalusVal = parseInt(attrs[armour_malus],10) || 0;
|
||
|
||
let avg = Math.ceil(averageDice(armourDiceVal) || 0);
|
||
avg += armourMalusVal;
|
||
|
||
let nameLabel = nameVal;
|
||
if(typeVal){
|
||
nameLabel+= " ("+getTranslationByKey("armour."+typeVal)+")";
|
||
}
|
||
|
||
let rollLabel = armourDiceVal;
|
||
rollLabel += getPositiveSign(armourMalusVal) + armourMalusVal;
|
||
|
||
let rollValue = normalizeDice(armourDiceVal)+"[Roll]";
|
||
rollValue += getPositiveSign(armourMalusVal) + armourMalusVal+"[Modifier]";
|
||
|
||
let update = {};
|
||
update[armourId + "_name_label"] = nameLabel;
|
||
update[armourId + "_armour_roll_label"] = rollLabel +" ("+avg+")";
|
||
update[armourId + "_armour_roll_value"] = "[[" + rollValue + "]]";
|
||
setAttrs(update);
|
||
});
|
||
});
|
||
|
||
|
||
//weapons Changes
|
||
on("change:repeating_weapons", (eventInfo) => {
|
||
let attackId = eventInfo.triggerName;
|
||
if (eventInfo.sourceAttribute.includes("options-flag")
|
||
|| eventInfo.sourceAttribute.includes("weapon_attack_value")
|
||
|| eventInfo.sourceAttribute.includes("weapon_damage_value")
|
||
|| eventInfo.sourceAttribute.includes("type_label")
|
||
|| eventInfo.sourceAttribute.includes("damage_label")) {
|
||
return;
|
||
}
|
||
// Get the weapon values
|
||
let name = attackId + "_name";
|
||
let type = attackId + "_type";
|
||
let damage_dice = attackId + "_damage_dice";
|
||
let damage_bonus = attackId + "_damage_bonus";
|
||
let damage_ability = attackId + "_damage_ability";
|
||
let ability = attackId + "_ability";
|
||
let range = attackId + "_range";
|
||
getAttrs([name, type, damage_dice, damage_bonus, damage_ability,range, ability,"strength","agility","mind","appeal","melee","ranged"], (attrs) => {
|
||
let nameval = attrs[name];
|
||
let typeval = attrs[type];;
|
||
let abilityVal = attrs[ability];
|
||
let abiliyMod = parseInt(attrs[abilityVal],10) || 0;
|
||
|
||
let rangeVal = attrs[range];
|
||
|
||
let damage_dice_val = attrs[damage_dice];
|
||
let damage_bonus_val = parseInt(attrs[damage_bonus],10) || 0;
|
||
let damage_ability_val = attrs[damage_ability];
|
||
let damage_ability_mod = parseInt(attrs[damage_ability_val],10) || 0;
|
||
|
||
let meleeVal = attrs["melee"];
|
||
let rangedVal = attrs["ranged"];
|
||
|
||
let attackMod = typeval === "melee" ? parseInt(meleeVal,10) : parseInt(rangedVal,10);
|
||
|
||
let AtkText = "@{roll}[Roll]";
|
||
if(abilityVal != "none")
|
||
{
|
||
AtkText += getPositiveSign(abiliyMod) + abiliyMod + "[^{attributes."+abilityVal+"}]";
|
||
}
|
||
AtkText += getPositiveSign(attackMod) + attackMod + (typeval === "melee" ? "[^{attack.type.melee}]" : "[^{attack.type.ranged}]");
|
||
|
||
let damageText = normalizeDice(damage_dice_val)+"[Roll]";
|
||
damageText += getPositiveSign(damage_bonus_val) + damage_bonus_val + "[Bonus]";
|
||
if(damage_ability_val != "none")
|
||
{
|
||
damageText += getPositiveSign(damage_ability_mod) + damage_ability_mod + "[^{attributes."+damage_ability_val+"}]";
|
||
}
|
||
|
||
let typeLabel = getTranslationByKey("attack.type." + typeval) || typeval;
|
||
if(typeval == "ranged" && !!rangeVal){
|
||
typeLabel += " (" + rangeVal + ")";
|
||
}
|
||
|
||
let damageLabel = damage_dice_val;
|
||
let damageLabelMod = damage_bonus_val+damage_ability_mod;
|
||
damageLabel += getPositiveSign(damageLabelMod) + damageLabelMod;
|
||
|
||
let update = {};
|
||
update[attackId + "_weapon_attack_value"] = "[[" + AtkText + "]]";
|
||
update[attackId + "_weapon_damage_value"] = "[[" + damageText + "]]";
|
||
update[attackId + "_type_label"] = typeLabel;
|
||
update[attackId + "_damage_label"] = damageLabel;
|
||
setAttrs(update);
|
||
});
|
||
});
|
||
|
||
/*Translate Roll query */
|
||
on("sheet:opened", function(eventInfo){
|
||
initSheetIfNeeded();
|
||
let rollQuery = {}
|
||
rollQuery["attribute_choose"] = "?{"+getTranslationByKey("common.choose")+"|"+getTranslationByKey("attributes.strength")+",@{strength}|"+getTranslationByKey("attributes.agility")+",@{agility}|"+getTranslationByKey("attributes.mind")+",@{mind}|"+getTranslationByKey("attributes.appeal")+",@{appeal}}";
|
||
setAttrs(rollQuery);
|
||
});
|
||
|
||
function initSheetIfNeeded(){
|
||
getAttrs(["page","has_faith","has_arcana","has_psionics","has_resolve","has_credit"], (attrs) => {
|
||
let toUpdate = {};
|
||
console.log(attrs);
|
||
if(!attrs["page"]){
|
||
toUpdate["page"] = "core";
|
||
}
|
||
if(!attrs["has_faith"] || attrs["has_faith"] == "on"){
|
||
toUpdate["has_faith"] = "on";
|
||
}
|
||
if(!attrs["has_arcana"] || attrs["has_arcana"] == "on"){
|
||
toUpdate["has_arcana"] = "on";
|
||
}
|
||
if(!attrs["has_psionics"] || attrs["has_psionics"] == "on"){
|
||
toUpdate["has_psionics"] = "on";
|
||
}
|
||
if(!attrs["has_resolve"] || attrs["has_resolve"] == "on"){
|
||
toUpdate["has_resolve"] = "on";
|
||
}
|
||
if(!attrs["has_credit"] || attrs["has_credit"] == "on"){
|
||
toUpdate["has_credit"] = "on";
|
||
}
|
||
console.log(toUpdate);
|
||
setAttrs(toUpdate);
|
||
});
|
||
|
||
}
|
||
/* add - remove bonus dices from roll */
|
||
on("change:roll_base change:bonus_dices", (eventInfo) => {
|
||
|
||
getAttrs(["roll_base","bonus_dices"], (attrs) => {
|
||
let roll_base = normalizeDice(attrs["roll_base"]);
|
||
let bonus_dices = parseInt(attrs["bonus_dices"],10) || 0;
|
||
|
||
const match = roll_base.match(/^(\d+)[dD](\d+)(k[hHlL]?(\d+))?$/);
|
||
if (!match) {
|
||
return;
|
||
}
|
||
const count = parseInt(match[1], 10);
|
||
const sides = parseInt(match[2], 10);
|
||
const modifier = match[3] ? match[3].toLowerCase() : null;
|
||
const value = match[4] ? parseInt(match[4], 10) : null;
|
||
if(modifier && !value)
|
||
{
|
||
return;
|
||
}
|
||
|
||
let baseDice = modifier ? value : count;
|
||
let bonusDice = 0;
|
||
if(modifier == "kh"){
|
||
bonusDice = count - value;
|
||
}
|
||
else if(modifier == "kl"){
|
||
bonusDice = value - count;
|
||
}
|
||
bonusDice += bonus_dices;
|
||
|
||
let totalDice = baseDice + Math.abs(bonusDice);
|
||
let stringRoll = totalDice+"d"+sides;
|
||
if(bonusDice > 0){
|
||
stringRoll += "kh"+baseDice;
|
||
}
|
||
else if(bonusDice < 0){
|
||
stringRoll += "kl"+baseDice;
|
||
}
|
||
|
||
let toUpdate = {};
|
||
toUpdate["roll"] = stringRoll;
|
||
setAttrs(toUpdate);
|
||
|
||
});
|
||
});
|
||
|
||
</script> |