13.0.39 - La défense d'Illisys #806
@@ -216,7 +216,7 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
||||
|
||||
// Points de reve actuel
|
||||
this.html.find('.roll-reve-actuel').click(async event => await this.actor.rollReveActuel({ resistance: false }))
|
||||
this.html.find('.button-reve-resistance').click(async event => await this.actor.rollReveActuel({ diff: -8, resistance: true }))
|
||||
this.html.find('.button-reve-resistance').click(async event => await this.actor.rollReveResistance())
|
||||
this.html.find('.action-empoignade').click(async event => await RdDEmpoignade.onAttaqueEmpoignadeFromItem(RdDSheetUtility.getItem(event, this.actor)))
|
||||
|
||||
this.html.find('.roll-arme').click(async event => {
|
||||
|
||||
@@ -26,7 +26,7 @@ import { BASE_CORPS_A_CORPS, BASE_ESQUIVE, CATEGORIES_COMPETENCES_CREATURES } fr
|
||||
import { RollDataAjustements } from "../rolldata-ajustements-v1.js";
|
||||
import { MappingCreatureArme } from "../item/mapping-creature-arme.mjs";
|
||||
import RollDialog from "../roll/roll-dialog.mjs";
|
||||
import { DEFAULT_ROLL_TYPES, DIFF, ROLL_TYPE_ATTAQUE, ROLL_TYPE_COMP } from "../roll/roll-constants.mjs";
|
||||
import { DEFAULT_ROLL_TYPES, DIFF, ROLL_TYPE_ATTAQUE, ROLL_TYPE_COMP, ROLL_TYPE_REVE_RESISTANCE } from "../roll/roll-constants.mjs";
|
||||
import { OptionsAvancees, ROLL_DIALOG_V2 } from "../settings/options-avancees.js";
|
||||
import { RdDInitiative } from "../initiative.mjs";
|
||||
import { RdDItemCompetenceCreature } from "../item-competencecreature.js";
|
||||
@@ -411,13 +411,33 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
})
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
async rollReveResistance(diff = -8) {
|
||||
return await RollDialog.create(
|
||||
{
|
||||
ids: { actorId: this.id },
|
||||
type: {
|
||||
allowed: [ROLL_TYPE_REVE_RESISTANCE],
|
||||
current: ROLL_TYPE_REVE_RESISTANCE,
|
||||
resistance: true
|
||||
},
|
||||
selected: {
|
||||
carac: { key: CARACS.REVE_ACTUEL, forced: true },
|
||||
comp: { key: undefined, forced: true },
|
||||
diff: { type: DIFF.DEFAUT, value: diff }
|
||||
}
|
||||
},
|
||||
{
|
||||
onRollDone: (dialog, roll) => RollDialog.onRollDoneClose(dialog, roll)
|
||||
})
|
||||
}
|
||||
|
||||
async rollReveActuel({ diff = 0, resistance = false }) {
|
||||
if (OptionsAvancees.isUsing(ROLL_DIALOG_V2)) {
|
||||
const rollData = {
|
||||
ids: { actorId: this.id },
|
||||
type: {
|
||||
allowed: [ROLL_TYPE_COMP],
|
||||
current: ROLL_TYPE_COMP,
|
||||
allowed: [ROLL_TYPE_REVE_RESISTANCE],
|
||||
current: ROLL_TYPE_REVE_RESISTANCE,
|
||||
resistance: resistance
|
||||
},
|
||||
selected: {
|
||||
|
||||
@@ -10,6 +10,7 @@ export const ROLL_TYPE_OEUVRE = 'oeuvre'
|
||||
export const ROLL_TYPE_SORT = 'sort'
|
||||
export const ROLL_TYPE_TACHE = 'tache'
|
||||
export const ROLL_TYPE_APPEL_CHANCE = 'appel-chance'
|
||||
export const ROLL_TYPE_REVE_RESISTANCE = 'reve-resistance'
|
||||
|
||||
export const ATTAQUE_ROLL_TYPES = [ROLL_TYPE_ATTAQUE]
|
||||
export const COMBAT_ROLL_TYPES = [ROLL_TYPE_ATTAQUE, ROLL_TYPE_DEFENSE]
|
||||
|
||||
@@ -51,6 +51,7 @@ import { RollTypePossession } from "./roll-type-possession.mjs";
|
||||
import { RollPartPossession } from "./roll-part-possession.mjs";
|
||||
import { RollPartApprecier } from "./roll-part-apprecier.mjs";
|
||||
import { RollTypeAppelChance } from "./roll-type-appel-chance.mjs";
|
||||
import { RollTypeReveResistance } from "./roll-type-resistance.mjs";
|
||||
|
||||
|
||||
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api
|
||||
@@ -67,7 +68,7 @@ export const ALL_ROLL_TYPES = [
|
||||
new RollTypeOeuvre(),
|
||||
new RollTypeJeu(),
|
||||
new RollTypeAppelChance(),
|
||||
// new RollTypeResistance ??
|
||||
new RollTypeReveResistance(),
|
||||
// new RollTypeFixedCarac ??
|
||||
]
|
||||
|
||||
|
||||
@@ -2,19 +2,6 @@ import { CARACS } from "../rdd-carac.js"
|
||||
import { DIFF, ROLL_TYPE_APPEL_CHANCE } from "./roll-constants.mjs"
|
||||
import { RollType } from "./roll-type.mjs"
|
||||
|
||||
const SPECIAL_ROLL_TYPES_DETAILS = {
|
||||
label: "fait appel à la chance",
|
||||
icon: `systems/foundryvtt-reve-de-dragon/assets/ui/chance.svg`,
|
||||
rollData: {
|
||||
selected: {
|
||||
carac: { key: CARACS.CHANCE_ACTUELLE, forced: true },
|
||||
diff: { value: 0, type: '' },
|
||||
comp: { key: '', forced: true },
|
||||
conditions: { hide: true }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class RollTypeAppelChance extends RollType {
|
||||
get code() { return ROLL_TYPE_APPEL_CHANCE }
|
||||
get name() { return `fait appel à la chance` }
|
||||
|
||||
31
module/roll/roll-type-resistance.mjs
Normal file
31
module/roll/roll-type-resistance.mjs
Normal file
@@ -0,0 +1,31 @@
|
||||
import { CARACS } from "../rdd-carac.js"
|
||||
import { DIFF, ROLL_TYPE_REVE_RESISTANCE } from "./roll-constants.mjs"
|
||||
import { RollType } from "./roll-type.mjs"
|
||||
|
||||
export class RollTypeReveResistance extends RollType {
|
||||
get code() { return ROLL_TYPE_REVE_RESISTANCE }
|
||||
get name() { return `fait un jet de résistance` }
|
||||
get icon() { return `systems/foundryvtt-reve-de-dragon/assets/ui/resistance.svg` }
|
||||
get chatResultTemplate() { return `systems/foundryvtt-reve-de-dragon/templates/roll/result/chat-reve-resistance.hbs` }
|
||||
|
||||
title(rollData) {
|
||||
return this.name
|
||||
}
|
||||
|
||||
setRollDataType(rollData) {
|
||||
foundry.utils.mergeObject(rollData, {
|
||||
selected: {
|
||||
carac: { key: CARACS.REVE_ACTUEL, forced: true },
|
||||
diff: { value: -8, type: '' },
|
||||
comp: { key: '', forced: true },
|
||||
conditions: { hide: true }
|
||||
}
|
||||
})
|
||||
super.setRollDataType(rollData)
|
||||
}
|
||||
|
||||
onSelect(rollData) {
|
||||
this.setDiffType(rollData, DIFF.DEFAUT)
|
||||
}
|
||||
|
||||
}
|
||||
24
templates/roll/result/chat-reve-resistance.hbs
Normal file
24
templates/roll/result/chat-reve-resistance.hbs
Normal file
@@ -0,0 +1,24 @@
|
||||
<div class="roll-chat">
|
||||
<div class="chat-img">
|
||||
<img src="{{active.img}}" data-tooltip="{{active.name}}" />
|
||||
<img src="{{current.comp.comp.img}}" data-tooltip="{{current.comp.label}}" />
|
||||
</div>
|
||||
<div class="chat-header">
|
||||
{{active.name}} fait un jet de résistance
|
||||
</div>
|
||||
|
||||
<div class="chat-resume">
|
||||
{{> 'partial-infojet'}}
|
||||
</div>
|
||||
|
||||
<div class="chat-details">
|
||||
<img class="chat-icon" src="systems/foundryvtt-reve-de-dragon/assets/ui/resistance.svg" />
|
||||
<span class="rdd-roll-{{rolled.code}} strong-text">
|
||||
{{#if rolled.isSuccess}}
|
||||
Jet de résistance réussi
|
||||
{{else}}
|
||||
Jet de résistance manqué
|
||||
{{/if}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user