ENH: Movement rates order, and speed rolls
							parent
							
								
									c94807c9ae
								
							
						
					
					
						commit
						cb583d9154
					
				|  | @ -114,7 +114,7 @@ export class OseActorSheet extends ActorSheet { | |||
|     html.find(".item-image").click(async (ev) => { | ||||
|       const li = $(ev.currentTarget).parents(".item"); | ||||
|       const item = this.actor.getOwnedItem(li.data("itemId")); | ||||
|       item.roll(); | ||||
|       item.roll({skipDialog: event.ctrlKey}); | ||||
|     }); | ||||
| 
 | ||||
| 
 | ||||
|  |  | |||
|  | @ -49,15 +49,14 @@ export class OseItem extends Item { | |||
|     return data; | ||||
|   } | ||||
| 
 | ||||
|   rollWeapon() { | ||||
|     console.log(this); | ||||
|   rollWeapon(skipDialog) { | ||||
|     let isNPC = this.actor.data.type != 'character'; | ||||
|     if (this.data.data.missile && !isNPC) { | ||||
|       this.actor.rollAttack({type: 'missile', label: this.name, dmg: this.data.data.damage}); | ||||
|       this.actor.rollAttack({type: 'missile', label: this.name, dmg: this.data.data.damage}, {event: {ctrlKey: skipDialog}}); | ||||
|     } else if (this.data.data.melee && !isNPC) { | ||||
|       this.actor.rollAttack({type: 'melee', label: this.name, dmg: this.data.data.damage}); | ||||
|       this.actor.rollAttack({type: 'melee', label: this.name, dmg: this.data.data.damage}, {event: {ctrlKey: skipDialog}}); | ||||
|     } else { | ||||
|       this.actor.rollAttack({type: 'raw', label: this.name, dmg: this.data.data.damage}); | ||||
|       this.actor.rollAttack({type: 'raw', label: this.name, dmg: this.data.data.damage}, {event: {ctrlKey: skipDialog}}); | ||||
|     } | ||||
|     return true; | ||||
|   } | ||||
|  | @ -96,9 +95,9 @@ export class OseItem extends Item { | |||
|    * Roll the item to Chat, creating a chat card which contains follow up attack or damage roll options | ||||
|    * @return {Promise} | ||||
|    */ | ||||
|   async roll({ configureDialog = true } = {}) { | ||||
|   async roll({ skipDialog = false } = {}) { | ||||
|     if (this.data.type == 'weapon') { | ||||
|       if (this.rollWeapon()) return; | ||||
|       if (this.rollWeapon(skipDialog)) return; | ||||
|     } | ||||
|     // Basic template rendering data
 | ||||
|     const token = this.actor.token; | ||||
|  |  | |||
|  | @ -211,11 +211,11 @@ | |||
|         <div class="flexrow"> | ||||
|             <ul class="attributes flexrow"> | ||||
|                 <li class="attribute attribute-secondaries"> | ||||
|                     <h4 class="attribute-name box-title" title="{{localize 'OSE.MovementEncounter'}}"> | ||||
|                         {{localize 'OSE.MovementEncounterShort'}}</h4> | ||||
|                     <h4 class="attribute-name box-title" title="{{localize 'OSE.MovementOverland'}}"> | ||||
|                         {{localize 'OSE.MovementOverlandShort'}}</h4> | ||||
|                     <div class="flexrow"> | ||||
|                         <div class="attribute-value"> | ||||
|                             {{divide data.movement.base 3}} | ||||
|                             {{divide data.movement.base 5}} | ||||
|                         </div> | ||||
|                     </div> | ||||
|                 </li> | ||||
|  | @ -228,11 +228,11 @@ | |||
|                     </div> | ||||
|                 </li> | ||||
|                 <li class="attribute attribute-secondaries"> | ||||
|                     <h4 class="attribute-name box-title" title="{{localize 'OSE.MovementOverland'}}"> | ||||
|                         {{localize 'OSE.MovementOverlandShort'}}</h4> | ||||
|                     <h4 class="attribute-name box-title" title="{{localize 'OSE.MovementEncounter'}}"> | ||||
|                         {{localize 'OSE.MovementEncounterShort'}}</h4> | ||||
|                     <div class="flexrow"> | ||||
|                         <div class="attribute-value"> | ||||
|                             {{divide data.movement.base 5}} | ||||
|                             {{divide data.movement.base 3}} | ||||
|                         </div> | ||||
|                     </div> | ||||
|                 </li> | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue