Skip to content

Commit

Permalink
Merge pull request #103 from CurtR95/0.4.2
Browse files Browse the repository at this point in the history
0.5.0 Design Overhaul Phase 1
  • Loading branch information
CurtR95 authored Apr 30, 2021
2 parents 6ad76b2 + 1f910b9 commit 9efdcff
Show file tree
Hide file tree
Showing 48 changed files with 2,574 additions and 1,253 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# IDE
.idea/
.vs/
.vs/
node_modules/
.eslintrc.js
package.json
package-lock.json
Binary file added fonts/eb-garamond-v14-latin-ext_latin-700.woff
Binary file not shown.
Binary file added fonts/eb-garamond-v14-latin-ext_latin-700.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added fonts/eb-garamond-v14-latin-ext_latin-italic.woff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
49 changes: 35 additions & 14 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
"dishonored.__comment": "The Dishonored System allows for dynamic location of variables. These are indicated via |#|.",


"dishonored.notifications.momentumTrackerPermissions": "The Momentum Tracker User Role does not have permissions to Modify Configuration Settings. Please change one of these in Permission Configuration or System Settings.",
"dishonored.notifications.momentum.trackerPermissions1": "The <b>Momentum Tracker User Role</b> does not have permissions to <b>Modify Configuration Settings</b>. Please either change ",
"dishonored.notifications.chaos.trackerPermissions1": "The <b>Chaos Tracker User Role</b> does not have permissions to <b>Modify Configuration Settings</b>. Please either change ",
"dishonored.notifications.trackerPermissions2": " so that User Role: ",
"dishonored.notifications.momentum.trackerPermissions3": " has permission to <b>Modify Configuration Settings</b> or, increase the User Role requirement for <b>Momentum Tracker User Role</b> in ",
"dishonored.notifications.chaos.trackerPermissions3": " has permission to <b>Modify Configuration Settings</b> or, increase the User Role requirement for <b>Chaos Tracker User Role</b> in ",
"dishonored.notifications.trackerPermissions4": ".",
"dishonored.notifications.trackerPermissionsClickHere": "To ignore this message until next update Click Here.",
"dishonored.notifications.lackPermission": "You do not have permission to view this item!",
"dishonored.notifications.tooManyBonecharms": "The current actor has 3 equipped bonecharms already! Doing Nothing.",
"dishonored.notifications.armorAlreadyEquipped": "The current actor has an equipped armor already! Doing Nothing.",
Expand Down Expand Up @@ -55,6 +61,12 @@

"dishonored.actor.item.adjectiveNew": "New",

"dishonored.actor.npc.types": "NPC Type",
"dishonored.actor.npc.incidental": "Incidental",
"dishonored.actor.npc.notable": "Notable",
"dishonored.actor.npc.minor": "Minor",
"dishonored.actor.npc.major": "Major",

"dishonored.actor.character.momentum": "Momentum Track",
"dishonored.actor.character.experience": "Experience Track",
"dishonored.actor.character.name": "Name",
Expand All @@ -67,7 +79,7 @@
"dishonored.actor.character.outlook": "Outlook",
"dishonored.actor.character.void": "Void Points Track",

"dishonored.actor.skisty.mod": "Modifier",
"dishonored.actor.skisty.mod": "Mod",
"dishonored.actor.skisty.check": "Perform Check",

"dishonored.actor.skill.title": "Skills",
Expand All @@ -91,16 +103,13 @@
"dishonored.actor.genericitem.name": "Name",
"dishonored.actor.genericitem.cost": "Value",

"dishonored.actor.contact.title": "Contacts",
"dishonored.actor.contact.relation": "Relation",

"dishonored.actor.talent.title": "Talents",
"dishonored.actor.talent.type": "Type",

"dishonored.actor.focus.title": "Focuses",
"dishonored.actor.focus.rating": "Rating",

"dishonored.actor.note.title": "Notes",
"dishonored.actor.abilities.mana": "Mana Points",

"dishonored.actor.talent.title": "Talents",
"dishonored.actor.talent.type": "Type",

"dishonored.actor.power.title": "Powers",
"dishonored.actor.power.rune": "Rune",
Expand All @@ -109,7 +118,8 @@
"dishonored.actor.belonging.title": "Belongings",
"dishonored.actor.belonging.collectable.coin": "Coins",
"dishonored.actor.belonging.collectable.rune": "Runes",
"dishonored.actor.belonging.weapon.title": "Weapons",
"dishonored.actor.belonging.collectable.bonecharm": "Bonecharms",
"dishonored.actor.belonging.weapon.title": "Weapon Name",
"dishonored.actor.belonging.weapon.dmg": "Dmg",
"dishonored.actor.belonging.weapon.damage": "Damage",
"dishonored.actor.belonging.weapon.armorpierce": "Armor Piercing",
Expand All @@ -125,14 +135,22 @@
"dishonored.actor.belonging.weapon.distant": "Distant",
"dishonored.actor.belonging.weapon.rangednearby": "Ranged (Nearby)",
"dishonored.actor.belonging.weapon.nearby": "Nearby",
"dishonored.actor.belonging.armor.title": "Armor",
"dishonored.actor.belonging.armor.title": "Armor Name",
"dishonored.actor.belonging.armor.protect": "Protect",
"dishonored.actor.belonging.armor.protection": "Protection",
"dishonored.actor.belonging.bonecharm.title": "Bonecharms",
"dishonored.actor.belonging.other.title": "Other Items",
"dishonored.actor.belonging.bonecharm.title": "Bonecharm Name",
"dishonored.actor.belonging.other.title": "Item Name",
"dishonored.actor.belonging.other.qty": "Qty",
"dishonored.actor.belonging.other.quantity": "Quantity",

"dishonored.actor.truth.title": "Truths",
"dishonored.actor.truth.content": "Content of Truth",

"dishonored.actor.contact.title": "Contacts",
"dishonored.actor.contact.relation": "Relation",

"dishonored.actor.note.title": "Notes",


"dishonored.contact.relation.great": "Great",
"dishonored.contact.relation.fair": "Fair",
Expand All @@ -141,6 +159,9 @@
"dishonored.contact.relation.dire": "Dire",


"dishonored.item.truth": "Truth",


"dishonored.item.armor.helmet": "Is Helmet?",
"dishonored.item.contact.send2actor": "Send to Actor",

Expand Down Expand Up @@ -176,5 +197,5 @@
"dishonored.tracker.momentum": "Momentum",


"dishonored.__eof": "This is an end of file because I'm lazy and keep forgetting commas. This shouldn't be in the final commit (sorry if it is - see previous statement)."
"dishonored.__eof": "This is an end of file because I'm lazy and keep forgetting commas. This shouldn't be in the final commit (sorry if it is - see previous sentence)."
}
2 changes: 1 addition & 1 deletion lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"dishonored.actor.character.archetype": "Arquetipo",
"dishonored.actor.character.outlook": "Perspectiva",
"dishonored.actor.character.void": "Puntos de Vacío",
"dishonored.actor.skisty.mod": "Modificador",
"dishonored.actor.skisty.mod": "Mod",
"dishonored.actor.skisty.check": "Tirada de Acción",
"dishonored.actor.skill.title": "Habilidades",
"dishonored.actor.skill.name": "Habilidades",
Expand Down
209 changes: 96 additions & 113 deletions module/actors/actor.js
Original file line number Diff line number Diff line change
@@ -1,107 +1,90 @@
import {
DishonoredRollDialog
} from '../apps/roll-dialog.js'
} from "../apps/roll-dialog.js";
import {
DishonoredRoll
} from '../roll.js'
} from "../roll.js";

export class DishonoredActor extends Actor {
prepareData() {
this.data.img = '/systems/FVTT-Dishonored/icons/dishonoredlogo.webp';
this.data.token.img = '/systems/FVTT-Dishonored/icons/dishonoredlogo.webp';
this.data.token.bar1.attribute = "stress";
if(this.data.type == "character") {
this.data.token.bar2.attribute = "void";
this.data.token.actorLink = "true";
this.data.token.brightSight = 30;
this.data.token.dimSight = 60;
this.data.token.displayBars = 50;
this.data.token.displayName = 50;
this.data.token.disposition = 1;
this.data.token.vision = true;
}
else {
this.data.token.displayBars = 40;
this.data.token.displayName = 40;
this.data.token.disposition = -1;
}
super.prepareData();
// const actorData = this.data;
}
prepareData() {
if (this.data.img == "icons/svg/mystery-man.svg") this.data.img = "/systems/FVTT-Dishonored/icons/dishonoredlogo.webp";
if (this.data.token.img == "icons/svg/mystery-man.svg") this.data.token.img = "/systems/FVTT-Dishonored/icons/dishonoredlogo.webp";
return this.data;
}
}

export class DishonoredSharedActorFunctions {

// This function renders all the tracks. This will be used every time the character sheet is loaded. It is a vital element as such it runs before most other code!
dishonoredRenderTracks(html, stressTrackMax, voidPointsMax, expPointsMax, momentumMax) {
var i;
// Checks if details for the Stress Track was included, this should happen in all cases!
if (stressTrackMax) {
for (i = 0; i < stressTrackMax; i++) {
if (i + 1 <= html.find('#total-stress')[0].value) {
html.find('[id^="stress"]')[i].setAttribute("data-selected", "true");
html.find('[id^="stress"]')[i].style.backgroundColor = "#191813";
html.find('[id^="stress"]')[i].style.color = "#ffffff";
} else {
html.find('[id^="stress"]')[i].removeAttribute("data-selected");
html.find('[id^="stress"]')[i].style.backgroundColor = "rgb(255, 255, 255, 0.3)";
html.find('[id^="stress"]')[i].style.color = "";
}
}
}
// Checks if details for the Void Track was included, this should happen for all Characters!
if (voidPointsMax) {
for (i = 0; i < voidPointsMax; i++) {
if (i + 1 <= html.find('#total-void')[0].value) {
html.find('[id^="void"]')[i].setAttribute("data-selected", "true");
html.find('[id^="void"]')[i].style.backgroundColor = "#191813";
html.find('[id^="void"]')[i].style.color = "#ffffff";
} else {
html.find('[id^="void"]')[i].removeAttribute("data-selected");
html.find('[id^="void"]')[i].style.backgroundColor = "rgb(255, 255, 255, 0.3)";
html.find('[id^="void"]')[i].style.color = "";
}
}
}
// Checks if details for the Experience Track was included, this should happen for all Characters!
if (expPointsMax) {
for (i = 0; i < expPointsMax; i++) {
if (i + 1 <= html.find('#total-exp')[0].value) {
html.find('[id^="exp"]')[i].setAttribute("data-selected", "true");
html.find('[id^="exp"]')[i].style.backgroundColor = "#191813";
html.find('[id^="exp"]')[i].style.color = "#ffffff";
} else {
html.find('[id^="exp"]')[i].removeAttribute("data-selected");
html.find('[id^="exp"]')[i].style.backgroundColor = "rgb(255, 255, 255, 0.3)";
html.find('[id^="exp"]')[i].style.color = "";
}
}
}
// Checks if details for the Momentum Track was included, this should happen for all Characters!
if(momentumMax) {
for (i = 0; i < 6; i++) {
if (i + 1 <= html.find('#total-mom')[0].value) {
html.find('[id^="mom"]')[i].setAttribute("data-selected", "true");
html.find('[id^="mom"]')[i].style.backgroundColor = "#191813";
html.find('[id^="mom"]')[i].style.color = "#ffffff";
} else {
html.find('[id^="mom"]')[i].removeAttribute("data-selected");
html.find('[id^="mom"]')[i].style.backgroundColor = "rgb(255, 255, 255, 0.3)";
html.find('[id^="mom"]')[i].style.color = "";
}
}
}
}
// This function renders all the tracks. This will be used every time the character sheet is loaded. It is a vital element as such it runs before most other code!
dishonoredRenderTracks(html, stressTrackMax, voidPointsMax, expPointsMax, momentumMax) {
let i;
// Checks if details for the Stress Track was included, this should happen in all cases!
if (stressTrackMax) {
for (i = 0; i < stressTrackMax; i++) {
if (i + 1 <= html.find("#total-stress")[0].value) {
html.find("[id^=\"stress\"]")[i].setAttribute("data-selected", "true");
html.find("[id^=\"stress\"]")[i].style.backgroundColor = "#191813";
html.find("[id^=\"stress\"]")[i].style.color = "#ffffff";
} else {
html.find("[id^=\"stress\"]")[i].removeAttribute("data-selected");
html.find("[id^=\"stress\"]")[i].style.backgroundColor = "rgb(255, 255, 255, 0.3)";
html.find("[id^=\"stress\"]")[i].style.color = "";
}
}
}
// Checks if details for the Void Track was included, this should happen for all Characters!
if (voidPointsMax) {
for (i = 0; i < voidPointsMax; i++) {
if (i + 1 <= html.find("#total-void")[0].value) {
html.find("[id^=\"void\"]")[i].setAttribute("data-selected", "true");
html.find("[id^=\"void\"]")[i].style.backgroundColor = "#191813";
html.find("[id^=\"void\"]")[i].style.color = "#ffffff";
} else {
html.find("[id^=\"void\"]")[i].removeAttribute("data-selected");
html.find("[id^=\"void\"]")[i].style.backgroundColor = "rgb(255, 255, 255, 0.3)";
html.find("[id^=\"void\"]")[i].style.color = "";
}
}
}
// Checks if details for the Experience Track was included, this should happen for all Characters!
if (expPointsMax) {
for (i = 0; i < expPointsMax; i++) {
if (i + 1 <= html.find("#total-exp")[0].value) {
html.find("[id^=\"exp\"]")[i].setAttribute("data-selected", "true");
html.find("[id^=\"exp\"]")[i].style.backgroundColor = "#191813";
html.find("[id^=\"exp\"]")[i].style.color = "#ffffff";
} else {
html.find("[id^=\"exp\"]")[i].removeAttribute("data-selected");
html.find("[id^=\"exp\"]")[i].style.backgroundColor = "rgb(255, 255, 255, 0.8)";
html.find("[id^=\"exp\"]")[i].style.color = "";
}
}
}
// Checks if details for the Momentum Track was included, this should happen for all Characters!
if(momentumMax) {
for (i = 0; i < 6; i++) {
if (i + 1 <= html.find("#total-mom")[0].value) {
html.find("[id^=\"mom\"]")[i].setAttribute("data-selected", "true");
html.find("[id^=\"mom\"]")[i].style.backgroundColor = "#191813";
html.find("[id^=\"mom\"]")[i].style.color = "#ffffff";
} else {
html.find("[id^=\"mom\"]")[i].removeAttribute("data-selected");
html.find("[id^=\"mom\"]")[i].style.backgroundColor = "rgb(255, 255, 255, 0.3)";
html.find("[id^=\"mom\"]")[i].style.color = "";
}
}
}
}

// This handles performing a skill test using the "Perform Check" button.
async rollSkillTest(event, checkTarget, selectedSkill, selectedStyle, speaker) {
event.preventDefault();
// This creates a dialog to gather details regarding the roll and waits for a response
event.preventDefault();
// This creates a dialog to gather details regarding the roll and waits for a response
let rolldialog = await DishonoredRollDialog.create();
if (rolldialog) {
let dicePool = rolldialog.get("dicePoolSlider");
let focusTarget = parseInt(rolldialog.get("dicePoolFocus"));
// Once the response has been collected it then sends it to be rolled.
let focusTarget = parseInt(rolldialog.get("dicePoolFocus"));
// Once the response has been collected it then sends it to be rolled.
let dishonoredRoll = new DishonoredRoll();
dishonoredRoll.performSkillTest(dicePool, checkTarget, focusTarget, selectedSkill, selectedStyle, speaker);
}
Expand All @@ -110,34 +93,34 @@ export class DishonoredSharedActorFunctions {
// This handles performing an "item" roll by clicking the item's image.
async rollGenericItem(event, type, id, speaker) {
event.preventDefault();
var item = speaker.items.get(id);
let item = speaker.items.get(id);
let dishonoredRoll = new DishonoredRoll();
// It will send it to a different method depending what item type was sent to it.
switch(type) {
case "item":
dishonoredRoll.performItemRoll(item, speaker);
break;
case "focus":
dishonoredRoll.performFocusRoll(item, speaker);
break;
case "bonecharm":
dishonoredRoll.performBonecharmRoll(item, speaker);
break;
case "weapon":
dishonoredRoll.performWeaponRoll(item, speaker);
break;
case "armor":
dishonoredRoll.performArmorRoll(item, speaker);
break;
case "talent":
dishonoredRoll.performTalentRoll(item, speaker);
break;
case "contact":
dishonoredRoll.performContactRoll(item, speaker);
break;
case "power":
dishonoredRoll.performPowerRoll(item, speaker);
break;
case "item":
dishonoredRoll.performItemRoll(item, speaker);
break;
case "focus":
dishonoredRoll.performFocusRoll(item, speaker);
break;
case "bonecharm":
dishonoredRoll.performBonecharmRoll(item, speaker);
break;
case "weapon":
dishonoredRoll.performWeaponRoll(item, speaker);
break;
case "armor":
dishonoredRoll.performArmorRoll(item, speaker);
break;
case "talent":
dishonoredRoll.performTalentRoll(item, speaker);
break;
case "contact":
dishonoredRoll.performContactRoll(item, speaker);
break;
case "power":
dishonoredRoll.performPowerRoll(item, speaker);
break;
}
}
}
Loading

0 comments on commit 9efdcff

Please sign in to comment.