Add Liminal character sheet

This commit is contained in:
SavageSpiel
2021-11-17 20:52:21 +00:00
parent 1345a2e061
commit d242606192
4 changed files with 630 additions and 0 deletions
+173
View File
@@ -0,0 +1,173 @@
/* Set the min-width so that when the window is resized the look will stay consistant */
.charsheet {
background-color: #8bb;
min-width: 825px;
/*background-image: url('https://d1vzi28wh99zvq.cloudfront.net/images/4329/267203.jpg');*/
}
/* Universal styling applied to all elements of these types */
h1 {
font-size: 4em;
margin-bottom: 10px;
text-align: center;
}
h2 {
font-size: 2em;
margin-bottom: 10px;
text-align: center;
}
/* BASIC INFO */
.sheet-basicinfo label {
display: inline-block;
width: 80px;
}
.sheet-basicinfo input {
display: inline-block;
width: 300px;
}
.sheet-basicinfo select {
display: inline-block;
width: 300px;
}
.sheet-basicinfo textarea {
display: inline-block;
width: 290px;
height:110px;
}
.sheet-basicinfo label.sheet-drive {
vertical-align:top;
}
/* SKILLS */
.sheet-skills label {
margin-left:153px;
margin-bottom:0;
margin-top:-15px;
font-weight: normal;
font-size:1em;
}
.sheet-skills input {
display: inline-block;
width: 115px;
}
p.sheet-skill-explain {
margin-top:10px;
}
.ui-dialog .charsheet .sheet-skills .sheet-col {
margin-right:10px;
width: calc(33% - 9px);
}
.charsheet .sheet-skills button[type=roll].sheet-skill-button {
width:94px;
margin:0;
height:22px;
text-align:left;
}
.sheet-skills button[type=roll].sheet-skill-button::before {
content: '';
}
.sheet-skillpoints label {
display: inline-block;
width: 150px;
}
.sheet-skillpoints input {
display: inline-block;
}
img {
max-height: 100px;
}
textarea {
resize: vertical;
}
/* STATS */
.sheet-stats h4 {
display: inline-block;
text-align: left;
}
.sheet-stats h4.sheet-first {
margin-left: 120px;
margin-right: 15px;
}
.sheet-stats input {
/*margin-right: 8%;
width: 17%;*/
display: inline-block;
}
.sheet-stats label {
display: inline-block;
width: 110px;
}
.sheet-stats label.sheet-driveused {
display: inline-block;
width: 190px;
}
/* COMBAT */
.sheet-combat label {
display: inline-block;
width: 200px;
}
.sheet-combat label.sheet-damagebonus {
display: inline-block;
width: 200px;
}
.sheet-combat input {
display: inline-block;
width: 170px;
}
.sheet-combat label.sheet-unarmed {
width: 297px;
font-weight:normal;
}
.sheet-combat select {
display: inline-block;
width: 80px;
}
/* TRAITS */
.sheet-traits input {
display: inline-block;
width: 340px;
}
.sheet-traits textarea {
height:40px;
width:379px;
}
.sheet-stats button[type=roll].sheet-2d6-dice::before {
font-family: 'dicefontd6';
content: 'ff ';
}
.sheet-stats button[type=roll].sheet-d6-dice::before {
font-family: 'dicefontd6';
content: 'f ';
}
+448
View File
@@ -0,0 +1,448 @@
<h1>Liminal</h1>
<h3>A RPG about those caught between the ordinary and extraordinary.</h3>
<div class="sheet-2colrow sheet-basicinfo">
<div class="sheet-col">
<label>Name:</label><input type="text" name="attr_character_name" /><br />
<label>Concept:</label><input type="text" name="attr_concept" /><br />
<label>Crew:</label><input type="text" name="attr_crew" /><br />
<label>Focus:</label><select name="attr_focus">
<option value="Tough">Tough</option>
<option value="Determined">Determined</option>
<option value="Magician">Magician</option>
</select>
</div>
<div class="sheet-col">
<label class="sheet-drive">Drive:</label><textarea name="attr_drive" />
</div>
</div>
<hr/>
<div class="sheet-3colrow sheet-skills">
<div class="sheet-col">
<h2>Physical Skills</h2>
<label>Specialities</label>
<button class="sheet-skill-button" type='roll' name='roll_athletics' value='&{template:default} {{name=@{character_name}}} {{Athletics=[[2d6 + @{athletics} + ?{Modifier|0}]]}}'>Athletics</button><input type="number" name='attr_athletics' min="0"></input><input type="text" name='attr_athleticsspec'></input>
<br />
<button class="sheet-skill-button" type='roll' name='roll_awareness' value='&{template:default} {{name=@{character_name}}} {{Awareness=[[2d6 + @{awareness} + ?{Modifier|0}]]}}'>Awareness</button><input type="number" name='attr_awareness' min="0"></input><input type="text" name='attr_awarenessspec'></input>
<br />
<button class="sheet-skill-button" type='roll' name='roll_melee' value='&{template:default} {{name=@{character_name}}} {{Melee=[[2d6 + @{melee} + ?{Modifier|0}]]}}'>Melee</button><input type="number" name='attr_melee' min="0"></input><input type="text" name='attr_meleespec'></input>
<br />
<button class="sheet-skill-button" type='roll' name='roll_shoot' value='&{template:default} {{name=@{character_name}}} {{Shoot=[[2d6 + @{shoot} + ?{Modifier|0}]]}}'>Shoot</button><input type="number" name='attr_shoot' min="0"></input><input type="text" name='attr_shootspec'></input>
<br />
<button class="sheet-skill-button" type='roll' name='roll_stealth' value='&{template:default} {{name=@{character_name}}} {{Stealth=[[2d6 + @{stealth} + ?{Modifier|0}]]}}'>Stealth</button><input type="number" name='attr_stealth' min="0"></input><input type="text" name='attr_stealthspec'></input>
<br />
<button class="sheet-skill-button" type='roll' name='roll_survival' value='&{template:default} {{name=@{character_name}}} {{Survival=[[2d6 + @{survival} + ?{Modifier|0}]]}}'>Survival</button><input type="number" name='attr_survival' min="0"></input><input type="text" name='attr_survivalspec'></input>
<br />
<button class="sheet-skill-button" type='roll' name='roll_vehicles' value='&{template:default} {{name=@{character_name}}} {{Vehicles=[[2d6 + @{vehicles} + ?{Modifier|0}]]}}'>Vehicles</button><input type="number" name='attr_vehicles' min="0"></input><input type="text" name='attr_vehiclesspec'></input>
</div>
<div class="sheet-col">
<h2>Mental Skills</h2>
<label>Specialities</label>
<button class="sheet-skill-button" type='roll' name='roll_testattack' value='&{template:default} {{name=@{character_name}}} {{Art=[[2d6 + @{art} + ?{Modifier|0}]]}}'>Art</button><input type="number" name='attr_art' min="0"></input><input type="text" name='attr_artspec'></input>
<br />
<button class="sheet-skill-button" type='roll' name='roll_testattack' value='&{template:default} {{name=@{character_name}}} {{Business=[[2d6 + @{business} + ?{Modifier|0}]]}}'>Business</button><input type="number" name='attr_business' min="0"></input><input type="text" name='attr_businessspec'></input>
<br />
<button class="sheet-skill-button" type='roll' name='roll_testattack' value='&{template:default} {{name=@{character_name}}} {{Education=[[2d6 + @{education} + ?{Modifier|0}]]}}'>Education</button><input type="number" name='attr_education' min="0"></input><input type="text" name='attr_educationspec'></input>
<br />
<button class="sheet-skill-button" type='roll' name='roll_testattack' value='&{template:default} {{name=@{character_name}}} {{Lore=[[2d6 + @{lore} + ?{Modifier|0}]]}}'>Lore</button><input type="number" name='attr_lore' min="0"></input><input type="text" name='attr_lorespec'></input>
<br />
<button class="sheet-skill-button" type='roll' name='roll_testattack' value='&{template:default} {{name=@{character_name}}} {{Medicine=[[2d6 + @{medicine} + ?{Modifier|0}]]}}'>Medicine</button><input type="number" name='attr_medicine' min="0"></input><input type="text" name='attr_medicinespec'></input>
<br />
<button class="sheet-skill-button" type='roll' name='roll_testattack' value='&{template:default} {{name=@{character_name}}} {{Science=[[2d6 + @{science} + ?{Modifier|0}]]}}'>Science</button><input type="number" name='attr_science' min="0"></input><input type="text" name='attr_sciencespec'></input>
<br />
<button class="sheet-skill-button" type='roll' name='roll_testattack' value='&{template:default} {{name=@{character_name}}} {{Technology=[[2d6 + @{technology} + ?{Modifier|0}]]}}'>Technology</button><input type="number" name='attr_technology' min="0"></input><input type="text" name='attr_technologyspec'></input>
</div>
<div class="sheet-col">
<h2>Social Skills</h2>
<label>Specialities</label>
<button class="sheet-skill-button" type='roll' name='roll_testattack' value='&{template:default} {{name=@{character_name}}} {{Charm=[[2d6 + @{charm} + ?{Modifier|0}]]}}'>Charm</button><input type="number" name='attr_charm' min="0"></input><input type="text" name='attr_charmspec'></input>
<br />
<button class="sheet-skill-button" type='roll' name='roll_testattack' value='&{template:default} {{name=@{character_name}}} {{Conviction=[[2d6 + @{conviction} + ?{Modifier|0}]]}}'>Conviction</button><input type="number" name='attr_conviction' min="0"></input><input type="text" name='attr_convictionspec'></input>
<br />
<button class="sheet-skill-button" type='roll' name='roll_testattack' value='&{template:default} {{name=@{character_name}}} {{Empathy=[[2d6 + @{empathy} + ?{Modifier|0}]]}}'>Empathy</button><input type="number" name='attr_empathy' min="0"></input><input type="text" name='attr_empathyspec'></input>
<br />
<button class="sheet-skill-button" type='roll' name='roll_testattack' value='&{template:default} {{name=@{character_name}}} {{High Society=[[2d6 + @{highsociety} + ?{Modifier|0}]]}}'>High Society</button><input type="number" name='attr_highsociety' min="0"></input><input type="text" name='attr_highsocietyspec'></input>
<br />
<button class="sheet-skill-button" type='roll' name='roll_testattack' value='&{template:default} {{name=@{character_name}}} {{Rhetoric=[[2d6 + @{rhetoric} + ?{Modifier|0}]]}}'>Rhetoric</button><input type="number" name='attr_rhetoric' min="0"></input><input type="text" name='attr_rhetoricspec'></input>
<br />
<button class="sheet-skill-button" type='roll' name='roll_testattack' value='&{template:default} {{name=@{character_name}}} {{Streetwise=[[2d6 + @{streetwise} + ?{Modifier|0}]]}}'>Streetwise</button><input type="number" name='attr_streetwise' min="0"></input><input type="text" name='attr_streetwisespec'></input>
<br />
<button class="sheet-skill-button" type='roll' name='roll_testattack' value='&{template:default} {{name=@{character_name}}} {{Taunt=[[2d6 + @{taunt} + ?{Modifier|0}]]}}'>Taunt</button><input type="number" name='attr_taunt' min="0"></input><input type="text" name='attr_tauntspec'></input>
</div>
</div>
<p class="sheet-skill-explain">Start with 17 Skill points. If you have a skill at 3 or higher you may spend 1 point for a Speciality.</p>
<div class="sheet-3colrow sheet-skillpoints">
<div class="sheet-col">
<label>Unspent skill points </label><input type="number" name='attr_skillpoints'></input>
</div>
<div class="sheet-col">
<label>Skill cap </label><input type="number" name='attr_skillcap'></input>
</div>
<div class="sheet-col">
<label>Total skill points </label><input type="number" name='attr_totalskillpoints'></input>
</div>
</div>
<hr />
<div class="sheet-2colrow sheet-stats">
<div class="sheet-col">
<h2>Attributes</h2>
<h4 class="sheet-first">Current</h4><h4>Max</h4><br />
<label>Endurance</label><input type="number" name="attr_endurance" />/<input type="number" name="attr_endurance_max" /><br />
<label>Will</label><input type="number" name="attr_will" />/<input type="number" name="attr_will_max" /><br />
<label>Experience</label><input type="number" name="attr_experience" />
<br />
<br />
<label class="sheet-driveused">Total advancements</label><input type="number" name="attr_totaladvancements" /><br />
<label class="sheet-driveused">Unspent advancements</label><input type="number" name="attr_advancements" /><br />
<p class="sheet-skill-explain">Spend 1 advancement to buy a trait point, increase your skill cap, or buy a crew asset.</p>
<label class="sheet-driveused">Drive used this session?</label><input type="checkbox" name="attr_driveused"></input>
<button class="sheet-skill-button sheet-d6-dice" type='roll' name='roll_drive' value='&{template:default} {{name=@{character_name}}} {{Will points recovered=[[1d6]]}}'> Lean on your drive</button>
<br /><br />
<label class="sheet-driveused">Additional crew assets</label><input type="number" name="attr_crewassets" />
</div>
<div class="sheet-col sheet-combat">
<h2>Combat</h2>
<label class="sheet-damagebonus">Melee damage bonus</label><input type="number" name="attr_meleebonus" /><br />
<label class="sheet-damagebonus">Shoot damage bonus</label><input type="number" name="attr_shootbonus" />
<br /><br />
<label>Select your token and then </label>
<button class="sheet-2d6-dice" type='roll' name='roll_initiative' value='&{template:default} {{name=@{character_name}}} {{Initiative=[[2d6 + @{awareness} + ?{Modifier|0} &{tracker}]]}}'>Roll Initiative</button>
<hr />
<label>Weapons and Attacks</label><br />
<label class="sheet-unarmed">Unarmed</label><button class="sheet-d6-dice" type='roll' name='roll_unarmed' value='&{template:default} {{name=@{character_name}}} {{Weapon=Unarmed}} {{Damage=[[1d6 + @{meleebonus} + ?{Modifier|0}]]}}'></button>
<button class="sheet-2d6-dice" type='roll' name='roll_unarmed2' value='&{template:default} {{name=@{character_name}}} {{Weapon=Unarmed}} {{Damage=[[2d6 + @{meleebonus} + ?{Modifier|0}]]}}'></button>
<fieldset class="repeating_weapons">
<input type="text" name="attr_weaponname" />
<input type="number" name="attr_weapondamagebonus" />
<select name="attr_weapontype">
<option value="@{meleebonus}">Melee</option>
<option value="@{shootbonus}">Shoot</option>
<option value="0">Other</option>
</select>
<button class="sheet-d6-dice" type='roll' name='roll_weapon' value='&{template:default} {{name=@{character_name}}} {{Weapon=@{weaponname}}} {{Damage=[[1d6 + @{weapondamagebonus} + @{weapontype} + ?{Modifier|0}]]}}'></button>
<button class="sheet-2d6-dice" type='roll' name='roll_weapon2' value='&{template:default} {{name=@{character_name}}} {{Weapon=@{weaponname}}} {{Damage=[[2d6 + @{weapondamagebonus} + @{weapontype} + ?{Modifier|0}]]}}'></button>
</fieldset>
</div>
</div>
<hr />
<div class="sheet-2colrow sheet-traits">
<div class="sheet-col">
<h2>Traits</h2>
<fieldset class="repeating_traits">
<input type="text" name="attr_traitname" />
<input type="number" name="attr_traitcost" min="1" />
<textarea name="attr_traitdescription" />
</fieldset>
</div>
<div class="sheet-col">
<h2>Limitations</h2>
<fieldset class="repeating_limitations">
<input type="text" name="attr_limitation" />
</fieldset>
</div>
</div>
<p class="sheet-skill-explain">Start with 5 Trait points. You can gain up to +2 points from Limitations.</p>
<div class="sheet-2colrow sheet-skillpoints">
<div class="sheet-col">
<label>Unspent trait points </label><input type="number" name='attr_traitpoints'></input>
</div>
<div class="sheet-col">
<label>Total trait points </label><input type="number" name='attr_totaltraitpoints'></input>
</div>
</div>
<hr />
<script type="text/worker">
// Initialise skills and other numbered attributes
on("change:athletics change:awareness change:melee change:shoot change:stealth change:survival change:vehicles change:art change:business change:education change:lore change:medicine change:science change:technology change:charm change:conviction change:empathy change:highsociety change:rhetoric change:streetwise change:taunt sheet:opened", function() {
getAttrs(["athletics","awareness","melee","shoot","stealth","survival","vehicles","art","business","education","lore","medicine","science","technology","charm","conviction","empathy","highsociety","rhetoric","streetwise","taunt","skillcap","meleebonus","shootbonus","totaltraitpoints","crewassets"], function(values) {
console.log(values);
let athletics = parseInt(values.athletics)||0;
let awareness = parseInt(values.awareness)||0;
let melee = parseInt(values.melee)||0;
let shoot = parseInt(values.shoot)||0;
let stealth = parseInt(values.stealth)||0;
let survival = parseInt(values.survival)||0;
let vehicles = parseInt(values.vehicles)||0;
let art = parseInt(values.art)||0;
let business = parseInt(values.business)||0;
let education = parseInt(values.education)||0;
let lore = parseInt(values.lore)||0;
let medicine = parseInt(values.medicine)||0;
let science = parseInt(values.science)||0;
let technology = parseInt(values.technology)||0;
let charm = parseInt(values.charm)||0;
let conviction = parseInt(values.conviction)||0;
let empathy = parseInt(values.empathy)||0;
let highsociety = parseInt(values.highsociety)||0;
let rhetoric = parseInt(values.rhetoric)||0;
let streetwise = parseInt(values.streetwise)||0;
let taunt = parseInt(values.taunt)||0;
let skillcap = parseInt(values.skillcap)||4;
let meleebonus = parseInt(values.meleebonus)||0;
let shootbonus = parseInt(values.shootbonus)||0;
let totaltraitpoints = parseInt(values.totaltraitpoints)||5;
let crewassets = parseInt(values.crewassets)||0;
setAttrs({
"athletics": Math.min(athletics, skillcap),
"awareness": Math.min(awareness, skillcap),
"melee": Math.min(melee, skillcap),
"shoot": Math.min(shoot, skillcap),
"stealth": Math.min(stealth, skillcap),
"survival": Math.min(survival, skillcap),
"vehicles": Math.min(vehicles, skillcap),
"art": Math.min(art, skillcap),
"business": Math.min(business, skillcap),
"education": Math.min(education, skillcap),
"lore": Math.min(lore, skillcap),
"medicine": Math.min(medicine, skillcap),
"science": Math.min(science, skillcap),
"technology": Math.min(technology, skillcap),
"charm": Math.min(charm, skillcap),
"conviction": Math.min(conviction, skillcap),
"empathy": Math.min(empathy, skillcap),
"highsociety": Math.min(highsociety, skillcap),
"rhetoric": Math.min(rhetoric, skillcap),
"streetwise": Math.min(streetwise, skillcap),
"taunt": Math.min(taunt, skillcap),
"skillcap": skillcap,
"meleebonus": meleebonus,
"shootbonus": shootbonus,
"totaltraitpoints": totaltraitpoints,
"crewassets": crewassets
});
});
});
// Set endurance maximum
on("change:athletics change:focus sheet:opened", function() {
getAttrs(["athletics","focus"], function(values) {
let athletics = parseInt(values.athletics)||0;
let focus = values.focus;
let endurance = athletics + 8
if (focus === "Tough")
{
endurance = athletics + 12
}
setAttrs({
"endurance_max": endurance
});
});
});
// Set will maximum
on("change:conviction change:focus sheet:opened", function() {
getAttrs(["conviction","focus"], function(values) {
let conviction = parseInt(values.conviction)||0;
let focus = values.focus;
let will = conviction + 8
if (focus === "Determined")
{
will = conviction + 10
}
setAttrs({
"will_max": will
});
});
});
// Set total skill points and advancements
on("change:experience sheet:opened", function() {
getAttrs(["experience"], function(values) {
let experience = parseInt(values.experience)||0;
let totalskillpoints = Math.floor(experience/5) + 17;
let totaladvancements = Math.floor(experience/15);
setAttrs({
"totalskillpoints": totalskillpoints,
"totaladvancements": totaladvancements
});
});
});
// Set unspent skill points
on("change:athletics change:awareness change:melee change:shoot change:stealth change:survival change:vehicles change:art change:business change:education change:lore change:medicine change:science change:technology change:charm change:conviction change:empathy change:highsociety change:rhetoric change:streetwise change:taunt change:athleticsspec change:awarenessspec change:meleespec change:shootspec change:stealthspec change:survivalspec change:vehiclesspec change:artspec change:businessspec change:educationspec change:lorespec change:medicinespec change:sciencespec change:technologyspec change:charmspec change:convictionspec change:empathyspec change:highsocietyspec change:rhetoricspec change:streetwisespec change:tauntspec change:totalskillpoints sheet:opened", function() {
getAttrs(["athletics","awareness","melee","shoot","stealth","survival","vehicles","art","business","education","lore","medicine","science","technology","charm","conviction","empathy","highsociety","rhetoric","streetwise","taunt","athleticsspec","awarenessspec","meleespec","shootspec","stealthspec","survivalspec","vehiclesspec","artspec","businessspec","educationspec","lorespec","medicinespec","sciencespec","technologyspec","charmspec","convictionspec","empathyspec","highsocietyspec","rhetoricspec","streetwisespec","tauntspec","totalskillpoints"], function(values) {
console.log(values);
let athletics = parseInt(values.athletics)||0;
let awareness = parseInt(values.awareness)||0;
let melee = parseInt(values.melee)||0;
let shoot = parseInt(values.shoot)||0;
let stealth = parseInt(values.stealth)||0;
let survival = parseInt(values.survival)||0;
let vehicles = parseInt(values.vehicles)||0;
let art = parseInt(values.art)||0;
let business = parseInt(values.business)||0;
let education = parseInt(values.education)||0;
let lore = parseInt(values.lore)||0;
let medicine = parseInt(values.medicine)||0;
let science = parseInt(values.science)||0;
let technology = parseInt(values.technology)||0;
let charm = parseInt(values.charm)||0;
let conviction = parseInt(values.conviction)||0;
let empathy = parseInt(values.empathy)||0;
let highsociety = parseInt(values.highsociety)||0;
let rhetoric = parseInt(values.rhetoric)||0;
let streetwise = parseInt(values.streetwise)||0;
let taunt = parseInt(values.taunt)||0;
let athleticsspec = CountSpecialities(values.athleticsspec);
let awarenessspec = CountSpecialities(values.awarenessspec);
let meleespec = CountSpecialities(values.meleespec);
let shootspec = CountSpecialities(values.shootspec);
let stealthspec = CountSpecialities(values.stealthspec);
let survivalspec = CountSpecialities(values.survivalspec);
let vehiclesspec = CountSpecialities(values.vehiclesspec);
let artspec = CountSpecialities(values.artspec);
let businessspec = CountSpecialities(values.businessspec);
let educationspec = CountSpecialities(values.educationspec);
let lorespec = CountSpecialities(values.lorespec);
let medicinespec = CountSpecialities(values.medicinespec);
let sciencespec = CountSpecialities(values.sciencespec);
let technologyspec = CountSpecialities(values.technologyspec);
let charmspec = CountSpecialities(values.charmspec);
let convictionspec = CountSpecialities(values.convictionspec);
let empathyspec = CountSpecialities(values.empathyspec);
let highsocietyspec = CountSpecialities(values.highsocietyspec);
let rhetoricspec = CountSpecialities(values.rhetoricspec);
let streetwisespec = CountSpecialities(values.streetwisespec);
let tauntspec = CountSpecialities(values.tauntspec);
console.log(stealthspec);
let totalskillpoints = parseInt(values.totalskillpoints)||0;
let skillpoints = athletics
+ awareness
+ melee
+ shoot
+ stealth
+ survival
+ vehicles
+ art
+ business
+ education
+ lore
+ medicine
+ science
+ technology
+ charm
+ conviction
+ empathy
+ highsociety
+ rhetoric
+ streetwise
+ taunt
+ athleticsspec
+ awarenessspec
+ meleespec
+ shootspec
+ stealthspec
+ survivalspec
+ vehiclesspec
+ artspec
+ businessspec
+ educationspec
+ lorespec
+ medicinespec
+ sciencespec
+ technologyspec
+ charmspec
+ convictionspec
+ empathyspec
+ highsocietyspec
+ rhetoricspec
+ streetwisespec
+ tauntspec;
setAttrs({
"skillpoints": totalskillpoints - skillpoints
});
});
});
// Set trait points
on('sheet:opened remove:repeating_traits change:repeating_traits:traitcost change:totaltraitpoints change:repeating_limitations:limitation remove:repeating_limitations', function() {
getSectionIDs('traits', function(idarray) {
// first get the attribute names for all rows in put in one array
const fieldnames = [];
idarray.forEach(id => fieldnames.push(`repeating_traits_${id}_traitcost`));
getAttrs(fieldnames, values => {
let totaltraitcost = 0;
// now loop through the rows again
idarray.forEach(id => {
let row = 'repeating_traits_' + id;
let traitcost = parseInt(values[`${row}_traitcost`])||0;
totaltraitcost += traitcost;
});
// Count the number of limitations as they all cost the same and take it off the total trait cost
getSectionIDs('limitations', function(idarray) {
let limitationCount = idarray.length;
totaltraitcost -= limitationCount;
// Get the number of trait points.
getAttrs(["totaltraitpoints"], function(values) {
let totaltraitpoints = parseInt(values.totaltraitpoints)||5;
setAttrs({
"traitpoints": totaltraitpoints - totaltraitcost
});
});
});
});
});
});
// Set unspent advancements
on('sheet:opened change:totaltraitpoints change:skillcap change:crewassets change:totaladvancements', function() {
getAttrs(["totaltraitpoints","skillcap","crewassets","totaladvancements"], function(values) {
let totaltraitpoints = parseInt(values.totaltraitpoints)||5;
let skillcap = parseInt(values.skillcap)||4;
let crewassets = parseInt(values.crewassets)||0;
let totaladvancements = parseInt(values.totaladvancements)||0;
setAttrs({
"advancements": totaladvancements - totaltraitpoints + 5 - skillcap + 4 - crewassets
});
});
});
function CountSpecialities(attribute){
return attribute == null ? 0 : attribute.trim().length > 0 ? attribute.split(",").length : 0;
}
</script>
Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

+9
View File
@@ -0,0 +1,9 @@
{
"html": "liminal.html",
"css": "liminal.css",
"authors": "Sue Savage",
"roll20userid": "5009227",
"preview": "liminalpreview.png",
"instructions": "A character sheet for Liminal.",
"legacy": false
}