diff --git a/images/icons/icon_vehicle_mobilitymodule.webp b/images/icons/icon_vehicle_mobilitymodule.webp new file mode 100644 index 0000000..55db752 Binary files /dev/null and b/images/icons/icon_vehicle_mobilitymodule.webp differ diff --git a/images/icons/icon_vehicle_propulsionmodule.webp b/images/icons/icon_vehicle_propulsionmodule.webp new file mode 100644 index 0000000..7936b6b Binary files /dev/null and b/images/icons/icon_vehicle_propulsionmodule.webp differ diff --git a/images/icons/icon_vehicule_combatmodule.webp b/images/icons/icon_vehicule_combatmodule.webp new file mode 100644 index 0000000..65aaef5 Binary files /dev/null and b/images/icons/icon_vehicule_combatmodule.webp differ diff --git a/images/icons/icon_vehicule_hull.webp b/images/icons/icon_vehicule_hull.webp new file mode 100644 index 0000000..001c0cc Binary files /dev/null and b/images/icons/icon_vehicule_hull.webp differ diff --git a/images/icons/icon_vehicule_module.webp b/images/icons/icon_vehicule_module.webp new file mode 100644 index 0000000..30af086 Binary files /dev/null and b/images/icons/icon_vehicule_module.webp differ diff --git a/images/icons/icon_vehicule_powercore.webp b/images/icons/icon_vehicule_powercore.webp new file mode 100644 index 0000000..0999885 Binary files /dev/null and b/images/icons/icon_vehicule_powercore.webp differ diff --git a/modules/pegasus-actor-sheet.js b/modules/pegasus-actor-sheet.js index f1e6b44..a5f2840 100644 --- a/modules/pegasus-actor-sheet.js +++ b/modules/pegasus-actor-sheet.js @@ -160,6 +160,7 @@ export class PegasusActorSheet extends ActorSheet { const li = $(ev.currentTarget).parents(".item"); let itemId = li.data("item-id"); this.actor.updatePerkStatus( itemId, ev.currentTarget.value) + this.render() }); html.find('.power-cost-spent').change(ev => { diff --git a/modules/pegasus-actor.js b/modules/pegasus-actor.js index 7d3698f..950dcf2 100644 --- a/modules/pegasus-actor.js +++ b/modules/pegasus-actor.js @@ -858,7 +858,8 @@ export class PegasusActor extends Actor { if (item.data.data.status == status) return;// Ensure we are really changing the status if (this.checkNoPerksAllowed() ) { - ChatMessage( {content: "No perks activation allowed due to effect !"}) + await this.updateEmbeddedDocuments('Item', [{ _id: item.id, 'data.status': "ready" }]) + ChatMessage.create( {content: "No perks activation allowed due to effect !"}) return } @@ -908,7 +909,7 @@ export class PegasusActor extends Actor { } this.disableWeaverPerk(item) PegasusUtility.createChatWithRollMode(item.name, { - content: await renderTemplate(`systems/fvtt-pegasus-rpg/templates/chat-perk-ready.html`, { name: this.name, perk: item }) + content: await renderTemplate(`systems/fvtt-pegasus-rpg/templates/chat-perk-ready.html`, { name: this.name, perk: duplicate(item) }) }) } if (status == "activated") { @@ -954,7 +955,7 @@ export class PegasusActor extends Actor { await this.update({ 'data.nrg': nrg }) } PegasusUtility.createChatWithRollMode(item.name, { - content: await renderTemplate(`systems/fvtt-pegasus-rpg/templates/chat-perk-activated.html`, { name: this.name, perk: item }) + content: await renderTemplate(`systems/fvtt-pegasus-rpg/templates/chat-perk-activated.html`, { name: this.name, perk: duplicate(item) }) }) this.enableWeaverPerk(item) } @@ -1387,7 +1388,7 @@ export class PegasusActor extends Actor { if (effect.data.effectstatlevel) { effect.data.effectlevel = this.data.data.statistics[effect.data.effectstat].value } - if (this.getTraumaState() == "none") { + if (this.getTraumaState() == "none" && !this.checkNoBonusDice()) { rollData.effectsList.push({ label: effect.name, type: "effect", applied: false, effect: effect, value: effect.data.effectlevel }) } else { if (!effect.data.bonusdice) { // Do not push bonus dice effect when TraumaState is activated diff --git a/modules/pegasus-item.js b/modules/pegasus-item.js index c1a16bc..c35b9aa 100644 --- a/modules/pegasus-item.js +++ b/modules/pegasus-item.js @@ -17,6 +17,13 @@ export const defaultItemImg = { money: "systems/fvtt-pegasus-rpg/images/icons/icon_money.webp", vice: "systems/fvtt-pegasus-rpg/images/icons/icon_vice.webp", virtue: "systems/fvtt-pegasus-rpg/images/icons/icon_virtue.webp", + vehiclehull:"systems/fvtt-pegasus-rpg/images/icons/icon_vehicule_hull.webp", + powercoremodule:"systems/fvtt-pegasus-rpg/images/icons/icon_vehicule_powercore.webp", + mobilitymodule: "systems/fvtt-pegasus-rpg/images/icons/icon_vehicle_mobilitymodule.webp", + combatmodule: "systems/fvtt-pegasus-rpg/images/icons/icon_vehicule_combatmodule.webp", + propulsionmodule: "systems/fvtt-pegasus-rpg/images/icons/icon_vehicle_propulsionmodule.webp", + vehiclemodule: "systems/fvtt-pegasus-rpg/images/icons/icon_vehicule_module.webp", + vehicleweaponmodule: "systems/fvtt-pegasus-rpg/images/icons/icon_vehicule_combatmodule.webp" } /** diff --git a/modules/pegasus-utility.js b/modules/pegasus-utility.js index a898609..00523ca 100644 --- a/modules/pegasus-utility.js +++ b/modules/pegasus-utility.js @@ -35,7 +35,7 @@ export class PegasusUtility { PegasusCommands.init(); Handlebars.registerHelper('count', function (list) { - return list.length; + return (list) ? list.length : 0; }) Handlebars.registerHelper('includes', function (array, val) { return array.includes(val); @@ -443,7 +443,8 @@ export class PegasusUtility { 'systems/fvtt-pegasus-rpg/templates/partial-actor-status.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' + 'systems/fvtt-pegasus-rpg/templates/partial-actor-equipment.html', + "systems/fvtt-pegasus-rpg/templates/partial-options-vehicle-speed.html" ] return loadTemplates(templatePaths); } diff --git a/system.json b/system.json index 5160da4..427c44f 100644 --- a/system.json +++ b/system.json @@ -180,9 +180,9 @@ "styles": [ "styles/simple.css" ], - "templateVersion": 100, + "templateVersion": 103, "title": "Pegasus RPG", "url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg", - "version": "0.6.10", + "version": "0.6.13", "background" : "./images/ui/pegasus_welcome_page.webp" } diff --git a/template.json b/template.json index d32d063..76451c6 100644 --- a/template.json +++ b/template.json @@ -339,9 +339,9 @@ "powercoremodule", "mobilitymodule", "combatmodule", + "propulsionmodule", "vehiclemodule", - "vehicleweaponmodule", - "propulsionmodule" + "vehicleweaponmodule" ], "effect": { "type": "", @@ -512,6 +512,7 @@ "action": "", "type": "", "powersource": "", + "powerlevel": 0, "effects": "", "activated": false, "purchasedeffects": "", @@ -600,12 +601,15 @@ "hulltype": "", "hr": 0, "man": 0, - "vms": 0 + "vms": 0, + "cost": 0 }, "powercoremodule": { "coretype": "", "pc": 0, - "nrg": 0 + "nrg": 0, + "cost": 0, + "space": 0 }, "mobilitymodule": { "vehiclecategory": "", @@ -614,15 +618,21 @@ "ts_f": "", "ts_s": "", "ts_r": "", - "man": "" + "man": "", + "cost": 0, + "space": 0 }, "propulsionmodule": { "quality": "", - "ad": "" + "ad": "", + "cost": 0, + "space": 0 }, "combatmodule": { "combattype": "", - "fc": "" + "fc": "", + "cost": 0, + "space": 0 }, "vehiclemodule": { "category": "", @@ -636,7 +646,9 @@ "shielddicevalue": "", "securitydicevalue": "", "range": "", - "idr": "" + "idr": "", + "cost": 0, + "space": 0 }, "vehicleweaponmodule": { "location": "", @@ -651,7 +663,8 @@ "range": "", "turret": "", "linkedweapon": "", - "idr": "" + "idr": "", + "cost": 0 } } } \ No newline at end of file diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index 385c3b1..e2b3392 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -430,6 +430,9 @@ + + + {{#each powers as |power key|}} @@ -469,6 +472,8 @@ + + {{power.data.powerlevel}}