Skip to content

Commit

Permalink
Created BladesConsequence, work on Resistance rolls
Browse files Browse the repository at this point in the history
  • Loading branch information
Eunomiac committed Nov 20, 2023
1 parent daf9242 commit bc5602d
Show file tree
Hide file tree
Showing 52 changed files with 3,306 additions and 1,656 deletions.
707 changes: 362 additions & 345 deletions css/style.min.css

Large diffs are not rendered by default.

118 changes: 50 additions & 68 deletions css/tinymce/content.min.css
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,20 @@ html, :root {
--color-shadow-primary: var(--blades-white-bright-nums);
--color-text-dark-primary: var(--blades-white-nums);
--color-bg-option: var(--blades-black-nums);
--color-background-lightest: var(--blades-black-nums);
--color-background-light: var(--blades-black-dark-nums);
--blades-color-negative: var(--blades-red-bright);
--blades-color-positive: var(--blades-gold-bright);
--font-primary: "Minion Pro", serif;
--font-primary: "Beaufort", serif;
--font-primary-smallcaps: var(--font-primary);
--font-primary-small: "Minion Pro Caption", serif;
--font-primary-narrow: "Minion Pro Cond", serif;
--font-primary-small-narrow: "Minion Pro Caption Cond", serif;
--font-primary: "Beaufort", serif;
--font-primary-smallcaps: var(--font-primary);
--font-primary-small: var(--font-primary);
--font-primary-narrow: var(--font-primary);
--font-primary-small-narrow: var(--font-primary);
--font-primary-alt: "Historical FellType", serif;
--font-primary-alt-smallcaps: "Historical FellType SC", serif;
--font-emphasis: "Kirsty", serif;
Expand Down Expand Up @@ -1076,43 +1082,29 @@ html .comp.consequence-display-container, :root .comp.consequence-display-contai
max-height: var(--container-height);
min-height: var(--container-height);
}
@keyframes anim-glow {
0% {
box-shadow: 0 0 0px var(--blades-red-bright);
background-color: var(--blades-red-darkest);
}
10% {
background-color: var(--blades-red-bright);
}
100% {
box-shadow: 0 0 10px 10px transparent;
background-color: var(--blades-red-darkest);
}
}
@keyframes icon-glow {
0% {
filter: brightness(1);
filter: brightness(1) blur(1px) drop-shadow(0px 0px 0px rgb(115, 255, 213));
}
10% {
filter: brightness(1);
filter: brightness(1.25) blur(0px) drop-shadow(0px 0px 12px rgb(115, 255, 213));
}
100% {
filter: brightness(1);
filter: brightness(1) blur(1px) drop-shadow(0px 0px 0px rgb(115, 255, 213));
}
}
@keyframes icon-red-pulse {
0% {
scale: 1;
fill: var(--blades-grey);
}
10% {
scale: 1.1;
fill: var(--blades-red-bright);
}
100% {
scale: 1;
fill: var(--blades-grey);
}
html .comp.consequence-display-container.dead-roll, html .comp.consequence-display-container .dead-roll *, :root .comp.consequence-display-container.dead-roll, :root .comp.consequence-display-container .dead-roll * {
animation: none;
pointer-events: none;
}
html .comp.consequence-display-container.consequence-accepted, html .comp.consequence-display-container.consequence-accepted *, :root .comp.consequence-display-container.consequence-accepted, :root .comp.consequence-display-container.consequence-accepted * {
--container-left-shift: 0px;
--csq-type-color: var(--blades-red) !important;
--csq-icon-bright: var(--blades-red) !important;
animation: none !important;
pointer-events: none !important;
outline: none !important;
text-shadow: var(--text-shadow-dark) !important;
}
html .comp.consequence-display-container .base-consequence, :root .comp.consequence-display-container .base-consequence {
--csq-icon-dark: var(--blades-black);
Expand All @@ -1122,13 +1114,15 @@ html .comp.consequence-display-container .base-consequence, :root .comp.conseque
--csq-name-color: var(--blades-white);
}
html .comp.consequence-display-container .accept-consequence, :root .comp.consequence-display-container .accept-consequence {
opacity: 0;
--csq-icon-dark: var(--blades-red-dark);
--csq-icon-med: var(--blades-red);
--csq-icon-bright: var(--blades-red-bright);
--csq-type-color: var(--blades-black-dark);
--csq-name-color: var(--blades-red);
}
html .comp.consequence-display-container .accept-consequence, :root .comp.consequence-display-container .accept-consequence {
opacity: 0;
}
html .comp.consequence-display-container .resist-consequence, :root .comp.consequence-display-container .resist-consequence {
opacity: 0;
--csq-icon-dark: var(--blades-gold-dark);
Expand Down Expand Up @@ -1236,8 +1230,8 @@ html .comp.consequence-display-container .consequence-icon-container .consequenc
animation: icon-glow 2s ease infinite;
pointer-events: auto;
}
html .comp.consequence-display-container .consequence-icon-container .consequence-icon-circle.base-consequence svg path, :root .comp.consequence-display-container .consequence-icon-container .consequence-icon-circle.base-consequence svg path {
animation: icon-red-pulse 2s ease infinite;
html .comp.consequence-display-container .consequence-icon-container .consequence-icon-circle.base-consequence img, :root .comp.consequence-display-container .consequence-icon-container .consequence-icon-circle.base-consequence img {
animation: icon-glow 2s ease infinite;
}
html .comp.consequence-display-container .consequence-icon-container .consequence-icon-circle.base-consequence:hover, :root .comp.consequence-display-container .consequence-icon-container .consequence-icon-circle.base-consequence:hover {
filter: brightness(2) !important;
Expand Down Expand Up @@ -2709,43 +2703,29 @@ html .comp.consequence-display-container, :root .comp.consequence-display-contai
max-height: var(--container-height);
min-height: var(--container-height);
}
@keyframes anim-glow {
0% {
box-shadow: 0 0 0px var(--blades-red-bright);
background-color: var(--blades-red-darkest);
}
10% {
background-color: var(--blades-red-bright);
}
100% {
box-shadow: 0 0 10px 10px transparent;
background-color: var(--blades-red-darkest);
}
}
@keyframes icon-glow {
0% {
filter: brightness(1);
filter: brightness(1) blur(1px) drop-shadow(0px 0px 0px rgb(115, 255, 213));
}
10% {
filter: brightness(1);
filter: brightness(1.25) blur(0px) drop-shadow(0px 0px 12px rgb(115, 255, 213));
}
100% {
filter: brightness(1);
filter: brightness(1) blur(1px) drop-shadow(0px 0px 0px rgb(115, 255, 213));
}
}
@keyframes icon-red-pulse {
0% {
scale: 1;
fill: var(--blades-grey);
}
10% {
scale: 1.1;
fill: var(--blades-red-bright);
}
100% {
scale: 1;
fill: var(--blades-grey);
}
html .comp.consequence-display-container.dead-roll, html .comp.consequence-display-container .dead-roll *, :root .comp.consequence-display-container.dead-roll, :root .comp.consequence-display-container .dead-roll * {
animation: none;
pointer-events: none;
}
html .comp.consequence-display-container.consequence-accepted, html .comp.consequence-display-container.consequence-accepted *, :root .comp.consequence-display-container.consequence-accepted, :root .comp.consequence-display-container.consequence-accepted * {
--container-left-shift: 0px;
--csq-type-color: var(--blades-red) !important;
--csq-icon-bright: var(--blades-red) !important;
animation: none !important;
pointer-events: none !important;
outline: none !important;
text-shadow: var(--text-shadow-dark) !important;
}
html .comp.consequence-display-container .base-consequence, :root .comp.consequence-display-container .base-consequence {
--csq-icon-dark: var(--blades-black);
Expand All @@ -2755,13 +2735,15 @@ html .comp.consequence-display-container .base-consequence, :root .comp.conseque
--csq-name-color: var(--blades-white);
}
html .comp.consequence-display-container .accept-consequence, :root .comp.consequence-display-container .accept-consequence {
opacity: 0;
--csq-icon-dark: var(--blades-red-dark);
--csq-icon-med: var(--blades-red);
--csq-icon-bright: var(--blades-red-bright);
--csq-type-color: var(--blades-black-dark);
--csq-name-color: var(--blades-red);
}
html .comp.consequence-display-container .accept-consequence, :root .comp.consequence-display-container .accept-consequence {
opacity: 0;
}
html .comp.consequence-display-container .resist-consequence, :root .comp.consequence-display-container .resist-consequence {
opacity: 0;
--csq-icon-dark: var(--blades-gold-dark);
Expand Down Expand Up @@ -2869,8 +2851,8 @@ html .comp.consequence-display-container .consequence-icon-container .consequenc
animation: icon-glow 2s ease infinite;
pointer-events: auto;
}
html .comp.consequence-display-container .consequence-icon-container .consequence-icon-circle.base-consequence svg path, :root .comp.consequence-display-container .consequence-icon-container .consequence-icon-circle.base-consequence svg path {
animation: icon-red-pulse 2s ease infinite;
html .comp.consequence-display-container .consequence-icon-container .consequence-icon-circle.base-consequence img, :root .comp.consequence-display-container .consequence-icon-container .consequence-icon-circle.base-consequence img {
animation: icon-glow 2s ease infinite;
}
html .comp.consequence-display-container .consequence-icon-container .consequence-icon-circle.base-consequence:hover, :root .comp.consequence-display-container .consequence-icon-container .consequence-icon-circle.base-consequence:hover {
filter: brightness(2) !important;
Expand Down Expand Up @@ -4000,17 +3982,17 @@ html .player-character-summary-panel .pc-summary section.pc-summary-maluses .pc-
html .player-character-summary-panel .pc-summary section.pc-summary-maluses .pc-summary-harm-container .pc-summary-harm > i, :root .player-character-summary-panel .pc-summary section.pc-summary-maluses .pc-summary-harm-container .pc-summary-harm > i {
line-height: 15px;
}
html .player-character-summary-panel .pc-summary section.pc-summary-maluses .pc-summary-harm-container .pc-summary-harm.pc-harm-heavy, :root .player-character-summary-panel .pc-summary section.pc-summary-maluses .pc-summary-harm-container .pc-summary-harm.pc-harm-heavy {
html .player-character-summary-panel .pc-summary section.pc-summary-maluses .pc-summary-harm-container .pc-summary-harm.pc-harm-severe, :root .player-character-summary-panel .pc-summary section.pc-summary-maluses .pc-summary-harm-container .pc-summary-harm.pc-harm-severe {
color: var(--blades-white-bright);
background: var(--blades-red-dark);
font-weight: bold;
}
html .player-character-summary-panel .pc-summary section.pc-summary-maluses .pc-summary-harm-container .pc-summary-harm.pc-harm-medium, :root .player-character-summary-panel .pc-summary section.pc-summary-maluses .pc-summary-harm-container .pc-summary-harm.pc-harm-medium {
html .player-character-summary-panel .pc-summary section.pc-summary-maluses .pc-summary-harm-container .pc-summary-harm.pc-harm-moderate, :root .player-character-summary-panel .pc-summary section.pc-summary-maluses .pc-summary-harm-container .pc-summary-harm.pc-harm-moderate {
color: var(--blades-red-bright);
background: var(--blades-red-dark-fade);
font-weight: bold;
}
html .player-character-summary-panel .pc-summary section.pc-summary-maluses .pc-summary-harm-container .pc-summary-harm.pc-harm-light, :root .player-character-summary-panel .pc-summary section.pc-summary-maluses .pc-summary-harm-container .pc-summary-harm.pc-harm-light {
html .player-character-summary-panel .pc-summary section.pc-summary-maluses .pc-summary-harm-container .pc-summary-harm.pc-harm-lesser, :root .player-character-summary-panel .pc-summary section.pc-summary-maluses .pc-summary-harm-container .pc-summary-harm.pc-harm-lesser {
color: var(--blades-red-bright);
background: var(--blades-red-dark-fade-strong);
}
Expand Down
8 changes: 4 additions & 4 deletions module/BladesActor.js
Original file line number Diff line number Diff line change
Expand Up @@ -881,15 +881,15 @@ class BladesActor extends Actor {
}
await this.update({ "system.experience.playbook.value": 0 });
if (BladesActor.IsType(this, BladesActorType.pc)) {
BladesPushAlert.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.`, "advancement-alert");
this.grantAdvancementPoints(AdvancementPoint.Ability);
return;
}
if (BladesActor.IsType(this, BladesActorType.crew)) {
BladesPushAlert.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.", "advancement-alert");
this.members.forEach((member) => {
const coinGained = this.system.tier.value + 2;
BladesPushAlert.Get().pushToAll("GM", `${member.name} Gains ${coinGained} Stash (Crew Advancement)`, undefined);
BladesPushAlert.Get().pushToAll("GM", `${member.name} Gains ${coinGained} Stash (Crew Advancement)`, null, "stash-gain-alert");
member.addStash(coinGained);
});
this.grantAdvancementPoints(AdvancementPoint.UpgradeOrAbility, 2);
Expand All @@ -899,7 +899,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>`);
BladesPushAlert.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")}.`, "advancement-alert");
}
/*~ @@DOUBLE-BLANK@@ ~*/
// #endregion
Expand Down
83 changes: 20 additions & 63 deletions module/BladesChat.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,16 @@
// #region IMPORTS ~
/* import U from "./core/utilities.js";
import C, {
BladesActorType, BladesItemType, RollPermissions, RollType, RollSubType,
RollModStatus, RollModSection, ActionTrait, DowntimeAction, AttributeTrait,
Position, Effect, Factor, RollResult, RollPhase, ConsequenceType, Tag
} from "./core/constants.js";
import {BladesActor, BladesPC, BladesCrew} from "./documents/BladesActorProxy.js";
import {BladesItem, BladesGMTracker} from "./documents/BladesItemProxy.js";
import {ApplyTooltipListeners, ApplyConsequenceListeners} from "./core/gsap.js";
import BladesDialog from "./BladesDialog.js"; */
import { ApplyTooltipAnimations, ApplyConsequenceAnimations } from "./core/gsap.js";
/*~ @@DOUBLE-BLANK@@ ~*/
import U from "./core/utilities.js";
import C, { BladesItemType } from "./core/constants.js";
import { BladesPC } from "./documents/BladesActorProxy.js";
import { BladesItem } from "./documents/BladesItemProxy.js";
import { ApplyTooltipListeners, ApplyConsequenceListeners } from "./core/gsap.js";
import BladesRoll from "./BladesRoll.js";
// #endregion
/*~ @@DOUBLE-BLANK@@ ~*/
class BladesChat extends ChatMessage {
/*~ @@DOUBLE-BLANK@@ ~*/
static Initialize() {
Hooks.on("renderChatMessage", (_msg, html) => {
ApplyTooltipListeners(html);
ApplyConsequenceListeners(html);
ApplyTooltipAnimations(html);
ApplyConsequenceAnimations(html);
BladesRoll.ApplyChatListeners(html);
});
return loadTemplates([
"systems/eunos-blades/templates/chat/roll-result-action-roll.hbs",
Expand All @@ -32,57 +20,26 @@ class BladesChat extends ChatMessage {
]);
}
/*~ @@DOUBLE-BLANK@@ ~*/
static GetRollSpeaker(rollInst) {
/*~ @@DOUBLE-BLANK@@ ~*/
// Get initial speaker data
const speaker = BladesChat.getSpeaker();
/*~ @@DOUBLE-BLANK@@ ~*/
// Compare against rollInst.rollPrimary and modify accordingly.
const { rollPrimaryID, rollPrimaryName, rollPrimaryType, rollPrimaryDoc } = rollInst.rollPrimary;
/*~ @@DOUBLE-BLANK@@ ~*/
speaker.alias = rollPrimaryName;
/*~ @@DOUBLE-BLANK@@ ~*/
if (BladesItem.IsType(BladesItemType.cohort_gang, BladesItemType.cohort_expert)) {
speaker.actor = rollPrimaryDoc?.parent?.id ?? speaker.actor;
if (rollPrimaryDoc?.parent instanceof BladesPC) {
speaker.alias = `${speaker.alias} (${rollPrimaryDoc.parent.name})`;
}
}
else if (BladesItem.IsType(BladesItemType.gm_tracker, BladesItemType.score)) {
speaker.actor = null;
speaker.alias = "The Gamemaster";
}
else if (rollPrimaryID) {
speaker.actor = rollPrimaryID;
}
/*~ @@DOUBLE-BLANK@@ ~*/
speaker.alias = `${speaker.alias} Rolls ...`;
/*~ @@DOUBLE-BLANK@@ ~*/
return speaker;
}
/*~ @@DOUBLE-BLANK@@ ~*/
static async ConstructRollOutput(rollInst) {
const speaker = BladesChat.GetRollSpeaker(rollInst);
/*~ @@DOUBLE-BLANK@@ ~*/
const template = `systems/eunos-blades/templates/chat/roll-result-${U.lCase(rollInst.rollType)}-roll.hbs`;
/*~ @@DOUBLE-BLANK@@ ~*/
const templateData = rollInst;
templateData.rollFlags = { ...rollInst.flagData };
/*~ @@DOUBLE-BLANK@@ ~*/
eLog.checkLog3("bladesRoll", "ConstructRollOutput Data", { rollInst, templateData });
/*~ @@DOUBLE-BLANK@@ ~*/
if (rollInst.rollResult) {
templateData.rollResultDescription = C.RollResultDescriptions[rollInst.finalPosition][rollInst.rollResult];
}
/*~ @@DOUBLE-BLANK@@ ~*/
const renderedHTML = await renderTemplate(template, rollInst);
/*~ @@DOUBLE-BLANK@@ ~*/
const messageData = {
speaker,
content: renderedHTML
speaker: rollInst.getSpeaker(BladesChat.getSpeaker()),
content: await rollInst.getResultHTML()
};
/*~ @@DOUBLE-BLANK@@ ~*/
BladesChat.create(messageData, {});
const chatMessage = await BladesChat.create(messageData, {});
chatMessage.rollInst = rollInst;
return chatMessage;
}
/*~ @@DOUBLE-BLANK@@ ~*/
_rollInst;
/*~ @@DOUBLE-BLANK@@ ~*/
get rollInst() { return this._rollInst; }
/*~ @@DOUBLE-BLANK@@ ~*/
set rollInst(rollInst) { this._rollInst = rollInst; }
/*~ @@DOUBLE-BLANK@@ ~*/
async reRender(html) {
this.update({ content: html });
}
}
/*~ @@DOUBLE-BLANK@@ ~*/
Expand Down
Loading

0 comments on commit bc5602d

Please sign in to comment.