New combat features

This commit is contained in:
LeRatierBretonnien 2023-03-24 13:29:19 +01:00
parent ed494e69b9
commit e573f5b382
7 changed files with 89 additions and 42 deletions

View File

@ -203,7 +203,11 @@
"WH.ui.ignoreeffect": "Ignore effect", "WH.ui.ignoreeffect": "Ignore effect",
"WH.ui.raceSkills": "Race skills", "WH.ui.raceSkills": "Race skills",
"WH.ui.identified": "Identified", "WH.ui.identified": "Identified",
"WH.ui.isclasssecondary": "Secondary class ?",
"WH.ui.secondaryclass": "Super warhero",
"WH.ui.meleedamagebonus": "Melee damage bonus",
"WH.ui.rangeddamagebonus": "Ranged damage bonus",
"WH.ui.bodyslots": "Body", "WH.ui.bodyslots": "Body",
"WH.ui.containerslot": "Containers", "WH.ui.containerslot": "Containers",

View File

@ -58,7 +58,8 @@ export class WarheroActorSheet extends ActorSheet {
subActors: duplicate(this.actor.getSubActors()), subActors: duplicate(this.actor.getSubActors()),
competency: this.actor.getCompetency(), competency: this.actor.getCompetency(),
race: duplicate(race), race: duplicate(race),
classes: duplicate(this.actor.getClasses()), mainClass: this.actor.getMainClass(),
secondaryClass: this.actor.getSecondaryClass(),
totalMoney: this.actor.computeTotalMoney(), totalMoney: this.actor.computeTotalMoney(),
equipments: duplicate(this.actor.getEquipmentsOnly()), equipments: duplicate(this.actor.getEquipmentsOnly()),
//moneys: duplicate(this.actor.getMoneys()), //moneys: duplicate(this.actor.getMoneys()),

View File

@ -168,9 +168,13 @@ export class WarheroActor extends Actor {
return race[0] ?? []; return race[0] ?? [];
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
getClass() { getMainClass() {
let classWH = this.items.filter(item => item.type == 'class') let classWH = this.items.find(item => item.type == 'class' && !item.system.issecondary)
return classWH[0] ?? []; return classWH
}
getSecondaryClass() {
let classWH = this.items.find(item => item.type == 'class' && item.system.issecondary)
return classWH
} }
getClasses() { getClasses() {
let comp = duplicate(this.items.filter(item => item.type == "class") || []); let comp = duplicate(this.items.filter(item => item.type == "class") || []);
@ -289,6 +293,14 @@ export class WarheroActor extends Actor {
formula += "+" + Math.floor(this.system.statistics.str.value * 1) formula += "+" + Math.floor(this.system.statistics.str.value * 1)
weapon.damageFormula2Hands = weapon.system.damage2hands + "+" + Math.floor(this.system.statistics.str.value * 1.5) weapon.damageFormula2Hands = weapon.system.damage2hands + "+" + Math.floor(this.system.statistics.str.value * 1.5)
} }
if (weapon.system.weapontype == "throwing" || weapon.system.weapontype == "shooting") {
formula += "+"+this.system.secondary.rangeddamagebonus.value
} else if ( weapon.system.weapontype != "special" ) {
formula += "+"+this.system.secondary.meleedamagebonus.value
if (weapon.damageFormula2Hands) {
weapon.damageFormula2Hands += "+"+this.system.secondary.meleedamagebonus.value
}
}
weapon.damageFormula = formula weapon.damageFormula = formula
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -496,17 +508,23 @@ export class WarheroActor extends Actor {
} }
getCompetency() { getCompetency() {
let myRace = this.getRace() let myRace = this.getRace()
let myClass = this.getClass() let myClass1 = this.getMainClass()
let myClass2 = this.getSecondaryClass()
let competency = { weapons: {}, armors: {}, shields: {} } let competency = { weapons: {}, armors: {}, shields: {} }
if (myRace.system) { if (myRace.system) {
this.updateCompetency(competency.weapons, myRace.system.weapons, game.system.warhero.config.weaponTypes) this.updateCompetency(competency.weapons, myRace.system.weapons, game.system.warhero.config.weaponTypes)
this.updateCompetency(competency.armors, myRace.system.armors, game.system.warhero.config.armorTypes) this.updateCompetency(competency.armors, myRace.system.armors, game.system.warhero.config.armorTypes)
this.updateCompetency(competency.shields, myRace.system.shields, game.system.warhero.config.shieldTypes) this.updateCompetency(competency.shields, myRace.system.shields, game.system.warhero.config.shieldTypes)
} }
if (myClass.system) { if (myClass1 && myClass1.system) {
this.updateCompetency(competency.weapons, myClass.system.weapons, game.system.warhero.config.weaponTypes) this.updateCompetency(competency.weapons, myClass1.system.weapons, game.system.warhero.config.weaponTypes)
this.updateCompetency(competency.armors, myClass.system.armors, game.system.warhero.config.armorTypes) this.updateCompetency(competency.armors, myClass1.system.armors, game.system.warhero.config.armorTypes)
this.updateCompetency(competency.shields, myClass.system.shields, game.system.warhero.config.shieldTypes) this.updateCompetency(competency.shields, myClass1.system.shields, game.system.warhero.config.shieldTypes)
}
if (myClass2 && myClass2.system) {
this.updateCompetency(competency.weapons, myClass2.system.weapons, game.system.warhero.config.weaponTypes)
this.updateCompetency(competency.armors, myClass2.system.armors, game.system.warhero.config.armorTypes)
this.updateCompetency(competency.shields, myClass2.system.shields, game.system.warhero.config.shieldTypes)
} }
return competency return competency
} }

View File

@ -107,7 +107,7 @@
"styles": [ "styles": [
"styles/simple.css" "styles/simple.css"
], ],
"version": "10.0.44", "version": "10.0.46",
"compatibility": { "compatibility": {
"minimum": "10", "minimum": "10",
"verified": "10", "verified": "10",
@ -115,7 +115,7 @@
}, },
"title": "Warhero RPG", "title": "Warhero RPG",
"manifest": "https://www.uberwald.me/gitea/public/fvtt-warhero/raw/branch/master/system.json", "manifest": "https://www.uberwald.me/gitea/public/fvtt-warhero/raw/branch/master/system.json",
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-warhero/archive/fvtt-warhero-10.0.44.zip", "download": "https://www.uberwald.me/gitea/uberwald/fvtt-warhero/archive/fvtt-warhero-10.0.46.zip",
"url": "https://www.uberwald.me/gitea/public/fvtt-warhero", "url": "https://www.uberwald.me/gitea/public/fvtt-warhero",
"background": "images/ui/warhero_welcome_page.webp", "background": "images/ui/warhero_welcome_page.webp",
"id": "fvtt-warhero" "id": "fvtt-warhero"

View File

@ -11,7 +11,7 @@
"biodata": { "biodata": {
"class": "", "class": "",
"age": 0, "age": 0,
"size": 3, "size": "medium",
"weight": "", "weight": "",
"height": "", "height": "",
"hair": "", "hair": "",
@ -172,6 +172,20 @@
"iscombat": true, "iscombat": true,
"value": 0 "value": 0
}, },
"meleedamagebonus": {
"label": "WH.ui.meleedamagebonus",
"abbrev": "meleedamagebonus",
"iscombat": true,
"style": "edit",
"value": 0
},
"rangeddamagebonus": {
"label": "WH.ui.rangeddamagebonus",
"abbrev": "rangeddamagebonus",
"iscombat": true,
"style": "edit",
"value": 0
},
"parrybonus": { "parrybonus": {
"label": "WH.ui.parrybonus", "label": "WH.ui.parrybonus",
"abbrev": "parrybonus", "abbrev": "parrybonus",
@ -360,6 +374,7 @@
"templates": [ "templates": [
"commonclassrace" "commonclassrace"
], ],
"issecondary": false,
"description": "" "description": ""
}, },
"race": { "race": {

View File

@ -27,30 +27,42 @@
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a> <a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div> </div>
</li> </li>
{{#if (count classes)}} <li class="item flexrow list-item " data-item-id="{{mainClass._id}}">
{{#each classes as |class idx|}}
<li class="item flexrow list-item" data-item-id="{{class._id}}">
<label class="item-field-label-medium">{{localize "WH.ui.class"}}</label>
<a class="item-edit"><img class="sheet-competence-img" src="{{class.img}}"></a>
<input type="text" class="item-field-label-medium" disabled value="{{class.name}}" data-dtype="String" />
<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}}
{{else}}
<li class="item flexrow list-item" data-item-id="{{class._id}}">
<label class="item-field-label-medium">{{localize "WH.ui.class"}}</label> <label class="item-field-label-medium">{{localize "WH.ui.class"}}</label>
<a class="item-edit"><img class="sheet-competence-img" src="{{class.img}}"></a> {{#if mainClass}}
<input type="text" class="item-field-label-medium" disabled value="{{class.name}}" data-dtype="String" /> <a class="item-edit"><img class="sheet-competence-img" src="{{mainClass.img}}"></a>
<input type="text" class="item-field-label-medium" disabled value="{{mainClass.name}}" data-dtype="String" />
<div class="item-controls item-controls-fixed">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
{{else}}
<a class="item-edit"><img class="sheet-competence-img" src="icons/svg/mystery-man.svg"></a>
{{/if}}
</li>
<li class="item flexrow list-item " data-item-id="{{secondaryClass._id}}">
<label class="item-field-label-medium">{{localize "WH.ui.secondaryclass"}}</label>
{{#if secondaryClass}}
<a class="item-edit"><img class="sheet-competence-img" src="{{secondaryClass.img}}"></a>
<input type="text" class="item-field-label-medium" disabled value="{{secondaryClass.name}}" data-dtype="String" />
<div class="item-controls item-controls-fixed"> <div class="item-controls item-controls-fixed">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a> <a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div> </div>
{{else}}
<a class="item-edit"><img class="sheet-competence-img" src="icons/svg/mystery-man.svg"></a>
{{/if}}
</li> </li>
{{/if}}
<li class="item flexrow list-item" > <li class="item flexrow list-item" >
<label class="item-field-label-medium">{{localize "WH.ui.religion"}}</label> <label class="item-field-label-medium">{{localize "WH.ui.religion"}}</label>
<input type="text" class="item-field-label-medium" name="system.biodata.religion" value="{{system.biodata.religion}}" data-dtype="String" /> <input type="text" class="item-field-label-medium" name="system.biodata.religion" value="{{system.biodata.religion}}" data-dtype="String" />
&nbsp;&nbsp;
<label class="item-field-label-short">{{localize "WH.ui.size"}}</label>
<select class="item-field-label-short" type="text" name="system.biodata.size" value="{{system.biodata.size}}" data-dtype="Number">
{{#select system.biodata.size}}
<option value="small">Small</option>
<option value="medium">Medium</option>
<option value="large">Large</option>
{{/select}}
</select>
</li> </li>
</ul> </ul>
</div> </div>
@ -167,6 +179,9 @@
{{#with system.attributes.ini as |stat|}} {{#with system.attributes.ini as |stat|}}
{{> systems/fvtt-warhero/templates/partial-actor-stat-block.html stat=stat key="ini" path="attributes" fieldClass="item-field-label-vlong"}} {{> systems/fvtt-warhero/templates/partial-actor-stat-block.html stat=stat key="ini" path="attributes" fieldClass="item-field-label-vlong"}}
{{/with}} {{/with}}
{{#with system.secondary.meleedamagebonus as |stat|}}
{{> systems/fvtt-warhero/templates/partial-actor-stat-block.html stat=stat key="meleedamagebonus" path="secondary" fieldClass="item-field-label-vlong"}}
{{/with}}
</ul> </ul>
<ul class="stat-list alternate-list"> <ul class="stat-list alternate-list">
{{#with system.attributes.txcm as |stat|}} {{#with system.attributes.txcm as |stat|}}
@ -175,6 +190,9 @@
{{#with system.attributes.txcr as |stat|}} {{#with system.attributes.txcr as |stat|}}
{{> systems/fvtt-warhero/templates/partial-actor-stat-block.html stat=stat key="txch" path="attributes" fieldClass="item-field-label-vlong"}} {{> systems/fvtt-warhero/templates/partial-actor-stat-block.html stat=stat key="txch" path="attributes" fieldClass="item-field-label-vlong"}}
{{/with}} {{/with}}
{{#with system.secondary.rangeddamagebonus as |stat|}}
{{> systems/fvtt-warhero/templates/partial-actor-stat-block.html stat=stat key="rangeddamagebonus" path="secondary" fieldClass="item-field-label-vlong"}}
{{/with}}
</ul> </ul>
</div> </div>
@ -592,19 +610,6 @@
</div> </div>
<div> <div>
<ul> <ul>
<li class="flexrow item">
<label class="generic-label">{{localize "WH.ui.size"}}</label>
<select class="competence-base flexrow" type="text" name="system.biodata.size" value="{{system.biodata.size}}" data-dtype="Number">
{{#select system.biodata.size}}
<option value="1">Tiny</option>
<option value="2">Small</option>
<option value="3">Medium</option>
<option value="4">Large</option>
<option value="5">Huge</option>
<option value="6">Gargantuan</option>
{{/select}}
</select>
</li>
<li class="flexrow item"> <li class="flexrow item">
<label class="generic-label">{{localize "WH.ui.gender"}}</label> <label class="generic-label">{{localize "WH.ui.gender"}}</label>
<input type="text" class="" name="system.biodata.sex" value="{{system.biodata.sex}}" data-dtype="String" /> <input type="text" class="" name="system.biodata.sex" value="{{system.biodata.sex}}" data-dtype="String" />

View File

@ -21,6 +21,10 @@
<div class="tab details" data-group="primary" data-tab="details"> <div class="tab details" data-group="primary" data-tab="details">
<ul> <ul>
<li class="flexrow"><label class="item-field-label-long ">{{localize "WH.ui.isclasssecondary"}}</label>
<input type="checkbox" name="system.issecondary" {{checked system.issecondary}}/>
</li>
{{#each system.weapons as |weaponflag key|}} {{#each system.weapons as |weaponflag key|}}
<li class="flexrow"><label class="item-field-label-long ">{{localize "WH.ui.weapons"}} {{localize (concat "WH.conf." key)}}</label> <li class="flexrow"><label class="item-field-label-long ">{{localize "WH.ui.weapons"}} {{localize (concat "WH.conf." key)}}</label>
<input type="checkbox" class="padd-right status-small-label color-class-common item-field-label-short" <input type="checkbox" class="padd-right status-small-label color-class-common item-field-label-short"