WIP Hero 6

This commit is contained in:
LeRatierBretonnien 2023-03-21 14:01:27 +01:00
parent 4d3f067bf9
commit d399b29d84
13 changed files with 256 additions and 134 deletions

View File

@ -12,6 +12,7 @@
"TypeLimitation": "Limitation",
"TypeComplication": "Complication",
"TypeEquipment": "Equipment",
"TypeCurrency": "Currency"
"TypeCurrency": "Currency",
"TypeManeuver": "Maneuver"
}
}

View File

@ -36,6 +36,7 @@ export class Hero6ActorSheet extends ActorSheet {
cssClass: this.isEditable ? "editable" : "locked",
system: objectData,
characteristics: this.actor.prepareCharac(),
defenses: duplicate(this.actor.system.defenses),
limited: this.object.limited,
skills: this.actor.getSkills( ),
perks: this.actor.getPerks( ),
@ -43,13 +44,13 @@ export class Hero6ActorSheet extends ActorSheet {
talents: this.actor.getTalents( ),
complications: this.actor.getComplications( ),
martialarts: this.actor.getMartialArts( ),
maneuvers: this.actor.getManeuvers( ),
weapons: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getWeapons()) ),
armors: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getArmors())),
shields: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getShields())),
equipments: this.actor.checkAndPrepareEquipments(duplicate(this.actor.getEquipmentsOnly()) ),
equipments: this.actor.checkAndPrepareEquipments(duplicate(this.actor.getEquipmentsMoneys()) ),
subActors: duplicate(this.actor.getSubActors()),
race: duplicate(this.actor.getRace()),
moneys: duplicate(this.actor.getMoneys()),
encCapacity: this.actor.getEncumbranceCapacity(),
description: await TextEditor.enrichHTML(this.object.system.biodata.description, {async: true}),
motivation: await TextEditor.enrichHTML(this.object.system.biodata.motivation, {async: true}),

View File

@ -274,8 +274,10 @@ export class Hero6Actor extends Actor {
}
return 0;
}
/* ------------------------------------------- */
getManeuvers() {
return this.items.filter(item => item.type == "maneuver" );
}
getEquipments() {
return this.items.filter(item => item.type == "equipment" && item.system.subtype == "equipment");
}
@ -288,7 +290,9 @@ export class Hero6Actor extends Actor {
getShields() {
return this.items.filter(item => item.type == "equipment" && item.system.subtype == "shield");
}
/* ------------------------------------------- */
getEquipmentsMoneys() {
return duplicate(this.items.filter(item => item.type == "equipment" && (item.system.subtype == "equipment" || item.system.subtype == "money")) || [])
}
getEquipmentsOnly() {
return duplicate(this.items.filter(item => item.type == "equipment" && item.system.subtype == "equipment") || [])
}
@ -529,7 +533,7 @@ export class Hero6Actor extends Actor {
let rollData = this.getCommonRollData()
rollData.mode = "item"
rollData.item = duplicate(item)
if ( item.type == "skill") {
if (item.type == "skill") {
this.prepareSkill(rollData.item)
}
this.startRoll(rollData)

View File

@ -4,7 +4,8 @@ export const Hero6_CONFIG = {
equipment: "Equipment",
weapon: "Weapon",
armor: "Armor",
shield: "Shield"
shield: "Shield",
money: "Money"
},
rollCharac : {
"str": "Strength",

View File

@ -91,12 +91,6 @@ Hooks.once("ready", function () {
});
}
// CSS patch for v9
if (game.version) {
let sidebar = document.getElementById("sidebar");
sidebar.style.width = "min-content";
}
welcomeMessage();
Hero6Utility.ready()
Hero6Commands.init()

View File

@ -298,7 +298,7 @@ export class Hero6Utility {
let actor = game.actors.get(rollData.actorId)
// ability/save/size => 0
let diceFormula = "3d6+" + rollData.bonusMalus
let diceFormula = "3d6"
let target = 10
if (rollData.charac) {
target = rollData.charac.roll
@ -306,7 +306,8 @@ export class Hero6Utility {
if (rollData.item) {
target = rollData.item.roll || rollData.item.system.roll
}
target += rollData.bonusMalus
// Performs roll
console.log("Roll formula", diceFormula)
let myRoll = rollData.roll

View File

@ -954,7 +954,7 @@ ul, li {
#sidebar #sidebar-tabs i{
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);
@ -1420,6 +1420,11 @@ Focus FOC: #ff0084
max-width: 8rem;
min-width: 8rem;
}
.item-field-label-long-img {
flex-grow:1;
max-width: 10rem;
min-width: 10rem;
}
.item-field-label-long2 {
flex-grow:1;
max-width: 16rem;

View File

@ -91,7 +91,7 @@
"styles": [
"styles/simple.css"
],
"version": "10.0.14",
"version": "10.0.20",
"compatibility": {
"minimum": "10",
"verified": "10",
@ -99,7 +99,7 @@
},
"title": "Hero System v6 for FoundrtVTT (Official)",
"manifest": "https://www.uberwald.me/gitea/uberwald/fvtt-hero-system-6/raw/branch/main/system.json",
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-hero-system-6/archive/fvtt-hero-system-6-v10.0.14.zip",
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-hero-system-6/archive/fvtt-hero-system-6-v10.0.17.zip",
"url": "https://www.uberwald.me/gitea/uberwald/",
"background": "images/ui/hro6_welcome_page.webp",
"id": "fvtt-hero-system-6"

View File

@ -36,6 +36,7 @@
"value": 10,
"base": 10,
"category": "main",
"hasroll": true,
"realcost": 0,
"activecost": 0
},
@ -43,34 +44,40 @@
"label": "Dexterity",
"value": 10,
"base": 10,
"hasroll": true,
"category": "main"
},
"con": {
"label": "Constitution",
"hasroll": true,
"category": "main",
"value": 10,
"base": 10
},
"int": {
"label": "Intelligence",
"hasroll": true,
"category": "main",
"value": 10,
"base": 10
},
"ego": {
"label": "Ego",
"hasroll": true,
"category": "main",
"value": 10,
"base": 10
},
"pre": {
"label": "Presence",
"hasroll": true,
"category": "main",
"value": 10,
"base": 10
},
"ocv": {
"label": "OCV",
"hasroll": false,
"base": 3,
"autoMod": "0",
"userMod": "0",
@ -79,6 +86,7 @@
},
"dcv": {
"label": "DCV",
"hasroll": false,
"base": 3,
"autoMod": "0",
"userMod": "0",
@ -87,6 +95,7 @@
},
"omcv": {
"label": "OMCV",
"hasroll": false,
"base": 3,
"autoMod": "0",
"userMod": "0",
@ -95,6 +104,7 @@
},
"dmcv": {
"label": "DMCV",
"hasroll": false,
"base": 3,
"autoMod": "0",
"userMod": "0",
@ -103,11 +113,14 @@
},
"spd": {
"label": "Speed",
"hasroll": false,
"value": 2,
"base": 2
},
"pd": {
"label": "PD",
"hasroll": false,
"isdefense": true,
"value": 2,
"base": 2,
"pd_nonresistant_total": 0,
@ -117,6 +130,8 @@
},
"ed": {
"label": "ED",
"hasroll": false,
"isdefense": true,
"value": 2,
"base": 2,
"ed_nonresistant_total": 0,
@ -126,21 +141,39 @@
},
"rec": {
"label": "REC",
"hasroll": false,
"value": 4,
"base": 4
},
"end": {
"label": "END",
"hasroll": false,
"isvital": true,
"damage": 0,
"value": 20,
"max": 20
},
"stun": {
"label": "STUN",
"hasroll": false,
"isvital": true,
"damage": 0,
"value": 20,
"max": 20
},
"other": {
"label": "OTHER",
"hasroll": false,
"isvital": true,
"damage": 0,
"value": 20,
"max": 20
},
"body": {
"label": "Body",
"label": "BODY",
"hasroll": false,
"isvital": true,
"damage": 0,
"value": 10,
"max": 10,
"loc": {
@ -164,27 +197,59 @@
},
"running": {
"label": "Running",
"hasroll": false,
"value": 12,
"base": 12
},
"swimming": {
"label": "Swimming",
"hasroll": false,
"value": 4,
"base": 4
},
"leaping": {
"label": "Leaping",
"hasroll": false,
"value": 4,
"base": 4,
"leaping_horizontal_base": 0,
"leaping_horizontal_total": 0,
"leaping_vertical_base": 0,
"leaping_vertical_total": 0
},
"flying": {
"label": "Flying",
}
}
},
"defenses": {
"defenses": {
"mental": {
"label": "Mental",
"value": 0,
"base": 0
"resistant": ""
},
"power": {
"label": "Power",
"value": 0,
"resistant": ""
},
"flash": {
"label": "Flash",
"value": 0,
"resistant": ""
},
"def1": {
"label": "N/A",
"value": 0,
"resistant": ""
},
"def2": {
"label": "N/A",
"value": 0,
"resistant": ""
},
"def3": {
"label": "N/A",
"value": 0,
"resistant": ""
}
}
},
@ -193,7 +258,8 @@
"character": {
"templates": [
"biodata",
"characteristics"
"characteristics",
"defenses"
],
"subactors": []
}
@ -205,11 +271,11 @@
"talent",
"power",
"advantage",
"maneuver",
"martialart",
"limitation",
"complication",
"equipment",
"currency"
"equipment"
],
"templates": {
"common": {
@ -239,11 +305,14 @@
"items": {}
}
},
"currency": {
"quantity": 0,
"maneuver": {
"templates": [
"common"
]
],
"pha": "",
"ocv": 0,
"dcv" : 0,
"active": false
},
"advantage": {
"templates": [
@ -314,15 +383,6 @@
"impenetrable": 0,
"value": 0
},
"maneuver": {
"templates": [
"common"
],
"phase": 0,
"ocv": "+0",
"dcv": "+0",
"active": false
},
"movement": {
"templates": [
"common"

View File

@ -89,32 +89,39 @@
{{!-- Combat Tab --}}
<div class="tab combat" data-group="primary" data-tab="combat">
<div class="flexcol">
<div class="grid grid2col">
<div>
<ul class="stat-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header-long">
<h3><label class="items-title-text">Weapons</label></h3>
<span class="item-field-label-long-img">
<label class="">Maneuvers</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Ability</label>
<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">Range</label>
<label class="short-label">Effects</label>
</span>
</li>
{{#each equippedWeapons as |weapon key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{weapon._id}}">
{{#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="{{weapon.img}}" /></a>
<span class="item-name-label-long"><a class ="roll-weapon">{{weapon.name}}</a></span>
src="{{maneuver.img}}" /></a>
<span class="item-field-label-long">{{maneuver.name}}</span>
<span class="item-field-label-short">{{weapon.system.ability}}</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">{{perk.system.range}}</span>
<span class="item-field-label-medium">{{maneuver.system.effects}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
@ -124,40 +131,74 @@
</div>
<div>
<ul class="stat-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header-long">
<h3><label class="items-title-text">Feats</label></h3>
</span>
<span class="item-field-label-medium">
<label class="short-label">Feature Die?</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">SL?</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">SL</label>
</span>
<ul class="item-list alternate-list">
<li class="flexrow item">
<label class="item-field-label-medium">SPD</label><label>{{system.characteristics.spd.value}}</label>
</li>
{{#each feats as |feat key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{feat._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{feat.img}}" /></a>
<span class="item-name-label-long">{{feat.name}}</span>
<span class="item-field-label-medium">{{upperFirst feat.system.isfeatdie}}</span>
<span class="item-field-label-medium">{{upperFirst feat.system.issl}}</span>
<span class="item-field-label-medium">{{feat.system.sl}}</span>
<div class="item-filler">&nbsp;</div>
<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>
</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="">Vitals</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">Damage</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" 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">
<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>
</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" 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}}">
<span class="item-field-label-long">{{def.label}}</span>
<span class="item-field-label-short">{{def.value}}</span>
<input type="text" class="item-field-label-short" name="system.defenses.{{key}}.resistant" value="{{def.resistant}}" data-dtype="Number" />
</li>
{{/each}}
</ul>
</div>
</div>
</div>
</div>
</div>
@ -167,11 +208,11 @@
<div class="charac-item">
<ul>
<li class="item flexrow list-item items-title-bg">
<span class="item-field-label-short">
<h3><label class="item-field-label-short">Value</label></h3>
<span class="item-field-label-medium">
<label class="">Value</label>
</span>
<span class="item-field-label-medium">
<label class="item-field-label-long">characteristic</label>
<label class="item-field-label-medium">CHAR</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Base</label>
@ -198,8 +239,8 @@
<ul class="stat-list alternate-list item-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Skills</label></h3>
<span class="item-field-label-long-img">
<label class="">Skills</label>
</span>
<span class="item-field-label-long">
<label class="short-label">CHAR</label>
@ -213,8 +254,8 @@
<li class="item stat flexrow list-item list-item-shadow" data-item-id="{{skill._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{skill.img}}" /></a>
<span class="item-name-label">{{skill.name}}</span>
<span class="item-field-label-short">{{upper skill.charac}}</span>
<span class="item-field-label-long">{{skill.name}}</span>
<span class="item-field-label-medium">{{upper skill.charac}}</span>
<span class="item-field-label-short"><a class="roll-item" data-type="skill"><i class="fas fa-dice"></i>{{skill.roll}}-</a></span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
@ -230,8 +271,8 @@
<ul class="stat-list alternate-list item-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Perks</label></h3>
<span class="item-field-label-long-img">
<label class="">Perks</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Roll</label>
@ -261,8 +302,8 @@
<ul class="stat-list alternate-list item-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Talents</label></h3>
<span class="item-field-label-long-img">
<label class="items-title-text">Talents</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Roll</label>
@ -292,8 +333,8 @@
<ul class="stat-list alternate-list item-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Martial Arts</label></h3>
<span class="item-field-label-long-img">
<label class="">Martial Arts</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Roll</label>
@ -323,7 +364,9 @@
<ul class="stat-list alternate-list item-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-img sheet-competence-img">&nbsp;</span>
<span class="item-name-img">
<label class="">&nbsp;</label>
</span>
<span class="item-field-label-short">
<label class="item-field-label-short">Cost</label>
</span>
@ -345,7 +388,7 @@
<span class="item-field-label-long4">{{{power.enrichDescription}}}
</span>
{{#if power.system.hasroll}}
<span class="item-field-label-short"><a class="roll-item" data-type="perk"><i class="fas fa-dice"></i>{{power.system.roll}}-</a></span>
<span class="item-field-label-short"><a class="roll-item" data-type="power"><i class="fas fa-dice"></i>{{power.system.roll}}-</a></span>
{{else}}
<span class="item-field-label-short">&nbsp;</span>
{{/if}}
@ -364,8 +407,8 @@
<ul class="stat-list alternate-list item-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Complications</label></h3>
<span class="item-field-label-long-img">
<label class="">Complications</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Roll</label>
@ -399,38 +442,6 @@
<span class="small-label">Capacity : {{encCapacity}}</span>
</div>
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Money</label></h3>
</span>
<span class="item-field-label-long">
<label class="short-label">Qty</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="currency" title="Create Item"><i class="fas fa-plus"></i></a>
</div>
</li>
{{#each moneys as |money key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{money._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{money.img}}" /></a>
<span class="item-name-label">{{money.name}}</span>
<span class="item-field-label-long"><label>
{{money.system.quantity}}
(<a class="quantity-minus plus-minus-button"> -</a>/<a class="quantity-plus plus-minus-button">+</a>)
</label>
</span>
<div class="item-filler">&nbsp;</div>
<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>
{{> systems/fvtt-hero-system-6/templates/partials/partial-actor-equipment-section.hbs title="Weapons" items=weapons}}
{{> systems/fvtt-hero-system-6/templates/partials/partial-actor-equipment-section.hbs title="Armor" items=armors}}

View File

@ -0,0 +1,40 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{> systems/fvtt-hero-system-6/templates/partials/partial-item-nav.hbs}}
{{!-- Sheet Body --}}
<section class="sheet-body">
{{> systems/fvtt-hero-system-6/templates/partials/partial-item-description.hbs}}
<div class="tab details" data-group="primary" data-tab="details">
<ul>
<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"/>
</li>
<li class="flexrow"><label class="item-field-label-medium">OCV</label>
<input type="text" class="item-field-label-medium" name="system.ocv" value="{{system.ocv}}" data-dtype="Number"/>
</li>
<li class="flexrow"><label class="item-field-label-medium">DCV</label>
<input type="text" class="item-field-label-medium" name="system.dcv" value="{{system.dcv}}" data-dtype="Number"/>
</li>
<li class="flexrow"><label class="item-field-label-medium">Effects</label>
<input type="text" class="item-field-label-long" name="system.effects" value="{{system.effects}}" data-dtype="String"/>
</li>
{{> systems/fvtt-hero-system-6/templates/partials/partial-item-cost.hbs}}
</ul>
</div>
</section>
</form>

View File

@ -1,7 +1,7 @@
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">{{title}}</label></h3>
<span class="item-field-label-long-img">
<label class="">{{title}}</label>
</span>
<span class="item-field-label-medium">
<label class="item-field-label-medium">Value</label>

View File

@ -1,7 +1,7 @@
<li class="item stat flexrow list-item list-item-shadow" data-attr-key="{{key}}">
<input type="text" class="item-field-label-short" name="system.characteristics.{{key}}.value" value="{{charac.value}}" data-dtype="Number"/>
<input type="text" class="item-field-label-medium" name="system.characteristics.{{key}}.value" value="{{charac.value}}" data-dtype="Number"/>
<span class="item-field-label-medium" name="{{key}}">
<h4 class="item-field-label-medium margin-item-list">{{charac.label}}</a></h4>
@ -9,7 +9,11 @@
<h4 class="item-field-label-short margin-item-list">{{charac.base}}</h4>
{{#if charac.hasroll}}
<h4 class="item-field-label-short margin-item-list"><a class="roll-charac" data-charac-key="{{key}}"><i class="fas fa-dice"></i>{{charac.roll}}-</a></h4>
{{else}}
<h4 class="item-field-label-short margin-item-list">&nbsp;</h4>
{{/if}}
<input type="text" class="item-field-label-long2" name="system.characteristics.{{key}}.notes" value="{{charac.notes}}" data-dtype="String"/>