sc-classes/README.md

31 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

привмер работы `вдохновение барда`:
* после активации умения, происходит выбор актёра
* выдача "особенности" вдохновение барда с нужным кубом
* использование актёром вдохновения из своего инвентаря
гайды:
https://github.com/foundry-vtt-community/wiki/blob/main/API-Learning-API.md
https://www.youtube.com/@oatveal/videos
https://www.answeroverflow.com/m/905397822822703116
Получение id персонажа
```javascript
let actor = game.user.character
let actorId - actor.id
```
Добавление значения к характеристике:
```javascript
actor.update({'system.abilities.str.value': actor.data.system.abilities.str.value+1})
```
Добавление предмета из мира
```javascript
const item = game.items.getName("End Concentration")
await actor.createEmbeddedDocuments('Item', [item.toObject()])
```
Добавление предмета из компендиума
```javascript
(Array.from(game.packs)).filter(element => element.metadata.name == 'sc-items')
```