Skip to content

Commit

Permalink
It might work, now have to fix templates
Browse files Browse the repository at this point in the history
  • Loading branch information
Eunomiac committed Feb 13, 2024
1 parent 84b1047 commit bd045b2
Show file tree
Hide file tree
Showing 28 changed files with 1,234 additions and 753 deletions.
2 changes: 1 addition & 1 deletion css/style.min.css
Original file line number Diff line number Diff line change
Expand Up @@ -18184,7 +18184,7 @@ template {
:root body.vtt.game.system-eunos-blades #hotbar #chat #chat-log *,
:root body.vtt.game.system-eunos-blades #players #chat #chat-log,
:root body.vtt.game.system-eunos-blades #players #chat #chat-log * {
--font-primary: "Beaufort", ;
--font-primary: "Beaufort", serif, ;
}
:root body.vtt.game.system-eunos-blades #interface #chat .flexrow.jump-to-bottom,
:root body.vtt.game.system-eunos-blades #controls #chat .flexrow.jump-to-bottom,
Expand Down
2 changes: 1 addition & 1 deletion module/BladesActor.js
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ class BladesActor extends Actor {
get isSubActor() { return this.parentActor !== undefined; }
// #endregion
// #region BladesRoll Implementation ~
get rollModsSchemaSet() {
get rollPrimaryModsSchemaSet() {
return BladesRollMod.ParseDocModsToSchemaSet(this);
}
get rollFactors() {
Expand Down
2 changes: 1 addition & 1 deletion module/BladesItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class BladesItem extends Item {
return this.type;
}
get rollPrimaryImg() { return this.img; }
get rollModsSchemaSet() {
get rollPrimaryModsSchemaSet() {
// Add roll mods from COHORT harm
return BladesRollMod.ParseDocModsToSchemaSet(this);
}
Expand Down
55 changes: 12 additions & 43 deletions module/blades.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
// #region ▮▮▮▮▮▮▮ IMPORTS ▮▮▮▮▮▮▮ ~
import C, { ActionTrait, AttributeTrait, RollType, ConsequenceType } from "./core/constants.js";
import C, { ActionTrait, RollType } from "./core/constants.js";
import registerSettings, { initTinyMCEStyles, initCanvasStyles, initDOMStyles } from "./core/settings.js";
import { registerHandlebarHelpers, preloadHandlebarsTemplates } from "./core/helpers.js";
import BladesChat from "./classes/BladesChat.js";
Expand All @@ -18,15 +18,16 @@ import BladesPCSheet from "./sheets/actor/BladesPCSheet.js";
import BladesCrewSheet from "./sheets/actor/BladesCrewSheet.js";
import BladesNPCSheet from "./sheets/actor/BladesNPCSheet.js";
import BladesFactionSheet from "./sheets/actor/BladesFactionSheet.js";
import BladesRoll, { BladesRollMod, BladesRollPrimary, BladesRollOpposition, BladesRollParticipant, BladesActionRoll, BladesResistanceRoll } from "./classes/BladesRoll.js";
import BladesRoll, { BladesRollMod, BladesRollPrimary, BladesRollOpposition, BladesRollParticipant, BladesActionRoll, BladesEngagementRoll, BladesFortuneRoll, BladesIncarcerationRoll, BladesIndulgeViceRoll, BladesInlineResistanceRoll, BladesResistanceRoll } from "./classes/BladesRoll.js";
import BladesDialog from "./classes/BladesDialog.js";
import BladesAI, { AGENTS, AIAssistant } from "./core/ai.js";
import BladesActiveEffect from "./documents/BladesActiveEffect.js";
import BladesGMTrackerSheet from "./sheets/item/BladesGMTrackerSheet.js";
import BladesClockKeeperSheet from "./sheets/item/BladesClockKeeperSheet.js";
CONFIG.debug.logging = true;
/* DEVCODE*/
Object.assign(globalThis, { eLog: logger });
import BladesDebug from "./core/debug.js";
CONFIG.debug.logging = true;
Object.assign(globalThis, { eLog: logger, BladesDebug });
Handlebars.registerHelper("eLog", logger.hbsLog);
/* !DEVCODE*/
let socket; // ~ SocketLib interface
Expand Down Expand Up @@ -59,45 +60,6 @@ class GlobalGetter {
};
BladesActionRoll.New(conf);
}
async newResistanceRoll() {
const pc = game.actors.getName("Alistair");
if (!pc?.id) {
return;
}
const csq = await BladesConsequence.Create({
target: pc,
targetFlagKey: "rollConsequence",
name: "Shattered Knee",
isScopingById: true,
type: ConsequenceType.ProwessHarm3,
primaryID: pc.uuid,
attribute: AttributeTrait.prowess,
attributeVal: 3,
resistSchema: {
name: "Banged Knee",
type: ConsequenceType.ProwessHarm2,
primaryID: pc.uuid,
canResistWithSpecial: true,
resistWithSpecialNegates: true,
specialFooterMsg: "Ability: Spend to Fully Negate."
},
canResistWithRoll: true,
canResistWithSpecial: true,
resistWithSpecialNegates: true,
specialFooterMsg: "Ability: Spend to Fully Negate."
});
const conf = {
target: pc,
targetFlagKey: "rollCollab",
rollType: RollType.Resistance,
rollUserID: game.users.find((user) => user.character?.name === "Alistair")?.id,
rollPrimaryData: pc,
resistanceData: {
consequence: csq.data
}
};
BladesResistanceRoll.New(conf);
}
}
// #region Globals: Exposing Functionality to Global Scope ~
/* DEVCODE*/ Object.assign(globalThis, {
Expand Down Expand Up @@ -126,6 +88,13 @@ class GlobalGetter {
BladesRollPrimary,
BladesRollOpposition,
BladesRollParticipant,
BladesActionRoll,
BladesEngagementRoll,
BladesFortuneRoll,
BladesIncarcerationRoll,
BladesIndulgeViceRoll,
BladesInlineResistanceRoll,
BladesResistanceRoll,
BladesChat,
BladesConsequence,
G,
Expand Down
10 changes: 4 additions & 6 deletions module/classes/BladesClocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class BladesClockKey extends BladesTargetLink {
// If no clocks provided, add one default clock.
clocksInitialData.push({});
}
// Generate a local-only TargetLink nstance, to assist in deriving values for the clocks data
// Generate a local-only TargetLink instance, to assist in deriving values for the clocks data
const tempLink = new BladesTargetLink(config);
// Generate the targetKey or targetFlagKey for each clockData
if (tempLink.targetKeyPrefix) {
Expand Down Expand Up @@ -316,12 +316,10 @@ class BladesClockKey extends BladesTargetLink {
}
return options;
}
// #endregion
// #region ~~~ CONSTRUCTOR & CLOCK CONFIG PARSER ~~~
constructor(data) {
super(data);
constructor(dataOrConfig) {
super(dataOrConfig);
game.eunoblades.ClockKeys.set(this.id, this);
Object.values(data.clocksData).forEach((clockData) => new BladesClock(clockData));
Object.values(dataOrConfig.clocksData ?? {}).forEach((clockData) => new BladesClock(clockData));
}
// parseClockConfig(config: BladesClock.Config, indexOverride?: ClockIndex): BladesClock.Data {
// if (this.size === 6) {throw new Error("Cannot add a clock to a clock key with 6 clocks.");}
Expand Down
4 changes: 2 additions & 2 deletions module/classes/BladesConsequence.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ class BladesConsequence extends BladesTargetLink {
if (this._consequenceNone) {
return this._consequenceNone;
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { id, ...linkData } = this.linkData;
return BladesConsequence.Create({ ...linkData, ...BladesConsequence.PartialNoneSchema })
.then((csq) => this._consequenceNone = csq);
return BladesConsequence.Create({ ...linkData, ...BladesConsequence.PartialNoneSchema }).then((csq) => this._consequenceNone = csq);
}
get parentConsequence() {
if (!this.parentCsqID) {
Expand Down
Loading

0 comments on commit bd045b2

Please sign in to comment.