Skip to content

Commit

Permalink
add support for reverse AP rolls
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee-Talman committed Mar 6, 2024
1 parent e7a8cfa commit b952a48
Show file tree
Hide file tree
Showing 31 changed files with 103 additions and 51 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 0.2.1
- Added support for reverse AP rolls for PCs/recruits
- Reduced size of chat message header font

## 0.2.0
- Added support for Power Attacks, with automatic weapon breaking
- Visual update to character, recruit, and monster sheets
Expand Down
4 changes: 2 additions & 2 deletions css/knave2e.css

Large diffs are not rendered by default.

19 changes: 18 additions & 1 deletion module/sheets/actor-sheet.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export default class Knave2eActorSheet extends ActorSheet {
}
return false;
});

const armorClass = armorPoints + 11;

return { armorPoints, armorClass }
Expand Down Expand Up @@ -343,6 +343,9 @@ export default class Knave2eActorSheet extends ActorSheet {
// Checks & Abilities.
html.on('click', '.actor-button.check', this._onCheck.bind(this));

// Armor Points for Player-Facing Rolls
html.on('click', '.actor-button.ap', this._onAP.bind(this));

// Resting
html.on('click', '.actor-button.rest', this._onRest.bind(this));

Expand Down Expand Up @@ -431,6 +434,20 @@ export default class Knave2eActorSheet extends ActorSheet {
return r
}

async _onAP(event) {
event.preventDefault();
const a = event.currentTarget;
const context = await this.getData();

let r = new Roll('d20+@ap', { ap: context.system.armorPoints });

r.toMessage({
speaker: ChatMessage.getSpeaker({ actor: this.actor }),
flavor: `[Reverse AP] ${this.actor.name}: `,
rollMode: game.settings.get('core', 'rollMode')
});
}

async _onNumberAppearing(event) {
event.preventDefault();
const a = event.currentTarget;
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion packs/actors/CURRENT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MANIFEST-000012
MANIFEST-000058
8 changes: 3 additions & 5 deletions packs/actors/LOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
2024/02/22-17:30:49.074 6748 Recovering log #11
2024/02/22-17:30:49.074 6748 Level-0 table #13: started
2024/02/22-17:30:49.075 6748 Level-0 table #13: 2032 bytes OK
2024/02/22-17:30:49.077 6748 Delete type=0 #11
2024/02/22-17:30:49.077 6748 Delete type=3 #10
2024/03/06-02:21:51.117 a634 Recovering log #57
2024/03/06-02:21:51.120 a634 Delete type=0 #57
2024/03/06-02:21:51.120 a634 Delete type=3 #56
6 changes: 3 additions & 3 deletions packs/actors/LOG.old
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
2024/02/22-16:06:33.467 5c5c Recovering log #8
2024/02/22-16:06:33.470 5c5c Delete type=0 #8
2024/02/22-16:06:33.470 5c5c Delete type=3 #6
2024/03/06-02:03:45.318 a534 Recovering log #55
2024/03/06-02:03:45.322 a534 Delete type=0 #55
2024/03/06-02:03:45.322 a534 Delete type=3 #54
Binary file removed packs/actors/MANIFEST-000012
Binary file not shown.
Binary file added packs/actors/MANIFEST-000058
Binary file not shown.
Binary file removed packs/items/000013.ldb
Binary file not shown.
Binary file added packs/items/000019.ldb
Binary file not shown.
2 changes: 1 addition & 1 deletion packs/items/CURRENT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MANIFEST-000012
MANIFEST-000058
8 changes: 3 additions & 5 deletions packs/items/LOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
2024/02/22-17:30:49.067 1df0 Recovering log #11
2024/02/22-17:30:49.067 1df0 Level-0 table #13: started
2024/02/22-17:30:49.068 1df0 Level-0 table #13: 1419 bytes OK
2024/02/22-17:30:49.071 1df0 Delete type=0 #11
2024/02/22-17:30:49.071 1df0 Delete type=3 #10
2024/03/06-02:21:51.106 37dc Recovering log #57
2024/03/06-02:21:51.109 37dc Delete type=0 #57
2024/03/06-02:21:51.109 37dc Delete type=3 #56
6 changes: 3 additions & 3 deletions packs/items/LOG.old
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
2024/02/22-16:06:33.461 4b0c Recovering log #8
2024/02/22-16:06:33.463 4b0c Delete type=0 #8
2024/02/22-16:06:33.463 4b0c Delete type=3 #6
2024/03/06-02:03:45.310 a478 Recovering log #55
2024/03/06-02:03:45.313 a478 Delete type=0 #55
2024/03/06-02:03:45.313 a478 Delete type=3 #54
Binary file removed packs/items/MANIFEST-000012
Binary file not shown.
Binary file added packs/items/MANIFEST-000058
Binary file not shown.
File renamed without changes.
2 changes: 1 addition & 1 deletion packs/monsters/CURRENT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MANIFEST-000012
MANIFEST-000058
8 changes: 3 additions & 5 deletions packs/monsters/LOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
2024/02/22-17:30:49.059 1df0 Recovering log #11
2024/02/22-17:30:49.059 1df0 Level-0 table #13: started
2024/02/22-17:30:49.060 1df0 Level-0 table #13: 1639 bytes OK
2024/02/22-17:30:49.062 1df0 Delete type=0 #11
2024/02/22-17:30:49.062 1df0 Delete type=3 #10
2024/03/06-02:21:51.100 a634 Recovering log #57
2024/03/06-02:21:51.102 a634 Delete type=0 #57
2024/03/06-02:21:51.102 a634 Delete type=3 #56
6 changes: 3 additions & 3 deletions packs/monsters/LOG.old
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
2024/02/22-16:06:33.454 5c5c Recovering log #8
2024/02/22-16:06:33.457 5c5c Delete type=0 #8
2024/02/22-16:06:33.457 5c5c Delete type=3 #6
2024/03/06-02:03:45.304 a534 Recovering log #55
2024/03/06-02:03:45.307 a534 Delete type=0 #55
2024/03/06-02:03:45.307 a534 Delete type=3 #54
Binary file removed packs/monsters/MANIFEST-000012
Binary file not shown.
Binary file added packs/monsters/MANIFEST-000058
Binary file not shown.
2 changes: 1 addition & 1 deletion packs/spells/CURRENT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MANIFEST-000002
MANIFEST-000046
4 changes: 3 additions & 1 deletion packs/spells/LOG
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
2024/02/22-17:30:49.084 6c90 Delete type=3 #1
2024/03/06-02:21:51.125 37dc Recovering log #45
2024/03/06-02:21:51.128 37dc Delete type=0 #45
2024/03/06-02:21:51.128 37dc Delete type=3 #44
3 changes: 3 additions & 0 deletions packs/spells/LOG.old
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
2024/03/06-02:03:45.325 a478 Recovering log #43
2024/03/06-02:03:45.327 a478 Delete type=0 #43
2024/03/06-02:03:45.328 a478 Delete type=3 #42
Binary file removed packs/spells/MANIFEST-000002
Binary file not shown.
Binary file added packs/spells/MANIFEST-000046
Binary file not shown.
2 changes: 1 addition & 1 deletion scss/global/_window.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
// Chat Message CSS
.chat-message .message-header .message-sender {
font-family: $font-sheet-title;
font-size: larger;
font-size: normal;
font-weight: bold;
text-transform: uppercase;
overflow: hidden;
Expand Down
64 changes: 48 additions & 16 deletions system.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,58 +5,90 @@
"authors": [
{
"name": "Lee Talman",
"discord": ".pizzawizard"
"discord": ".pizzawizard",
"flags": {}
}
],
"url": "https://github.com/Lee-Talman/knave2e",
"license": "LICENSE.txt",
"readme": "README.md",
"license": "https://github.com/Lee-Talman/knave2e/blob/main/LICENSE.txt",
"readme": "https://github.com/Lee-Talman/knave2e/blob/main/README.md",
"bugs": "https://github.com/Lee-Talman/knave2e/issues",
"changelog": "CHANGELOG.md",
"version": "0.2.0",
"changelog": "https://github.com/Lee-Talman/knave2e/blob/main/CHANGELOG.md",
"version": "0.2.1",
"compatibility": {
"minimum": "10",
"verified": "11",
"maximum": "11"
},
"esmodules": ["module/knave2e.mjs"],
"styles": ["css/knave2e.css"],
"esmodules": [
"module/knave2e.mjs"
],
"styles": [
"css/knave2e.css"
],
"languages": [
{
"lang": "en",
"name": "English",
"path": "lang/en.json"
"path": "lang/en.json",
"flags": {}
}
],
"packs": [
{
"name": "monsters",
"label": "Monsters",
"type": "Actor"
"type": "Actor",
"system": "knave2e",
"path": "packs/monsters",
"ownership": {
"PLAYER": "OBSERVER",
"ASSISTANT": "OWNER"
},
"flags": {}
},
{
"name": "items",
"label": "Weapons",
"type": "Item"
"type": "Item",
"system": "knave2e",
"path": "packs/items",
"ownership": {
"PLAYER": "OBSERVER",
"ASSISTANT": "OWNER"
},
"flags": {}
},
{
"name": "actors",
"label": "Recruits",
"type": "Actor"
"type": "Actor",
"system": "knave2e",
"path": "packs/actors",
"ownership": {
"PLAYER": "OBSERVER",
"ASSISTANT": "OWNER"
},
"flags": {}
},
{
"name": "spells",
"label": "Spells",
"type": "Item"
"type": "Item",
"system": "knave2e",
"path": "packs/spells",
"ownership": {
"PLAYER": "OBSERVER",
"ASSISTANT": "OWNER"
},
"flags": {}
}
],
"packFolders": [],
"socket": false,
"manifest": "https://raw.githubusercontent.com/Lee-Talman/knave2e/main/system.json",
"download": "https://github.com/Lee-Talman/knave2e/archive/refs/tags/release-0.1.2.zip",
"download": "https://github.com/Lee-Talman/knave2e/releases/download/0.2.1/system.zip",
"background": "systems/knave2e/assets/anvil-bg.png",
"gridDistance": 5,
"gridUnits": "ft",
"primaryTokenAttribute": "hitPoints",
"secondaryTokenAttribute": "wounds"
}
}
2 changes: 1 addition & 1 deletion templates/actor/actor-character-sheet.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
</div>
</div>
<div class="flexcol no-wrap flex-group-center">
<div class="resource-label">{{localize "KNAVE2E.ArmorPoints"}}</div>
<a class="resource-label transparent actor-button ap">{{localize "KNAVE2E.ArmorPoints"}}</a>
<div class="resource-label content circle character">
{{system.armorPoints}}
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/actor/actor-recruit-sheet.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<div class="resource-label content shield character">{{system.armorClass}}</div>
</div>
<div class="grid-span-1 flexcol no-wrap flex-group-center">
<div class="resource-label">{{localize "KNAVE2E.ArmorPoints"}}</div>
<a class="resource-label transparent actor-button ap">{{localize "KNAVE2E.ArmorPoints"}}</a>
<div class="resource-label content circle character">
{{system.armorPoints}}
</div>
Expand Down

0 comments on commit b952a48

Please sign in to comment.