mirror of
https://github.com/em-squared/5e-drs.git
synced 2025-10-30 05:04:21 +00:00
ajout des archétypes de taromancien et d'officier
This commit is contained in:
parent
9b9a54b134
commit
233a8cc5de
10 changed files with 491 additions and 72 deletions
|
|
@ -193,6 +193,23 @@ export default {
|
|||
})
|
||||
}
|
||||
|
||||
// let json = []
|
||||
// for (var magicItem of results) {
|
||||
// let mi = {}
|
||||
// mi.name = magicItem.frontmatter.title
|
||||
// mi.attunement = magicItem.frontmatter.attunement
|
||||
// mi.rarity = magicItem.frontmatter.rarity
|
||||
// mi.type = magicItem.frontmatter.type
|
||||
// mi.subtype = magicItem.frontmatter.subtype
|
||||
// mi.source = magicItem.frontmatter.source
|
||||
// mi.content = magicItem.rawContent
|
||||
// json.push(mi)
|
||||
// }
|
||||
//
|
||||
// console.log(json)
|
||||
|
||||
// console.log(results)
|
||||
|
||||
return results
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -152,7 +152,19 @@
|
|||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
import Breadcrumb from '@theme/components/Breadcrumb'
|
||||
import { displayChallenge } from '@theme/util/monsterHelpers'
|
||||
import {
|
||||
displayChallenge,
|
||||
displayAC,
|
||||
displayHP,
|
||||
displayMovement,
|
||||
displaySavingThrows,
|
||||
displaySkills,
|
||||
displayVulnerabilities,
|
||||
displayResistances,
|
||||
displayImmunities,
|
||||
displayConditionImmunities,
|
||||
displaySenses,
|
||||
} from '@theme/util/monsterHelpers'
|
||||
import { setUrlParams, getUrlParameter } from '@theme/util/filterHelpers'
|
||||
import { isResourceInLibrary, handleTooltips } from '@theme/util'
|
||||
import Monster from '@theme/components/Monster'
|
||||
|
|
@ -351,6 +363,40 @@ export default {
|
|||
results = classFiltered
|
||||
}
|
||||
|
||||
// let json = []
|
||||
// for (var monster of results) {
|
||||
// let m = {}
|
||||
// m.name = monster.frontmatter.title
|
||||
// m.size = monster.frontmatter.size
|
||||
// m.alignment = monster.frontmatter.alignment
|
||||
// m.type = monster.frontmatter.type
|
||||
// m.subtype = monster.frontmatter.subtype
|
||||
// m.swarm = monster.frontmatter.isSwarm
|
||||
// m.challenge = monster.frontmatter.challenge
|
||||
// m.ac = displayAC(monster)
|
||||
// m.hp = displayHP(monster)
|
||||
// m.speed = displayMovement(monster)
|
||||
// m.abilityScores = monster.frontmatter.abilityScores
|
||||
// m.savingThrows = displaySavingThrows(monster)
|
||||
// m.skills = displaySkills(monster)
|
||||
// m.vulnerabilities = displayVulnerabilities(monster)
|
||||
// m.resistances = displayResistances(monster)
|
||||
// m.immunities = displayImmunities(monster)
|
||||
// m.conditionImmunities = displayConditionImmunities(monster)
|
||||
// m.senses = displaySenses(monster)
|
||||
// m.languages = monster.frontmatter.languages
|
||||
// m.telepathy = monster.frontmatter.telepathy
|
||||
// m.source = monster.frontmatter.source
|
||||
// m.sourcePage = monster.frontmatter.source_page
|
||||
// m.content = monster.rawContent
|
||||
// m.environments = monster.frontmatter.environments
|
||||
// m.dungeon_types = monster.frontmatter.dungeonTypes
|
||||
// json.push(m)
|
||||
// }
|
||||
//
|
||||
// console.log(json)
|
||||
// console.log(results)
|
||||
|
||||
return results
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -394,6 +394,27 @@ export default {
|
|||
// }
|
||||
// console.log(csv)
|
||||
|
||||
// let json = []
|
||||
// for (var spell of results) {
|
||||
// let s = {}
|
||||
// s.name = spell.frontmatter.title
|
||||
// s.casting_time = spell.frontmatter.casting_time
|
||||
// s.classes = spell.frontmatter.classes
|
||||
// s.components = spell.frontmatter.components
|
||||
// s.concentration = spell.frontmatter.concentration
|
||||
// s.description = spell.frontmatter.description
|
||||
// s.duration = spell.frontmatter.duration
|
||||
// s.level = spell.frontmatter.level
|
||||
// s.range = spell.frontmatter.range
|
||||
// s.ritual = spell.frontmatter.ritual
|
||||
// s.school = spell.frontmatter.school
|
||||
// s.source = spell.frontmatter.source
|
||||
// s.content = spell.rawContent
|
||||
// json.push(s)
|
||||
// }
|
||||
//
|
||||
// console.log(json)
|
||||
|
||||
return results
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import {stats} from '../../data/stats'
|
||||
import {CHALLENGES} from '../../data/monsters'
|
||||
import {armorTypes} from '../../data/armorTypes.js'
|
||||
|
||||
// Calcul du modificateur de caractéristique
|
||||
export function getModifier (score) {
|
||||
|
|
@ -177,6 +178,249 @@ export function displayHP (monster) {
|
|||
return ""
|
||||
}
|
||||
|
||||
// Affiche les vitesses de déplacement
|
||||
export function displayMovement (monster) {
|
||||
if (monster.frontmatter.customMovement) {
|
||||
return monster.frontmatter.customMovement
|
||||
}
|
||||
let result = ''
|
||||
if (monster.frontmatter.movement.walk) {
|
||||
result += monster.frontmatter.movement.walk + ' m'
|
||||
} else {
|
||||
result += '0 m'
|
||||
}
|
||||
if (monster.frontmatter.movement.climb) {
|
||||
if (result != '') {
|
||||
result += ', '
|
||||
}
|
||||
result += 'escalade ' + monster.frontmatter.movement.climb + ' m'
|
||||
}
|
||||
if (monster.frontmatter.movement.burrow) {
|
||||
if (result != '') {
|
||||
result += ', '
|
||||
}
|
||||
result += 'fouissement ' + monster.frontmatter.movement.burrow + ' m'
|
||||
}
|
||||
if (monster.frontmatter.movement.swim) {
|
||||
if (result != '') {
|
||||
result += ', '
|
||||
}
|
||||
result += 'nage ' + monster.frontmatter.movement.swim + ' m'
|
||||
}
|
||||
if (monster.frontmatter.movement.fly) {
|
||||
if (result != '') {
|
||||
result += ', '
|
||||
}
|
||||
result += 'vol ' + monster.frontmatter.movement.fly + ' m'
|
||||
if (monster.frontmatter.movement.hover) {
|
||||
result += ' (vol stationnaire)'
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
export function getMonsterProficiencyBonus (monster) {
|
||||
if (monster.frontmatter.proficiencyBonus) {
|
||||
return parseInt(monster.frontmatter.proficiencyBonus)
|
||||
}
|
||||
return getProficiencyBonus(monster.frontmatter.challenge)
|
||||
}
|
||||
|
||||
export function displaySavingThrowBonus (monster, ability) {
|
||||
let result = stats.abilities[ability].abbr
|
||||
let bonus = displayBonus(getModifier(monster.frontmatter.abilityScores[ability]) + getMonsterProficiencyBonus(monster))
|
||||
result += ' ' + bonus
|
||||
return result
|
||||
}
|
||||
|
||||
export function displaySavingThrows(monster) {
|
||||
if (monster.frontmatter.customSavingThrows) {
|
||||
return monster.frontmatter.customSavingThrows
|
||||
}
|
||||
let savingThrows = []
|
||||
|
||||
if (monster.frontmatter.savingThrows && monster.frontmatter.savingThrows.length > 0) {
|
||||
for (var st of monster.frontmatter.savingThrows) {
|
||||
savingThrows.push(displaySavingThrowBonus(monster, st))
|
||||
}
|
||||
}
|
||||
|
||||
return savingThrows.join(', ')
|
||||
}
|
||||
|
||||
export function displaySkillBonus (monster, skill) {
|
||||
if (skill.name == 'custom') {
|
||||
return skill.value
|
||||
}
|
||||
let result = stats.skills[skill.name].label
|
||||
if (skill.invalid) {
|
||||
result += ' ' + displayBonus(skill.value)
|
||||
return result
|
||||
}
|
||||
let bonus = getModifier(monster.frontmatter.abilityScores[stats.skills[skill.name].ability]) + getMonsterProficiencyBonus(monster)
|
||||
if (skill.isExpert) {
|
||||
bonus += getMonsterProficiencyBonus(monster) // Bonus de maître doublé pour les experts
|
||||
}
|
||||
bonus = displayBonus(bonus)
|
||||
result += ' ' + bonus
|
||||
return result
|
||||
}
|
||||
|
||||
export function displaySkills(monster) {
|
||||
if (monster.frontmatter.customSkills) {
|
||||
return monster.frontmatter.customSkills
|
||||
}
|
||||
|
||||
let skills = []
|
||||
|
||||
if (monster.frontmatter.skills && monster.frontmatter.skills.length > 0) {
|
||||
for (var skill of monster.frontmatter.skills) {
|
||||
skills.push(displaySkillBonus(monster, skill))
|
||||
}
|
||||
}
|
||||
|
||||
return skills.join(', ')
|
||||
}
|
||||
|
||||
export function displayDamageTypes (damageTypes) {
|
||||
let result = ''
|
||||
damageTypes.forEach((damageType, idx) => {
|
||||
if (result != '') {
|
||||
if (idx == damageTypes.length - 1) {
|
||||
result += ' et '
|
||||
} else {
|
||||
result += ', '
|
||||
}
|
||||
}
|
||||
result += stats.damageTypes[damageType].label
|
||||
})
|
||||
return result
|
||||
}
|
||||
|
||||
export function displayVulnerabilities(monster) {
|
||||
if (monster.frontmatter.customDamageTypeVulnerabilities) {
|
||||
return monster.frontmatter.customDamageTypeVulnerabilities
|
||||
}
|
||||
|
||||
let vulnerabilities = ''
|
||||
|
||||
if (monster.frontmatter.damageTypeVulnerabilities && monster.frontmatter.damageTypeVulnerabilities.length > 0) {
|
||||
vulnerabilities = displayDamageTypes(monster.frontmatter.damageTypeVulnerabilities)
|
||||
}
|
||||
|
||||
return vulnerabilities
|
||||
}
|
||||
|
||||
export function displayResistances(monster) {
|
||||
|
||||
let resistances = ''
|
||||
|
||||
if (monster.frontmatter.damageTypeResistances && monster.frontmatter.damageTypeResistances.length > 0) {
|
||||
resistances = displayDamageTypes(monster.frontmatter.damageTypeResistances)
|
||||
}
|
||||
|
||||
return resistances
|
||||
}
|
||||
|
||||
export function displayImmunities(monster) {
|
||||
|
||||
let immunities = ''
|
||||
|
||||
if (monster.frontmatter.damageTypeImmunities && monster.frontmatter.damageTypeImmunities.length > 0) {
|
||||
immunities = displayDamageTypes(monster.frontmatter.damageTypeImmunities)
|
||||
}
|
||||
|
||||
return immunities
|
||||
}
|
||||
|
||||
export function displayCondition (condition) {
|
||||
return stats.conditions[condition].label
|
||||
}
|
||||
|
||||
export function displayConditionImmunities(monster) {
|
||||
|
||||
let result = ''
|
||||
|
||||
if (monster.frontmatter.conditionImmunities && monster.frontmatter.conditionImmunities.length > 0) {
|
||||
monster.frontmatter.conditionImmunities.forEach((condition, idx) => {
|
||||
if (result != '') {
|
||||
if (idx == monster.frontmatter.conditionImmunities.length - 1) {
|
||||
result += ' et '
|
||||
} else {
|
||||
result += ', '
|
||||
}
|
||||
}
|
||||
result += stats.conditions[condition].label
|
||||
})
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
export function getMonsterPassivePerception (monster) {
|
||||
let result = 10 + getModifier(monster.frontmatter.abilityScores.sag)
|
||||
if (monster.frontmatter.skills) {
|
||||
monster.frontmatter.skills.forEach((skill, idx) => {
|
||||
if (skill.name == 'perception') {
|
||||
if (skill.isExpert) {
|
||||
result += getMonsterProficiencyBonus(monster) * 2
|
||||
} else {
|
||||
result += getMonsterProficiencyBonus(monster)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
export function displaySenses (monster) {
|
||||
let result = ''
|
||||
if (monster.frontmatter.senses) {
|
||||
if (monster.frontmatter.senses.tremorsense) {
|
||||
result += 'perception des vibrations ' + monster.frontmatter.senses.tremorsense + ' m'
|
||||
}
|
||||
if (monster.frontmatter.senses.blindsight || monster.frontmatter.senses.customBlindSight) {
|
||||
if (result != '') {
|
||||
result += ', '
|
||||
}
|
||||
if (monster.frontmatter.senses.customBlindSight) {
|
||||
result += 'vision aveugle ' + monster.frontmatter.senses.customBlindSight
|
||||
} else {
|
||||
result += 'vision aveugle ' + monster.frontmatter.senses.blindsight + ' m'
|
||||
}
|
||||
}
|
||||
if (monster.frontmatter.senses.darkvision || monster.frontmatter.senses.customDarkvision) {
|
||||
if (result != '') {
|
||||
result += ', '
|
||||
}
|
||||
if (monster.frontmatter.senses.customDarkvision) {
|
||||
result += 'vision dans le noir ' + monster.frontmatter.senses.customDarkvision
|
||||
} else {
|
||||
result += 'vision dans le noir ' + monster.frontmatter.senses.darkvision + ' m'
|
||||
}
|
||||
}
|
||||
if (monster.frontmatter.senses.truesight || monster.frontmatter.senses.customTrueSight) {
|
||||
if (result != '') {
|
||||
result += ', '
|
||||
}
|
||||
if (monster.frontmatter.senses.customTrueSight) {
|
||||
result += 'vision parfaite ' + monster.frontmatter.senses.customTrueSight
|
||||
} else {
|
||||
result += 'vision parfaite ' + monster.frontmatter.senses.truesight + ' m'
|
||||
}
|
||||
}
|
||||
if (result != '') {
|
||||
result += ', '
|
||||
}
|
||||
}
|
||||
if (monster.frontmatter.senses && monster.frontmatter.senses.customPassivePerception) {
|
||||
result += 'Perception passive ' + monster.frontmatter.senses.customPassivePerception
|
||||
} else {
|
||||
result += 'Perception passive ' + getMonsterPassivePerception(monster)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
// Retourne le nombre de points de combat pour un indice de dangerosité
|
||||
export function getPCbyChallenge(challenge) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue