Actor/Crew rolls

This commit is contained in:
sladecraven 2022-09-21 16:54:34 +02:00
parent 343ac6ab9d
commit 8345ee0ebb
11 changed files with 268 additions and 310 deletions

View File

@ -15,10 +15,10 @@ const __statBuild = [
//{ modules: ["vehiclehull"], field: "pc", itemfield: "vms", subfield: "avgnrg" },
//{ modules: ["powercoremodule"], field: "pc", itemfield: "nrg", subfield: "avgnrg" },
{ modules: ["vehiclehull", "mobilitymodule"], itemfield: "man", field: "man" },
{ modules: ["powercoremodule"], field: "pc", itemfield: "pc", },
{ modules: ["mobilitymodule"], field: "mr", itemfield: "mr", },
{ modules: ["propulsionmodule"], field: "ad", itemfield: "ad", },
{ modules: ["combatmodule"], field: "fc", itemfield: "fc", },
{ modules: ["powercoremodule"], field: "pc", itemfield: "pc", additionnal1: "curnrg", additionnal2: "maxnrg" },
{ modules: ["mobilitymodule"], field: "mr", itemfield: "mr" },
{ modules: ["propulsionmodule"], field: "ad", itemfield: "ad" },
{ modules: ["combatmodule"], field: "fc", itemfield: "fc" },
]
const __isVehicleUnique = { vehiclehull:1, powercoremodule:1, mobilitymodule: 1, propulsionmodule: 1, combatmodule: 1}
const __speed2Num = { fullstop: 0, crawling: 1, slow: 2, average: 3, fast: 4, extfast: 5 }
@ -746,12 +746,12 @@ export class PegasusActor extends Actor {
/* -------------------------------------------- */
getStat(statKey) {
let stat
if (statKey == 'mr') {
if (this.type == "character" && statKey == 'mr') {
stat = duplicate(this.system.mr);
} else {
stat = duplicate(this.system.statistics[statKey]);
}
stat.dice = PegasusUtility.getDiceFromLevel(stat.value);
stat.dice = PegasusUtility.getDiceFromLevel(stat.value || stat.level);
return stat;
}
@ -928,7 +928,7 @@ export class PegasusActor extends Actor {
} else {
let pc = duplicate(this.system.statistics.pc)
pc.curnrg += value
if (pc.curnrg >= 0) {
if (pc.curnrg >= 0 && pc.curnrg <= pc.maxnrg) {
this.update({ 'system.statistics.pc': pc })
}
}
@ -1068,13 +1068,15 @@ export class PegasusActor extends Actor {
/* -------------------------------------------- */
getTraumaState() {
this.traumaState = "none"
let negDelirium = -Math.floor((this.system.secondary.delirium.max + 1) / 2)
if (this.type == "character") {
if (this.system.secondary.delirium.value <= 0 && this.system.secondary.delirium.value >= negDelirium) {
this.traumaState = "trauma"
}
if (this.system.secondary.delirium.value < negDelirium) {
this.traumaState = "severetrauma"
if ( this.type == "character") {
let negDelirium = -Math.floor((this.system.secondary.delirium.max + 1) / 2)
if (this.type == "character") {
if (this.system.secondary.delirium.value <= 0 && this.system.secondary.delirium.value >= negDelirium) {
this.traumaState = "trauma"
}
if (this.system.secondary.delirium.value < negDelirium) {
this.traumaState = "severetrauma"
}
}
}
return this.traumaState
@ -1540,9 +1542,19 @@ export class PegasusActor extends Actor {
}
}
}
addVehicleWeapons(rollData, vehicle) {
if (vehicle) {
let modules = vehicle.items.filter(vehicle => vehicle.type == "vehicleweaponmodule")
if (modules && modules.length > 0) {
for( let module of modules) {
rollData.vehicleWeapons.push({ label: `Weapon ${module.name}`, type: "item", applied: false, weapon: module, value: module.system.damagedicevalue } )
}
}
}
}
/* -------------------------------------------- */
getCommonRollData(statKey = undefined, useShield = false, isInit = false, isPower = false, isPowerDmg = false) {
getCommonRollData(statKey = undefined, useShield = false, isInit = false, isPower = false, subKey = "", vehicle = undefined ) {
let rollData = PegasusUtility.getBasicRollData(isInit)
rollData.alias = this.name
rollData.actorImg = this.img
@ -1555,11 +1567,34 @@ export class PegasusActor extends Actor {
rollData.noBonusDice = this.checkNoBonusDice()
rollData.dicePool = []
if (subKey == "melee-dmg" || subKey == "ranged-dmg" || subKey == "power-dmg") {
rollData.isDamage = true
}
if (statKey) {
rollData.statKey = statKey
rollData.stat = this.getStat(statKey)
rollData.statDicesLevel = rollData.stat.value
rollData.statDicesLevel = rollData.stat.value || rollData.stat.level
rollData.statMod = rollData.stat.mod
if ( vehicle) {
rollData.vehicle = duplicate(vehicle)
if (subKey == "melee-dmg") {
rollData.statVehicle = vehicle.system.statistics.mr
rollData.statDicesLevel += vehicle.system.statistics.mr.currentlevel
this.addVehicleWeapons(rollData, vehicle)
}
if (subKey == "ranged-atk") {
rollData.statVehicle = vehicle.system.statistics.fc
rollData.statDicesLevel += vehicle.system.statistics.fc.currentlevel
}
if (subKey == "ranged-dmg") {
this.addVehicleWeapons(rollData, vehicle)
}
if (subKey == "defense") {
rollData.statVehicle = vehicle.system.statistics.man
rollData.statDicesLevel += vehicle.system.statistics.man.currentlevel
}
}
rollData.specList = this.getRelevantSpec(statKey)
rollData.selectedSpec = "0"
if (statKey.toLowerCase() == "mr") {
@ -1567,7 +1602,7 @@ export class PegasusActor extends Actor {
} else {
rollData.img = `systems/fvtt-pegasus-rpg/images/icons/${rollData.stat.abbrev}.webp`
}
let diceKey = PegasusUtility.getDiceFromLevel(rollData.stat.value)
let diceKey = PegasusUtility.getDiceFromLevel(rollData.statDicesLevel)
let diceList = diceKey.split(" ")
let mod = rollData.stat.mod
for (let myDice of diceList) {
@ -1581,7 +1616,7 @@ export class PegasusActor extends Actor {
}
}
this.addEffects(rollData, isInit, isPower, isPowerDmg)
this.addEffects(rollData, isInit, isPower, subKey == "power-dmg" )
this.addArmorsShields(rollData, statKey, useShield)
this.addWeapons(rollData, statKey, useShield)
this.addEquipments(rollData, statKey)
@ -1627,10 +1662,10 @@ export class PegasusActor extends Actor {
}
/* -------------------------------------------- */
rollPool(statKey, useShield = false, subKey = "none") {
rollPool(statKey, useShield = false, subKey = "none", vehicle = undefined) {
let stat = this.getStat(statKey)
if (stat) {
let rollData = this.getCommonRollData(statKey, useShield, false, false, subKey == "power-dmg")
let rollData = this.getCommonRollData(statKey, useShield, false, false, subKey, vehicle)
rollData.mode = "stat"
rollData.subKey = subKey
let def = stat.label
@ -1639,9 +1674,6 @@ export class PegasusActor extends Actor {
}
rollData.title = `Roll : ${def} `
rollData.img = "icons/dice/d12black.svg"
if (subKey == "melee-dmg" || subKey == "ranged-dmg" || subKey == "power-dmg") {
rollData.isDamage = true
}
this.startRoll(rollData)
} else {
ui.notifications.warn("Statistic not found !");
@ -1747,7 +1779,7 @@ export class PegasusActor extends Actor {
if (power) {
power = duplicate(power)
let rollData = this.getCommonRollData(power.system.statistic, false, false, true, false)
let rollData = this.getCommonRollData(power.system.statistic, false, false, true)
rollData.mode = "power"
rollData.power = power
@ -1820,6 +1852,16 @@ export class PegasusActor extends Actor {
} else {
if (sum != Number(this.system.statistics[statDef.field].level)) {
this.update({ [`system.statistics.${statDef.field}.level`]: sum, [`system.statistics.${statDef.field}.currentlevel`]: sum })
if (statDef.additionnal1) {
if (sum != Number(this.system.statistics[statDef.field][statDef.additionnal1])) {
this.update({ [`system.statistics.${statDef.field}.${statDef.additionnal1}`]: sum } )
}
}
if (statDef.additionnal2) {
if (sum != Number(this.system.statistics[statDef.field][statDef.additionnal2])) {
this.update({ [`system.statistics.${statDef.field}.${statDef.additionnal2}`]: sum } )
}
}
}
}
}
@ -1912,6 +1954,7 @@ export class PegasusActor extends Actor {
}
// Check size
if (item.type == "vehiclemodule" || item.type == "vehicleweaponmodule") {
item.system.space = item.system.space || 0
if ( this.system.modules.usedvms + Number(item.system.space) > this.system.modules.totalvms ) {
ChatMessage.create( { content: `No more room available to host module ${item.name}. Module is not added to the vehicle.`})
return false
@ -1920,4 +1963,40 @@ export class PegasusActor extends Actor {
return true
}
/* -------------------------------------------- */
getCrewList() {
let crew = []
for (let actorDef of this.system.crew) {
let actor = game.actors.get(actorDef.id)
if (actor ) {
crew.push( {name: actor.name, img: actor.img, id: actor.id })
}
}
return crew
}
/* -------------------------------------------- */
addCrew(actorId) {
let crewList = duplicate( this.system.crew.filter( actorDef => actorDef.id != actorId ) || [] )
crewList.push( {id: actorId})
this.update( { 'system.crew': crewList } )
}
/* -------------------------------------------- */
rollPoolFromVehicle(statKey, useShield = false, subKey = "none") {
// Find relevant actor
let actor
for( let actorDef of this.system.crew) {
let actorTest = game.actors.get( actorDef.id)
if (actorTest.testUserPermission( game.user, "OWNER")) {
actor = actorTest
break
}
}
if (!actor) {
ui.notifications.warn("You do no own any actors in the crew of this vehicle.")
return
}
actor.rollPool( statKey, useShield, subKey, this )
}
}

View File

@ -118,6 +118,21 @@ export class PegasusRollDialog extends Dialog {
PegasusUtility.updateDamageDicePool(this.rollData)
}
/* -------------------------------------------- */
manageVehicleWeapon( weaponIdx, toggled) {
let weapon = this.rollData.vehicleWeapons[weaponIdx]
if (weapon) {
this.rollData.weapon = duplicate(weapon)
if (toggled) {
this.rollData.weaponName = weapon.weapon.name
} else {
this.rollData.weaponName = undefined
}
weapon.applied = toggled
}
PegasusUtility.updateDamageDicePool(this.rollData)
}
/* -------------------------------------------- */
manageEquip(equipIdx, toggled) {
let equip = this.rollData.equipmentsList[equipIdx]
@ -216,6 +231,12 @@ export class PegasusRollDialog extends Dialog {
let equipIdx = $(event.currentTarget).data("equip-idx")
this.manageEquip(equipIdx, toggled)
})
html.find('.vehicle-weapon-clicked').change((event) => {
let toggled = event.currentTarget.checked
let weaponIdx = $(event.currentTarget).data("vehicle-weapon-idx")
this.manageVehicleWeapon(weaponIdx, toggled)
this.refreshDialog()
})
html.find('.pool-add-dice').click(async (event) => {
let diceKey = $(event.currentTarget).data("dice-key")

View File

@ -7,7 +7,7 @@ import { PegasusRollDialog } from "./pegasus-roll-dialog.js";
/* -------------------------------------------- */
const __level2Dice = ["d0", "d4", "d6", "d8", "d10", "d12"]
const __name2DiceValue = { "0": 0, "d0": 0, "d4": 4, "d6": 6, "d8": 8, "d10": 10, "d12": 12 }
const __dice2Level = {"d0": 0, "d4": 1, "d6": 2, "d8": 3, "d10": 4, "d12": 5}
const __dice2Level = { "d0": 0, "d4": 1, "d6": 2, "d8": 3, "d10": 4, "d12": 5 }
/* -------------------------------------------- */
export class PegasusUtility {
@ -61,8 +61,8 @@ export class PegasusUtility {
/* -------------------------------------------- */
static initGenericRoll() {
let rollData = PegasusUtility.getBasicRollData()
rollData.alias = "Dice Pool Roll",
rollData.mode = "generic"
rollData.alias = "Dice Pool Roll",
rollData.mode = "generic"
rollData.title = `Dice Pool Roll`
rollData.img = "icons/dice/d12black.svg"
rollData.isGeneric = true
@ -85,14 +85,14 @@ export class PegasusUtility {
event.preventDefault()
let rollData = PegasusUtility.initGenericRoll()
rollData.isChatRoll = true
let rollDialog = await PegasusRollDialog.create( undefined, rollData)
rollDialog.render( true )
let rollDialog = await PegasusRollDialog.create(undefined, rollData)
rollDialog.render(true)
})
}
})
}
}
/* -------------------------------------------- */
static pushInitiativeOptions(html, options) {
options.push({ name: "Apply -10", condition: true, icon: '<i class="fas fa-plus"></i>', callback: target => { PegasusCombat.decInitBy10(target.data('combatant-id'), -10); } })
@ -114,7 +114,7 @@ export class PegasusUtility {
let diceList = diceKey.split(" ")
for (let myDice of diceList) {
let newDice = {
name: "effect-bonus-dice", key: myDice, level: effect.effect.system.effectlevel, effect: effect.effect.name,
name: "effect-bonus-dice", key: myDice, level: PegasusUtility.getLevelFromDice(myDice), effect: effect.effect.name,
img: `systems/fvtt-pegasus-rpg/images/dice/${myDice}.webp`
}
newDicePool.push(newDice)
@ -128,12 +128,12 @@ export class PegasusUtility {
static updateHindranceBonusDice(rollData) {
let newDicePool = rollData.dicePool.filter(dice => dice.name != "effect-hindrance")
for (let hindrance of rollData.effectsList) {
if (hindrance && hindrance.applied && (hindrance.type == "hindrance" || (hindrance.type == "effect" && hindrance.effect?.system?.hindrance) ) ) {
let diceKey = PegasusUtility.getDiceFromLevel( (hindrance.value) ? hindrance.value : hindrance.effect.system.effectlevel)
if (hindrance && hindrance.applied && (hindrance.type == "hindrance" || (hindrance.type == "effect" && hindrance.effect?.system?.hindrance))) {
let diceKey = PegasusUtility.getDiceFromLevel((hindrance.value) ? hindrance.value : hindrance.effect.system.effectlevel)
let diceList = diceKey.split(" ")
for (let myDice of diceList) {
let newDice = {
name: "effect-hindrance", key: myDice, level: hindrance.value, effect: hindrance.name,
name: "effect-hindrance", key: myDice, level: PegasusUtility.getLevelFromDice(myDice), effect: hindrance.name,
img: `systems/fvtt-pegasus-rpg/images/dice/${myDice}.webp`
}
newDicePool.push(newDice)
@ -152,7 +152,7 @@ export class PegasusUtility {
let diceList = diceKey.split(" ")
for (let myDice of diceList) {
let newDice = {
name: "armor-shield", key: myDice, level: armor.value,
name: "armor-shield", key: myDice, level: PegasusUtility.getLevelFromDice(myDice),
img: `systems/fvtt-pegasus-rpg/images/dice/${myDice}.webp`
}
newDicePool.push(newDice)
@ -173,7 +173,21 @@ export class PegasusUtility {
let diceList = diceKey.split(" ")
for (let myDice of diceList) {
let newDice = {
name: "damage", key: myDice, level: weapon.value,
name: "damage", key: myDice, level: PegasusUtility.getLevelFromDice(myDice),
img: `systems/fvtt-pegasus-rpg/images/dice/${myDice}.webp`
}
newDicePool.push(newDice)
}
}
}
for (let weapon of rollData.vehicleWeapons) {
if (weapon.applied) {
let diceKey = PegasusUtility.getDiceFromLevel(weapon.value)
let diceList = diceKey.split(" ")
for (let myDice of diceList) {
let newDice = {
name: "damage", key: myDice, level: PegasusUtility.getLevelFromDice(myDice),
img: `systems/fvtt-pegasus-rpg/images/dice/${myDice}.webp`
}
newDicePool.push(newDice)
@ -181,11 +195,11 @@ export class PegasusUtility {
}
}
rollData.dicePool = newDicePool
}
}
}
/* -------------------------------------------- */
static updateStatDicePool( rollData) {
static updateStatDicePool(rollData) {
let newDicePool = rollData.dicePool.filter(dice => dice.name != "stat")
let statDice = rollData.dicePool.find(dice => dice.name == "stat")
if (statDice.level > 0) {
@ -410,7 +424,7 @@ export class PegasusUtility {
}
/* -------------------------------------------- */
static targetToken( user, token, flag) {
static targetToken(user, token, flag) {
if (flag) {
token.actor.checkIfPossible()
}
@ -463,7 +477,7 @@ export class PegasusUtility {
static async getEffectFromCompendium(effectName) {
effectName = effectName.toLowerCase()
let effect = game.items.contents.find(item => item.type == 'effect' && item.name.toLowerCase() == effectName)
if (!effect ) {
if (!effect) {
let effects = await this.loadCompendium('fvtt-pegasus-rpg.effects', item => item.name.toLowerCase() == effectName)
let objs = effects.map(i => i.toObject())
effect = objs[0]
@ -636,7 +650,7 @@ export class PegasusUtility {
}
/* -------------------------------------------- */
static removeForeignEffect( effectData) {
static removeForeignEffect(effectData) {
if (game.user.isGM) {
console.log("Remote removal of effects", effectData)
let actor = game.canvas.tokens.get(effectData.defenderTokenId).actor
@ -714,7 +728,7 @@ export class PegasusUtility {
if (effect.foreign) {
if (game.user.isGM) {
this.removeForeignEffect(effect)
} else {
} else {
game.socket.emit("system.fvtt-pegasus-rpg", { msg: "msg_gm_remove_effect", data: effect })
}
} else {
@ -767,7 +781,6 @@ export class PegasusUtility {
/* -------------------------------------------- */
static async rollPegasus(rollData) {
let actor = game.actors.get(rollData.actorId)
let diceFormulaTab = []
@ -815,6 +828,8 @@ export class PegasusUtility {
// And save the roll
this.saveRollData(rollData)
actor.lastRoll = rollData
console.log("Rolldata performed ", rollData, diceFormula)
}
/* -------------------------------------------- */
@ -968,10 +983,11 @@ export class PegasusUtility {
effectsList: [],
armorsList: [],
weaponsList: [],
vehicleWeapons: [],
equipmentsList: [],
optionsDiceList: PegasusUtility.getOptionsDiceList()
}
if ( !isInit) { // For init, do not display target hindrances
if (!isInit) { // For init, do not display target hindrances
PegasusUtility.updateWithTarget(rollData)
}
return rollData
@ -981,7 +997,7 @@ export class PegasusUtility {
static updateWithTarget(rollData) {
let target = PegasusUtility.getTarget()
if (target) {
console.log("TARGET ", target)
console.log("TARGET ", target)
let defenderActor = target.actor
rollData.defenderTokenId = target.id
//rollData.attackerId = this.id

View File

@ -41,6 +41,8 @@ export class PegasusVehicleSheet extends ActorSheet {
limited: this.object.limited,
optionsDiceList: PegasusUtility.getOptionsDiceList(),
vmsAvailable: objectData.system.modules.totalvms - objectData.system.modules.vmsused,
avgNRG: objectData.system.statistics.pc.maxnrg - objectData.system.statistics.pc.curnrg,
crewList: this.actor.getCrewList(),
totalCost: this.actor.getTotalCost(),
optionsLevel: PegasusUtility.getOptionsLevel(),
subActors: duplicate(this.actor.getSubActors()),
@ -195,23 +197,24 @@ export class PegasusVehicleSheet extends ActorSheet {
html.find('.generic-pool-roll').click((event) => {
this.openGenericRoll()
} );
html.find('.attack-melee').click((event) => {
this.actor.rollPool( 'com', false, "melee-atk");
});
html.find('.attack-ranged').click((event) => {
this.actor.rollPool( 'agi', false, "ranged-atk");
});
html.find('.defense-roll').click((event) => {
this.actor.rollPool( 'def', true);
this.actor.rollPoolFromVehicle( 'com', false, "melee-atk")
});
html.find('.damage-melee').click((event) => {
this.actor.rollPool( 'str', false, "melee-dmg");
this.actor.rollPoolFromVehicle( 'str', false, "melee-dmg")
});
html.find('.attack-ranged').click((event) => {
this.actor.rollPoolFromVehicle( 'agi', false, "ranged-atk")
});
html.find('.damage-ranged').click((event) => {
this.actor.rollPool( 'per', false, "ranged-dmg");
this.actor.rollPoolFromVehicle( 'per', false, "ranged-dmg");
});
html.find('.defense-roll').click((event) => {
this.actor.rollPoolFromVehicle( 'def', true, "defense");
});
html.find('.damage-resistance').click((event) => {
this.actor.rollPool( 'phy', false, "dmg-res");
this.actor.rollVehicleDamageResistance( );
});
html.find('.roll-stat').click((event) => {
@ -269,7 +272,14 @@ export class PegasusVehicleSheet extends ActorSheet {
const fieldName = $(ev.currentTarget).data("field-name");
let value = Number(ev.currentTarget.value);
this.actor.update( { [`${fieldName}`]: value } );
});
})
html.find('.member-view').click((event) => {
const li = $(event.currentTarget).parents(".item")
let actorId = li.data("actor-id")
const actor = game.actors.get( actorId )
actor.sheet.render(true)
})
}
/* -------------------------------------------- */
@ -294,6 +304,17 @@ export class PegasusVehicleSheet extends ActorSheet {
}
}
/* -------------------------------------------- */
async _onDropActor(event, dragData) {
const actor = fromUuidSync(dragData.uuid)
if (actor) {
this.actor.addCrew(actor.id)
}else {
ui.notifications.warn("This actor is not found and can't be added to the Vehicle's crew.")
}
super._onDropActor(event)
}
/* -------------------------------------------- */
/** @override */
_updateObject(event, formData) {

View File

@ -1,6 +1,5 @@
{
"description": "Pegasus RPG system for FoundryVTT",
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v10.0.8.zip",
"esmodules": [
"modules/pegasus-main.js"
],
@ -24,7 +23,7 @@
"manifest": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/raw/branch/master/system.json",
"compatibility": {
"minimum": "10",
"verified": "10.284",
"verified": "10.285",
"maximum": "10"
},
"id": "fvtt-pegasus-rpg",
@ -254,6 +253,7 @@
],
"title": "Pegasus RPG",
"url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg",
"version": "10.0.9",
"version": "10.0.11",
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v10.0.11.zip",
"background": "systems/fvtt-pegasus-rpg/images/ui/pegasus_welcome_page.webp"
}

View File

@ -200,7 +200,7 @@
"description": ""
},
"vehicle": {
"subactors": [],
"crew": [],
"statistics": {
"fc": {
"label": "FC",

View File

@ -25,7 +25,7 @@
<li>Weapon Damage Dice : {{weaponDamageDice}}</li>
{{/if}}
{{#if isResistance}}
<li>Armor Resistance Dice : {{armor.data.resistanceDice}}</li>
<li>Armor Resistance Dice : {{armor.system.resistanceDice}}</li>
{{/if}}
{{#if stat}}
<li>Statistic : {{stat.label}}</li>
@ -38,7 +38,11 @@
<li>Weapon : {{weaponName}}</li>
{{/if}}
{{#if weapon}}
<li>Damage type : {{weapon.weapon.data.damagetype}} {{weapon.weapon.data.damagetypelevel}}</li>
{{#if vehicle}}
<li>Damage type : {{weapon.weapon.system.damagetype}}</li>
{{else}}
<li>Damage type : {{weapon.weapon.system.damagetype}} {{weapon.weapon.system.damagetypelevel}}</li>
{{/if}}
{{/if}}
{{#if isResistance}}

View File

@ -125,3 +125,17 @@
</ul>
{{/if}}
{{#if (notEmpty vehicleWeapons)}}
<label>Vehicle Weapons</label>
<ul>
{{#each vehicleWeapons as |weapon idx|}}
<li class="flex-group-left">
<label class="attribute-value checkbox"><input type="checkbox" class="vehicle-weapon-clicked" id="vehicle-weapon-{{idx}}" data-vehicle-weapon-idx="{{idx}}" {{checked weapon.applied}}/></label>
<label class="generic-label padd-right">{{weapon.label}} ({{weapon.value}})</label>
</li>
{{/each}}
</ul>
{{/if}}

View File

@ -52,9 +52,9 @@
<a class="vehicle-current-nrg-minus plus-minus-button">&nbsp;-</a>
</span>
<span class="stat-label stat-margin" name="{{key}}">Av NRG</span>
<input type="text" class="input-numeric-short" name="system.statistics.{{key}}.avgnrg" value="{{stat.avgnrg}}" data-dtype="Number" />
<input type="text" class="input-numeric-short" value="{{@root.avgNRG}}" data-dtype="Number" disabled/>
<span class="stat-label stat-margin" name="{{key}}">Max NRG</span>
<input type="text" class="input-numeric-short" name="system.statistics.{{key}}.maxnrg" value="{{stat.maxnrg}}" data-dtype="Number" />
<input type="text" class="input-numeric-short" name="system.statistics.{{key}}.maxnrg" value="{{stat.maxnrg}}" data-dtype="Number" disabled />
</div>
{{/if}}

View File

@ -3,7 +3,7 @@
{{#if img}}
<img class="actor-icon" src="{{img}}" data-edit="img" title="{{name}}" />
{{/if}}
<h1 class="dialog-roll-title roll-dialog-header">{{title}}</h1>
<h1 class="dialog-roll-title roll-dialog-header">{{title}} {{#if vehicle}} from {{vehicle.name}} {{/if}}</h1>
</header>
<div class="grid grid-2col">
@ -14,7 +14,7 @@
{{else}}
<div class="flexrow">
<span class="roll-dialog-label">Stat Dice ({{stat.label}}) : </span>
<span class="roll-dialog-label">Stat ({{stat.label}} {{#if statVehicle}}+{{statVehicle.label}}{{/if}}) : </span>
<select class="roll-dialog-label" id="statDicesLevel" type="text" name="statDicesLevel"
value="{{statDicesLevel}}" data-dtype="Number" {{#if statKey}}disabled{{/if}}>
{{#select statDicesLevel}}

View File

@ -49,6 +49,7 @@
<nav class="sheet-tabs tabs" data-group="primary">
<a class="item" data-tab="combat">Combat</a>
<a class="item" data-tab="modules">Vehicle Modules</a>
<a class="item" data-tab="crew">Crew</a>
<a class="item" data-tab="cargo">Cargo Hold</a>
<a class="item" data-tab="details">Vehicle Details</a>
</nav>
@ -281,7 +282,7 @@
<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">STEP 1 - HULL TYPE</label></h3>
<h3><label class="items-title-text">1 - Hull</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Size</label>
@ -303,7 +304,8 @@
<li class="item stat flexrow list-item list-item-shadow" data-item-id="{{hull._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{hull.img}}" /></a>
<span class="item-name-label"><a class="roll-spec">{{hull.name}}</a></span>
<span class="item-name-label-long"><a class="roll-spec">{{hull.name}}</a></span>
<span class="item-field-label-short">{{hull.system.size}}</span>
<span class="item-field-label-medium">{{hull.system.hulltype}}</span>
<span class="item-field-label-short">{{hull.system.hr}}</span>
<span class="item-field-label-short">{{hull.system.man}}</span>
@ -319,12 +321,12 @@
<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">STEP 2 - POWER CORE MODULE</label></h3>
<h3><label class="items-title-text">2 - Power core</label></h3>
</span>
<span class="item-field-label-long">
<label class="short-label">Power Core Type</label>
<span class="item-field-label-medium">
<label class="short-label">Type</label>
</span>
<span class="item-field-label-sjort">
<span class="item-field-label-short">
<label class="short-label">PC</label>
</span>
<span class="item-field-label-short">
@ -335,7 +337,7 @@
<li class="item stat flexrow list-item list-item-shadow" data-item-id="{{powercore._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{powercore.img}}" /></a>
<span class="item-name-label"><a class="roll-spec">{{powercore.name}}</a></span>
<span class="item-name-label-long"><a class="roll-spec">{{powercore.name}}</a></span>
<span class="item-field-label-medium">{{powercore.system.coretype}}</span>
<span class="item-field-label-short">{{powercore.system.pc}}</span>
<span class="item-field-label-short">{{powercore.system.nrg}}</span>
@ -350,7 +352,7 @@
<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">STEP 3 - MOBILITY MODULE</label></h3>
<h3><label class="items-title-text">3 -Mobility</label></h3>
</span>
<span class="item-field-label-long">
<label class="short-label">Vehicle Category</label>
@ -378,7 +380,7 @@
<li class="item stat flexrow list-item list-item-shadow" data-item-id="{{mobility._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{mobility.img}}" /></a>
<span class="item-name-label"><a class="roll-spec">{{mobility.name}}</a></span>
<span class="item-name-label-long"><a class="roll-spec">{{mobility.name}}</a></span>
<span class="item-field-label-long">{{mobility.system.vehiclecategory}}</span>
<span class="item-field-label-medium">{{mobility.system.quality}}</span>
<span class="item-field-label-short">{{mobility.system.mr}}</span>
@ -397,7 +399,7 @@
<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">STEP 4 - PROPULSION MODULE</label></h3>
<h3><label class="items-title-text">4 - Propulsion</label></h3>
</span>
<span class="item-field-label-medium">
<label class="short-label">Quality</label>
@ -413,7 +415,7 @@
<li class="item stat flexrow list-item list-item-shadow" data-item-id="{{propulsion._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{propulsion.img}}" /></a>
<span class="item-name-label"><a class="roll-spec">{{propulsion.name}}</a></span>
<span class="item-name-label-long"><a class="roll-spec">{{propulsion.name}}</a></span>
<span class="item-field-label-medium">{{propulsion.system.quality}}</span>
<span class="item-field-label-short">{{propulsion.system.ad}}</span>
<span class="item-field-label-short">{{propulsion.system.topspeed}}</span>
@ -428,9 +430,9 @@
<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">STEP 5 - COMBAT MODULE</label></h3>
<h3><label class="items-title-text">5 - Combat</label></h3>
</span>
<span class="item-field-label-medium">
<span class="item-field-label-long">
<label class="short-label">Quality</label>
</span>
<span class="item-field-label-short">
@ -441,8 +443,8 @@
<li class="item stat flexrow list-item list-item-shadow" data-item-id="{{combat._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{combat.img}}" /></a>
<span class="item-name-label"><a class="roll-spec">{{combat.name}}</a></span>
<span class="item-field-label-medium">{{combat.system.quality}}</span>
<span class="item-name-label-long"><a class="roll-spec">{{combat.name}}</a></span>
<span class="item-field-label-long">{{combat.system.combattype}}</span>
<span class="item-field-label-short">{{combat.system.fc}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
@ -455,7 +457,7 @@
<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">VEHICLES MODULES</label></h3>
<h3><label class="items-title-text">Vehicles modules</label></h3>
</span>
<span class="item-field-label-long">
<label class="short-label">Category</label>
@ -480,7 +482,7 @@
<li class="item stat flexrow list-item list-item-shadow" data-item-id="{{vehiclemod._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{vehiclemod.img}}" /></a>
<span class="item-name-label"><a class="roll-spec">{{vehiclemod.name}}</a></span>
<span class="item-name-label-long"><a class="roll-spec">{{vehiclemod.name}}</a></span>
<span class="item-field-label-long">{{vehiclemod.system.category}}</span>
<span class="item-field-label-long">{{vehiclemod.system.location}}</span>
<span class="item-field-label-long">{{vehiclemod.system.security}}</span>
@ -498,7 +500,7 @@
<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">VEHICLES WEAPONS</label></h3>
<h3><label class="items-title-text">Vehicles weapons</label></h3>
</span>
<span class="item-field-label-long">
<label class="short-label">Site</label>
@ -526,7 +528,7 @@
<li class="item stat flexrow list-item list-item-shadow" data-item-id="{{weapon._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"><a class="roll-spec">{{weapon.name}}</a></span>
<span class="item-name-label-long"><a class="roll-spec">{{weapon.name}}</a></span>
<span class="item-field-label-long">{{weapon.system.site}}</span>
<span class="item-field-label-long">{{weapon.system.location}}</span>
<span class="item-field-label-short">{{weapon.system.dmg}}</span>
@ -545,6 +547,29 @@
</div>
{{!-- Crew Tab --}}
<div class="tab items" data-group="primary" data-tab="crew">
<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">Crew</label></h3>
</span>
<div class="item-filler">&nbsp;</div>
</li>
{{#each crewList as |member key|}}
<li class="item flexrow list-item list-item-shadow" data-actor-id="{{member.id}}">
<a class="member-view item-name-img" title="View Actor"><img class="sheet-competence-img"
src="{{member.img}}" /></a>
<span class="item-name-label">{{member.name}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control member-delete" title="Delete Member"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
{{!-- Cargo Tab --}}
<div class="tab equipment" data-group="primary" data-tab="cargo">
@ -856,230 +881,8 @@
{{!-- Details Tab --}}
<div class="tab biodata" data-group="primary" data-tab="details">
<div class="grid grid-2col">
<div>
<ul class="item-list alternate-list">
<li class="item flexrow">
<label class="generic-label">Origin</label>
<input type="text" class="" name="system.biodata.origin" value="{{data.biodata.origin}}"
data-dtype="String" />
</li>
<li class="item flexrow">
<label class="generic-label">Age</label>
<input type="text" class="" name="system.biodata.age" value="{{data.biodata.age}}" data-dtype="String" />
</li>
<li class="item flexrow">
<label class="generic-label">Height</label>
<input type="text" class="" name="system.biodata.size" value="{{data.biodata.size}}" data-dtype="String" />
</li>
<li class="item flexrow">
<label class="generic-label">Eyes</label>
<input type="text" class="" name="system.biodata.eyes" value="{{data.biodata.eyes}}" data-dtype="String" />
</li>
<li class="item flexrow">
<label class="generic-label">Hair</label>
<input type="text" class="" name="system.biodata.hair" value="{{data.biodata.hair}}" data-dtype="String" />
</li>
</ul>
</div>
<div>
<ul>
<li class="flexrow item">
<label class="generic-label">Weight</label>
<input type="text" class="" name="system.biodata.weight" value="{{data.biodata.weight}}"
data-dtype="String" />
</li>
<li class="flexrow item">
<label class="generic-label">Sex</label>
<input type="text" class="" name="system.biodata.sex" value="{{data.biodata.sex}}" data-dtype="String" />
</li>
<li class="flexrow item">
<label class="generic-label">Preferred Hand</label>
<input type="text" class="" name="system.biodata.preferredhand" value="{{data.biodata.preferredhand}}"
data-dtype="String" />
</li>
<li class="flexrow item" data-item-id="{{race._id}}">
<label class="generic-label">Race</label>
<a class="item-edit"><img class="stat-icon" src="{{race.img}}"></a>
<input type="text" class="" name="system.biodata.racename" value="{{race.name}}" disabled
data-dtype="String" />
<div class="item-controls">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
<li class="flexrow item" data-item-id="{{role._id}}">
<label class="generic-label">Role</label>
<a class="item-edit"><img class="stat-icon" src="{{role.img}}"></a>
<input type="text" class="" name="system.biodata.rolename" value="{{role.name}}" disabled
data-dtype="String" />
<div class="item-controls">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
</ul>
</div>
</div>
<div>
<ul class="stat-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Virtues</label></h3>
</span>
<span class="item-field-label-short">Status</label></span>
</li>
{{#each virtues as |virtue key|}}
<li class="item stat flexrow list-item list-item-shadow" data-arme-id="{{virtue.id}}"
data-item-id="{{virtue._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{virtue.img}}" /></a>
<span class="item-name-label">{{virtue.name}}</span>
<span class="item-field-label-short"><label class="short-label">
{{#if virtue.system.activated}}
Activated
{{else}}
&nbsp;-&nbsp;
{{/if}}
</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control vice-virtue-activate" title="Activated">{{#if virtue.system.activated}}<i
class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
<div>
<ul class="stat-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Vices</label></h3>
</span>
<span class="item-field-label-short">Status</label></span>
</li>
{{#each vices as |vice key|}}
<li class="item stat flexrow list-item list-item-shadow" data-arme-id="{{vice.id}}"
data-item-id="{{vice._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{vice.img}}" /></a>
<span class="item-name-label">{{vice.name}}</span>
<span class="item-field-label-short"><label class="short-label">
{{#if vice.system.activated}}
Activated
{{else}}
&nbsp;-&nbsp;
{{/if}}
</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control vice-virtue-activate" title="Activated">{{#if vice.system.activated}}<i
class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
<ul>
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Psychology</label></h3>
</span>
</li>
<li class="flexrow">
<label class="short-label">Worst Fear </label>
<input type="text" class="" name="system.biodata.worstfear" value="{{data.biodata.worstfear}}"
data-dtype="String" />
<label class="attribute-value checkbox"><input type="checkbox" class="change-worstfear"
name="system.biodata.worstfearactive" {{checked data.biodata.worstfearactive}} /> Active ?</label>
</li>
<li class="flexrow">
<label class="short-label">Desires </label>
<input type="text" class="" name="system.biodata.desires" value="{{data.biodata.desires}}"
data-dtype="String" />
<label class="attribute-value checkbox"><input type="checkbox" class="change-desires"
name="system.biodata.desiresactive" {{checked data.biodata.desiresactive}} /> Active ?</label>
</li>
</ul>
<h3>Catchphrase : </h3>
<ul>
<li class="flexrow">
<label class="short-label">Catchphrase </label>
<input type="text" class="" name="system.biodata.catchphrase" value="{{data.biodata.catchphrase}}"
data-dtype="String" />
</li>
<li class="flexrow">
<label class="short-label">Catchphrase Trigger : </label>
<input type="text" class="" name="system.biodata.catchphrasetrigger" value="{{data.biodata.catchphrasetrigger}}"
data-dtype="String" />
</li>
<li class="flexrow">
<label class="short-label">Catchphrase used </label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.biodata.catchphraseused" {{checked
data.biodata.catchphraseused}} /></label>
</li>
</ul>
<ul>
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Development</label></h3>
</span>
</li>
<li class="flexrow">
<label class="short-label">Character Value : </label>
<input type="text" class="" name="system.biodata.charactervalue" value="{{data.biodata.charactervalue}}"
data-dtype="String" />
</li>
<li class="flexrow">
<label class="short-label">Character Development Points Total (CDP total) : </label>
<input type="text" class="" name="system.biodata.cdp" value="{{data.biodata.cdp}}" data-dtype="Number" />
</li>
<li class="flexrow">
<label class="short-label">Bonus selection : </label>
<input type="text" class="" name="system.biodata.bonusselection" value="{{data.biodata.bonusselection}}" data-dtype="String" />
</li>
<li class="flexrow">
<label class="short-label">Morality : </label>
<input type="text" class="" name="system.biodata.morality" value="{{data.biodata.morality}}" data-dtype="Number" />
</li>
<li class="flexrow">
<label class="short-label">Morality threshold : </label>
<input type="text" class="" name="system.biodata.moralitythreshold" value="{{data.biodata.moralitythreshold}}" disabled data-dtype="Number" />
</li>
<li class="flexrow">
<label class="short-label">Hero Level (max) : </label>
<select class="status-small-label color-class-common" type="text" name="system.biodata.maxlevelremaining" value="{{data.biodata.maxlevelremaining}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
{{#select data.biodata.maxlevelremaining}}
{{{@root.maxLevelRemainingList}}}
{{/select}}
</select>
</li>
<li class="flexrow">
<label class="short-label">Hero Levels Remaining : </label>
<select class="status-small-label color-class-common" type="text" name="system.biodata.currentlevelremaining" value="{{data.biodata.currentlevelremaining}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
{{#select data.biodata.currentlevelremaining}}
{{{@root.levelRemainingList}}}
{{/select}}
</select>
</li>
<li class="flexrow">
<label class="short-label">Threat Level : </label>
<input type="text" class="" name="system.biodata.threatlevel" value="{{data.biodata.threatlevel}}"
data-dtype="Number" />
</li>
</ul>
<hr>
<h3>Background : </h3>
<h3>Description : </h3>
<div class="form-group editor">
{{editor data.biodata.description target="system.biodata.description" button=true owner=owner
editable=editable}}