Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Star Wars Saga Edition] Minor bugfixes, formatting changes #12029

Merged
merged 3 commits into from Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 29 additions & 1 deletion Star Wars Saga Edition/StarWarsSagaEdition.css
Expand Up @@ -10,7 +10,7 @@
--sheet-text: #000;
--input-border: #222;
--input-border-top: #ccc;
--input-disabled-bg:#e7e7e7;
--input-disabled-bg:#e3e3e3;
--input-disabled-border:#444;
--input-disabled-border-top:#999;
--header-bg: #000;
Expand Down Expand Up @@ -89,6 +89,13 @@
background-color: var(--input-disabled-bg);
outline: none;
}
.charsheet input[disabled]::-webkit-outer-spin-button,
.charsheet input[disabled]::-webkit-inner-spin-button,
.charsheet input[readonly]::-webkit-outer-spin-button,
.charsheet input[readonly]::-webkit-inner-spin-button {
/* This is necessary for Chrome, since the spin buttons still take up space in disabled input boxes, even while invisible. */
display:none;
}

.charsheet input.header {
width: 100%;
Expand Down Expand Up @@ -554,6 +561,7 @@
/* Dark mode colors*/
--dm-input-bg: #3f3f50;
--dm-input-text: #f5f5f5;
--dm-placeholder-text: #a1a1a9;
--dm-scrollbar1-thumb: #5c5c84;
--dm-scrollbar1-shaft: #2e2e40;
--dm-scrollbar2-thumb: #1e1e44;
Expand Down Expand Up @@ -606,6 +614,16 @@
border-top-color: var(--dm-input-border-top);
}

.sheet-darkmode .charsheet input::placeholder,
.sheet-darkmode .charsheet textarea::placeholder {
color: var(--dm-placeholder-text);
}

.sheet-darkmode .charsheet input::-moz-placeholder,
.sheet-darkmode .charsheet textarea::-moz-placeholder {
color: var(--dark-primarytext);
}

.sheet-darkmode .charsheet input[type=radio],
.sheet-darkmode .charsheet input[type=checkbox] {
accent-color: var(--dm-checkbox-accent);
Expand Down Expand Up @@ -643,6 +661,7 @@
box-shadow: 0 1px 0 var(--dm-persistent-checked-inset) inset;
border: 1px solid var(--dm-persistent-checked-border);
}

/* This doesn't work right now, but hopefully it can be fixed eventually. */
/*.sheet-darkmode .charsheet input::part(-webkit-outer-spin-button):hover,
.sheet-darkmode .charsheet input[type=number]::part(-webkit-outer-spin-button) {
Expand Down Expand Up @@ -917,6 +936,15 @@
/* This uses the default Roll20 color variable to prevent colored rectangles from poking through in the rounded corners. */
}

.sheet-rolltemplate-sagadefault.sheet-rolltemplate-darkmode table,
.sheet-rolltemplate-attack.sheet-rolltemplate-darkmode table,
.sheet-rolltemplate-skill.sheet-rolltemplate-darkmode table,
.sheet-rolltemplate-second-wind.sheet-rolltemplate-darkmode table,
.sheet-rolltemplate-statBlock.sheet-rolltemplate-darkmode table,
.sheet-rolltemplate-Status.sheet-rolltemplate-darkmode table {
background-color: transparent;
}

.sheet-rolltemplate-sagadefault.sheet-rolltemplate-darkmode th,
.sheet-rolltemplate-attack.sheet-rolltemplate-darkmode th,
.sheet-rolltemplate-skill.sheet-rolltemplate-darkmode th,
Expand Down
80 changes: 51 additions & 29 deletions Star Wars Saga Edition/StarWarsSagaEdition.html
Expand Up @@ -121,7 +121,7 @@
<td></td>
</tr>
<tr> <td colspan="4"><div class="sheet-textHead" style="margin-top:2px"><span data-i18n="second-wind">Second Wind</span></div> </td> </tr>
<tr><th colspan="2"><span class="sheet-small" ><input type="checkbox" value="1" name="attr_IsDroid" title="To ensure the droids always take 1/4 HP as second wind. @{IsDroid}" /><span data-i18n="is_droid" class="not-show"> Is droid?</span></th> <th><span data-i18n="current">Current</span></th> <th><span data-i18n="total">Total</span></th>
<tr><th colspan="2"><span class="sheet-small" ><input type="checkbox" value="1" name="attr_IsDroid" title="To ensure the droids always take 1/4 HP as second wind. @{IsDroid}" />&nbsp;<span data-i18n="is_droid" class="not-show">Is droid?</span></th> <th><span data-i18n="current">Current</span></th> <th><span data-i18n="total">Total</span></th>
<tr>
<input type="hidden" name="attr_hidden_second_wind" value="1" />
<td><button type="action" name="act_SecondWind" title="Take second wind">Take</button></td>
Expand All @@ -144,15 +144,15 @@
</table>
<p><span data-i18n="ignore_ct">Ignore CT?</span> <input type="checkbox" value="[[@{CT}*-1]][CT Ignore]" name="attr_CTIgnoreDT" title="Does Damage Threshold ignore decrease from the Condition Track? @{CTIgnoreDT}" /></p>

<label><span data-i18n="damage_reduction">Damage Reduction</span></label>
<label><span data-i18n="damage_reduction">Damage Reduction</span>&nbsp;</label>
<input type="checkbox" class="DRShow sheet-hideCheckbox" style="width:130px; margin-left:-148px; height:20px; margin-top: -1px;" value="1" name="attr_DR-Show" title="Show/Hide Damage Reduction" />
<span class="DRBody not-show"><input type="number" name="attr_DR" placeholder="0" value="" title="Damage Reduction @{DR}" /></span>
<br />
<label><span data-i18n="shield_rating">Shield Rating</span></label>
<label><span data-i18n="shield_rating">Shield Rating</span>&nbsp;</label>
<input type="checkbox" class="SRShow sheet-hideCheckbox" style="width:93px; margin-left:-111px; height:20px; margin-top: -3px;" value="1" name="attr_SR-Show" title="Show/Hide Shield Rating" />
<span class="not-show SRBody"><input type="number" name="attr_SR" placeholder="0" value="" title="Current Shield Rating @{SR}" /> / <input type="number" name="attr_SR_max" placeholder="0" value="" title="Max Shield Rating @{SR|max}" /></span>
<br />
<label><span data-i18n="immune">Immune</span></label>
<label><span data-i18n="immune">Immune</span>&nbsp;</label>
<input type="checkbox" class="immuneShow sheet-hideCheckbox" style="width:57px; margin-left:-75px; height:20px; margin-top: -3px;" value="1" name="attr_immune-Show" title="Show/Hide Immunities" />
<span class="not-show immuneBody"><input type="text" name="attr_Immune" value="" title="Immunities @{Immune}" style="width:75%" /> </span>
<span/>
Expand Down Expand Up @@ -206,7 +206,7 @@
<div class="sheet-table-row">
<span class="sheet-table-data">
<button type="roll" name="roll_InitiativeTurn" value="&{template:skill} {{name=Rolling for Turn Order}} {{skill=[[1d20+@{Initiative}+@{InitiativeDecimal}[Initiative Decimal]+?{Other Modifiers|0}[Other] &{tracker}]]}} {{notes=@{Initiative|max}}}" title="Roll Initiative to Turn Order window %{InitiativeTurn}" ></button>
<label><span data-i18n="initiative">Initiative</span></label> <span class="sheet-small" style="margin-left:10px;"><input type="checkbox" value="[[0.01 * (@{Initiative})]]" name="attr_InitiativeDecimal" title="Add Initiative Modifier to roll as a decimal for easier sorting @{InitiativeDecimal}" checked /><span data-i18n="init_decimal" class="not-show"> &nbsp;Initiative as Decimal</span></span>
<label><span data-i18n="initiative">Initiative</span></label> <span class="sheet-small" style="margin-left:10px;"><input type="checkbox" value="[[0.01 * (@{Initiative})]]" name="attr_InitiativeDecimal" title="Add Initiative Modifier to roll as a decimal for easier sorting @{InitiativeDecimal}" checked />&nbsp;<span data-i18n="init_decimal" class="not-show">Initiative as Decimal</span></span>
</span>
</div>
<div class="sheet-table-row">
Expand Down Expand Up @@ -2066,7 +2066,7 @@
</table>
</div>
<div class="sheet-col">
<table>
<table style="magin-bottom:2px;">
<tr>
<td colspan="4" style="padding:0px 2px 0px 0px"><div class="sheet-textHead"><span data-i18n="force_points">Force Points</span></div></td>
<td colspan="2" style="padding:0px 0px 0px 3px"><div class="sheet-textHead"><span data-i18n="destiny_points">Destiny Pts</span></div></td>
Expand Down Expand Up @@ -2102,7 +2102,7 @@
<label data-i18n="perception">Perception </label>
<br />
<button type="roll" name="roll_InitiativeTurn" value="&{template:skill} {{name=Rolling for Turn Order}} {{skill=[[1d20+@{Initiative}+@{InitiativeDecimal}[Initiative Decimal]+?{Other Modifiers|0}[Other] &{tracker}]]}} {{notes=@{Initiative|max}}}" title="Roll Initiative to Turn Order window %{InitiativeTurn}" ></button>
<label data-i18n="initiative">Initiative</label> <span class="sheet-small" style="margin-left:10px;"><input type="checkbox" value="[[0.01 * (@{Initiative})]]" name="attr_InitiativeDecimal" title="Add Initiative Modifier to roll as a decimal for easier sorting @{InitiativeDecimal}" checked /><span data-i18n="init_decimal" class="not-show"> Initiative as Decimal</span></span>
<label data-i18n="initiative">Initiative</label> <span class="sheet-small" style="margin-left:10px;"><input type="checkbox" value="[[0.01 * (@{Initiative})]]" name="attr_InitiativeDecimal" title="Add Initiative Modifier to roll as a decimal for easier sorting @{InitiativeDecimal}" checked />&nbsp;<span data-i18n="init_decimal" class="not-show">Initiative as Decimal</span></span>
<table>
<tr>
<td colspan="6"><div class="sheet-textHead"><span data-i18n="grapple">Grapple</span></div></td>
Expand Down Expand Up @@ -2266,10 +2266,10 @@
<span class="sheet-table-data">&nbsp;=&nbsp;</span>
<span class="sheet-table-data"><select name="attr_AcrobaticsMod" class="modtype" title="Acrobatics Mod (default DEX)">
<option value="@{str|max}" data-i18n="str">STR</option>
<option value="@{dex|max}" data-i18n="dex">DEX</option>
<option value="@{dex|max}" data-i18n="dex" selected>DEX</option>
<option value="@{con|max}" data-i18n="con">CON</option>
<option value="@{int|max}" data-i18n="int">INT</option>
<option value="@{wis|max}" data-i18n="wis" selected>WIS</option>
<option value="@{wis|max}" data-i18n="wis">WIS</option>
<option value="@{cha|max}" data-i18n="cha">CHA</option>
</select></span>
<span class="sheet-table-data sheet-skillsFeats"><input type="checkbox" value="5" name="attr_AcrobaticsFeat" title="Trained in Acrobatics?" /></span> <!-- Skill Training -->
Expand Down Expand Up @@ -2312,8 +2312,8 @@
<option value="@{dex|max}" data-i18n="dex">DEX</option>
<option value="@{con|max}" data-i18n="con">CON</option>
<option value="@{int|max}" data-i18n="int">INT</option>
<option value="@{wis|max}" data-i18n="wis" selected>WIS</option>
<option value="@{cha|max}" data-i18n="cha">CHA</option>
<option value="@{wis|max}" data-i18n="wis">WIS</option>
<option value="@{cha|max}" data-i18n="cha" selected>CHA</option>
</select></span>
<span class="sheet-table-data sheet-skillsFeats"><input type="checkbox" value="5" name="attr_DeceptionFeat" title="Trained in Deception?" /></span> <!-- Skill Training -->
<span class="sheet-table-data sheet-skillsFeats"><input type="checkbox" value="5" name="attr_DeceptionFeat_max" title="Focused in Deception?" /></span> <!-- Skill Focus -->
Expand Down Expand Up @@ -2955,9 +2955,9 @@
<option value="-1">Co-Pilot</option>
<option value="-2" selected>Gunner</option>
</select>
<input type="text" name="attr_vehicle-WeaponPosition" class="sheet-hidden" />
<input type="text" name="attr_vehicle-WeaponPosition" class="sheet-hidden" value="Gunner" />
</td>
<td colspan="2"><input type="checkbox" value="2" name="attr_vehicle-AttackBAB_max" title="This will add the +2 for trained characters using pilot-operated weapons." />Trained in Pilot?</td>
<td colspan="2"><input type="checkbox" value="2" name="attr_vehicle-AttackBAB_max" title="This will add the +2 for trained characters using pilot-operated weapons." />&nbsp;Trained in Pilot?</td>
</tr>
<tr>
<td rowspan="4" width="15px"></td>
Expand Down Expand Up @@ -3116,8 +3116,8 @@
</div>
</div>
<table><tr>
<td colspan="2"><input type="checkbox" class="defaultCrewLock" value="5" name="attr_vehicle-PilotMod_max" title="Trained in Pilot?" />Trained in Pilot?</td>
<td colspan="5"><input type="checkbox" value="@{vehicle-int|max}" name="attr_vehicle-UseComputerMod_max" title="Include Vehicle's INT for Use Computer?" />Include Vehicle's INT for Use Computer?</td>
<td colspan="2"><input type="checkbox" class="defaultCrewLock" value="5" name="attr_vehicle-PilotMod_max" title="Trained in Pilot?" />&nbsp;Trained in Pilot?</td>
<td colspan="5"><input type="checkbox" value="@{vehicle-int|max}" name="attr_vehicle-UseComputerMod_max" title="Include Vehicle's INT for Use Computer?" />&nbsp;Include Vehicle's INT for Use Computer?</td>
</tr></table>
<hr style="margin-top: 4px; margin-bottom: 4px;" />
</fieldset>
Expand Down Expand Up @@ -3204,11 +3204,10 @@
</div>
<div class="clear"></div>
</div> <!-- End Vehicle Sheet -->
<br />
<!-- start help section -->
<div>
For Help, please see the wiki page. <input type="text" disabled="true" name="wiki_URL" style="width:30em" title="Wiki URL" value="https://wiki.roll20.net/Star_Wars_Saga_Edition_Character_Sheet"/> <br/>
<span data-i18n="last_updated"><b>Last updated</b></span> 16 July 2023
For help, please see the wiki page. <input type="text" disabled="true" name="wiki_URL" style="width:30em" title="Wiki URL" value="https://wiki.roll20.net/Star_Wars_Saga_Edition_Character_Sheet"/> <br/>
<b><span data-i18n="last_updated">Last updated</span>:</b> 24 July 2023
</div>
<!-- start roll templates -->
<body>
Expand Down Expand Up @@ -3992,19 +3991,27 @@
on("change:armorperception", function() {
ArmorPerception();
});
on("change:hp_max change:con change:IsDroid", function() {
//sheetworker triggers on any changes to the "hp_max" or "con" attribute
getAttrs(["hp_max","CON", "hidden_second_wind", "IsDroid"], function(values) {
//get the values for the two attributes, so they can used.
let hp_max = parseInt(values.hp_max)||0;
let con = parseInt(values.CON)||0;
on("change:hp_max change:con", function() {
SecondWindUpdate();
});
on("change:IsDroid", function() {
SecondWindUpdate();
//Set defense to STR instead of con
getAttrs(["IsDroid", "FortTotal"], function(values) {
let droid = parseInt(values.IsDroid)||0;
//saves the current values of the two attributes on two temporary variables, which then can be used easily in calculations.
if(droid ==1 || Math.floor((hp_max / 4)) > con) {SecondWindValue = Math.floor((hp_max / 4));} else {SecondWindValue=con}
// Selects which is higher con score of 1/4 of health
let fortequation = values.FortTotal;
if(droid ==1) {
DTDefense="@{str|max}";
fortequation=fortequation.replaceAll(/@{con|max}/gi,'@{str|max}');
}
else {
DTDefense="@{con|max}";
fortequation=fortequation.replaceAll('@{str|max}','@{con|max}');
}
console.log(fortequation);
setAttrs({
"hidden_second_wind": SecondWindValue
// changes the "Second_Wind" sheet attribute to be the value of our temporary variable "SecondWindValue"
"FortMod": DTDefense,
"FortTotal": fortequation
});
});
});
Expand Down Expand Up @@ -4438,6 +4445,21 @@
});
});
};
var SecondWindUpdate = function() {
getAttrs(["hp_max","CON", "hidden_second_wind", "IsDroid"], function(values) {
//get the values for the two attributes, so they can used.
let hp_max = parseInt(values.hp_max)||0;
let con = parseInt(values.CON)||0;
let droid = parseInt(values.IsDroid)||0;
//saves the current values of the two attributes on two temporary variables, which then can be used easily in calculations.
if(droid ==1 || Math.floor((hp_max / 4)) > con) {SecondWindValue = Math.floor((hp_max / 4));} else {SecondWindValue=con}
// Selects which is higher con score of 1/4 of health
setAttrs({
"hidden_second_wind": SecondWindValue
// changes the "Second_Wind" sheet attribute to be the value of our temporary variable "SecondWindValue"
});
});
}
var SkillUpdate = function() {
getAttrs(["AcrobaticsFormula","AthleticsFormula","ClimbFormula","DeceptionFormula","EnduranceFormula","GatherInformationFormula","InitiativeFormula","JumpFormula","Knowledge-BureaucracyFormula","Knowledge-GalacticLoreFormula","Knowledge-LifeSciencesFormula","Knowledge-PhysicalScienceFormula","Knowledge-SocialScienceFormula","Knowledge-TacticsFormula","Knowledge-TechnologyFormula","MechanicsFormula","PerceptionFormula","PersuasionFormula","PilotFormula","RideFormula","StealthFormula","SurvivalFormula","SwimFormula","TreatInjuryFormula","UseComputerFormula","UsetheForceFormula"], function(values) {
var AcrobaticsFormula = values.AcrobaticsFormula;
Expand Down
2 changes: 1 addition & 1 deletion Star Wars Saga Edition/sheet.json
Expand Up @@ -4,7 +4,7 @@
"authors": " Alicia G (original author), Stephen C (maintainer)",
"roll20userid": "2889, 436906",
"preview": "StarWarsSagaEditionpreview.png",
"instructions": "# Character Sheet\r Inspired by the Saga Edition sheet by Mad Irishman Productions. This sheet auto-calculates statistics using the rules as written. Most (but not all) supplement rules have been taken into account. If you feel that there is something incorrect or missing, please contact the authors. \r\r\r **Last Updated:** 16 July, 2023\r\r\r View the Wiki for the Change Log and more information on the sheet including complete list of attributes and rolls: https://wiki.roll20.net/Star_Wars_Saga_Edition_Character_Sheet",
"instructions": "# Character Sheet\r Inspired by the Saga Edition sheet by Mad Irishman Productions. This sheet auto-calculates statistics using the rules as written. Most (but not all) supplement rules have been taken into account. If you feel that there is something incorrect or missing, please contact the authors. \r\r\r **Last Updated:** 24 July, 2023\r\r\r View the Wiki for the Change Log and more information on the sheet including complete list of attributes and rolls: https://wiki.roll20.net/Star_Wars_Saga_Edition_Character_Sheet",
"legacy": false,
"printable": true
}