Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cover statuses #4013

Merged
merged 5 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions icons/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ The dnd5e system for Foundry Virtual Tabletop includes icon artwork licensed fro
/svg/properties/magical.svg - "Sparkling sabre icon" by Lorc under CC BY 3.0
/svg/statuses/bloodied.svg - "Blood icon" by Skoll under CC BY 3.0
/svg/statuses/burrowing.svg - "Spade icon" by Lorc under CC BY 3.0
/svg/statuses/cover-*.svg - "Shield Icon" by sbed under CC BY 3.0
/svg/statuses/cursed.svg - "Ubisoft sun icon" by Lorc under CC BY 3.0
/svg/statuses/diseased.svg - "Biohazard icon" by Lorc under CC BY 3.0
/svg/statuses/ethereal.svg - "Ghost ally icon" by Lorc under CC BY 3.0
Expand Down
6 changes: 6 additions & 0 deletions icons/svg/statuses/cover-full.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions icons/svg/statuses/cover-half.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions icons/svg/statuses/cover-three-quarters.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2891,6 +2891,8 @@
"StatusEthereal": "Ethereal",
"StatusExceedingCarryingCapacity": "Exceeding Carrying Capacity",
"StatusFlying": "Flying",
"StatusFullCover": "Full Cover",
arbron marked this conversation as resolved.
Show resolved Hide resolved
"StatusHalfCover": "Half Cover",
"StatusHeavilyEncumbered": "Heavily Encumbered",
"StatusHiding": "Hiding",
"StatusHovering": "Hovering",
Expand All @@ -2899,6 +2901,7 @@
"StatusSleeping": "Sleeping",
"StatusStable": "Stable",
"StatusSurprised": "Surprised",
"StatusThreeQuartersCover": "Three-Quarters Cover",
"StatusTransformed": "Transformed"
},

Expand Down
21 changes: 19 additions & 2 deletions module/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2741,6 +2741,7 @@ DND5E.consumableResources = [
/**
* @typedef {object} _StatusEffectConfig5e
* @property {string} icon Icon used to represent the condition on the token.
* @property {number} [order] Order status to the start of the token HUD, rather than alphabetically.
* @property {string} [reference] UUID of a journal entry with details on this condition.
* @property {string} [special] Set this condition as a special status effect under this name.
* @property {string[]} [riders] Additional conditions, by id, to apply as part of this condition.
Expand Down Expand Up @@ -2908,7 +2909,7 @@ DND5E.conditionEffects = {
/**
* Extra status effects not specified in `conditionTypes`. If the ID matches a core-provided effect, then this
* data will be merged into the core data.
* @enum {Omit<StatusEffectConfig5e, "img"> & {icon: string}}
* @enum {Omit<StatusEffectConfig5e, "img"> & { icon: string }}
*/
DND5E.statusEffects = {
burrowing: {
Expand All @@ -2921,10 +2922,26 @@ DND5E.statusEffects = {
icon: "systems/dnd5e/icons/svg/statuses/concentrating.svg",
special: "CONCENTRATING"
},
coverFull: {
name: "EFFECT.DND5E.StatusFullCover",
icon: "systems/dnd5e/icons/svg/statuses/cover-full.svg",
order: 4
},
coverHalf: {
name: "EFFECT.DND5E.StatusHalfCover",
icon: "systems/dnd5e/icons/svg/statuses/cover-half.svg",
order: 2
},
coverThreeQuarters: {
name: "EFFECT.DND5E.StatusThreeQuartersCover",
icon: "systems/dnd5e/icons/svg/statuses/cover-three-quarters.svg",
order: 3
},
dead: {
name: "EFFECT.DND5E.StatusDead",
icon: "systems/dnd5e/icons/svg/statuses/dead.svg",
special: "DEFEATED"
special: "DEFEATED",
order: 1
},
dodging: {
name: "EFFECT.DND5E.StatusDodging",
Expand Down
1 change: 0 additions & 1 deletion module/documents/active-effect.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import FormulaField from "../data/fields/formula-field.mjs";
import { EnchantmentData } from "../data/item/fields/enchantment-field.mjs";
import { staticID } from "../utils.mjs";

/**
Expand Down
3 changes: 2 additions & 1 deletion module/utils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,8 @@ export function performPreLocalization(config) {
// Localize & sort status effects
CONFIG.statusEffects.forEach(s => s.name = game.i18n.localize(s.name));
CONFIG.statusEffects.sort((lhs, rhs) =>
lhs.id === "dead" ? -1 : rhs.id === "dead" ? 1 : lhs.name.localeCompare(rhs.name, game.i18n.lang)
lhs.order || rhs.order ? (lhs.order ?? Infinity) - (rhs.order ?? Infinity)
: lhs.name.localeCompare(rhs.name, game.i18n.lang)
);
}

Expand Down