#131 Commande astro ajoutée
This commit is contained in:
		| @@ -84,6 +84,11 @@ export class RdDCalendrier extends Application { | ||||
|     return day+" "+heuresList[month]; | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   getCurrentHeure() { | ||||
|     return heuresList[this.calendrier.heureRdD]; | ||||
|   } | ||||
|  | ||||
|   /* -------------------------------------------- */ | ||||
|   getCurrentDayIndex( ) { | ||||
|     return (this.calendrier.moisRdD * 28) + this.calendrier.jour; | ||||
| @@ -283,7 +288,7 @@ export class RdDCalendrier extends Application { | ||||
|       } | ||||
|     } | ||||
|     else { | ||||
|       ui.notifications.warn(this.data.name + " n'a pas d'heure de naissance, ou elle est incorrecte"); | ||||
|       ui.notifications.warn(name + " n'a pas d'heure de naissance, ou elle est incorrecte : " + heureNaissance); | ||||
|     } | ||||
|     return 0; | ||||
|   } | ||||
|   | ||||
| @@ -53,6 +53,12 @@ export class RdDCommands { | ||||
|       <br><strong>/payer 10d</strong> permet d'envoyer un message pour payer 10 deniers | ||||
|       ` | ||||
|       }); | ||||
|       rddCommands.registerCommand({ | ||||
|         path: ["/astro"], func: (content, msg, params) => RdDUtility.afficherHeuresChanceMalchance(params[0]), | ||||
|         descr: `Affiche les heures de chance et de malchance selon l'heure de naissance donnée en argument. Exemples: | ||||
|       <br><strong>/astro Lyre</strong>  | ||||
|       ` | ||||
|       }); | ||||
|       game.system.rdd.commands = rddCommands; | ||||
|     } | ||||
|   } | ||||
|   | ||||
| @@ -867,8 +867,8 @@ export class RdDUtility { | ||||
|       d.render(true); | ||||
|     } | ||||
|      | ||||
|     /* -------------------------------------------- */ | ||||
|     static async confirmerSuppression(actorSheet, li) { | ||||
|   /* -------------------------------------------- */ | ||||
|   static async confirmerSuppression(actorSheet, li) { | ||||
|       let itemId = li.data("item-id"); | ||||
|       let objet  = actorSheet.actor.items.find( item => item._id == itemId ); | ||||
|       let msgTxt = "<p>Etes vous certain de vouloir supprimer cet objet ?"; | ||||
| @@ -906,6 +906,15 @@ export class RdDUtility { | ||||
|         default: "cancel" | ||||
|       }); | ||||
|       d.render(true); | ||||
|     } | ||||
|   } | ||||
|    | ||||
|   /* -------------------------------------------- */ | ||||
|   static afficherHeuresChanceMalchance( heureNaissance ) { | ||||
|     let ajustement = game.system.rdd.calendrier.getAjustementAstrologique(heureNaissance.toLowerCase()); | ||||
|     ChatMessage.create( {  | ||||
|       content: `Pour l'heure ${game.system.rdd.calendrier.getCurrentHeure()}, le modificateur de Chance/Malchance est de : ${ajustement}.`,  | ||||
|       whisper: ChatMessage.getWhisperRecipients("MJ") | ||||
|       } );      | ||||
|   } | ||||
|  | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user