Spells with multiple damage types aren't represented
- Linguagem predominante
- TypeScript
- Estrelas
- 934
- Forks
- 427
- Merge médio
- 17h 25min
- PRs com merge (30d)
- 22
Descrição
Taking the spell Ice Storm for example:
Ice Storm is an AoE spell that deals (at base level) 2d8 bludgeoning damage + 4d6 cold damage. The API lists the spell damage as follows:
```
"damage": {
"damage_type": {
"index": "bludgeoning",
"name": "Bludgeoning",
"url": "/api/damage-types/bludgeoning"
},
"damage_at_slot_level": {
"4": "2d8 + 4d6",
"5": "3d8 + 4d6",
"6": "4d8 + 4d6",
"7": "5d8 + 4d6",
"8": "6d8 + 4d6",
"9": "7d8 + 4d6"
}
},
```
It correctly captures that two different damage types are used for the respective d8 and d6 rolls. But does not identify the damage type and also missed the cold damage type altogether.
Not sure the optimal representation for this, but I suggest the keys for "damage_at_slot_level" and "damage_at_character_level" to be a subtype of "damage_type". Additionally "damage_type" would replace the current "damage" key, as "damage" seems redundant since I believe there are no times where a damage value exists without belonging to a damage_type Resulting in this instance for the below fix for Ice Storm
```
"damage_type": [
{
"index": "bludgeoning",
"name": "Bludgeoning",
"url": "/api/damage-types/bludgeoning",
"damage_at_slot_level": {
"4": "2d8",
"5": "3d8",
"6": "4d8",
"7": "5d8",
"8": "6d8",
"9": "7d8 "
}
},
{
"index": "cold",
"name": "Cold",
"url": "/api/damage-types/cold",
"damage_at_slot_level": {
"4": "4d6",
"5": "4d6",
"6": "4d6",
"7": "4d6",
"8": "4d6",
"9": "4d6"
}
}
],
```
Guia de contribuição
Direção de pesquisa
Look at the spell data files in the repository, likely in a `src` or `data` directory, to understand the current structure of the damage field. Examine the Ice Storm entry as an example. The fix involves modifying the data schema and potentially the TypeScript types that define it. Check for existing tests or validation scripts to ensure changes are correct. The goal is to update the representation so multiple damage types are properly captured with their respective dice rolls per level.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- json, typescript
- Domínio
- api, data
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Pouca atividade
- Clareza
- Claramente especificada
- Facilidade para iniciantes
- 65/100