Skip to content

Commit 7418feb

Browse files
committed
add blast button to chat when using abilities that have blast, other fixes
1 parent 4fcce9a commit 7418feb

File tree

13 files changed

+47
-19
lines changed

13 files changed

+47
-19
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ The **official** system for playing Warhammer 40k: Wrath & Glory on [Foundry VTT
33

44
![](https://img.shields.io/github/v/release/moo-man/WrathAndGlory-FoundryVTT?label=Latest%20Version)
55
![](https://img.shields.io/github/downloads/moo-man/WrathAndGlory-FoundryVTT/latest/wrath-and-glory.zip?label=Downloads%20%28Latest%20Version%29)
6-
![](https://img.shields.io/badge/FoundryVTT%20Compatibility-V12-orange)
6+
![](https://img.shields.io/badge/FoundryVTT%20Compatibility-V13-orange)
77

88
![repo-cover-wng](https://user-images.githubusercontent.com/28637157/146312294-3568bd17-9556-4a66-8072-905b42d3cff7.png)
99

@@ -19,10 +19,12 @@ The **official** system for playing Warhammer 40k: Wrath & Glory on [Foundry VTT
1919
- [Wrath & Glory - Redacted Records I](https://foundryvtt.com/packages/wng-records1) - This magazine-style collection of articles uncovers numerous secrets of the Gilead System, opening up new settings and antagonists for players to explore and confront, and new character options to increase Agents’ chance of surviving these new and perilous situations.
2020
- [Wrath & Glory - Church of Steel](https://foundryvtt.com/packages/wng-cos) - Unveil the mysteries of the Machine Spirit and unleash the massive power of machines of war with this comprehensive guide to vehicles.
2121
- [Wrath & Glory - Threat Assessment: Xenos](https://foundryvtt.com/packages/wng-xenos) - Contains a mass of new alien threats to challenge Agents of any Tier, and is the perfect companion to any Warhammer 40,000 Wrath & Glory campaign.
22-
22+
- [Wrath & Glory - Redacted Records II](https://foundryvtt.com/packages/wng-records2) - An invaluable resource suffused with scriptures of righteous destruction and technological liturgies to empower your games with an abundance of new ways to play.
23+
- [Wrath & Glory - Darktide: Extraction](https://foundryvtt.com/packages/wng-darktide) - Explore the setting of Warhammer 40,000: Darktide as Inquisitor Grendyl dispatches you to a lost region of Hive Tertium. Play Darktide? Bring your Darktide character to life by importing them directly into the game!
2324

2425
## Special Thanks
2526
- Cubicle 7
27+
- FatShark
2628
- Perfectro (original system creator)
2729
- Thul (Features, testing and suggestions)
2830

scripts/apps/character-creation.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,18 @@ export default class CharacterCreation extends FormApplication {
6060
let data = super.getData();
6161
this.species = await this.species;
6262
this.faction = await this.faction;
63-
this.archetypeAbilities = await this.archetype.system.abilities.awaitDocuments();
64-
this.speciesAbilities = await this.species.system.abilities.awaitDocuments()
63+
if (!this.species)
64+
{
65+
ui.notifications.error("Archetypes must assign a Species Item");
66+
throw "Archetypes must assign a Species Item";
67+
}
68+
if (!this.faction)
69+
{
70+
ui.notifications.error("Archetypes must assign a Faction Item");
71+
throw "Archetypes must assign a Faction Item";
72+
}
73+
this.archetypeAbilities = await this.archetype?.system.abilities.awaitDocuments() || [];
74+
this.speciesAbilities = await this.species?.system.abilities.awaitDocuments() || []
6575

6676
await this.initializeCharacter()
6777

scripts/common/config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ WNG.premiumModules = {
357357
"wng-xenos" : "Threat Assessment: Xenos",
358358
"wng-starter-set" : "Starter Set",
359359
"wng-records2" : "Redacted Records: Vol. II",
360+
"wng-darktide" : "DarkTide: Extraction",
360361
}
361362

362363
WNG.transferTypes = {

scripts/common/tests/ability-roll.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export default class AbilityRoll extends WNGTest {
4747
if (this.testData.damage)
4848
{
4949
this.computeDamage()
50+
this.result.blast = this.item.system.traits.has("blast").rating;
5051
}
5152
}
5253

scripts/common/utility.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ export default class WNGUtility {
107107
}
108108
}
109109

110+
// TODO remove this (church of steel, xenos), prefer @Embed
110111
static async tableToHTML(table, label, options=[])
111112
{
112113
let noCenter = options.includes("no-center");

scripts/document/actor.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ export class WrathAndGloryActor extends WarhammerActor {
238238
roll.sendToChat();
239239
}
240240

241-
async setupTestFromItem(item, context, options)
241+
async setupTestFromItem(item, context={}, options={})
242242
{
243243
if (typeof item == "string")
244244
{
@@ -437,6 +437,8 @@ export class WrathAndGloryActor extends WarhammerActor {
437437
ap += modifiers.ap.reduce((acc, mod) => acc + mod.value, 0);
438438
mortal += modifiers.mortal.reduce((acc, mod) => acc + mod.value, 0);
439439
res += modifiers.resilience.reduce((acc, mod) => acc + mod.value, 0);
440+
441+
addModifierBreakdown("resilience", "Resilience");
440442

441443
if (invuln)
442444
{

scripts/model/item/faction.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ export class FactionModel extends StandardItemModel
2121

2222
shouldTransferEffect(effect)
2323
{
24+
if (effect.getFlag(game.system.id, "forceTransfer"))
25+
{
26+
return true;
27+
}
28+
2429
for (let bg of this.backgrounds.origin.concat(this.backgrounds.accomplishment).concat(this.backgrounds.goal))
2530
{
2631
if (bg.chosen && bg.effect.id == effect.id && !effect.changes.some(c => c.mode == 0))

scripts/model/message/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export class WrathAndGloryTestMessageModel extends WarhammerTestMessageModel
139139
let table = game.tables.getName("Mutation Severity")
140140
let roll = new Roll(table.formula)
141141
let result = await table.roll({ roll })
142-
ChatMessage.create({ content: result.results[0].getChatText() + ` (${result.roll.total})`, roll : result.roll, type: CONST.CHAT_MESSAGE_TYPES.ROLL, flavor: `Mutation`, speaker : test.context.speaker })
142+
ChatMessage.create({ content: await result.results[0].getHTML() + ` (${result.roll.total})`, roll : result.roll, type: CONST.CHAT_MESSAGE_TYPES.ROLL, flavor: `Mutation`, speaker : test.context.speaker })
143143
}
144144
static _onAddPotency(ev, target)
145145
{

static/templates/actor/agent/agent-notes.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
<h2 class="sheet-divider">{{localize "TITLE.ASCENSION"}}</h2>
104104

105105
<div class="ascensions">
106-
<button data-action="createItem" data-type="ascension"><i class="fa-solid fa-plus"></i></button>
106+
<button type="button" data-action="createItem" data-type="ascension"><i class="fa-solid fa-plus"></i></button>
107107
{{#each items.ascension}}
108108
<div class="ascension context-menu-alt" data-uuid="{{this.uuid}}">
109109
<img src="{{this.img}}">

static/templates/chat/roll/ability/ability-use.hbs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,20 @@
1313
</div>
1414
{{/if}}
1515

16+
{{#if result.blast}}
17+
<div class="wrapper">
18+
<button type="button" data-action="blast" data-blast="{{result.blast}}"><i class="fa-solid fa-ruler-combined"></i> Blast</button>
19+
</div>
20+
{{/if}}
21+
22+
1623
{{#if showTest}}
1724
<div class="wrapper">
1825
<button type="button" data-action="rollTest">{{testDisplay}}</button>
1926
</div>
2027
{{/if}}
2128

29+
2230
<div class="wrapper">
2331
{{> effectButtons}}
2432
</div>

0 commit comments

Comments
 (0)