Message sur D20 impair dans le tchat et corrections diverses
All checks were successful
Release Creation / build (release) Successful in 44s
All checks were successful
Release Creation / build (release) Successful in 44s
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
.history/
|
||||
node_modules
|
||||
.github/
|
||||
|
||||
@@ -148,6 +148,21 @@
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.dice-value.d20-impair {
|
||||
text-decoration: line-through;
|
||||
color: #c46b4e;
|
||||
text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
|
||||
}
|
||||
|
||||
.dice-odd-label {
|
||||
font-size: 0.7rem;
|
||||
color: #c46b4e;
|
||||
font-weight: bold;
|
||||
text-transform: uppercase;
|
||||
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
|
||||
line-height: 1.1;
|
||||
}
|
||||
|
||||
.total-label,
|
||||
.difficulty-label {
|
||||
font-size: 0.75rem;
|
||||
|
||||
@@ -220,14 +220,8 @@ export class WastelandActor extends Actor {
|
||||
prepareDerivedData() {
|
||||
|
||||
if (this.type == 'personnage') {
|
||||
let newSante = this.system.sante.bonus + (this.system.attributs.pui.value + this.system.attributs.tre.value) * 2 + 5
|
||||
if (this.system.sante.base != newSante) {
|
||||
this.update({ 'system.sante.base': newSante })
|
||||
}
|
||||
let newPsyche = ((this.system.attributs.cla.value + this.system.attributs.tre.value) * 2) + 5
|
||||
if (this.system.psyche.fullmax != newPsyche) {
|
||||
this.update({ 'system.psyche.fullmax': newPsyche })
|
||||
}
|
||||
this.system.sante.base = this.system.sante.bonus + (this.system.attributs.pui.value + this.system.attributs.tre.value) * 2 + 5
|
||||
this.system.psyche.fullmax = ((this.system.attributs.cla.value + this.system.attributs.tre.value) * 2) + 5
|
||||
}
|
||||
|
||||
super.prepareDerivedData()
|
||||
|
||||
@@ -89,7 +89,7 @@ export class WastelandCommands {
|
||||
if (command && command.func) {
|
||||
const result = command.func(content, msg, params);
|
||||
if (result == false) {
|
||||
RdDCommands._chatAnswer(msg, command.descr);
|
||||
WastelandCommands._chatAnswer(msg, command.descr);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -180,14 +180,14 @@ Hooks.once("ready", function () {
|
||||
ui.notifications.info("Attention ! Aucun personnage n'est relié au joueur !");
|
||||
ChatMessage.create({
|
||||
content: "<b>ATTENTION</b> Le joueur " + game.user.name + " n'est relié à aucun personnage !",
|
||||
user: game.user._id
|
||||
user: game.user.id
|
||||
});
|
||||
}
|
||||
if (!game.user.isGM && game.user.character && !game.user.character.prototypeToken.actorLink) {
|
||||
ui.notifications.info("Le token de du joueur n'est pas connecté à l'acteur !");
|
||||
ChatMessage.create({
|
||||
content: "<b>ATTENTION</b> Le token du joueur " + game.user.name + " n'est pas connecté à l'acteur !",
|
||||
user: game.user._id
|
||||
user: game.user.id
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -358,6 +358,7 @@ export class WastelandUtility {
|
||||
//console.log("PAIR/IMP", diceValue)
|
||||
if (diceValue % 2 == 1) {
|
||||
//console.log("PAIR/IMP2", diceValue)
|
||||
rollData.d20IsOdd = true
|
||||
rollData.finalResult -= rollData.roll.terms[0].results[0].result // Substract value
|
||||
if (diceValue == 1 || diceValue == 11) {
|
||||
rollData.isDramatique = true
|
||||
@@ -616,7 +617,7 @@ export class WastelandUtility {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static getUsers(filter) {
|
||||
return game.users.filter(filter).map(user => user.data._id);
|
||||
return game.users.filter(filter).map(user => user.id);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@@ -891,7 +892,7 @@ export class WastelandUtility {
|
||||
let message = game.messages.get($(li).attr("data-message-id"))
|
||||
let rollData = message.getFlag("world", "wasteland-roll")
|
||||
if (rollData.competence) {
|
||||
let nbPred = rollData.competence.data.predilections.filter(pred => !pred.used).length
|
||||
let nbPred = rollData.competence.system.predilections.filter(pred => !pred.used).length
|
||||
return (!rollData.isReroll && rollData.competence && nbPred > 0)
|
||||
}
|
||||
return false
|
||||
@@ -900,7 +901,7 @@ export class WastelandUtility {
|
||||
let message = game.messages.get($(li).attr("data-message-id"))
|
||||
let rollData = message.getFlag("world", "wasteland-roll")
|
||||
if (rollData.competence) {
|
||||
return rollData.competence.data.doublebonus
|
||||
return rollData.competence.system.doublebonus
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -3160,6 +3160,23 @@ li {
|
||||
font-weight: bold;
|
||||
line-height: 1.2;
|
||||
}
|
||||
.wasteland-chat-result .result-main .result-display .dice-result .dice-value.d20-impair,
|
||||
.wasteland-chat-result .result-main .result-display .total-result .dice-value.d20-impair,
|
||||
.wasteland-chat-result .result-main .result-display .difficulty .dice-value.d20-impair {
|
||||
text-decoration: line-through;
|
||||
color: #c46b4e;
|
||||
text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
|
||||
}
|
||||
.wasteland-chat-result .result-main .result-display .dice-result .dice-odd-label,
|
||||
.wasteland-chat-result .result-main .result-display .total-result .dice-odd-label,
|
||||
.wasteland-chat-result .result-main .result-display .difficulty .dice-odd-label {
|
||||
font-size: 0.7rem;
|
||||
color: #c46b4e;
|
||||
font-weight: bold;
|
||||
text-transform: uppercase;
|
||||
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
|
||||
line-height: 1.1;
|
||||
}
|
||||
.wasteland-chat-result .result-main .result-display .dice-result .total-label,
|
||||
.wasteland-chat-result .result-main .result-display .total-result .total-label,
|
||||
.wasteland-chat-result .result-main .result-display .difficulty .total-label,
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -62,7 +62,10 @@
|
||||
<div class="result-display">
|
||||
<div class="dice-result">
|
||||
<i class="fas fa-dice"></i>
|
||||
<span class="dice-value">{{diceResult}}</span>
|
||||
<span class="dice-value {{#if d20IsOdd}}d20-impair{{/if}}">{{diceResult}}</span>
|
||||
{{#if d20IsOdd}}
|
||||
<span class="dice-odd-label">impair → 0</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="total-result">
|
||||
<span class="total-label">Total</span>
|
||||
@@ -108,6 +111,13 @@
|
||||
<span class="detail-value">{{diceFormula}}</span>
|
||||
</div>
|
||||
|
||||
{{#if d20IsOdd}}
|
||||
<div class="detail-row malus">
|
||||
<span class="detail-label">D20 impair :</span>
|
||||
<span class="detail-value">compte pour 0</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<div class="detail-row">
|
||||
<span class="detail-label">{{attr.label}}:</span>
|
||||
<span class="detail-value">{{attr.value}}</span>
|
||||
|
||||
Reference in New Issue
Block a user