New combat features
This commit is contained in:
parent
ed494e69b9
commit
e573f5b382
@ -203,6 +203,10 @@
|
||||
"WH.ui.ignoreeffect": "Ignore effect",
|
||||
"WH.ui.raceSkills": "Race skills",
|
||||
"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.containerslot": "Containers",
|
||||
|
@ -58,7 +58,8 @@ export class WarheroActorSheet extends ActorSheet {
|
||||
subActors: duplicate(this.actor.getSubActors()),
|
||||
competency: this.actor.getCompetency(),
|
||||
race: duplicate(race),
|
||||
classes: duplicate(this.actor.getClasses()),
|
||||
mainClass: this.actor.getMainClass(),
|
||||
secondaryClass: this.actor.getSecondaryClass(),
|
||||
totalMoney: this.actor.computeTotalMoney(),
|
||||
equipments: duplicate(this.actor.getEquipmentsOnly()),
|
||||
//moneys: duplicate(this.actor.getMoneys()),
|
||||
|
@ -168,9 +168,13 @@ export class WarheroActor extends Actor {
|
||||
return race[0] ?? [];
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
getClass() {
|
||||
let classWH = this.items.filter(item => item.type == 'class')
|
||||
return classWH[0] ?? [];
|
||||
getMainClass() {
|
||||
let classWH = this.items.find(item => item.type == 'class' && !item.system.issecondary)
|
||||
return classWH
|
||||
}
|
||||
getSecondaryClass() {
|
||||
let classWH = this.items.find(item => item.type == 'class' && item.system.issecondary)
|
||||
return classWH
|
||||
}
|
||||
getClasses() {
|
||||
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)
|
||||
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
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
@ -496,17 +508,23 @@ export class WarheroActor extends Actor {
|
||||
}
|
||||
getCompetency() {
|
||||
let myRace = this.getRace()
|
||||
let myClass = this.getClass()
|
||||
let myClass1 = this.getMainClass()
|
||||
let myClass2 = this.getSecondaryClass()
|
||||
let competency = { weapons: {}, armors: {}, shields: {} }
|
||||
if (myRace.system) {
|
||||
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.shields, myRace.system.shields, game.system.warhero.config.shieldTypes)
|
||||
}
|
||||
if (myClass.system) {
|
||||
this.updateCompetency(competency.weapons, myClass.system.weapons, game.system.warhero.config.weaponTypes)
|
||||
this.updateCompetency(competency.armors, myClass.system.armors, game.system.warhero.config.armorTypes)
|
||||
this.updateCompetency(competency.shields, myClass.system.shields, game.system.warhero.config.shieldTypes)
|
||||
if (myClass1 && myClass1.system) {
|
||||
this.updateCompetency(competency.weapons, myClass1.system.weapons, game.system.warhero.config.weaponTypes)
|
||||
this.updateCompetency(competency.armors, myClass1.system.armors, game.system.warhero.config.armorTypes)
|
||||
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
|
||||
}
|
||||
|
@ -107,7 +107,7 @@
|
||||
"styles": [
|
||||
"styles/simple.css"
|
||||
],
|
||||
"version": "10.0.44",
|
||||
"version": "10.0.46",
|
||||
"compatibility": {
|
||||
"minimum": "10",
|
||||
"verified": "10",
|
||||
@ -115,7 +115,7 @@
|
||||
},
|
||||
"title": "Warhero RPG",
|
||||
"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",
|
||||
"background": "images/ui/warhero_welcome_page.webp",
|
||||
"id": "fvtt-warhero"
|
||||
|
@ -11,7 +11,7 @@
|
||||
"biodata": {
|
||||
"class": "",
|
||||
"age": 0,
|
||||
"size": 3,
|
||||
"size": "medium",
|
||||
"weight": "",
|
||||
"height": "",
|
||||
"hair": "",
|
||||
@ -172,6 +172,20 @@
|
||||
"iscombat": true,
|
||||
"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": {
|
||||
"label": "WH.ui.parrybonus",
|
||||
"abbrev": "parrybonus",
|
||||
@ -360,6 +374,7 @@
|
||||
"templates": [
|
||||
"commonclassrace"
|
||||
],
|
||||
"issecondary": false,
|
||||
"description": ""
|
||||
},
|
||||
"race": {
|
||||
|
@ -27,30 +27,42 @@
|
||||
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{#if (count classes)}}
|
||||
{{#each classes as |class idx|}}
|
||||
<li class="item flexrow list-item" data-item-id="{{class._id}}">
|
||||
<li class="item flexrow list-item " data-item-id="{{mainClass._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" />
|
||||
{{#if mainClass}}
|
||||
<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>
|
||||
</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>
|
||||
<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" />
|
||||
<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">
|
||||
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{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" >
|
||||
<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" />
|
||||
|
||||
<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>
|
||||
</ul>
|
||||
</div>
|
||||
@ -167,6 +179,9 @@
|
||||
{{#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"}}
|
||||
{{/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 class="stat-list alternate-list">
|
||||
{{#with system.attributes.txcm as |stat|}}
|
||||
@ -175,6 +190,9 @@
|
||||
{{#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"}}
|
||||
{{/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>
|
||||
</div>
|
||||
|
||||
@ -592,19 +610,6 @@
|
||||
</div>
|
||||
<div>
|
||||
<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">
|
||||
<label class="generic-label">{{localize "WH.ui.gender"}}</label>
|
||||
<input type="text" class="" name="system.biodata.sex" value="{{system.biodata.sex}}" data-dtype="String" />
|
||||
|
@ -21,6 +21,10 @@
|
||||
<div class="tab details" data-group="primary" data-tab="details">
|
||||
<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|}}
|
||||
<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"
|
||||
|
Reference in New Issue
Block a user