Compare commits

...

10 Commits

Author SHA1 Message Date
7a1171b774 Vehicles enhancements 2022-09-25 09:26:12 +02:00
7a9ed39d02 Actor/Crew rolls 2022-09-21 16:58:02 +02:00
8345ee0ebb Actor/Crew rolls 2022-09-21 16:54:34 +02:00
343ac6ab9d NRG stuff 2022-09-18 17:30:15 +02:00
9a20a96cec Start vehicle automation 2022-09-16 17:36:58 +02:00
ae697b0bb8 WIP for vehicle sheets 2022-09-09 08:33:28 +02:00
ecf5a38eb0 WIP for vehicle sheets 2022-09-08 21:26:45 +02:00
1849a60194 Vehicle - WIP 2022-09-05 11:32:21 +02:00
fbb578c541 Vehicle - WIP 2022-09-05 08:57:48 +02:00
7614964772 Vehicle - WIP 2022-09-05 08:57:02 +02:00
29 changed files with 2285 additions and 378 deletions

View File

@ -1,6 +1,6 @@
[Dolphin]
SortRole=creationtime
Timestamp=2021,4,13,9,23,48.267
SortRole=modificationtime
Timestamp=2022,9,8,20,43,38.73
Version=4
ViewMode=1
VisibleRoles=Details_text,Details_size,Details_modificationtime,Details_creationtime,CustomizedDetails

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -246,7 +246,7 @@ export class PegasusActorSheet extends ActorSheet {
this.actor.rollPool( 'agi', false, "ranged-atk");
});
html.find('.defense-roll').click((event) => {
this.actor.rollPool( 'def', true);
this.actor.rollPool( 'def', true, "defence");
});
html.find('.damage-melee').click((event) => {
this.actor.rollPool( 'str', false, "melee-dmg");
@ -365,7 +365,10 @@ export class PegasusActorSheet extends ActorSheet {
if (item == undefined) {
item = this.actor.items.get( dragData.uuid )
}
let ret = await this.actor.preprocessItem( event, item, true )
console.log("Dropped", item)
let itemFull = await PegasusUtility.searchItem( item )
let ret = await this.actor.preprocessItem( event, itemFull, true )
if ( ret ) {
super._onDropItem(event, dragData)
}

View File

@ -7,10 +7,55 @@ const coverBonusTable = { "nocover": 0, "lightcover": 2, "heavycover": 4, "entre
const statThreatLevel = ["agi", "str", "phy", "com", "def", "per"]
const __subkey2title = {
"melee-dmg": "Melee Damage", "melee-atk": "Melee Attack", "ranged-atk": "Ranged Attack",
"ranged-dmg": "Ranged Damage", "dmg-res": "Damare Resistance"
"ranged-dmg": "Ranged Damage", "defence": "Defence", "dmg-res": "Damare Resistance"
}
const __statBuild = [
{ modules: ["vehiclehull"], field: "hr", itemfield: "hr" },
{ modules: ["vehiclehull", "vehiclemodule"], field: "hr", itemfield: "size", subfield: "size" },
//{ 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", 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 }
const __num2speed = ["fullstop", "crawling", "slow", "average", "fast", "extfast"]
const __isVehicle = { vehiclehull: 1, powercoremodule: 1, mobilitymodule: 1, combatmodule: 1, propulsionmodule: 1, vehiclemodule: 1, vehicleweaponmodule: 1, effect: 1 }
const __bonusEffect = {
name: "Crawling MAN Bonus", type: "effect", img: "systems/fvtt-pegasus-rpg/images/icons/icon_effect.webp",
system: {
type: "physical",
genre: "positive",
effectlevel: 3,
reducedicevalue: false,
stataffected: "man",
specaffected: [],
statdice: false,
bonusdice: true,
weapondamage: false,
hindrance: false,
resistedby: "notapplicable",
recoveryroll: false,
recoveryrollstat: "",
recoveryrollspec: [],
effectstatlevel: false,
effectstat: "",
oneuse: false,
ignorehealthpenalty: false,
isthispossible: "",
mentaldisruption: false,
physicaldisruption: false,
mentalimmunity: false,
physicalimmunity: false,
nobonusdice: false,
noperksallowed: false,
description: "",
otherdice: false
}
}
/* -------------------------------------------- */
/* -------------------------------------------- */
/**
* Extend the base Actor entity by defining a custom roll data structure which is ideal for the Simple system.
@ -71,7 +116,9 @@ export class PegasusActor extends Actor {
this.system.encCapacity = this.getEncumbranceCapacity()
this.buildContainerTree()
}
if (this.type == 'vehicle') {
this.computeVehicleStats();
}
super.prepareDerivedData();
}
@ -106,6 +153,42 @@ export class PegasusActor extends Actor {
let comp = this.items.filter(item => item.type == 'effect');
return comp;
}
/* -------------------------------------------- */
getCombatModules() {
let comp = this.items.filter(item => item.type == 'combatmodule');
return comp;
}
/* -------------------------------------------- */
getVehicleHull() {
let comp = this.items.filter(item => item.type == 'vehiclehull');
return comp;
}
/* -------------------------------------------- */
getPowercoreModules() {
let comp = this.items.filter(item => item.type == 'powercoremodule');
return comp;
}
/* -------------------------------------------- */
getMobilityModules() {
let comp = this.items.filter(item => item.type == 'mobilitymodule');
return comp;
}
/* -------------------------------------------- */
getPropulsionModules() {
let comp = this.items.filter(item => item.type == 'propulsionmodule');
return comp;
}
/* -------------------------------------------- */
getVehicleModules() {
let comp = this.items.filter(item => item.type == 'vehiclemodule');
return comp;
}
/* -------------------------------------------- */
getVehicleWeaponModules() {
let comp = this.items.filter(item => item.type == 'vehicleweaponmodule');
return comp;
}
/* -------------------------------------------- */
getPowers() {
let comp = this.items.filter(item => item.type == 'power');
@ -210,7 +293,8 @@ export class PegasusActor extends Actor {
/* -------------------------------------------- */
async manageDesires(flag) {
if (flag) {
let effect = await PegasusUtility.getEffectFromCompendium("Desires")
let effect = await PegasusUtility.getEffectFromCompendium("Desire")
//console.log("EFFECT", effect)
effect.system.desires = true
this.createEmbeddedDocuments('Item', [effect])
} else {
@ -285,7 +369,7 @@ export class PegasusActor extends Actor {
nrg.activated += item.system.costspent
nrg.value -= item.system.costspent
nrg.max -= item.system.costspent
await this.update({ 'data.nrg': nrg })
await this.update({ 'system.nrg': nrg })
let effects = []
for (let effect of item.system.effectsgained) {
@ -301,7 +385,7 @@ export class PegasusActor extends Actor {
} else {
nrg.activated -= item.system.costspent
nrg.max += item.system.costspent
await this.update({ 'data.nrg': nrg })
await this.update({ 'system.nrg': nrg })
let toRem = []
for (let item of this.items) {
@ -390,7 +474,7 @@ export class PegasusActor extends Actor {
tl += equip.system.threatlevel
}
if (tl != this.system.biodata.threatlevel) {
this.update({ 'data.biodata.threatlevel': tl })
this.update({ 'system.biodata.threatlevel': tl })
}
}
@ -459,7 +543,7 @@ export class PegasusActor extends Actor {
let combat = duplicate(this.system.combat)
combat.stunlevel += incDec
if (combat.stunlevel >= 0) {
this.update({ 'data.combat': combat })
this.update({ 'system.combat': combat })
let chatData = {
user: game.user.id,
rollMode: game.settings.get("core", "rollMode"),
@ -481,7 +565,7 @@ export class PegasusActor extends Actor {
if (incDec > 0 && stunAbove > 0) {
let delirium = duplicate(this.system.secondary.delirium)
delirium.value -= incDec
this.update({ 'data.secondary.delirium': delirium })
this.update({ 'system.secondary.delirium': delirium })
}
}
@ -489,7 +573,7 @@ export class PegasusActor extends Actor {
modifyMomentum(incDec) {
let momentum = duplicate(this.system.momentum)
momentum.value += incDec
this.update({ 'data.momentum': momentum })
this.update({ 'system.momentum': momentum })
let chatData = {
user: game.user.id,
rollMode: game.settings.get("core", "rollMode"),
@ -539,11 +623,11 @@ export class PegasusActor extends Actor {
ui.notifications.warn("Container is already full !")
return
} else {
await this.updateEmbeddedDocuments("Item", [{ _id: object.id, 'data.containerid': containerId }])
await this.updateEmbeddedDocuments("Item", [{ _id: object.id, 'system.containerid': containerId }])
}
} else if (object && object.system.containerid) { // remove from container
console.log("Removeing: ", object)
await this.updateEmbeddedDocuments("Item", [{ _id: object.id, 'data.containerid': "" }]);
await this.updateEmbeddedDocuments("Item", [{ _id: object.id, 'system.containerid': "" }]);
}
}
/* -------------------------------------------- */
@ -576,6 +660,12 @@ export class PegasusActor extends Actor {
/* -------------------------------------------- */
async preprocessItem(event, item, onDrop = false) {
console.log("Pre-process", item)
if (item.type != "effect" && __isVehicle[item.type]) {
ui.notifications.warn("You can't drop Vehicles item over a character sheet.")
return
}
// Pre-filter effects
if (item.type == 'effect') {
if (this.checkMentalDisruption() && item.system.type == "mental" && item.system.genre == "positive") {
@ -596,12 +686,13 @@ export class PegasusActor extends Actor {
}
}
if (item.type == 'race') {
this.applyRace(item.system)
this.applyRace(item)
} else if (item.type == 'role') {
this.applyRole(item.system)
this.applyRole(item)
} else if (item.type == 'ability') {
this.applyAbility(item.system, [], true)
this.applyAbility(item, [], true)
if (!onDrop) {
await this.createEmbeddedDocuments('Item', [item])
}
@ -661,7 +752,7 @@ export class PegasusActor extends Actor {
async addSubActor(subActorId) {
let subActors = duplicate(this.system.subactors);
subActors.push(subActorId);
await this.update({ 'data.subactors': subActors });
await this.update({ 'system.subactors': subActors });
}
/* -------------------------------------------- */
async delSubActor(subActorId) {
@ -671,7 +762,7 @@ export class PegasusActor extends Actor {
newArray.push(id);
}
}
await this.update({ 'data.subactors': newArray });
await this.update({ 'system.subactors': newArray });
}
/* -------------------------------------------- */
@ -687,12 +778,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;
}
@ -721,7 +812,7 @@ export class PegasusActor extends Actor {
if (powers.length > 0) {
this.createEmbeddedDocuments('Item', powers)
}
this.updateEmbeddedDocuments('Item', [{ _id: specId, 'data.powersactivated': true }])
this.updateEmbeddedDocuments('Item', [{ _id: specId, 'system.powersactivated': true }])
}
}
@ -736,7 +827,7 @@ export class PegasusActor extends Actor {
if (toRem.length > 0) {
this.deleteEmbeddedDocuments('Item', toRem)
}
this.updateEmbeddedDocuments('Item', [{ _id: specId, 'data.powersactivated': false }])
this.updateEmbeddedDocuments('Item', [{ _id: specId, 'system.powersactivated': false }])
}
/* -------------------------------------------- */
@ -751,7 +842,7 @@ export class PegasusActor extends Actor {
if (effects.length > 0) {
this.createEmbeddedDocuments('Item', effects)
}
this.updateEmbeddedDocuments('Item', [{ _id: itemId, 'data.activated': true }])
this.updateEmbeddedDocuments('Item', [{ _id: itemId, 'system.activated': true }])
}
}
@ -766,7 +857,7 @@ export class PegasusActor extends Actor {
if (toRem.length > 0) {
this.deleteEmbeddedDocuments('Item', toRem)
}
this.updateEmbeddedDocuments('Item', [{ _id: itemId, 'data.activated': false }])
this.updateEmbeddedDocuments('Item', [{ _id: itemId, 'system.activated': false }])
}
/* -------------------------------------------- */
@ -841,7 +932,7 @@ export class PegasusActor extends Actor {
let item = this.items.get(itemId)
if (item && value) {
value = Number(value) || 0
await this.updateEmbeddedDocuments('Item', [{ _id: itemId, 'data.costspent': value }])
await this.updateEmbeddedDocuments('Item', [{ _id: itemId, 'system.costspent': value }])
}
}
@ -851,7 +942,7 @@ export class PegasusActor extends Actor {
for (let perk of this.items) {
if (perk.type == "perk") {
this.cleanPerkEffects(perk.id)
this.updateEmbeddedDocuments('Item', [{ _id: perk.id, 'data.status': "ready", 'data.used1': false, 'data.used2': false, 'data.used3': false }])
this.updateEmbeddedDocuments('Item', [{ _id: perk.id, 'system.status': "ready", 'system.used1': false, 'system.used2': false, 'system.used3': false }])
ChatMessage.create({ content: `Perk ${perk.name} has been deactivated due to Severe Trauma state !` })
}
}
@ -860,10 +951,18 @@ export class PegasusActor extends Actor {
/* -------------------------------------------- */
incDecNRG(value) {
if (this.type == "character") {
let nrg = duplicate(this.system.nrg)
nrg.value += value
if (nrg.value >= 0 && nrg.value <= nrg.max) {
this.update({ 'data.nrg': nrg })
this.update({ 'system.nrg': nrg })
}
} else {
let pc = duplicate(this.system.statistics.pc)
pc.curnrg += value
if (pc.curnrg >= 0 && pc.curnrg <= pc.maxnrg) {
this.update({ 'system.statistics.pc': pc })
}
}
}
@ -1001,6 +1100,7 @@ export class PegasusActor extends Actor {
/* -------------------------------------------- */
getTraumaState() {
this.traumaState = "none"
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) {
@ -1010,6 +1110,7 @@ export class PegasusActor extends Actor {
this.traumaState = "severetrauma"
}
}
}
return this.traumaState
}
@ -1098,70 +1199,72 @@ export class PegasusActor extends Actor {
}
}
/* -------------------------------------------- */
async computeNRGHealth() {
if (this.isOwner || game.user.isGM) {
let updates = {}
let phyDiceValue = PegasusUtility.getDiceValue(this.system.statistics.phy.value) + this.system.secondary.health.bonus + this.system.statistics.phy.mod;
if (phyDiceValue != this.system.secondary.health.max) {
updates['data.secondary.health.max'] = phyDiceValue
updates['system.secondary.health.max'] = phyDiceValue
}
if (this.computeValue) {
updates['data.secondary.health.value'] = phyDiceValue
updates['system.secondary.health.value'] = phyDiceValue
}
let mndDiceValue = PegasusUtility.getDiceValue(this.system.statistics.mnd.value) + this.system.secondary.delirium.bonus + this.system.statistics.mnd.mod;
if (mndDiceValue != this.system.secondary.delirium.max) {
updates['data.secondary.delirium.max'] = mndDiceValue
updates['system.secondary.delirium.max'] = mndDiceValue
}
if (this.computeValue) {
updates['data.secondary.delirium.value'] = mndDiceValue
updates['system.secondary.delirium.value'] = mndDiceValue
}
let stlDiceValue = PegasusUtility.getDiceValue(this.system.statistics.stl.value) + this.system.secondary.stealthhealth.bonus + this.system.statistics.stl.mod;
if (stlDiceValue != this.system.secondary.stealthhealth.max) {
updates['data.secondary.stealthhealth.max'] = stlDiceValue
updates['system.secondary.stealthhealth.max'] = stlDiceValue
}
if (this.computeValue) {
updates['data.secondary.stealthhealth.value'] = stlDiceValue
updates['system.secondary.stealthhealth.value'] = stlDiceValue
}
let socDiceValue = PegasusUtility.getDiceValue(this.system.statistics.soc.value) + this.system.secondary.socialhealth.bonus + this.system.statistics.soc.mod;
if (socDiceValue != this.system.secondary.socialhealth.max) {
updates['data.secondary.socialhealth.max'] = socDiceValue
updates['system.secondary.socialhealth.max'] = socDiceValue
}
if (this.computeValue) {
updates['data.secondary.socialhealth.value'] = socDiceValue
updates['system.secondary.socialhealth.value'] = socDiceValue
}
let nrgValue = PegasusUtility.getDiceValue(this.system.statistics.foc.value) + this.system.nrg.mod + this.system.statistics.foc.mod
if (nrgValue != this.system.nrg.absolutemax) {
updates['data.nrg.absolutemax'] = nrgValue
updates['system.nrg.absolutemax'] = nrgValue
}
if (this.computeValue) {
updates['data.nrg.max'] = nrgValue
updates['data.nrg.value'] = nrgValue
updates['system.nrg.max'] = nrgValue
updates['system.nrg.value'] = nrgValue
}
let stunth = PegasusUtility.getDiceValue(this.system.statistics.phy.value) + PegasusUtility.getDiceValue(this.system.statistics.mnd.value) + PegasusUtility.getDiceValue(this.system.statistics.foc.value)
+ this.system.statistics.mnd.mod + this.system.statistics.phy.mod + this.system.statistics.foc.mod
if (stunth != this.system.combat.stunthreshold) {
updates['data.combat.stunthreshold'] = stunth
updates['system.combat.stunthreshold'] = stunth
}
let momentum = this.system.statistics.foc.value + this.system.statistics.foc.mod
if (momentum != this.system.momentum.max) {
updates['data.momentum.value'] = 0
updates['data.momentum.max'] = momentum
updates['system.momentum.value'] = 0
updates['system.momentum.max'] = momentum
}
let mrLevel = (this.system.statistics.agi.value + this.system.statistics.str.value) - this.system.statistics.phy.value
mrLevel = (mrLevel < 1) ? 1 : mrLevel;
if (mrLevel != this.system.mr.value) {
updates['data.mr.value'] = mrLevel
updates['system.mr.value'] = mrLevel
}
let moralitythreshold = - (Number(PegasusUtility.getDiceValue(this.system.statistics.foc.value)) + Number(this.system.statistics.foc.mod))
if (moralitythreshold != this.system.biodata.moralitythreshold) {
updates['data.biodata.moralitythreshold'] = moralitythreshold
updates['system.biodata.moralitythreshold'] = moralitythreshold
}
if (!this.isToken) {
if (this.warnMorality != this.system.biodata.morality && this.system.biodata.morality < 0) {
@ -1175,11 +1278,11 @@ export class PegasusActor extends Actor {
let race = this.getRace()
if (race && race.name && (race.name != this.system.biodata.racename)) {
updates['data.biodata.racename'] = race.name
updates['system.biodata.racename'] = race.name
}
let role = this.getRole()
if (role && role.name && (role.name != this.system.biodata.rolename)) {
updates['data.biodata.rolename'] = role.name
updates['system.biodata.rolename'] = role.name
}
if (Object.entries(updates).length > 0) {
await this.update(updates)
@ -1241,7 +1344,7 @@ export class PegasusActor extends Actor {
if (objetQ) {
let newQ = objetQ.system.quantity + incDec
if (newQ >= 0) {
const updated = await this.updateEmbeddedDocuments('Item', [{ _id: objetQ.id, 'data.quantity': newQ }]) // pdates one EmbeddedEntity
const updated = await this.updateEmbeddedDocuments('Item', [{ _id: objetQ.id, 'system.quantity': newQ }]) // pdates one EmbeddedEntity
}
}
}
@ -1251,7 +1354,7 @@ export class PegasusActor extends Actor {
if (objetQ) {
let newQ = objetQ.system.ammocurrent + incDec;
if (newQ >= 0 && newQ <= objetQ.system.ammomax) {
const updated = await this.updateEmbeddedDocuments('Item', [{ _id: objetQ.id, 'data.ammocurrent': newQ }]); // pdates one EmbeddedEntity
const updated = await this.updateEmbeddedDocuments('Item', [{ _id: objetQ.id, 'system.ammocurrent': newQ }]); // pdates one EmbeddedEntity
}
}
}
@ -1262,24 +1365,24 @@ export class PegasusActor extends Actor {
if (ability.system.affectedstat != "notapplicable") {
let stat = duplicate(this.system.statistics[ability.system.affectedstat])
stat.mod += Number(ability.system.statmodifier)
updates[`data.statistics.${ability.system.affectedstat}`] = stat
updates[`system.statistics.${ability.system.affectedstat}`] = stat
}
// manage status bonus
if (ability.system.statusaffected != "notapplicable") {
if (ability.system.statusaffected == 'nrg') {
let nrg = duplicate(this.system.nrg)
nrg.mod += Number(ability.system.statusmodifier)
updates[`data.nrg`] = nrg
updates[`system.nrg`] = nrg
}
if (ability.system.statusaffected == 'health') {
let health = duplicate(this.system.secondary.health)
health.bonus += Number(ability.system.statusmodifier)
updates[`data.secondary.health`] = health
updates[`system.secondary.health`] = health
}
if (ability.system.statusaffected == 'delirium') {
let delirium = duplicate(this.system.secondary.delirium)
delirium.bonus += Number(ability.system.statusmodifier)
updates[`data.secondary.delirium`] = delirium
updates[`system.secondary.delirium`] = delirium
}
}
if (directUpdate) {
@ -1317,11 +1420,12 @@ export class PegasusActor extends Actor {
/* -------------------------------------------- */
async applyRace(race) {
let updates = { 'data.biodata.racename': race.name }
let updates = { 'system.biodata.racename': race.name }
let newItems = []
await this.deleteAllItemsByType('race')
newItems.push(race);
console.log("DROPPED RACE", race)
for (let ability of race.system.abilities) {
newItems.push(ability)
this.applyAbility(ability, updates)
@ -1349,7 +1453,7 @@ export class PegasusActor extends Actor {
async applyRole(role) {
console.log("ROLE", role)
let updates = { 'data.biodata.rolename': role.name }
let updates = { 'system.biodata.rolename': role.name }
let newItems = []
await this.deleteAllItemsByType('role')
newItems.push(role)
@ -1370,8 +1474,9 @@ export class PegasusActor extends Actor {
/* -------------------------------------------- */
addHindrancesList(effectsList) {
if (this.type == "character") {
if (this.system.combat.stunlevel > 0) {
effectsList.push({ label: "Stun Hindrance", type: "hindrance", foreign: true, actorId: this.id, applied: false, value: this.system.combat.stunlevel })
effectsList.push({ label: "Stun Hindrance", type: "hindrance", foreign: true, actorId: this.id, applied: false, value: 2 })
}
if (this.system.combat.hindrancedice > 0) {
effectsList.push({ label: "Wounds Hindrance", type: "hindrance", foreign: true, actorId: this.id, applied: false, value: this.system.combat.hindrancedice })
@ -1391,11 +1496,31 @@ export class PegasusActor extends Actor {
}
}
}
if (this.type == "vehicle") {
if (this.system.stun.value > 0) {
effectsList.push({ label: "Stun Hindrance", type: "hindrance", foreign: true, actorId: this.id, applied: false, value: 2 })
}
if (this.isVehicleCrawling()) {
effectsList.push({ label: "Crawling Hindrance", type: "hindrance", foreign: true, actorId: this.id, applied: false, value: 3 })
}
if (this.isVehicleSlow()) {
effectsList.push({ label: "Slow Hindrance", type: "hindrance", foreign: true, actorId: this.id, applied: false, value: 1 })
}
if (this.isVehicleAverage()) {
effectsList.push({ label: "Average Hindrance", type: "hindrance", foreign: true, actorId: this.id, applied: false, value: 1 })
}
if (this.isVehicleFast()) {
effectsList.push({ label: "Fast Hindrance", type: "hindrance", foreign: true, actorId: this.id, applied: false, value: 3 })
}
if (this.isVehicleExFast()) {
effectsList.push({ label: "Ext. Fast Hindrance", type: "hindrance", foreign: true, actorId: this.id, applied: false, value: 5 })
}
}
}
/* -------------------------------------------- */
/* ROLL SECTION
/* -------------------------------------------- */
pushEffect(rollData, effect) {
if (this.getTraumaState() == "none" && !this.checkNoBonusDice()) {
rollData.effectsList.push({ label: effect.name, type: "effect", applied: false, effect: effect, value: effect.system.effectlevel })
@ -1471,9 +1596,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
@ -1486,11 +1621,42 @@ 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") {
if (vehicle.isVehicleFullStop()) {
ui.notifications.warn("MR not added to Melee Damage due to Full Stop.")
} else {
rollData.statVehicle = vehicle.system.statistics.mr
}
this.addVehicleWeapons(rollData, vehicle)
}
if (subKey == "ranged-atk") {
rollData.statVehicle = vehicle.system.statistics.fc
}
if (subKey == "ranged-dmg") {
this.addVehicleWeapons(rollData, vehicle)
}
if (subKey == "defense") {
if (vehicle.isVehicleFullStop()) {
ui.notifications.warn("MAN not added to Defense due to Full Stop.")
} else {
rollData.statVehicle = vehicle.system.statistics.man
}
}
//this.addVehiculeHindrances(rollData.effectsList, vehicle)
//this.addVehicleBonus(rollData, vehicle)
}
rollData.specList = this.getRelevantSpec(statKey)
rollData.selectedSpec = "0"
if (statKey.toLowerCase() == "mr") {
@ -1498,21 +1664,13 @@ 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 diceList = diceKey.split(" ")
let mod = rollData.stat.mod
for (let myDice of diceList) {
myDice = myDice.trim()
let newDice = {
name: "stat", key: myDice, level: PegasusUtility.getLevelFromDice(myDice), mod: mod,
img: `systems/fvtt-pegasus-rpg/images/dice/${myDice}.webp`
}
rollData.dicePool.push(newDice)
mod = 0 // Only first dice has modifier
rollData.dicePool = rollData.dicePool.concat(PegasusUtility.buildDicePool("stat", rollData.statDicesLevel, rollData.stat.mod))
if (rollData.statVehicle) {
rollData.dicePool = rollData.dicePool.concat(PegasusUtility.buildDicePool("statvehicle", rollData.statVehicle.currentlevel, 0))
}
}
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)
@ -1558,10 +1716,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
@ -1570,9 +1728,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 !");
@ -1678,7 +1833,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
@ -1690,4 +1845,299 @@ export class PegasusActor extends Actor {
ui.notifications.warn("Power not found !", powerId);
}
}
/* -------------------------------------------- */
/* VEHICLE STUFF */
manageCurrentSpeed(speed) {
if (speed == "fullstop") {
this.update({ 'system.secondary.moverange': "nomovement" })
}
if (speed == "crawling") {
this.update({ 'system.secondary.moverange': "threatzone" })
}
if (speed == "slow") {
this.update({ 'system.secondary.moverange': "close" })
}
if (speed == "average") {
this.update({ 'system.secondary.moverange': "medium" })
}
if (speed == "fast") {
this.update({ 'system.secondary.moverange': "long" })
}
if (speed == "extfast") {
this.update({ 'system.secondary.moverange': "extreme" })
}
}
/* -------------------------------------------- */
modifyVehicleStun(incDec) {
let stun = this.system.stun.value + incDec
this.update({ 'stun.value': stun })
}
/* -------------------------------------------- */
addTopSpeedBonus(topspeed, bonus) {
let num = __speed2Num[topspeed] + Number(bonus)
num = Math.max(0, num)
num = Math.min(num, __num2speed.length - 1)
return __num2speed[num]
}
/* -------------------------------------------- */
manageVehicleSpeedBonus(speed, name, stat, level) {
if (this.system.statistics.ad.currentspeed == speed) {
if (!this.items.find(effect => effect.system.isspeed == speed)) {
let effect = duplicate(__bonusEffect)
effect.name = name
effect.system.stataffected = stat
effect.system.effectlevel = level
effect.system.isspeed = speed
this.createEmbeddedDocuments("Item", [effect])
}
} else {
let effect = this.items.find(effect => effect.system.isspeed == speed)
if (effect) {
this.deleteEmbeddedDocuments("Item", [effect.id])
}
}
}
/* -------------------------------------------- */
async computeVehicleStats() {
if (this.type == "vehicle") {
for (let statDef of __statBuild) {
let sum = 0
let list = []
for (let moduleType of statDef.modules) {
list = list.concat(this.items.filter(item => item.type == moduleType))
}
if (list && list.length > 0) {
sum = list.reduce((value, item2) => value + Number(item2.system[statDef.itemfield]), 0)
}
//console.log("Processing", statDef.field, this.system.statistics[statDef.field].level, list, sum)
if (statDef.subfield) {
if (sum != Number(this.system.statistics[statDef.field][statDef.subfield])) {
//console.log("Update", statDef.field, statDef.subfield, sum, this.system.statistics[statDef.field][statDef.subfield])
this.update({ [`system.statistics.${statDef.field}.${statDef.subfield}`]: sum })
}
} 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 })
}
}
}
}
}
// Top speed management
let mobility = this.items.find(item => item.type == "mobilitymodule")
let arcs = duplicate(this.system.arcs)
if (mobility) {
let propulsion = this.items.find(item => item.type == "propulsionmodule")
let bonus = (propulsion) ? propulsion.system.topspeed : 0
arcs.frontarc.topspeed = this.addTopSpeedBonus(mobility.system.ts_f, bonus)
arcs.rightarc.topspeed = mobility.system.ts_s
arcs.leftarc.topspeed = mobility.system.ts_s
arcs.toparc.topspeed = mobility.system.ts_s
arcs.bottomarc.topspeed = mobility.system.ts_s
arcs.reararc.topspeed = mobility.system.ts_r
} else {
arcs.frontarc.topspeed = "fullstop"
arcs.rightarc.topspeed = "fullstop"
arcs.leftarc.topspeed = "fullstop"
arcs.toparc.topspeed = "fullstop"
arcs.bottomarc.topspeed = "fullstop"
arcs.reararc.topspeed = "fullstop"
}
for (let key in this.system.arcs) {
if (this.system.arcs[key].topspeed != arcs[key].topspeed) {
this.update({ 'system.arcs': arcs })
}
}
// VMS management
let hull = this.items.find(item => item.type == "vehiclehull")
let modules = duplicate(this.system.modules)
if (hull) {
modules.totalvms = Number(hull.system.vms)
} else {
modules.totalvms = 0
}
let spaceList = this.items.filter(item => item.type == "vehiclemodule") || []
spaceList = spaceList.concat(this.items.filter(item => item.type == "vehicleweaponmodule") || [])
let space = 0
if (spaceList && spaceList.length > 0) {
space = spaceList.reduce((value, item2) => value + Number(item2.system.space), 0)
}
modules.usedvms = space
if (modules.totalvms != this.system.modules.totalvms || modules.usedvms != this.system.modules.usedvms) {
this.update({ 'system.modules': modules })
}
if (modules.usedvms > modules.totalvms) {
ui.notifications.warn("Warning! No more space available in cargo !!")
}
}
// Speed effect management
this.manageVehicleSpeedBonus("crawling", "Crawling MAN Bonus", "man", 3)
this.manageVehicleSpeedBonus("slow", "Slow MAN Bonus", "man", 1)
this.manageVehicleSpeedBonus("average", "Avoid attack Bonus", "all", 1)
this.manageVehicleSpeedBonus("fast", "Avoid attack Bonus", "all", 3)
this.manageVehicleSpeedBonus("extfast", "Avoid attack Bonus", "all", 5)
}
/* -------------------------------------------- */
getTotalCost() {
let sumCost = 0
for (let item of this.items) {
if (__isVehicle[item.type]) {
if (item.system.cost) {
sumCost += Number(item.system.cost)
}
}
}
return sumCost
}
/* -------------------------------------------- */
async preprocessItemVehicle(event, item, onDrop = false) {
if (item.type != "effect" && !__isVehicle[item.type]) {
ui.notifications.warn("You can't drop Character items over a vehicle sheet.")
return
}
//console.log(">>>>> item", item.type, __isVehicleUnique[item.type])
if (__isVehicleUnique[item.type]) {
let toDelList = []
for (let toDel of this.items) {
if (toDel.type == item.type) {
toDelList.push(toDel.id)
}
}
//console.log("TODEL : ", toDelList)
if (toDelList.length > 0) {
await this.deleteEmbeddedDocuments('Item', toDelList)
}
}
// 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
}
}
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 })
}
/* -------------------------------------------- */
delCrew(actorId) {
let crewList = duplicate(this.system.crew.filter(actorDef => actorDef.id != actorId) || [])
this.update({ 'system.crew': crewList })
}
/* -------------------------------------------- */
isVehicleFullStop() {
return this.system.statistics.ad.currentspeed == "fullstop"
}
isVehicleCrawling() {
return this.system.statistics.ad.currentspeed == "crawling"
}
isVehicleSlow() {
return this.system.statistics.ad.currentspeed == "slow"
}
isVehicleAverage() {
return this.system.statistics.ad.currentspeed == "average"
}
isVehicleFast() {
return this.system.statistics.ad.currentspeed == "fast"
}
isVehicleExFast() {
return this.system.statistics.ad.currentspeed == "extfast"
}
/* -------------------------------------------- */
isValidActor() {
// 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")) {
return actorTest
}
}
if (!actor) {
ui.notifications.warn("You do no own any actors in the crew of this vehicle.")
return
}
}
/* -------------------------------------------- */
rollPoolFromVehicle(statKey, useShield = false, subKey = "none") {
let actor = this.isValidActor()
if (actor) {
actor.rollPool(statKey, useShield, subKey, this)
}
}
/* -------------------------------------------- */
addVehicleShields(rollData) {
let shields = this.items.filter( shield => shield.type == "vehiclemodule" && shield.system.activated && shield.system.shielddicevalue > 0) || []
for (let shield of shields) {
rollData.vehicleShieldList.push({ label: `${shield.name} (${shield.system.arccoverage})`, type: "vehicleshield", applied: false, value: shield.system.shielddicevalue })
}
}
/* -------------------------------------------- */
rollVehicleDamageResistance() {
let actor = this.isValidActor()
if (actor) {
let stat = this.getStat("hr")
let rollData = this.getCommonRollData("hr")
rollData.mode = "stat"
rollData.title = `Stat ${stat.label}`;
this.addVehicleShields(rollData)
this.startRoll(rollData)
}
}
/* -------------------------------------------- */
activateVehicleModule(itemId) {
let mod = this.items.get(itemId)
if (mod) {
this.updateEmbeddedDocuments('Item', [{ _id: mod.id, 'system.activated': !mod.system.activated }])
}
}
}

View File

@ -11,6 +11,7 @@
import { PegasusActor } from "./pegasus-actor.js";
import { PegasusItemSheet } from "./pegasus-item-sheet.js";
import { PegasusActorSheet } from "./pegasus-actor-sheet.js";
import { PegasusVehicleSheet } from "./pegasus-vehicle-sheet.js";
import { PegasusNPCSheet } from "./pegasus-npc-sheet.js";
import { PegasusUtility } from "./pegasus-utility.js";
import { PegasusCombat } from "./pegasus-combat.js";
@ -62,8 +63,8 @@ Hooks.once("init", async function () {
/* -------------------------------------------- */
// Register sheet application classes
Actors.unregisterSheet("core", ActorSheet);
Actors.registerSheet("fvtt-pegasus", PegasusActorSheet, { types: ["character"], makeDefault: true });
//Actors.registerSheet("fvtt-pegasus", PegasusVehicleSheet, { types: ["vehicle"], makeDefault: false });
Actors.registerSheet("fvtt-pegasus", PegasusActorSheet, { types: ["character"], makeDefault: true })
Actors.registerSheet("fvtt-pegasus", PegasusVehicleSheet, { types: ["vehicle"], makeDefault: false })
Items.unregisterSheet("core", ItemSheet);
Items.registerSheet("fvtt-pegasus", PegasusItemSheet, { makeDefault: true });

View File

@ -118,6 +118,36 @@ 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)
}
/* -------------------------------------------- */
manageVehicleShield( shieldIdx, toggled) {
let shield = this.rollData.vehicleShieldList[shieldIdx]
if (shield) {
this.rollData.shield = duplicate(shield)
if (toggled) {
this.rollData.shieldName = shield.name
} else {
this.rollData.shieldName = undefined
}
shield.applied = toggled
}
PegasusUtility.updateArmorDicePool(this.rollData)
}
/* -------------------------------------------- */
manageEquip(equipIdx, toggled) {
let equip = this.rollData.equipmentsList[equipIdx]
@ -216,6 +246,19 @@ 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('.vehicle-shield-clicked').change((event) => {
let toggled = event.currentTarget.checked
let shieldIdx = $(event.currentTarget).data("vehicle-shield-idx")
this.manageVehicleShield(shieldIdx, toggled)
this.refreshDialog()
})
html.find('.pool-add-dice').click(async (event) => {
let diceKey = $(event.currentTarget).data("dice-key")

View File

@ -105,20 +105,29 @@ export class PegasusUtility {
{ key: "d12", level: 5, img: "systems/fvtt-pegasus-rpg/images/dice/d12.webp" }]
}
/* -------------------------------------------- */
static buildDicePool(name, level, mod = 0, effectName = undefined) {
let dicePool = []
let diceKey = PegasusUtility.getDiceFromLevel(level)
let diceList = diceKey.split(" ")
for (let myDice of diceList) {
myDice = myDice.trim()
let newDice = {
name: name, key: myDice, level: PegasusUtility.getLevelFromDice(myDice), mod: mod, effect: effectName,
img: `systems/fvtt-pegasus-rpg/images/dice/${myDice}.webp`
}
dicePool.push(newDice)
mod = 0 // Only first dice has modifier
}
return dicePool
}
/* -------------------------------------------- */
static updateEffectsBonusDice(rollData) {
let newDicePool = rollData.dicePool.filter(dice => dice.name != "effect-bonus-dice")
for (let effect of rollData.effectsList) {
if (effect && effect.applied && effect.type == "effect" && effect.effect.system.bonusdice) {
let diceKey = PegasusUtility.getDiceFromLevel(effect.effect.system.effectlevel)
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,
img: `systems/fvtt-pegasus-rpg/images/dice/${myDice}.webp`
}
newDicePool.push(newDice)
}
newDicePool = newDicePool.concat( this.buildDicePool("effect-bonus-dice", effect.effect.system.effectlevel, 0, effect.effect.name ))
}
}
rollData.dicePool = newDicePool
@ -129,15 +138,7 @@ export class PegasusUtility {
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)
let diceList = diceKey.split(" ")
for (let myDice of diceList) {
let newDice = {
name: "effect-hindrance", key: myDice, level: hindrance.value, effect: hindrance.name,
img: `systems/fvtt-pegasus-rpg/images/dice/${myDice}.webp`
}
newDicePool.push(newDice)
}
newDicePool = newDicePool.concat( this.buildDicePool("effect-hindrance", (hindrance.value) ? hindrance.value : hindrance.effect.system.effectlevel, 0, hindrance.name ))
}
}
rollData.dicePool = newDicePool
@ -148,15 +149,13 @@ export class PegasusUtility {
let newDicePool = rollData.dicePool.filter(dice => dice.name != "armor-shield")
for (let armor of rollData.armorsList) {
if (armor.applied) {
let diceKey = PegasusUtility.getDiceFromLevel(armor.value)
let diceList = diceKey.split(" ")
for (let myDice of diceList) {
let newDice = {
name: "armor-shield", key: myDice, level: armor.value,
img: `systems/fvtt-pegasus-rpg/images/dice/${myDice}.webp`
newDicePool = newDicePool.concat( this.buildDicePool("armor-shield", armor.value, 0))
}
newDicePool.push(newDice)
}
newDicePool = rollData.dicePool.filter(dice => dice.name != "vehicle-shield")
for (let shield of rollData.vehicleShieldList) {
if (shield.applied) {
newDicePool = newDicePool.concat( this.buildDicePool("vehicle-shield", shield.value, 0))
}
}
rollData.dicePool = newDicePool
@ -169,15 +168,13 @@ export class PegasusUtility {
let newDicePool = rollData.dicePool.filter(dice => dice.name != "damage")
for (let weapon of rollData.weaponsList) {
if (weapon.applied && weapon.type == "damage") {
let diceKey = PegasusUtility.getDiceFromLevel(weapon.value)
let diceList = diceKey.split(" ")
for (let myDice of diceList) {
let newDice = {
name: "damage", key: myDice, level: weapon.value,
img: `systems/fvtt-pegasus-rpg/images/dice/${myDice}.webp`
newDicePool = newDicePool.concat( this.buildDicePool("damage", weapon.value, 0))
}
newDicePool.push(newDice)
}
for (let weapon of rollData.vehicleWeapons) {
if (weapon.applied) {
newDicePool = newDicePool.concat( this.buildDicePool("damage", weapon.value, 0))
}
}
rollData.dicePool = newDicePool
@ -189,36 +186,23 @@ export class PegasusUtility {
let newDicePool = rollData.dicePool.filter(dice => dice.name != "stat")
let statDice = rollData.dicePool.find(dice => dice.name == "stat")
if (statDice.level > 0) {
let diceKey = PegasusUtility.getDiceFromLevel(rollData.statDicesLevel)
let diceList = diceKey.split(" ")
let mod = statDice.mod
for (let myDice of diceList) {
myDice = myDice.trim()
let newDice = {
name: "stat", key: myDice, level: PegasusUtility.getLevelFromDice(myDice), mod: mod,
img: `systems/fvtt-pegasus-rpg/images/dice/${myDice}.webp`
}
mod = 0 // Only first dice has modifier
newDicePool.push(newDice)
newDicePool = newDicePool.concat( this.buildDicePool( "stat", rollData.statDicesLevel, statDice.mod))
}
if (rollData.vehicleStat) {
newDicePool = rollData.dicePool.filter(dice => dice.name != "vehiclestat")
if (rollData.vehicleStat.currentlevel > 0 ) {
newDicePool = newDicePool.concat( this.buildDicePool( "vehiclestat", rollData.vehicleStat.currentlevel, 0))
}
rollData.dicePool = newDicePool
}
}
/* -------------------------------------------- */
static updateSpecDicePool(rollData) {
let newDicePool = rollData.dicePool.filter(dice => dice.name != "spec")
if (rollData.specDicesLevel > 0) {
let diceKey = PegasusUtility.getDiceFromLevel(rollData.specDicesLevel)
let diceList = diceKey.split(" ")
for (let myDice of diceList) {
myDice = myDice.trim()
let newDice = {
name: "spec", key: myDice, level: PegasusUtility.getLevelFromDice(myDice),
img: `systems/fvtt-pegasus-rpg/images/dice/${myDice}.webp`
}
newDicePool.push(newDice)
}
newDicePool = newDicePool.concat( this.buildDicePool( "spec", rollData.specDicesLevel, 0))
}
rollData.dicePool = newDicePool
}
@ -302,14 +286,16 @@ export class PegasusUtility {
/* -------------------------------------------- */
static async loadCompendiumData(compendium) {
const pack = game.packs.get(compendium);
return await pack?.getDocuments() ?? [];
const pack = game.packs.get(compendium)
console.log("PACK", pack, compendium)
return await pack?.getDocuments() ?? []
}
/* -------------------------------------------- */
static async loadCompendium(compendium, filter = item => true) {
let compendiumData = await PegasusUtility.loadCompendiumData(compendium);
return compendiumData.filter(filter);
let compendiumData = await PegasusUtility.loadCompendiumData(compendium)
//console.log("Comp data", compendiumData)
return compendiumData.filter(filter)
}
/* -------------------------------------------- */
@ -397,7 +383,7 @@ export class PegasusUtility {
this.rollPegasus(rollData)
character.modifyHeroLevelRemaining(-1)
} else {
ui.notifications.warn(`No more Hero Level for ${actor.name} ! Unable to reroll.`)
ui.notifications.warn(`No more Hero Level for ${character.name} ! Unable to reroll.`)
}
}
}
@ -447,6 +433,8 @@ export class PegasusUtility {
'systems/fvtt-pegasus-rpg/templates/partial-equipment-effects.html',
'systems/fvtt-pegasus-rpg/templates/partial-actor-stat-block.html',
'systems/fvtt-pegasus-rpg/templates/partial-actor-status.html',
'systems/fvtt-pegasus-rpg/templates/partial-vehicle-stat-block.html',
'systems/fvtt-pegasus-rpg/templates/partial-vehicle-arc.html',
'systems/fvtt-pegasus-rpg/templates/partial-item-nav.html',
'systems/fvtt-pegasus-rpg/templates/partial-item-description.html',
'systems/fvtt-pegasus-rpg/templates/partial-actor-equipment.html',
@ -460,7 +448,7 @@ export class PegasusUtility {
effectName = effectName.toLowerCase()
let effect = game.items.contents.find(item => item.type == 'effect' && item.name.toLowerCase() == effectName)
if (!effect) {
let effects = await this.loadCompendium('fvtt-pegasus.effect', item => item.name.toLowerCase() == effectName)
let effects = await this.loadCompendium('fvtt-pegasus-rpg.effects', item => item.name.toLowerCase() == effectName)
let objs = effects.map(i => i.toObject())
effect = objs[0]
} else {
@ -660,19 +648,6 @@ export class PegasusUtility {
return chatData;
}
/* -------------------------------------------- */
static async loadCompendiumData(compendium) {
const pack = game.packs.get(compendium);
return await pack?.getDocuments() ?? [];
}
/* -------------------------------------------- */
static async loadCompendium(compendium, filter = item => true) {
let compendiumData = await this.loadCompendiumData(compendium);
//console.log("Compendium", compendiumData);
return compendiumData.filter(filter);
}
/* -------------------------------------------- */
static async showDiceSoNice(roll, rollMode) {
if (game.modules.get("dice-so-nice")?.active) {
@ -776,7 +751,6 @@ export class PegasusUtility {
/* -------------------------------------------- */
static async rollPegasus(rollData) {
let actor = game.actors.get(rollData.actorId)
let diceFormulaTab = []
@ -824,6 +798,8 @@ export class PegasusUtility {
// And save the roll
this.saveRollData(rollData)
actor.lastRoll = rollData
console.log("Rolldata performed ", rollData, diceFormula)
}
/* -------------------------------------------- */
@ -914,7 +890,11 @@ export class PegasusUtility {
static async searchItem(dataItem) {
let item
if (dataItem.pack) {
item = await fromUuid("Compendium." + dataItem.pack + "." + dataItem.id)
let id = dataItem.id || dataItem._id
let items = await this.loadCompendium( dataItem.pack, item => item.id == id)
//console.log(">>>>>> PACK", items)
item = items[0] || undefined
//item = await fromUuid(dataItem.pack + "." + id)
} else {
item = game.items.get(dataItem.id)
}
@ -977,7 +957,9 @@ export class PegasusUtility {
effectsList: [],
armorsList: [],
weaponsList: [],
vehicleWeapons: [],
equipmentsList: [],
vehicleShieldList: [],
optionsDiceList: PegasusUtility.getOptionsDiceList()
}
if (!isInit) { // For init, do not display target hindrances

View File

@ -0,0 +1,328 @@
/**
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
import { PegasusUtility } from "./pegasus-utility.js"
import { PegasusRollDialog } from "./pegasus-roll-dialog.js"
/* -------------------------------------------- */
export class PegasusVehicleSheet extends ActorSheet {
/** @override */
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["fvtt-pegasus-rpg", "sheet", "actor"],
template: "systems/fvtt-pegasus-rpg/templates/vehicle-sheet.html",
width: 960,
height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "combat" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editScore: true
});
}
/* -------------------------------------------- */
async getData() {
const objectData = this.object
let actorData = duplicate(this.object)
let formData = {
title: this.title,
id: objectData.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
data: actorData.system,
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
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()),
effects: duplicate(this.actor.getEffects()),
combatModules: duplicate(this.actor.getCombatModules()),
powerCoreModules: duplicate(this.actor.getPowercoreModules()),
vehicleHull: duplicate(this.actor.getVehicleHull()),
mobilityModules: duplicate(this.actor.getMobilityModules()),
propulsionModules: duplicate(this.actor.getPropulsionModules()),
vehicleModules: duplicate(this.actor.getVehicleModules()),
vehicleWeaponModules: duplicate(this.actor.getVehicleWeaponModules()),
options: this.options,
owner: this.document.isOwner,
editScore: this.options.editScore,
isGM: game.user.isGM
}
this.formData = formData;
console.log("VEHICLE : ", formData, this.object);
return formData;
}
/* -------------------------------------------- */
async openGenericRoll() {
let rollData = PegasusUtility.initGenericRoll()
rollData.traumaState = this.actor.getTraumaState()
let rollDialog = await PegasusRollDialog.create( this.actor, rollData);
rollDialog.render( true );
}
/* -------------------------------------------- */
async rollIDR( itemId, diceValue) {
let item = this.actor.items.get( itemId) ?? {name: "Unknown"}
let myRoll = new Roll(diceValue+"x").roll({ async: false })
await PegasusUtility.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
let chatData = {
user: game.user.id,
rollMode: game.settings.get("core", "rollMode"),
whisper: [game.user.id].concat(ChatMessage.getWhisperRecipients('GM')),
content: `${this.actor.name} has roll IDR for ${item.name} : ${myRoll.total}`
}
ChatMessage.create(chatData)
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
html.bind("keydown", function(e) { // Ignore Enter in actores sheet
if (e.keyCode === 13) return false;
});
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
const item = this.actor.items.get( itemId );
item.sheet.render(true);
});
// Delete Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item")
PegasusUtility.confirmDelete(this, li)
})
html.find('.item-add').click(ev => {
let dataType = $(ev.currentTarget).data("type")
this.actor.createEmbeddedDocuments('Item', [{ name: "NewItem", type: dataType }], { renderSheet: true })
})
html.find('.current-speed-change').click(ev => {
let speed = ev.currentTarget.value
this.actor.manageCurrentSpeed(speed)
})
html.find('.vehicle-module-activate').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
this.actor.activateVehicleModule( itemId)
});
html.find('.vehicle-weapon-activate').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
this.actor.activateVehicleModule( itemId)
});
html.find('.equip-activate').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
this.actor.equipActivate( itemId)
});
html.find('.equip-deactivate').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
this.actor.equipDeactivate( itemId)
});
html.find('.effect-used').click(ev => {
const li = $(ev.currentTarget).parents(".item");
let itemId = li.data("item-id");
this.actor.perkEffectUsed( itemId)
});
html.find('.member-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let actorId = li.data("actor-id")
this.actor.delCrew(actorId)
});
html.find('.quantity-minus').click(event => {
const li = $(event.currentTarget).parents(".item");
this.actor.incDecQuantity( li.data("item-id"), -1 );
} )
html.find('.quantity-plus').click(event => {
const li = $(event.currentTarget).parents(".item");
this.actor.incDecQuantity( li.data("item-id"), +1 );
} )
html.find('.vehicle-current-nrg-minus').click(event => {
this.actor.incDecNRG( -1 );
} )
html.find('.vehicle-current-nrg-plus').click(event => {
this.actor.incDecNRG( 1 );
} )
html.find('.ammo-minus').click(event => {
const li = $(event.currentTarget).parents(".item")
this.actor.incDecAmmo( li.data("item-id"), -1 );
} );
html.find('.ammo-plus').click(event => {
const li = $(event.currentTarget).parents(".item")
this.actor.incDecAmmo( li.data("item-id"), +1 )
} );
html.find('.vehicle-stun-minus').click(event => {
this.actor.modifyVehicleStun( -1 )
} )
html.find('.vehicle-stun-plus').click(event => {
this.actor.modifyVehicleStun( 1 )
} )
html.find('.momentum-minus').click(event => {
this.actor.modifyMomentum( -1 )
} )
html.find('.momentum-plus').click(event => {
this.actor.modifyMomentum( 1 )
} )
html.find('.unarmed-attack').click((event) => {
this.actor.rollUnarmedAttack();
});
html.find('.generic-pool-roll').click((event) => {
this.openGenericRoll()
} );
html.find('.attack-melee').click((event) => {
this.actor.rollPoolFromVehicle( 'com', false, "melee-atk")
});
html.find('.damage-melee').click((event) => {
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.rollPoolFromVehicle( 'per', false, "ranged-dmg");
});
html.find('.defense-roll').click((event) => {
this.actor.rollPoolFromVehicle( 'def', true, "defence");
});
html.find('.damage-resistance').click((event) => {
this.actor.rollVehicleDamageResistance( );
});
html.find('.roll-stat').click((event) => {
const statId = $(event.currentTarget).data("stat-key");
this.actor.rollStat(statId);
});
html.find('.roll-mr').click((event) => {
this.actor.rollMR();
});
html.find('.roll-idr').click((event) => {
const diceValue = $(event.currentTarget).data("dice-value")
const li = $(event.currentTarget).parents(".item")
this.rollIDR( li.data("item-id"), diceValue)
})
html.find('.weapon-roll').click((event) => {
const li = $(event.currentTarget).parents(".item");
const weaponId = li.data("item-id");
this.actor.rollWeapon(weaponId);
});
html.find('.armor-roll').click((event) => {
const li = $(event.currentTarget).parents(".item");
const armorId = li.data("item-id");
this.actor.rollArmor(armorId);
});
html.find('.weapon-damage-roll').click((event) => {
const li = $(event.currentTarget).parents(".item");
const weaponId = li.data("item-id");
this.actor.rollWeapon(weaponId, true);
});
html.find('.weapon-damage').click((event) => {
const li = $(event.currentTarget).parents(".item");
const weapon = this.actor.getOwnedItem(li.data("item-id"));
this.actor.rollDamage(weapon, 'damage');
});
html.find('.lock-unlock-sheet').click((event) => {
this.options.editScore = !this.options.editScore;
this.render(true);
});
html.find('.item-link a').click((event) => {
const itemId = $(event.currentTarget).data("item-id");
const item = this.actor.getOwnedItem(itemId);
item.sheet.render(true);
});
html.find('.item-equip').click(ev => {
const li = $(ev.currentTarget).parents(".item");
this.actor.equipItem( li.data("item-id") );
this.render(true);
});
html.find('.update-field').change(ev => {
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)
})
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
return position;
}
/* -------------------------------------------- */
async _onDropItem(event, dragData) {
const item = fromUuidSync(dragData.uuid)
if (item == undefined) {
item = this.actor.items.get( dragData.uuid )
}
let ret = await this.actor.preprocessItemVehicle( event, item, true )
if ( ret ) {
super._onDropItem(event, dragData)
}
}
/* -------------------------------------------- */
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) {
// Update the Actor
return this.object.update(formData)
}
}

View File

@ -1235,8 +1235,7 @@ ul, li {
/*************************************************************/
#pause
{
font-size: 2rem;
{ font-size: 2rem;
}
#pause > h3
{
@ -1285,6 +1284,8 @@ Focus FOC: #ff0084
background-color: black;
background: black;
}
.color-class-fc,
.color-class-man,
.color-class-agi,
.color-class-ranged-attack {
background-color: #02a41d;
@ -1303,10 +1304,12 @@ Focus FOC: #ff0084
.color-class-meleedmg {
background-color: #5f3d00;
}
.color-class-hr,
.color-class-phy,
.color-class-dmgres {
background-color: #990304;
}
.color-class-ad,
.color-class-mr {
background-color: #050505;
}
@ -1325,6 +1328,7 @@ Focus FOC: #ff0084
.color-class-ranged-damage {
background-color: #f9c801;
}
.color-class-pc,
.color-class-foc {
background-color: #ff0084;
}
@ -1376,6 +1380,10 @@ Focus FOC: #ff0084
max-height: 42px;
min-height: 36px;
}
.item-stat-roll-vehicle {
max-height: 102px;
min-height: 102px;
}
.item-stat-roll select, .item-stat-roll input {
margin-top: 4px;
margin-right: 2px;

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.0.zip",
"esmodules": [
"modules/pegasus-main.js"
],
@ -10,7 +9,8 @@
{
"lang": "en",
"name": "English",
"path": "lang/en.json"
"path": "lang/en.json",
"flags": {}
}
],
"authors": [
@ -19,14 +19,11 @@
"flags": {}
}
],
"library": false,
"license": "LICENSE.txt",
"manifest": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/raw/branch/master/system.json",
"manifestPlusVersion": "1.0.0",
"media": [],
"compatibility": {
"minimum": "10",
"verified": "10.284",
"verified": "10.285",
"maximum": "10"
},
"id": "fvtt-pegasus-rpg",
@ -35,241 +32,217 @@
"type": "Item",
"label": "Specialisations",
"name": "specialisations",
"path": "./packs/specialisations.db",
"path": "packs/specialisations.db",
"system": "fvtt-pegasus-rpg",
"tags": [
"specialisation"
]
"private": false,
"flags": {}
},
{
"type": "Item",
"label": "Racial Abilities",
"name": "racial-abilities",
"path": "./packs/racial-abilities.db",
"path": "packs/racial-abilities.db",
"system": "fvtt-pegasus-rpg",
"tags": [
"ability"
]
"private": false,
"flags": {}
},
{
"type": "Item",
"label": "Perks",
"name": "perk",
"path": "./packs/perk.db",
"path": "packs/perk.db",
"system": "fvtt-pegasus-rpg",
"tags": [
"perk"
]
"private": false,
"flags": {}
},
{
"type": "Item",
"label": "Powers",
"name": "powers",
"path": "./packs/powers.db",
"path": "packs/powers.db",
"system": "fvtt-pegasus-rpg",
"tags": [
"power"
]
"private": false,
"flags": {}
},
{
"type": "Item",
"label": "Race",
"name": "race",
"path": "./packs/race.db",
"path": "packs/race.db",
"system": "fvtt-pegasus-rpg",
"tags": [
"race"
]
"private": false,
"flags": {}
},
{
"type": "Item",
"label": "Role",
"name": "role",
"path": "./packs/role.db",
"path": "packs/role.db",
"system": "fvtt-pegasus-rpg",
"tags": [
"role"
]
"private": false,
"flags": {}
},
{
"type": "Item",
"label": "Effects",
"name": "effects",
"path": "./packs/effects.db",
"path": "packs/effects.db",
"system": "fvtt-pegasus-rpg",
"tags": [
"effect"
]
"private": false,
"flags": {}
},
{
"type": "Item",
"label": "Armour",
"name": "armour",
"path": "./packs/armour.db",
"path": "packs/armour.db",
"system": "fvtt-pegasus-rpg",
"tags": [
"armour"
]
"private": false,
"flags": {}
},
{
"type": "Item",
"label": "Equipment",
"name": "equipment",
"path": "./packs/equipment.db",
"path": "packs/equipment.db",
"system": "fvtt-pegasus-rpg",
"tags": [
"equipment"
]
"private": false,
"flags": {}
},
{
"type": "Item",
"label": "Shields",
"name": "shields",
"path": "./packs/shields.db",
"path": "packs/shields.db",
"system": "fvtt-pegasus-rpg",
"tags": [
"shield"
]
"private": false,
"flags": {}
},
{
"type": "Item",
"label": "Melee Weapons",
"name": "melee-weapons",
"path": "./packs/melee-weapons.db",
"path": "packs/melee-weapons.db",
"system": "fvtt-pegasus-rpg",
"tags": [
"weapon", "melee"
]
"private": false,
"flags": {}
},
{
"type": "Item",
"label": "Ranged Weapons",
"name": "ranged-weapons",
"path": "./packs/ranged-weapons.db",
"path": "packs/ranged-weapons.db",
"system": "fvtt-pegasus-rpg",
"tags": [
"weapon", "ranged"
]
"private": false,
"flags": {}
},
{
"type": "Item",
"label": "Currency",
"name": "currency",
"path": "./packs/currency.db",
"path": "packs/currency.db",
"system": "fvtt-pegasus-rpg",
"tags": [
"currency", "money"
]
"private": false,
"flags": {}
},
{
"type": "Item",
"label": "Macros",
"name": "macro-commands",
"path": "./packs/macro-commands.db",
"path": "packs/macro-commands.db",
"system": "fvtt-pegasus-rpg",
"tags": [
"macro", "command"
]
"private": false,
"flags": {}
},
{
"type": "Item",
"label": "Vehicle - Weapon modules",
"name": "vm-vehicle-weapons-modules",
"path": "./packs/vm-vehicle-weapons-modules.db",
"path": "packs/vm-vehicle-weapons-modules.db",
"system": "fvtt-pegasus-rpg",
"tags": [
"weapon", "vehicle"
]
"private": false,
"flags": {}
},
{
"type": "Item",
"label": "Vehicle - Propulsion modules",
"name": "vm-vehicle-propulsion-modules",
"path": "./packs/vm-vehicle-propulsion-modules.db",
"path": "packs/vm-vehicle-propulsion-modules.db",
"system": "fvtt-pegasus-rpg",
"tags": [
"propulsion", "vehicle"
]
"private": false,
"flags": {}
},
{
"type": "Item",
"label": "Vehicle - Power core modules",
"name": "vm-vehicle-power-core-module",
"path": "./packs/vm-vehicle-power-core-module.db",
"path": "packs/vm-vehicle-power-core-module.db",
"system": "fvtt-pegasus-rpg",
"tags": [
"propulsion", "vehicle"
]
"private": false,
"flags": {}
},
{
"type": "Item",
"label": "Vehicle - Modules",
"name": "vm-vehicle-modules",
"path": "./packs/vm-vehicle-modules.db",
"path": "packs/vm-vehicle-modules.db",
"system": "fvtt-pegasus-rpg",
"tags": [
"module", "vehicle"
]
"private": false,
"flags": {}
},
{
"type": "Item",
"label": "Vehicle - Mobility module",
"name": "vm-vehicle-mobility-module",
"path": "./packs/vm-vehicle-mobility-module.db",
"path": "packs/vm-vehicle-mobility-module.db",
"system": "fvtt-pegasus-rpg",
"tags": [
"mobility", "vehicle"
]
"private": false,
"flags": {}
},
{
"type": "Item",
"label": "Vehicle - Hull module",
"name": "vm-vehicle-hulls",
"path": "./packs/vm-vehicle-hulls.db",
"path": "packs/vm-vehicle-hulls.db",
"system": "fvtt-pegasus-rpg",
"tags": [
"hull", "vehicle"
]
"private": false,
"flags": {}
},
{
"type": "Item",
"label": "Vehicle - Combat module",
"name": "vm-vehicle-combat-module",
"path": "./packs/vm-vehicle-combat-module.db",
"path": "packs/vm-vehicle-combat-module.db",
"system": "fvtt-pegasus-rpg",
"tags": [
"combat", "vehicle"
]
"private": false,
"flags": {}
},
{
"type": "Item",
"label": "Vices",
"name": "vices",
"path": "./packs/vices.db",
"path": "packs/vices.db",
"system": "fvtt-pegasus-rpg",
"tags": [
"vice"
]
"private": false,
"flags": {}
},
{
"type": "Item",
"label": "Virtues",
"name": "virtues",
"path": "./packs/virtues.db",
"path": "packs/virtues.db",
"system": "fvtt-pegasus-rpg",
"tags": [
"virtue"
]
"private": false,
"flags": {}
},
{
"type": "Item",
"label": "ZZ-Admin-FX",
"name": "zz-adminfx-zz",
"path": "./packs/zz-adminfx-zz.db",
"path": "packs/zz-adminfx-zz.db",
"system": "fvtt-pegasus-rpg",
"tags": [
"fx"
]
"private": false,
"flags": {}
}
],
"primaryTokenAttribute": "secondary.health",
@ -278,9 +251,9 @@
"styles": [
"styles/simple.css"
],
"templateVersion": 109,
"title": "Pegasus RPG",
"url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg",
"version": "10.0.0",
"background" : "./images/ui/pegasus_welcome_page.webp"
"version": "10.0.14",
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v10.0.14.zip",
"background": "systems/fvtt-pegasus-rpg/images/ui/pegasus_welcome_page.webp"
}

View File

@ -10,6 +10,7 @@
"name": "",
"age": 0,
"size": "",
"sizenum": 0,
"weight": "",
"hair": "",
"sex": "",
@ -199,26 +200,31 @@
"description": ""
},
"vehicle": {
"crew": [],
"statistics": {
"fc": {
"label": "FC",
"abbrev": "fc",
"level": 0,
"currentlevel": 0
"currentlevel": 0,
"col": 1
},
"man": {
"label": "FC",
"abbrev": "fc",
"label": "MAN",
"abbrev": "man",
"dicevalue": "",
"level": 0,
"currentlevel": 0
"currentlevel": 0,
"turningarc45": 0,
"col": 1
},
"hr": {
"label": "HR",
"abbrev": "hr",
"level": 0,
"currentlevel": 0,
"size": 0
"size": 0,
"col": 2
},
"pc": {
"label": "PC",
@ -226,13 +232,16 @@
"level": 0,
"currentlevel": 0,
"avgnrg": 0,
"curnrg": 0
"curnrg": 0,
"maxnrg": 0,
"col": 2
},
"mr": {
"label": "MR",
"abbrev": "mr",
"level": 0,
"currentlevel": 0
"currentlevel": 0,
"col": 3
},
"ad": {
"label": "A/D",
@ -240,7 +249,8 @@
"level": 0,
"currentlevel": 0,
"accmode": "",
"currentspeed": ""
"currentspeed": "",
"col": 3
}
},
"stun": {
@ -257,7 +267,7 @@
"activatedmoduleenergy": 0,
"vdp": 0,
"vehiculevalue": 0,
"availablevms": 0,
"totalvms": 0,
"vmsused": 0,
"totalcost": 0
},
@ -275,34 +285,46 @@
},
"arcs": {
"frontarc": {
"label": "Fore Arc",
"topspeed": "",
"shieldlevel": 0,
"armourlevel": 0
"armourlevel": 0,
"is3D": false
},
"reararc": {
"label": "Rear Arc",
"topspeed": "",
"shieldlevel": 0,
"armourlevel": 0
"armourlevel": 0,
"is3D": false
},
"rightarc": {
"label": "Right Arc",
"topspeed": "",
"shieldlevel": 0,
"armourlevel": 0
"armourlevel": 0,
"is3D": false
},
"leftarc": {
"label": "Left Arc",
"topspeed": "",
"shieldlevel": 0,
"armourlevel": 0
"armourlevel": 0,
"is3D": false
},
"toparc": {
"label": "Top Arc",
"topspeed": "",
"shieldlevel": 0,
"armourlevel": 0
"armourlevel": 0,
"is3D": true
},
"bottomarc": {
"label": "Bottom Arc",
"topspeed": "",
"shieldlevel": 0,
"armourlevel": 0
"armourlevel": 0,
"is3D": true
}
}
}
@ -655,6 +677,7 @@
"range": "",
"idr": "",
"cost": 0,
"size": 0,
"space": 0
},
"vehicleweaponmodule": {
@ -666,12 +689,15 @@
"effects": [],
"damagedicevalue": "",
"damagetype": "",
"damagetypelevel": 0,
"aoe": "",
"range": "",
"turret": "",
"linkedweapon": "",
"idr": "",
"cost": 0
"cost": 0,
"extradamage": false,
"extradamagevalue": 0
}
}
}

View File

@ -839,17 +839,16 @@
<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" />
<label class="generic-label">Sex</label>
<input type="text" class="" name="system.biodata.sex" value="{{data.biodata.sex}}" 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" />
<label class="generic-label">Height/Weight</label>
<input type="text" class="" name="system.biodata.weight" value="{{data.biodata.weight}}" data-dtype="String" />
</li>
<li class="item flexrow">
<label class="generic-label">Eyes</label>
@ -864,13 +863,14 @@
<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" />
<label class="generic-label">Size</label>
<input type="text" class="" name="system.biodata.sizenum" value="{{data.biodata.sizenum}}"
data-dtype="Number" />
</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" />
<label class="generic-label">Origin</label>
<input type="text" class="" name="system.biodata.origin" value="{{data.biodata.origin}}"
data-dtype="String" />
</li>
<li class="flexrow item">
<label class="generic-label">Preferred Hand</label>
@ -986,6 +986,14 @@
<label class="attribute-value checkbox"><input type="checkbox" class="change-desires"
name="system.biodata.desiresactive" {{checked data.biodata.desiresactive}} /> Active ?</label>
</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>
</ul>
<h3>Catchphrase : </h3>
@ -1026,14 +1034,6 @@
<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}}>

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

@ -124,7 +124,7 @@
<input type="text" class="padd-right" name="system.deactivatedtext" value="{{data.deactivatedtext}}" data-dtype="String"/>
</li>
<li class="flexrow"><label class="generic-label">Power Level Cost</label>
<li class="flexrow"><label class="generic-label">PPP Used to Purchase</label>
<input type="text" class="input-numeric-short padd-right" name="system.powerlevelcost" value="{{data.powerlevelcost}}"
data-dtype="Number" />
</li>

View File

@ -29,7 +29,7 @@
<input type="text" class="" name="system.ad" value="{{data.ad}}" data-dtype="Number"/>
</li>
<li class="flexrow"><label class="generic-label">Top Speed (TS)</label>
<li class="flexrow"><label class="generic-label">Top Speed (TS) bonus</label>
<input type="text" class="" name="system.topspeed" value="{{data.topspeed}}" data-dtype="Number"/>
</li>

View File

@ -54,12 +54,12 @@
<ul>
<li class="flexrow"><label class="generic-label">Selectable Stats ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.selectablestats" {{checked
data.selectablestats}} /></label>
system.selectablestats}} /></label>
</li>
{{#if data.selectablestats}}
<li class="flexrow"><label class="generic-label">Select 1 stat only once?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.statsonlyonce" {{checked
data.statsonlyonce}} /></label>
system.statsonlyonce}} /></label>
</li>
<li class="flexrow"><label class="generic-label">Number of selectable stats</label>
<input type="text" class="input-numeric-short padd-right" name="system.numberstats" value="{{data.numberstats}}"

View File

@ -50,7 +50,7 @@
<label class="attribute-value checkbox"><input type="checkbox" name="system.activated" {{checked data.activated}}/></label>
</li>
<li class="flexrow"><label class="generic-label">NRG</label>
<li class="flexrow"><label class="generic-label">NRG Cost</label>
<input type="text" class="" name="system.nrg" value="{{data.nrg}}" data-dtype="Number"/>
</li>

View File

@ -67,6 +67,20 @@
</select>
</li>
<li class="flexrow"><label class="generic-label">Damage type level</label>
<input type="text" class="" name="system.damagetypelevel" value="{{data.damagetypelevel}}" data-dtype="Number"/>
</li>
<li class="flexrow"><label class="generic-label">Extra damage ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.extradamage" {{checked data.extradamage}}/></label>
</li>
{{#if data.extradamage}}
<li class="flexrow"><label class="generic-label">Extra damage value (D12)</label>
<input type="text" class="" name="system.extradamagevalue" value="{{data.extradamagevalue}}" data-dtype="Number"/>
</li>
{{/if}}
<li class="flexrow"><label class="generic-label">Optimal Range</label>
<select class="competence-base flexrow" type="text" name="system.range" value="{{data.range}}" data-dtype="String">
{{#select data.range}}

View File

@ -1,4 +1,4 @@
<option value="none">None</option>
<option value="fullstop">Full stop</option>
<option value="crawling">Crawling</option>
<option value="slow">Slow</option>
<option value="average">Average</option>

View File

@ -4,10 +4,10 @@
<ul>
{{#each effectsList as |effect idx|}}
{{#if effect.effect.data.hindrance}}
{{#if effect.effect.system.hindrance}}
<li class="flex-group-left">
<label class="attribute-value checkbox"><input type="checkbox" class="effect-clicked" id="effect-{{idx}}" data-effect-idx="{{idx}}" {{checked effect.applied}}/></label>
<label class="generic-label">Target Hindrance : {{effect.label}} ({{upperFirst effect.effect.data.type}}, {{upperFirst effect.effect.data.genre}}, {{effect.value}})</label>
<label class="generic-label">Target Hindrance : {{effect.label}} ({{upperFirst effect.effect.system.type}}, {{upperFirst effect.effect.system.genre}}, {{effect.value}})</label>
</li>
{{else}}
{{#if (eq type "hindrance")}}
@ -30,13 +30,13 @@
</li>
{{/if}}
{{#if (count effect.effect.data.specaffected)}}
{{#each effect.effect.data.specaffected as |spec idx2|}}
{{#if (count effect.effect.system.specaffected)}}
{{#each effect.effect.system.specaffected as |spec idx2|}}
{{#if (eq @root.specName spec.name)}}
<li class="flex-group-left">
<label class="attribute-value checkbox"><input type="checkbox" class="effect-clicked" id="effect-{{idx}}" data-effect-idx="{{idx}}" {{checked effect.applied}}/></label>
{{#if effect.effect}}
<label class="generic-label">{{effect.label}} ({{upperFirst effect.effect.data.type}}, {{upperFirst effect.effect.data.genre}}, {{effect.value}})</label>
<label class="generic-label">{{effect.label}} ({{upperFirst effect.effect.system.type}}, {{upperFirst effect.effect.system.genre}}, {{effect.value}})</label>
{{else}}
<label class="generic-label">{{effect.label}} ({{effect.value}})</label>
{{/if}}
@ -44,31 +44,31 @@
{{/if}}
{{/each}}
{{else}}
{{#if (eq @root.statKey effect.effect.data.stataffected)}}
{{#if (eq @root.statKey effect.effect.system.stataffected)}}
<li class="flex-group-left">
<label class="attribute-value checkbox"><input type="checkbox" class="effect-clicked" id="effect-{{idx}}" data-effect-idx="{{idx}}" {{checked effect.applied}}/></label>
{{#if effect.effect}}
<label class="generic-label">{{effect.label}} ({{upperFirst effect.effect.data.type}}, {{upperFirst effect.effect.data.genre}}, {{effect.value}})</label>
<label class="generic-label">{{effect.label}} ({{upperFirst effect.effect.system.type}}, {{upperFirst effect.effect.system.genre}}, {{effect.value}})</label>
{{else}}
<label class="generic-label">{{effect.label}} ({{effect.value}})</label>
{{/if}}
</li>
{{else}}
{{#if (eq @root.subKey effect.effect.data.stataffected)}}
{{#if (eq @root.subKey effect.effect.system.stataffected)}}
<li class="flex-group-left">
<label class="attribute-value checkbox"><input type="checkbox" class="effect-clicked" id="effect-{{idx}}" data-effect-idx="{{idx}}" {{checked effect.applied}}/></label>
{{#if effect.effect}}
<label class="generic-label">{{effect.label}} ({{upperFirst effect.effect.data.type}}, {{upperFirst effect.effect.data.genre}}, {{effect.value}})</label>
<label class="generic-label">{{effect.label}} ({{upperFirst effect.effect.system.type}}, {{upperFirst effect.effect.system.genre}}, {{effect.value}})</label>
{{else}}
<label class="generic-label">{{effect.label}} ({{effect.value}})</label>
{{/if}}
</li>
{{else}}
{{#if (eq effect.effect.data.stataffected "all")}}
{{#if (eq effect.effect.system.stataffected "all")}}
<li class="flex-group-left">
<label class="attribute-value checkbox"><input type="checkbox" class="effect-clicked" id="effect-{{idx}}" data-effect-idx="{{idx}}" {{checked effect.applied}}/></label>
{{#if effect.effect}}
<label class="generic-label">{{effect.label}} ({{upperFirst effect.effect.data.type}}, {{upperFirst effect.effect.data.genre}}, {{effect.value}})</label>
<label class="generic-label">{{effect.label}} ({{upperFirst effect.effect.system.type}}, {{upperFirst effect.effect.system.genre}}, {{effect.value}})</label>
{{else}}
<label class="generic-label">{{effect.label}} ({{effect.value}})</label>
{{/if}}
@ -125,3 +125,33 @@
</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}}
{{#if (notEmpty vehicleShieldList)}}
<label>Vehicle Shields</label>
<ul>
{{#each vehicleShieldList as |shield idx|}}
<li class="flex-group-left">
<label class="attribute-value checkbox"><input type="checkbox" class="vehicle-shield-clicked" id="vehicle-shield-{{idx}}" data-vehicle-shield-idx="{{idx}}" {{checked shield.applied}}/></label>
<label class="generic-label padd-right">{{shield.label}} ({{shield.value}})</label>
</li>
{{/each}}
</ul>
{{/if}}

View File

@ -0,0 +1,46 @@
<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">{{arc.label}}</label></h3>
</span>
<span class="item-field-label-long">
<label class="short-label">Top speed</label>
</span>
<span class="item-field-label-long">
<label class="short-label">Shield</label>
</span>
<span class="item-field-label-long">
<label class="short-label">Armour</label>
</span>
</li>
<li class="item flexrow list-item list-item-shadow" data-arc-name="{{idx}}">
<span class="item-name-img">&nbsp;</span>
<span class="item-name-label-long">&nbsp;</span>
<span class="item-field-label-long">
<select type="text" name="system.arcs.{{idx}}.topspeed" value="{{arc.topspeed}}" data-dtype="String" disabled>
{{#select arc.topspeed}}
{{> systems/fvtt-pegasus-rpg/templates/partial-options-vehicle-speed.html}}
{{/select}}
</select>
</span>
<span class="item-field-label-long">
<select type="text" name="system.arcs.{{idx}}.shieldlevel" value="{{arc.shieldlevel}}" data-dtype="Number">
{{#select arc.shieldlevel}}
{{{@root.optionsDiceList}}}
{{/select}}
</select>
</span>
<span class="item-field-label-long">
<select type="text" name="system.arcs.{{idx}}.armourlevel" value="{{arc.armourlevel}}" data-dtype="Number">
{{#select arc.armourlevel}}
{{{@root.optionsDiceList}}}
{{/select}}
</select>
</span>
</li>
</ul>

View File

@ -0,0 +1,82 @@
<li class="item flexrow list-item color-class-{{lower stat.abbrev}} item-stat-roll-vehicle" data-attr-key="{{key}}">
<div class="flexcol">
<div class="flexrow">
<span class="stat-icon">
<img class="stat-icon" src="systems/fvtt-pegasus-rpg/images/icons/icon_vehicle_{{stat.abbrev}}.webp">
</span>
<span class="stat-label stat-margin" name="{{key}}">
<h4 class="stat-text-white stat-margin"><a class="roll-stat stat-margin"
data-stat-key="{{key}}">{{upper stat.abbrev}}</a></h4>
</span>
<select class="status-small-label color-class-common" type="text" name="system.statistics.{{key}}.level"
value="{{stat.level}}" data-dtype="Number" disabled>
{{#select stat.level}}
{{{@root.optionsDiceList}}}
{{/select}}
</select>
</div>
<div class="flexrow stat-text-white">
<span class="stat-label stat-margin" name="{{key}}">Current level</span>
<select class="status-small-label color-class-common" type="text" name="system.statistics.{{key}}.currentlevel"
value="{{stat.currentlevel}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
{{#select stat.currentlevel}}
{{{@root.optionsDiceList}}}
{{/select}}
</select>
</div>
{{#if (eq key "man")}}
<div class="flexrow stat-text-white">
<span class="stat-label stat-margin" name="{{key}}">45° Turning Arcs</span>
<select class="status-small-label color-class-common" type="text" name="system.statistics.{{key}}.turningarc45"
value="{{stat.turningarc45}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
{{#select stat.turningarc45}}
{{{@root.optionsDiceList}}}
{{/select}}
</select>
</div>
{{/if}}
{{#if (eq key "hr")}}
<div class="flexrow stat-text-white">
<span class="stat-label stat-margin" name="{{key}}">Size</span>
<input type="text" class="input-numeric-short" name="system.statistics.{{key}}.size" value="{{stat.size}}" data-dtype="Number" />
</div>
{{/if}}
{{#if (eq key "pc")}}
<div class="flexrow stat-text-white">
<span class="stat-label stat-margin" name="{{key}}">Cur NRG</span>
<input type="text" class="input-numeric-short" name="system.statistics.{{key}}.curnrg" value="{{stat.curnrg}}" data-dtype="Number" />
<span class="padd-right status-small-label no-grow">
<a class="vehicle-current-nrg-plus plus-minus-button">+</a>
<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" 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" disabled />
</div>
{{/if}}
{{#if (eq key "ad")}}
<div class="flexrow stat-text-white">
<span class="stat-label stat-margin" name="{{key}}">Acc Mode</span>
<select class="status-small-label color-class-common" type="text" name="system.statistics.{{key}}.accmode"
value="{{stat.accmode}}" data-dtype="String" {{#unless @root.editScore}}disabled{{/unless}}>
{{#select stat.accmode}}
<option value="acc">ACC</option>
<option value="dec">DEC</option>
{{/select}}
</select>
<span class="stat-label stat-margin" name="{{key}}">Curr. speed</span>
<select class="status-small-label color-class-common current-speed-change" type="text" name="system.statistics.{{key}}.currentspeed"
value="{{stat.currentspeed}}" data-dtype="String" {{#unless @root.editScore}}disabled{{/unless}}>
{{#select stat.currentspeed}}
{{> systems/fvtt-pegasus-rpg/templates/partial-options-vehicle-speed.html}}
{{/select}}
</select>
</div>
{{/if}}
</div>
</li>

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">{{upper stat.label}} :</span>
<select class="roll-dialog-label" id="statDicesLevel" type="text" name="statDicesLevel"
value="{{statDicesLevel}}" data-dtype="Number" {{#if statKey}}disabled{{/if}}>
{{#select statDicesLevel}}
@ -24,6 +24,19 @@
<span class="small-label">&nbsp;+&nbsp;{{statMod}}</span>
</div>
{{#if statVehicle}}
<div class="flexrow">
<span class="roll-dialog-label">{{upper statVehicle.label}} :</span>
<select class="roll-dialog-label" id="statVehicleLevel" type="text" name="statVehicleLevel"
value="{{statVehicle.currentlevel}}" data-dtype="Number" {{#if statKey}}disabled{{/if}}>
{{#select statVehicle.currentlevel}}
{{{optionsDiceList}}}
{{/select}}
</select>
<span class="small-label">&nbsp;</span>
</div>
{{/if}}
{{#if specList}}
<div class="flexrow">
<span class="roll-dialog-label">Spec : </span>

View File

@ -0,0 +1,904 @@
<form class="{{cssClass}}" autocomplete="off">
{{!-- Sheet Header --}}
<header class="sheet-header">
<div class="header-fields">
<h1 class="charname margin-right"><input name="name" type="text" value="{{name}}" placeholder="Name" /></h1>
<div class="flexrow">
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}" />
<div class="flexcol">
<div class="flexrow">
<div class="stat-item">
<ul>
{{#each data.statistics as |stat key|}}
{{#if (eq stat.col 1)}}
{{> systems/fvtt-pegasus-rpg/templates/partial-vehicle-stat-block.html stat=stat key=key}}
{{/if}}
{{/each}}
</ul>
</div>
<div class="stat-item">
<ul>
{{#each data.statistics as |stat key|}}
{{#if (eq stat.col 2)}}
{{> systems/fvtt-pegasus-rpg/templates/partial-vehicle-stat-block.html stat=stat key=key}}
{{/if}}
{{/each}}
</ul>
</div>
<div class="stat-item">
<ul>
{{#each data.statistics as |stat key|}}
{{#if (eq stat.col 3)}}
{{> systems/fvtt-pegasus-rpg/templates/partial-vehicle-stat-block.html stat=stat key=key}}
{{/if}}
{{/each}}
</ul>
</div>
</div>
</div>
</div>
</div>
</header>
{{!-- Sheet Tab Navigation --}}
<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>
{{!-- Sheet Body --}}
<section class="sheet-body">
{{!-- Combat Tab --}}
<div class="tab fight" data-group="primary" data-tab="combat">
<div class="flexcol">
<div class="flexrow">
<div class="stat-item">
<ul class="stat-list alternate-list">
<li class="item flexrow list-item color-class-melee"><a class="combat-button attack-melee flexrow">
<span class="combat-icon flexrow">
<img class="combat-icon" src="systems/fvtt-pegasus-rpg/images/icons/COM.webp">
</span>
<span class="generic-label combat-margin stat-text-white">Melee Attack</span>
</a>
</li>
<li class="item flexrow list-item color-class-meleedmg"><a class="combat-button damage-melee flexrow">
<span class="combat-icon flexrow">
<img class="combat-icon" src="systems/fvtt-pegasus-rpg/images/icons/STR.webp">
</span>
<span class="generic-label combat-margin stat-text-white">Melee/Thrown Damage</span>
</a>
</li>
</ul>
</div>
<div class="stat-item">
<ul class="stat-list alternate-list">
<li class="item flexrow list-item color-class-ranged-attack"><a class="combat-button attack-ranged flexrow">
<span class="combat-icon flexrow">
<img class="combat-icon" src="systems/fvtt-pegasus-rpg/images/icons/AGI.webp">
</span>
<span class="generic-label combat-margin stat-text-white">Ranged Attack</span>
</a>
</li>
<li class="item flexrow list-item color-class-ranged-damage"><a class="combat-button damage-ranged flexrow">
<span class="combat-icon flexrow">
<img class="combat-icon" src="systems/fvtt-pegasus-rpg/images/icons/PER.webp">
</span>
<span class="generic-label combat-margin stat-text-white">Ranged Damage</span>
</a>
</li>
</ul>
</div>
<div class="stat-item">
<ul class="stat-list alternate-list">
<li class="item flexrow list-item color-class-defence"><a class="combat-button defense-roll flexrow">
<span class="combat-icon flexrow">
<img class="combat-icon" src="systems/fvtt-pegasus-rpg/images/icons/DEF.webp">
</span>
<span class="generic-label combat-margin stat-text-white">Defence</span>
</a>
</li>
<li class="item flexrow list-item color-class-dmgres"><a class="combat-button damage-resistance flexrow">
<span class="combat-icon flexrow">
<img class="combat-icon" src="systems/fvtt-pegasus-rpg/images/icons/PHY.webp">
</span>
<span class="generic-label combat-margin stat-text-white">Damage Resistance</span>
</a>
</li>
</ul>
</div>
<div class="stat-item">
<span class="flexrow">
<h3>Stun</h3>
<span class="status-small-label no-grow">
<a class="vehicle-stun-plus plus-minus-button">+</a>
<a class="vehicle-stun-minus plus-minus-button">&nbsp;-</a>
</span>
</span>
<ul class="stat-list alternate-list">
<li class="item stat flexrow list-item">
<span class="generic-label small-label">Current</span>
<input type="text" class="" name="system.combat.stunlevel" value="{{data.combat.stunlevel}}"
data-dtype="Number" />
<span class="generic-label small-label">Threshold</span>
<input type="text" class="" name="system.combat.stunthreshold" value="{{data.combat.stunthreshold}}"
data-dtype="Number" />
</li>
</ul>
</div>
</div>
<div class="flexrow">
<span class="item-name-label-header-long">
<label class="items-title-text">Direction of travel</label>
<select type="text" name="system.secondary.traveldirection" value="{{data.secondary.traveldirection}}" data-dtype="String">
{{#select data.secondary.traveldirection}}
{{#each data.arcs as |arc idx|}}
<option value="{{idx}}">{{arc.label}}</option>
{{/each}}
{{/select}}
</select>
</span>
<span class="item-name-label-header-long">
<label class="items-title-text">Move range</label>
<select type="text" name="system.secondary.moverange" value="{{data.secondary.moverange}}" data-dtype="String">
{{#select data.secondary.moverange}}
<option value="nomovement">No Movement</option>
<option value="threatzone">Threat zone</option>
<option value="close">Close</option>
<option value="medium">Medium</option>
<option value="long">Long</option>
<option value="extreme">Extreme</option>
{{/select}}
</select>
</span>
</div>
<div class="flexrow">
<span class="item-name-label-header-long">
<label class="items-title-text">Using 3D combat</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.secondary.is3Dcombat" {{checked
data.secondary.is3Dcombat}} /></label>
</span>
{{#if data.secondary.is3Dcombat}}
<span class="item-name-label-header-long">
<label class="items-title-text">Elevation</label>
<input type="text" class="input-numeric-short padd-right" name="system.secondary.elevation" value="{{data.secondary.elevation}}" data-dtype="Number"/>
</span>
<span class="item-name-label-header-long">
<label class="items-title-text">Angle</label>
<select type="text" name="system.secondary.angle" value="{{data.secondary.angle}}" data-dtype="String">
{{#select data.secondary.angle}}
<option value="level">Level</option>
<option value="angled">Angled</option>
<option value="Vertical">Vertical</option>
{{/select}}
</select>
</span>
{{/if}}
</div>
<div>
{{#each data.arcs as |arc idx|}}
{{#if arc.is3D}}
{{#if @root.data.secondary.is3Dcombat}}
{{> systems/fvtt-pegasus-rpg/templates/partial-vehicle-arc.html idx=idx arc=arc}}
{{/if}}
{{else}}
{{> systems/fvtt-pegasus-rpg/templates/partial-vehicle-arc.html idx=idx arc=arc}}
{{/if}}
{{/each}}
</div>
<ul class="stat-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header-long2">
<h3><label class="items-title-text">Effects</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Level</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Type</label>
</span>
<span class="item-field-label-short">
<label class="short-label">P/N</label>
</span>
<span class="item-field-label-long">
<label class="short-label">Stat</label>
</span>
</li>
{{#each effects as |effect key|}}
<li class="item stat flexrow list-item list-item-shadow" data-arme-id="{{effect.id}}"
data-item-id="{{effect._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{effect.img}}" /></a>
<span class="item-name-label-long2">{{effect.name}}</span>
<span class="item-field-label-short">{{effect.system.effectlevel}}</span>
<span class="item-field-label-short">{{upperFirst effect.system.type}}</span>
<span class="item-field-label-short">{{upperFirst effect.datsystema.genre}}</span>
<span class="item-field-label-short">{{upper effect.system.stataffected}}</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>
{{!-- Modules Tab --}}
<div class="tab items" data-group="primary" data-tab="modules">
<div class="stat-item">
<ul class="stat-list alternate-list">
<li class="item stat flexrow list-item">
<span class="generic-label small-label "><strong>VDP</strong></span>
<input type="text" class="input-numeric-short padd-right" name="system.modules.vdp" value="{{data.modules.vdp}}"
data-dtype="Number" />
<span class="generic-label small-label"><strong>Vehicle Value</strong></span>
<input type="text" class="input-numeric-short" name="system.modules.vehiculevalue" value="{{data.modules.vehiculevalue}}"
data-dtype="Number" />
<span class="generic-label small-label"><strong>Total cost</strong></span>
<input type="text" class="" value="{{totalCost}}"
data-dtype="Number" disabled />
<span class="generic-label small-label "><strong>VMS</strong></span>
<span class="generic-label small-label">Total</span>
<input type="text" class="input-numeric-short" name="system.modules.totalvms" value="{{data.modules.totalvms}}"
data-dtype="Number" disabled />
<span class="generic-label small-label">Available</span>
<input type="text" class="input-numeric-short" name="system.modules.vmsavailable" value="{{data.modules.vmsAvailable}}"
data-dtype="Number" disabled />
<span class="generic-label small-label">Used</span>
<input type="text" class="input-numeric-short" name="system.modules.vmsused" value="{{data.modules.vmsused}}"
data-dtype="Number" disabled />
</li>
</ul>
</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">1 - Hull</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Size</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">Hull Type</label>
</span>
<span class="item-field-label-short">
<label class="short-label">HR</label>
</span>
<span class="item-field-label-short">
<label class="short-label">MAN</label>
</span>
<span class="item-field-label-short">
<label class="short-label">VMS</label>
</span>
</li>
{{#each vehicleHull as |hull key|}}
<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-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>
<span class="item-field-label-short">{{hull.system.vms}}</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>
<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">2 - Power core</label></h3>
</span>
<span class="item-field-label-medium">
<label class="short-label">Type</label>
</span>
<span class="item-field-label-short">
<label class="short-label">PC</label>
</span>
<span class="item-field-label-short">
<label class="short-label">NRG</label>
</span>
</li>
{{#each powerCoreModules as |powercore key|}}
<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-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>
<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>
<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">3 -Mobility</label></h3>
</span>
<span class="item-field-label-long">
<label class="short-label">Vehicle Category</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">Quality</label>
</span>
<span class="item-field-label-short">
<label class="short-label">MR</label>
</span>
<span class="item-field-label-short">
<label class="short-label">TS:F</label>
</span>
<span class="item-field-label-short">
<label class="short-label">TS:S</label>
</span>
<span class="item-field-label-short">
<label class="short-label">TS:R</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">MAN Adj.</label>
</span>
</li>
{{#each mobilityModules as |mobility key|}}
<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-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>
<span class="item-field-label-short">{{mobility.system.ts_f}}</span>
<span class="item-field-label-short">{{mobility.system.ts_s}}</span>
<span class="item-field-label-short">{{mobility.system.ts_r}}</span>
<span class="item-field-label-medium">{{mobility.system.man}}</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>
<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">4 - Propulsion</label></h3>
</span>
<span class="item-field-label-medium">
<label class="short-label">Quality</label>
</span>
<span class="item-field-label-short">
<label class="short-label">A/D</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">TS:F Adj.</label>
</span>
</li>
{{#each propulsionModules as |propulsion key|}}
<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-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>
<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>
<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">5 - Combat</label></h3>
</span>
<span class="item-field-label-long">
<label class="short-label">Quality</label>
</span>
<span class="item-field-label-short">
<label class="short-label">FC</label>
</span>
</li>
{{#each combatModules as |combat key|}}
<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-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">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
<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>
</span>
<span class="item-field-label-long">
<label class="short-label">Category</label>
</span>
<span class="item-field-label-long">
<label class="short-label">Location</label>
</span>
<span class="item-field-label-long">
<label class="short-label">Security</label>
</span>
<span class="item-field-label-short">
<label class="short-label">NRG</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">Range</label>
</span>
<span class="item-field-label-short">
<label class="short-label">IDR</label>
</span>
</li>
{{#each vehicleModules as |vehiclemod key|}}
<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-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>
<span class="item-field-label-short">{{vehiclemod.system.nrg}}</span>
<span class="item-field-label-medium">{{vehiclemod.system.range}}</span>
<span class="item-field-label-short">{{vehiclemod.system.idr}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control vehicle-module-activate" title="Activated">{{#if vehiclemod.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>
<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>
</span>
<span class="item-field-label-long">
<label class="short-label">Site</label>
</span>
<span class="item-field-label-long">
<label class="short-label">Location</label>
</span>
<span class="item-field-label-short">
<label class="short-label">DMG</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">AoE</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">Turret</label>
</span>
<span class="item-field-label-short">
<label class="short-label">NRG</label>
</span>
<span class="item-field-label-short">
<label class="short-label">IDR</label>
</span>
</li>
{{#each vehicleWeaponModules as |weapon key|}}
<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-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>
<span class="item-field-label-medium">{{weapon.system.aoe}}</span>
<span class="item-field-label-medium">{{weapon.system.turrent}}</span>
<span class="item-field-label-short">{{weapon.system.nrg}}</span>
<span class="item-field-label-short">{{weapon.system.idr}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control vehicle-weapon-activate" title="Activated">{{#if weapon.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>
{{!-- 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">
<div class="flexrow">
<h3>Encumbrance</h3>
<span class="small-label">Current : {{encCurrent}}</span>
<span class="small-label">Capacity : {{encCapacity}}</span>
<span class="small-label">Hindrance : {{encHindrance}}</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>
<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>
</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>
<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.system.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>
</div>
</li>
{{/each}}
</ul>
<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">Weapons</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Attack</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Damage</label>
</span>
<span class="item-field-label-short">
<label class="short-label">DMG</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">DMGT</label>
</span>
<span class="item-field-label-long">
<label class="short-label">Ammo</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">Act/Deact</label>
</span>
<span class="item-field-label-short">
<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="weapon" title="Create Item"><i class="fas fa-plus"></i></a>
</div>
</li>
{{#each weapons as |weapon key|}}
<li class="item 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">{{weapon.name}}</span>
<span class="item-field-label-short"><label>{{upper weapon.system.statistic}}</label></span>
<span class="item-field-label-short"><label>{{upper weapon.system.damagestatistic}}</label></span>
<span class="item-field-label-short"><label>{{weapon.system.damageDice}}</label></span>
<span class="item-field-label-medium"><label>{{weapon.system.damagetype}} ({{weapon.system.damagetypelevel}})</label></span>
{{#if (gt weapon.system.ammomax 0)}}
<span class="item-field-label-long"><label>{{weapon.system.ammocurrent}}/{{weapon.system.ammomax}}
(<a class="ammo-minus plus-minus-button"> -</a>/<a class="ammo-plus plus-minus-button">+</a>)
</label></span>
{{else}}
<span class="item-field-label-long"><label>-</label>
</span>
{{/if}}
<span class="item-field-label-medium">
{{#if (count weapon.system.effects)}}
{{#if weapon.system.activated}}
<a class="equip-deactivate">Deactivate</a>
{{else}}
<a class="equip-activate">Activate</a>
{{/if}}
{{else}}
&nbsp;-&nbsp;
{{/if}}
</span>
<span class="item-field-label-short"><label>{{weapon.system.weight}}</label></span>
<span class="item-field-label-medium">
{{#if weapon.system.idrDice}}
<a class="roll-idr" data-dice-value="{{weapon.system.idrDice}}">{{weapon.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-equip" title="Worn">{{#if weapon.system.equipped}}<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>
<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">Armors</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Stat</label>
</span>
<span class="item-field-label-short">
<label class="short-label">DMG RES</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">Loc</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">Act/Deact</label>
</span>
<span class="item-field-label-short">
<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="armor" title="Create Item"><i class="fas fa-plus"></i></a>
</div>
</li>
{{#each armors as |armor key|}}
<li class="item list-item flexrow list-item-shadow" data-item-id="{{armor._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{armor.img}}" /></a>
<span class="item-name-label">{{armor.name}}</span>
<span class="item-field-label-short">{{upper armor.system.statistic}}</span>
<span class="item-field-label-short">{{armor.system.resistanceDice}}</span>
<span class="item-field-label-medium">{{armor.system.locationprotected}}</span>
<span class="item-field-label-medium">
{{#if (count armor.system.effects)}}
{{#if armor.system.activated}}
<a class="equip-deactivate">Deactivate</a>
{{else}}
<a class="equip-activate">Activate</a>
{{/if}}
{{else}}
&nbsp;-&nbsp;
{{/if}}
</span>
<span class="item-field-label-short">{{armor.system.weight}}</span>
<span class="item-field-label-medium">
{{#if armor.system.idrDice}}
<a class="roll-idr" data-dice-value="{{armor.system.idrDice}}">{{armor.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-equip" title="Worn">{{#if armor.system.equipped}}<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>
<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">Shields</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Dice</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">Act/Deact</label>
</span>
<span class="item-field-label-short">
<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="shield" title="Create Item"><i class="fas fa-plus"></i></a>
</div>
</li>
{{#each shields as |shield key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{shield._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{shield.img}}" /></a>
<span class="item-name-label">{{shield.name}}</span>
<span class="item-field-label-short">{{shield.system.levelDice}}</span>
<span class="item-field-label-medium">
{{#if (count shield.system.effects)}}
{{#if shield.system.activated}}
<a class="equip-deactivate">Deactivate</a>
{{else}}
<a class="equip-activate">Activate</a>
{{/if}}
{{else}}
&nbsp;-&nbsp;
{{/if}}
</span>
<span class="item-field-label-short">{{shield.system.weight}}</span>
<span class="item-field-label-medium">
{{#if shield.system.idrDice}}
<a class="roll-idr" data-dice-value="{{shield.system.idrDice}}">{{shield.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-equip" title="Worn">{{#if shield.system.equipped}}<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>
<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">Equipment</label></h3>
</span>
<span class="item-field-label-long">
<label class="short-label">Quantity</label>
</span>
<span class="item-field-label-medium">
<label class="short-label">Act/Deact</label>
</span>
<span class="item-field-label-short">
<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="equipment" title="Create Item"><i class="fas fa-plus"></i></a>
</div>
</li>
{{#each containersTree as |equip key|}}
{{> systems/fvtt-pegasus-rpg/templates/partial-actor-equipment.html equip=equip level=1}}
<ul class="item-list list-item-shadow2 list-item-margin1">
{{#each equip.system.contents as |subgear key|}}
{{> systems/fvtt-pegasus-rpg/templates/partial-actor-equipment.html equip=subgear level=2}}
{{/each}}
</ul>
{{/each}}
</ul>
<hr>
</div>
{{!-- Details Tab --}}
<div class="tab biodata" data-group="primary" data-tab="details">
<hr>
<h3>Description : </h3>
<div class="form-group editor">
{{editor data.biodata.description target="system.biodata.description" button=true owner=owner
editable=editable}}
</div>
<hr>
<h3>Notes : </h3>
<div class="form-group editor">
{{editor data.biodata.notes target="system.biodata.notes" button=true owner=owner editable=editable}}
</div>
<hr>
</article>
</div>
</section>
</form>