Skip to content

Commit

Permalink
Completed monster sheet
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyMonette committed May 5, 2021
1 parent 80b10a8 commit f7222f5
Show file tree
Hide file tree
Showing 47 changed files with 490 additions and 48 deletions.
Binary file added assets/images/Monsters/Beasts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Monsters/CursedOnes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Monsters/Draconids.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Monsters/Elementa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Monsters/Humanoids.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Monsters/Hybrids.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Monsters/Insectoids.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Monsters/Mages.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Monsters/Necrophages.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Monsters/Ogroids.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Monsters/Relicts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Monsters/Specters.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Monsters/Vampires.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Monsters/bandit.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added assets/images/Monsters/drowner.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Monsters/grave Hag.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Monsters/scoiatael.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Monsters/tokens/Drowner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Monsters/tokens/Nekker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Monsters/tokens/arachas.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Monsters/tokens/bandit1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Monsters/tokens/cockatrice.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Monsters/tokens/couvin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Monsters/tokens/golem.png
Binary file added assets/images/Monsters/tokens/goule.png
Binary file added assets/images/Monsters/tokens/hag.png
Binary file added assets/images/Monsters/tokens/loupgarou.png
Binary file added assets/images/Monsters/tokens/mage1.png
Binary file added assets/images/Monsters/tokens/spectre.png
Binary file added assets/images/Monsters/tokens/succube.png
Binary file added assets/images/Monsters/tokens/troll.png
Binary file added assets/images/Monsters/wraith.jpg
17 changes: 17 additions & 0 deletions module/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,21 @@ witcher.Concealment = {
S: "Small",
L: "Large",
NA: "CantHide",
}



witcher.MonsterTypes = {
Humanoids: "Humanoids",
Necrophages: "Necrophages",
Specters: "Specters",
Beasts: "Beasts",
CursedOnes: "CursedOnes",
Hybrids: "Hybrids",
Insectoids: "Insectoids",
Elementa: "Elementa",
Relicts: "Relicts",
Ogroids: "Ogroids",
Draconids: "Draconids",
Vampires: "Vampires",
}
68 changes: 45 additions & 23 deletions module/sheets/WitcherActorSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ export default class WitcherActorSheet extends ActorSheet {
data.substancesFulgur = data.items.filter(function(item) {return item.type=="component" && item.data.type=="substances" && item.data.substanceType=="fulgur" });
data.fulgurCount = data.substancesFulgur.sum("quantity");


data.loots = data.items.filter(function(item) {return item.type=="component" || item.type == "valuable" || item.type=="diagrams" || item.type=="armor" || item.type=="alchemical"});
data.notes = data.items.filter(function(item) {return item.type=="note"});

data.TotalWeight = data.items.weight();

data.noviceSpells = data.items.filter(function(item) {return item.type=="spell" && item.data.level=="novice" && (item.data.class=="Spells" || item.data.class=="Invocations" || item.data.class=="Witcher")});
Expand All @@ -91,20 +95,19 @@ export default class WitcherActorSheet extends ActorSheet {
html.find(".item-armor-display").on("click", this._onItemDisplayInfo.bind(this));
html.find(".item-valuable-display").on("click", this._onItemDisplayInfo.bind(this));
html.find(".item-delete").on("click", this._onItemDelete.bind(this));
html.find(".add-item").on("click", this._onItemAdd.bind(this));

html.find(".skill-display").on("click", this._onSkillDisplay.bind(this));
html.find(".item-substance-display").on("click", this._onSubstanceDisplay.bind(this));
html.find(".item-spell-display").on("click", this._onItemDisplayInfo.bind(this));



html.find(".crit-roll").on("click", this._onCritRoll.bind(this));
html.find(".death-roll").on("click", this._onDeathSaveRoll.bind(this));
html.find(".stat-roll").on("click", this._onStatSaveRoll.bind(this));
html.find(".item-roll").on("click", this._onItemRoll.bind(this));
html.find(".profession-roll").on("click", this._onProfessionRoll.bind(this));
html.find(".spell-roll").on("click", this._onSpellRoll.bind(this));


html.find("#awareness-rollable").on("click", function () {rollSkillCheck(thisActor, 0, 0)});
html.find("#business-rollable").on("click", function () {rollSkillCheck(thisActor, 0, 1)});
html.find("#deduction-rollable").on("click", function () {rollSkillCheck(thisActor, 0, 2)});
Expand Down Expand Up @@ -164,6 +167,15 @@ export default class WitcherActorSheet extends ActorSheet {
html.find("#resistcoerc-rollable").on("click", function () {rollSkillCheck(thisActor, 6, 5)});
html.find("#ritcraft-rollable").on("click", function () {rollSkillCheck(thisActor, 6, 6)});
}

async _onItemAdd(event) {
let element = event.currentTarget
let itemData = {
name: `new ${element.dataset.itemtype}`,
type: element.dataset.itemtype
}
this.actor.createOwnedItem(itemData)
}

async _onSpellRoll(event) {
let itemId = event.currentTarget.closest(".item").dataset.itemId;
Expand All @@ -186,7 +198,6 @@ export default class WitcherActorSheet extends ActorSheet {
}

async _onProfessionRoll(event) {
console.log("profession roll")
let stat = event.currentTarget.closest(".profession-display").dataset.stat;
let level = event.currentTarget.closest(".profession-display").dataset.level;
let name = event.currentTarget.closest(".profession-display").dataset.name;
Expand All @@ -195,39 +206,39 @@ export default class WitcherActorSheet extends ActorSheet {
let statName = 0
switch(stat){
case "int":
statValue = this.actor.data.data.stats.int.max;
statValue = this.actor.data.data.stats.int.current;
statName = "WITCHER.StInt";
break;
case "ref":
statValue = this.actor.data.data.stats.ref.max;
statValue = this.actor.data.data.stats.ref.current;
statName = "WITCHER.StRef";
break;
case "dex":
statValue = this.actor.data.data.stats.dex.max;
statValue = this.actor.data.data.stats.dex.current;
statName = "WITCHER.StDex";
break;
case "body":
statValue = this.actor.data.data.stats.body.max;
statValue = this.actor.data.data.stats.body.current;
statName = "WITCHER.StBody";
break;
case "spd":
statValue = this.actor.data.data.stats.spd.max;
statValue = this.actor.data.data.stats.spd.current;
statName = "WITCHER.StSpd";
break;
case "emp":
statValue = this.actor.data.data.stats.emp.max;
statValue = this.actor.data.data.stats.emp.current;
statName = "WITCHER.StEmp";
break;
case "cra":
statValue = this.actor.data.data.stats.cra.max;
statValue = this.actor.data.data.stats.cra.current;
statName = "WITCHER.StCra";
break;
case "will":
statValue = this.actor.data.data.stats.will.max;
statValue = this.actor.data.data.stats.will.current;
statName = "WITCHER.StWill";
break;
case "luck":
statValue = this.actor.data.data.stats.int.max;
statValue = this.actor.data.data.stats.int.current;
statName = "WITCHER.StLuck";
break;
}
Expand Down Expand Up @@ -264,39 +275,39 @@ export default class WitcherActorSheet extends ActorSheet {
let statName = 0
switch(stat){
case "int":
statValue = this.actor.data.data.stats.int.max;
statValue = this.actor.data.data.stats.int.current;
statName = "WITCHER.StInt";
break;
case "ref":
statValue = this.actor.data.data.stats.ref.max;
statValue = this.actor.data.data.stats.ref.current;
statName = "WITCHER.StRef";
break;
case "dex":
statValue = this.actor.data.data.stats.dex.max;
statValue = this.actor.data.data.stats.dex.current;
statName = "WITCHER.StDex";
break;
case "body":
statValue = this.actor.data.data.stats.body.max;
statValue = this.actor.data.data.stats.body.current;
statName = "WITCHER.StBody";
break;
case "spd":
statValue = this.actor.data.data.stats.spd.max;
statValue = this.actor.data.data.stats.spd.current;
statName = "WITCHER.StSpd";
break;
case "emp":
statValue = this.actor.data.data.stats.emp.max;
statValue = this.actor.data.data.stats.emp.current;
statName = "WITCHER.StEmp";
break;
case "cra":
statValue = this.actor.data.data.stats.cra.max;
statValue = this.actor.data.data.stats.cra.current;
statName = "WITCHER.StCra";
break;
case "will":
statValue = this.actor.data.data.stats.will.max;
statValue = this.actor.data.data.stats.will.current;
statName = "WITCHER.StWill";
break;
case "luck":
statValue = this.actor.data.data.stats.int.max;
statValue = this.actor.data.data.stats.int.current;
statName = "WITCHER.StLuck";
break;
}
Expand Down Expand Up @@ -360,7 +371,7 @@ export default class WitcherActorSheet extends ActorSheet {
}

let messageData = {
speaker: {alias: this.actor.data.data.general.name},
speaker: {alias: this.actor.name},
flavor: `<h1>Attack: ${item.name}</h1>`,
}

Expand Down Expand Up @@ -481,6 +492,17 @@ export default class WitcherActorSheet extends ActorSheet {

}

_onSkillDisplay(event) {
event.preventDefault();
let section = event.currentTarget.closest(".skill");
let editor = $(section).find(".skill-list")
editor.toggleClass("hidden");

let chevronEditor = $(section).find(".fas")
chevronEditor.toggleClass("fa-chevron-right");
chevronEditor.toggleClass("fa-chevron-down");
}

_onSubstanceDisplay(event) {
event.preventDefault();
let section = event.currentTarget.closest(".substance");
Expand Down
29 changes: 15 additions & 14 deletions module/witcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ with the Hand to Hand Table, page 48 of Witcher TRPG Handbook.
function updateDerived(actor){

let thisActor = actor;
let base = Math.floor((thisActor.data.data.stats.body.max + thisActor.data.data.stats.will.max)/2);
let currentBody = thisActor.data.data.stats.body.max;
let base = Math.floor((thisActor.data.data.stats.body.current + thisActor.data.data.stats.will.current)/2);
let currentBody = thisActor.data.data.stats.body.current;

let newHP = base*5;
let newSta = base*5;
let newRec = base;
let newStun = base;
let newEnc = thisActor.data.data.stats.body.max*10;
let newRun = thisActor.data.data.stats.spd.max*3;
let newEnc = thisActor.data.data.stats.body.current*10;
let newRun = thisActor.data.data.stats.spd.current*3;
let newLeap = Math.floor(newRun/5);

let meleeBonus = 0;
Expand Down Expand Up @@ -79,8 +79,8 @@ function updateDerived(actor){
newStun = 10;
}

let newResolve = Math.floor((thisActor.data.data.stats.will.max + thisActor.data.data.stats.int.max)/2*5);

let newResolve = Math.floor((thisActor.data.data.stats.will.current + thisActor.data.data.stats.int.current)/2*5);
console.log(meleeBonus)
thisActor.update({
'data.derivedStats.hp.max': newHP,
'data.derivedStats.sta.max': newSta,
Expand All @@ -98,6 +98,7 @@ function updateDerived(actor){
}

function rollSkillCheck(thisActor, statNum, skillNum){
console.log("coucou")
let parentStat = "";
let skillName = "";
let stat = 0;
Expand All @@ -109,55 +110,55 @@ function rollSkillCheck(thisActor, statNum, skillNum){
parentStat = game.i18n.localize("WITCHER.StInt");
array = getIntSkillMod(thisActor, skillNum);
skillName = array[0];
stat = thisActor.data.data.stats.int.max;
stat = thisActor.data.data.stats.int.current;
skill = array[1];
break;
case 1:
parentStat = game.i18n.localize("WITCHER.StRef");
array = getRefSkillMod(thisActor, skillNum);
skillName = array[0];
stat = thisActor.data.data.stats.ref.max;
stat = thisActor.data.data.stats.ref.current;
skill = array[1];
break;
case 2:
parentStat = game.i18n.localize("WITCHER.StDex");
array = getDexSkillMod(thisActor, skillNum);
skillName = array[0];
stat = thisActor.data.data.stats.dex.max;
stat = thisActor.data.data.stats.dex.current;
skill = array[1];
break;
case 3:
parentStat = game.i18n.localize("WITCHER.StBody");
array = getBodySkillMod(thisActor, skillNum);
skillName = array[0];
stat = thisActor.data.data.stats.body.max;
stat = thisActor.data.data.stats.body.current;
skill = array[1];
break;
case 4:
parentStat = game.i18n.localize("WITCHER.StEmp");
array = getEmpSkillMod(thisActor, skillNum);
skillName = array[0];
stat = thisActor.data.data.stats.emp.max;
stat = thisActor.data.data.stats.emp.current;
skill = array[1];
break;
case 5:
parentStat = game.i18n.localize("WITCHER.StCra");
array = getCraSkillMod(thisActor, skillNum);
skillName = array[0];
stat = thisActor.data.data.stats.cra.max;
stat = thisActor.data.data.stats.cra.current;
skill = array[1];
break;
case 6:
parentStat = game.i18n.localize("WITCHER.StWill");
array = getWillSkillMod(thisActor, skillNum);
skillName = array[0];
stat = thisActor.data.data.stats.will.max;
stat = thisActor.data.data.stats.will.current;
skill = array[1];
break;
}

let messageData = {
speaker: {alias: thisActor.data.data.general.name},
speaker: {alias: thisActor.name},
flavor: `${parentStat}: ${skillName} Check`,
}
let rollFormula = `1d10+${stat}+${skill}`
Expand Down
2 changes: 1 addition & 1 deletion module/witcherItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default class WitcherItem extends Item {
}

let messageData = {
speaker: {alias: this.actor.data.data.general.name},
speaker: {alias: this.actor.name},
flavor: `<h1>Attack: ${item.name}</h1>`,
}

Expand Down
2 changes: 2 additions & 0 deletions scripts/TheWitcherTRPG.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ import WitcherItem from "../module/witcherItem.js";
async function preloadHandlebarsTemplates(){
const templatePath =[
"systems/TheWitcherTRPG/templates/sheets/actor/character-sheet.html",
"systems/TheWitcherTRPG/templates/sheets/actor/monster-sheet.html",
"systems/TheWitcherTRPG/templates/partials/character-header.html",
"systems/TheWitcherTRPG/templates/partials/tab-skills.html",
"systems/TheWitcherTRPG/templates/partials/tab-profession.html",
"systems/TheWitcherTRPG/templates/partials/tab-background.html",
"systems/TheWitcherTRPG/templates/partials/tab-inventory.html",
"systems/TheWitcherTRPG/templates/partials/tab-magic.html",
"systems/TheWitcherTRPG/templates/partials/substances.html",
"systems/TheWitcherTRPG/templates/partials/monster-skill-tab.html",

"systems/TheWitcherTRPG/templates/partials/chat/profession-chat.html",
"systems/TheWitcherTRPG/templates/partials/chat/stat-chat.html",
Expand Down
Loading

0 comments on commit f7222f5

Please sign in to comment.