Combat tab

This commit is contained in:
LeRatierBretonnien 2023-03-21 20:43:41 +01:00
parent d399b29d84
commit e0adf04753
8 changed files with 268 additions and 72 deletions

View File

@ -14,8 +14,8 @@ export class Hero6ActorSheet extends ActorSheet {
return mergeObject(super.defaultOptions, {
classes: ["fvtt-hero-system-6", "sheet", "actor"],
template: "systems/fvtt-hero-system-6/templates/actors/actor-sheet.hbs",
width: 960,
height: 720,
width: 1124,
height: 916,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "main" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editScore: true
@ -37,6 +37,7 @@ export class Hero6ActorSheet extends ActorSheet {
system: objectData,
characteristics: this.actor.prepareCharac(),
defenses: duplicate(this.actor.system.defenses),
movements: duplicate(this.actor.system.movements),
limited: this.object.limited,
skills: this.actor.getSkills( ),
perks: this.actor.getPerks( ),
@ -180,7 +181,11 @@ export class Hero6ActorSheet extends ActorSheet {
html.find('.update-field').change(ev => {
const fieldName = $(ev.currentTarget).data("field-name");
let value = Number(ev.currentTarget.value);
const fieldType = $(ev.currentTarget).data("dtype");
let value = ev.currentTarget.value
if (fieldType.toLowerCase() == "Number") {
value = Number(value)
}
this.actor.update( { [`${fieldName}`]: value } );
});
}

View File

@ -274,9 +274,13 @@ export class Hero6Actor extends Actor {
}
return 0;
}
/* ------------------------------------------- */
getManeuvers() {
return this.items.filter(item => item.type == "maneuver" );
let maneuvers = {
general: this.items.filter(item => item.type == "maneuver" && item.system.maneuvertype == "general"),
offensive: this.items.filter(item => item.type == "maneuver" && item.system.maneuvertype == "offensive"),
defensive: this.items.filter(item => item.type == "maneuver" && item.system.maneuvertype == "defensive")
}
return maneuvers
}
getEquipments() {
return this.items.filter(item => item.type == "equipment" && item.system.subtype == "equipment");

View File

@ -7,6 +7,11 @@ export const Hero6_CONFIG = {
shield: "Shield",
money: "Money"
},
maneuverTypes: {
"general": "General",
"offensive": "Offensive",
"defensive": "Defensive"
},
rollCharac : {
"str": "Strength",
"dex": "Dexterity",

View File

@ -952,9 +952,9 @@ ul, li {
}
#sidebar #sidebar-tabs i{
width: 25px;
/*width: 25px;*/
height: 25px;
/*display: inline-block;*/
display: inline-block;
background-position:center;
background-size:cover;
text-shadow: 1px 1px 0 rgba(0,0,0,0.75);

View File

@ -91,7 +91,7 @@
"styles": [
"styles/simple.css"
],
"version": "10.0.20",
"version": "10.0.28",
"compatibility": {
"minimum": "10",
"verified": "10",

View File

@ -26,6 +26,12 @@
"appearance": "",
"description": "",
"notes": "",
"points": 0,
"complications": 0,
"xpearned": 0,
"xpspent": 0,
"combatskills": "",
"presenceattack": "",
"gmnotes": ""
}
},
@ -36,6 +42,9 @@
"value": 10,
"base": 10,
"category": "main",
"strdice": "",
"lift": "",
"strend": 0,
"hasroll": true,
"realcost": 0,
"activecost": 0
@ -197,18 +206,21 @@
},
"running": {
"label": "Running",
"ismovement": true,
"hasroll": false,
"value": 12,
"base": 12
},
"swimming": {
"label": "Swimming",
"ismovement": true,
"hasroll": false,
"value": 4,
"base": 4
},
"leaping": {
"label": "Leaping",
"ismovement": true,
"hasroll": false,
"value": 4,
"base": 4,
@ -219,6 +231,32 @@
}
}
},
"movements": {
"movements": {
"fly": {
"label": "Fly",
"value": 0
},
"teleport": {
"label": "Teleport",
"value": 0
},
"tunnel": {
"label": "Tunnel",
"value": 0
},
"move1": {
"label": "N/A",
"iseditable": true,
"value": 0
},
"move2": {
"label": "N/A",
"iseditable": true,
"value": 0
}
}
},
"defenses": {
"defenses": {
"mental": {
@ -239,16 +277,19 @@
"def1": {
"label": "N/A",
"value": 0,
"iseditable": true,
"resistant": ""
},
"def2": {
"label": "N/A",
"value": 0,
"iseditable": true,
"resistant": ""
},
"def3": {
"label": "N/A",
"value": 0,
"iseditable": true,
"resistant": ""
}
}
@ -259,7 +300,8 @@
"templates": [
"biodata",
"characteristics",
"defenses"
"defenses",
"movements"
],
"subactors": []
}
@ -309,6 +351,7 @@
"templates": [
"common"
],
"maneuvertype": "general",
"pha": "",
"ocv": 0,
"dcv" : 0,

View File

@ -40,29 +40,51 @@
<input type="text" class="item-field-label-long3" name="system.biodata.hair" value="{{system.biodata.hair}}" data-dtype="String" />
</li>
</ul>
</div>
<div>
<ul class="item-list alternate-list">
<li class="flexrow item">
<label class="item-field-label-medium">Gender</label>
<input type="text" class="item-field-label-medium" name="system.biodata.gender" value="{{system.biodata.gender}}" data-dtype="String" />
</li>
<li class="item flexrow">
<label class="item-field-label-medium">Height</label>
<input type="text" class="item-field-label-medium" name="system.biodata.height" value="{{system.biodata.height}}" data-dtype="String" />
</li>
<li class="item flexrow">
<label class="item-field-label-medium">Mass</label>
<input type="text" class="item-field-label-medium" name="system.biodata.mass" value="{{system.biodata.mass}}" data-dtype="String" />
</li>
<li class="item flexrow">
<label class="item-field-label-medium">Eyes</label>
<input type="text" class="item-field-label-medium" name="system.biodata.eyes" value="{{system.biodata.eyes}}" data-dtype="String" />
</li>
</ul>
</div>
</div>
<div>
<ul class="item-list alternate-list">
<li class="flexrow item">
<label class="item-field-label-medium">Gender</label>
<input type="text" class="item-field-label-medium" name="system.biodata.gender" value="{{system.biodata.gender}}" data-dtype="String" />
</li>
<li class="item flexrow">
<label class="item-field-label-medium">Height</label>
<input type="text" class="item-field-label-medium" name="system.biodata.height" value="{{system.biodata.height}}" data-dtype="String" />
</li>
<li class="item flexrow">
<label class="item-field-label-medium">Mass</label>
<input type="text" class="item-field-label-medium" name="system.biodata.mass" value="{{system.biodata.mass}}" data-dtype="String" />
</li>
<li class="item flexrow">
<label class="item-field-label-medium">Eyes</label>
<input type="text" class="item-field-label-medium" name="system.biodata.eyes" value="{{system.biodata.eyes}}" data-dtype="String" />
</li>
</ul>
</div>
</div>
<div class="flexrow">
<ul class="item-list alternate-list">
<li class="item flexrow">
<label class="item-field-label-medium">Points</label>
<input type="text" class="item-field-label-short" name="system.biodata.points" value="{{system.biodata.origin}}" data-dtype="Number" />
<label class="">&nbsp;</label>
<label class="item-field-label-medium">Complications</label>
<input type="text" class="item-field-label-short" name="system.biodata.complications" value="{{system.biodata.complications}}" data-dtype="Number" />
<label class="">&nbsp;</label>
<label class="item-field-label-medium">XP Earned</label>
<input type="text" class="item-field-label-short" name="system.biodata.xpearned" value="{{system.biodata.xpearned}}" data-dtype="Number" />
<label class="">&nbsp;</label>
<label class="item-field-label-medium">XP Spent</label>
<input type="text" class="item-field-label-short" name="system.biodata.xpspent" value="{{system.biodata.xpspent}}" data-dtype="Number" />
<label class="">&nbsp;</label>
</li>
</ul>
</div>
</div>
</div>
</div>
@ -91,49 +113,69 @@
<div class="tab combat" data-group="primary" data-tab="combat">
<div class="grid grid2col">
<div>
<ul class="stat-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-field-label-long-img">
<label class="">Maneuvers</label>
</span>
<span class="item-field-label-short">
<label class="short-label">PHA</label>
</span>
<span class="item-field-label-short">
<label class="short-label">OCV</label>
</span>
<span class="item-field-label-short">
<label class="short-label">DCV</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">Effects</label>
</span>
<div>
<ul class="item-list alternate-list">
<li class="flexrow item">
<label class="item-field-label-medium">STR Dice</label>
<input type="text" class="item-field-label-short update-field" data-field-name="system.characteristics.str.strdice" value="{{characteristics.str.strdice}}" data-dtype="String" />
<label class="item-field-label-short">&nbsp;</label>
<label class="item-field-label-medium">Lift</label>
<input type="text" class="item-field-label-short update-field" data-field-name="system.characteristics.str.lift" value="{{characteristics.str.lift}}" data-dtype="String" />
<label class="item-field-label-short">&nbsp;</label>
<label class="item-field-label-medium">STR END</label>
<input type="text" class="item-field-label-short update-field" data-field-name="system.characteristics.str.strend" value="{{characteristics.str.strend}}" data-dtype="Number" />
</li>
{{#each maneuvers as |maneuver key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{maneuver._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{maneuver.img}}" /></a>
<span class="item-field-label-long">{{maneuver.name}}</span>
<span class="item-field-label-short">{{maneuver.system.pha}}</span>
<span class="item-field-label-short">{{maneuver.system.ocv}}</span>
<span class="item-field-label-short">{{maneuver.system.dcv}}</span>
<span class="item-field-label-medium">{{maneuver.system.effects}}</span>
<div class="item-controls item-controls-fixed">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
<li class="flexrow item">
<label class="item-field-label-long">Presence attack</label>
<input type="text" class="item-field-label-short update-field" data-field-name="system.biodata.presenceattack" value="{{system.biodata.presenceattack}}" data-dtype="Number" />
</li>
{{/each}}
</ul>
</div>
{{#each maneuvers as |mlist key|}}
<ul class="stat-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-field-label-long-img">
<label class="">{{upperFirst key}} Maneuvers</label>
</span>
<span class="item-field-label-short">
<label class="short-label">PHA</label>
</span>
<span class="item-field-label-short">
<label class="short-label">OCV</label>
</span>
<span class="item-field-label-short">
<label class="short-label">DCV</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">Effects</label>
</span>
</li>
{{#each mlist as |maneuver key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{maneuver._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{maneuver.img}}" /></a>
<span class="item-field-label-long">{{maneuver.name}}</span>
<span class="item-field-label-short">{{maneuver.system.pha}}</span>
<span class="item-field-label-short">{{maneuver.system.ocv}}</span>
<span class="item-field-label-short">{{maneuver.system.dcv}}</span>
<span class="item-field-label-medium">{{maneuver.system.effects}}</span>
<div class="item-controls item-controls-fixed">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
{{/each}}
</div>
<div>
<ul class="item-list alternate-list">
<li class="flexrow item">
<label class="item-field-label-medium">SPD</label><label>{{system.characteristics.spd.value}}</label>
<label class="item-field-label-medium">SPD</label>
<input type="text" class="item-field-label-short update-field" data-field-name="system.characteristics.spd.value" value="{{characteristics.spd.value}}" data-dtype="Number" />
</li>
</ul>
@ -148,47 +190,53 @@
<label class="short-label">Val.</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Damage</label>
<label class="short-label">Dam.</label>
</span>
</li>
{{#each characteristics as |char key|}}
{{#if char.isvital}}
<li class="item flexrow list-item list-item-shadow" data-charac-key="{{key}}">
<span class="item-field-label-long">{{char.label}}</span>
<span class="item-field-label-short">{{char.value}}</span>
<input type="text" class="item-field-label-short update-field" data-field-name="system.characteristics.{{key}}.value" value="{{char.value}}" data-dtype="Number" />
<input type="text" class="item-field-label-short" name="system.characteristics.{{key}}.damage" value="{{char.damage}}" data-dtype="Number" />
</li>
{{/if}}
{{/each}}
</ul>
</div>
<div>
<ul class="stat-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-field-label-long-img">
<span class="item-field-label-long">
<label class="">Defenses</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Val.</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Resistant</label>
<label class="short-label">Res.</label>
</span>
</li>
{{#each characteristics as |char key|}}
{{#if char.isdefense}}
<li class="item flexrow list-item list-item-shadow" data-charac-key="{{key}}">
<span class="item-field-label-long">{{char.label}}</span>
<span class="item-field-label-short">{{char.value}}</span>
<input type="text" class="item-field-label-short update-field" data-field-name="system.characteristics.{{key}}.value" value="{{char.value}}" data-dtype="Number" />
<input type="text" class="item-field-label-short" name="system.characteristics.{{key}}.resistant" value="{{char.resistant}}" data-dtype="Number" />
</li>
{{/if}}
{{/each}}
{{#each defenses as |def key|}}
<li class="item flexrow list-item list-item-shadow" data-defense-key="{{key}}">
{{#if def.iseditable}}
<input type="text" class="item-field-label-long update-field" data-field-name="system.defenses.{{key}}.label" value="{{def.label}}" data-dtype="String" />
{{else}}
<span class="item-field-label-long">{{def.label}}</span>
<span class="item-field-label-short">{{def.value}}</span>
{{/if}}
<input type="text" class="item-field-label-short update-field" data-field-name="system.defenses.{{key}}.value" value="{{def.value}}" data-dtype="Number" />
<input type="text" class="item-field-label-short" name="system.defenses.{{key}}.resistant" value="{{def.resistant}}" data-dtype="Number" />
</li>
{{/each}}
@ -197,6 +245,87 @@
</div>
</div>
<div class="flexrow">
<label class="item-field-label-short">OCV</label>
<input type="text" class="item-field-label-short update-field" data-field-name="system.characteristics.ocv.value" value="{{characteristics.ocv.value}}" data-dtype="Number" />
<label class="item-field-label-short">&nbsp;</label>
<label class="item-field-label-short">DCV</label>
<input type="text" class="item-field-label-short update-field" data-field-name="system.characteristics.dcv.value" value="{{characteristics.dcv.value}}" data-dtype="Number" />
<label class="item-field-label-short">&nbsp;</label>
<label class="item-field-label-short">OMCV</label>
<input type="text" class="item-field-label-short update-field" data-field-name="system.characteristics.omcv.value" value="{{characteristics.omcv.value}}" data-dtype="Number" />
<label class="item-field-label-short">&nbsp;</label>
<label class="item-field-label-short">DMCV</label>
<input type="text" class="item-field-label-short update-field" data-field-name="system.characteristics.dmcv.value" value="{{characteristics.dmcv.value}}" data-dtype="Number" />
</div>
<div class="flexrow">
<label class="item-field-label-long">Combat Skill Levels</label>
<textarea rows="4" type="text" class="padd-right" name="system.biodata.combatskills"
data-dtype="String">{{system.biodata.combatskills}}</textarea>
</div>
<div class="grid grid2col">
<div>
<ul class="stat-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-field-label-long">
<label class="">Senses</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Val.</label>
</span>
</li>
{{#each senses as |sense key|}}
<li class="item flexrow list-item list-item-shadow" data-charac-key="{{key}}">
<span class="item-field-label-long">{{sense.label}}</span>
<span class="item-field-label-short">{{sense.value}}</span>
</li>
{{/each}}
</ul>
</div>
<div>
<ul class="stat-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-field-label-long">
<label class="">Movement</label>
</span>
<span class="item-field-label-short">
<label class="short-label">C.</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Non-C.</label>
</span>
</li>
{{#each characteristics as |char key|}}
{{#if char.ismovement}}
<li class="item flexrow list-item list-item-shadow" data-charac-key="{{key}}">
<span class="item-field-label-long">{{char.label}}</span>
<input type="text" class="item-field-label-short update-field" data-field-name="system.characteristics.{{key}}.value" value="{{char.value}}" data-dtype="Number" />
<input type="text" class="item-field-label-short" value="{{mul char.value 2}}" disabled data-dtype="Number" />
</li>
{{/if}}
{{/each}}
{{#each movements as |move key|}}
<li class="item flexrow list-item list-item-shadow" data-charac-key="{{key}}">
{{#if move.iseditable}}
<input type="text" class="item-field-label-long update-field" data-field-name="system.movements.{{key}}.label" value="{{move.label}}" data-dtype="String" />
{{else}}
<span class="item-field-label-long">{{move.label}}</span>
{{/if}}
<input type="text" class="item-field-label-short update-field" data-field-name="system.movements.{{key}}.value" value="{{move.value}}" data-dtype="Number" />
<input type="text" class="item-field-label-short" value="{{mul move.value 2}}" disabled data-dtype="Number" />
</li>
{{/each}}
</ul>
</div>
</div>
</div>
</div>

View File

@ -16,6 +16,16 @@
<div class="tab details" data-group="primary" data-tab="details">
<ul>
<li class="flexrow"><label class="item-field-label-long">Type</label>
<select class="item-field-label-long" type="text" name="system.maneuvertype" value="{{system.maneuvertype}}" data-dtype="String">
{{#select system.maneuvertype}}
{{#each config.maneuverTypes as |name key|}}
<option value="{{key}}">{{name}}</option>
{{/each}}
{{/select}}
</select>
</li>
<li class="flexrow"><label class="item-field-label-medium">PHA</label>
<input type="text" class="item-field-label-medium" name="system.pha" value="{{system.pha}}" data-dtype="String"/>