Skip to content

Commit 0081f8a

Browse files
Merge pull request #3806 from earthdawn-vtt/refactor/3137-refactoring--halfmagic-rolloptions
♻️💄 Update Half-Magic Workflow and Chat Message
2 parents db6eca6 + 09fbb64 commit 0081f8a

17 files changed

Lines changed: 269 additions & 81 deletions

File tree

dictionaries/ed4e-words.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ namegiver
44
vasgothia
55
edid
66
edids
7-
halfmagic
87
tskrang
98
obsidiman
109
spellcaster

lang/de.json

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@
391391
"damageRollOptions": "Schaden durch {damageSource}:",
392392
"edRollOptions": "Earthdawn Würfelwurf",
393393
"fullRestRecovery": "Erholungsproben aufgefüllt",
394+
"halfMagicRollOptions": "<p>{actor}</p><p>nutzt Halbmagie als</p><p>{discipline},</p><p>basierend auf {attribute}</p>",
394395
"horrorMarkRollOptions": "{horror} versucht ein Dämonenmal auf {caster} zu platzieren.",
395396
"ignoresArmor": "Ignoriert Rüstung",
396397
"invalidDiceFormula": "Ungültige Würfelformel",
@@ -402,7 +403,6 @@
402403
"rollAbility": "{sourceActor} würfelt {ability} ({step})",
403404
"rollAttribute": "{actor} würfelt {attribute} ({step})",
404405
"rollEquipment": "{sourceActor} würfelt {equipment} ({step})",
405-
"rollHalfMagic": "{actor} würfelt Halbmagie für die Disziplin {discipline}, basierend auf {attribute} mit Stufe {step}",
406406
"rollInitiative": "{sourceActor} würfelt {initiative} ({step})",
407407
"rollRecovery": "{sourceActor} nutzt Erholungsproben für {recoveryMode}",
408408
"rollSubstitute": "{actor} würfelt {attribute} ({step}) um {substitute} zu ersetzen",
@@ -675,7 +675,7 @@
675675
"attribute": "Attribute",
676676
"attuning": "Abstimmung",
677677
"damage": "Schaden",
678-
"halfmagic": "Halbmagie",
678+
"halfMagic": "Halbmagie",
679679
"horrorMark": "Dämonenmal",
680680
"initiative": "Initiative",
681681
"jumpUp": "Aufspringen",
@@ -2611,6 +2611,18 @@
26112611
}
26122612
}
26132613
},
2614+
"HalfMagicRollOptions": {
2615+
"FIELDS": {
2616+
"attribute": {
2617+
"hint": "Das Kürzel des Attributs auf dem die Halbmagie-Probe basiert",
2618+
"label": "Attribut-Kürzel"
2619+
},
2620+
"disciplineUuid": {
2621+
"hint": "UUID der Disizipline für die Halbmagie gewürfelt wird",
2622+
"label": "Disziplin-UUID"
2623+
}
2624+
}
2625+
},
26142626
"InitiativeRollOptions": {
26152627
"FIELDS": {
26162628
"increaseAbilities": {
@@ -3316,6 +3328,7 @@
33163328
"Title": {
33173329
"attuneGrimoire": "Struktur Verstehen um Grimoire abzustimmen",
33183330
"damage": "Schaden würfeln ({damageSourceType})",
3331+
"halfMagic": "Halbmagie auf {attribute} würfeln",
33193332
"itemHistory": "Artefaktgeschichte würfeln",
33203333
"jumpUp": "Aufspringen würfeln",
33213334
"rollAttribute": "Attributsprobe würfeln",

lang/en.json

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@
391391
"damageRollOptions": "Damage from {damageSource}:",
392392
"edRollOptions": "Earthdawn Roll",
393393
"fullRestRecovery": "Recovery tests refilled",
394+
"halfMagicRollOptions": "<p>{actor}</p><p>uses half-magic as</p><p>{discipline},</p><p>based on {attribute}</p>",
394395
"horrorMarkRollOptions": "{horror} attempts to place a horror mark on {caster}.",
395396
"ignoresArmor": "Ignores armor",
396397
"invalidDiceFormula": "Invalid die formula",
@@ -402,7 +403,6 @@
402403
"rollAbility": "{sourceActor} rolls {ability} ({step})",
403404
"rollAttribute": "{actor} rolls {attribute} ({step})",
404405
"rollEquipment": "{sourceActor} rolls {equipment} ({step})",
405-
"rollHalfMagic": "{actor} rolls half-magic for the discipline {discipline}, based on {attribute} with step {step}",
406406
"rollInitiative": "{sourceActor} rolls {initiative} ({step})",
407407
"rollRecovery": "{sourceActor} uses a recovery test for {recoveryMode}",
408408
"rollSubstitute": "{actor} rolls {attribute} ({step}) to replace {substitute}",
@@ -675,7 +675,7 @@
675675
"attribute": "Attribute",
676676
"attuning": "Attuning",
677677
"damage": "Damage",
678-
"halfmagic": "Half-Magic",
678+
"halfMagic": "Half-Magic",
679679
"horrorMark": "Horror Mark",
680680
"initiative": "Initiative",
681681
"jumpUp": "Jump Up",
@@ -2611,6 +2611,18 @@
26112611
}
26122612
}
26132613
},
2614+
"HalfMagicRollOptions": {
2615+
"FIELDS": {
2616+
"attribute": {
2617+
"hint": "The ID of the attribute the half magic is based on",
2618+
"label": "Attribute ID"
2619+
},
2620+
"disciplineUuid": {
2621+
"hint": "UUID of the discipline for which half magic is rolled",
2622+
"label": "Discipline UUID"
2623+
}
2624+
}
2625+
},
26142626
"InitiativeRollOptions": {
26152627
"FIELDS": {
26162628
"increaseAbilities": {
@@ -3316,6 +3328,7 @@
33163328
"Title": {
33173329
"attuneGrimoire": "Patterncraft to Attune Grimoire",
33183330
"damage": "Roll Damage ({damageSourceType})",
3331+
"halfMagic": "Roll Half-Magic on {attribute}",
33193332
"itemHistory": "Roll Item History",
33203333
"jumpUp": "Roll Jump Up",
33213334
"rollAttribute": "TODO: Add translation",

lang/fr.json

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@
391391
"damageRollOptions": "Options de jet de dégâts",
392392
"edRollOptions": "Options de jet ED",
393393
"fullRestRecovery": "Récupération après repos complet",
394+
"halfMagicRollOptions": "Jet de Demi-magie",
394395
"horrorMarkRollOptions": "Options de jet de Marque d'Horreur",
395396
"ignoresArmor": "Ignore l'armure",
396397
"invalidDiceFormula": "Formule de dés invalide",
@@ -402,7 +403,6 @@
402403
"rollAbility": "Jet de capacité",
403404
"rollAttribute": "Jet d'attribut",
404405
"rollEquipment": "Jet d'équipement",
405-
"rollHalfMagic": "Jet de Demi-magie",
406406
"rollInitiative": "Jet d'Initiative",
407407
"rollRecovery": "Jet de Récupération",
408408
"rollSubstitute": "Jet de substitution",
@@ -675,7 +675,7 @@
675675
"attribute": "Attribut",
676676
"attuning": "Harmonisation",
677677
"damage": "Dégâts",
678-
"halfmagic": "Demi-magie",
678+
"halfMagic": "Demi-magie",
679679
"horrorMark": "Marque d'Horreur",
680680
"initiative": "Initiative",
681681
"jumpUp": "Se redresser",
@@ -2611,6 +2611,18 @@
26112611
}
26122612
}
26132613
},
2614+
"HalfMagicRollOptions": {
2615+
"FIELDS": {
2616+
"attribute": {
2617+
"hint": "TODO: Add translation",
2618+
"label": "TODO: Add translation"
2619+
},
2620+
"disciplineUuid": {
2621+
"hint": "TODO: Add translation",
2622+
"label": "TODO: Add translation"
2623+
}
2624+
}
2625+
},
26142626
"InitiativeRollOptions": {
26152627
"FIELDS": {
26162628
"increaseAbilities": {
@@ -3316,6 +3328,7 @@
33163328
"Title": {
33173329
"attuneGrimoire": "Harmoniser au Grimoire",
33183330
"damage": "Dégâts",
3331+
"halfMagic": "TODO: Add translation",
33193332
"itemHistory": "Historique de l'Objet",
33203333
"jumpUp": "Se redresser",
33213334
"rollAttribute": "Jeter l'Attribut",

lang/pl.json

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@
391391
"damageRollOptions": "TODO: Add translation",
392392
"edRollOptions": "TODO: Add translation",
393393
"fullRestRecovery": "TODO: Add translation",
394+
"halfMagicRollOptions": "TODO: Add translation",
394395
"horrorMarkRollOptions": "TODO: Add translation",
395396
"ignoresArmor": "TODO: Add translation",
396397
"invalidDiceFormula": "TODO: Add translation",
@@ -402,7 +403,6 @@
402403
"rollAbility": "TODO: Add translation",
403404
"rollAttribute": "TODO: Add translation",
404405
"rollEquipment": "TODO: Add translation",
405-
"rollHalfMagic": "TODO: Add translation",
406406
"rollInitiative": "TODO: Add translation",
407407
"rollRecovery": "TODO: Add translation",
408408
"rollSubstitute": "TODO: Add translation",
@@ -675,7 +675,7 @@
675675
"attribute": "TODO: Add translation",
676676
"attuning": "TODO: Add translation",
677677
"damage": "TODO: Add translation",
678-
"halfmagic": "TODO: Add translation",
678+
"halfMagic": "TODO: Add translation",
679679
"horrorMark": "TODO: Add translation",
680680
"initiative": "TODO: Add translation",
681681
"jumpUp": "TODO: Add translation",
@@ -2611,6 +2611,18 @@
26112611
}
26122612
}
26132613
},
2614+
"HalfMagicRollOptions": {
2615+
"FIELDS": {
2616+
"attribute": {
2617+
"hint": "TODO: Add translation",
2618+
"label": "TODO: Add translation"
2619+
},
2620+
"disciplineUuid": {
2621+
"hint": "TODO: Add translation",
2622+
"label": "TODO: Add translation"
2623+
}
2624+
}
2625+
},
26142626
"InitiativeRollOptions": {
26152627
"FIELDS": {
26162628
"increaseAbilities": {
@@ -3316,6 +3328,7 @@
33163328
"Title": {
33173329
"attuneGrimoire": "TODO: Add translation",
33183330
"damage": "TODO: Add translation",
3331+
"halfMagic": "TODO: Add translation",
33193332
"itemHistory": "TODO: Add translation",
33203333
"jumpUp": "TODO: Add translation",
33213334
"rollAttribute": "TODO: Add translation",

module/applications/actor/namegiver-sheet.mjs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ export default class ActorSheetEdNamegiver extends ActorSheetEdSentient {
2727
form: {
2828
submitOnChange: true,
2929
},
30-
actions: {
31-
halfmagic: ActorSheetEdNamegiver.rollHalfMagic,
32-
},
3330
};
3431

3532
/** @inheritdoc */
@@ -58,15 +55,4 @@ export default class ActorSheetEdNamegiver extends ActorSheetEdSentient {
5855
return super._onDropItem( event, item );
5956
}
6057

61-
// region Actions
62-
/**
63-
* This function triggers the half magic roll of an adept.
64-
* @param {Event} event - The event that triggered the form submission.
65-
* @param {HTMLElement} target - The HTML element that triggered the action.
66-
*/
67-
static async rollHalfMagic( event, target ) {
68-
event.preventDefault();
69-
ui.notifications.info( "Half magic not done yet" );
70-
this.document.rollHalfMagic( { event: event } );
71-
}
7258
}

module/config/handlebars.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ export const partials = [
205205
"systems/ed4e/templates/chat/chat-flavor/attribute-roll-flavor.hbs",
206206
"systems/ed4e/templates/chat/chat-flavor/damage-roll-flavor.hbs",
207207
"systems/ed4e/templates/chat/chat-flavor/effect-roll-flavor.hbs",
208-
"systems/ed4e/templates/chat/chat-flavor/halfmagic-roll-flavor.hbs",
208+
"systems/ed4e/templates/chat/chat-flavor/half-magic-roll-flavor.hbs",
209209
"systems/ed4e/templates/chat/chat-flavor/initiative-roll-flavor.hbs",
210210
"systems/ed4e/templates/chat/chat-flavor/recovery-roll-flavor.hbs",
211211
"systems/ed4e/templates/chat/chat-flavor/spellcasting-roll-flavor.hbs",

module/config/rolls.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ export const rollTypes = {
4141
label: "ED.Config.RollTypes.damage",
4242
flavorTemplate: "systems/ed4e/templates/chat/chat-flavor/damage-roll-flavor.hbs",
4343
},
44-
halfmagic: {
45-
label: "ED.Config.RollTypes.halfmagic",
46-
flavorTemplate: "systems/ed4e/templates/chat/chat-flavor/halfmagic-roll-flavor.hbs",
44+
halfMagic: {
45+
label: "ED.Config.RollTypes.halfMagic",
46+
flavorTemplate: "systems/ed4e/templates/chat/chat-flavor/half-magic-roll-flavor.hbs",
4747
},
4848
horrorMark: {
4949
label: "ED.Config.RollTypes.horrorMark",

module/config/system.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export const icons = {
116116
eyeSlash: "fa-eye-slash",
117117
favoritable: "fa-star",
118118
finishCharGen: "fa-thin fa-check-double",
119-
halfmagic: "fa-hat-wizard",
119+
halfMagic: "fa-hat-wizard",
120120
initiative: "fa-running",
121121
itemHistory: "fa-history",
122122
nextCharGen: "fa-thin fa-arrow-right",

module/data/item/templates/rollable.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default class RollableTemplate extends SystemDataModel {
2828
initial: "",
2929
choices: filterObject(
3030
ROLLS.rollTypes,
31-
( key, _ ) => ![ "attribute", "attuning", "halfmagic" ].includes( key )
31+
( key, _ ) => ![ "attribute", "attuning", "halfMagic" ].includes( key )
3232
),
3333
} ),
3434
rollTypeDetails: new fields.SchemaField( {

0 commit comments

Comments
 (0)