Enhance march

This commit is contained in:
LeRatierBretonnien 2023-03-14 19:23:19 +01:00
parent b23d0836fe
commit 3489dc6254
10 changed files with 158 additions and 91 deletions

View File

@ -1,3 +1,17 @@
{
}
{
"ACTOR": {
"TypeCharacter": "Character"
},
"ITEM": {
"TypeSkill": "Skill",
"TypePerk": "Perk",
"TypePower": "Power",
"TypeTalent": "Talent",
"TypeAdvantage": "Advantage",
"TypeMartialart": "Martial art",
"TypeLimitation": "Limitation",
"TypeComplication": "Complication",
"TypeEquipment": "Equipment",
"TypeCurrency": "Currency"
}
}

View File

@ -91,7 +91,7 @@ export class Hero6Actor extends Actor {
/* -------------------------------------------- */
getMoneys() {
let comp = this.items.filter(item => item.type == 'money');
let comp = this.items.filter(item => item.type == 'currency');
Hero6Utility.sortArrayObjectsByName(comp)
return comp;
}
@ -163,10 +163,52 @@ export class Hero6Actor extends Actor {
}
return item;
}
/* -------------------------------------------- */
prepareSkill(skill) {
skill.roll = 0
skill.charac = "N/A"
if (skill.system.skillfamiliarity) {
skill.roll = 8;
} else if (skill.system.skillprofiency) {
skill.roll = 10;
} else if (skill.system.skilltype == "agility") {
skill.charac = "DEX"
let charac = duplicate(this.system.characteristics.dex)
this.prepareCharacValues(charac)
skill.roll = charac.roll
} else if (skill.system.skilltype == "interaction") {
skill.charac = "PRE"
let charac = duplicate(this.system.characteristics.pre)
this.prepareCharacValues(charac)
skill.roll = charac.roll
} else if (skill.system.skilltype == "intellect") {
skill.charac = "INT"
let charac = duplicate(this.system.characteristics.int)
this.prepareCharacValues(charac)
skill.roll = charac.roll
} else if (skill.system.skilltype == "background") {
skill.roll = 11
} else if (skill.system.skilltype == "custom") {
if (skill.system.characteristic == "manual") {
skill.roll = skill.system.base
} else {
skill.charac = skill.system.characteristic
let charac = duplicate(this.system.characteristics[skill.system.characteristic])
this.prepareCharacValues(charac)
skill.roll = charac.roll
}
}
if (skill.system.levels > 0) {
skill.roll += skill.system.levels
}
}
/* -------------------------------------------- */
getSkills() {
let comp = duplicate(this.items.filter(item => item.type == 'skill') || [])
for (let skill of comp) {
this.prepareSkill(skill)
}
Hero6Utility.sortArrayObjectsByName(comp)
return comp
}
@ -177,8 +219,8 @@ export class Hero6Actor extends Actor {
}
async getPowers() {
let comp = duplicate(this.items.filter(item => item.type == 'power') || [])
for(let c of comp) {
c.enrichDescription = c.name + "<br>" + await TextEditor.enrichHTML(c.system.description, {async: true})
for (let c of comp) {
c.enrichDescription = c.name + "<br>" + await TextEditor.enrichHTML(c.system.description, { async: true })
}
Hero6Utility.sortArrayObjectsByName(comp)
return comp
@ -192,7 +234,7 @@ export class Hero6Actor extends Actor {
let comp = duplicate(this.items.filter(item => item.type == 'martialart') || [])
Hero6Utility.sortArrayObjectsByName(comp)
return comp
}
}
getComplications() {
let comp = duplicate(this.items.filter(item => item.type == 'complication') || [])
Hero6Utility.sortArrayObjectsByName(comp)
@ -296,7 +338,7 @@ export class Hero6Actor extends Actor {
/* -------------------------------------------- */
async incDecHP(formula) {
let dmgRoll = new Roll(formula+"[dark-starsorange]").roll({ async: false })
let dmgRoll = new Roll(formula + "[dark-starsorange]").roll({ async: false })
await Hero6Utility.showDiceSoNice(dmgRoll, game.settings.get("core", "rollMode"))
let hp = duplicate(this.system.secondary.hp)
hp.value = Number(hp.value) + Number(dmgRoll.total)
@ -377,14 +419,14 @@ export class Hero6Actor extends Actor {
}
/* -------------------------------------------- */
prepareCharacValues( charac) {
prepareCharacValues(charac) {
charac.total = charac.value
charac.roll = 9 + Math.floor((charac.value)/5)
charac.roll = 9 + Math.floor((charac.value) / 5)
}
prepareCharac() {
let characs = duplicate(this.system.characteristics)
for(let key in characs) {
this.prepareCharacValues( characs[key])
for (let key in characs) {
this.prepareCharacValues(characs[key])
}
return characs
}
@ -483,10 +525,13 @@ export class Hero6Actor extends Actor {
}
/* -------------------------------------------- */
rollItem(itemId) {
let item = this.items.get( itemId)
let item = this.items.get(itemId)
let rollData = this.getCommonRollData()
rollData.mode = "item"
rollData.item = duplicate(item)
if ( item.type == "skill") {
this.prepareSkill(rollData.item)
}
this.startRoll(rollData)
}

View File

@ -46,7 +46,7 @@ export class Hero6Utility {
return __locationNames[key]
})
Handlebars.registerHelper('isSkillCustom', function (key) {
if (key == "custom" || key == "background" ) {
if (key == "custom" ) {
return true;
}
return false
@ -304,7 +304,7 @@ export class Hero6Utility {
target = rollData.charac.roll
}
if (rollData.item) {
target = rollData.item.system.roll
target = rollData.item.roll || rollData.item.system.roll
}
// Performs roll
@ -328,9 +328,7 @@ export class Hero6Utility {
if ( myRoll.terms[0].total == 18) { // Always a failure
rollData.isSuccess = false
}
if (rollData.isSuccess ) {
rollData.margin = target - rollData.result
}
rollData.margin = target - rollData.result
let msg = await this.createChatWithRollMode(rollData.alias, {
content: await renderTemplate(`systems/fvtt-hero-system-6/templates/chat/chat-generic-result.hbs`, rollData)

View File

@ -447,7 +447,7 @@ form .form-group label {
.window-app .window-content, .window-app.sheet .window-content .sheet-body{
font-size: 0.8rem;
background: url("../images/ui/pc_sheet_bg.webp") repeat left top;
/*background: url("../images/ui/pc_sheet_bg.webp") repeat left top;*/
background: rgba(228, 240, 240, 0.75);
color: rgba(66, 66, 64, 0.95);
}
@ -546,7 +546,7 @@ ul, li {
}
.sheet li {
margin: 0.010rem;
margin: 0.1rem;
padding: 0.25rem;
}
.header-fields li {
@ -574,10 +574,10 @@ ul, li {
}
.list-item {
margin: 0.125rem;
margin: 0.2rem;
/*box-shadow: inset 0px 0px 1px #00000096;*/
/*border-radius: 0.25rem;*/
padding: 0.125rem;
padding: 0.2rem;
flex: 1 1 5rem;
display: flex !important;
}
@ -1425,6 +1425,11 @@ Focus FOC: #ff0084
max-width: 16rem;
min-width: 16rem;
}
.item-field-label-long3 {
flex-grow:1;
max-width: 30rem;
min-width: 30rem;
}
.item-field-label-long4 {
flex-grow:1;
max-width: 40rem;
@ -1451,3 +1456,7 @@ Focus FOC: #ff0084
min-width:2rem;
max-width: 2rem;
}
.biodata-portrait {
min-height: 512px;
min-width: 256px;
}

View File

@ -91,7 +91,7 @@
"styles": [
"styles/simple.css"
],
"version": "10.0.13",
"version": "10.0.14",
"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.13.zip",
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-hero-system-6/archive/fvtt-hero-system-6-v10.0.14.zip",
"url": "https://www.uberwald.me/gitea/uberwald/",
"background": "images/ui/hro6_welcome_page.webp",
"id": "fvtt-hero-system-6"

View File

@ -208,7 +208,8 @@
"martialart",
"limitation",
"complication",
"equipment"
"equipment",
"currency"
],
"templates": {
"common": {
@ -238,6 +239,12 @@
"items": {}
}
},
"currency": {
"quantity": 0,
"templates": [
"common"
]
},
"advantage": {
"templates": [
"common"

View File

@ -6,56 +6,58 @@
<div class="flexrow">
<img class="profile-img margin-image-right" src="{{img}}" data-edit="img" title="{{name}}" />
<div class="flexcol">
<h1 class="charname margin-image-right"><input name="name" type="text" value="{{name}}" placeholder="Name" /></h1>
<h1 class="charname "><input name="name" type="text" value="{{name}}" placeholder="Name" /></h1>
<div class="flexrow">
<ul class="item-list alternate-list">
<li class="item flexrow">
<label class="generic-label">Alternate IDs</label>
<input type="text" class="" name="system.biodata.alternateids" value="{{system.biodata.origin}}"
<label class="item-field-label-medium">Alternate IDs</label>
<input type="text" class="item-field-label-long4" name="system.biodata.alternateids" value="{{system.biodata.origin}}"
data-dtype="String" />
</li>
</ul>
<div class="grid grid-2col">
</div>
<div class="grid grid-2col">
<div>
<ul class="item-list alternate-list">
<li class="flexrow item">
<label class="item-field-label-medium">Campaign</label>
<input type="text" class="item-field-label-long3" name="system.biodata.campaign" value="{{system.biodata.campaign}}" data-dtype="String" />
</li>
<li class="flexrow item">
<label class="item-field-label-medium">Player</label>
<input type="text" class="item-field-label-long3" name="system.biodata.player" value="{{system.biodata.player}}"
data-dtype="String" />
</li>
<li class="flexrow item">
<label class="item-field-label-medium">GM</label>
<input type="text" class="item-field-label-long3" name="system.biodata.gm" value="{{system.biodata.gm}}"
data-dtype="String" />
</li>
<li class="item flexrow">
<label class="item-field-label-medium">Hair</label>
<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="generic-label">Campaign name</label>
<input type="text" class="" name="system.biodata.campaign" value="{{system.biodata.campaign}}" data-dtype="String" />
</li>
<li class="flexrow item">
<label class="generic-label">Gender</label>
<input type="text" class="" name="system.biodata.gender" value="{{system.biodata.gender}}" data-dtype="String" />
</li>
<li class="flexrow item">
<label class="generic-label">Player</label>
<input type="text" class="" name="system.biodata.player" value="{{system.biodata.player}}"
data-dtype="String" />
</li>
<li class="flexrow item">
<label class="generic-label">GM</label>
<input type="text" class="" name="system.biodata.gm" value="{{system.biodata.gm}}"
data-dtype="String" />
</li>
</ul>
</div>
<div>
<ul>
<li class="item flexrow">
<label class="generic-label">Height</label>
<input type="text" class="" name="system.biodata.height" value="{{system.biodata.height}}" data-dtype="String" />
<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="generic-label">Mass</label>
<input type="text" class="" name="system.biodata.mass" value="{{system.biodata.mass}}" data-dtype="String" />
<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="generic-label">Eyes</label>
<input type="text" class="" name="system.biodata.eyes" value="{{system.biodata.eyes}}" data-dtype="String" />
<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="generic-label">Hair</label>
<input type="text" class="" name="system.biodata.hair" value="{{system.biodata.hair}}" data-dtype="String" />
<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>
@ -169,7 +171,7 @@
<h3><label class="item-field-label-short">Value</label></h3>
</span>
<span class="item-field-label-medium">
<label class="item-field-label-medium">Label</label>
<label class="item-field-label-long">characteristic</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Base</label>
@ -199,7 +201,7 @@
<span class="item-name-label-header">
<h3><label class="items-title-text">Skills</label></h3>
</span>
<span class="item-field-label-short">
<span class="item-field-label-long">
<label class="short-label">CHAR</label>
</span>
<span class="item-field-label-short">
@ -212,8 +214,8 @@
<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.system.characteristic}}</span>
<span class="item-field-label-short"><a class="roll-item" data-type="skill"><i class="fas fa-dice"></i>{{skill.system.base}}-</a></span>
<span class="item-field-label-short">{{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">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
@ -405,15 +407,9 @@
<span class="item-field-label-long">
<label class="short-label">Qty</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">Weight</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">IDR</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="money" title="Create Item"><i class="fas fa-plus"></i></a>
<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|}}
@ -427,17 +423,6 @@
(<a class="quantity-minus plus-minus-button"> -</a>/<a class="quantity-plus plus-minus-button">+</a>)
</label>
</span>
<span class="item-field-label-medium">
<label>{{money.system.weight}}</label>
</span>
<span class="item-field-label-medium">
{{#if money.system.idrDice}}
<a class="roll-idr" data-dice-value="{{money.data.idrDice}}">{{money.system.idrDice}}</a>
{{else}}
&nbsp;-&nbsp;
{{/if}}
</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>
@ -460,10 +445,17 @@
{{!-- Biography Tab --}}
<div class="tab biodata" data-group="primary" data-tab="biodata">
<h3>Background/History : </h3>
<div class="form-group editor">
{{editor description target="system.biodata.description" button=true owner=owner
editable=editable}}
<div class="flexrow">
<div class="biodata-portrait">
<img src="{{img}}">
</div>
<div>
<h3>Background/History : </h3>
<div class="form-group editor">
{{editor description target="system.biodata.description" button=true owner=owner
editable=editable}}
</div>
</div>
</div>
<hr>
<h3>Personality/Motivation : </h3>

View File

@ -17,8 +17,12 @@
{{#if item}}
<div class="flexrow">
<span class="item-field-label-long margin-item-list">{{upperFirst item.type}} : </span>
<span class="item-field-label-long margin-item-list">{{upperFirst item.type}} - {{upperFirst item.name}}</span>
{{#if item.roll}}
<span class="item-field-label-medium margin-item-list">{{item.roll}}-</span>
{{else}}
<span class="item-field-label-medium margin-item-list">{{item.system.roll}}-</span>
{{/if}}
</div>
{{/if}}

View File

@ -33,9 +33,7 @@
</li>
<li><strong>Result : {{result}}</strong> ({{#if isSuccess}}Success!!{{else}}Failure!{{/if}})</li>
{{#if isSuccess}}
<li><strong>Margin : {{margin}}</strong>
{{/if}}
</ul>
</div>

View File

@ -16,10 +16,10 @@
<div class="tab details" data-group="primary" data-tab="details">
<ul>
<li class="flexrow"><label class="generic-label">Quantity</label>
<input type="text" class="input-numeric-short padd-right" name="system.quantity" value="{{data.quantity}}" data-dtype="Number"/>
<input type="text" class="input-numeric-short padd-right" name="system.quantity" value="{{system.quantity}}" data-dtype="Number"/>
</li>
<li class="flexrow"><label class="generic-label">Unit value</label>
<input type="text" class="input-numeric-short padd-right" name="system.value" value="{{data.value}}" data-dtype="Number"/>
<input type="text" class="input-numeric-short padd-right" name="system.value" value="{{system.value}}" data-dtype="Number"/>
</li>
</ul>
</div>