3 Commits

Author SHA1 Message Date
6aa0b3a58d Fix robot weapon, and rework encumbrance
All checks were successful
Release Creation / build (release) Successful in 53s
2025-11-15 21:59:42 +01:00
810271c2a2 Crew member enhancements
All checks were successful
Release Creation / build (release) Successful in 59s
2025-11-11 12:13:26 +01:00
27b09d4546 Add crew member option with pilot rolls integrated
All checks were successful
Release Creation / build (release) Successful in 48s
2025-11-09 22:12:00 +01:00
38 changed files with 1051 additions and 160 deletions

View File

@@ -24,6 +24,7 @@
body {
--color-text-secondary: #160303;
--color-text-emphatic: #09610e;
--input-height: 1.6rem;
}
.d100 {
width: 18px;
@@ -74,6 +75,11 @@ i.fvtt-ftl-nomad {
.application.dialog.fvtt-ftl-nomad .legend {
font-family: var(--font-primary);
}
.sheet-tabs {
background-color: var(--color-light-1);
font-family: Ethnocentric;
font-size: 0.7rem;
}
.chat-message,
.chat-message.whisper {
font-family: var(--font-primary);
@@ -99,8 +105,8 @@ i.fvtt-ftl-nomad {
.fvtt-ftl-nomad .vehicle-sheet-common .form-group label {
font-weight: bold;
margin-right: 8px;
min-width: 4rem;
max-width: 4rem;
min-width: 5rem;
max-width: 5rem;
}
.fvtt-ftl-nomad .starship-sheet-common label {
font-family: var(--font-secondary);
@@ -384,7 +390,7 @@ i.fvtt-ftl-nomad {
background-color: var(--color-light-1);
display: flex;
flex-direction: column;
gap: 5px;
justify-content: space-evenly;
flex: 1;
}
.fvtt-ftl-nomad .character-main .character-skills .character-skill {
@@ -1002,8 +1008,8 @@ i.fvtt-ftl-nomad {
.fvtt-ftl-nomad .vehicle-content .form-group label {
font-weight: bold;
margin-right: 8px;
min-width: 4rem;
max-width: 4rem;
min-width: 5rem;
max-width: 5rem;
}
.fvtt-ftl-nomad .sheet-tabs {
background-color: var(--color-light-1);
@@ -1033,6 +1039,12 @@ i.fvtt-ftl-nomad {
width: auto;
border: none;
}
.fvtt-ftl-nomad .vehicle-main .vehicle-pc .vehicle-left .spec label {
max-width: 4rem;
}
.fvtt-ftl-nomad .vehicle-main .vehicle-pc .vehicle-left .spec input {
max-width: 4rem;
}
.fvtt-ftl-nomad .vehicle-main .vehicle-pc .vehicle-right {
display: flex;
flex-direction: column;
@@ -1048,8 +1060,7 @@ i.fvtt-ftl-nomad {
}
.fvtt-ftl-nomad .vehicle-main .vehicle-pc .vehicle-right .cargo label,
.fvtt-ftl-nomad .vehicle-main .vehicle-pc .vehicle-right .capacity label {
min-width: 4rem;
max-width: 4rem;
max-width: 7rem;
}
.fvtt-ftl-nomad .vehicle-main .vehicle-pc .vehicle-right .cargo input,
.fvtt-ftl-nomad .vehicle-main .vehicle-pc .vehicle-right .capacity input {
@@ -1058,10 +1069,31 @@ i.fvtt-ftl-nomad {
}
.fvtt-ftl-nomad .vehicle-main .vehicle-pc .vehicle-right .cargo .cargo-content,
.fvtt-ftl-nomad .vehicle-main .vehicle-pc .vehicle-right .capacity .cargo-content {
display: flex;
flex-direction: column;
gap: 4px;
}
.fvtt-ftl-nomad .vehicle-main .vehicle-pc .vehicle-right .cargo .cargo-content .cargo-line,
.fvtt-ftl-nomad .vehicle-main .vehicle-pc .vehicle-right .capacity .cargo-content .cargo-line {
display: flex;
align-items: center;
gap: 4px;
}
.fvtt-ftl-nomad .vehicle-main .vehicle-pc .vehicle-right .cargo .npc-crew-field,
.fvtt-ftl-nomad .vehicle-main .vehicle-pc .vehicle-right .capacity .npc-crew-field {
display: flex;
align-items: center;
gap: 4px;
}
.fvtt-ftl-nomad .vehicle-main .vehicle-pc .vehicle-right .cargo .npc-crew-field .npc-crew-roll,
.fvtt-ftl-nomad .vehicle-main .vehicle-pc .vehicle-right .capacity .npc-crew-field .npc-crew-roll {
cursor: pointer;
color: var(--color-text-dark-primary);
}
.fvtt-ftl-nomad .vehicle-main .vehicle-pc .vehicle-right .cargo .npc-crew-field .npc-crew-roll:hover,
.fvtt-ftl-nomad .vehicle-main .vehicle-pc .vehicle-right .capacity .npc-crew-field .npc-crew-roll:hover {
color: var(--color-text-hyperlink);
}
.fvtt-ftl-nomad .vehicle-main .vehicle-pc .vehicle-right .vehicle-infos {
display: flex;
flex-direction: column;
@@ -1155,6 +1187,65 @@ i.fvtt-ftl-nomad {
font-size: calc(var(--font-size-standard) * 1.4);
padding-left: 5px;
}
.fvtt-ftl-nomad .tab.vehicle-equipment .main-div .crew .crew-list {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 8px;
padding: 4px;
}
.fvtt-ftl-nomad .tab.vehicle-equipment .main-div .crew .crew-member {
display: flex;
align-items: center;
gap: 4px;
padding: 4px;
border: 1px solid var(--color-border-dark);
border-radius: 4px;
background: var(--color-light-2);
}
.fvtt-ftl-nomad .tab.vehicle-equipment .main-div .crew .crew-member .crew-img {
width: 32px;
height: 32px;
border-radius: 50%;
border: 1px solid var(--color-border-dark);
cursor: pointer;
}
.fvtt-ftl-nomad .tab.vehicle-equipment .main-div .crew .crew-member .crew-img:hover {
opacity: 0.8;
box-shadow: 0 0 4px var(--color-shadow-primary);
}
.fvtt-ftl-nomad .tab.vehicle-equipment .main-div .crew .crew-member .crew-name {
flex: 1;
font-size: var(--font-size-small);
cursor: pointer;
}
.fvtt-ftl-nomad .tab.vehicle-equipment .main-div .crew .crew-member .crew-name:hover {
color: var(--color-text-dark-highlight);
text-shadow: 0 0 4px var(--color-shadow-primary);
}
.fvtt-ftl-nomad .tab.vehicle-equipment .main-div .crew .crew-member .controls {
display: flex;
gap: 4px;
min-width: 3rem;
}
.fvtt-ftl-nomad .tab.vehicle-equipment .main-div .crew .crew-member .controls a {
color: var(--color-text-dark-primary);
}
.fvtt-ftl-nomad .tab.vehicle-equipment .main-div .crew .crew-member .controls a:hover {
color: var(--color-text-dark-highlight);
}
.fvtt-ftl-nomad .tab.vehicle-equipment .main-div .crew .crew-member .controls .pilot-button {
color: var(--color-text-light-primary);
}
.fvtt-ftl-nomad .tab.vehicle-equipment .main-div .crew .crew-member .controls .pilot-button:hover {
color: var(--color-text-light-highlight);
}
.fvtt-ftl-nomad .tab.vehicle-equipment .main-div .crew .crew-empty {
grid-column: 1 / -1;
text-align: center;
padding: 8px;
font-style: italic;
color: var(--color-text-dark-secondary);
}
.fvtt-ftl-nomad .tab.vehicle-equipment .main-div .weapons {
display: grid;
grid-template-columns: repeat(2, 1fr);
@@ -1421,7 +1512,7 @@ i.fvtt-ftl-nomad {
background-color: var(--color-light-1);
display: flex;
flex-direction: column;
gap: 5px;
justify-content: space-evenly;
flex: 1;
}
.fvtt-ftl-nomad .robot-main .robot-skills .robot-skill {
@@ -1663,9 +1754,6 @@ i.fvtt-ftl-nomad {
min-width: 5rem;
max-width: 5rem;
}
.fvtt-ftl-nomad .sheet-tabs {
background-color: var(--color-light-1);
}
.fvtt-ftl-nomad .starship-main {
background-color: var(--color-light-1);
display: flex;
@@ -1756,6 +1844,18 @@ i.fvtt-ftl-nomad {
.fvtt-ftl-nomad .starship-main .starship-pc .starship-right .cargo select {
max-width: 5rem;
}
.fvtt-ftl-nomad .starship-main .starship-pc .starship-right .cargo .npc-crew-field {
display: flex;
align-items: center;
gap: 4px;
}
.fvtt-ftl-nomad .starship-main .starship-pc .starship-right .cargo .npc-crew-field .npc-crew-roll {
cursor: pointer;
color: var(--color-text-dark-primary);
}
.fvtt-ftl-nomad .starship-main .starship-pc .starship-right .cargo .npc-crew-field .npc-crew-roll:hover {
color: var(--color-text-hyperlink);
}
.fvtt-ftl-nomad .starship-main .starship-pc .starship-right .starship-infos {
display: flex;
flex-direction: column;
@@ -1845,6 +1945,65 @@ i.fvtt-ftl-nomad {
font-size: calc(var(--font-size-standard) * 1.4);
padding-left: 5px;
}
.fvtt-ftl-nomad .tab.starship-equipment .crew .crew-list {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 8px;
padding: 4px;
}
.fvtt-ftl-nomad .tab.starship-equipment .crew .crew-member {
display: flex;
align-items: center;
gap: 4px;
padding: 4px;
border: 1px solid var(--color-border-dark);
border-radius: 4px;
background: var(--color-light-2);
}
.fvtt-ftl-nomad .tab.starship-equipment .crew .crew-member .crew-img {
width: 32px;
height: 32px;
border-radius: 50%;
border: 1px solid var(--color-border-dark);
cursor: pointer;
}
.fvtt-ftl-nomad .tab.starship-equipment .crew .crew-member .crew-img:hover {
opacity: 0.8;
box-shadow: 0 0 4px var(--color-shadow-primary);
}
.fvtt-ftl-nomad .tab.starship-equipment .crew .crew-member .crew-name {
flex: 1;
font-size: var(--font-size-small);
cursor: pointer;
}
.fvtt-ftl-nomad .tab.starship-equipment .crew .crew-member .crew-name:hover {
color: var(--color-text-dark-highlight);
text-shadow: 0 0 4px var(--color-shadow-primary);
}
.fvtt-ftl-nomad .tab.starship-equipment .crew .crew-member .controls {
display: flex;
gap: 4px;
min-width: 3rem;
}
.fvtt-ftl-nomad .tab.starship-equipment .crew .crew-member .controls a {
color: var(--color-text-dark-primary);
}
.fvtt-ftl-nomad .tab.starship-equipment .crew .crew-member .controls a:hover {
color: var(--color-text-dark-highlight);
}
.fvtt-ftl-nomad .tab.starship-equipment .crew .crew-member .controls .pilot-button {
color: var(--color-text-light-primary);
}
.fvtt-ftl-nomad .tab.starship-equipment .crew .crew-member .controls .pilot-button:hover {
color: var(--color-text-light-highlight);
}
.fvtt-ftl-nomad .tab.starship-equipment .crew .crew-empty {
grid-column: 1 / -1;
text-align: center;
padding: 8px;
font-style: italic;
color: var(--color-text-dark-secondary);
}
.fvtt-ftl-nomad .tab.starship-equipment .weapons {
display: grid;
grid-template-columns: repeat(2, 1fr);
@@ -2091,7 +2250,7 @@ i.fvtt-ftl-nomad {
background-color: var(--color-light-1);
display: flex;
flex-direction: column;
gap: 5px;
justify-content: space-evenly;
flex: 1;
}
.fvtt-ftl-nomad .creature-main .creature-skills .creature-skill {

View File

@@ -447,6 +447,7 @@
"capacity" : "Capacity",
"Agility" : "Agility",
"Armor": "Armor",
"ArmorCritical": "Armor Critical",
"cargo": "Cargo",
"vehicle": "Vehicle",
"starship": "Starship",
@@ -475,6 +476,7 @@
"Unarmed": "Unarmed",
"Vehicle": "Vehicle",
"armor": "Armor",
"armorCritical": "Armor (Crit.)",
"armors": "Armors",
"biodata": "Biodata",
"biography": "Biography",
@@ -524,7 +526,12 @@
"titleWeapon": "Weapon Roll",
"total": "Total",
"totalScore": "Total Score",
"weapons": "Weapons"
"weapons": "Weapons",
"crew": "Crew",
"noCrew": "No crew members assigned",
"vehicleBonus": "Vehicle/Starship Agility Bonus",
"selectSkill": "Select Skill",
"npcCrewSkill": "NPC Crew"
},
"Language": {
"FIELDS": {
@@ -610,7 +617,10 @@
"label": "Hull Type"
},
"armor": {
"label": "Armor"
"label": "Armor (Reg.)"
},
"armorCritical": {
"label": "Armor (Crit.)"
},
"guns" : {
"label": "Guns"
@@ -633,6 +643,12 @@
"crew": {
"label": "Crew"
},
"crewCapacity": {
"label": "Crew Capacity"
},
"npcCrew": {
"label": "NPC Skill"
},
"description": {
"label": "Description"
},
@@ -707,11 +723,20 @@
"label": "Speed"
},
"armor": {
"label": "Armor"
"label": "Armor (Reg.)"
},
"armorCritical": {
"label": "Armor (Crit.)"
},
"crew": {
"label": "Crew"
},
"crewCapacity": {
"label": "Crew Capacity"
},
"npcCrew": {
"label": "NPC Skill"
},
"description": {
"label": "Description"
},
@@ -723,7 +748,21 @@
}
}
},
"Warning": {},
"Warning": {
"alreadyInCrew": "This actor is already a crew member",
"notACharacter": "Only characters can pilot vehicles",
"noVehiclesSkill": "This character does not have the vehicles skill",
"noSkills": "This character does not have any skills",
"noNpcCrew": "NPC Crew level is below 0",
"onlyCharactersAllowed": "Only characters can be added as crew members",
"noLinkedPrototype": "This character must be linked to his token to be added as crew member"
},
"RemoveCrew": "Remove from crew",
"RemoveCrewTitle": "Remove crew member?",
"RemoveCrewContent": "Are you sure you want to remove {name} from the crew?",
"PilotVehicle": "Pilot vehicle (with vehicle agility bonus)",
"PilotStarship": "Pilot starship (with starship agility bonus)",
"RollNpcCrew": "Roll for NPC Crew",
"Weapon": {
"FIELDS": {
"cost": {

View File

@@ -14,9 +14,148 @@ export default class FTLNomadStarshipSheet extends FTLNomadActorSheet {
actions: {
createEquipment: FTLNomadStarshipSheet.#onCreateEquipment,
createWeapon: FTLNomadStarshipSheet.#onCreateWeapon,
removeCrew: FTLNomadStarshipSheet.#onRemoveCrew,
viewCrew: FTLNomadStarshipSheet.#onViewCrew,
pilotCrew: FTLNomadStarshipSheet.#onPilotCrew,
rollNpcCrew: FTLNomadStarshipSheet.#onRollNpcCrew,
},
}
/**
* Remove a crew member from the starship
* @param {Event} event The initiating click event
* @param {HTMLElement} target The current target of the event listener
*/
static async #onRemoveCrew(event, target) {
const crewUuid = target.dataset.crewUuid
const actor = await fromUuid(crewUuid)
// Show confirmation dialog
const confirmed = await foundry.applications.api.DialogV2.confirm({
window: { title: game.i18n.localize("FTLNOMAD.RemoveCrewTitle") },
content: game.i18n.format("FTLNOMAD.RemoveCrewContent", { name: actor?.name || "Unknown" }),
rejectClose: false,
modal: true
})
if (!confirmed) return
const currentCrew = this.document.system.crewList || []
const updatedCrew = currentCrew.filter(uuid => uuid !== crewUuid)
await this.document.update({ "system.crewList": updatedCrew })
}
/**
* Open the actor sheet of a crew member
* @param {Event} event The initiating click event
* @param {HTMLElement} target The current target of the event listener
*/
static async #onViewCrew(event, target) {
const actorUuid = target.closest('.crew-member').dataset.actorUuid
const actor = await fromUuid(actorUuid)
if (actor) {
actor.sheet.render(true)
}
}
/**
* Roll a piloting check for a crew member with starship agility bonus
* @param {Event} event The initiating click event
* @param {HTMLElement} target The current target of the event listener
*/
static async #onPilotCrew(event, target) {
const actorUuid = target.closest('.crew-member').dataset.actorUuid
const actor = await fromUuid(actorUuid)
console.log("Pilot crew - Actor:", actor, "Type:", actor?.type)
if (!actor) {
ui.notifications.warn("Actor not found")
return
}
if (actor.type !== "character") {
ui.notifications.warn(`This actor is of type "${actor.type}", not "character"`)
return
}
// Get starship agility bonus
const starshipAgility = this.document.system.agility || 0
// Get all skills from the actor
const actorSkills = actor.system.skills
if (!actorSkills) {
ui.notifications.warn(game.i18n.localize("FTLNOMAD.Warning.noSkills"))
return
}
// Default to vehicles skill
const defaultSkill = actorSkills.vehicles || Object.values(actorSkills)[0]
// Import the Roll class
const FTLNomadRoll = (await import("../../documents/roll.mjs")).default
// Call the roll prompt with all skills available and starship agility as a vehicle bonus
let roll = await FTLNomadRoll.prompt({
rollType: "skill",
rollItem: defaultSkill,
availableSkills: actorSkills,
selectedSkillId: "vehicles",
actorId: actor.id,
actorName: actor.name,
actorImage: actor.img,
talents: actor.items.filter(i => i.type === "talent" && i.system.isAdvantage),
isEncumbered: actor.system.isEncumbered(),
hasTarget: false,
vehicleBonus: starshipAgility
})
if (!roll) return null
await roll.toMessage({}, { rollMode: roll.options.rollMode })
}
/**
* Roll a check for NPC crew with starship agility bonus
* @param {Event} event The initiating click event
* @param {HTMLElement} target The current target of the event listener
*/
static async #onRollNpcCrew(event, target) {
const npcCrewLevel = this.document.system.npcCrew || 0
if (npcCrewLevel < 0) {
ui.notifications.warn(game.i18n.localize("FTLNOMAD.Warning.noNpcCrew"))
return
}
// Get starship agility bonus
const starshipAgility = this.document.system.agility || 0
// Create a fake skill object for the NPC crew
const npcSkill = {
value: npcCrewLevel,
label: "FTLNOMAD.Label.npcCrewSkill"
}
// Import the Roll class
const FTLNomadRoll = (await import("../../documents/roll.mjs")).default
// Call the roll prompt with NPC crew level as skill
let roll = await FTLNomadRoll.prompt({
rollType: "skill",
rollItem: npcSkill,
actorId: this.document.id,
actorName: `${this.document.name} (NPC Crew)`,
actorImage: this.document.img,
talents: [],
isEncumbered: false,
hasTarget: false,
vehicleBonus: starshipAgility
})
if (!roll) return null
await roll.toMessage({}, { rollMode: roll.options.rollMode })
}
/** @override */
static PARTS = {
main: {
@@ -63,9 +202,35 @@ export default class FTLNomadStarshipSheet extends FTLNomadActorSheet {
context.enrichedNotes = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.notes, { async: true })
context.enrichedModifications = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.modifications, { async: true })
// Prepare crew members data
context.crewMembers = await this.#prepareCrewMembers()
return context
}
/**
* Prepare crew members data from stored UUIDs
* @returns {Promise<Array>}
*/
async #prepareCrewMembers() {
const crewUuids = this.document.system.crewList || []
const crewMembers = []
for (const uuid of crewUuids) {
const actor = await fromUuid(uuid)
if (actor) {
crewMembers.push({
uuid: uuid,
id: actor.id,
name: actor.name,
img: actor.img
})
}
}
return crewMembers
}
_generateTooltip(type, target) {
}
@@ -128,7 +293,41 @@ export default class FTLNomadStarshipSheet extends FTLNomadActorSheet {
case "Item":
const item = await fromUuid(data.uuid)
return super._onDropItem(item)
case "Actor":
const actor = await fromUuid(data.uuid)
return this.#onDropActor(actor)
}
}
/**
* Handle dropping an actor onto the starship sheet to add them to the crew
* @param {Actor} actor The actor being dropped
*/
async #onDropActor(actor) {
if (!actor) return
// Check if actor is of type "character"
if (actor.type !== "character") {
ui.notifications.info(game.i18n.localize("FTLNOMAD.Warning.onlyCharactersAllowed"))
return
}
// Check if the actor has a linked prototype
if (!actor.prototypeToken?.actorLink) {
ui.notifications.info(game.i18n.localize("FTLNOMAD.Warning.noLinkedPrototype"))
return
}
const currentCrew = this.document.system.crewList || []
// Check if actor is already in crew
if (currentCrew.includes(actor.uuid)) {
ui.notifications.warn(game.i18n.localize("FTLNOMAD.Warning.alreadyInCrew"))
return
}
// Add actor UUID to crew array
const updatedCrew = [...currentCrew, actor.uuid]
await this.document.update({ "system.crewList": updatedCrew })
}
}

View File

@@ -5,8 +5,8 @@ export default class FTLNomadVehicleSheet extends FTLNomadActorSheet {
static DEFAULT_OPTIONS = {
classes: ["vehicle"],
position: {
width: 680,
height: 540,
width: 720,
height: 640,
},
window: {
contentClasses: ["vehicle-content"],
@@ -14,9 +14,148 @@ export default class FTLNomadVehicleSheet extends FTLNomadActorSheet {
actions: {
createEquipment: FTLNomadVehicleSheet.#onCreateEquipment,
createWeapon: FTLNomadVehicleSheet.#onCreateWeapon,
removeCrew: FTLNomadVehicleSheet.#onRemoveCrew,
viewCrew: FTLNomadVehicleSheet.#onViewCrew,
pilotCrew: FTLNomadVehicleSheet.#onPilotCrew,
rollNpcCrew: FTLNomadVehicleSheet.#onRollNpcCrew,
},
}
/**
* Remove a crew member from the vehicle
* @param {Event} event The initiating click event
* @param {HTMLElement} target The current target of the event listener
*/
static async #onRemoveCrew(event, target) {
const crewUuid = target.dataset.crewUuid
const actor = await fromUuid(crewUuid)
// Show confirmation dialog
const confirmed = await foundry.applications.api.DialogV2.confirm({
window: { title: game.i18n.localize("FTLNOMAD.RemoveCrewTitle") },
content: game.i18n.format("FTLNOMAD.RemoveCrewContent", { name: actor?.name || "Unknown" }),
rejectClose: false,
modal: true
})
if (!confirmed) return
const currentCrew = this.document.system.crewList || []
const updatedCrew = currentCrew.filter(uuid => uuid !== crewUuid)
await this.document.update({ "system.crewList": updatedCrew })
}
/**
* Open the actor sheet of a crew member
* @param {Event} event The initiating click event
* @param {HTMLElement} target The current target of the event listener
*/
static async #onViewCrew(event, target) {
const actorUuid = target.closest('.crew-member').dataset.actorUuid
const actor = await fromUuid(actorUuid)
if (actor) {
actor.sheet.render(true)
}
}
/**
* Roll a piloting check for a crew member with vehicle agility bonus
* @param {Event} event The initiating click event
* @param {HTMLElement} target The current target of the event listener
*/
static async #onPilotCrew(event, target) {
const actorUuid = target.closest('.crew-member').dataset.actorUuid
const actor = await fromUuid(actorUuid)
console.log("Pilot crew - Actor:", actor, "Type:", actor?.type)
if (!actor) {
ui.notifications.warn("Actor not found")
return
}
if (actor.type !== "character") {
ui.notifications.warn(`This actor is of type "${actor.type}", not "character"`)
return
}
// Get vehicle agility bonus
const vehicleAgility = this.document.system.agility || 0
// Get all skills from the actor
const actorSkills = actor.system.skills
if (!actorSkills) {
ui.notifications.warn(game.i18n.localize("FTLNOMAD.Warning.noSkills"))
return
}
// Default to vehicles skill
const defaultSkill = actorSkills.vehicles || Object.values(actorSkills)[0]
// Import the Roll class
const FTLNomadRoll = (await import("../../documents/roll.mjs")).default
// Call the roll prompt with all skills available and vehicle agility as a vehicle bonus
let roll = await FTLNomadRoll.prompt({
rollType: "skill",
rollItem: defaultSkill,
availableSkills: actorSkills,
selectedSkillId: "vehicles",
actorId: actor.id,
actorName: actor.name,
actorImage: actor.img,
talents: actor.items.filter(i => i.type === "talent" && i.system.isAdvantage),
isEncumbered: actor.system.isEncumbered(),
hasTarget: false,
vehicleBonus: vehicleAgility
})
if (!roll) return null
await roll.toMessage({}, { rollMode: roll.options.rollMode })
}
/**
* Roll a check for NPC crew with vehicle agility bonus
* @param {Event} event The initiating click event
* @param {HTMLElement} target The current target of the event listener
*/
static async #onRollNpcCrew(event, target) {
const npcCrewLevel = this.document.system.npcCrew || 0
if (npcCrewLevel < 0) {
ui.notifications.warn(game.i18n.localize("FTLNOMAD.Warning.noNpcCrew"))
return
}
// Get vehicle agility bonus
const vehicleAgility = this.document.system.agility || 0
// Create a fake skill object for the NPC crew
const npcSkill = {
value: npcCrewLevel,
label: "FTLNOMAD.Label.npcCrewSkill"
}
// Import the Roll class
const FTLNomadRoll = (await import("../../documents/roll.mjs")).default
// Call the roll prompt with NPC crew level as skill
let roll = await FTLNomadRoll.prompt({
rollType: "skill",
rollItem: npcSkill,
actorId: this.document.id,
actorName: `${this.document.name} (NPC Crew)`,
actorImage: this.document.img,
talents: [],
isEncumbered: false,
hasTarget: false,
vehicleBonus: vehicleAgility
})
if (!roll) return null
await roll.toMessage({}, { rollMode: roll.options.rollMode })
}
/** @override */
static PARTS = {
main: {
@@ -62,9 +201,35 @@ export default class FTLNomadVehicleSheet extends FTLNomadActorSheet {
context.enrichedDescription = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.description, { async: true })
context.enrichedNotes = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.notes, { async: true })
// Prepare crew members data
context.crewMembers = await this.#prepareCrewMembers()
return context
}
/**
* Prepare crew members data from stored UUIDs
* @returns {Promise<Array>}
*/
async #prepareCrewMembers() {
const crewUuids = this.document.system.crewList || []
const crewMembers = []
for (const uuid of crewUuids) {
const actor = await fromUuid(uuid)
if (actor) {
crewMembers.push({
uuid: uuid,
id: actor.id,
name: actor.name,
img: actor.img
})
}
}
return crewMembers
}
_generateTooltip(type, target) {
}
@@ -128,7 +293,36 @@ export default class FTLNomadVehicleSheet extends FTLNomadActorSheet {
case "Item":
const item = await fromUuid(data.uuid)
return super._onDropItem(item)
case "Actor":
const actor = await fromUuid(data.uuid)
return this.#onDropActor(actor)
}
}
/**
* Handle dropping an actor onto the vehicle sheet to add them to the crew
* @param {Actor} actor The actor being dropped
*/
async #onDropActor(actor) {
if (!actor) return
// Check if actor is of type "character"
if (actor.type !== "character") {
ui.notifications.info(game.i18n.localize("FTLNOMAD.Warning.onlyCharactersAllowed"))
return
}
const currentCrew = this.document.system.crewList || []
// Check if actor is already in crew
if (currentCrew.includes(actor.uuid)) {
ui.notifications.warn(game.i18n.localize("FTLNOMAD.Warning.alreadyInCrew"))
return
}
// Add actor UUID to crew array
const updatedCrew = [...currentCrew, actor.uuid]
await this.document.update({ "system.crewList": updatedCrew })
}
}

View File

@@ -67,9 +67,12 @@ export default class FTLNomadRoll extends Roll {
} else {
let mod = options.rollItem?.value || 0
fullFormula = `${options.formula} + ${options.skillModifier}D + ${mod} + ${options.rangeModifier}D + ${options.numericModifier}D + ${options.numericModifierSelect}`
if (options.vehicleBonus && options.useVehicleBonus) {
fullFormula += ` + ${options.vehicleBonus}`
}
}
// Replace all the "+ -" with "-"
fullFormula = fullFormula.replace(/\+\s*\-/g, "- ")
fullFormula = fullFormula.replace(/\+\s*-/g, "- ")
$('#roll-dialog-full-formula').text(fullFormula)
options.fullFormula = fullFormula
}
@@ -136,13 +139,29 @@ export default class FTLNomadRoll extends Roll {
options.numericModifierSelect = 0
options.rangeModifier = rangeModifier
options.damageModifier = damageModifier
options.vehicleBonus = options.vehicleBonus || 0
options.useVehicleBonus = true // Par défaut, le bonus est activé
let fullFormula = `${formula} + ${options.rollItem.value}`
if (options.isEncumbered) {
fullFormula += ` - 1D`
}
if (options.vehicleBonus && options.useVehicleBonus) {
fullFormula += ` + ${options.vehicleBonus}`
}
options.fullFormula = fullFormula
options.formula = formula
// Prepare available skills if provided (for vehicle/starship piloting)
let availableSkills = null
if (options.availableSkills) {
availableSkills = Object.entries(options.availableSkills).map(([id, skill]) => ({
id: id,
label: skill.label,
value: skill.value,
selected: id === options.selectedSkillId
}))
}
let dialogContext = {
actorId: options.actorId,
actorName: options.actorName,
@@ -164,6 +183,8 @@ export default class FTLNomadRoll extends Roll {
hasTarget: options.hasTarget,
modifier,
numericModifierSelect,
vehicleBonus: options.vehicleBonus,
availableSkills: availableSkills,
}
const content = await foundry.applications.handlebars.renderTemplate("systems/fvtt-ftl-nomad/templates/roll-dialog.hbs", dialogContext)
@@ -190,6 +211,14 @@ export default class FTLNomadRoll extends Roll {
rejectClose: false, // Click on Close button will not launch an error
render: (event, dialog) => {
FTLNomadRoll.updateFullFormula(options)
$(".roll-skill-selector").change(event => {
const skillId = event.target.value
if (options.availableSkills && options.availableSkills[skillId]) {
options.rollItem = foundry.utils.duplicate(options.availableSkills[skillId])
options.selectedSkillId = skillId
FTLNomadRoll.updateFullFormula(options)
}
})
$(".roll-skill-modifier").change(event => {
options.skillModifier = Number(event.target.value)
FTLNomadRoll.updateFullFormula(options)
@@ -216,6 +245,10 @@ export default class FTLNomadRoll extends Roll {
}
FTLNomadRoll.updateFullFormula(options)
})
$(".use-vehicle-bonus").change(event => {
options.useVehicleBonus = event.target.checked
FTLNomadRoll.updateFullFormula(options)
})
}
})
@@ -229,13 +262,22 @@ export default class FTLNomadRoll extends Roll {
if (Hooks.call("fvtt-ftl-nomad.preRoll", options, rollData) === false) return
// Update rollItem if a skill was selected from the dropdown
if (rollData.selectedSkill && options.availableSkills) {
options.rollItem = foundry.utils.duplicate(options.availableSkills[rollData.selectedSkill])
}
options.numericModifier = Number(rollData.numericModifier) || 0
options.skillModifier = Number(rollData.skillModifier) || 0
options.rangeModifier = Number(rollData.rangeModifier) || 0
options.numericModifierSelect = Number(rollData.numericModifierSelect) || 0
options.useVehicleBonus = rollData.useVehicleBonus !== "off" && rollData.useVehicleBonus !== false
options.finalModifier = options.numericModifier + options.skillModifier + options.rangeModifier
let mod = options.rollItem?.value || 0
mod += options.numericModifierSelect
if (options.useVehicleBonus) {
mod += options.vehicleBonus || 0
}
// Build the dice formula
let diceFormula = "2d6"

View File

@@ -77,10 +77,7 @@ export default class FTLNomadProtagonist extends foundry.abstract.TypeDataModel
prepareDerivedData() {
super.prepareDerivedData();
let encMax = 10 + (2 * this.skills.physical.value)
if (encMax !== this.enc.max) {
this.enc.max = encMax
}
let encMax = this.enc.max // 10 + (2 * this.skills.physical.value)
let enc = 0
let armor = 0
for (let i of this.parent.items) {

View File

@@ -49,10 +49,8 @@ export default class FTLNomadRobot extends foundry.abstract.TypeDataModel {
prepareDerivedData() {
super.prepareDerivedData();
let encMax = this.durability + (2 * this.skills.physical.value)
if (encMax !== this.enc.max) {
this.enc.max = encMax
}
let encMax = this.enc.max // this.durability + (2 * this.skills.physical.value)
let enc = 0
for (let i of this.parent.items) {
if (i.system?.enc) {

View File

@@ -11,7 +11,10 @@ export default class FTLNomadStarship extends foundry.abstract.TypeDataModel {
schema.hullType = new fields.StringField({ required: true, initial: "small", choices: SYSTEM.STARSHIP_HULL })
schema.endurance = new fields.StringField({ required: true, initial: "" })
schema.armor = new fields.StringField({ required: true, initial: "" })
schema.crew = new fields.StringField({ required: true, initial: "" })
schema.armorCritical = new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
schema.crewList = new fields.ArrayField(new fields.StringField({ required: true }), { initial: [] })
schema.crewCapacity = new fields.StringField({ required: true, initial: "" })
schema.npcCrew = new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
schema.cargo = new fields.StringField({ required: true, initial: "" })
schema.guns = new fields.StringField({ required: true, initial: "1d6" })
schema.travelMultiplier = new fields.StringField({ required: true, initial: "" })

View File

@@ -9,8 +9,11 @@ export default class FTLNomadVehicle extends foundry.abstract.TypeDataModel {
schema.agility = new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
schema.armor = new fields.StringField({ required: true, initial: "" })
schema.armorCritical = new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
schema.cargo = new fields.StringField({ required: true, initial: "" })
schema.crew = new fields.StringField({ required: true, initial: "" })
schema.crewList = new fields.ArrayField(new fields.StringField({ required: true }), { initial: [] })
schema.crewCapacity = new fields.StringField({ required: true, initial: "" })
schema.npcCrew = new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
schema.force = new fields.NumberField({ ...requiredInteger, initial: 1, min: 1 })
schema.range = new fields.StringField({ required: true, initial: "1d6" })
schema.speed = new fields.StringField({ required: true, initial: "1d6" })

View File

@@ -1 +1 @@
MANIFEST-000107
MANIFEST-000136

View File

@@ -1,7 +1,7 @@
2025/10/27-20:06:28.536125 7f2a23fff6c0 Recovering log #105
2025/10/27-20:06:28.547660 7f2a23fff6c0 Delete type=3 #103
2025/10/27-20:06:28.547796 7f2a23fff6c0 Delete type=0 #105
2025/10/27-20:07:11.806730 7f2a213ff6c0 Level-0 table #110: started
2025/10/27-20:07:11.806798 7f2a213ff6c0 Level-0 table #110: 0 bytes OK
2025/10/27-20:07:11.813240 7f2a213ff6c0 Delete type=0 #108
2025/10/27-20:07:11.813543 7f2a213ff6c0 Manual compaction at level-0 from '!folders!AuBtSOj1mJmh88qx' @ 72057594037927935 : 1 .. '!items!zv9dwgL3p7ThQn7j' @ 0 : 0; will stop at (end)
2025/11/15-21:57:15.481581 7f4781ffb6c0 Recovering log #134
2025/11/15-21:57:15.491519 7f4781ffb6c0 Delete type=3 #132
2025/11/15-21:57:15.491588 7f4781ffb6c0 Delete type=0 #134
2025/11/15-21:59:21.237179 7f4780bff6c0 Level-0 table #139: started
2025/11/15-21:59:21.237222 7f4780bff6c0 Level-0 table #139: 0 bytes OK
2025/11/15-21:59:21.302054 7f4780bff6c0 Delete type=0 #137
2025/11/15-21:59:21.450579 7f4780bff6c0 Manual compaction at level-0 from '!folders!AuBtSOj1mJmh88qx' @ 72057594037927935 : 1 .. '!items!zv9dwgL3p7ThQn7j' @ 0 : 0; will stop at (end)

View File

@@ -1,7 +1,7 @@
2025/10/27-20:03:18.716726 7f2a22ffd6c0 Recovering log #101
2025/10/27-20:03:18.728612 7f2a22ffd6c0 Delete type=3 #99
2025/10/27-20:03:18.728755 7f2a22ffd6c0 Delete type=0 #101
2025/10/27-20:06:09.635606 7f2a213ff6c0 Level-0 table #106: started
2025/10/27-20:06:09.635675 7f2a213ff6c0 Level-0 table #106: 0 bytes OK
2025/10/27-20:06:09.644064 7f2a213ff6c0 Delete type=0 #104
2025/10/27-20:06:09.658912 7f2a213ff6c0 Manual compaction at level-0 from '!folders!AuBtSOj1mJmh88qx' @ 72057594037927935 : 1 .. '!items!zv9dwgL3p7ThQn7j' @ 0 : 0; will stop at (end)
2025/11/11-09:55:29.500472 7f0922ffd6c0 Recovering log #130
2025/11/11-09:55:29.510925 7f0922ffd6c0 Delete type=3 #128
2025/11/11-09:55:29.511008 7f0922ffd6c0 Delete type=0 #130
2025/11/11-12:13:09.876661 7f0920bff6c0 Level-0 table #135: started
2025/11/11-12:13:09.876709 7f0920bff6c0 Level-0 table #135: 0 bytes OK
2025/11/11-12:13:09.882679 7f0920bff6c0 Delete type=0 #133
2025/11/11-12:13:09.882804 7f0920bff6c0 Manual compaction at level-0 from '!folders!AuBtSOj1mJmh88qx' @ 72057594037927935 : 1 .. '!items!zv9dwgL3p7ThQn7j' @ 0 : 0; will stop at (end)

Binary file not shown.

View File

View File

@@ -1 +1 @@
MANIFEST-000085
MANIFEST-000114

View File

@@ -1,7 +1,7 @@
2025/10/27-20:06:28.555946 7f2a227fc6c0 Recovering log #83
2025/10/27-20:06:28.567241 7f2a227fc6c0 Delete type=3 #81
2025/10/27-20:06:28.567394 7f2a227fc6c0 Delete type=0 #83
2025/10/27-20:07:11.791873 7f2a213ff6c0 Level-0 table #88: started
2025/10/27-20:07:11.791940 7f2a213ff6c0 Level-0 table #88: 0 bytes OK
2025/10/27-20:07:11.799353 7f2a213ff6c0 Delete type=0 #86
2025/10/27-20:07:11.813499 7f2a213ff6c0 Manual compaction at level-0 from '!actors!0FQ6XaRi24OorI21' @ 72057594037927935 : 1 .. '!folders!vRnrOJqSMlxbSgyX' @ 0 : 0; will stop at (end)
2025/11/15-21:57:15.495359 7f47817fa6c0 Recovering log #112
2025/11/15-21:57:15.505936 7f47817fa6c0 Delete type=3 #110
2025/11/15-21:57:15.505987 7f47817fa6c0 Delete type=0 #112
2025/11/15-21:59:21.388865 7f4780bff6c0 Level-0 table #117: started
2025/11/15-21:59:21.388934 7f4780bff6c0 Level-0 table #117: 0 bytes OK
2025/11/15-21:59:21.450426 7f4780bff6c0 Delete type=0 #115
2025/11/15-21:59:21.450606 7f4780bff6c0 Manual compaction at level-0 from '!actors!0FQ6XaRi24OorI21' @ 72057594037927935 : 1 .. '!folders!vRnrOJqSMlxbSgyX' @ 0 : 0; will stop at (end)

View File

@@ -1,7 +1,7 @@
2025/10/27-20:03:18.738218 7f2a23fff6c0 Recovering log #79
2025/10/27-20:03:18.749460 7f2a23fff6c0 Delete type=3 #77
2025/10/27-20:03:18.749597 7f2a23fff6c0 Delete type=0 #79
2025/10/27-20:06:09.651196 7f2a213ff6c0 Level-0 table #84: started
2025/10/27-20:06:09.651261 7f2a213ff6c0 Level-0 table #84: 0 bytes OK
2025/10/27-20:06:09.658656 7f2a213ff6c0 Delete type=0 #82
2025/10/27-20:06:09.658955 7f2a213ff6c0 Manual compaction at level-0 from '!actors!0FQ6XaRi24OorI21' @ 72057594037927935 : 1 .. '!folders!vRnrOJqSMlxbSgyX' @ 0 : 0; will stop at (end)
2025/11/11-09:55:29.516089 7f0921ffb6c0 Recovering log #108
2025/11/11-09:55:29.525977 7f0921ffb6c0 Delete type=3 #106
2025/11/11-09:55:29.526050 7f0921ffb6c0 Delete type=0 #108
2025/11/11-12:13:09.863976 7f0920bff6c0 Level-0 table #113: started
2025/11/11-12:13:09.864017 7f0920bff6c0 Level-0 table #113: 0 bytes OK
2025/11/11-12:13:09.870509 7f0920bff6c0 Delete type=0 #111
2025/11/11-12:13:09.882783 7f0920bff6c0 Manual compaction at level-0 from '!actors!0FQ6XaRi24OorI21' @ 72057594037927935 : 1 .. '!folders!vRnrOJqSMlxbSgyX' @ 0 : 0; will stop at (end)

Binary file not shown.

View File

View File

@@ -172,7 +172,7 @@
background-color: var(--color-light-1);
display: flex;
flex-direction: column;
gap: 5px;
justify-content: space-evenly;
flex: 1;
.character-skill {

View File

@@ -129,7 +129,7 @@
background-color: var(--color-light-1);
display: flex;
flex-direction: column;
gap: 5px;
justify-content: space-evenly;
flex: 1;
.creature-skill {

View File

@@ -1,8 +1,11 @@
:root {
--font-size-standard: 0.9rem;
--font-size-result: 1.4rem;
--background-image-base: linear-gradient(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.8)),
url("../assets/ui/ftl_nomad_background_01.webp");
--background-image-base: linear-gradient(
rgba(255, 255, 255, 0.8),
rgba(255, 255, 255, 0.8)
),
url("../assets/ui/ftl_nomad_background_01.webp");
--font-primary: "Atkinson";
--font-secondary: "Atkinson";
--font-title: "Ethnocentric";
@@ -12,12 +15,14 @@
--color-warning: darkorange;
--color-critical-success: rgb(21, 39, 204);
--color-critical-failure: rgb(141, 32, 231);
/*--img-icon-color-filter: invert(60%) sepia(12%) saturate(6853%) hue-rotate(81deg) brightness(113%) contrast(104%);*/
}
body {
--color-text-secondary: rgb(22, 3, 3);
--color-text-emphatic: rgb(9, 97, 14);
--input-height: 1.6rem;
}
.d100 {
@@ -65,7 +70,7 @@ i.fvtt-ftl-nomad {
.application.dialog.fvtt-ftl-nomad {
font-family: var(--font-primary);
font-size: calc(var(--font-size-standard) * 1.0);
font-size: calc(var(--font-size-standard) * 1);
background-image: var(--background-image-base);
button:hover {
background: var(--color-dark-6);
@@ -75,11 +80,17 @@ i.fvtt-ftl-nomad {
}
}
.sheet-tabs {
background-color: var(--color-light-1);
font-family: Ethnocentric;
font-size: 0.7rem;
}
.chat-message,
.chat-message.whisper {
font-family: var(--font-primary);
background-image: var(--background-image-base);
background-repeat:repeat-y;
background-repeat: repeat-y;
background-position: 0%;
background-size: 100% 100%;
}

View File

@@ -77,8 +77,8 @@
label {
font-weight: bold;
margin-right: 8px;
min-width: 4rem;
max-width: 4rem;
min-width: 5rem;
max-width: 5rem;
}
}
}

View File

@@ -146,7 +146,7 @@
background-color: var(--color-light-1);
display: flex;
flex-direction: column;
gap: 5px;
justify-content: space-evenly;
flex: 1;
.robot-skill {

View File

@@ -4,10 +4,6 @@
overflow: scroll;
}
.sheet-tabs {
background-color: var(--color-light-1);
}
.starship-main {
background-color: var(--color-light-1);
display: flex;
@@ -109,6 +105,18 @@
select {
max-width: 5rem;
}
.npc-crew-field {
display: flex;
align-items: center;
gap: 4px;
.npc-crew-roll {
cursor: pointer;
color: var(--color-text-dark-primary);
&:hover {
color: var(--color-text-hyperlink);
}
}
}
}
.starship-infos {
@@ -214,6 +222,68 @@
padding-left: 5px;
}
}
.crew {
.crew-list {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 8px;
padding: 4px;
}
.crew-member {
display: flex;
align-items: center;
gap: 4px;
padding: 4px;
border: 1px solid var(--color-border-dark);
border-radius: 4px;
background: var(--color-light-2);
.crew-img {
width: 32px;
height: 32px;
border-radius: 50%;
border: 1px solid var(--color-border-dark);
cursor: pointer;
&:hover {
opacity: 0.8;
box-shadow: 0 0 4px var(--color-shadow-primary);
}
}
.crew-name {
flex: 1;
font-size: var(--font-size-small);
cursor: pointer;
&:hover {
color: var(--color-text-dark-highlight);
text-shadow: 0 0 4px var(--color-shadow-primary);
}
}
.controls {
display: flex;
gap: 4px;
min-width: 3rem;
a {
color: var(--color-text-dark-primary);
&:hover {
color: var(--color-text-dark-highlight);
}
}
.pilot-button {
color: var(--color-text-light-primary);
&:hover {
color: var(--color-text-light-highlight);
}
}
}
}
.crew-empty {
grid-column: 1 / -1;
text-align: center;
padding: 8px;
font-style: italic;
color: var(--color-text-dark-secondary);
}
}
.weapons {
display: grid;
grid-template-columns: repeat(2, 1fr);

View File

@@ -33,6 +33,15 @@
border: none;
}
}
.spec {
label {
max-width: 4rem;
}
input {
max-width: 4rem;
}
}
}
.vehicle-right {
@@ -52,17 +61,33 @@
.cargo,
.capacity {
label {
min-width: 4rem;
max-width: 4rem;
max-width: 7rem;
}
input {
max-width: 6rem;
margin-right: 0.5rem;
}
.cargo-content {
display: flex;
flex-direction: column;
gap: 4px;
.cargo-line {
display: flex;
align-items: center;
gap: 4px;
}
}
.npc-crew-field {
display: flex;
align-items: center;
gap: 4px;
.npc-crew-roll {
cursor: pointer;
color: var(--color-text-dark-primary);
&:hover {
color: var(--color-text-hyperlink);
}
}
}
}
@@ -173,6 +198,68 @@
padding-left: 5px;
}
}
.crew {
.crew-list {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 8px;
padding: 4px;
}
.crew-member {
display: flex;
align-items: center;
gap: 4px;
padding: 4px;
border: 1px solid var(--color-border-dark);
border-radius: 4px;
background: var(--color-light-2);
.crew-img {
width: 32px;
height: 32px;
border-radius: 50%;
border: 1px solid var(--color-border-dark);
cursor: pointer;
&:hover {
opacity: 0.8;
box-shadow: 0 0 4px var(--color-shadow-primary);
}
}
.crew-name {
flex: 1;
font-size: var(--font-size-small);
cursor: pointer;
&:hover {
color: var(--color-text-dark-highlight);
text-shadow: 0 0 4px var(--color-shadow-primary);
}
}
.controls {
display: flex;
gap: 4px;
min-width: 3rem;
a {
color: var(--color-text-dark-primary);
&:hover {
color: var(--color-text-dark-highlight);
}
}
.pilot-button {
color: var(--color-text-light-primary);
&:hover {
color: var(--color-text-light-highlight);
}
}
}
}
.crew-empty {
grid-column: 1 / -1;
text-align: center;
padding: 8px;
font-style: italic;
color: var(--color-text-dark-secondary);
}
}
.weapons {
display: grid;
grid-template-columns: repeat(2, 1fr);

View File

@@ -26,8 +26,9 @@
src="{{item.img}}"
data-tooltip="{{item.name}}"
/>
<i class="fa-regular fa-dice"></i>
<div
class="name"
class="name rollable"
data-roll-type="weapon"
data-tooltip="{{{item.system.description}}}"
>

View File

@@ -10,8 +10,20 @@
<div class="dialog-skill">Damage : {{weapon.system.damage}}</div>
<div class="dialog-skill">Weapon : {{weapon.name}}</div>
{{else}}
<div class="dialog-skill">{{localize rollItem.label}}
: 2d6+{{rollItem.value}}</div>
{{#if availableSkills}}
<label>{{localize "FTLNOMAD.Label.selectSkill"}}</label>
<select name="selectedSkill" class="roll-skill-selector">
{{#each availableSkills as |skill|}}
<option
value="{{skill.id}}"
{{#if skill.selected}}selected{{/if}}
>{{localize skill.label}} (2d6+{{skill.value}})</option>
{{/each}}
</select>
{{else}}
<div class="dialog-skill">{{localize rollItem.label}}
: 2d6+{{rollItem.value}}</div>
{{/if}}
{{/if}}
{{#if (eq rollType "weapon")}}
@@ -19,7 +31,7 @@
{{/if}}
{{#if isEncumbered}}
<div class="dialog-skill red-warning">Encumbered : -1D</div>
<div class="dialog-skill red-warning">Encumbered : -1D for Physical Attacks</div>
{{/if}}
</fieldSet>
@@ -44,6 +56,20 @@
<select name="numericModifierSelect" class="roll-numeric-modifier">
{{selectOptions choiceNumericModifier selected=numericModifierSelect}}
</select>
{{#if vehicleBonus}}
<div class="vehicle-bonus-info">
<label>
<input
type="checkbox"
name="useVehicleBonus"
class="use-vehicle-bonus"
checked
/>
{{localize "FTLNOMAD.Label.vehicleBonus"}}
</label>
<span class="vehicle-bonus-value">+{{vehicleBonus}}</span>
</div>
{{/if}}
{{/if}}
{{#if (eq rollType "weapon")}}

View File

@@ -4,63 +4,43 @@
data-group="{{tab.group}}"
>
<div class="main-div">
<!-- <div class="weapons">
<fieldset>
<legend>{{localize "FTLNOMAD.Label.weapons"}}{{#if isEditMode}}
<a
class="action"
data-tooltip="{{localize ' FTLNOMAD.Tooltip.addWeapon'}}"
data-tooltip-direction="UP"
><i class="fas fa-plus" data-action="createWeapon"></i></a>{{/if}}
</legend>
{{#each weapons as |item|}}
{{!log 'weapon' this}}
<fieldset class="crew">
<legend>{{localize "FTLNOMAD.Label.crew"}}
({{crewMembers.length}}{{#if
system.crewCapacity
}}/{{system.crewCapacity}}{{/if}})</legend>
<div class="crew-list">
{{#each crewMembers as |member|}}
<div
class="weapon item"
data-item-id="{{item.id}}"
data-item-uuid="{{item.uuid}}"
class="crew-member"
data-actor-uuid="{{member.uuid}}"
data-drag="true"
>
<img
class="item-img"
src="{{item.img}}"
data-tooltip="{{item.name}}"
class="crew-img"
src="{{member.img}}"
data-tooltip="{{member.name}}"
data-action="viewCrew"
/>
<div
class="name rollable"
data-roll-type="weapon"
data-tooltip="{{{item.system.description}}}"
>
{{item.name}}
</div>
<a
class="damage rollable"
data-item-id="{{item.id}}"
data-action="roll"
data-roll-type="damage"
data-roll-value="{{item.system.damage}}"
>{{localize "FTLNOMAD.Label.damageShort"}}
:
{{item.system.damage}}</a>
<div class="crew-name" data-action="viewCrew">{{member.name}}</div>
<div class="controls">
<a
data-tooltip="{{localize 'FTLNOMAD.Edit'}}"
data-action="edit"
data-item-id="{{item.id}}"
data-item-uuid="{{item.uuid}}"
><i class="fas fa-edit"></i></a>
class="pilot-button"
data-tooltip="{{localize 'FTLNOMAD.PilotStarship'}}"
data-action="pilotCrew"
><i class="fas fa-dice-d6"></i></a>
<a
data-tooltip="{{localize 'FTLNOMAD.Delete'}}"
data-action="delete"
data-item-id="{{item.id}}"
data-item-uuid="{{item.uuid}}"
><i class="fas fa-trash"></i></a>
data-tooltip="{{localize 'FTLNOMAD.RemoveCrew'}}"
data-action="removeCrew"
data-crew-uuid="{{member.uuid}}"
><i class="fas fa-times"></i></a>
</div>
</div>
{{else}}
<div class="crew-empty">{{localize "FTLNOMAD.Label.noCrew"}}</div>
{{/each}}
</div>
</fieldset> -->
</fieldset>
<fieldset>
<legend>{{localize "FTLNOMAD.Label.equipment"}}{{#if isEditMode}}

View File

@@ -22,12 +22,21 @@
localize=true
disabled=isPlayMode
}}
{{formField
systemFields.armor
value=system.armor
localize=true
disabled=isPlayMode
}}
{{formField
systemFields.armorCritical
value=system.armorCritical
localize=true
disabled=isPlayMode
}}
{{formField
systemFields.endurance
value=system.endurance
@@ -96,11 +105,26 @@
<legend>{{localize "FTLNOMAD.Label.cargo"}}</legend>
<div class="flexrow">
{{formField
systemFields.crew
value=system.crew
systemFields.crewCapacity
value=system.crewCapacity
localize=true
disabled=isPlayMode
}}
<div class="npc-crew-field">
<a
class="npc-crew-roll rollable"
data-action="rollNpcCrew"
data-tooltip="{{localize 'FTLNOMAD.RollNpcCrew'}}"
><i class="fas fa-dice-d6"></i></a>
{{formField
systemFields.npcCrew
value=system.npcCrew
localize=true
disabled=isPlayMode
}}
</div>
</div>
<div class="flexrow">
{{formField
systemFields.cargo
value=system.cargo

View File

@@ -4,6 +4,45 @@
data-group="{{tab.group}}"
>
<div class="main-div">
<fieldset class="crew">
<legend>{{localize "FTLNOMAD.Label.crew"}}
({{crewMembers.length}}{{#if
system.crewCapacity
}}/{{system.crewCapacity}}{{/if}})</legend>
<div class="crew-list">
{{#each crewMembers as |member|}}
<div
class="crew-member"
data-actor-uuid="{{member.uuid}}"
data-drag="true"
>
<img
class="crew-img"
src="{{member.img}}"
data-tooltip="{{member.name}}"
data-action="viewCrew"
/>
<div class="crew-name" data-action="viewCrew">{{member.name}}</div>
<div class="controls">
<a
class="pilot-button"
data-tooltip="{{localize 'FTLNOMAD.PilotVehicle'}}"
data-action="pilotCrew"
><i class="fas fa-dice-d6"></i></a>
<a
data-tooltip="{{localize 'FTLNOMAD.RemoveCrew'}}"
data-action="removeCrew"
data-crew-uuid="{{member.uuid}}"
><i class="fas fa-times"></i></a>
</div>
</div>
{{else}}
<div class="crew-empty">{{localize "FTLNOMAD.Label.noCrew"}}</div>
{{/each}}
</div>
</fieldset>
<fieldset>
<legend>{{localize "FTLNOMAD.Label.weapons"}}{{#if isEditMode}}
<a

View File

@@ -13,16 +13,25 @@
data-tooltip="{{actor.name}}"
/>
</div>
<fieldset>
<legend>{{localize "FTLNOMAD.Label.Agility"}}</legend>
<div class="flexrow">
{{formField
systemFields.agility
value=system.agility
localize=true
disabled=isPlayMode
}}
</div>
<fieldset class="spec">
{{formField
systemFields.agility
value=system.agility
localize=true
disabled=isPlayMode
}}
{{formField
systemFields.armor
value=system.armor
localize=true
disabled=isPlayMode
}}
{{formField
systemFields.armorCritical
value=system.armorCritical
localize=true
disabled=isPlayMode
}}
</fieldset>
</div>
@@ -48,12 +57,6 @@
<fieldset class="capacity">
<legend>{{localize "FTLNOMAD.Label.capacity"}}</legend>
<div class="flexrow">
{{formField
systemFields.armor
value=system.armor
localize=true
disabled=isPlayMode
}}
{{formField
systemFields.force
value=system.force
@@ -80,27 +83,43 @@
<fieldset class="cargo">
<legend>{{localize "FTLNOMAD.Label.cargo"}}</legend>
<div class="cargo-content">
{{formField
systemFields.crew
value=system.crew
localize=true
disabled=isPlayMode
}}
{{formField
systemFields.cargo
value=system.cargo
localize=true
disabled=isPlayMode
}}
{{formField
systemFields.tonnage
value=system.tonnage
localize=true
disabled=isPlayMode
}}
<div class="cargo-line">
{{formField
systemFields.crewCapacity
value=system.crewCapacity
localize=true
disabled=isPlayMode
}}
<div class="npc-crew-field">
<a
class="npc-crew-roll rollable"
data-action="rollNpcCrew"
data-tooltip="{{localize 'FTLNOMAD.RollNpcCrew'}}"
><i class="fas fa-dice-d6"></i></a>
{{formField
systemFields.npcCrew
value=system.npcCrew
localize=true
disabled=isPlayMode
}}
</div>
</div>
<div class="cargo-line">
{{formField
systemFields.cargo
value=system.cargo
localize=true
disabled=isPlayMode
}}
{{formField
systemFields.tonnage
value=system.tonnage
localize=true
disabled=isPlayMode
}}
</div>
</div>
</fieldset>
</div>
</div>
</fieldset>