reprise du projet
This commit is contained in:
@@ -46,6 +46,20 @@ export class VermineActor extends Actor {
|
||||
// things organized.
|
||||
this._prepareCharacterData(actorData);
|
||||
this._prepareNpcData(actorData);
|
||||
|
||||
//combat initiative reaction difficulty
|
||||
console.log(this.system.combatStatus)
|
||||
switch (parseInt(this.system.combatStatus.difficulty)) {
|
||||
case 5: this.system.combatStatus.label = "Offensif";
|
||||
break;
|
||||
case 7: this.system.combatStatus.label = "Actif";
|
||||
break;
|
||||
case 9: this.system.combatStatus.label = "Passif";
|
||||
break;
|
||||
default:
|
||||
this.system.combatStatus.label = "Passif";
|
||||
this.system.combatStatus.difficulty = "9";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -182,7 +182,7 @@ export class VermineCharacterSheet extends VermineActorSheet {
|
||||
event.preventDefault();
|
||||
const element = event.currentTarget;
|
||||
const dataset = element.dataset;
|
||||
console.log("Ceci est un jet d'un personnage joueur");
|
||||
console.log("Ceci est un jet d'un personnage joueur", this.actor);
|
||||
// Handle item rolls.
|
||||
if (dataset.rollType) {
|
||||
if (dataset.rollType == 'item') {
|
||||
@@ -197,7 +197,7 @@ export class VermineCharacterSheet extends VermineActorSheet {
|
||||
dataset.rollType = dataset.type;
|
||||
|
||||
let data = {
|
||||
actorId: this.actor.id,
|
||||
actorId: this.object.id,
|
||||
rollType: dataset.rollType,
|
||||
labelKey: dataset.label,
|
||||
|
||||
@@ -205,8 +205,9 @@ export class VermineCharacterSheet extends VermineActorSheet {
|
||||
};
|
||||
|
||||
let dial = await RollDialog.create(data);
|
||||
dial.render(true)
|
||||
return true;
|
||||
console.log("from sheet", data, this)
|
||||
return dial.render(true)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,10 +47,14 @@ export default class RollDialog extends Dialog {
|
||||
rolltype: null,
|
||||
NoD: 1,
|
||||
Reroll: false,
|
||||
actorId: game.user.character.id
|
||||
actorId: game.user.character?.id || canvas.tokens.controlled[0]?.actor.id
|
||||
}) {
|
||||
// Retrieve the actor data based on the actorId
|
||||
data.actor = await game.actors.get(data.actorId);
|
||||
if (!data.actor) {
|
||||
return await ui.notifications.warn("Vous n'avez pas de personnage attitré ou de token selectionné");
|
||||
|
||||
}
|
||||
console.log(data.actor)
|
||||
data.availableSpecialties = data.actor.items.filter(it => it.type == "specialty");
|
||||
console.log(data.availableSpecialties)
|
||||
@@ -177,13 +181,9 @@ export default class RollDialog extends Dialog {
|
||||
return html.querySelector('select#ability').options[html.querySelector('select#ability').selectedIndex].dataset.label
|
||||
}
|
||||
displaySpecialties() {
|
||||
console.log(this)
|
||||
let specialties = this.element[0].querySelectorAll('[data-spec-skill]');
|
||||
for (let specEl of specialties) {
|
||||
if (specEl.dataset.specSkill != this.getLabel()) {
|
||||
specEl.style.display = "none";
|
||||
specEl.querySelector('input').checked = null;
|
||||
} else { specEl.style.display = "inline" }
|
||||
specEl.style.display = "inline"
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -421,7 +421,6 @@ export class VermineCombatant extends Combatant {
|
||||
constructor(data, context) {
|
||||
super(data, context);
|
||||
this.setDefaultAttitude();
|
||||
console.log(this)
|
||||
|
||||
}
|
||||
setDefaultAttitude() {
|
||||
@@ -429,7 +428,6 @@ export class VermineCombatant extends Combatant {
|
||||
}
|
||||
_getInitiativeFormula() {
|
||||
|
||||
console.log(this);
|
||||
return String(CONFIG.Combat.initiative.formula || game.system.initiative);
|
||||
}
|
||||
|
||||
|
||||
+22
-13
@@ -34,19 +34,6 @@ Hooks.once('init', async function () {
|
||||
VermineCombat
|
||||
};
|
||||
|
||||
// Add custom constants for configuration.
|
||||
CONFIG.VERMINE = VERMINE;
|
||||
CONFIG.VERMINE.model = game.system.template;
|
||||
|
||||
/**
|
||||
* Set an initiative formula for the system
|
||||
* @type {String}
|
||||
*/
|
||||
CONFIG.Combat.initiative = {
|
||||
formula: "(@abilities.reflexes.value + @skills.alertness.value)d10cs>=@combatStatus.difficulty",
|
||||
decimals: 2
|
||||
};
|
||||
|
||||
// Define custom Document classes
|
||||
CONFIG.Actor.documentClass = VermineActor;
|
||||
CONFIG.Item.documentClass = VermineItem;
|
||||
@@ -84,8 +71,30 @@ Hooks.once('init', async function () {
|
||||
registerHooks(); // register Hooks
|
||||
registerSettings(); // register Vermine Settings
|
||||
|
||||
|
||||
//CONFIG AFTER INIT documentypes
|
||||
|
||||
// Add custom constants for configuration.
|
||||
CONFIG.VERMINE = VERMINE;
|
||||
CONFIG.VERMINE.model = {
|
||||
Actor: game.system.template.Actor,
|
||||
Item: game.system.template.Item
|
||||
}
|
||||
|
||||
/**
|
||||
* Set an initiative formula for the system
|
||||
* @type {String}
|
||||
*/
|
||||
CONFIG.Combat.initiative = {
|
||||
formula: "(@abilities.reflexes.value + @skills.alertness.value)d10cs>=@combatStatus.difficulty",
|
||||
decimals: 2
|
||||
};
|
||||
|
||||
|
||||
|
||||
//afficher le mode de jeu
|
||||
let mode = game.settings.get('vermine2047', 'game-mode');
|
||||
if (!mode) { mode = '1'; await game.settings.set('vermine2047', 'game-mode', '1') }
|
||||
let el = document.createElement('SPAN');
|
||||
switch (mode) {
|
||||
case '1':
|
||||
|
||||
Reference in New Issue
Block a user