san checks working better, begun work on skills
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
@import url("https://fonts.googleapis.com/css2?family=Martel:wght@400;800&family=Roboto:wght@300;400;500&display=swap");
|
||||
@import url("https://fonts.googleapis.com/css2?family=Didact+Gothic");
|
||||
|
||||
/* Global styles */
|
||||
.window-app {
|
||||
font-family: "Didact Gothic", "Roboto", sans-serif;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.rollable:hover, .rollable:focus {
|
||||
|
||||
+13
-16
@@ -10,7 +10,7 @@ export class DeltaGreenActorSheet extends ActorSheet {
|
||||
classes: ["deltagreen", "sheet", "actor"],
|
||||
template: "systems/deltagreen/templates/actor/actor-sheet.html",
|
||||
width: 600,
|
||||
height: 600,
|
||||
height: 800,
|
||||
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }]
|
||||
});
|
||||
}
|
||||
@@ -20,11 +20,6 @@ export class DeltaGreenActorSheet extends ActorSheet {
|
||||
/** @override */
|
||||
getData() {
|
||||
const data = super.getData();
|
||||
|
||||
//data.dtypes = ["String", "Number", "Boolean"];
|
||||
//for (let attr of Object.values(data.data.attributes)) {
|
||||
// attr.isCheckbox = attr.dtype === "Boolean";
|
||||
//}
|
||||
|
||||
// Prepare items.
|
||||
if (this.actor.data.type == 'character') {
|
||||
@@ -66,15 +61,15 @@ export class DeltaGreenActorSheet extends ActorSheet {
|
||||
let item = i.data;
|
||||
i.img = i.img || DEFAULT_TOKEN;
|
||||
// Append to gear.
|
||||
if (i.type === 'item') {
|
||||
if (i.type === 'gear') {
|
||||
gear.push(i);
|
||||
}
|
||||
// Append to features.
|
||||
else if (i.type === 'feature') {
|
||||
else if (i.type === 'weapon') {
|
||||
features.push(i);
|
||||
}
|
||||
// Append to spells.
|
||||
else if (i.type === 'spell') {
|
||||
else if (i.type === 'ritual') {
|
||||
if (i.data.spellLevel != undefined) {
|
||||
spells[i.data.spellLevel].push(i);
|
||||
}
|
||||
@@ -113,9 +108,9 @@ export class DeltaGreenActorSheet extends ActorSheet {
|
||||
li.slideUp(200, () => this.render(false));
|
||||
});
|
||||
|
||||
// Rollable abilities.
|
||||
// Rollable abilities - bind to everything with the 'Rollable' class
|
||||
html.find('.rollable').click(this._onRoll.bind(this));
|
||||
|
||||
|
||||
// Drag events for macros.
|
||||
if (this.actor.owner) {
|
||||
let handler = ev => this._onDragItemStart(ev);
|
||||
@@ -128,6 +123,7 @@ export class DeltaGreenActorSheet extends ActorSheet {
|
||||
|
||||
// Custom Sheet Macros
|
||||
html.find('#btnResetBreakingPoint').click(this._resetBreakingPoint.bind(this));
|
||||
//html.find('.sanity-test-btn').click(this._onSanityTest.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -174,7 +170,11 @@ export class DeltaGreenActorSheet extends ActorSheet {
|
||||
let targetVal = "";
|
||||
|
||||
// check the 'data-target="something" property to determine how to grab the target for the roll
|
||||
if(dataset.target === "statistic.x5"){
|
||||
if(! Number.isNaN(dataset.target)){
|
||||
targetVal = dataset.target;
|
||||
label += `, Target: ${targetVal}`;
|
||||
}
|
||||
else if(dataset.target === "statistic.x5"){
|
||||
let stat = this.actor.data.data.statistics[key];
|
||||
targetVal = stat.x5;
|
||||
label += `, Target: ${targetVal}`;
|
||||
@@ -192,11 +192,8 @@ export class DeltaGreenActorSheet extends ActorSheet {
|
||||
}
|
||||
|
||||
_resetBreakingPoint(event){
|
||||
//let actorData = this.actor.data;
|
||||
let currentBreakingPoint = 0;
|
||||
console.log('Resetting breaking point...');
|
||||
//console.log(actorData);
|
||||
|
||||
|
||||
currentBreakingPoint = this.actor.data.data.sanity.value - this.actor.data.data.statistics.pow.value;
|
||||
|
||||
let updatedData = duplicate(this.actor.data.data);
|
||||
|
||||
@@ -45,6 +45,10 @@ Hooks.once('init', async function() {
|
||||
Handlebars.registerHelper('toLowerCase', function(str) {
|
||||
return str.toLowerCase();
|
||||
});
|
||||
|
||||
Handlebars.registerHelper('toUpperCase', function(str) {
|
||||
return str.toUpperCase();
|
||||
});
|
||||
});
|
||||
|
||||
Hooks.once("ready", async function() {
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "deltagreen",
|
||||
"title": "Delta Green",
|
||||
"description": "Delta Green RPG system for FoundryVTT!",
|
||||
"version": "1.0.3",
|
||||
"description": "Delta Green RPG system for FoundryVTT.",
|
||||
"version": "1.0.0",
|
||||
"minimumCoreVersion": "0.6.2",
|
||||
"compatibleCoreVersion": "0.6.2",
|
||||
"templateVersion": 2,
|
||||
|
||||
+9
-11
@@ -12,7 +12,9 @@
|
||||
"max": 10
|
||||
},
|
||||
"wp": {
|
||||
"value": 10
|
||||
"value": 10,
|
||||
"min": 0,
|
||||
"max": 10
|
||||
},
|
||||
"statistics": {
|
||||
"str": {
|
||||
@@ -76,7 +78,7 @@
|
||||
"failure": false
|
||||
},
|
||||
"athletics": {
|
||||
"label": "Artillery",
|
||||
"label": "Athletics",
|
||||
"proficiency": 30,
|
||||
"failure": false
|
||||
},
|
||||
@@ -289,6 +291,7 @@
|
||||
"base",
|
||||
"human_skills"
|
||||
],
|
||||
"schemaVersion": 1.0,
|
||||
"sanity": {
|
||||
"value": 100,
|
||||
"currentBreakingPoint": 101,
|
||||
@@ -309,7 +312,8 @@
|
||||
"motivations":[
|
||||
{
|
||||
"description":"",
|
||||
"disorder":""
|
||||
"disorder":"",
|
||||
"crossedOut": false
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -317,8 +321,7 @@
|
||||
"Item": {
|
||||
"types": [
|
||||
"weapon",
|
||||
"equipment",
|
||||
"ability",
|
||||
"gear",
|
||||
"ritual"
|
||||
],
|
||||
"templates": {
|
||||
@@ -331,12 +334,7 @@
|
||||
"base"
|
||||
]
|
||||
},
|
||||
"equipment": {
|
||||
"templates": [
|
||||
"base"
|
||||
]
|
||||
},
|
||||
"ability": {
|
||||
"gear": {
|
||||
"templates": [
|
||||
"base"
|
||||
]
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<div class="resource-content flexrow flex-center flex-between">
|
||||
<input type="text" name="data.wp.value" value="{{data.wp.value}}" data-dtype="Number"/>
|
||||
<span> / </span>
|
||||
<span class="max-attribute-value-label">{{numberFormat data.wp.max decimals=0 sign=false}}</span>
|
||||
<span class="max-attribute-value-label" title="Maximum WP is equal to POW.">{{numberFormat data.wp.max decimals=0 sign=false}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -36,16 +36,17 @@
|
||||
<div class="resource flex-group-center">
|
||||
<label for="data.sanity.value" class="resource-label">SANITY</label>
|
||||
<div class="resource-content flexrow flex-center flex-between">
|
||||
<span class="rollable" data-roll="d100" data-target="sanity" data-label="SAN" title="Click to roll a sanity check...">SAN</span>
|
||||
<input title="Starting sanity is equal to POW x 5." type="text" name="data.sanity.value" value="{{data.sanity.value}}" data-dtype="Number"/>
|
||||
<span> / </span>
|
||||
<span title="Maximum sanity is equal to 99 - the Unnatural skill." class="max-attribute-value-label">{{numberFormat data.sanity.max decimals=0 sign=false}}</span>
|
||||
<!-- <span class="statistic-mod rollable left-aligned-label" data-roll="d100" data-target="sanity" data-label="SAN">(SAN Test)</span> -->
|
||||
<button class="btn-tiny rollable" data-roll="d100" data-target="sanity" data-label="SAN" title="Click to roll a sanity check...">TEST</button>
|
||||
<!-- <button id="btnSanityTest" class="btn-tiny sanity-test-btn" data-roll="d100" data-target="sanity" data-label="SAN" title="Click to roll a sanity check...">TEST</button> -->
|
||||
<span> </span>
|
||||
<span class="breaking-point-label"> Breaking Point: </span>
|
||||
<!-- <span title="The current breaking point, resent when current sanity falls to or below this value." class="max-attribute-value-label">{{numberFormat data.sanity.currentBreakingPoint decimals=0 sign=false}}</span> -->
|
||||
<input title="The current breaking point, resent when current sanity falls to or below this value." type="text" name="data.sanity.currentBreakingPoint" value="{{data.sanity.currentBreakingPoint}}" data-dtype="Number"/>
|
||||
<button id="btnResetBreakingPoint" class="btn-tiny" title="Reset breaking point to be SAN - WP.">Reset</button>
|
||||
<input title="The current breaking point, reset when current sanity falls to or below this value." type="text" name="data.sanity.currentBreakingPoint" value="{{data.sanity.currentBreakingPoint}}" data-dtype="Number"/>
|
||||
<button id="btnResetBreakingPoint" class="btn-tiny" title="Reset breaking point to be current SAN - WP.">Reset</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -55,9 +56,9 @@
|
||||
<div class="statistics grid grid-3col">
|
||||
{{#each data.statistics as |statistic key|}}
|
||||
<div class="statistic flexrow flex-group-center">
|
||||
<label for="data.statistics.{{key}}.value" class="resource-label">{{key}}</label>
|
||||
<label class="rollable" data-roll="d100" data-target="statistic.x5" data-label="{{key}}" title="Click to roll a x5 check." for="data.statistics.{{key}}.value" class="resource-label">{{toUpperCase key}}</label>
|
||||
<input type="text" name="data.statistics.{{key}}.value" value="{{statistic.value}}" data-dtype="Number"/>
|
||||
<span class="statistic-mod rollable" data-roll="d100" data-target="statistic.x5" data-label="{{key}}" title="Click to roll a x5 check.">{{numberFormat statistic.x5 decimals=0 sign=false}}</span>
|
||||
<span class="statistic-mod">({{numberFormat statistic.x5 decimals=0 sign=false}}%)</span>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
@@ -75,13 +76,20 @@
|
||||
{{!-- Sheet Body --}}
|
||||
<section class="sheet-body">
|
||||
|
||||
{{!-- Biography Tab --}}
|
||||
<div class="tab biography" data-group="primary" data-tab="physical-description">
|
||||
{{editor content=data.physicalDescription target="data.physicalDescription" button=true owner=owner editable=editable}}
|
||||
{{!-- Skills Tab --}}
|
||||
<div class="tab skills" data-group="primary" data-tab="skills">
|
||||
<div class="statistics grid grid-3col">
|
||||
{{#each data.skills as |skill key|}}
|
||||
<div class="statistic flexrow flex-group-center">
|
||||
<label class="rollable" data-roll="d100" data-target="{{skill.proficiency}}" data-label="{{skill.label}}" title="Click to roll a skill check." for="data.skills.{{key}}.value" class="resource-label">{{skill.label}}</label>
|
||||
<input type="text" name="data.skills.{{key}}.proficiency" value="{{skill.proficiency}}" data-dtype="Number"/>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{!-- Owned Items Tab --}}
|
||||
<div class="tab items" data-group="primary" data-tab="items">
|
||||
<div class="tab items" data-group="primary" data-tab="gear">
|
||||
<ol class="items-list">
|
||||
<li class="item flexrow item-header">
|
||||
<div class="item-image"></div>
|
||||
@@ -103,56 +111,9 @@
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
{{!-- Owned Features Tab --}}
|
||||
<div class="tab features" data-group="primary" data-tab="features">
|
||||
<ol class="items-list">
|
||||
<li class="item flexrow item-header">
|
||||
<div class="item-image"></div>
|
||||
<div class="item-name">Name</div>
|
||||
<div class="item-controls">
|
||||
<a class="item-control item-create" title="Create item" data-type="feature"><i class="fas fa-plus"></i> Add item</a>
|
||||
</div>
|
||||
</li>
|
||||
{{#each actor.features as |item id|}}
|
||||
<li class="item flexrow" data-item-id="{{item._id}}">
|
||||
<div class="item-image"><img src="{{item.img}}" title="{{item.name}}" width="24" height="24"/></div>
|
||||
<h4 class="item-name">{{item.name}}</h4>
|
||||
<div class="item-controls">
|
||||
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
{{!-- Owned Spells Tab --}}
|
||||
<div class="tab spells" data-group="primary" data-tab="spells">
|
||||
<ol class="items-list">
|
||||
<li class="item flexrow item-header">
|
||||
<div class="item-image"></div>
|
||||
<div class="item-name">Name</div>
|
||||
<div class="item-controls"></div>
|
||||
</li>
|
||||
{{#each actor.spells as |spells spellLevel|}}
|
||||
<li class="item flexrow item-header">
|
||||
<div class="item-name">Level {{spellLevel}} Spells</div>
|
||||
<div class="item-controls">
|
||||
<a class="item-control item-create" title="Create item" data-type="spell" data-spell-level="{{spellLevel}}"><i class="fas fa-plus"></i> Add LVL {{spellLevel}}</a>
|
||||
</div>
|
||||
</li>
|
||||
{{#each spells as |item id|}}
|
||||
<li class="item flexrow" data-item-id="{{item._id}}">
|
||||
<div class="item-image"><img src="{{item.img}}" title="{{item.name}}" width="24" height="24"/></div>
|
||||
<h4 class="item-name">{{item.name}}</h4>
|
||||
<div class="item-controls">
|
||||
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
{{/each}}
|
||||
</ol>
|
||||
{{!-- Description Tab --}}
|
||||
<div class="tab physical-description" data-group="primary" data-tab="physical-description">
|
||||
{{editor content=data.physicalDescription target="data.physicalDescription" button=true owner=owner editable=editable}}
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user