12.0.7 - La propriété d'Astrobazzarh #709
| @@ -5,6 +5,8 @@ | ||||
|   - les effets draconiques d'un souffle/queue | ||||
|   - mise à jour des points de tâche des blessures lors des soins | ||||
| - pas d'expérience sur les particulières quand aucun MJ n'est connecté | ||||
| - Le drag&drop d'un acteur depuis la liste des acteurs sur la fiche | ||||
|   d'une entité incarnée permet d'accorder le personnage | ||||
|  | ||||
| ## 12.0.6 - Le bazar d'Astrobazzarh | ||||
| - Corrections de l'inventaire en bazar: | ||||
|   | ||||
| @@ -508,8 +508,8 @@ export class RdDBaseActorReve extends RdDBaseActor { | ||||
|  | ||||
|   isEntiteAccordee(attacker) { return true } | ||||
|  | ||||
|   async setEntiteReveAccordee(attacker) { | ||||
|     ui.notifications.error("Impossible de s'accorder à " + this.name + ": ce n'est pas une entite de cauchemer/rêve"); | ||||
|   async setEntiteReveAccordee(actor) { | ||||
|     ui.notifications.error("Impossible de s'accorder à " + this.name + ": ce n'est pas une entité incarnée"); | ||||
|   } | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -33,27 +33,4 @@ export class RdDCreature extends RdDBaseActorSang { | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   isEntiteAccordee(attacker) { | ||||
|     if (this.isEntite([ENTITE_INCARNE])) { | ||||
|       let resonnance = this.system.sante.resonnance | ||||
|       return (resonnance.actors.find(it => it == attacker.id)) | ||||
|     } | ||||
|     return true | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   async setEntiteReveAccordee(attacker) { | ||||
|     if (this.isEntite([ENTITE_INCARNE])) { | ||||
|       let resonnance = foundry.utils.duplicate(this.system.sante.resonnance); | ||||
|       if (resonnance.actors.find(it => it == attacker.id)) { | ||||
|         // déjà accordé | ||||
|         return; | ||||
|       } | ||||
|       await this.update({ "system.sante.resonnance": [...resonnance, attacker.id] }); | ||||
|     } | ||||
|     else { | ||||
|       super.setEntiteReveAccordee(attacker) | ||||
|     } | ||||
|   } | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -54,6 +54,12 @@ export class RdDActorEntiteSheet extends RdDBaseActorReveSheet { | ||||
|     }); | ||||
|   } | ||||
|  | ||||
|   async _onDropActor(event, dragData) { | ||||
|     const dropActor = fromUuidSync(dragData.uuid) | ||||
|     await this.actor.setEntiteReveAccordee(dropActor) | ||||
|     super._onDropActor(event, dragData) | ||||
|   } | ||||
|  | ||||
|   async deleteSubActeur(actorId) { | ||||
|     let newResonances = this.actor.system.sante.resonnance.actors.filter(id => id != actorId); | ||||
|     await this.actor.update({ 'system.sante.resonnance.actors': newResonances }, { renderSheet: false }); | ||||
|   | ||||
| @@ -91,20 +91,16 @@ export class RdDEntite extends RdDBaseActorReve { | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   async setEntiteReveAccordee(attacker) { | ||||
|   async setEntiteReveAccordee(actor) { | ||||
|     if (this.isEntite([ENTITE_INCARNE])) { | ||||
|       let resonnance = foundry.utils.duplicate(this.system.sante.resonnance); | ||||
|       if (resonnance.actors.find(it => it == attacker.id)) { | ||||
|       if (this.system.sante.resonnance.actors.find(it => it == actor.id)) { | ||||
|         // déjà accordé | ||||
|         return; | ||||
|         return | ||||
|       } | ||||
|       resonnance.actors.push(attacker.id); | ||||
|       await this.update({ "system.sante.resonnance": resonnance }); | ||||
|       await this.update({ "system.sante.resonnance.actors": [...this.system.sante.resonnance.actors, actor.id] }) | ||||
|     } | ||||
|     else { | ||||
|       super.setEntiteReveAccordee(attacker) | ||||
|       super.setEntiteReveAccordee(actor) | ||||
|     } | ||||
|   } | ||||
|  | ||||
|  | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user