From 0c750ae8f19fd86e7513c8d7055ab392fb47e3ab Mon Sep 17 00:00:00 2001 From: BeautiDemise Date: Tue, 20 Aug 2024 20:32:22 +0200 Subject: [PATCH 01/34] Bugfix: Ailment count updates in messages was not displaying correctly for ailments added next round --- ProjectMoonTRPG/ProjectMoonTRPG.html | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/ProjectMoonTRPG/ProjectMoonTRPG.html b/ProjectMoonTRPG/ProjectMoonTRPG.html index dc5ccecffd3..bf9cf606563 100644 --- a/ProjectMoonTRPG/ProjectMoonTRPG.html +++ b/ProjectMoonTRPG/ProjectMoonTRPG.html @@ -15511,12 +15511,22 @@

Edit Mode Password

delete tempOutput.checkResult; } + console.log(tempOutput.modifyList) + console.log(tempOutput.modifyTarget) + console.log(tempOutput.modifyVal) + console.log(ailmentList) + /* Handle updating ailmentList and barList after a successful AutoEffect */ if (tempOutput.modifyList != undefined) { if (tempOutput.modifyList == "barList") { barList[tempOutput.modifyTarget] = parseInt(barList[tempOutput.modifyTarget]) + parseInt(tempOutput.modifyVal); } else { - ailmentList[tempOutput.modifyTarget][1] = parseInt(ailmentList[tempOutput.modifyTarget][1]) + parseInt(tempOutput.modifyVal); + let targetIndex = 1; + if (tempOutput.modifyTarget.includes("NextTurn")) { + tempOutput.modifyTarget = tempOutput.modifyTarget.replace("NextTurn",""); + targetIndex = 2; + } + ailmentList[tempOutput.modifyTarget][targetIndex] = parseInt(ailmentList[tempOutput.modifyTarget][targetIndex]) + parseInt(tempOutput.modifyVal); } delete tempOutput.modifyList; delete tempOutput.modifyTarget; @@ -16337,8 +16347,8 @@

Edit Mode Password

/* Update target list */ returnValues.modifyList = "ailmentList"; - returnValues.modifyTarget = effectAilment; - returnValues.modifyVal = effectVal; + returnValues.modifyTarget = effectTarget; + returnValues.modifyVal = effectVal*scaling; /* Handle message */ let message = ""; From 1f048b3f02bca6a460a75f7389c909f0e3224aba Mon Sep 17 00:00:00 2001 From: BeautiDemise Date: Tue, 20 Aug 2024 20:50:52 +0200 Subject: [PATCH 02/34] Bugfix: Negative damage resistance ailments and custom resistances now correctly state they increase damage by N instead of reducing damage by N --- ProjectMoonTRPG/ProjectMoonTRPG.html | 23 +++++++++++------------ ProjectMoonTRPG/translation.json | 1 + 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ProjectMoonTRPG/ProjectMoonTRPG.html b/ProjectMoonTRPG/ProjectMoonTRPG.html index bf9cf606563..50509fea263 100644 --- a/ProjectMoonTRPG/ProjectMoonTRPG.html +++ b/ProjectMoonTRPG/ProjectMoonTRPG.html @@ -13774,25 +13774,24 @@

Edit Mode Password

} function generateDamageHelperBodyEffect(effectName, effectVal, effectType, ailmentRes, iconString, resMode = "", resVal = "", resIcon = "") { - let langDamage = "damage"; - let langDealt = "dealt"; - let langRegened = "regened"; - let langReducedDamageBy = "reduced damage by"; - let langResist = "Resistance: "; + let langDamage = getTranslationByKeyCustom("damage", "message-damage"); + let langDealt = getTranslationByKeyCustom("dealt", "message-dealt"); + let langRegened = getTranslationByKeyCustom("regened", "message-regened"); + let langResist = getTranslationByKeyCustom("Resistance: ", "message-resist"); - if(getTranslationByKey("message-damage") != false) { - langDamage = getTranslationByKey("message-damage"); - langDealt = getTranslationByKey("message-dealt"); - langRegened = getTranslationByKey("message-regened"); - langReducedDamageBy = getTranslationByKey("message-reduced-damage-by"); - langResist = getTranslationByKey("message-resist"); + let langReduction = ""; + if (effectVal < 0) { + langReduction = getTranslationByKeyCustom("increased damage by", "message-increased-damage-by"); + } else { + langReduction = getTranslationByKeyCustom("reduced damage by", "message-reduced-damage-by"); } + let message = "
"; switch (effectType) { case "Damage": message += `${iconString}
${effectName} ${langDealt} ${Math.abs(effectVal)} ${langDamage}`; break; case "Regen": message += `${iconString}
${effectName} ${langRegened} ${Math.abs(effectVal)} ${langDamage}`; break; - case "Reduction": message += `${iconString}
${effectName} ${langReducedDamageBy} ${Math.abs(effectVal)}`; break; + case "Reduction": message += `${iconString}
${effectName} ${langReduction} ${Math.abs(effectVal)}`; break; } if (resMode == "beforeResistance") { message += ` x [${resVal}x] ` + getIcon("def", resIcon); diff --git a/ProjectMoonTRPG/translation.json b/ProjectMoonTRPG/translation.json index 2c9f0e793be..6c600588aa3 100644 --- a/ProjectMoonTRPG/translation.json +++ b/ProjectMoonTRPG/translation.json @@ -492,6 +492,7 @@ "message-dealt": "dealt", "message-regened":"regened", "message-reduced-damage-by":"reduced damage by", + "message-increased-damage-by":"increased damage by", "message-increased-HP-damage-by":"increased HP damage by", "message-received":"received", "message-received-no":"Received no", From 1e7e9af8bdf9ac6d466cd889ae6c1258ddc651ac Mon Sep 17 00:00:00 2001 From: BeautiDemise Date: Wed, 21 Aug 2024 01:45:05 +0200 Subject: [PATCH 03/34] Bugfix: Two "X is Staggered!" messages were being posted when Staggered --- ProjectMoonTRPG/ProjectMoonTRPG.html | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ProjectMoonTRPG/ProjectMoonTRPG.html b/ProjectMoonTRPG/ProjectMoonTRPG.html index 50509fea263..b22392dff7b 100644 --- a/ProjectMoonTRPG/ProjectMoonTRPG.html +++ b/ProjectMoonTRPG/ProjectMoonTRPG.html @@ -10957,10 +10957,8 @@

Edit Mode Password

if(currentstag <= 0 && currentstate == "0"){ - setAttrs({ - "StaggerState":"Staggered", - "StaggerDuration":statedurationmax - }); + setAttrs({"StaggerState":"Staggered"}); + setAttrs({"StaggerDuration":statedurationmax}); } /* Value check end */ @@ -11306,8 +11304,8 @@

Edit Mode Password

}); /* Auto: Stagger State updates */ -on("change:StaggerState change:StaggerDuration", function() { - +on("change:StaggerState change:StaggerDuration", function(eventInfo) { + getSectionIDs(`repeating_global`, idarray => { let id = `repeating_global_${idarray[0]}`; @@ -11327,6 +11325,11 @@

Edit Mode Password

let egostate = values.egoActiveState; let sanity = parseInt(values.SP) - parseInt(values[`${id}_staggerSanity`]); + /* Aborts the function if staggerduration is set to its max value. Hinders a double messages when Staggered (StaggerState and StaggerDuration are both changed) */ + if (eventInfo.sourceAttribute == "staggerduration" && stateduration == statedurationmax) { + return; + } + if(egocon == "OnStagger" && currentstate != "0"){ setAttrs({"egoActiveState":"true"}); } @@ -11365,9 +11368,6 @@

Edit Mode Password

let langStateDurationMultiRound = getTranslationByKeyCustom(" will stop being Staggered in ", "message-stagger4") + parseInt(stateduration + 1) + " " + getTranslationByKeyCustom("rounds", "message-round-plural"); let messageDescription = ""; - console.log(stateduration) - console.log(statedurationmax) - if (currentstate == "Staggered" && stateduration == statedurationmax) { messageDescription = langStateTrue; } From 601bdc6763dd054caf3458deb157b482db540a5e Mon Sep 17 00:00:00 2001 From: BeautiDemise Date: Fri, 23 Aug 2024 16:42:50 +0200 Subject: [PATCH 04/34] Bugfix: HTML class was named improperly --- ProjectMoonTRPG/ProjectMoonTRPG.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ProjectMoonTRPG/ProjectMoonTRPG.html b/ProjectMoonTRPG/ProjectMoonTRPG.html index b22392dff7b..328a2a6bde2 100644 --- a/ProjectMoonTRPG/ProjectMoonTRPG.html +++ b/ProjectMoonTRPG/ProjectMoonTRPG.html @@ -15652,7 +15652,7 @@

Edit Mode Password

conditionalAlert += buttonName; } if (conditionalAlert != "") { - message += `
${getIcon("icons","whisper","false","class=autoEffectImage")}Created conditional buttons:
${conditionalAlert}
` + message += `
${getIcon("icons","whisper","false","class=autoEffectImage")}Created conditional buttons:
${conditionalAlert}
` } /* Execute challange rolls */ From 6a29a236c4d8e75b22d5006106cf90c10f079e2d Mon Sep 17 00:00:00 2001 From: BeautiDemise Date: Fri, 23 Aug 2024 18:19:46 +0200 Subject: [PATCH 05/34] Feature: AutoEffect sections are now collapsed by default and are revealed by hovering over them - Will look into adding a setting to enable and disable this fuctionality --- ProjectMoonTRPG/ProjectMoonTRPGStyle.css | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ProjectMoonTRPG/ProjectMoonTRPGStyle.css b/ProjectMoonTRPG/ProjectMoonTRPGStyle.css index fdca93e446b..37c3bedb57a 100644 --- a/ProjectMoonTRPG/ProjectMoonTRPGStyle.css +++ b/ProjectMoonTRPG/ProjectMoonTRPGStyle.css @@ -2501,15 +2501,23 @@ height: 35px;} .sheet-rolltemplate-autoeffect .userscript-autoeffectContainer, .sheet-rolltemplate-message .userscript-autoeffectContainer, .sheet-rolltemplate-baseRoll .userscript-autoeffectContainer { - margin-top: 10px; border-radius: 5px; border: 1px solid #555; position: relative; + max-height: 29px; + transition: max-height 1.5s ease-out; + overflow: hidden; +} +.sheet-rolltemplate-damagecalculation .userscript-autoeffectContainer:hover, +.sheet-rolltemplate-autoeffect .userscript-autoeffectContainer:hover, +.sheet-rolltemplate-message .userscript-autoeffectContainer:hover, +.sheet-rolltemplate-baseRoll .userscript-autoeffectContainer:hover { + max-height: 500px; + transition: max-height 3s ease; } .sheet-rolltemplate-baseRoll .userscript-autoeffectContainer { float: left; width: 99.3%; - margin-top: 10px; } .sheet-rolltemplate-damagecalculation .userscript-autoeffectContainer > .userscript-autoeffectEntry, .sheet-rolltemplate-autoeffect .userscript-autoeffectContainer > .userscript-autoeffectEntry, From bf04889dab635e452ce90d8329f1a3bff11bfa97 Mon Sep 17 00:00:00 2001 From: BeautiDemise Date: Fri, 23 Aug 2024 18:45:42 +0200 Subject: [PATCH 06/34] Bugfix/feature: Fixed autoeffect messages without sections being collapsed - Also added a small delay to opening a section to avoid sections opening when moving the cursor past the section --- ProjectMoonTRPG/ProjectMoonTRPGStyle.css | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ProjectMoonTRPG/ProjectMoonTRPGStyle.css b/ProjectMoonTRPG/ProjectMoonTRPGStyle.css index 37c3bedb57a..e2315b870e0 100644 --- a/ProjectMoonTRPG/ProjectMoonTRPGStyle.css +++ b/ProjectMoonTRPG/ProjectMoonTRPGStyle.css @@ -2497,23 +2497,26 @@ height: 35px;} .sheet-rolltemplate-baseRoll .userscript-autoeffectContainer a { pointer-events: none; } +.sheet-rolltemplate-autoeffect .userscript-autoeffectContainer { + border-radius: 5px; + border: 1px solid #555; + position: relative; +} .sheet-rolltemplate-damagecalculation .userscript-autoeffectContainer, -.sheet-rolltemplate-autoeffect .userscript-autoeffectContainer, .sheet-rolltemplate-message .userscript-autoeffectContainer, .sheet-rolltemplate-baseRoll .userscript-autoeffectContainer { border-radius: 5px; border: 1px solid #555; position: relative; max-height: 29px; - transition: max-height 1.5s ease-out; + transition: max-height 1.5s 0.1s ease-out; overflow: hidden; } .sheet-rolltemplate-damagecalculation .userscript-autoeffectContainer:hover, -.sheet-rolltemplate-autoeffect .userscript-autoeffectContainer:hover, .sheet-rolltemplate-message .userscript-autoeffectContainer:hover, .sheet-rolltemplate-baseRoll .userscript-autoeffectContainer:hover { max-height: 500px; - transition: max-height 3s ease; + transition: max-height 3s 0.1s ease; } .sheet-rolltemplate-baseRoll .userscript-autoeffectContainer { float: left; From 07a0f637c63cc3975d6c33b686422b161d7a5b5a Mon Sep 17 00:00:00 2001 From: BeautiDemise Date: Fri, 23 Aug 2024 18:46:25 +0200 Subject: [PATCH 07/34] Bugfix: Fixed ailmentList being updated when using Inflict and Give, and fixed ailmentList not being updated correctly for custom ailments --- ProjectMoonTRPG/ProjectMoonTRPG.html | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/ProjectMoonTRPG/ProjectMoonTRPG.html b/ProjectMoonTRPG/ProjectMoonTRPG.html index 328a2a6bde2..2d944d31337 100644 --- a/ProjectMoonTRPG/ProjectMoonTRPG.html +++ b/ProjectMoonTRPG/ProjectMoonTRPG.html @@ -15510,25 +15510,20 @@

Edit Mode Password

delete tempOutput.checkResult; } - console.log(tempOutput.modifyList) - console.log(tempOutput.modifyTarget) - console.log(tempOutput.modifyVal) - console.log(ailmentList) - /* Handle updating ailmentList and barList after a successful AutoEffect */ if (tempOutput.modifyList != undefined) { if (tempOutput.modifyList == "barList") { barList[tempOutput.modifyTarget] = parseInt(barList[tempOutput.modifyTarget]) + parseInt(tempOutput.modifyVal); } else { let targetIndex = 1; - if (tempOutput.modifyTarget.includes("NextTurn")) { - tempOutput.modifyTarget = tempOutput.modifyTarget.replace("NextTurn",""); + if (tempOutput.modifyNextTurn != undefined && tempOutput.modifyNextTurn == "true") { targetIndex = 2; } ailmentList[tempOutput.modifyTarget][targetIndex] = parseInt(ailmentList[tempOutput.modifyTarget][targetIndex]) + parseInt(tempOutput.modifyVal); } delete tempOutput.modifyList; delete tempOutput.modifyTarget; + delete tempOutput.modifyNextTurn; delete tempOutput.modifyVal; } @@ -16337,18 +16332,22 @@

Edit Mode Password

if (effectRepeatingId == 0) { effectTarget = effectAilment; } /* If standard ailment */ else { effectTarget = `repeating_ailments_${ailmentList[effectAilment][4]}_ailNum`; } /* If custom ailment */ + /* Update target list */ + if (autoEffectVariant == "Gain") { + returnValues.modifyList = "ailmentList"; + returnValues.modifyTarget = effectAilment; + returnValues.modifyNextTurn = "false"; + returnValues.modifyVal = effectVal*scaling; + } + /* Effect changes target to the next turn field if it's enabled */ /* Is ignored if "This turn" override is included */ if (effectHasNextTurn == 'true' && forceTarget != "This round") { effectTarget += "NextTurn"; count = ailmentList[effectAilment][2]; + if (returnValues.modifyNextTurn != undefined) { returnValues.modifyNextTurn = "true"; } } - /* Update target list */ - returnValues.modifyList = "ailmentList"; - returnValues.modifyTarget = effectTarget; - returnValues.modifyVal = effectVal*scaling; - /* Handle message */ let message = ""; let messageValues = {}; From 88c984e5bab8b3adee03bade2aff9674aa2580d9 Mon Sep 17 00:00:00 2001 From: BeautiDemise Date: Fri, 23 Aug 2024 19:18:05 +0200 Subject: [PATCH 08/34] Icon: Added Blood icon from LoR --- ProjectMoonTRPG/ProjectMoonTRPG.html | 119 ++++++------------ ProjectMoonTRPG/ProjectMoonTRPGStyle.css | 4 + ProjectMoonTRPG/images/ailments/Blood.png | Bin 0 -> 4249 bytes .../imagesResized/ailments/Blood.png | Bin 0 -> 1314 bytes 4 files changed, 42 insertions(+), 81 deletions(-) create mode 100644 ProjectMoonTRPG/images/ailments/Blood.png create mode 100644 ProjectMoonTRPG/imagesResized/ailments/Blood.png diff --git a/ProjectMoonTRPG/ProjectMoonTRPG.html b/ProjectMoonTRPG/ProjectMoonTRPG.html index 2d944d31337..4cd19f23d1d 100644 --- a/ProjectMoonTRPG/ProjectMoonTRPG.html +++ b/ProjectMoonTRPG/ProjectMoonTRPG.html @@ -524,46 +524,40 @@
-
-
-
-
-
-
-
-
-
-
+ +
+
+
@@ -1172,10 +1166,13 @@
-
+ +
+
+
@@ -2411,47 +2408,41 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
@@ -3664,47 +3655,41 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
@@ -3958,47 +3943,41 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
@@ -4252,47 +4231,41 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
@@ -4546,47 +4519,41 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
@@ -7040,46 +7007,40 @@
-
-
-
-
-
-
-
-
-
-
+ +
+
+
@@ -9817,47 +9778,41 @@

Edit Mode Password

-
-
-
-
-
-
-
-
-
-
+
+
+
+
@@ -10213,6 +10168,8 @@

Edit Mode Password

+ + diff --git a/ProjectMoonTRPG/ProjectMoonTRPGStyle.css b/ProjectMoonTRPG/ProjectMoonTRPGStyle.css index e2315b870e0..9cd5955392b 100644 --- a/ProjectMoonTRPG/ProjectMoonTRPGStyle.css +++ b/ProjectMoonTRPG/ProjectMoonTRPGStyle.css @@ -2240,6 +2240,10 @@ background-image: url('https://raw.githubusercontent.com/punibird/roll20-charact background-image: url('https://raw.githubusercontent.com/beautidemise/roll20-character-sheets/master/ProjectMoonTRPG/images/ailments/limbus/RottingSkin.png'); } +.blood { +background-image: url('https://raw.githubusercontent.com/beautidemise/roll20-character-sheets/Release-v0.6.3/ProjectMoonTRPG/images/ailments/Blood.png'); +} + .slashprotection-limbus { background-image: url('https://raw.githubusercontent.com/punibird/roll20-character-sheets/master/ProjectMoonTRPG/images/ailments/limbus/SlashProtection.png'); } diff --git a/ProjectMoonTRPG/images/ailments/Blood.png b/ProjectMoonTRPG/images/ailments/Blood.png new file mode 100644 index 0000000000000000000000000000000000000000..0ed2f5db36de94ad1755cd684d7b1dbabf1c09af GIT binary patch literal 4249 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 literal 0 HcmV?d00001 diff --git a/ProjectMoonTRPG/imagesResized/ailments/Blood.png b/ProjectMoonTRPG/imagesResized/ailments/Blood.png new file mode 100644 index 0000000000000000000000000000000000000000..0ad38952855bce92a77d32969398a0decaf0ba5e GIT binary patch literal 1314 zcmV+-1>O3IP)pF8+1ijbW?9;ba!ELWdK8EY;$>YAX9X8WNB|8RBvx=!KdMT000E7 zNkls86fn5lPk)@lc6R%*(o2`)INRCX z&N=s<^V;|MoaZ^uJw_5Y!(zH2|K%jc79`vqg>kU58b}4M!CXn@ZiG~hh3s8G252*#Lh=;G4y{KC;`?$JutX4a?+WQ3}E*GU>NWyd`A@p7d1PyrO{VZw<@Lp@M0k}ibWj8>c^T4`2z;FN$c*hOmr&Eng zth+)h6ia%$OGAt?2G~Ce?%N4O0W#p5oPrvzF{|nvAB#F5HJnxH49FM*2Umi3ddD`v zGdvOBloV=K9U`+O5caBc2BdNzWbXxfI=A~g#Ju@9ZC{?^g)gevYTb&5g{vxIg&1Sf zfvOVl%?{ZoAo}TXc+%21QM8ta+k-U0Qb`NDB4lG5 z!#ZfPvvRJ>K#VcN4OG7fQFHBF{OK5f6tS<*!t05ncENHoBrZaQr0HD=vi263vm5B` z2zltQM^8#4eqKHoi}YJ_CCfWX($Ppmj%C5f zWzKDXlM?`9qe(0);kWgbT;6wtM}YHCCTV`eAjX(v;Ox6#CRn2ps{{PU??6JqlLT8@ zXei&#DquaFlyqk#Avr#%_#EivK!jqP!50uW<$hu(r1NvpDh^5%SfL*x>3pOhOZvg9 z750UD?D3Vy0SfIH1@stw7fG|HaU%aMerXLb!`hu8>8nUV)(nHZQX3FuKYv7pR0pit z2ic##+Xs+bn9I@P)igI>W14ly6Oy(@3bJen6geS22groniUUA9;7Lqi(A;c}t=LS% z)fVPhhdd@}XQUvrW1#$fz;7eG_S(_Ra8#rnXa&?ej{cL!Q@wRJKmOjv3d=d-dZ&xR z0U2%J@M2)71L1XK1xJ%=vmquao}MWKIep+b-w1XOiMf89^v<2JwwZ4%Jz-ibaX-cF!#L`|c{}mv{k(JP(w>v7L9)4O{1Dpv4*<@8L zN7A-PL;3+fq(l5vM?ONERl6f20jx3n7HekZFfjH;{?Q8O=rBod<#?phr;<1LH8>h-H>ibH^g1b YAFw)IyQw3hZU6uP07*qoM6N<$f^;}fIRF3v literal 0 HcmV?d00001 From 5a36e100c41146a148e9b53ed07db6d7e2e676f5 Mon Sep 17 00:00:00 2001 From: BeautiDemise Date: Fri, 23 Aug 2024 19:25:18 +0200 Subject: [PATCH 09/34] Bugfix: Blood icon not configured correctly for tools --- ProjectMoonTRPG/ProjectMoonTRPG.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ProjectMoonTRPG/ProjectMoonTRPG.html b/ProjectMoonTRPG/ProjectMoonTRPG.html index 4cd19f23d1d..b6acf2d4b50 100644 --- a/ProjectMoonTRPG/ProjectMoonTRPG.html +++ b/ProjectMoonTRPG/ProjectMoonTRPG.html @@ -411,7 +411,7 @@
-
+
@@ -3687,7 +3687,7 @@
-
+
@@ -3975,7 +3975,7 @@
-
+
@@ -4263,7 +4263,7 @@
-
+
@@ -4551,7 +4551,7 @@
-
+
From 9cafe440e3e66a62bb081e052d1b9edb44f03e1b Mon Sep 17 00:00:00 2001 From: BeautiDemise Date: Fri, 23 Aug 2024 19:27:58 +0200 Subject: [PATCH 10/34] Bugfix: Stagger update message was not displaying correctly when manually unstaggering oneself --- ProjectMoonTRPG/ProjectMoonTRPG.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ProjectMoonTRPG/ProjectMoonTRPG.html b/ProjectMoonTRPG/ProjectMoonTRPG.html index b6acf2d4b50..6b04e2acd67 100644 --- a/ProjectMoonTRPG/ProjectMoonTRPG.html +++ b/ProjectMoonTRPG/ProjectMoonTRPG.html @@ -11334,7 +11334,7 @@

Edit Mode Password

else if (currentstate == "Staggered" && stateduration < statedurationmax) { messageDescription = langStateDurationMultiRound; } - else if (currentstate != "Staggered" && stateduration == 0) { + else if (currentstate != "Staggered") { messageDescription = langStateFalse; } From 2240d57f8df44122e72631e9bda86d790e7528b1 Mon Sep 17 00:00:00 2001 From: BeautiDemise Date: Fri, 23 Aug 2024 20:45:53 +0200 Subject: [PATCH 11/34] Feature: Settings improvements - Sorted settings into sections - Added "Collapse AutoEffect sections" setting. Enables collapsable section styling for *NEW* AutoEffect messages while enabled - "Hide: Helper Text" now also disables helper text for the Damage Helper. Also moved the blunt icon up to fit the smaller format --- ProjectMoonTRPG/ProjectMoonTRPG.html | 128 ++++++++++++++--------- ProjectMoonTRPG/ProjectMoonTRPGStyle.css | 52 ++++++--- ProjectMoonTRPG/translation.json | 6 ++ 3 files changed, 118 insertions(+), 68 deletions(-) diff --git a/ProjectMoonTRPG/ProjectMoonTRPG.html b/ProjectMoonTRPG/ProjectMoonTRPG.html index 6b04e2acd67..54f6dd61af7 100644 --- a/ProjectMoonTRPG/ProjectMoonTRPG.html +++ b/ProjectMoonTRPG/ProjectMoonTRPG.html @@ -20,58 +20,68 @@
-
-Settings - - - - - - - - - - - - - - - - - - - - +
+
+ General Settings + + + + + + + + + + + + + + + + + + + Combat Settings - + + + + + + + + + +
- +
+ Ailment Settings - + - + - + - + + + - - + Damage Helper Settings - + - + - - + AutoEffect Settings + -
+ +
+
@@ -2700,7 +2710,8 @@

Damage helper

-
+ +
@@ -2714,19 +2725,19 @@
-
+
Base Damage
-
+
Flat HP DMG - +
-
+
Flat ST DMG - +
-
+
Apply damage
@@ -15289,7 +15300,7 @@

Edit Mode Password

AutoScript = translateAutoScriptToEnglish(AutoScript); /* Get relevant attributes */ - getAttrs(["settingMuteMessage", "settingWhisperRolls", "settingWhisperTarget", "settingLimbusStyle", "settingHideNextTurn", //"settingTargetMode", + getAttrs(["settingMuteMessage", "settingWhisperRolls", "settingWhisperTarget", "settingLimbusStyle", "settingHideNextTurn", "settingCollapseAutoEffectSections", //"settingTargetMode", "HP", "HP_max", "StagRes", "StagRes_max", "SP", "SP_max", "thisRoundSpeed", "nextRoundSpeed", "StaggerState", "distortState", "egoActiveState", "egoType", "autoScriptStyling"], function(values) { @@ -15298,6 +15309,7 @@

Edit Mode Password

let settingWhisperTarget = values.settingWhisperTarget; let settingLimbusStyle = values.settingLimbusStyle; let settingHideNextTurn = values.settingHideNextTurn; + let settingCollapseSections = values.settingCollapseAutoEffectSections; //let targetmode = values.settingTargetMode; //if (overrideList.targetmode != undefined) { targetmode = overrideList.targetmode; } @@ -15617,7 +15629,7 @@

Edit Mode Password

/* Standard messages print as a generic "AutoEffects" section and include all unconditional effects */ if (returnValues.error != true && message != "") { if (sendMessage == "false") { - returnValues.message = autoEffectSection("AutoEffects", message); + returnValues.message = autoEffectSection("AutoEffects", message, settingCollapseSections); } } @@ -15634,9 +15646,9 @@

Edit Mode Password

} if (returnValues.message == undefined) { - returnValues.message = autoEffectSection(conditionName, conditionMessage, iconFolder, iconName, getColor(iconColor)); + returnValues.message = autoEffectSection(conditionName, conditionMessage, settingCollapseSections, iconFolder, iconName, getColor(iconColor)); } else { - returnValues.message += autoEffectSection(conditionName, conditionMessage, iconFolder, iconName, getColor(iconColor)); + returnValues.message += autoEffectSection(conditionName, conditionMessage, settingCollapseSections, iconFolder, iconName, getColor(iconColor)); } } @@ -15648,9 +15660,9 @@

Edit Mode Password

for (const [errorType, errorMessage] of Object.entries(errorMessageList)) { if (errorType) if (returnValues.message == undefined) { - returnValues.message = autoEffectSection(errorType, errorMessage, "icons", "exit", getColor("Red")); + returnValues.message = autoEffectSection(errorType, errorMessage, settingCollapseSections, "icons", "exit", getColor("Red")); } else { - returnValues.message += autoEffectSection(errorType, errorMessage, "icons", "exit", getColor("Red")); + returnValues.message += autoEffectSection(errorType, errorMessage, settingCollapseSections, "icons", "exit", getColor("Red")); } } resetConditionals(); @@ -15675,6 +15687,11 @@

Edit Mode Password

if (returnValues.message == undefined) { returnValues.message = ""; } let messageContents = "
" + message + returnValues.message + "
"; + /* Collapse sections if the setting is enabled */ + if (settingCollapseSections == "true") { + messageContents = messageContents.replaceAll("autoeffectContainer'>", "autoeffectContainer collapseSection'>") + } + let whisper = ""; if(settingWhisperRolls == "true"){ whisper = "/w " + settingWhisperTarget; @@ -15877,7 +15894,7 @@

Edit Mode Password

function autoEffectEntry(message) { return "
" + message + "
"; } -function autoEffectSection(header, message, iconFolder="icons", iconName="gear", iconColor="#85a874") { +function autoEffectSection(header, message, collapseSections, iconFolder="icons", iconName="gear", iconColor="#85a874") { let newEntry = "
" newEntry += `
` newEntry += `
` @@ -15885,6 +15902,13 @@

Edit Mode Password

newEntry += `
`; newEntry += `
${header}
` newEntry += `
` + message + "
"; + + console.log(collapseSections) + if (collapseSections == "true") { + + newEntry = newEntry.replaceAll("autoeffectContainer'>", "autoeffectContainer collapseSection'>") + } + return newEntry; } diff --git a/ProjectMoonTRPG/ProjectMoonTRPGStyle.css b/ProjectMoonTRPG/ProjectMoonTRPGStyle.css index 9cd5955392b..bb8bb6fe480 100644 --- a/ProjectMoonTRPG/ProjectMoonTRPGStyle.css +++ b/ProjectMoonTRPG/ProjectMoonTRPGStyle.css @@ -162,6 +162,14 @@ textarea::placeholder, .CharSmallNotes::placeholder, .CharDetail::placeholder, . .helperText:checked ~ .helperTextContainer .helpers b { display: none !important; } +.helperText:checked ~ .damageHelperContainer.helperTextContainer :is(.slash, .pierce) { + margin-right: 28px; +} +.helperText:checked ~ .damageHelperContainer.helperTextContainer .blunt { + position: absolute; + top: 0px; + left: 28px; +} .editCover > .rowContainer, .editCover > .hide-item, .editCover > .hide-item > .rowContainer { @@ -395,8 +403,8 @@ textarea::placeholder, .CharSmallNotes::placeholder, .CharDetail::placeholder, . z-index: 150; } #settings:hover { - height: 500px; - width: 300px; + height: auto; + width: 530px; border: 1px #fee2b0 solid; border-radius: 5px 15px 5px 5px; background-color: rgba(0,0,0,0.8); @@ -417,6 +425,10 @@ textarea::placeholder, .CharSmallNotes::placeholder, .CharDetail::placeholder, . } .settingsText { padding: 35px; + padding-bottom: 25px; +} +.settingsTitle { + line-height: 1.8em; } @@ -2501,26 +2513,14 @@ height: 35px;} .sheet-rolltemplate-baseRoll .userscript-autoeffectContainer a { pointer-events: none; } -.sheet-rolltemplate-autoeffect .userscript-autoeffectContainer { - border-radius: 5px; - border: 1px solid #555; - position: relative; -} .sheet-rolltemplate-damagecalculation .userscript-autoeffectContainer, +.sheet-rolltemplate-autoeffect .userscript-autoeffectContainer, .sheet-rolltemplate-message .userscript-autoeffectContainer, .sheet-rolltemplate-baseRoll .userscript-autoeffectContainer { + margin-top: 5px; border-radius: 5px; border: 1px solid #555; position: relative; - max-height: 29px; - transition: max-height 1.5s 0.1s ease-out; - overflow: hidden; -} -.sheet-rolltemplate-damagecalculation .userscript-autoeffectContainer:hover, -.sheet-rolltemplate-message .userscript-autoeffectContainer:hover, -.sheet-rolltemplate-baseRoll .userscript-autoeffectContainer:hover { - max-height: 500px; - transition: max-height 3s 0.1s ease; } .sheet-rolltemplate-baseRoll .userscript-autoeffectContainer { float: left; @@ -2562,6 +2562,26 @@ height: 35px;} position: absolute; left: 0; } +/* Collapseable section styling */ +.sheet-rolltemplate-damagecalculation .userscript-collapseSection, +.sheet-rolltemplate-message .userscript-collapseSection, +.sheet-rolltemplate-baseRoll .userscript-collapseSection { + max-height: 29px; + transition: max-height 1.5s 0.1s ease-out; + overflow: hidden; +} +.sheet-rolltemplate-damagecalculation .userscript-collapseSection:hover, +.sheet-rolltemplate-message .userscript-collapseSection:hover, +.sheet-rolltemplate-baseRoll .userscript-collapseSection:hover { + max-height: 500px; + transition: max-height 3s 0.1s ease; +} +/* Removed mergin for every section but the first */ +.sheet-rolltemplate-damagecalculation .userscript-collapseSection ~ .userscript-collapseSection, +.sheet-rolltemplate-message .userscript-collapseSection ~ .userscript-collapseSection, +.sheet-rolltemplate-baseRoll .userscript-collapseSection ~ .userscript-collapseSection { + margin-top: 0px; +} /* Action buttons below chat messages */ diff --git a/ProjectMoonTRPG/translation.json b/ProjectMoonTRPG/translation.json index 6c600588aa3..2bd3f0bae2f 100644 --- a/ProjectMoonTRPG/translation.json +++ b/ProjectMoonTRPG/translation.json @@ -6,6 +6,11 @@ "credits4":"Supported by:", "credits5":"System:", "settings":"Settings", + "settings-general":"General Settings", + "settings-combat":"Combat Settings", + "settings-damage-helper":"Damage Helper Settings", + "settings-ailments":"Ailment Settings", + "settings-autoeffects":"AutoEffect Setting", "settings-mute":"Mute ailment messages", "settings-detect":"Auto: Detect combat states", "settings-autoapplydamage":"Auto: Apply damage taken", @@ -28,6 +33,7 @@ "settings-limbusstyle":"Limbus style ailment icons", "settings-multihituses":"Spend Uses per Multi-hit", "settings-hideuses":"Hide: Uses in messages", + "settings-collapsesections":"Collapse AutoEffect sections", "assessed":"Assessed by: ", "sheet-title":"Background Investigation and Combat Ability Report", "sheet-title-distort":"Distortion Survey Report", From ca095dad4452032c059ff1d7dbe442636b91ae3c Mon Sep 17 00:00:00 2001 From: BeautiDemise Date: Fri, 23 Aug 2024 21:09:40 +0200 Subject: [PATCH 12/34] Feature: Settings improvements - Collapsable AutoEffect sections now remain open for much longer when hovered over - Added setting to disable the "created conditional buttons" alert functionality --- ProjectMoonTRPG/ProjectMoonTRPG.html | 8 ++++++-- ProjectMoonTRPG/ProjectMoonTRPGStyle.css | 11 ++++++++++- ProjectMoonTRPG/translation.json | 1 + 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ProjectMoonTRPG/ProjectMoonTRPG.html b/ProjectMoonTRPG/ProjectMoonTRPG.html index 54f6dd61af7..ff0ec80903f 100644 --- a/ProjectMoonTRPG/ProjectMoonTRPG.html +++ b/ProjectMoonTRPG/ProjectMoonTRPG.html @@ -79,6 +79,8 @@ + +
@@ -15300,7 +15302,8 @@

Edit Mode Password

AutoScript = translateAutoScriptToEnglish(AutoScript); /* Get relevant attributes */ - getAttrs(["settingMuteMessage", "settingWhisperRolls", "settingWhisperTarget", "settingLimbusStyle", "settingHideNextTurn", "settingCollapseAutoEffectSections", //"settingTargetMode", + getAttrs(["settingMuteMessage", "settingWhisperRolls", "settingWhisperTarget", "settingLimbusStyle", "settingHideNextTurn", + "settingCollapseAutoEffectSections", "settingHideConditionalButtonReminder", //"settingTargetMode", "HP", "HP_max", "StagRes", "StagRes_max", "SP", "SP_max", "thisRoundSpeed", "nextRoundSpeed", "StaggerState", "distortState", "egoActiveState", "egoType", "autoScriptStyling"], function(values) { @@ -15310,6 +15313,7 @@

Edit Mode Password

let settingLimbusStyle = values.settingLimbusStyle; let settingHideNextTurn = values.settingHideNextTurn; let settingCollapseSections = values.settingCollapseAutoEffectSections; + let settingConditionalButtonReminder = values.settingHideConditionalButtonReminder; //let targetmode = values.settingTargetMode; //if (overrideList.targetmode != undefined) { targetmode = overrideList.targetmode; } @@ -15615,7 +15619,7 @@

Edit Mode Password

if (conditionalAlert != "") { conditionalAlert += ", "} conditionalAlert += buttonName; } - if (conditionalAlert != "") { + if (conditionalAlert != "" && settingConditionalButtonReminder != "true") { message += `
${getIcon("icons","whisper","false","class=autoEffectImage")}Created conditional buttons:
${conditionalAlert}
` } diff --git a/ProjectMoonTRPG/ProjectMoonTRPGStyle.css b/ProjectMoonTRPG/ProjectMoonTRPGStyle.css index bb8bb6fe480..b7ed2759eb9 100644 --- a/ProjectMoonTRPG/ProjectMoonTRPGStyle.css +++ b/ProjectMoonTRPG/ProjectMoonTRPGStyle.css @@ -402,6 +402,7 @@ textarea::placeholder, .CharSmallNotes::placeholder, .CharDetail::placeholder, . font-weight: bold; z-index: 150; } +/*#settings {*/ #settings:hover { height: auto; width: 530px; @@ -424,9 +425,17 @@ textarea::placeholder, .CharSmallNotes::placeholder, .CharDetail::placeholder, . border: 1px #fee2b0 solid; } .settingsText { + width: 220px; padding: 35px; padding-bottom: 25px; } +.settingsText input[type="checkbox"] { + position: absolute; +} +.settingsText span:not(.settingsTitle) { + position: relative; + left: 21px; +} .settingsTitle { line-height: 1.8em; } @@ -2567,7 +2576,7 @@ height: 35px;} .sheet-rolltemplate-message .userscript-collapseSection, .sheet-rolltemplate-baseRoll .userscript-collapseSection { max-height: 29px; - transition: max-height 1.5s 0.1s ease-out; + transition: max-height 10s 0.1s ease-in; overflow: hidden; } .sheet-rolltemplate-damagecalculation .userscript-collapseSection:hover, diff --git a/ProjectMoonTRPG/translation.json b/ProjectMoonTRPG/translation.json index 2bd3f0bae2f..10c2816de29 100644 --- a/ProjectMoonTRPG/translation.json +++ b/ProjectMoonTRPG/translation.json @@ -34,6 +34,7 @@ "settings-multihituses":"Spend Uses per Multi-hit", "settings-hideuses":"Hide: Uses in messages", "settings-collapsesections":"Collapse AutoEffect sections", + "settings-hideconditionalreminder":"Hide: Conditional button reminder", "assessed":"Assessed by: ", "sheet-title":"Background Investigation and Combat Ability Report", "sheet-title-distort":"Distortion Survey Report", From 143f22db6bf6dc51aba1abbad1cd6a82c8c2e631 Mon Sep 17 00:00:00 2001 From: BeautiDemise Date: Fri, 23 Aug 2024 21:23:39 +0200 Subject: [PATCH 13/34] Feature: Settings improvements - New settings can now be imported and exported --- ProjectMoonTRPG/ProjectMoonTRPG.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ProjectMoonTRPG/ProjectMoonTRPG.html b/ProjectMoonTRPG/ProjectMoonTRPG.html index ff0ec80903f..7359cb77f62 100644 --- a/ProjectMoonTRPG/ProjectMoonTRPG.html +++ b/ProjectMoonTRPG/ProjectMoonTRPG.html @@ -16663,7 +16663,13 @@

Edit Mode Password

let attrkeyCharacter = ["character_nameBase", "instinct", "wisdom", "justice", "charm", "insight", "temperance", "EXP", "character_job", "age", "height", "character_origin", "character_residence", "character_assets", "character_ahn", "character_url", "character_summary", "character_combatnote", "character_history", "character_relations", "character_notes", "character_desc", "character_personality", "character_background"]; -let attrkeySettings = ["settingWhisperRolls", "settingMuteMessage", "settingAutoDetect", "settingTurnUpdate", "settingAutoApplyDamage", "settingSimpleDisplay", "settingExtraEquip", "settingHideSpecial", "settingHideBaseEffect", "settingHideNextTurn", "settingHideBarUpdate", "settingHelperText", "settingHideShare", "settingBurnImmune", "settingBleedImmune", "settingMultihitFull", "settingMultihitUses", "settingHideUses", "AutoScriptStyling"]; +let attrkeySettings = ["settingWhisperRolls", + +"settingSimpleDisplay", "settingExtraEquip", "settingHideSpecial", "settingHelperText", "settingHideShare", "settingHideUses", +"settingAutoDetect", "settingTurnUpdate", "settingMultihitFull", "settingMultihitUses", +"settingMuteMessage", "settingHideNextTurn", "settingBurnImmune", "settingBleedImmune", +"settingAutoApplyDamage", "settingHideBarUpdate", +"settingCollapseAutoEffectSections", "settingHideConditionalButtonReminder", "settingHideBaseEffect", "AutoScriptStyling"]; let attrkeyEquip = ["outfitName", "outfitRank", "outfitDescription", "outfitEffect", "defDice1", "defDice2", "defDice3", "evdDice1", "evdDice2", "evdDice3", "outfitImmune1", "outfitImmune2", "outfitImmune3", "outfitImmune4", "outfitImmune5", "outfitImmune6", "bleedResist", "burnResist", "damageResist", "outfitAutoScript", From 14bc01a17f8265f71c6ab260c6d422203c24715c Mon Sep 17 00:00:00 2001 From: BeautiDemise Date: Fri, 23 Aug 2024 22:27:06 +0200 Subject: [PATCH 14/34] Feature: Added arrow to collapseable sections to indicate they can be opened --- ProjectMoonTRPG/ProjectMoonTRPG.html | 4 ++-- ProjectMoonTRPG/ProjectMoonTRPGStyle.css | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/ProjectMoonTRPG/ProjectMoonTRPG.html b/ProjectMoonTRPG/ProjectMoonTRPG.html index 7359cb77f62..1ede17b4a24 100644 --- a/ProjectMoonTRPG/ProjectMoonTRPG.html +++ b/ProjectMoonTRPG/ProjectMoonTRPG.html @@ -15693,7 +15693,7 @@

Edit Mode Password

/* Collapse sections if the setting is enabled */ if (settingCollapseSections == "true") { - messageContents = messageContents.replaceAll("autoeffectContainer'>", "autoeffectContainer collapseSection'>") + messageContents = messageContents.replaceAll("autoeffectContainer'>", "autoeffectContainer collapseSection'>
") } let whisper = ""; @@ -15910,7 +15910,7 @@

Edit Mode Password

console.log(collapseSections) if (collapseSections == "true") { - newEntry = newEntry.replaceAll("autoeffectContainer'>", "autoeffectContainer collapseSection'>") + newEntry = newEntry.replaceAll("autoeffectContainer'>", "autoeffectContainer collapseSection'>
") } return newEntry; diff --git a/ProjectMoonTRPG/ProjectMoonTRPGStyle.css b/ProjectMoonTRPG/ProjectMoonTRPGStyle.css index b7ed2759eb9..116f6ab6422 100644 --- a/ProjectMoonTRPG/ProjectMoonTRPGStyle.css +++ b/ProjectMoonTRPG/ProjectMoonTRPGStyle.css @@ -2591,6 +2591,27 @@ height: 35px;} .sheet-rolltemplate-baseRoll .userscript-collapseSection ~ .userscript-collapseSection { margin-top: 0px; } +/* Create arrow to indicate if the section is collapsed or expanded */ +.sheet-rolltemplate-damagecalculation .userscript-collapseSection .userscript-arrow, +.sheet-rolltemplate-message .userscript-collapseSection .userscript-arrow, +.sheet-rolltemplate-baseRoll .userscript-collapseSection .userscript-arrow { + position: absolute; top: 10px; right: 10px; + width: 0px; + height: 0px; + border-bottom: none; + border-left: 6px solid transparent; + border-right: 6px solid transparent; + border-top: 10px solid #fff; + opacity: 50%; + transition: opacity 10s 0.1s ease; +} +/* Create arrow to indicate if the section is collapsed or expanded */ +.sheet-rolltemplate-damagecalculation .userscript-collapseSection:hover .userscript-arrow, +.sheet-rolltemplate-message .userscript-collapseSection:hover .userscript-arrow, +.sheet-rolltemplate-baseRoll .userscript-collapseSection:hover .userscript-arrow { + opacity: 0%; + transition: opacity 0.6s 0.1s ease; +} /* Action buttons below chat messages */ From 57db27def1cfd60ae8d1fe4279e9ca1ed65342c6 Mon Sep 17 00:00:00 2001 From: BeautiDemise Date: Fri, 23 Aug 2024 22:32:54 +0200 Subject: [PATCH 15/34] Bugfix: Attacks with multiple dice now displays #1 for the first apply damage action button --- ProjectMoonTRPG/ProjectMoonTRPG.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ProjectMoonTRPG/ProjectMoonTRPG.html b/ProjectMoonTRPG/ProjectMoonTRPG.html index 1ede17b4a24..9803a2f8678 100644 --- a/ProjectMoonTRPG/ProjectMoonTRPG.html +++ b/ProjectMoonTRPG/ProjectMoonTRPG.html @@ -13014,7 +13014,10 @@

Edit Mode Password

for (const rollKey in rollList) { damage_data.baseOverride = Math.max(parseInt(rollList[rollKey]) + parseInt(autoeffectBaseDamage),0); - let rollNumber = (rollKey == "roll1") ? "" : ` (#${rollKey.replace("roll","")})`; + let rollNumber = ` (#${rollKey.replace("roll","")})`; + if (Object.keys(rollList).length == 1) { + rollNumber = ""; + } buttonList.push(generateActionButton("autoDamage"+rollNumber, getIcon("icons","damage"), "red", "actionButtonDamage", {...damage_data})); } } From 5ea63bfcd81346a9638350e38531649725b1e216 Mon Sep 17 00:00:00 2001 From: BeautiDemise Date: Sun, 25 Aug 2024 02:40:26 +0200 Subject: [PATCH 16/34] Bugfix: Check AutoEffects were not working when using status bar values --- ProjectMoonTRPG/ProjectMoonTRPG.html | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ProjectMoonTRPG/ProjectMoonTRPG.html b/ProjectMoonTRPG/ProjectMoonTRPG.html index 9803a2f8678..0bc1dcbaefd 100644 --- a/ProjectMoonTRPG/ProjectMoonTRPG.html +++ b/ProjectMoonTRPG/ProjectMoonTRPG.html @@ -15909,10 +15909,7 @@

Edit Mode Password

newEntry += `
`; newEntry += `
${header}
` newEntry += `
` + message + "
"; - - console.log(collapseSections) if (collapseSections == "true") { - newEntry = newEntry.replaceAll("autoeffectContainer'>", "autoeffectContainer collapseSection'>
") } @@ -16108,9 +16105,9 @@

Edit Mode Password

/* Handle ailment count */ if (ailmentList.hasOwnProperty(effectName)) { count = ailmentList[effectName][1]; countImmutable = ailmentList[effectName][3]; } /* Handle bar count */ - else if (barList.hasOwnProperty(effectName)) { count = barList[effectName]; } + else if (barList.hasOwnProperty(effectName)) { count = barList[effectName]; countImmutable = count; } /* Handle bar damage count */ - else if (barDamageList.hasOwnProperty(effectName)) { count = barDamageList[effectName]; } + else if (barDamageList.hasOwnProperty(effectName)) { count = barDamageList[effectName]; countImmutable = count; } else { return autoEffectErrorMessage("Invalid Target", `Ailment, Bar or BarDamage "${effectName}" does not exist`, AutoEffect); } /* Get required value. Recalculate count if percentage */ @@ -16132,7 +16129,7 @@

Edit Mode Password

countImmutable = count; } else { return autoEffectErrorMessage("Invalid Value", `Value "${AutoEffect[1]}" is not a number or percentage`, AutoEffect); } - + /* Handle the scaling option */ let scaling = 1; let scalingOption = AutoEffect.find(option => (/(scaling)/ig).test(option)); @@ -16206,6 +16203,7 @@

Edit Mode Password

else if (barList.hasOwnProperty(effectName)) { effectTarget = effectName; count = barList[effectName]; + countImmutable = count; } else { return autoEffectErrorMessage("Invalid Target", `Ailment or Bar "${effectName}" does not exist`, AutoEffect); } From c9b6c4ed196db8ae00a441f41e634aad9fb676d7 Mon Sep 17 00:00:00 2001 From: BeautiDemise Date: Sun, 25 Aug 2024 04:13:17 +0200 Subject: [PATCH 17/34] Bugfix: DistortState was not properly defined on sheet creation, leading to display issues --- ProjectMoonTRPG/ProjectMoonTRPG.html | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ProjectMoonTRPG/ProjectMoonTRPG.html b/ProjectMoonTRPG/ProjectMoonTRPG.html index 0bc1dcbaefd..cc2aa952b86 100644 --- a/ProjectMoonTRPG/ProjectMoonTRPG.html +++ b/ProjectMoonTRPG/ProjectMoonTRPG.html @@ -10897,7 +10897,7 @@

Edit Mode Password

}); -/* Auto: Initialize Base name */ +/* Auto: Initialize Base name and distort state */ on("sheet:opened", function() { getAttrs(["distortState", "character_name", "character_nameBase"], function(values) { let name = values.character_name; @@ -10905,11 +10905,9 @@

Edit Mode Password

let state = values.distortState; if(state != "true" && basename != name){ - - setAttrs({"character_nameBase":name}); - + setAttrs({"character_nameBase":name}); + setAttrs({"distortState":"0"}); } - }); }); From 349b2c1d50736c0e08a58b9710231f884985188f Mon Sep 17 00:00:00 2001 From: BeautiDemise Date: Mon, 26 Aug 2024 21:19:59 +0200 Subject: [PATCH 18/34] Bugfix: Old #MessageButton option was not being converted correctly to the new conditional options --- ProjectMoonTRPG/ProjectMoonTRPG.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ProjectMoonTRPG/ProjectMoonTRPG.html b/ProjectMoonTRPG/ProjectMoonTRPG.html index cc2aa952b86..265e92aa1ba 100644 --- a/ProjectMoonTRPG/ProjectMoonTRPG.html +++ b/ProjectMoonTRPG/ProjectMoonTRPG.html @@ -15747,7 +15747,7 @@

Edit Mode Password

cleanAutoScript = cleanAutoScript.replaceAll('“','"').replaceAll('”','"'); /* Remove any of the old v0.6 options that still remain in the AutoScript */ - cleanAutoScript = cleanAutoScript.replaceAll("#Button","").replaceAll("#Message","#Section").replaceAll("#MessageButton","").trim(); + cleanAutoScript = cleanAutoScript.replaceAll("#MessageButton","").replaceAll("#Button","").replaceAll("#Message","#Section").trim(); /* Replace Stagger_Protection with StaggerProtection. The space is added to avoid affecting image links */ cleanAutoScript = cleanAutoScript.replaceAll(' Stagger_Protection',' StaggerProtection'); From 49b1adb9c13949256d77d775a831609b24a0ae67 Mon Sep 17 00:00:00 2001 From: BeautiDemise Date: Mon, 26 Aug 2024 21:26:13 +0200 Subject: [PATCH 19/34] Bugfix: Styling rules were being deleted if the styling editor was open when closing the sheet --- ProjectMoonTRPG/ProjectMoonTRPG.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ProjectMoonTRPG/ProjectMoonTRPG.html b/ProjectMoonTRPG/ProjectMoonTRPG.html index 265e92aa1ba..29d9d023065 100644 --- a/ProjectMoonTRPG/ProjectMoonTRPG.html +++ b/ProjectMoonTRPG/ProjectMoonTRPG.html @@ -17779,7 +17779,13 @@

Edit Mode Password

let editorTarget = values.autoScriptEditorTarget; autoScriptList.forEach(autoScriptPrefix => { let target = `${autoScriptPrefix}AutoScript`; - if (autoScriptPrefix == "autoScriptEditorInput") { target = "autoScriptEditorInput"; } + if (autoScriptPrefix == "autoScriptEditorInput") { + if (editorTarget == "autoScriptStyling") { + return; + } else { + target = "autoScriptEditorInput"; + } + } let autoScript = values[target]; colorList.forEach(color => { From 221328e5a44891e4e20383262b7645ceffad9090 Mon Sep 17 00:00:00 2001 From: BeautiDemise Date: Mon, 26 Aug 2024 21:53:37 +0200 Subject: [PATCH 20/34] Bugfix: Stagger duration not being set properly when manually staggering a creature --- ProjectMoonTRPG/ProjectMoonTRPG.html | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/ProjectMoonTRPG/ProjectMoonTRPG.html b/ProjectMoonTRPG/ProjectMoonTRPG.html index 29d9d023065..430f4f5537a 100644 --- a/ProjectMoonTRPG/ProjectMoonTRPG.html +++ b/ProjectMoonTRPG/ProjectMoonTRPG.html @@ -1748,7 +1748,7 @@
- +
@@ -1948,6 +1952,7 @@ +
@@ -1973,6 +1978,7 @@ +
@@ -2005,6 +2011,7 @@ +
@@ -2031,6 +2038,7 @@ +
@@ -2057,6 +2065,7 @@ +
@@ -2089,6 +2098,7 @@ + @@ -2115,6 +2125,7 @@ + @@ -2141,6 +2152,7 @@ + @@ -2172,6 +2184,7 @@ + @@ -2198,6 +2211,7 @@ + @@ -2224,6 +2238,7 @@ + @@ -2518,6 +2533,7 @@ + @@ -9900,6 +9916,7 @@

Edit Mode Password

+ @@ -11606,18 +11623,24 @@

Edit Mode Password

setAttrs({"messageOverride":"true"}); - setAttrs({ - "StaggerState":"0", "StaggerDuration":staggerdurationmax, "PanicState":"0", "SealState":"0", "ImmobileState":"0", "DefeatState":"0", "Burn": "0", "Bleed":"0", "Paralysis":"0", "Protection": "0", "StaggerProtection": "0", "Fragile": "0", "Strength": "0", "Feeble": "0", "Endurance": "0", "Disarm": "0", "Haste": "0", "Bind": "0", "Charge":"0", "Smoke": "0", "Seal":"0", "Fortune":"0", "BurnNextTurn": "0", "BleedNextTurn":"0", "ParalysisNextTurn":"0", "ProtectionNextTurn": "0", "StaggerProtectionNextTurn": "0", "FragileNextTurn": "0", "StrengthNextTurn": "0", "FeebleNextTurn": "0", "EnduranceNextTurn": "0", "DisarmNextTurn": "0", "HasteNextTurn": "0", "BindNextTurn": "0", "ChargeNextTurn":"0", "SmokeNextTurn": "0", "Seal":"0", "FortuneNextTurn":"0", "SP":newsan}); }); - + let ailmentNames = ["Burn", "Bleed", "Paralysis", "Protection", "StaggerProtection", "Fragile", "Strength", "Feeble", "Endurance", "Disarm", "Haste", "Bind", "Smoke", "Charge", "Fortune"]; + let attributeObject = {}; + ailmentNames.forEach(ailment => { + attributeObject[`${ailment}`] = 0; + attributeObject[`${ailment}NextTurn`] = 0; + attributeObject[`${ailment}DecayPause`] = 0; + }); + setAttrs({...attributeObject, "StaggerState":"0", "StaggerDuration":staggerdurationmax, "PanicState":"0", "SealState":"0", "ImmobileState":"0", "DefeatState":"0", "Seal":"0", "SP":newsan}); }); /* Custom Ailments */ getSectionIDs(`repeating_ailments`, idarray => { - const fieldnames = idarray.reduce((rows,id) => [...rows, `repeating_ailments_${id}_ailNum`, `repeating_ailments_${id}_ailNumNextTurn`], ''); + const fieldnames = idarray.reduce((rows,id) => [...rows, `repeating_ailments_${id}_ailNum`, `repeating_ailments_${id}_ailNumNextTurn`, `repeating_ailments_${id}_ailDecayPause`], ''); getAttrs([...fieldnames], v => { const output = {}; idarray.forEach(id => { output[`repeating_ailments_${id}_ailNum`] = 0; output[`repeating_ailments_${id}_ailNumNextTurn`] = 0; + output[`repeating_ailments_${id}_ailDecayPause`] = 0; }); setAttrs(output); }); @@ -12013,31 +12036,32 @@

Edit Mode Password

/* Action: Update ailments */ on('clicked:updateAilments', function() { + updateAilments(); +}); -getSectionIDs(`repeating_global`, idarray => { - let id = `repeating_global_${idarray[0]}`; +function updateAilments(ailmentOverride=[]) { + getSectionIDs(`repeating_global`, idarray => { + let id = `repeating_global_${idarray[0]}`; - getAttrs(["settingMuteMessage", "settingWhisperRolls", "settingWhisperTarget", "settingBurnImmune", "nextRoundSpeed", - "StaggerState", "StaggerDuration", `${id}_staggerDurationMax`, "SealState", "ImmobileState", "Burn", "burnResist", "burnResist_ego", "distortState", "egoActiveState", "egoType", "Smoke", "Charge", "HP", "StagRes_max", "settingLimbusStyle", - `${id}_staggerRecoverPercent`, `${id}_staggerRecoverBase`, `${id}_burnDecayMode`, `${id}_burnDecayVal`, `${id}_smokeDecayMode`, `${id}_smokeDecayVal`, `${id}_chargeDecayMode`, `${id}_chargeDecayVal`, - "Bleed", "BurnNextTurn", "BleedNextTurn", "ParalysisNextTurn", "ProtectionNextTurn", "StaggerProtectionNextTurn", "FragileNextTurn", "StrengthNextTurn", "FeebleNextTurn", "EnduranceNextTurn", "DisarmNextTurn", "HasteNextTurn", "BindNextTurn", "SmokeNextTurn", "ChargeNextTurn", "FortuneNextTurn"], function(values) { + let ailmentNames = ["Burn", "Bleed", "Paralysis", "Protection", "StaggerProtection", "Fragile", "Strength", "Feeble", "Endurance", "Disarm", "Haste", "Bind", "Smoke", "Charge", "Fortune"]; + if (ailmentOverride.length != 0) { ailmentNames = ailmentOverride; } - let burnnew = parseInt(values.BurnNextTurn); - let burncurrent = values.Burn; - let burndecay = values[`${id}_burnDecayVal`]; + let attributeList = []; + ailmentNames.forEach(ailment => { + attributeList.push(`${ailment}`, `${ailment}NextTurn`, `${ailment}DecayPause`); + }); - let bleednew = parseInt(values.Bleed) + parseInt(values.BleedNextTurn); + getAttrs(["settingMuteMessage", "settingWhisperRolls", "settingWhisperTarget", "settingBurnImmune", "nextRoundSpeed", + "StaggerState", "StaggerDuration", `${id}_staggerDurationMax`, "SealState", "ImmobileState", "burnResist", "burnResist_ego", "distortState", "egoActiveState", "egoType", "HP", "StagRes_max", "settingLimbusStyle", + `${id}_staggerRecoverPercent`, `${id}_staggerRecoverBase`, `${id}_burnDecayMode`, `${id}_burnDecayVal`, `${id}_smokeDecayMode`, `${id}_smokeDecayVal`, `${id}_chargeDecayMode`, `${id}_chargeDecayVal`, + ...attributeList], function(values) { + let burnnew = 0; + let bleednew = parseInt(values.Bleed); + let smokenew = 0; + let chargenew = 0; let stagnew = "0"; - let smokenew = parseInt(values.SmokeNextTurn); - let smokecurrent = values.Smoke; - let smokedecay = values[`${id}_smokeDecayVal`]; - - let chargenew = parseInt(values.ChargeNextTurn); - let chargecurrent = values.Charge; - let chargedecay = values[`${id}_chargeDecayVal`]; - let nomessage = values.settingMuteMessage; let burnimmune = values.settingBurnImmune; let iconstyle = values.settingLimbusStyle; @@ -12047,18 +12071,6 @@

Edit Mode Password

let sealcheck = values.SealState; let immobilecheck = values.ImmobileState; - let paralysisnew = values.ParalysisNextTurn; - let protectionnew = values.ProtectionNextTurn; - let staggerprotectionnew = values.StaggerProtectionNextTurn; - let fragilenew = values.FragileNextTurn; - let strengthnew = values.StrengthNextTurn; - let feeblenew = values.FeebleNextTurn; - let endurancenew = values.EnduranceNextTurn; - let disarmnew = values.DisarmNextTurn; - let hastenew = values.HasteNextTurn; - let bindnew = values.BindNextTurn; - let fortunenew = values.FortuneNextTurn; - let iconnew = ""; let style = "https://raw.githubusercontent.com/punibird/roll20-character-sheets/master/ProjectMoonTRPG/images/ailments/"; @@ -12092,136 +12104,162 @@

Edit Mode Password

} /* Burn processing */ - if (parseInt(values.Burn) > 0) { - - /* Decay */ - if(burndecay == "n"){ - burndecay = parseInt(burncurrent); - } - else if(burndecay == "-n"){ - burndecay = parseInt(0 - burncurrent); - } - - if(values[`${id}_burnDecayMode`] == "+"){ - burnnew += parseInt(burncurrent) + parseInt(burndecay); - } - else if(values[`${id}_burnDecayMode`] == "x"){ - burnnew += parseInt(parseInt(burncurrent) * parseFloat(burndecay)); - } - else if(values[`${id}_burnDecayMode`] == "="){ - burnnew += parseInt(burndecay); - } - - /* Damage */ - let burndamage = parseInt(values.Burn - burnresist); - - if(burndamage <= 0){ - burndamage = 0; - } - - let burnresult = parseInt(values.HP - burndamage); - - let iconnew = ""; - - if(burnimmune == "true"){ - burnresult = parseInt(values.HP); - } - - /* Translation prep */ - let langBurn = " was burned for "; - let langDamage = " damage."; - let langResist = "Resistance: "; - let langResistCombined = ""; - - if(getTranslationByKey("message-burn") != false){ - - langBurn = getTranslationByKey("message-burn"); - langDamage= getTranslationByKey("message-damage"); - langResist= getTranslationByKey("message-resist"); - } - - if(burnresist != "0"){ - langResistCombined = "
(" + langResist + burnresist + ")
"; - } - - let burnmessage = langBurn + "" + burndamage + " " + langDamage + "." + langResistCombined; + if(ailmentNames.includes("Burn")) { + let burncurrent = parseInt(values.Burn); + let burndecay = parseFloat(values[`${id}_burnDecayVal`]); + + if (burncurrent > 0) { + + /* Decay */ + if (parseInt(values.BurnDecayPause) == 0) { + if(burndecay == "n"){ + burndecay = parseInt(burncurrent); + } + else if(burndecay == "-n"){ + burndecay = parseInt(0 - burncurrent); + } + + if(values[`${id}_burnDecayMode`] == "+"){ + burnnew += parseInt(burncurrent) + parseInt(burndecay); + } + else if(values[`${id}_burnDecayMode`] == "x"){ + burnnew += parseInt(parseInt(burncurrent) * parseFloat(burndecay)); + } + else if(values[`${id}_burnDecayMode`] == "="){ + burnnew += parseInt(burndecay); + } - setAttrs({"HP":burnresult, "dummy":burnmessage, "dummyIcon":iconnew}); - autoScriptOverrideList.Burn = [burnnew, burncurrent]; + console.log(values) + } - if(nomessage != "true" && burnimmune != "true"){ - startRoll((whisper + "&{template:message} {{icon=@{dummyIcon}}} {{name=@{character_name}}} {{message=@{dummy} }}"), (results) => { - finishRoll(results.rollId, {} ); - }); + /* Damage */ + let burndamage = parseInt(values.Burn - burnresist); + + if(burndamage <= 0){ + burndamage = 0; + } + + let burnresult = parseInt(values.HP - burndamage); + + let iconnew = ""; + + if(burnimmune == "true"){ + burnresult = parseInt(values.HP); + } + + /* Translation prep */ + let langBurn = " was burned for "; + let langDamage = " damage."; + let langResist = "Resistance: "; + let langResistCombined = ""; + + if(getTranslationByKey("message-burn") != false){ + + langBurn = getTranslationByKey("message-burn"); + langDamage= getTranslationByKey("message-damage"); + langResist= getTranslationByKey("message-resist"); + } + + if(burnresist != "0"){ + langResistCombined = "
(" + langResist + burnresist + ")
"; + } + + let burnmessage = langBurn + "" + burndamage + " " + langDamage + "." + langResistCombined; + + setAttrs({"HP":burnresult, "dummy":burnmessage, "dummyIcon":iconnew}); + autoScriptOverrideList.Burn = [burnnew, burncurrent]; + + if(nomessage != "true" && burnimmune != "true"){ + startRoll((whisper + "&{template:message} {{icon=@{dummyIcon}}} {{name=@{character_name}}} {{message=@{dummy} }}"), (results) => { + finishRoll(results.rollId, {} ); + }); + } } } - /* Custom Ailments */ - getSectionIDs(`repeating_ailments`, idarray => { - const fieldnames = idarray.reduce((rows,id) => [...rows, `repeating_ailments_${id}_ailTrigger`, `repeating_ailments_${id}_ailNextTurn`, `repeating_ailments_${id}_ailNum`, `repeating_ailments_${id}_ailNumNextTurn`], ''); - - getAttrs([...fieldnames], v => { - - idarray.forEach(id => { - let ailTrigger = v[`repeating_ailments_${id}_ailTrigger`]; - - let ailNextTurn = v[`repeating_ailments_${id}_ailNextTurn`]; - let ailNum = v[`repeating_ailments_${id}_ailNum`]; - let ailNumNextTurn = v[`repeating_ailments_${id}_ailNumNextTurn`]; - - if (ailTrigger == "RoundEnd") { - updateCustomAilment(id, "standard", "true", function(returnValues) { Object.assign(autoScriptOverrideList, returnValues) }); - } - else { - updateCustomAilment(id, "decay", "true", function(returnValues) { Object.assign(autoScriptOverrideList, returnValues) }); - } + /* Custom Ailments */ + if (ailmentNames.length >= 15) { + getSectionIDs(`repeating_ailments`, idarray => { + const fieldnames = idarray.reduce((rows,id) => [...rows, `repeating_ailments_${id}_ailTrigger`, `repeating_ailments_${id}_ailNextTurn`, `repeating_ailments_${id}_ailNum`, `repeating_ailments_${id}_ailNumNextTurn`], ''); + + getAttrs([...fieldnames], v => { + + idarray.forEach(id => { + + let ailTrigger = v[`repeating_ailments_${id}_ailTrigger`]; + + let ailNextTurn = v[`repeating_ailments_${id}_ailNextTurn`]; + let ailNum = v[`repeating_ailments_${id}_ailNum`]; + let ailNumNextTurn = v[`repeating_ailments_${id}_ailNumNextTurn`]; + + if (ailTrigger == "RoundEnd") { + updateCustomAilment(id, "standard", "true", function(returnValues) { Object.assign(autoScriptOverrideList, returnValues) }); + } + else { + updateCustomAilment(id, "decay", "true", function(returnValues) { Object.assign(autoScriptOverrideList, returnValues) }); + } + }); }); }); - }); + } /* Smoke processing */ - if (parseInt(values.Smoke) > 0){ + if(ailmentNames.includes("Smoke")) { + let smokecurrent = parseInt(values.Smoke); + let smokedecay = parseFloat(values[`${id}_smokeDecayVal`]); - if(smokedecay == "n"){ - smokedecay = parseInt(smokecurrent); - } - else if(smokedecay == "-n"){ - smokedecay = parseInt(0 - smokecurrent); - } - - if(values[`${id}_smokeDecayMode`] == "+"){ - smokenew += parseInt(smokecurrent) + parseInt(smokedecay); - } - else if(values[`${id}_smokeDecayMode`] == "x"){ - smokenew += parseInt(parseInt(smokecurrent) * parseFloat(smokedecay)); - } - else if(values[`${id}_smokeDecayMode`] == "="){ - smokenew += parseInt(smokedecay); + if (smokecurrent > 0){ + + if (parseInt(values.SmokeDecayPause) == 0) { + if(smokedecay == "n"){ + smokedecay = parseInt(smokecurrent); + } + else if(smokedecay == "-n"){ + smokedecay = parseInt(0 - smokecurrent); + } + + if(values[`${id}_smokeDecayMode`] == "+"){ + smokenew += parseInt(smokecurrent) + parseInt(smokedecay); + } + else if(values[`${id}_smokeDecayMode`] == "x"){ + smokenew += parseInt(parseInt(smokecurrent) * parseFloat(smokedecay)); + } + else if(values[`${id}_smokeDecayMode`] == "="){ + smokenew += parseInt(smokedecay); + } + } + autoScriptOverrideList.Smoke = [smokenew, smokecurrent]; } - autoScriptOverrideList.Smoke = [smokenew, smokecurrent]; } /* Charge processing */ - if (parseInt(values.Charge) > 0){ + if(ailmentNames.includes("Charge")) { + let chargecurrent = parseInt(values.Charge); + let chargedecay = parseFloat(values[`${id}_chargeDecayVal`]); - if(chargedecay == "n"){ - chargedecay = parseInt(chargecurrent); - } - else if(chargedecay == "-n"){ - chargedecay = parseInt(0 - chargecurrent); - } + if (chargecurrent > 0){ + + if (parseInt(values.ChargeDecayPause) == 0) { + if(chargedecay == "n"){ + chargedecay = parseInt(chargecurrent); + } + else if(chargedecay == "-n"){ + chargedecay = parseInt(0 - chargecurrent); + } - if(values[`${id}_chargeDecayMode`] == "+"){ - chargenew += parseInt(chargecurrent) + parseInt(chargedecay); - } - else if(values[`${id}_chargeDecayMode`] == "x"){ - chargenew += parseInt(parseInt(chargecurrent) * parseFloat(chargedecay)); - } - else if(values[`${id}_chargeDecayMode`] == "="){ - chargenew += parseInt(chargedecay); + if(values[`${id}_chargeDecayMode`] == "+"){ + chargenew += parseInt(chargecurrent) + parseInt(chargedecay); + } + else if(values[`${id}_chargeDecayMode`] == "x"){ + chargenew += parseInt(parseInt(chargecurrent) * parseFloat(chargedecay)); + } + else if(values[`${id}_chargeDecayMode`] == "="){ + chargenew += parseInt(chargedecay); + } + } + autoScriptOverrideList.Charge = [chargenew, chargecurrent]; } - autoScriptOverrideList.Charge = [chargenew, chargecurrent]; } @@ -12250,18 +12288,35 @@

Edit Mode Password

AutoScriptMain("", "Round start", "true", "true", {...autoScriptOverrideList, targetmode: "false"}); output = { + ...output, "thisRoundSpeed":nextRoundSpeed, "nextRoundSpeed":0, "isFirstRound":"false", "baseActNum":"0", + "Bleed":bleednew, "Burn": burnnew, "Smoke":smokenew, "Charge": chargenew + } + + /*output = { ...output, "thisRoundSpeed":nextRoundSpeed, "nextRoundSpeed":0, "isFirstRound":"false", "baseActNum":"0", "Bleed":bleednew, "BleedNextTurn":"0", "Burn": burnnew, "BurnNextTurn":"0", "Paralysis": paralysisnew, "ParalysisNextTurn":"0", "Protection": protectionnew, "ProtectionNextTurn":"0", "StaggerProtection": staggerprotectionnew, "StaggerProtectionNextTurn":"0", "Fragile": fragilenew, "FragileNextTurn":"0", "Strength": strengthnew, "StrengthNextTurn":"0", "Feeble": feeblenew, "FeebleNextTurn":"0", "Endurance": endurancenew, "EnduranceNextTurn":"0", "Disarm": disarmnew, "DisarmNextTurn":"0", "Haste": hastenew, "HasteNextTurn":"0", "Bind": bindnew, "BindNextTurn":"0", "Smoke": smokenew, "SmokeNextTurn":"0", "Charge":chargenew, "ChargeNextTurn":"0", "Fortune":fortunenew, "FortuneNextTurn":"0" - } + }*/ + + ailmentNames.forEach(ailment => { + /* If decay pause is active, keep current count and decrease the pause count by 1 */ + if (parseInt(values[`${ailment}DecayPause`]) > 0 && ailment != "Bleed") { + output[`${ailment}`] = parseInt(values[`${ailment}`]); + output[`${ailment}DecayPause`] = parseInt(values[`${ailment}DecayPause`]) - 1; + } + + /* Add NextTurn count */ + if (output[`${ailment}`] != undefined) { output[`${ailment}`] += parseInt(values[`${ailment}NextTurn`]); } + else { output[`${ailment}`] = parseInt(values[`${ailment}NextTurn`]); } + output[`${ailment}NextTurn`] = 0; + }); - setAttrs(output); setAttrs(output); }); }); -}); +} function updateAdvantages(changeval){ @@ -12332,9 +12387,12 @@

Edit Mode Password

getSectionIDs(`repeating_global`, idarray => { let id = `repeating_global_${idarray[0]}`; -getAttrs(["Bleed", "bleedResist", "bleedResist_ego", "distortState", "egoActiveState", "egoType", "HP", "settingBleedImmune", "settingWhisperRolls", "settingWhisperTarget", "settingMuteMessage", "settingLimbusStyle", "character_name", `${id}_bleedDecayMode`, `${id}_bleedDecayVal`], function(values) { +getAttrs(["Bleed", "BleedDecayPause", "bleedResist", "bleedResist_ego", "distortState", "egoActiveState", "egoType", "HP", + "settingBleedImmune", "settingWhisperRolls", "settingWhisperTarget", "settingMuteMessage", "settingLimbusStyle", "character_name", `${id}_bleedDecayMode`, `${id}_bleedDecayVal`], function(values) { + let bleednew = "0"; let bleedcurrent = values.Bleed; + let bleeddecaypause = parseInt(values.BleedDecayPause); let bleeddecay = values[`${id}_bleedDecayVal`]; let bleeddamage = 0; let bleedresult = parseInt(values.HP); @@ -12357,6 +12415,11 @@

Edit Mode Password

bleedresist = parseInt(values.bleedResist) + parseInt(values.bleedResist_ego); } + if (bleeddecaypause > 0) { + mode = "damage"; + setAttrs({"BleedDecayPause":bleeddecaypause - 1}); + } + /* Translation prep */ let langBleed = " bled for "; let langDamage = " damage."; @@ -15427,13 +15490,14 @@

Edit Mode Password

let conditionalButtonList = {}; let conditionalButtonSilent = ""; let errorMessageList = {}; - + let stylingList = parseAutoScriptStyling(values.autoScriptStyling); - + let output = {}; let tempOutput = {}; let returnValues = { checkResult:"success", error:false }; let challengeRollList = {}; + let procAilmentList = {}; let message = ""; let messageValues = {}; @@ -15521,6 +15585,8 @@

Edit Mode Password

case "DiceCount": tempOutput = autoEffectDice(AutoEffect[0], scaling); break; case "BaseDamage": tempOutput = autoEffectDamage(AutoEffect[0], barList, scaling); break; case "FlatDamage": tempOutput = autoEffectDamage(AutoEffect[0], barList, scaling); break; + case "Proc": tempOutput = autoEffectProc(AutoEffect[0], ailmentList, scaling, settingLimbusStyle); break; + case "Pause": tempOutput = autoEffectPause(AutoEffect[0], ailmentList, scaling, settingLimbusStyle); break; case "ChallengeRoll": tempOutput = autoEffectChallengeRoll(AutoEffect[0], scaling); break; case "Speed": tempOutput = autoEffectSpeed(AutoEffect[0], scaling, thisRoundSpeed, nextRoundSpeed); break; default: tempOutput = autoEffectErrorMessage("Invalid AutoEffect", `${AutoEffect[0][0].replace("Unknown: ","")} is not a valid AutoEffect`, AutoEffect[0]); break; @@ -15645,6 +15711,14 @@

Edit Mode Password

delete tempOutput.challengeRollDifficulty; } + /* Handle proc ailment */ + if (tempOutput.procAilment != undefined) { + if (procAilmentList[tempOutput.procAilment] != undefined) { + procAilmentList[tempOutput.procAilment] += 1; + } else { procAilmentList[tempOutput.procAilment] = 1; } + delete tempOutput.procAilment; + } + /* Handle message */ if (tempOutput.message != undefined) { /* Translate output message. Targets are still written in English */ @@ -15715,6 +15789,18 @@

Edit Mode Password

/* Checks if any checks failed and the button should not be displayed */ rollChallenge(statName, rollDifficulty, "false"); } + + /* Execute proc effects */ + for (const [ailmentName, procCount] of Object.entries(procAilmentList)) { + for (let i = 0; i < procCount; i++) { + if (ailmentName[0] == "-") { /* If custom ailment */ + updateCustomAilment(ailmentName); + } else { /* If standard ailment */ + updateAilments([ailmentName]); + } + } + } + /* Message handling */ /* Standard messages print as a generic "AutoEffects" section and include all unconditional effects */ @@ -15920,9 +16006,10 @@

Edit Mode Password

switch (AutoScript[i][0][0]) { case "Reset": case "CustomMessage": case "DicePower": case "DiceMax": case "DiceCount": case "BaseDamage": break; case "Require": case "Consume": AutoScript[i][0][2] = getAilmentOrBarFromTranslation(AutoScript[i][0][2]); break; - case "Gain": case "Inflict": case "Give": AutoScript[i][0][2] = getAilmentFromTranslation(AutoScript[i][0][2]); break; + case "Gain": case "Inflict": case "Give": case "Pause": AutoScript[i][0][2] = getAilmentFromTranslation(AutoScript[i][0][2]); break; case "Set": case "Add": case "Multi": case "FlatDamage": AutoScript[i][0][2] = getBarFromTranslation(AutoScript[i][0][2]); break; case "ChallengeRoll": AutoScript[i][0][1] = getStatFromTranslation(AutoScript[i][0][1]); break; + case "Proc": AutoScript[i][0][1] = getAilmentFromTranslation(AutoScript[i][0][1]); break; default: console.log("Translation error with AutoEffect name " + AutoScript[i][0][0]) } @@ -16753,6 +16840,88 @@

Edit Mode Password

} return returnValues; } + +function autoEffectProc(AutoEffect, ailmentList, scaling, settingLimbusStyle) { + let returnValues = {}; + + /* Check format */ + if (AutoEffect.length < 2 || AutoEffect.length > 3) { return autoEffectErrorMessage("Format Error", `Expected format: (Proc #Ailment #Silent(optional))`, AutoEffect); } + if (AutoEffect.length > 2) { if (AutoEffect[2].toLowerCase() != "silent") { return autoEffectErrorMessage("Invalid Option", `Option "${AutoEffect[2]}" is not a valid option`, AutoEffect); } } + + /* Handle scaling */ + if (scaling == 0) { return {}; } + + /* Get ailment name or id */ + let effectAilment = AutoEffect[1]; + let effectRepeatingId = ailmentList[effectAilment][4]; + if (!ailmentList.hasOwnProperty(effectAilment)) { return autoEffectErrorMessage("Invalid Target", `Ailment "${effectAilment}" does not exist`, AutoEffect); } + + /* Get target and proc ailment */ + let effectTarget = ""; + if (effectRepeatingId == 0) { effectTarget = effectAilment; } /* If standard ailment */ + else { effectTarget = effectRepeatingId; } /* If custom ailment */ + returnValues.procAilment = effectTarget; + + /* Handle message */ + let message = ""; + let messageValues = {}; + let messageFormat = getTranslationByKeyCustom("[/TARGET] Proc [TARGET]", "autoeffect-format-proc"); + let effectIcon = ailmentList[effectAilment][5]; + + if (!AutoEffect.some(option => (/(silent)/ig).test(option))) { + message = autoEffectMessage(messageFormat, effectAilment, 0, 0, 1, "success", settingLimbusStyle, effectIcon); + } + messageValues = { effectTarget: effectAilment, effectIcon: effectIcon, effectVal: 0, effectCount: 0, scaling: 1, checkResult: "success", settingLimbusStyle: settingLimbusStyle } + + return {...returnValues, message: message, messageValues: messageValues }; +} + +function autoEffectPause(AutoEffect, ailmentList, scaling, settingLimbusStyle) { + let returnValues = {}; + + /* Check format */ + if (AutoEffect.length < 3 || AutoEffect.length > 4) { return autoEffectErrorMessage("Format Error", `Expected format: (Pause N #Ailment #Silent(optional))`, AutoEffect); } + if (AutoEffect.length > 3) { if (AutoEffect[3].toLowerCase() != "silent") { return autoEffectErrorMessage("Invalid Option", `Option "${AutoEffect[3]}" is not a valid option`, AutoEffect); } } + + /* Handle scaling */ + AutoEffect[1] *= scaling; + if (scaling == 0) { return {}; } + + /* Get ailment name */ + let effectAilment = AutoEffect[2]; + if (!ailmentList.hasOwnProperty(effectAilment)) { return autoEffectErrorMessage("Invalid Target", `Ailment "${effectAilment}" does not exist`, AutoEffect); } + + /* Get values */ + let effectVal = parseInt(Math.abs(AutoEffect[1])); + if (isNaN(effectVal) == true) { return autoEffectErrorMessage("Invalid Value", `Value "${AutoEffect[1]}" is not a number`, AutoEffect); } + let count = 0; + + /* Get target attribute */ + let effectTarget = ""; + let effectRepeatingId = ailmentList[effectAilment][4]; + let effectHasNextTurn = ailmentList[effectAilment][0]; + if (effectRepeatingId == 0) { effectTarget = `${effectAilment}DecayPause`; } /* If standard ailment */ + else { effectTarget = `repeating_ailments_${ailmentList[effectAilment][4]}_ailDecayPause`; } /* If custom ailment */ + + /* Handle message */ + let message = ""; + let messageValues = {}; + let messageFormat = getTranslationByKeyCustom("[/TARGET] Paused [TARGET] for [SCALING NUM] activations", "autoeffect-format-pause"); + let effectIcon = ailmentList[effectAilment][5]; + + if (!AutoEffect.some(option => (/(silent)/ig).test(option))) { + message = autoEffectMessage(messageFormat, effectAilment, effectVal/scaling, count, scaling, "success", settingLimbusStyle, effectIcon); + } + messageValues = { effectTarget: effectAilment, effectIcon: effectIcon, effectVal: effectVal/scaling, effectCount: count, scaling: scaling, checkResult: "success", settingLimbusStyle: settingLimbusStyle } + + /* Execute AutoEffect */ + returnValues = { [effectTarget]: parseInt(effectVal), count: parseInt(count), message: message, messageValues: messageValues } + + return returnValues; +} + + + /*--- AutoEffect functions end ---*/ @@ -17391,7 +17560,14 @@

Edit Mode Password

/* effect - Triggers only effect */ function updateCustomAilment(rowid, mode="standard", roundEnd="true", callback=() => {}) { - getAttrs(["distortState", "egoActiveState", "egoType", `repeating_ailments_${rowid}_ailNum`, `repeating_ailments_${rowid}_ailNumNextTurn`, `repeating_ailments_${rowid}_ailName`, `repeating_ailments_${rowid}_ailIcon`, `repeating_ailments_${rowid}_ailTrigger`, `repeating_ailments_${rowid}_ailEffect`, `repeating_ailments_${rowid}_ailEffectMode`, `repeating_ailments_${rowid}_ailEffectVal`, `repeating_ailments_${rowid}_ailDecayWhenHit`, `repeating_ailments_${rowid}_ailCustomResistanceNum`, `repeating_ailments_${rowid}_ailCustomResistanceNumEgo`, `repeating_ailments_${rowid}_ailDecayRoundEnd`, `repeating_ailments_${rowid}_ailDecayMode`, `repeating_ailments_${rowid}_ailDecayVal`, `repeating_ailments_${rowid}_ailDecayMin`, `repeating_ailments_${rowid}_ailMax`, `repeating_ailments_${rowid}_ailMaxBehavior`, `repeating_ailments_${rowid}_ailMessageCheck`, `repeating_ailments_${rowid}_ailMessage`, "HP", "StagRes", "SP", "Light", "distortCounter", "difficulty", "baseSpeed", "baseLuckNum", "settingWhisperRolls", "settingWhisperTarget", "settingMuteMessage", "character_name"], function(values) { + getAttrs(["distortState", "egoActiveState", "egoType", "settingWhisperRolls", "settingWhisperTarget", "settingMuteMessage", + `repeating_ailments_${rowid}_ailNum`, `repeating_ailments_${rowid}_ailNumNextTurn`, `repeating_ailments_${rowid}_ailDecayPause`, `repeating_ailments_${rowid}_ailName`, + `repeating_ailments_${rowid}_ailIcon`, `repeating_ailments_${rowid}_ailTrigger`, `repeating_ailments_${rowid}_ailEffect`, `repeating_ailments_${rowid}_ailEffectMode`, + `repeating_ailments_${rowid}_ailEffectVal`, `repeating_ailments_${rowid}_ailDecayWhenHit`, `repeating_ailments_${rowid}_ailCustomResistanceNum`, + `repeating_ailments_${rowid}_ailCustomResistanceNumEgo`, `repeating_ailments_${rowid}_ailDecayRoundEnd`, `repeating_ailments_${rowid}_ailDecayMode`, + `repeating_ailments_${rowid}_ailDecayVal`, `repeating_ailments_${rowid}_ailDecayMin`, `repeating_ailments_${rowid}_ailMax`, `repeating_ailments_${rowid}_ailMaxBehavior`, + `repeating_ailments_${rowid}_ailMessageCheck`, `repeating_ailments_${rowid}_ailMessage`, + "HP", "StagRes", "SP", "Light", "distortCounter", "difficulty", "baseSpeed", "baseLuckNum", "character_name"], function(values) { let charname = values.character_name; let nomessage = values.settingMuteMessage; @@ -17417,10 +17593,18 @@

Edit Mode Password

let effectval = values[`repeating_ailments_${rowid}_ailEffectVal`]; let decayRoundEnd = values[`repeating_ailments_${rowid}_ailDecayRoundEnd`]; + let decaypause = parseInt(values[`repeating_ailments_${rowid}_ailDecayPause`]); let decaymode = values[`repeating_ailments_${rowid}_ailDecayMode`]; let decayval = values[`repeating_ailments_${rowid}_ailDecayVal`]; let decaymin = parseInt(values[`repeating_ailments_${rowid}_ailDecayMin`]); + if (decaypause > 0) { + if (trigger != "OnAction" || (trigger == "OnAction" && mode == "standard")) { + mode = "effect"; + setAttrs({[`repeating_ailments_${rowid}_ailDecayPause`]:decaypause - 1}); + } + } + let maxcount = parseInt(values[`repeating_ailments_${rowid}_ailMax`]); let maxtype = values[`repeating_ailments_${rowid}_ailMaxBehavior`]; @@ -17960,7 +18144,7 @@

Edit Mode Password

let settingHideNextTurn = values.settingHideNextTurn; const HasNextTurn = settingHideNextTurn == "true" ? 'false' : 'true'; - let ailmentNames = ["Burn", "Bleed", "Paralysis", "Protection", "StaggerProtection", "Fragile", "Strength", "Feeble", "Endurance", "Disarm", "Haste", "Bind", "Smoke", "Charge", "Fortune"] + let ailmentNames = ["Burn", "Bleed", "Paralysis", "Protection", "StaggerProtection", "Fragile", "Strength", "Feeble", "Endurance", "Disarm", "Haste", "Bind", "Smoke", "Charge", "Fortune"]; ailmentNames.forEach(ailment => { if (["Burn", "Bleed", "Smoke", "Charge"].includes(ailment)) { let ailmentNextTurnSetting = settingHideNextTurn == "true" ? "false" : values[ailment.toLowerCase()+"NextTurnSetting"]; @@ -18034,6 +18218,8 @@

Edit Mode Password

if (getTranslationByKey("autoeffect-dicemax") == autoEffect) { return "DiceMax"; } if (getTranslationByKey("autoeffect-dicecount") == autoEffect) { return "DiceCount"; } if (getTranslationByKey("autoeffect-challengeroll") == autoEffect) { return "ChallengeRoll"; } + if (getTranslationByKey("autoeffect-proc") == autoEffect) { return "Proc"; } + if (getTranslationByKey("autoeffect-pause") == autoEffect) { return "Pause"; } if (getTranslationByKey("autoeffect-speed") == autoEffect) { return "Speed"; } return "Unknown: " + autoEffect; } diff --git a/ProjectMoonTRPG/translation.json b/ProjectMoonTRPG/translation.json index 62562c653a3..e30cf27a2f5 100644 --- a/ProjectMoonTRPG/translation.json +++ b/ProjectMoonTRPG/translation.json @@ -298,6 +298,8 @@ "autoeffect-dicemax": "DiceMax", "autoeffect-dicecount": "DiceCount", "autoeffect-challengeroll": "ChallengeRoll", + "autoeffect-proc":"Proc", + "autoeffect-pause":"Pause", "autoeffect-speed": "Speed", "autoeffect-format-require": "Require [SCALING NUM] [TARGET]: [CHECK]", "autoeffect-format-consume": "Consume [-SCALING NUM] [TARGET]: [CHECK]", @@ -317,6 +319,8 @@ "autoeffect-format-dice-neg": "Reduce [TARGET] by [SCALING NUM]", "autoeffect-format-challengeroll": "Rolling [TARGET] +[SCALING NUM]", "autoeffect-format-challengeroll-neg": "Rolling [TARGET] [SCALING NUM]", + "autoeffect-format-proc":"[/TARGET] Proc [TARGET]", + "autoeffect-format-pause":"[/TARGET] Paused [TARGET] for [SCALING NUM] activations", "autoeffect-format-speed": "Increase [TARGET] by [SCALING NUM]", "autoeffect-format-speed-neg": "Reduce [TARGET] by [SCALING NUM]", "autoeffect-match-check": "[CHECK]", From 6c9d433bca7a2ff40975022a209e770e7d62c7f0 Mon Sep 17 00:00:00 2001 From: BeautiDemise Date: Tue, 27 Aug 2024 13:04:02 +0200 Subject: [PATCH 33/34] Feature: Ego skills now requires an active ego/distortion for AutoScript triggers to be collected --- ProjectMoonTRPG/ProjectMoonTRPG.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ProjectMoonTRPG/ProjectMoonTRPG.html b/ProjectMoonTRPG/ProjectMoonTRPG.html index 64ee9126286..98d13cf409d 100644 --- a/ProjectMoonTRPG/ProjectMoonTRPG.html +++ b/ProjectMoonTRPG/ProjectMoonTRPG.html @@ -15407,7 +15407,7 @@

Edit Mode Password

} } - let autoScriptList = ["weapon1", "weapon2", "weapon3", "weapon4", "augment", "outfit", "tool1", "tool2", "tool3", "tool4", "special1", "special2", + let autoScriptList = ["weapon1", "weapon2", "weapon3", "weapon4", "augment", "outfit", "ego", "tool1", "tool2", "tool3", "tool4", "special1", "special2", "skill1", "skill2", "skill3", "skill4", "skill5", "skill6", "egoSkill1", "egoSkill2", "egoSkill3", "egoSkill4", "egoSkill5", "egoSkill6"]; autoScriptList = autoScriptList.map(prefix => prefix + "AutoScript"); @@ -15415,8 +15415,9 @@

Edit Mode Password

let collectedAutoScripts = ""; autoScriptList.forEach(autoScript => { + /* Finds all substrings that begin with "[#" and end with "#]" */ - if (autoScript == "egoAutoScript" && !(values.distortState == "true" || values.egoActiveState == "true")) { + if (autoScript.includes("ego") && !(values.distortState == "true" || values.egoActiveState == "true")) { return; } if ((/\[([#][^]+[#])\]/g).test(values[`${autoScript}`])) { From d5f58ad24df798e54daf9f2a49e98f8a750c2fb4 Mon Sep 17 00:00:00 2001 From: BeautiDemise Date: Tue, 27 Aug 2024 13:04:25 +0200 Subject: [PATCH 34/34] Feature: Added target option to Proc and Pause --- ProjectMoonTRPG/ProjectMoonTRPG.html | 70 ++++++++++++++++------------ 1 file changed, 41 insertions(+), 29 deletions(-) diff --git a/ProjectMoonTRPG/ProjectMoonTRPG.html b/ProjectMoonTRPG/ProjectMoonTRPG.html index 98d13cf409d..15de7af791a 100644 --- a/ProjectMoonTRPG/ProjectMoonTRPG.html +++ b/ProjectMoonTRPG/ProjectMoonTRPG.html @@ -15801,7 +15801,6 @@

Edit Mode Password

} } } - /* Message handling */ /* Standard messages print as a generic "AutoEffects" section and include all unconditional effects */ @@ -16846,8 +16845,8 @@

Edit Mode Password

let returnValues = {}; /* Check format */ - if (AutoEffect.length < 2 || AutoEffect.length > 3) { return autoEffectErrorMessage("Format Error", `Expected format: (Proc #Ailment #Silent(optional))`, AutoEffect); } - if (AutoEffect.length > 2) { if (AutoEffect[2].toLowerCase() != "silent") { return autoEffectErrorMessage("Invalid Option", `Option "${AutoEffect[2]}" is not a valid option`, AutoEffect); } } + if (AutoEffect.length < 2 || AutoEffect.length > 4) { return autoEffectErrorMessage("Format Error", `Expected format: (Proc #Ailment #Target(optional) #Silent(optional))`, AutoEffect); } + if (AutoEffect.length > 2) { AutoEffect.slice(2).forEach(option => { if (!(["silent", "target"].includes(option.toLowerCase()))) { returnValues = autoEffectErrorMessage("Invalid Option", `Option "${option}" is not a valid option`, AutoEffect); } }); } /* Handle scaling */ if (scaling == 0) { return {}; } @@ -16857,32 +16856,39 @@

Edit Mode Password

let effectRepeatingId = ailmentList[effectAilment][4]; if (!ailmentList.hasOwnProperty(effectAilment)) { return autoEffectErrorMessage("Invalid Target", `Ailment "${effectAilment}" does not exist`, AutoEffect); } - /* Get target and proc ailment */ + /* Get target */ let effectTarget = ""; if (effectRepeatingId == 0) { effectTarget = effectAilment; } /* If standard ailment */ else { effectTarget = effectRepeatingId; } /* If custom ailment */ - returnValues.procAilment = effectTarget; - - /* Handle message */ - let message = ""; - let messageValues = {}; - let messageFormat = getTranslationByKeyCustom("[/TARGET] Proc [TARGET]", "autoeffect-format-proc"); - let effectIcon = ailmentList[effectAilment][5]; - if (!AutoEffect.some(option => (/(silent)/ig).test(option))) { - message = autoEffectMessage(messageFormat, effectAilment, 0, 0, 1, "success", settingLimbusStyle, effectIcon); + /* Handle the target option */ + if (AutoEffect.some(option => (/(target)/ig).test(option))) { + returnValues = {...returnValues, "autoInflict": autoEffectToString(AutoEffect.slice(0, 2)) } + } else { + returnValues.procAilment = effectTarget; + + /* Handle message */ + let message = ""; + let messageValues = {}; + let messageFormat = getTranslationByKeyCustom("[/TARGET] Proc [TARGET]", "autoeffect-format-proc"); + let effectIcon = ailmentList[effectAilment][5]; + + if (!AutoEffect.some(option => (/(silent)/ig).test(option))) { + message = autoEffectMessage(messageFormat, effectAilment, 0, 0, 1, "success", settingLimbusStyle, effectIcon); + } + messageValues = { effectTarget: effectAilment, effectIcon: effectIcon, effectVal: 0, effectCount: 0, scaling: 1, checkResult: "success", settingLimbusStyle: settingLimbusStyle } + returnValues = {...returnValues, message: message, messageValues: messageValues } } - messageValues = { effectTarget: effectAilment, effectIcon: effectIcon, effectVal: 0, effectCount: 0, scaling: 1, checkResult: "success", settingLimbusStyle: settingLimbusStyle } - return {...returnValues, message: message, messageValues: messageValues }; + return returnValues; } function autoEffectPause(AutoEffect, ailmentList, scaling, settingLimbusStyle) { let returnValues = {}; /* Check format */ - if (AutoEffect.length < 3 || AutoEffect.length > 4) { return autoEffectErrorMessage("Format Error", `Expected format: (Pause N #Ailment #Silent(optional))`, AutoEffect); } - if (AutoEffect.length > 3) { if (AutoEffect[3].toLowerCase() != "silent") { return autoEffectErrorMessage("Invalid Option", `Option "${AutoEffect[3]}" is not a valid option`, AutoEffect); } } + if (AutoEffect.length < 3 || AutoEffect.length > 5) { return autoEffectErrorMessage("Format Error", `Expected format: (Pause N #Ailment #Target(optional) #Silent(optional))`, AutoEffect); } + if (AutoEffect.length > 3) { AutoEffect.slice(3).forEach(option => { if (!(["silent", "target"].includes(option.toLowerCase()))) { returnValues = autoEffectErrorMessage("Invalid Option", `Option "${option}" is not a valid option`, AutoEffect); } }); } /* Handle scaling */ AutoEffect[1] *= scaling; @@ -16904,19 +16910,25 @@

Edit Mode Password

if (effectRepeatingId == 0) { effectTarget = `${effectAilment}DecayPause`; } /* If standard ailment */ else { effectTarget = `repeating_ailments_${ailmentList[effectAilment][4]}_ailDecayPause`; } /* If custom ailment */ - /* Handle message */ - let message = ""; - let messageValues = {}; - let messageFormat = getTranslationByKeyCustom("[/TARGET] Paused [TARGET] for [SCALING NUM] activations", "autoeffect-format-pause"); - let effectIcon = ailmentList[effectAilment][5]; + /* Handle the target option */ + if (AutoEffect.some(option => (/(target)/ig).test(option))) { + returnValues = {...returnValues, "autoInflict": autoEffectToString(AutoEffect.slice(0, 3)) } + } else { - if (!AutoEffect.some(option => (/(silent)/ig).test(option))) { - message = autoEffectMessage(messageFormat, effectAilment, effectVal/scaling, count, scaling, "success", settingLimbusStyle, effectIcon); + /* Handle message */ + let message = ""; + let messageValues = {}; + let messageFormat = getTranslationByKeyCustom("[/TARGET] Paused [TARGET] for [SCALING NUM] activations", "autoeffect-format-pause"); + let effectIcon = ailmentList[effectAilment][5]; + + if (!AutoEffect.some(option => (/(silent)/ig).test(option))) { + message = autoEffectMessage(messageFormat, effectAilment, effectVal/scaling, count, scaling, "success", settingLimbusStyle, effectIcon); + } + messageValues = { effectTarget: effectAilment, effectIcon: effectIcon, effectVal: effectVal/scaling, effectCount: count, scaling: scaling, checkResult: "success", settingLimbusStyle: settingLimbusStyle } + + /* Execute AutoEffect */ + returnValues = { [effectTarget]: parseInt(effectVal), count: parseInt(count), message: message, messageValues: messageValues } } - messageValues = { effectTarget: effectAilment, effectIcon: effectIcon, effectVal: effectVal/scaling, effectCount: count, scaling: scaling, checkResult: "success", settingLimbusStyle: settingLimbusStyle } - - /* Execute AutoEffect */ - returnValues = { [effectTarget]: parseInt(effectVal), count: parseInt(count), message: message, messageValues: messageValues } return returnValues; } @@ -18057,7 +18069,7 @@

Edit Mode Password

/* There used to be a bug that replaced one AutoScript with the default AutoScript styling rules. This cleans up any sheets affected by the bug */ /* Should be able to remove this after a few updates have passed and all currently used character sheets have been cleaned (added in update 0.6.3) */ let colorList = ["green","blue","red","orange","yellow","purple","black"]; - let autoScriptList = ["weapon1", "weapon2", "weapon3", "weapon4", "augment", "outfit", "tool1", "tool2", "tool3", "tool4", "special1", "special2", + let autoScriptList = ["weapon1", "weapon2", "weapon3", "weapon4", "augment", "outfit", "ego", "tool1", "tool2", "tool3", "tool4", "special1", "special2", "skill1", "skill2", "skill3", "skill4", "skill5", "skill6", "egoSkill1", "egoSkill2", "egoSkill3", "egoSkill4", "egoSkill5", "egoSkill6", "autoScriptEditorInput"];