Skip to content

Commit

Permalink
Major work on resistance rolls, added AI
Browse files Browse the repository at this point in the history
  • Loading branch information
Eunomiac committed Oct 14, 2023
1 parent 435ac61 commit 122249a
Show file tree
Hide file tree
Showing 62 changed files with 3,504 additions and 7,538 deletions.
431 changes: 333 additions & 98 deletions css/style.min.css

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion css/tinymce/content.min.css
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,12 @@ html, :root {
--line-height-expanded: 1.4;
--line-height-primary: 1.2;
--line-height-compact: 1;
--text-shadow-dark: 0.1rem 0.1rem 0.2rem var(--blades-black-dark);
--text-shadow-dark:
1px 1px 2px var(--blades-black-dark);
--text-shadow-dark-strong:
1px 1px 2px var(--blades-black-dark),
1px 1px 2px var(--blades-black-dark),
1px 1px 2px var(--blades-black-dark);
--box-shadow-dark: inset 0 0 0.3rem var(--blades-black-dark-fade);
--box-shadow-dark-strong: inset 0 0 0.5rem var(--blades-black-dark);
--color-default: var(--blades-white);
Expand Down
8 changes: 0 additions & 8 deletions module/@types/blades-sheet.d copy.js

This file was deleted.

10 changes: 5 additions & 5 deletions module/BladesActor.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import U from "./core/utilities.js";
import C, { BladesActorType, Tag, Playbook, BladesItemType, ActionTrait, PrereqType, AdvancementPoint, Randomizers, Factor } from "./core/constants.js";
import { BladesItem } from "./documents/BladesItemProxy.js";
import BladesPushController from "./BladesPushController.js";
import BladesPushAlert from "./BladesPushAlert.js";
import { SelectionCategory } from "./BladesDialog.js";
var BladesActorUniqueTags;
(function (BladesActorUniqueTags) {
Expand Down Expand Up @@ -713,15 +713,15 @@ class BladesActor extends Actor {
}
await this.update({ "system.experience.playbook.value": 0 });
if (BladesActor.IsType(this, BladesActorType.pc)) {
BladesPushController.Get().pushToAll("GM", `${this.name} Advances their Playbook!`, `${this.name}, select a new Ability on your Character Sheet.`);
BladesPushAlert.Get().pushToAll("GM", `${this.name} Advances their Playbook!`, `${this.name}, select a new Ability on your Character Sheet.`);
this.grantAdvancementPoints(AdvancementPoint.Ability);
return;
}
if (BladesActor.IsType(this, BladesActorType.crew)) {
BladesPushController.Get().pushToAll("GM", `${this.name} Advances their Playbook!`, "Select new Upgrades and/or Abilities on your Crew Sheet.");
BladesPushAlert.Get().pushToAll("GM", `${this.name} Advances their Playbook!`, "Select new Upgrades and/or Abilities on your Crew Sheet.");
this.members.forEach(member => {
const coinGained = this.system.tier.value + 2;
BladesPushController.Get().pushToAll("GM", `${member.name} Gains ${coinGained} Stash (Crew Advancement)`, undefined);
BladesPushAlert.Get().pushToAll("GM", `${member.name} Gains ${coinGained} Stash (Crew Advancement)`, undefined);
member.addStash(coinGained);
});
this.grantAdvancementPoints(AdvancementPoint.UpgradeOrAbility, 2);
Expand All @@ -730,7 +730,7 @@ class BladesActor extends Actor {
async advanceAttribute(attribute) {
await this.update({ [`system.experience.${attribute}.value`]: 0 });
const actions = C.Action[attribute].map(action => `<strong>${U.tCase(action)}</strong>`);
BladesPushController.Get().pushToAll("GM", `${this.name} Advances their ${U.uCase(attribute)}!`, `${this.name}, add a dot to one of ${U.oxfordize(actions, true, "or")}.`);
BladesPushAlert.Get().pushToAll("GM", `${this.name} Advances their ${U.uCase(attribute)}!`, `${this.name}, add a dot to one of ${U.oxfordize(actions, true, "or")}.`);
}
parentActor;
get isSubActor() { return this.parentActor !== undefined; }
Expand Down
2 changes: 1 addition & 1 deletion module/BladesItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import C, { BladesActorType, BladesItemType, Tag, Factor } from "./core/constants.js";
import U from "./core/utilities.js";
import { BladesActor } from "./documents/BladesActorProxy.js";
import { BladesRollMod } from "./BladesRollCollab.js";
import { BladesRollMod } from "./BladesRoll.js";
class BladesItem extends Item {

static async create(data, options = {}) {
Expand Down
14 changes: 7 additions & 7 deletions module/BladesPushController.js → module/BladesPushAlert.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
\* ****▌███████████████████████████████████████████████████████████████████████████▐**** */

import U from "./core/utilities.js";
export default class BladesPushController {
export default class BladesPushAlert {
static Get() {
if (!game.eunoblades.PushController) {
throw new Error("Attempt to Get BladesPushController before 'ready' hook.");
throw new Error("Attempt to Get BladesPushAlert before 'ready' hook.");
}
return game.eunoblades.PushController;
}
Expand All @@ -18,8 +18,8 @@ export default class BladesPushController {
game.eunoblades ??= {};
Hooks.once("ready", async () => {
let pushController = game.eunoblades.PushController;
if (!(pushController instanceof BladesPushController)) {
pushController = new BladesPushController();
if (!(pushController instanceof BladesPushAlert)) {
pushController = new BladesPushAlert();
}
game.eunoblades.PushController = pushController;
pushController.initOverlay();
Expand All @@ -35,13 +35,13 @@ export default class BladesPushController {
}
initOverlay() {
$("#sidebar").append($("<div id='blades-push-notifications'></div>"));
BladesPushController.isInitialized = true;
BladesPushAlert.isInitialized = true;
}
get elem$() { return $("#blades-push-notifications"); }
get elem() { return this.elem$[0]; }
activeNotifications = {};
push(blockClass, charName, titleText, bodyText) {
const pushController = BladesPushController.Get();
const pushController = BladesPushAlert.Get();
const pushID = randomID();
const pushLines = [
`<div id="#blades-push-${pushID}" class="push-notice${charName === "GM" ? " gm-notice" : ""} ${blockClass}">`
Expand Down Expand Up @@ -86,7 +86,7 @@ export default class BladesPushController {
return;
}
const pushArgs = args.slice(0, 3);
socketlib.system.executeForUsers("pushNotice", users.map((user) => user.id), "", ...pushArgs);
socketlib.system.executeForUsers("pushNotice", users.map(user => user.id), "", ...pushArgs);
}
pushToGM(...args) {
socketlib.system.executeForAllGMs("pushNotice", "to-gm-notice", ...args);
Expand Down
Loading

0 comments on commit 122249a

Please sign in to comment.