mirror of
				https://github.com/em-squared/5e-drs.git
				synced 2025-10-31 05:24:20 +00:00 
			
		
		
		
	WIP bestiaire
This commit is contained in:
		
							parent
							
								
									bde611ae9b
								
							
						
					
					
						commit
						510db9f858
					
				
					 58 changed files with 29311 additions and 365 deletions
				
			
		
							
								
								
									
										15
									
								
								docs/.vuepress/theme/util/magicItemHelpers.js
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								docs/.vuepress/theme/util/magicItemHelpers.js
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,15 @@ | |||
| export function displayItemMeta (item, short = false) { | ||||
|   let result = item.type | ||||
|   if (item.subtype) { | ||||
|     result += ' (' + item.subtype + ')' | ||||
|   } | ||||
|   result += ', ' + item.rarity | ||||
|   if (item.attunement) { | ||||
|     if (short) { | ||||
|       result += ' (harmonisation requise)' | ||||
|     } else { | ||||
|       result += ' (' + item.attunement + ')' | ||||
|     } | ||||
|   } | ||||
|   return result | ||||
| } | ||||
							
								
								
									
										26
									
								
								docs/.vuepress/theme/util/monsterHelpers.js
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								docs/.vuepress/theme/util/monsterHelpers.js
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,26 @@ | |||
| // Calcul du modificateur de caractéristique
 | ||||
| export function getModifier (score) { | ||||
|   return Math.floor((score - 10) / 2) | ||||
| } | ||||
| 
 | ||||
| // Ajoute un + devant les valeurs positives pour l'affichage
 | ||||
| export function displayBonus (value) { | ||||
|   if (value >= 0) { | ||||
|     value = '+' + value | ||||
|   } | ||||
|   return value | ||||
| } | ||||
| 
 | ||||
| // Affichage d'un score de caractéristiques sous la forme 16 (+3)
 | ||||
| export function displayAbilityScore (score) { | ||||
|   let modifier = getModifier(score) | ||||
|   if (modifier >= 0) { | ||||
|     modifier = '+' + modifier | ||||
|   } | ||||
|   return score + ' (' + modifier + ')' | ||||
| } | ||||
| 
 | ||||
| // Calcul du bonus de maîtrise en fonction du niveau
 | ||||
| export function getProficiencyBonus (level) { | ||||
|   return Math.ceil(level / 4) + 1 | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Maxime Moraine
						Maxime Moraine