ENH: retainers and items
							parent
							
								
									816c4d4a36
								
							
						
					
					
						commit
						0be4556bfe
					
				|  | @ -7,7 +7,7 @@ | |||
| 
 | ||||
|     "OSE.Formula": "Formula", | ||||
|     "OSE.SitMod": "Situational Modifier", | ||||
|     "OSE.RollMod": "Roll Mode", | ||||
|     "OSE.RollMode": "Roll Mode", | ||||
|     "OSE.RollExample": "Roll Example", | ||||
| 
 | ||||
|     "OSE.Name": "Name", | ||||
|  | @ -19,8 +19,13 @@ | |||
|     "OSE.Treasure": "Treasure type", | ||||
|     "OSE.Size": "Size", | ||||
|     "OSE.Morale": "Morale", | ||||
|     "OSE.Retainer": "Retainer", | ||||
|     "OSE.Appearing": "NA", | ||||
| 
 | ||||
|     "OSE.Loyalty": "Loyalty Rating", | ||||
|     "OSE.LoyaltyShort": "LR", | ||||
|      | ||||
|     "OSE.AbilityCheck": "Ability Check", | ||||
|     "OSE.scores.str.long": "Strength", | ||||
|     "OSE.scores.str.short": "STR", | ||||
|     "OSE.scores.wis.long": "Wisdom", | ||||
|  | @ -52,7 +57,6 @@ | |||
|     "OSE.HitDiceShort": "HD", | ||||
|     "OSE.Movement": "Movement", | ||||
|     "OSE.MovementShort": "MOV", | ||||
|     "OSE.SpecialMovement": "Special Movement", | ||||
|     "OSE.ArmorClass": "Armor Class", | ||||
|     "OSE.ArmorClassShort": "AC", | ||||
|     "OSE.SpellDC": "DC", | ||||
|  |  | |||
|  | @ -44,7 +44,6 @@ | |||
|     "OSE.HitDiceShort": "DV", | ||||
|     "OSE.Movement": "Mouvement", | ||||
|     "OSE.MovementShort": "MOUV", | ||||
|     "OSE.SpecialMovement": "Mouvement Spécial", | ||||
|     "OSE.ArmorClass": "Classe d'Armure", | ||||
|     "OSE.ArmorClassShort": "CA", | ||||
|     "OSE.SpellDC": "DF", | ||||
|  |  | |||
|  | @ -133,6 +133,14 @@ export class OseActorSheetCharacter extends OseActorSheet { | |||
|     // Item summaries
 | ||||
|     html.find('.item .item-name h4').click(event => this._onItemSummary(event)); | ||||
| 
 | ||||
|      | ||||
|     html.find('.ability-score .attribute-name a').click(ev => { | ||||
|       let actorObject = this.actor; | ||||
|       let element = event.currentTarget; | ||||
|       let score = element.parentElement.parentElement.dataset.score; | ||||
|       actorObject.rollCheck(score, { event: event }); | ||||
|     }) | ||||
| 
 | ||||
|     // Handle default listeners last so system listeners are triggered first
 | ||||
|     super.activateListeners(html); | ||||
|   } | ||||
|  |  | |||
|  | @ -26,4 +26,19 @@ export class OseActor extends Actor { | |||
|       title: `${label} ${game.i18n.localize('OSE.SavingThrow')}`, | ||||
|     }); | ||||
|   } | ||||
| 
 | ||||
|   rollCheck(score, options = {}) { | ||||
|     const label = game.i18n.localize(`OSE.scores.${score}.long`); | ||||
|     const rollParts = ['1d20']; | ||||
| 
 | ||||
|     // Roll and return
 | ||||
|     return OseDice.Roll({ | ||||
|       event: options.event, | ||||
|       parts: rollParts, | ||||
|       data: this.data, | ||||
|       speaker: ChatMessage.getSpeaker({ actor: this }), | ||||
|       flavor: `${label} ${game.i18n.localize('OSE.AbilityCheck')}`, | ||||
|       title: `${label} ${game.i18n.localize('OSE.AbilityCheck')}`, | ||||
|     }); | ||||
|   } | ||||
| } | ||||
|  |  | |||
|  | @ -2,6 +2,36 @@ | |||
|   "Actor": { | ||||
|     "types": ["character", "monster"], | ||||
|     "templates": { | ||||
|       "common": { | ||||
|         "retainer": { | ||||
|           "enabled": false, | ||||
|           "loyalty": 0 | ||||
|         }, | ||||
|         "hp": { | ||||
|           "hd": "", | ||||
|           "value": 20, | ||||
|           "max": 20 | ||||
|         }, | ||||
|         "ac": { | ||||
|           "value": 0, | ||||
|           "mod": 0 | ||||
|         }, | ||||
|         "thac0": { | ||||
|           "value": 19, | ||||
|           "mod": 0 | ||||
|         }, | ||||
|         "saves": { | ||||
|           "death": 10, | ||||
|           "wand": 10, | ||||
|           "paralysis": 10, | ||||
|           "breath": 10, | ||||
|           "spell": 10 | ||||
|         }, | ||||
|         "movement": { | ||||
|           "base": 0, | ||||
|           "encounter": 0 | ||||
|         }  | ||||
|       }, | ||||
|       "spellcaster": { | ||||
|         "spells": { | ||||
|           "enabled": false, | ||||
|  | @ -34,7 +64,7 @@ | |||
|       } | ||||
|     }, | ||||
|     "character": { | ||||
|       "templates": ["spellcaster"], | ||||
|       "templates": ["common", "spellcaster"], | ||||
|       "details": { | ||||
|         "biography": "", | ||||
|         "class": "", | ||||
|  | @ -76,32 +106,6 @@ | |||
|         "silver": 0, | ||||
|         "copper": 0 | ||||
|       }, | ||||
|       "hp": { | ||||
|         "hd": "", | ||||
|         "value": 20, | ||||
|         "max": 20 | ||||
|       }, | ||||
|       "ac": { | ||||
|         "value": 0, | ||||
|         "mod": 0 | ||||
|       }, | ||||
|       "thac0": { | ||||
|         "value": 19, | ||||
|         "mod": 0, | ||||
|         "missile": 0, | ||||
|         "melee": 0 | ||||
|       }, | ||||
|       "saves": { | ||||
|         "D": 10, | ||||
|         "W": 10, | ||||
|         "P": 10, | ||||
|         "B": 10, | ||||
|         "S": 10 | ||||
|       }, | ||||
|       "movement": { | ||||
|         "base": 0, | ||||
|         "encounter": 0 | ||||
|       }, | ||||
|       "initative": { | ||||
|         "value": 0, | ||||
|         "mod": 0 | ||||
|  | @ -109,7 +113,7 @@ | |||
|       "languages": [] | ||||
|     }, | ||||
|     "monster": { | ||||
|       "templates": ["spellcaster"], | ||||
|       "templates": ["common", "spellcaster"], | ||||
|       "details": { | ||||
|         "biography": "", | ||||
|         "alignment": "", | ||||
|  | @ -119,45 +123,44 @@ | |||
|         "appearing": "", | ||||
|         "morale": 0 | ||||
|       }, | ||||
|       "saves": { | ||||
|         "death": 10, | ||||
|         "wand": 10, | ||||
|         "paralysis": 10, | ||||
|         "breath": 10, | ||||
|         "spell": 10 | ||||
|       }, | ||||
|       "thac0": { | ||||
|         "value": 19, | ||||
|         "mod": 0 | ||||
|       }, | ||||
|       "hp": { | ||||
|         "hd": "", | ||||
|         "max": 0, | ||||
|         "value": 0 | ||||
|       }, | ||||
|       "ac": { | ||||
|         "value": 0, | ||||
|         "mod": 0 | ||||
|       }, | ||||
|       "attacks": { | ||||
|         "value": 1 | ||||
|       }, | ||||
|       "movement": { | ||||
|         "base": 0, | ||||
|         "encounter": 0 | ||||
|       } | ||||
|     } | ||||
|   }, | ||||
|   "Item": { | ||||
|     "types": ["item", "spell", "ability"], | ||||
|     "types": ["item", "weapon", "armor", "spell", "ability"], | ||||
|     "item": { | ||||
|       "description": "", | ||||
|       "quantity": 1, | ||||
|       "quantity": { | ||||
|         "value": 1, | ||||
|         "max": 0 | ||||
|       }, | ||||
|       "cost": 0, | ||||
|       "weight": 0 | ||||
|     }, | ||||
|     "weapon": { | ||||
|       "description": "", | ||||
|       "damage": "1d6", | ||||
|       "qualities": "", | ||||
|       "slow": false, | ||||
|       "melee": true, | ||||
|       "ranged": true, | ||||
|       "cost": 0, | ||||
|       "weight": 0 | ||||
|     }, | ||||
|     "armor": { | ||||
|       "description": "", | ||||
|       "ac": 9, | ||||
|       "aac": 10, | ||||
|       "cost": 0, | ||||
|       "weight": 0 | ||||
|     }, | ||||
|     "spell": { | ||||
|       "lvl": 1, | ||||
|       "class": "", | ||||
|       "class": "Magic-User", | ||||
|       "duration": "", | ||||
|       "range": "", | ||||
|       "description": "" | ||||
|     }, | ||||
|     "ability": { | ||||
|  |  | |||
|  | @ -11,6 +11,18 @@ | |||
|         /> | ||||
|       </div> | ||||
|     </div> | ||||
|     <div class="form-group"> | ||||
|       <label for="retainer">{{localize "OSE.Retainer"}}</label> | ||||
|       <div class="form-fields"> | ||||
|         <input | ||||
|           type="checkbox" | ||||
|           name="data.retainer.enabled" | ||||
|           id="retainer" | ||||
|           {{checked | ||||
|           data.retainer.enabled}} | ||||
|         /> | ||||
|       </div> | ||||
|     </div> | ||||
|     <footer class="sheet-footer"> | ||||
|       <button type="submit"> | ||||
|         <i class="fas fa-save"></i>{{localize "Save Changes"}} | ||||
|  |  | |||
|  | @ -23,20 +23,6 @@ | |||
|                     data-dtype="Number" /> | ||||
|             </div> | ||||
|         </li> | ||||
|         <li class="attribute"> | ||||
|             <h4 class="attribute-name box-title" title="{{ localize 'OSE.Melee' }}">{{ localize "OSE.MeleeShort" }}</h4> | ||||
|             <div class="attribute-value"> | ||||
|                 <input name="data.thac0.melee" type="text" value="{{data.thac0.melee}}" placeholder="0" | ||||
|                     data-dtype="Number" /> | ||||
|             </div> | ||||
|         </li> | ||||
|         <li class="attribute"> | ||||
|             <h4 class="attribute-name box-title" title="{{ localize 'OSE.Missile' }}">{{ localize "OSE.MissileShort" }}</h4> | ||||
|             <div class="attribute-value"> | ||||
|                 <input name="data.thac0.missile" type="text" value="{{data.thac0.missile}}" placeholder="0" | ||||
|                     data-dtype="Number" /> | ||||
|             </div> | ||||
|         </li> | ||||
|         {{#if config.individualInit}} | ||||
|         <li class="attribute"> | ||||
|             <h4 class="attribute-name box-title" title="{{ localize 'OSE.Initiative' }}">{{ localize "OSE.InitiativeShort" }}</h4> | ||||
|  | @ -46,6 +32,15 @@ | |||
|             </div> | ||||
|         </li> | ||||
|         {{/if}} | ||||
|         {{#if data.retainer.enabled}} | ||||
|         <li class="attribute"> | ||||
|             <h4 class="attribute-name box-title" title="{{ localize 'OSE.Loyalty' }}">{{ localize "OSE.LoyaltyShort" }}</h4> | ||||
|             <div class="attribute-value"> | ||||
|                 <input name="data.retainer.loyalty" type="text" value="{{data.retainer.loyalty}}" | ||||
|                     placeholder="0" data-dtype="Number" /> | ||||
|             </div> | ||||
|         </li> | ||||
|         {{/if}} | ||||
|         <li class="attribute"> | ||||
|             <h4 class="attribute-name box-title">{{ localize "OSE.MovementShort" }}</h4> | ||||
|             <div class="attribute-value"> | ||||
|  | @ -59,33 +54,33 @@ | |||
|     {{!-- Scores --}} | ||||
|     <div class="attribute-group"> | ||||
|         <ul class="attributes"> | ||||
|             <li class="attribute"> | ||||
|                 <h4 class="attribute-name box-title" title="{{ localize 'OSE.scores.str.long' }}">{{ localize "OSE.scores.str.short" }}</h4> | ||||
|             <li class="attribute ability-score" data-score="str"> | ||||
|                 <h4 class="attribute-name box-title" title="{{ localize 'OSE.scores.str.long' }}"><a>{{ localize "OSE.scores.str.short" }}</a></h4> | ||||
|                 <div class="attribute-value"> | ||||
|                     <input name="data.scores.str.value" type="text" value="{{data.scores.str.value}}" placeholder="0"  data-dtype="Number"/> | ||||
|             </li> | ||||
|             <li class="attribute"> | ||||
|                 <h4 class="attribute-name box-title" title="{{ localize 'OSE.scores.int.long' }}">{{ localize "OSE.scores.int.short" }}</h4> | ||||
|             <li class="attribute ability-score" data-score="int"> | ||||
|                 <h4 class="attribute-name box-title" title="{{ localize 'OSE.scores.int.long' }}"><a>{{ localize "OSE.scores.int.short" }}</a></h4> | ||||
|                 <div class="attribute-value"> | ||||
|                     <input name="data.scores.int.value" type="text" value="{{data.scores.int.value}}" placeholder="0"  data-dtype="Number"/> | ||||
|             </li> | ||||
|             <li class="attribute"> | ||||
|                 <h4 class="attribute-name box-title" title="{{ localize 'OSE.scores.wis.long' }}">{{ localize "OSE.scores.wis.short" }}</h4> | ||||
|             <li class="attribute ability-score" data-score="wis"> | ||||
|                 <h4 class="attribute-name box-title" title="{{ localize 'OSE.scores.wis.long' }}"><a>{{ localize "OSE.scores.wis.short" }}</a></h4> | ||||
|                 <div class="attribute-value"> | ||||
|                     <input name="data.scores.wis.value" type="text" value="{{data.scores.wis.value}}" placeholder="0"  data-dtype="Number"/> | ||||
|             </li> | ||||
|             <li class="attribute"> | ||||
|                 <h4 class="attribute-name box-title" title="{{ localize 'OSE.scores.dex.long' }}">{{ localize "OSE.scores.dex.short" }}</h4> | ||||
|             <li class="attribute ability-score" data-score="dex"> | ||||
|                 <h4 class="attribute-name box-title" title="{{ localize 'OSE.scores.dex.long' }}"><a>{{ localize "OSE.scores.dex.short" }}</a></h4> | ||||
|                 <div class="attribute-value"> | ||||
|                     <input name="data.scores.dex.value" type="text" value="{{data.scores.dex.value}}" placeholder="0"  data-dtype="Number"/> | ||||
|             </li> | ||||
|             <li class="attribute"> | ||||
|                 <h4 class="attribute-name box-title" title="{{ localize 'OSE.scores.con.long' }}">{{ localize "OSE.scores.con.short" }}</h4> | ||||
|             <li class="attribute ability-score" data-score="con"> | ||||
|                 <h4 class="attribute-name box-title" title="{{ localize 'OSE.scores.con.long' }}"><a>{{ localize "OSE.scores.con.short" }}</a></h4> | ||||
|                 <div class="attribute-value"> | ||||
|                     <input name="data.scores.con.value" type="text" value="{{data.scores.con.value}}" placeholder="0"  data-dtype="Number"/> | ||||
|             </li> | ||||
|             <li class="attribute"> | ||||
|                 <h4 class="attribute-name box-title" title="{{ localize 'OSE.scores.cha.long' }}">{{ localize "OSE.scores.cha.short" }}</h4> | ||||
|             <li class="attribute ability-score" data-score="cha"> | ||||
|                 <h4 class="attribute-name box-title" title="{{ localize 'OSE.scores.cha.long' }}"><a>{{ localize "OSE.scores.cha.short" }}</a></h4> | ||||
|                 <div class="attribute-value"> | ||||
|                     <input name="data.scores.cha.value" type="text" value="{{data.scores.cha.value}}" placeholder="0"  data-dtype="Number"/> | ||||
|             </li> | ||||
|  |  | |||
|  | @ -30,6 +30,15 @@ | |||
|                     data-dtype="Number" /> | ||||
|             </div> | ||||
|         </li> | ||||
|         {{#if data.retainer.enabled}} | ||||
|         <li class="attribute"> | ||||
|             <h4 class="attribute-name box-title" title="{{ localize 'OSE.Loyalty' }}">{{ localize "OSE.LoyaltyShort" }}</h4> | ||||
|             <div class="attribute-value"> | ||||
|                 <input name="data.retainer.loyalty" type="text" value="{{data.retainer.loyalty}}" | ||||
|                     placeholder="0" data-dtype="Number" /> | ||||
|             </div> | ||||
|         </li> | ||||
|         {{/if}} | ||||
|         <li class="attribute"> | ||||
|             <h4 class="attribute-name box-title" title="{{localize 'OSE.Movement'}}">{{ localize "OSE.MovementShort" }}</h4> | ||||
|             <div class="attribute-value"> | ||||
|  |  | |||
|  | @ -0,0 +1,19 @@ | |||
| <form class="{{cssClass}}" autocomplete="off"> | ||||
|   <header class="sheet-header"> | ||||
|     <img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}" /> | ||||
|     <div class="header-col"> | ||||
|       <h1 class="charname"> | ||||
|         <input | ||||
|           name="name" | ||||
|           type="text" | ||||
|           value="{{item.name}}" | ||||
|           placeholder="Name" | ||||
|         /> | ||||
|       </h1> | ||||
|     </div> | ||||
|   </header> | ||||
|   <section class="sheet-body"> | ||||
|     {{editor content=data.description target="data.description" | ||||
|     button=true owner=owner editable=editable}} | ||||
|   </section> | ||||
| </form> | ||||
|  | @ -0,0 +1,19 @@ | |||
| <form class="{{cssClass}}" autocomplete="off"> | ||||
|   <header class="sheet-header"> | ||||
|     <img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}" /> | ||||
|     <div class="header-col"> | ||||
|       <h1 class="charname"> | ||||
|         <input | ||||
|           name="name" | ||||
|           type="text" | ||||
|           value="{{item.name}}" | ||||
|           placeholder="Name" | ||||
|         /> | ||||
|       </h1> | ||||
|     </div> | ||||
|   </header> | ||||
|   <section class="sheet-body"> | ||||
|     {{editor content=data.description target="data.description" | ||||
|     button=true owner=owner editable=editable}} | ||||
|   </section> | ||||
| </form> | ||||
		Loading…
	
		Reference in New Issue