added pre version of a wiki
This commit is contained in:
37
wiki/dev/dicepicker.md
Normal file
37
wiki/dev/dicepicker.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# DicePicker (DP)
|
||||
The DicePicker is the entry point to any L5R roll (but chat command).
|
||||
|
||||
## Usage exemple
|
||||
```js
|
||||
new game.l5r5e.DicePickerDialog({
|
||||
skillId: 'aesthetics',
|
||||
ringId: 'water',
|
||||
actor: game.user.character
|
||||
}).render(true);
|
||||
```
|
||||
|
||||
## Constructor Options
|
||||
| Property | Type | Notes / Exemples |
|
||||
|------------------|----------|-------------------------------------------------------------------------------------------------------------------------------|
|
||||
| actor | Actor | Any `Actor` object instance.<br>ex : `game.user.character`, `canvas.tokens.controlled[0].actor` |
|
||||
| actorId | string | This is the `id` not the `uuid` of an actor.<br>ex : "AbYgKrNwWeAxa9jT" |
|
||||
| actorName | string | Careful this is case sensitive.<br>ex : "Isawa Aki" |
|
||||
| difficulty | number | `1` to `9` |
|
||||
| difficultyHidden | boolean | If `true`, hide the difficulty and lock the view for the player. |
|
||||
| isInitiativeRoll | boolean | `true` if this is an initiative roll |
|
||||
| itemUuid | string | The `uuid` of technique or weapon used for this roll. Can be anything retrieved by `fromUuid()` or `fromUuidSync()` |
|
||||
| ringId | string | If not provided, take the current stance of the actor if any.<br>ex : "fire", "water" |
|
||||
| skillId | string | Skill `id`<br>ex : "design", "aesthetics", "courtesy" |
|
||||
| skillCatId | string | Skill category `id`<br>ex : "artisan", "scholar" |
|
||||
| skillsList | string[] | `skillId`/`skillCatId` list coma separated.<br>Allow the player to select the skill used in a select<br>ex : "artisan,design" |
|
||||
|
||||
|
||||
All these properties are optional.
|
||||
|
||||
For `actor*` properties, the resolution is in this order :
|
||||
1. `option.actor`
|
||||
2. `option.actorId`
|
||||
3. `option.actorName`
|
||||
4. Try to find the first controlled token by the player (`canvas.tokens.controlled[0]?.actor`)
|
||||
5. Use the assigned character if any (`game.user.character`)
|
||||
6. If nothing found, then no actor are set
|
||||
9
wiki/dev/rnk.md
Normal file
9
wiki/dev/rnk.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Roll n Keep (RnK)
|
||||
The RnK use `ChatMessage` to retrieve the roll, alter it, add the new message and delete the old.
|
||||
|
||||
> If you have any idea how to modify directly the ChatMessage and update it, let me know.
|
||||
|
||||
Usage :
|
||||
```js
|
||||
new RollnKeepDialog(messageId).render(true);
|
||||
```
|
||||
34
wiki/dev/roll.md
Normal file
34
wiki/dev/roll.md
Normal file
@@ -0,0 +1,34 @@
|
||||
# Roll
|
||||
The roll use the `RollL5r5e` class, who store a lot of additional variables.
|
||||
|
||||
Here is a view of `<roll>.l5r5e` properties :
|
||||
```js
|
||||
actor: null, // actor instance
|
||||
dicesTypes: {
|
||||
std: false, // true if have a standard roll (ex : 1d6)
|
||||
l5r: false, // true if have a l5r roll (we need the RnK)
|
||||
},
|
||||
difficulty: 2,
|
||||
difficultyHidden: false,
|
||||
history: null, // Stored data of the RnK, can be big
|
||||
initialFormula: null, // The initial formula use in DP
|
||||
itemUuid: null, // technique or weapon uuid
|
||||
isInitiativeRoll: false,
|
||||
keepLimit: null, // Max number of dice to keep
|
||||
rnkEnded: false, // false if the player can modify the roll.
|
||||
skillAssistance: 0, // Number of skill assistance, needed to know the number of dice keept
|
||||
skillCatId: "", // Skill category id
|
||||
skillId: "", // Skill id
|
||||
stance: "", // Ring id (fire, void...)
|
||||
strifeApplied: 0, // how many strife point the linked actor have already taken
|
||||
summary: {
|
||||
totalSuccess: 0, // = success + explosive
|
||||
totalBonus: 0, // = totalSuccess - difficulty
|
||||
success: 0,
|
||||
explosive: 0,
|
||||
opportunity: 0,
|
||||
strife: 0,
|
||||
},
|
||||
targetInfos: null, // "img" and "name" of the target if any
|
||||
voidPointUsed: false, // if a void point as been used for this roll
|
||||
```
|
||||
94
wiki/dev/sockets.md
Normal file
94
wiki/dev/sockets.md
Normal file
@@ -0,0 +1,94 @@
|
||||
# Sockets API
|
||||
Here is the list of Socket's methods, most of them is design to be use internally by the system, but you can find some useful for your projects.
|
||||
|
||||
|
||||
## deleteChatMessage
|
||||
Delete ChatMessage by his `id`, the GM permission is required, so a GM need to be connected for this to work. Used in RnK.
|
||||
|
||||
Usage :
|
||||
```js
|
||||
game.l5r5e.sockets.deleteChatMessage(messageId);
|
||||
```
|
||||
|
||||
|
||||
## refreshAppId
|
||||
Refresh a application windows by it's `htmlId` (not `windowsId`). Used in RnK.
|
||||
<br>Ex : `l5r5e-twenty-questions-dialog-kZHczAFghMNYFRWe`, not `65`.
|
||||
|
||||
Usage :
|
||||
```js
|
||||
game.l5r5e.sockets.refreshAppId(applicationId);
|
||||
```
|
||||
|
||||
|
||||
## updateMessageIdAndRefresh
|
||||
Change the message in the selected application windows, and rerender the application to force the refresh. Used in RnK.
|
||||
|
||||
Usage :
|
||||
```js
|
||||
game.l5r5e.sockets.refreshAppId(applicationId, messageId);
|
||||
```
|
||||
|
||||
|
||||
## openDicePicker
|
||||
Remotely open the DicePicker (DP) on targetted Users/Actors if they are active users. Used in initiative roll.
|
||||
|
||||
Arguments :
|
||||
|
||||
| Property | Type | Notes / Exemples |
|
||||
|-----------|---------|----------------------------------------------------------------------------|
|
||||
| users | User[] | Users list to trigger the DP (will be reduce to `id` for network perf.) |
|
||||
| actors | Actor[] | Actors list to trigger the DP (will be reduce to `uuid` for network perf.) |
|
||||
| dpOptions | Object | Any [DicePickerDialog.options](dicepicker.md#constructor-options) |
|
||||
|
||||
|
||||
### Exemples
|
||||
|
||||
#### Fitness skill roll for the all combat targets
|
||||
```js
|
||||
game.l5r5e.sockets.openDicePicker({
|
||||
actors: Array.from(game.user.targets).map(t => t.document.actor),
|
||||
dpOptions: {
|
||||
skillId: 'fitness',
|
||||
difficulty: 3,
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
#### Initiative roll (skirmish) for all player's character who are in combat tracker
|
||||
```js
|
||||
game.l5r5e.sockets.openDicePicker({
|
||||
actors: game.combat.combatants.filter(c => c.hasPlayerOwner && !c.isDefeated && !c.initiative).map(c => c.actor),
|
||||
dpOptions: {
|
||||
skillId: 'tactics',
|
||||
difficulty: 1,
|
||||
isInitiativeRoll: true,
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
#### Melee skill roll with "fire" ring, pre-selected for all the selected tokens
|
||||
```js
|
||||
game.l5r5e.sockets.openDicePicker({
|
||||
actors: canvas.tokens.controlled.map(t => t.actor),
|
||||
dpOptions: {
|
||||
ringId: 'fire',
|
||||
skillId: 'melee',
|
||||
difficulty: 2,
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
#### Skill roll with skill list for all active players (but GM)
|
||||
```js
|
||||
game.l5r5e.sockets.openDicePicker({
|
||||
users: game.users.players.filter(u => u.active && u.hasPlayerOwner),
|
||||
dpOptions: {
|
||||
ringId: 'water',
|
||||
skillId: 'unarmed',
|
||||
skillsList: 'melee,ranged,unarmed',
|
||||
difficulty: 3,
|
||||
difficultyHidden: true,
|
||||
}
|
||||
});
|
||||
```
|
||||
21
wiki/dev/system-helping.md
Normal file
21
wiki/dev/system-helping.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# System helping (Contribute)
|
||||
## Rules
|
||||
You are free to contribute and propose corrections, modifications after fork. Try to respect theses rules:
|
||||
- Make sure you are up-to-date with the referent branch (most of the time the `dev` branch).
|
||||
- Clear and precise commit messages allow a quick review of the code.
|
||||
- If possible, limit yourself to one Feature per Merge request so as not to block the process.
|
||||
|
||||
|
||||
## Dev install
|
||||
1. Clone the repository.
|
||||
2. Use `npm ci` to install the dependence.
|
||||
3. Create a link from `<repo>/system` to your foundry system data (by default `%localappdata%/FoundryVTT/data/systems/l5r5e`).
|
||||
|
||||
Windows exemple (modify the target and source directories, and run this in administrator) :
|
||||
```bash
|
||||
mklink /D /J "%localappdata%/FoundryVTT/data/systems/l5r5e" "D:/Projects/FVTT/l5r5e/system"
|
||||
```
|
||||
|
||||
|
||||
## Compiling SCSS
|
||||
1. Run `npm watch` to watch and compile the `scss` files.
|
||||
Reference in New Issue
Block a user