@@ -7,10 +7,6 @@ <h1 class="title">
77 style ="height: 60px "
88 />
99 </ h1 >
10- < label > Initiative:</ label > < button type ="roll " value ="@{wtype} &{template:simpleroll} {{rolltitle=1d10}} {{roll=[[ [[1d10]][1d10]]]}} {{name=Initiative}} {{charactername=@{character_name}}} " title ="Roll 1d10 " class ="btn ui-draggable "> </ button >
11- < button class ="startcombat-button " type ="action " data-i18n-title ="startcombat " name ="act_startcombat "> Start Combat</ button >
12- < button class ="endcombat-button " type ="action " data-i18n-title ="endcombat " name ="act_endcombat "> End Combat</ button >
13- < button class ="respite-button " type ="action " data-i18n-title ="respite " name ="act_respite "> Respite</ button >
1410 < label class ="sheet-options-checkbox-label " for ="sheet-options-checkbox "> y</ label >
1511 < input id ="sheet-options-checkbox " class ="sheet-options-checkbox " type ="checkbox " />
1612 < div class ="sheet-panel sheet-options-toggle ">
@@ -44,6 +40,10 @@ <h5 data-i18n="import"></h5>
4440<!-- Character Sheet Start -->
4541< div class ="sheet-body ">
4642 <!-- Header Panel -->
43+ < label > Initiative:</ label > < button type ="roll " value ="@{wtype} &{template:simpleroll} {{rolltitle=1d10}} {{roll=[[ [[1d10]][1d10]]]}} {{name=Initiative}} {{charactername=@{character_name}}} " title ="Roll 1d10 " class ="btn ui-draggable "> </ button >
44+ < button class ="startcombat-button " type ="action " data-i18n-title ="startcombat " name ="act_startcombat "> Start Combat</ button >
45+ < button class ="endcombat-button " type ="action " data-i18n-title ="endcombat " name ="act_endcombat "> End Combat</ button >
46+ < button class ="respite-button " type ="action " data-i18n-title ="respite " name ="act_respite "> Respite</ button >
4747 < div class ="sheet-panel header-panel ">
4848 < div class ="sheet-panel-box profile-panel ">
4949 < div class ="name-input-group ">
@@ -174,8 +174,13 @@ <h5 data-i18n="level"></h5>
174174 </ div >
175175 </ div >
176176 < div class ="dashboard-surges minimize-ignore ">
177- < div class ="dashboard-stat-group surges-input-group ">
178- < label data-characteristic ="surges " data-i18n ="surges " data-i18n-title ="surges-tooltip "> Surges</ label >
177+ < div class ="dashboard-stat-group ">
178+ < label data-characteristic ="surges " data-i18n ="surges "> Surges</ label >
179+ < div class ="surges-input-group ">
180+ < label data-characteristic ="surges-damage " data-i18n ="surges-damage " data-i18n-title ="surges-damage-tooltip "> Damage</ label >
181+ < span class ="pipe-separator "> |</ span >
182+ < label data-characteristic ="surges-potency " data-i18n ="surges-potency " data-i18n-title ="surges-potency-tooltip "> Potency</ label >
183+ </ div >
179184 < input type ="number " name ="attr_surges " title ="Macro: @{NAME|surges} " />
180185 </ div >
181186 </ div >
@@ -198,10 +203,6 @@ <h5 data-i18n="level"></h5>
198203 < input type ="number " class ="input-md " name ="attr_stability " title ="Macro: @{NAME|stability} " />
199204 < label class ="sublabel " data-i18n ="stability "> </ label >
200205 </ div >
201- < div class ="movement-input-group ">
202- < input type ="number " class ="input-md " name ="attr_forcemove " title ="Macro: @{NAME|forcemove} " />
203- < label class ="sublabel " data-i18n ="forcemove "> </ label >
204- </ div >
205206 </ div >
206207 <!-- Stamina -->
207208 < div class ="stamina-panel ">
@@ -415,7 +416,7 @@ <h5 class="panel-title" data-i18n="ancestry-traits"></h5>
415416 <!-- Equipment and Modifiers Panel -->
416417 < div class ="sheet-panel-box modifiers-panel ">
417418 < div class ="modifiers-title ">
418- < h5 class ="panel-title " data-i18n ="modifiers "> </ h5 >
419+ < h5 class ="panel-title " data-i18n ="equipment- modifiers "> </ h5 >
419420 < span data-i18n ="kit "> kit</ span >
420421 < label > < input type ="checkbox " name ="attr_kit " /> </ label >
421422 </ div >
@@ -499,6 +500,24 @@ <h5 class="panel-title" data-i18n="modifiers"></h5>
499500 < label class ="kit-damage-label " data-i18n ="effect "> </ label >
500501 < textarea name ="attr_modifier_description "> </ textarea >
501502 </ div >
503+ < div class ="other-modifiers ">
504+ < div class ="other-modifiers-forcemove-group ">
505+ < input type ="number " class ="other-modifiers-forcemove " name ="attr_forcemove " />
506+ < label class ="sublabel " data-i18n ="forcemove "> </ label >
507+ </ div >
508+ < div class ="other-modifiers-mag-psi-group ">
509+ < input type ="number " class ="other-modifiers-mag-psi " name ="attr_mag_psi_dam " />
510+ < label class ="sublabel " data-i18n ="mag-psi-dam "> </ label >
511+ </ div >
512+ < div class ="other-modifiers-fire-dam-group ">
513+ < input type ="number " class ="other-modifiers-fire-dam " name ="attr_fire_dam " />
514+ < label class ="sublabel " data-i18n ="fire-dam "> </ label >
515+ </ div >
516+ < div class ="other-modifiers-sanct-weap-group ">
517+ < input type ="number " class ="other-modifiers-sanct-weap " name ="attr_sanct_weap " />
518+ < label class ="sublabel " data-i18n ="sanct-weap "> </ label >
519+ </ div >
520+ </ div >
502521 </ div >
503522 </ div >
504523 <!-- Perks Panel -->
@@ -1534,7 +1553,7 @@ <h2 data-i18n="maneuvers"></h2>
15341553 < input type ="hidden " class ="ability-effect " data-i18n-placeholder ="effect " name ="attr_consumable_effect " value ="Unless otherwise noted in its description, a creature can activate a consumable treasure such as a potion with the Use Consumable maneuver. A creature can use this maneuver to administer a consumable treasure that benefits the user either to themself or to a willing adjacent creature. " />
15351554
15361555 < div class ="ability-card card-display ">
1537- < button type ="action " class ="ability-share-button " data-i18n-title ="ability-share " name ="act_standup_share ">
1556+ < button type ="action " class ="ability-share-button " data-i18n-title ="ability-share " name ="act_consumable_share ">
15381557 <!-- speech balloon -->
15391558 💬
15401559 </ button >
@@ -3222,27 +3241,75 @@ <h5 class="panel-title" data-i18n="conditions"></h5>
32223241 **/
32233242 async function rollResource ( ) {
32243243 console . log ( "~~~ rollResource ~~~" ) ;
3225- // Get the resource name.
3226- const attrs = await getAttrsAsync ( [ 'resource_name' ] ) ;
3244+ // Get the resource name and resource amount .
3245+ const attrs = await getAttrsAsync ( [ 'resource' , ' resource_name'] ) ;
32273246 const resource_name = attrs . resource_name ;
3228-
3229- buildRoll ( ROLLTEMPLATES . SIMPLE , { name : "@{resource_name} Gain" , rolltitle : "@{resource_name}" , roll : `[[?{Type d3 or number|0}]]` } , { } ) ;
3247+ const resource = parseInt ( attrs . resource ) || 0 ;
3248+
3249+ const rollQuery = `[[?{d3 or number|0}]]` ;
3250+
3251+ const rollTemplate = `@{wtype}&{template:${ ROLLTEMPLATES . SIMPLE } } {{charactername=@{character_name}}} {{name=${ resource_name } Gain}} {{rolltitle=${ resource_name } }} {{roll=${ rollQuery } }}` ;
3252+
3253+ startRoll ( rollTemplate , ( { rollId, results } ) => {
3254+ const resource_gain = results . roll . result || 0 ;
3255+ const resource_updated = resource + resource_gain ;
3256+
3257+ setAttrs ( { "resource" : resource_updated } ) ;
3258+
3259+ finishRoll ( rollId ) ;
3260+ } ) ;
32303261 }
32313262
32323263 /**
3233- ** Simple Roll to apply Surges
3264+ ** Simple Roll to apply Damage Surges
32343265 ** And adjust automatically in sheet
32353266 **/
3236- async function rollSurges ( ) {
3237- console . log ( "~~~ rollSurges ~~~" ) ;
3267+ async function rollDamageSurges ( ) {
3268+ console . log ( "~~~ rollDamageSurges ~~~" ) ;
3269+ // Get the necessary attributes.
32383270 const attrs = await getAttrsAsync ( [ "might" , "agility" , "reason" , "intuition" , "presence" ] ) ;
32393271 let highest = 0 ;
32403272 for ( const val of Object . values ( attrs ) ) {
32413273 const num = parseInt ( val ) || 0 ;
32423274 highest = Math . max ( highest , num ) ;
32433275 }
3244-
3245- buildRoll ( ROLLTEMPLATES . SIMPLE , { name : "Using Surges" , rolltitle : "Surges" , roll : `?{Choose|Damage,?{How many?|1,[[1*${ highest } ]] additional damage|2,[[2*${ highest } ]] additional damage|3,[[3*${ highest } ]] additional damage}|Potency,2 surges used to increase potency by 1}` } , { } ) ;
3276+ const attr_surges = await getAttrsAsync ( [ "surges" ] ) ;
3277+ const surges = parseInt ( attr_surges . surges ) || 0 ;
3278+
3279+ const rollQuery = `[[?{How many?|1|2|3}]]` ;
3280+
3281+ const rollTemplate = `@{wtype}&{template:${ ROLLTEMPLATES . SIMPLE } } {{charactername=@{character_name}}} {{name=Using Surges for Damage}} {{rolltitle=${ rollQuery } }} {{roll=Surges used for [[${ rollQuery } *${ highest } ]] damage}}` ;
3282+
3283+ startRoll ( rollTemplate , ( { rollId, results } ) => {
3284+ const surges_lose = results . rolltitle . result || 0 ;
3285+ const surges_updated = surges - surges_lose ;
3286+
3287+ setAttrs ( { "surges" : surges_updated } ) ;
3288+
3289+ finishRoll ( rollId ) ;
3290+ } ) ;
3291+ }
3292+
3293+ /**
3294+ ** Simple Roll to apply Potency Surges
3295+ ** And adjust automatically in sheet
3296+ **/
3297+ async function rollPotencySurges ( ) {
3298+ console . log ( "~~~ rollPotencySurges ~~~" ) ;
3299+ // Get the necessary attributes.
3300+ const attrs = await getAttrsAsync ( [ "surges" , "agility" , "reason" , "intuition" , "presence" ] ) ;
3301+ const surges = parseInt ( attrs . surges ) || 0 ;
3302+
3303+ const rollTemplate = `@{wtype}&{template:${ ROLLTEMPLATES . SIMPLE } } {{charactername=@{character_name}}} {{name=Using Surges for Potency Increase}} {{rolltitle=[[2]]}} {{roll=Surges used to increase potency by 1}}` ;
3304+
3305+ startRoll ( rollTemplate , ( { rollId, results } ) => {
3306+ const surges_lose = results . rolltitle . result || 0 ;
3307+ const surges_updated = surges - surges_lose ;
3308+
3309+ setAttrs ( { "surges" : surges_updated } ) ;
3310+
3311+ finishRoll ( rollId ) ;
3312+ } ) ;
32463313 }
32473314
32483315 /**
@@ -3629,10 +3696,16 @@ <h5 class="panel-title" data-i18n="conditions"></h5>
36293696 rollResource ( ) ;
36303697 } ) ;
36313698
3632- // Surges Simple Roll
3699+ // Damage Surges Simple Roll
3700+
3701+ $20 ( '.surges-input-group > label[data-characteristic="surges-damage"]' ) . on ( 'click' , ( e ) => {
3702+ rollDamageSurges ( ) ;
3703+ } ) ;
3704+
3705+ // Potency Surges Simple Roll
36333706
3634- $20 ( '.surges-input-group > label' ) . on ( 'click' , ( e ) => {
3635- rollSurges ( ) ;
3707+ $20 ( '.surges-input-group > label[data-characteristic="surges-potency"] ' ) . on ( 'click' , ( e ) => {
3708+ rollPotencySurges ( ) ;
36363709 } ) ;
36373710
36383711 // Configuration map for feature sharing
@@ -3751,12 +3824,14 @@ <h5 class="panel-title" data-i18n="conditions"></h5>
37513824
37523825 function calculateEndCombat ( ) {
37533826 console . log ( '~~~ calculateEndCombat ~~~' ) ;
3754- getAttrs ( [ "resource" , "surges" ] , function ( values ) {
3827+ getAttrs ( [ "resource" , "surges" , "stamina_temporary" ] , function ( values ) {
37553828 let resource = parseInt ( values . resource ) || 0 ;
37563829 let surges = parseInt ( values . surges ) || 0 ;
3830+ let stamina_temporary = parseInt ( values . stamina_temporary ) || 0 ;
37573831 setAttrs ( {
37583832 "resource" : 0 ,
3759- "surges" : 0
3833+ "surges" : 0 ,
3834+ "stamina_temporary" : 0
37603835 } ) ;
37613836 } ) ;
37623837 }
0 commit comments