Possessions dans HUD
Permettre de commencer les possessions V2
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
# 13.0
|
||||
|
||||
## 13.0.21 - La folie d'Illysis
|
||||
|
||||
- Fenêtre de jet v2
|
||||
- les possessions sont maintenant gérées avec les fenêtres V2
|
||||
- on peut choisir sa voie de draconic pour contrer une possession ou conjurer
|
||||
|
||||
## 13.0.20 - L'immobilisme d'Illysis
|
||||
|
||||
- Centrage du logo de pause
|
||||
|
||||
@@ -121,7 +121,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
getDraconicOuPossession() {
|
||||
return [
|
||||
...this.getDraconics(),
|
||||
...this.itemTypes[ITEM_TYPES.competencecreature].filter(it => it.system.ispossession || it.system.categorie == CATEGORIES_COMPETENCES_CREATURES.possession.key),
|
||||
...this.itemTypes[ITEM_TYPES.competencecreature].filter(it => it.isCompetencePossession()),
|
||||
this.getConjurationNaturelle()
|
||||
].sort(Misc.descending(it => it.system.niveau));
|
||||
}
|
||||
@@ -164,7 +164,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
return this.itemTypes[ITEM_TYPES.competencecreature]
|
||||
.filter(it => it.isAttaque())
|
||||
.map(it => it.attaqueCreature())
|
||||
.filter(it => it != undefined);
|
||||
.filter(it => it != undefined)
|
||||
}
|
||||
|
||||
async computeArmure(dmg) { return this.getProtectionNaturelle() }
|
||||
|
||||
@@ -220,6 +220,7 @@ export class RdDBaseActor extends Actor {
|
||||
isEntite() { return false }
|
||||
isEntiteIncarnee() { return false }
|
||||
isEntiteNonIncarnee() { return false }
|
||||
isEntiteBlurette() { return false }
|
||||
isHautRevant() { return false }
|
||||
isVehicule() { return false }
|
||||
isPersonnage() { return false }
|
||||
@@ -848,6 +849,7 @@ export class RdDBaseActor extends Actor {
|
||||
|
||||
listActionsPossessions() {
|
||||
return this.itemTypes[ITEM_TYPES.possession]
|
||||
.filter(it => !it.system.possede)
|
||||
.map(p => {
|
||||
return {
|
||||
label: p.name,
|
||||
@@ -856,9 +858,4 @@ export class RdDBaseActor extends Actor {
|
||||
}
|
||||
})
|
||||
}
|
||||
listActionsCombat() {
|
||||
const possessions = this.listActionsPossessions()
|
||||
return possessions.length > 0 ? possessions : this.listActions({})
|
||||
|
||||
}
|
||||
}
|
||||
@@ -19,8 +19,8 @@ export class RdDEntite extends RdDBaseActorReve {
|
||||
|
||||
isEntite() { return true }
|
||||
isEntiteNonIncarnee() { return this.system.definition.typeentite == ENTITE_NONINCARNE }
|
||||
isEntiteIncarnee() { return [ENTITE_INCARNE, ENTITE_BLURETTE].includes(this.system.definition.typeentite) }
|
||||
isEntiteBlurette() { return this.system.definition.typeentite !== ENTITE_BLURETTE }
|
||||
isEntiteIncarnee() { return !this.isEntiteNonIncarnee() }
|
||||
isEntiteBlurette() { return this.system.definition.typeentite == ENTITE_BLURETTE }
|
||||
|
||||
getReveActuel() {
|
||||
return Misc.toInt(this.system.carac.reve?.value)
|
||||
@@ -101,6 +101,15 @@ export class RdDEntite extends RdDBaseActorReve {
|
||||
return true
|
||||
}
|
||||
|
||||
listActionsPossessions() {
|
||||
if (this.isEntiteNonIncarnee()) {
|
||||
return this.itemTypes[ITEM_TYPES.competencecreature]
|
||||
.filter(it => it.system.ispossession)
|
||||
.map(it => it.attaqueCreature())
|
||||
.filter(it => it != undefined)
|
||||
}
|
||||
return super.listActionsPossessions()
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
async setEntiteReveAccordee(actor) {
|
||||
if (this.isEntiteIncarnee()) {
|
||||
|
||||
@@ -205,7 +205,7 @@ export class RdDItem extends Item {
|
||||
return this.isCompetence() && ['melee', 'tir', 'lancer'].includes(this.system.categorie)
|
||||
}
|
||||
|
||||
isCompetencePossession() { return ITEM_TYPES.competencecreature == this.type && this.system.categorie == "possession" }
|
||||
isCompetencePossession() { return ITEM_TYPES.competencecreature == this.type && this.system.categorie == CATEGORIES_COMPETENCES_CREATURES.possession.key }
|
||||
isTemporel() { return typesObjetsTemporels.includes(this.type) }
|
||||
isOeuvre() { return typesObjetsOeuvres.includes(this.type) }
|
||||
isDraconique() { return RdDItem.getItemTypesDraconiques().includes(this.type) }
|
||||
|
||||
@@ -34,7 +34,7 @@ export class RdDTokenHud {
|
||||
const actor = RdDCombatManager.getActorCombatant(combatant, { warning: false })
|
||||
if (actor) {
|
||||
if (OptionsAvancees.isUsing(ROLL_DIALOG_V2)) {
|
||||
await RdDTokenHud.addExtensionHudCombat(html, combatant, actor, token)
|
||||
await RdDTokenHud.addExtensionHudCombatV2(html, combatant, actor, token)
|
||||
}
|
||||
else {
|
||||
const actions = RdDCombatManager.listActionsActorCombatant(actor)
|
||||
@@ -47,17 +47,28 @@ export class RdDTokenHud {
|
||||
}
|
||||
}
|
||||
|
||||
static async addExtensionHudCombat(html, combatant, actor, token) {
|
||||
const actionsActor = actor.listActionsCombat();
|
||||
static async addExtensionHudCombatV2(html, combatant, actor, token) {
|
||||
const isPossession = actor.listActionsPossessions().length > 0;
|
||||
const actionsCombat = isPossession ? [] : actor.listAttaques()
|
||||
const ajustements = combatant?.initiative ?
|
||||
[
|
||||
{ label: 'Initiative +1', action: 'delta', value: 1 },
|
||||
{ label: 'Initiative -1', action: 'delta', value: -1 }
|
||||
] : []
|
||||
const autres = [{ label: "Autre action", action: 'autre' }]
|
||||
const actions = Misc.indexed(actionsActor.concat(ajustements).concat(autres))
|
||||
const actions = Misc.indexed([
|
||||
...actionsCombat,
|
||||
...ajustements,
|
||||
...autres
|
||||
])
|
||||
|
||||
const hudData = { combatant, token, actions };
|
||||
const hudData = {
|
||||
combatant,
|
||||
token,
|
||||
isPossession,
|
||||
isEntiteNonIncarnee: actor.isEntiteNonIncarnee(),
|
||||
actions,
|
||||
};
|
||||
const hud = $(await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/hud-actor-combat.hbs', hudData))
|
||||
$(html).find('div.col.left').append(hud)
|
||||
|
||||
@@ -84,6 +95,7 @@ export class RdDTokenHud {
|
||||
}
|
||||
})
|
||||
list.find('.rdd-attaque-v2').click(event => combatant.actor.rollAttaque(token))
|
||||
list.find('.rdd-possession-v2').click(event => combatant.actor.rollPossession())
|
||||
}
|
||||
|
||||
static async addExtensionHudInit(html, combatant, actions) {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
{{log this}}
|
||||
<div class="control-icon rdd-combat ">
|
||||
<img class="rdd-hud-togglebutton"
|
||||
src="systems/foundryvtt-reve-de-dragon/icons/heures/hd06.svg" width="36" height="36"
|
||||
@@ -7,7 +6,6 @@
|
||||
<div class="control-icon token-hud-icon select-init-v2">
|
||||
<i class="fa-solid fa-dice-d6"></i>
|
||||
<select name="initiative">
|
||||
{{log combatant}}
|
||||
<option value="">{{#if combatant.system.init}}
|
||||
{{combatant.system.init.value}} {{combatant.system.init.label}}
|
||||
{{else}}Initiative...{{/if}}
|
||||
@@ -15,20 +13,19 @@
|
||||
{{selectOptions actions selected='' valueAttr='index' labelAttr='label'}}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
{{!-- <div class="control-icon token-hud-icon rdd-init-v2"
|
||||
data-combatant-id="{{../combatant.id}}"
|
||||
data-action="initiative"
|
||||
data-tooltip="Choisir l'initiative">
|
||||
<label><i class="fa-solid fa-dice-d6"></i><span> Initiative</span></label>
|
||||
</div> --}}
|
||||
|
||||
{{#if isPossession}}
|
||||
<div class="control-icon token-hud-icon rdd-possession-v2"
|
||||
data-action="possession"
|
||||
data-tooltip="{{#if isEntiteNonIncarnee}}Possession{{else}}Conjuration{{/if}}">
|
||||
<label><i class="fa-solid fa-sword"></i> {{#if isEntiteNonIncarnee}}Posséder{{else}}Conjurer{{/if}}</label>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="control-icon token-hud-icon rdd-attaque-v2"
|
||||
data-combatant-id="{{../combatant.id}}"
|
||||
data-action="attaque"
|
||||
data-tooltip="Attaquer la cible">
|
||||
<label><i class="fa-solid fa-sword"></i> Attaquer</label>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user