Skip to content

Commit

Permalink
Trap Handling
Browse files Browse the repository at this point in the history
Completed Trap handling, fixed bug with attacks bool toggle
  • Loading branch information
Lumenita committed Dec 15, 2024
1 parent ee50613 commit 56da573
Show file tree
Hide file tree
Showing 19 changed files with 506 additions and 101 deletions.
82 changes: 74 additions & 8 deletions css/abfalter.css
Original file line number Diff line number Diff line change
Expand Up @@ -3829,12 +3829,20 @@ h6 {
border: 1px solid var(--boxColor);
}
.weapon-item .weaponSubHeaderContainer {
display: grid;
grid-template-columns: 1fr auto;
align-items: center;
display: flex;
width: 100%;
padding: 5px 0 0 0;
}
.wepSubLeft {
display: flex;
justify-content: flex-start;
width: 50%;
}
.wepSubRight {
display: flex;
justify-content: flex-end;
width: 50%;
}
.weaponSubTrap {
display: flex;
align-items: center;
Expand All @@ -3851,16 +3859,15 @@ h6 {
display: flex;
align-items: center;
white-space: nowrap;
justify-self: end;
}
.weaponSubThrow > span:nth-of-type(2) {
padding: 0 5px 0 3px;
padding: 0 3px 0 5px;
}
.weaponSubThrow > a {
font-size: 13px;
}
.weaponSubThrow > span:nth-of-type(3) {
padding: 0 2px 0 2px;
.weaponSubThrow > span:nth-of-type(1) {
padding: 0 5px;
}
/* #endregion */

Expand Down Expand Up @@ -5966,7 +5973,7 @@ h6 {
width: 5%;
}
/* #endregion */
/* #region Weapon Attack Prompt */
/* #region Weapon Attack Prompt & Chat Card */
.wepAtkDiceRoll {
padding: 0 3%;
}
Expand All @@ -5989,4 +5996,63 @@ h6 {
.wepAtkDiceRoll > label > select {
width: 45%;
}

.weaponChatRollMsg > div:first-of-type {
display: grid;
font-size: 23px;
justify-items: center;
}
.weaponChatRollMsg > div:first-of-type > span:nth-of-type(2) {
text-decoration: underline;
font-style: italic;
font-size: 15px;
}
.chatAtkRoll {
font-size: 17px;
display: flex;
justify-content: space-between;
}
.chatAtkRoll > span:nth-of-type(1) {
padding-left: 7%;
max-width: 75%;
}
.chatAtkRoll > span:nth-of-type(2) {
padding-right: 7%;
align-self: center;
}
.weaponChatRollMsg > div:nth-last-of-type(2) {
border-image: url(../img/border.png) 10 stretch;
border-top: 5px solid black;
border-bottom: 5px solid black;
margin-top: 3px;
margin-bottom: 3px;
}



.atkCustomTitleContainer {
position: relative;
}
.atkCustomTitle {
visibility: hidden;
opacity: 0;
background-color: #333;
color: #fff;
text-align: center;
border-radius: 4px;
padding: 5px;
position: absolute;
top: 100%; /* Position it below the container */
z-index: 10;
left: 50%;
width: 200px;
transform: translateX(-50%);
transition: opacity 0.2s ease-in-out;
font-size: 14px;
pointer-events: none;
}
.atkCustomTitleContainer:hover .atkCustomTitle {
visibility: visible;
opacity: 1;
}
/* #endregion */
2 changes: 2 additions & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,8 @@
"trapRoll": "Trap opp. rolls are",
"fortitudeShort": "Fort",
"breakageShort": "Break",
"targetAim": "Direct atk. target",


"armoryTab": {
"wearArmor": "Wear Armor",
Expand Down
6 changes: 3 additions & 3 deletions module/abfalter.js
Original file line number Diff line number Diff line change
Expand Up @@ -933,11 +933,11 @@ class weaponDataModel extends foundry.abstract.DataModel {
quantityConsumed: makeBoolField(),
consumedValue: makeIntField(),
ignorePrecision: makeBoolField(),
ignoreVorpal: makeBoolField(),
ignoreTrapping: makeBoolField(),
ignoreVorpal: makeBoolField(false),
ignoreTrapping: makeBoolField(false),
trappingType: makeBoolField(),
trappingValue: makeIntField(),
parentPercision: makeBoolField(),
parentPrecision: makeBoolField(),
parentVorpal: makeBoolField(),
parentTrapping: makeBoolField(),
parentThrowable: makeBoolField(),
Expand Down
4 changes: 4 additions & 0 deletions module/chat.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { openRollFunction } from "./diceroller.js";
import { wepOpenRollFunction } from "./diceroller.js";
import { fumbleRollFunction } from "./diceroller.js";

export function addChatListeners(html, _msg) {
html.find('button.secOpenRoll').click(ev => {
openRollFunction(_msg.message);
});
html.find('button.wepOpenRoll').click(ev => {
wepOpenRollFunction(_msg.message);
});

html.find('button.secFumbleRoll').click(ev => {
fumbleRollFunction(_msg.message);
Expand Down
3 changes: 3 additions & 0 deletions module/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,9 @@ export const abfalter = {
activeActionMod: "abfalter.activeActionMod",
directedAttackPrompt: "abfalter.directedAttackPrompt",
trapRoll: "abfalter.trapRoll",
fortitudeShort: "abfalter.fortitudeShort",
breakageShort: "abfalter.breakageShort",
targetAim: "abfalter.targetAim",
};
abfalter.kiTab = {
kiAbilities: "abfalter.kiTab.kiAbilities",
Expand Down
Loading

0 comments on commit 56da573

Please sign in to comment.