2 Commits

Author SHA1 Message Date
JDR-Ninja
11a10bbbfc Migration V12 2024-05-24 15:55:48 -04:00
JDR-Ninja
47dd386fe0 Ajustements 2024-05-16 22:06:56 -04:00
15 changed files with 74 additions and 58 deletions

1
.gitignore vendored
View File

@@ -28,3 +28,4 @@
.history/
src/
mgt2.zip

View File

@@ -1,6 +1,15 @@
## [0.1.2](https://github.com/xdy/twodsix-foundryvtt/compare/v4.24.5...v4.24.6) (2024-05-04)
## [0.1.3] (2024-05-25)
### Bug Fixes
### Correctifs
* Localisation
* Ajouter valeur de la difficulté dans le label
### Features
* Support de la v12
## [0.1.2] (2024-05-16)
### Correctifs
* Affichage de la difficulté pour les Talents Psioniques
* Ajout de scrollbar dans la feuille de personnage
* Drag & Drop sur la fiche des Carrières, Maladies, Contacts, Espèces

View File

@@ -123,6 +123,8 @@
"NewArmor": "New Armor",
"NewAugment": "New Augment",
"NewContact": "New Contact",
"NewComputer": "New Computer",
"NewContainer": "New Container",
"NewDisease": "New Diseases",
"NewEquipment": "New Equipment",
"NewItem": "New Item",
@@ -250,14 +252,14 @@
},
"Difficulty": {
"NA": "Not Applicable",
"Simple": "Simple",
"Easy": "Easy",
"Routine": "Routine",
"Average": "Average",
"Difficult": "Difficult",
"VeryDifficult": "Very Difficult",
"Formidable": "Formidable",
"Impossible": "Impossible"
"Simple": "Simple (2)",
"Easy": "Easy (4)",
"Routine": "Routine (6)",
"Average": "Average (8)",
"Difficult": "Difficult (10)",
"VeryDifficult": "Very Difficult (12)",
"Formidable": "Formidable (14)",
"Impossible": "Impossible (16)"
},
"PsionicReach": {
"NA": "N/A",
@@ -357,6 +359,7 @@
}
},
"Items": {
"SelectAll": "(all)",
"Age": "Age",
"Armor": "Armor",
"Armors": "Armors",

View File

@@ -29,7 +29,7 @@
"hint": "Choisissez un thème"
},
"useWeightMetric": {
"name": "Utiliser le Système Métrique pour le Poid",
"name": "Utiliser le Système Métrique pour le Poids",
"hint": "kilogramme (kg) au lieu de la livre (lbs)"
},
"useDistanceMetric": {
@@ -123,6 +123,8 @@
"NewArmor": "Nouvelle Armure",
"NewAugment": "Nouvelle Augmentation",
"NewContact": "Nouveau Contact",
"NewContainer": "Nouveau Conteneur",
"NewComputer": "Nouvel Ordinateur",
"NewDisease": "Nouvelle Maladie",
"NewEquipment": "Nouvelle Équipement",
"NewItem": "Nouveau Objet",
@@ -250,14 +252,14 @@
},
"Difficulty": {
"NA": "N/A",
"Simple": "Simple",
"Easy": "Facile",
"Routine": "Routine",
"Average": "Moyenne",
"Difficult": "Difficile",
"VeryDifficult": "Très Difficile",
"Formidable": "Formidable",
"Impossible": "Impossible"
"Simple": "Simple (2)",
"Easy": "Facile (4)",
"Routine": "Routine (6)",
"Average": "Moyenne (8)",
"Difficult": "Difficile (10)",
"VeryDifficult": "Très Difficile (12)",
"Formidable": "Formidable (14)",
"Impossible": "Impossible (16)"
},
"PsionicReach": {
"NA": "N/A",
@@ -357,6 +359,7 @@
}
},
"Items": {
"SelectAll": "(tous)",
"Age": "Âge",
"Armor": "Armure",
"Armors": "Armures",
@@ -409,7 +412,7 @@
"Options": "Options",
"PSICost": "Coût PSI",
"Powered": "Alimenté",
"Processing": "Traitement",
"Processing": "Capacité de Traitement",
"Protection": "Protection",
"PsionicSkill": "Compétence Psionique",
"Qty": "Qté",
@@ -436,8 +439,8 @@
"Type": "Type",
"Weapon": "Arme",
"Weapons": "Armes",
"Weight": "Poid",
"Weightless": "Aucun Poid",
"Weight": "Poids",
"Weightless": "Aucun Poids",
"Quantity": "Quantité"
},
"Durations": {

View File

@@ -618,10 +618,10 @@ class ActorCharacter {
const cloneActor = duplicate($this);
await this.recalculateArmor($this, cloneActor);
if (recalculEncumbrance) {
const str = $this.system.characteristics.strength.value;
const end = $this.system.characteristics.endurance.value;
const str = Number($this.system.characteristics.strength.value);
const end = Number($this.system.characteristics.endurance.value);
let sumSkill = 0;
$this.items.filter((x) => x.type === "talent" && x.system.subType === "skill" && x.system.skill.reduceEncumbrance === true).forEach((x) => sumSkill += x.system.level);
$this.items.filter((x) => x.type === "talent" && x.system.subType === "skill" && x.system.skill.reduceEncumbrance === true).forEach((x) => sumSkill += Number(x.system.level));
let normal = str + end + sumSkill;
let heavy = normal * 2;
cloneActor.system.states.encumbrance = $this.system.inventory.weight > normal;
@@ -714,23 +714,23 @@ class ActorCharacter {
}
static async preUpdate($this, changed, options, user) {
var _a, _b, _c, _d, _e, _f, _g, _h;
const newStr = (_a = foundry.utils.getProperty(changed, "system.characteristics.strength.value")) != null ? _a : $this.system.characteristics.strength.value;
const newEnd = (_b = foundry.utils.getProperty(changed, "system.characteristics.endurance.value")) != null ? _b : $this.system.characteristics.endurance.value;
const newStr = Number((_a = foundry.utils.getProperty(changed, "system.characteristics.strength.value")) != null ? _a : $this.system.characteristics.strength.value);
const newEnd = Number((_b = foundry.utils.getProperty(changed, "system.characteristics.endurance.value")) != null ? _b : $this.system.characteristics.endurance.value);
if (newStr !== $this.system.characteristics.strength.value || newEnd !== $this.system.characteristics.endurance.value) {
let sumSkill = 0;
$this.items.filter((x) => x.type === "talent" && x.system.subType === "skill" && x.system.skill.reduceEncumbrance === true).forEach((x) => sumSkill += x.system.level);
$this.items.filter((x) => x.type === "talent" && x.system.subType === "skill" && x.system.skill.reduceEncumbrance === true).forEach((x) => sumSkill += Number(x.system.level));
let normal = newStr + newEnd + sumSkill;
let heavy = normal * 2;
foundry.utils.setProperty(changed, "system.inventory.encumbrance.normal", normal);
foundry.utils.setProperty(changed, "system.inventory.encumbrance.heavy", heavy);
}
const characteristicModified = this.computeCharacteristics(changed);
const strengthValue = (_c = foundry.utils.getProperty(changed, "system.characteristics.strength.value")) != null ? _c : $this.system.characteristics.strength.value;
const strengthMax = (_d = foundry.utils.getProperty(changed, "system.characteristics.strength.max")) != null ? _d : $this.system.characteristics.strength.max;
const dexterityValue = (_e = foundry.utils.getProperty(changed, "system.characteristics.dexterity.value")) != null ? _e : $this.system.characteristics.dexterity.value;
const dexterityMax = (_f = foundry.utils.getProperty(changed, "system.characteristics.dexterity.max")) != null ? _f : $this.system.characteristics.dexterity.max;
const enduranceValue = (_g = foundry.utils.getProperty(changed, "system.characteristics.endurance.value")) != null ? _g : $this.system.characteristics.endurance.value;
const enduranceMax = (_h = foundry.utils.getProperty(changed, "system.characteristics.endurance.max")) != null ? _h : $this.system.characteristics.endurance.max;
const strengthValue = Number((_c = foundry.utils.getProperty(changed, "system.characteristics.strength.value")) != null ? _c : $this.system.characteristics.strength.value);
const strengthMax = Number((_d = foundry.utils.getProperty(changed, "system.characteristics.strength.max")) != null ? _d : $this.system.characteristics.strength.max);
const dexterityValue = Number((_e = foundry.utils.getProperty(changed, "system.characteristics.dexterity.value")) != null ? _e : $this.system.characteristics.dexterity.value);
const dexterityMax = Number((_f = foundry.utils.getProperty(changed, "system.characteristics.dexterity.max")) != null ? _f : $this.system.characteristics.dexterity.max);
const enduranceValue = Number((_g = foundry.utils.getProperty(changed, "system.characteristics.endurance.value")) != null ? _g : $this.system.characteristics.endurance.value);
const enduranceMax = Number((_h = foundry.utils.getProperty(changed, "system.characteristics.endurance.max")) != null ? _h : $this.system.characteristics.endurance.max);
const lifeValue = strengthValue + dexterityValue + enduranceValue;
const lifeMax = strengthMax + dexterityMax + enduranceMax;
if ($this.system.life.value !== lifeValue)
@@ -837,8 +837,8 @@ class ActorCharacter {
}
static computeCharacteristic(changed, name) {
const path = `system.characteristics.${name}`;
const newValue = foundry.utils.getProperty(changed, path + ".value");
if (newValue) {
const newValue = Number(foundry.utils.getProperty(changed, path + ".value"));
if (newValue && !isNaN(newValue)) {
const dm = this.getModifier(newValue);
foundry.utils.setProperty(changed, path + ".dm", dm);
return true;
@@ -1746,7 +1746,7 @@ class TravellerActorSheet extends ActorSheet {
}
}
actorContainers.sort(MGT2Helper.compareByName);
const containers = [{ "name": "(tous)", "_id": "" }].concat(actorContainers);
const containers = [{ "name": game.i18n.localize("MGT2.Items.SelectAll"), "_id": "", "display": game.i18n.localize("MGT2.Items.SelectAll") }].concat(actorContainers);
const containerIndex = /* @__PURE__ */ new Map();
for (let c of actorContainers) {
containerIndex.set(c._id, c);
@@ -2271,7 +2271,7 @@ class TravellerActorSheet extends ActorSheet {
};
if (MGT2Helper.hasValue(rollOptions, "difficulty")) {
chatData.rollDifficulty = rollOptions.difficulty;
chatData.rollDifficultyLabel = MGT2Helper.getDifficultyDisplay(rollOptions.difficulty);
chatData.rollDifficultyLabel = game.i18n.localize(`MGT2.Difficulty.${rollOptions.difficulty}`);
if (roll.total >= MGT2Helper.getDifficultyValue(rollOptions.difficulty)) {
chatData.rollSuccess = true;
} else {
@@ -2327,7 +2327,7 @@ class TravellerActorSheet extends ActorSheet {
if (this.actor.system.containerDropIn == "" || this.actor.system.containerDropIn === null) {
if (containers.length === 0) {
const cls = getDocumentClass("Item");
container = cls.create({ name: "New container", type: "container" }, { parent: this.actor });
container = cls.create({ name: game.i18n.localize("MGT2.Actor.NewContainer"), type: "container" }, { parent: this.actor });
} else {
container = containers[0];
}
@@ -2363,7 +2363,7 @@ class TravellerActorSheet extends ActorSheet {
_onContainerCreate(ev) {
ev.preventDefault();
const cls = getDocumentClass("Item");
return cls.create({ name: "New container", type: "container" }, { parent: this.actor });
return cls.create({ name: game.i18n.localize("MGT2.Actor.NewContainer"), type: "container" }, { parent: this.actor });
}
_canDragDrop(selector) {
return this.isEditable;

File diff suppressed because one or more lines are too long

BIN
mgt2.zip

Binary file not shown.

View File

@@ -1,13 +1,13 @@
{
"id": "mgt2",
"version": "0.1.2",
"version": "0.1.3",
"title": "MGT2 - Mongoose Traveller (Unofficial)",
"description": "An unofficial implementation of Mongoose Publishing Traveller (VO/VF). Traveller is the property of Mongoose Publishing, and can be purchased at https://www.mongoosepublishing.com",
"background": "systems/mgt2/assets/screens/rosette-nebula-ngc2239-hoo.webp",
"url": "https://github.com/JDR-Ninja/foundryvtt-mgt2",
"manifest": "https://github.com/JDR-Ninja/foundryvtt-mgt2/releases/latest/download/system.json",
"readme": "https://raw.githubusercontent.com/JDR-Ninja/foundryvtt-mgt2/main/README.md",
"download": "https://github.com/JDR-Ninja/foundryvtt-mgt2/releases/download/v0.1.2/mgt2.zip",
"download": "https://github.com/JDR-Ninja/foundryvtt-mgt2/releases/download/v0.1.3/mgt2.zip",
"changelog": "https://raw.githubusercontent.com/JDR-Ninja/foundryvtt-mgt2/main/CHANGELOG.md",
"authors": [
{
@@ -37,7 +37,7 @@
],
"compatibility": {
"minimum": "11",
"verified": "11.315"
"verified": "12.324"
},
"gridDistance": 1.5,
"gridUnits": "m",

View File

@@ -558,7 +558,7 @@
<div class="row-item row-item-85 row-item-left upcase"><i class="fa-solid fa-toolbox"></i>{{ localize 'MGT2.Items.Equipments' }}</div>
<div class="row-item row-item-2 row-item-center">{{ localize 'MGT2.Items.Qty' }}</div>
<div class="row-item row-item-2 row-item-right flex-fix">{{ localize 'MGT2.Items.Weight' }}</div>
<div class="row-item row-item-15 item-controls flex-fix"><a class="item-create" data-type-item="equipment" data-create-name="{{ localize 'MGT2.Actor.Equipment' }}" title="{{ localize 'MGT2.Actor.AddEquipment' }}"><i class="fas fa-plus"></i></a></div>
<div class="row-item row-item-15 item-controls flex-fix"><a class="item-create" data-type-item="equipment" data-create-name="{{ localize 'MGT2.Actor.NewEquipment' }}" title="{{ localize 'MGT2.Actor.AddEquipment' }}"><i class="fas fa-plus"></i></a></div>
</div>
{{#each equipments as |equipment id|}}
<div class="table-row drag-item-list" data-item-id="{{equipment._id}}" role="rowgroup">
@@ -582,11 +582,11 @@
<div class="row-item row-item-15 item-controls flex-fix"><a class="item-create" data-type-item="item" data-create-name="{{ localize 'MGT2.Actor.NewItem' }}" title="{{ localize 'MGT2.Actor.AddItem' }}"><i class="fas fa-plus"></i></a></div>
</div>
{{#each items as |item|}}
{{#if (eq item.type "container")}}
<div class="table-row drop-item-list" data-item-id="{{item._id}}">
{{#if (eq item.type "container")}}
<div class="table-row drop-item-list" data-item-id="{{item._id}}">
{{else}}
<div class="table-row drag-item-list" data-item-id="{{item._id}}">
{{/if}}
{{/if}}
<div class="row-item row-item-85 row-item-left">{{item.name}}</div>
<div class="row-item row-item-2 row-item-center">{{item.system.quantity}}</div>
<div class="row-item row-item-2 row-item-right flex-fix">{{item.weight}}</div>
@@ -627,7 +627,7 @@
<div>
<label>{{ localize 'MGT2.Items.Containers' }}</label>
<select name="system.containerView">
{{selectOptions containers selected=system.containerView nameAttr="_id" labelAttr="display"}}
{{selectOptions containers selected=system.containerView valueAttr="_id" labelAttr="display"}}
</select>
<div class="container-controls">
{{#unless containerShowAll}}<a class="container-edit"><i class="fas fa-edit"></i></a>{{/unless}}
@@ -638,7 +638,7 @@
<div>
<label>DropIn</label>
<select name="system.containerDropIn">
{{selectOptions actorContainers selected=system.containerDropIn nameAttr="_id" labelAttr="display"}}
{{selectOptions actorContainers selected=system.containerDropIn valueAttr="_id" labelAttr="display"}}
</select>
</div>
</div>

View File

@@ -32,7 +32,7 @@
<div class="field-group w3-10">
<label>{{ localize 'MGT2.Items.Storage' }}</label>
<select name="system.container.id">
{{selectOptions containers selected=system.container.id nameAttr="_id" labelAttr="name"}}
{{selectOptions containers selected=system.container.id valueAttr="_id" labelAttr="name"}}
</select>
</div>
{{/if}}

View File

@@ -29,7 +29,7 @@
<div class="field-group">
<label>{{ localize 'MGT2.Items.Storage' }}</label>
<select name="system.container.id">
{{selectOptions containers selected=system.container.id nameAttr="_id" labelAttr="name"}}
{{selectOptions containers selected=system.container.id valueAttr="_id" labelAttr="name"}}
</select>
</div>
{{/if}}

View File

@@ -43,7 +43,7 @@
<div class="field-group">
<label>{{ localize 'MGT2.Items.Storage' }}</label>
<select name="system.container.id">
{{selectOptions containers selected=system.container.id nameAttr="_id" labelAttr="name"}}
{{selectOptions containers selected=system.container.id valueAttr="_id" labelAttr="name"}}
</select>
</div>
{{/if}}

View File

@@ -36,14 +36,14 @@
<div class="field-group">
<label>{{ localize 'MGT2.Items.Computer' }}</label>
<select name="system.software.computerId">
{{selectOptions computers selected=system.software.computerId nameAttr="_id" labelAttr="name"}}
{{selectOptions computers selected=system.software.computerId valueAttr="_id" labelAttr="name"}}
</select>
</div>
{{/if}}
<div class="field-group">
<label>{{ localize 'MGT2.Items.Storage' }}</label>
<select name="system.container.id">
{{selectOptions containers selected=system.container.id nameAttr="_id" labelAttr="name"}}
{{selectOptions containers selected=system.container.id valueAttr="_id" labelAttr="name"}}
</select>
</div>
</div>

View File

@@ -10,7 +10,7 @@
<label>{{ localize 'MGT2.Items.Skill' }}</label>
<select name="system.roll.skill">
<option></option>
{{selectOptions skills selected=system.roll.skill nameAttr="_id" labelAttr="name"}}
{{selectOptions skills selected=system.roll.skill valueAttr="_id" labelAttr="name"}}
</select>
</div>
<div class="field-group w3-10">

View File

@@ -27,7 +27,7 @@
<div class="field-group">
<label>{{ localize 'MGT2.Items.Storage' }}</label>
<select name="system.container.id">
{{selectOptions containers selected=system.container.id nameAttr="_id" labelAttr="name"}}
{{selectOptions containers selected=system.container.id valueAttr="_id" labelAttr="name"}}
</select>
</div>
{{/if}}