Skip to content

Commit

Permalink
Support the Hiding status effect (#142)
Browse files Browse the repository at this point in the history
* dnd5e: *Hiding* Status Effect can be used to bank stealth results
* dnd5e: Handle vision-5e's "undefined" detection mode
* Systems can specialize game settings defaults
* Fix v12 lighting calculations
  • Loading branch information
Eligarf authored Jul 1, 2024
1 parent cc67bdc commit d309ff8
Show file tree
Hide file tree
Showing 13 changed files with 450 additions and 329 deletions.
6 changes: 6 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v4.4.0
* dnd5e: *Hiding* Status Effect can be used to bank stealth results
* dnd5e: Handle vision-5e's "undefined" detection mode
* Systems can specialize game settings defaults
* Fix v12 lighting calculations

# v4.3.2
* Added a small binoculars icon over the banked perception value in the token HUD
* Fix module.json warning
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ Stealthy will not automatically remove a banked stealth roll - the dnd5e [Skulke
* [lib-wrapper](https://foundryvtt.com/packages/lib-wrapper)
* [socketlib](https://github.com/manuelVo/foundryvtt-socketlib)
## Optional modules
Stealthy will adapt to the presence of any of the following modules should they be active
* [Active Token Effects](https://foundryvtt.com/packages/ATL)
* [Condition Lab & Triggler](https://foundryvtt.com/packages/condition-lab-triggler)
* [DFreds Convenient Effects](https://foundryvtt.com/packages/dfreds-convenient-effects)
* [Midi QOL](https://foundryvtt.com/packages/midi-qol)
* [Vision5e](https://foundryvtt.com/packages/vision-5e)
* [Visual Active Effects](https://foundryvtt.com/packages/visual-active-effects)
8 changes: 7 additions & 1 deletion languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"warning": "Reload is required to apply changes to selected detection modes"
},
"source": {
"hint": "Where to find the effect",
"hint": "Which source to use for the Active Effect stored on the actor",
"ce": {
"name": "Convenient Effects",
"beforeLabel": "Couldn't find effect",
Expand All @@ -86,6 +86,7 @@
},
"config": {
"general": "General Options",
"effects": "Active Effect Options",
"debug": "Debug Options",
"advanced": "Advanced Options"
},
Expand All @@ -99,6 +100,11 @@
"name": "End Turn",
"hint": "End turn if you are owner of the current combatant"
},
"hiding": {
"choice": "Use 'Hiding' Status Effect",
"hint": "This string will be sent through i18n.localize(). Changing these may affect overall automation of Stealthy's effects. If you want 'hiding', use 'EFFECT.DND5E.StatusHiding'",
"iconhint": "Default icon for Hidden effect (ignored if using Status Effect)"
},
"perceptionDisadvantage": {
"name": "Perception disadvantage in Dim light",
"hint": "Use scene lighting to determine if perception disadvantage applies for tokens with stealth. Uses center X,Y of the token, nothing fancy"
Expand Down
10 changes: 8 additions & 2 deletions languages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"source": "Source d'effets cachés",
"preloc": {
"key": "Clé de localisation pour l'étiquette masquée",
"hint": "Cette chaîne sera envoyée via i18n.localize(). "
"hint": "Cette chaîne sera envoyée via i18n.localize(). Changing these may affect overall automation of Stealthy's effects."
},
"icon": "Icône cachée",
"iconhint": "Icône par défaut pour l'effet masqué"
Expand Down Expand Up @@ -60,7 +60,7 @@
"warning": "Reload is required to apply changes to selected detection modes"
},
"source": {
"hint": "Où trouver l'effet",
"hint": "Which source to use for the Active Effect stored on the actor",
"ce": {
"name": "Convinient effects",
"beforeLabel": "Impossible de trouver l'effet",
Expand All @@ -86,6 +86,7 @@
},
"config": {
"general": "Options générales",
"effects": "Active Effect Options",
"debug": "Options de debug",
"advanced": "Options avancées"
},
Expand All @@ -99,6 +100,11 @@
"name": "Fin du tour",
"hint": "Fin du tour si vous êtes propriétaire du combattant actuel"
},
"hiding": {
"choice": "Use 'Hiding' Status Effect",
"hint": "Cette chaîne sera envoyée via i18n.localize(). Changing these may affect overall automation of Stealthy's effects. If you want 'hiding', use 'EFFECT.DND5E.StatusHiding'",
"iconhint": "Icône par défaut pour l'effet Détection (ignored if using Status Effect)"
},
"perceptionDisadvantage": {
"name": "Perception disadvantage in Dim light",
"hint": "Use scene lighting to determine if perception disadvantage applies for tokens with stealth. Uses center X,Y of the token, nothing fancy"
Expand Down
8 changes: 7 additions & 1 deletion languages/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"warning": "É necessário atualizar a página para aplicar alterações aos modos de detecção selecionados"
},
"source": {
"hint": "Onde encontrar o efeito",
"hint": "Which source to use for the Active Effect stored on the actor",
"ce": {
"name": "Convenient Effects",
"beforeLabel": "Não foi possível encontrar o efeito",
Expand All @@ -86,6 +86,7 @@
},
"config": {
"general": "Opções Gerais",
"effects": "Active Effect Options",
"debug": "Opções de Depuração",
"advanced": "Opções Avançadas"
},
Expand All @@ -99,6 +100,11 @@
"name": "Encerrar Turno",
"hint": "Encerra o turno se você é dono do atual combatente."
},
"hiding": {
"choice": "Use 'Hiding' Status Effect",
"hint": "Esta string será enviada através de i18n.localize(). Mudar isso pode afetar a automação geral dos efeitos do Stealthy.. If you want 'hiding', use 'EFFECT.DND5E.StatusHiding'",
"iconhint": "Ícone padrão para o efeito Escondido (ignored if using Status Effect)"
},
"perceptionDisadvantage": {
"name": "Desvantagem em Percepção na Penumbra",
"hint": "Usa a iluminação da cena para determinar se a desvantagem de Percepção se aplica aos tokens furtivos. Usa o centro X,Y do token, nada sofisticado."
Expand Down
2 changes: 1 addition & 1 deletion scripts/detectionModesMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class DetectionModesApplicationClass extends FormApplication {
getData() {
const context = super.getData();
const entries = Object.entries(this.#detectionModes)
.filter(([k,v]) => k in CONFIG.Canvas.detectionModes)
.filter(([k,v]) => k in CONFIG.Canvas.detectionModes && k !== 'undefined')
.map(([k, v]) => [k, {
label: CONFIG.Canvas.detectionModes[k].label,
enabled: v
Expand Down
2 changes: 1 addition & 1 deletion scripts/doors.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Stealthy } from "./stealthy.js";

export default class Doors {

static initialize() {
static setup() {
libWrapper.register(
Stealthy.MODULE_ID,
"WallConfig.prototype._updateObject",
Expand Down
Loading

0 comments on commit d309ff8

Please sign in to comment.