diff --git a/Shadowrun3e/shadowrun3e.css b/Shadowrun3e/shadowrun3e.css index 4bfeec0ba8..3cdf5ccb4e 100644 --- a/Shadowrun3e/shadowrun3e.css +++ b/Shadowrun3e/shadowrun3e.css @@ -19,6 +19,13 @@ animation-name: example; animation-duration: 4s; } +select option { + background: black; + color: white; + text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4); +} + + .button { font-size: 1em; padding: 4px; @@ -1167,15 +1174,35 @@ min-width: 0; display: none; } -.numberspan { - -} - - /* Magic Formating */ -.spells-spirit-status, -.spells-status { +.spells-status-tracking { + display: grid; + grid-template-columns: 40px 60px 60px 90px 50px 35px 60px 35px 50px 35px 70px 35px 50px 40px 60px 35px 35px; + align-items: center; + text-align: end; + background-color: rgba(192,192,192,.9); + border-top: 2px solid #fff; + border-right: 2px solid #fff; + border-left: 2px solid #fff; + border-top-left-radius: 10px; + border-top-right-radius: 10px; +} + +.spells-status-buttons { + display: grid; + grid-template-columns: 200px 60px 25px 60px 25px 60px 25px 60px 25px 60px 25px; + align-items: center; + text-align: end; + background-color: rgba(192,192,192,.9); + border-bottom: 2px solid #fff; + border-right: 2px solid #fff; + border-left: 2px solid #fff; + border-bottom-left-radius: 10px; + border-bottom-right-radius: 10px; + } + +.spells-spirit-status { display: grid; grid-template-columns: auto auto auto 60px 25px auto 25px 60px 25px 60px 25px; align-items: center; @@ -1292,6 +1319,36 @@ input[type="checkbox"].hidden-checkbox { grid-template-columns: 90px auto auto auto; } +.reusable-foci, +.powerfocus, +.spiritfocus { + display: none; +} + + +.focitype[value="Power Focus"] ~.reusable { + display: none; +} + + +.focitype[value="Spirit Focus"] ~.spiritfocus, +.focitype[value="Power Focus"] ~.powerfocus { + display: grid; +} + +.focitype[value="Spirit Focus"] ~.reusable, +.focitype[value="Spirit Focus"] ~.powerfoucs, +.focitype[value="Power Focus"] ~.reusable { + display: none; +} + +.magictype[value="shaman"] ~.mage-foci { + display: none; +} +.magictype[value="mage"] ~.shaman-foci { + display: none; +} + .foci-table { display: grid; /*grid-template-columns: 80px 45px;*/ @@ -1521,6 +1578,16 @@ melee-table-row input[type="textarea"], border-radius: 2px; justify-content: center; } +.spells-status-tracking span { + width: 35px; + background-color: white; + padding-left: 10px; + padding-right: 10px; + padding-top: 3px; + padding-bottom: 3px; + border: 1px solid #fff; + border-radius: 2px; + } .numberspan span, .deck-combat-modifiers span { width: 35px; @@ -2158,11 +2225,12 @@ input.enable-fa:not(:checked)~span.show_fa_dice { padding-right: 5px; } +.sorcery-over[value="1"] ~ .sorcery-over, +.spellpool-over[value="1"] ~ .spellpool-over, .vehicle-flux-overload[value="1"] ~ .flux-overload, .frame-utility-full[value="1"]~.frame-overload, .deck-mem-full[value="1"]~.deck-overload { background-color: red; - /* Green */ } .deck-utilities { diff --git a/Shadowrun3e/shadowrun3e.html b/Shadowrun3e/shadowrun3e.html index f84fdfdf20..ae6eab8d11 100644 --- a/Shadowrun3e/shadowrun3e.html +++ b/Shadowrun3e/shadowrun3e.html @@ -670,17 +670,71 @@
+ + + + + + +
-
Spells Stacked:
-
Spells Sustained:
+
+
+
Stacked
+
Sustained
+ +
+
Max
+
Used
+ +
+
Max
+
Defense
+
Used
+
+
Max
+
Defense
+
Used
+ +
+
Max
+
Used
+ +
Spells
+
+
+
Spell Defense
+
+
+
Sorcery
+
+
+
+ + +
+
Spell Pool
+
+
+
+ + +
+
Conjuring
+
+
+ +
+
Misc. Modifiers:
Defend:
Dispell:
Summon:
Banish:
Control:
+
Spells Stacked:
@@ -743,8 +797,8 @@
Adept
Mage
-
Shaman
-
Aspected Mage
+
Shaman
+
Aspected Mage
@@ -1092,65 +1146,75 @@
-
-
Name
+
Type
+
Category
Force
-
Power Foci
-
-
-
-
Air Elemental
-
-
Water Elemental
-
-
Earth Elemental
-
-
Fire Elemental
-
-
-
-
City Spirit
-
-
Field Spirit
-
-
Hearth Spirit
-
-
-
Desert Spirit
-
-
Forest Spirit
-
-
Mountain Spirit
-
-
Prairie Spirit
-
-
-
Mist Spirit
-
-
Storm Spirit
-
-
Wind Spirit
-
-
-
Lake Spirit
-
-
River Spirit
-
-
Sea Spirit
-
-
-
Gnome
-
-
Manitous
-
-
Salamander
-
-
Sylphs
-
-
Ancestor
-
+
Quantity
+
+
+ + +
+ +
+
+ +
+
+ +
+
+ +
+ +
+
+ +
+ +
+
Equip
@@ -4234,8 +4298,21 @@ buttonlist.forEach(button => { }); }); + + var resetpool = function () { + atts=[]; + /* atts["controllpool-used"]=0; + atts["hackingppool-used"]=0; + atts["astralpool-used"]=0; + atts["combatpool-used"]=0; */ + atts["magicpool-used"]=0; + atts["sorcery-used"]=0; + atts["spelldefense-used"]=0; + setAttrs(atts); + }; + on('clicked:repeating_spells:cast', (info) => { - var atts=["magic"]; + var atts=["magic", "magicpool-used", "sorcery-used"]; var source=info['sourceAttribute'].split('_'); const myid=info["htmlAttributes"]["id"] var sourceattr=source.pop(); @@ -4253,6 +4330,8 @@ buttonlist.forEach(button => { const force=myval[myrepeat + "force"]; const target=myval[myrepeat + "target"]; const drain=myval[myrepeat + "drain"]; + const spused=parseInt(myval["magicpool-used"]); + const sorceryused=parseInt(myval["sorcery-used"]); var drainlvl=myval[myrepeat + "drainlvl"]; const name=myval[myrepeat + "name"]; const description=myval[myrepeat + "description"]; @@ -4260,7 +4339,7 @@ buttonlist.forEach(button => { var targetofspell=target; if (target.includes("@{target")) targetofspell="@{target|Target|token_name}" var calcDice="?{Sorcery Dice?} + ?{Spell Pool Dice?}"; - var calcTN= target + " + (2*(@{spellstack}+@{spellsus})) + @{spellmisc} + @{stun_pen} + @{wound_pen}"; + var calcTN= target + " + (2*(@{spellstack}+@{spellsus})) + @{spellmisc} + @{stun_pen} + @{wound_pen} + @{cover}"; var calcDrainTN="floor(" + force + "/2) + " + drain + " + ( 2 * @{spellsus} )"; var calcDrainDice="@{willpower|max} + ?{Sorcery Dice for Drain?} + ?{Spell Pool Dice for Drain?}"; var myroll="&{template:spell}{{myname=@{character_name}}}"; @@ -4286,6 +4365,7 @@ buttonlist.forEach(button => { } console.log(myroll); startRoll(myroll, (results) => { + atts=[]; console.log('tst'); console.log(results.results.spelldamage.result); const finaldmg=damagetable[results.results.spelldamage.result]; @@ -4311,13 +4391,15 @@ buttonlist.forEach(button => { if ( (draindmg >= 10 ) && ( force > magic )) draindmg = draindmg - 9; draindmg=damagetable[draindmg]; console.log('drdmg : ' + draindmg); - console.log('sorcery dice : ' + results.results.sorcerydice.result); - console.log('spell pool : ' + results.results.spellpool.result); + atts["sorcery-used"]= sorceryused + parseInt(results.results.sorcerydice.result); + atts["magicpool-used"]= spused + parseInt(results.results.spellpool.result); finishRoll( results.rollId, { spelldamage: finaldmg, draindamage: draindmg, }); + console.log(atts); + setAttrs(atts); }); }); }); @@ -4347,6 +4429,7 @@ buttonlist.forEach(button => { console.log(myroll); startRoll(myroll, (results) => { finishRoll( results.rollId); + resetpool(); }); }); }; @@ -4539,8 +4622,8 @@ buttonlist.forEach(button => { var myroll="&{template:spell}{{myname=@{character_name}}}"; myroll+="{{sorcerydice=[[?{Sorcery Dice?|@{spellcasting}} + ?{Sorcery Dice for Drain?|0}]]}}"; myroll+="{{spellpool=[[?{Spell Pool Dice?|0} + ?{Spell Pool Dice for Drain?|0}]]}}"; - myroll+="{{spellname="DISPELL"}}"; - myroll+="{{castforce=?{Force of Spell?}}}" + myroll+="{{spellname=DISPELL}}"; + myroll+="{{castforce=[[?{Force of Spell?|0}]]}}"; myroll+="{{rolldice=[[" + calcDice + "]]}}"; myroll+="{{targetnumber=[[" + calcTN + "]]}}"; myroll+="{{draintest= [[ [[" + calcDrainDice + "]]d6>[[ {2, ( " + calcDrainTN + ")}kh1 ]]!! ]] }}"; @@ -4556,10 +4639,12 @@ buttonlist.forEach(button => { var calcDice="?{Sorcery Dice?} + ?{Spell Pool Dice?}"; var calcTN="?{Force of Spell?}"; var myroll="&{template:spell}{{myname=@{character_name}}}"; - myroll+="{{sorcerydice=[[?{Sorcery Dice?|@{spelldefense}}}}"; - myroll+="{{spellpool=[[?{Spell Pool Dice?|0}}}": - myroll+="{{castforce=?{Force of Spell?}}}" - myroll+="{{spellname="SPELL DEFENSE"}}"; + myroll+="{{sorcerydice=[[?{Sorcery Dice?|@{spelldefense}}]]}}"; + myroll+="{{castforce=[[?{Force of Spell?|0}]]}}"; + myroll+="{{targetnumber=[[" + calcTN + "]]}}"; + myroll+="{{spellpool=[[?{Spell Pool Dice?|0}]]}}"; + myroll+="{{spellname=SPELL DEFENSE}}"; + myroll+="{{rolldice=[[" + calcDice + "]]}}"; myroll+="{{targetofspell=@{target|Ally|token_name}}}"; myroll+="{{casttest=[[ [[" + calcDice + "]]d6>[[" + calcTN + "]]!! ]] }}"; console.log(myroll); @@ -4568,10 +4653,6 @@ buttonlist.forEach(button => { }); }); - var spelld = function (myid) { - - - }; on('clicked:vehicleposition', (info) => { calcTN="[[{2,(@{handling} + @{speed-exceeding} + @{driving-position-terrain} - @{vehicle-actionbonus} + (@{vehicle-autonav} * @{autonav}) + @{vehicle-driver}stun_pen} +@{vehicle-driver}wound_pen} +@{wp-vehicle} )}kh1]]" @@ -6529,6 +6610,33 @@ on("change:deck-dni change:intelligence_max change:reaction change:deck-asist ch }); }); +on("change:sorcery-defense change:magicpool-defense change:sorcery-used change:magicpool-used", function() { + getAttrs(["sorcery-defense", "magicpool", "sorcery", "magicpool-defense", "magicpool-used", "sorcery-used"], function (myval) { + atts=[]; + console.log('updating defense dice'); + var poolover=0; + var sorceryover=0; + let sorcery=parseInt(myval["sorcery"]); + let pool=parseInt(myval["magicpool"]); + let md=parseInt(myval["magicpool-defense"]); + let sd=parseInt(myval["sorcery-defense"]); + let mpu=parseInt(myval["magicpool-used"]); + let su=parseInt(myval["sorcery-used"]); + let sorcerytotal= sd + su; + let pooltotal= md + mpu; + if ( sorcerytotal > sorcery ) sorceryover=1; + if ( pooltotal > pool ) poolover=1; + atts["sorcery-over"]=sorceryover; + atts["spellpool-over"]=poolover; + atts["spelldefensedice"]=md + sd; + atts["sorcery-used-total"]=sd + su; + atts["magicpool-used-total"]=md + mpu; + console.log(atts); + setAttrs(atts); + }); + +}); + on("sheet:opened change:deck-masking-final change:decksleaze-rating", function() { getAttrs(["deck-masking-final", "decksleaze-rating"], function (myval) { console.log(myval["deck-masking-final"]); @@ -7045,6 +7153,69 @@ powers: ["Accident", "Divination", "Guard", "Materialization", "Search"] }); }) + on("remove:repeating_foci change:repeating_foci", function(eventinfo) { + const attribs=["category", "force", "type"]; + console.log(eventinfo); + mytrigger=eventinfo["triggerName"]; + console.log('mytrigger ' + mytrigger); + atts=[]; + + if (mytrigger == "remove:repeating_foci" ) { + myrepeat=eventinfo["sourceAttribute"]; + myattrib="remove"; + } else { + mybase=eventinfo["sourceAttribute"].split("_"); + myattrib=mybase.pop(); + myrepeat=mybase.join('_'); + } + if (myattrib == "remove" ) { + let cat = eventinfo["removedInfo"][myrepeat.concat("_category")]; + let type = eventinfo["removedInfo"][myrepeat.concat("_type")]; + if ( type == "Power Focus" ) atts["power-focus"]=0; + else if ( type == "Spirit Focus") atts[cat]=0; + else if ( type == "Expendable" ) atts["exp-" + cat]=0; + else if ( type == "Reusable" ) atts["reusable-" + cat]=0; + else return; + console.log(atts); + setAttrs(atts); + } else if (myattrib != "qty" ) { + gets=[]; + gets.push(myrepeat.concat("_category")); + gets.push(myrepeat.concat("_force")); + gets.push(myrepeat.concat("_type")); + getAttrs(gets, function(myval) { + let cat=myval[myrepeat.concat("_category")]; + let force=myval[myrepeat.concat("_force")]; + let type=myval[myrepeat.concat("_type")]; + if (type == "Power Focus") { + atts["power-focus"]=force + } else if ( type == "Spirit Focus" ) { + atts[cat]=force; + } else if ( type == "Expendable" ) { + if ( cat == "none" ) return; + var myatt="exp-" + cat; + atts[myatt]=force; + + } else if ( type == "Reusable" ) { + if ( cat == "none" ) return; + var myatt="reusable-" + cat; + atts[myatt]=force; + } else { + console.log('skipping'); + } + + console.log(atts); + setAttrs(atts); + }); + + + + } + + }); + + + @@ -7140,6 +7311,7 @@ powers: ["Accident", "Divination", "Guard", "Materialization", "Search"]
{{character}} {{type}}
{{#description}}
{{description}}
{{/description}} {{#roll}}
Roll: {{roll}}
{{/roll}} +
All pools refreshed
{{#notes}}
{{notes}}
{{/notes}} {{#notes2}}
{{notes2}}
{{/notes2}} {{#rollGreater() roll 10}}
{{character}} has qualified for multiple combat phases!