Skip to content

Commit

Permalink
Misc correction and Adding Compendium
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyMonette committed May 7, 2021
1 parent f7222f5 commit ba12e46
Show file tree
Hide file tree
Showing 45 changed files with 860 additions and 77 deletions.
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/Endrega.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/Fiend.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/Nekkers.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/Troll.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/arachasae.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/ghoul.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/golem.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/griffin.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/katakan.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/noonwraith.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/siren.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/tokens/fiend.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/griffin.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/katakan.png
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/noonwrait.png
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/tokens/siren.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/wolf.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/wyvern.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/warg.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/werewolf.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/wolves.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/wyvern.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/hearth.png
2 changes: 1 addition & 1 deletion lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"WITCHER.Actor.CoreStat.Rec": "REC",

"WITCHER.Actor.DerStat.Vigor": "VIGOR",
"WITCHER.Actor.DerStat.HP": "HP",
"WITCHER.Actor.DerStat.HP": "Max HP",
"WITCHER.Actor.DerStat.Sta": "STA",
"WITCHER.Actor.DerStat.Resolve": "RESOLVE",
"WITCHER.Actor.DerStat.Focus": "FOCUS",
Expand Down
7 changes: 4 additions & 3 deletions module/chat.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
export async function RollCustomMessage(rollResult, template, extraData) {
export async function RollCustomMessage(rollResult, template, actor, extraData) {
let templateContext = {
...extraData,
roll: rollResult,
tooltip: await rollResult.getTooltip()
};

let speaker = ChatMessage.getSpeaker(actor)
speaker.alias = actor.data.name
let chatData = {
user: game.user._if,
speaker: ChatMessage.getSpeaker(),
speaker: speaker,
roll: rollResult,
content: await renderTemplate(template, templateContext),
sound: CONFIG.sounds.dice
Expand Down
50 changes: 25 additions & 25 deletions module/sheets/WitcherActorSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export default class WitcherActorSheet extends ActorSheet {
}

let rollResult = new Roll(roll).roll()
await RollCustomMessage(rollResult, "systems/TheWitcherTRPG/templates/partials/chat/spell-chat.html", {
await RollCustomMessage(rollResult, "systems/TheWitcherTRPG/templates/partials/chat/spell-chat.html", this.actor, {
type: "Spell Roll",
title: spellItem.name,
staCost: spellItem.data.data.stamina,
Expand Down Expand Up @@ -244,7 +244,7 @@ export default class WitcherActorSheet extends ActorSheet {
}

let rollResult = new Roll(`1d10+${statValue}+${level}`).roll()
await RollCustomMessage(rollResult, "systems/TheWitcherTRPG/templates/partials/chat/profession-chat.html", {
await RollCustomMessage(rollResult, "systems/TheWitcherTRPG/templates/partials/chat/profession-chat.html", this.actor, {
type: "Stats Roll",
title: name,
effet: effet,
Expand All @@ -255,14 +255,14 @@ export default class WitcherActorSheet extends ActorSheet {

async _onCritRoll(event) {
let rollResult = new Roll("1d10x10").roll()
await RollCustomMessage(rollResult, "systems/TheWitcherTRPG/templates/partials/chat/crit-chat.html", {
await RollCustomMessage(rollResult, "systems/TheWitcherTRPG/templates/partials/chat/crit-chat.html", this.actor, {
type: "Stats Roll",
})
}

async _onDeathSaveRoll(event) {
let rollResult = new Roll("1d10").roll()
await RollCustomMessage(rollResult, "systems/TheWitcherTRPG/templates/partials/chat/stat-chat.html", {
await RollCustomMessage(rollResult, "systems/TheWitcherTRPG/templates/partials/chat/stat-chat.html", this.actor, {
type: "Stats Roll",
statName: "WITCHER.DeathSave",
difficulty: this.actor.data.data.coreStats.stun.value
Expand Down Expand Up @@ -313,7 +313,7 @@ export default class WitcherActorSheet extends ActorSheet {
}

let rollResult = new Roll("1d10").roll()
await RollCustomMessage(rollResult, "systems/TheWitcherTRPG/templates/partials/chat/stat-chat.html", {
await RollCustomMessage(rollResult, "systems/TheWitcherTRPG/templates/partials/chat/stat-chat.html", this.actor, {
type: "Stats Roll",
statName: statName,
difficulty: statValue
Expand Down Expand Up @@ -380,110 +380,110 @@ export default class WitcherActorSheet extends ActorSheet {
content: `<h2>${item.name} damage: ${formula}</h2>`,
buttons: {
LocationRandomHuman: {
label: "Human",
label: "Random Human",
callback: (html) => {
let location = getRandomInt(10)
switch(location){
case 1:
messageData.flavor= `<h1>Attack: ${item.name}</h1>Location: Head`;
messageData.flavor= `<h1>Attack: ${item.name}</h1><div>Location: Head</div><div>Effect: ${item.data.data.effect}</div>`;
formula = `(${formula})*3`;
break;
case 2:
case 3:
case 4:
messageData.flavor= `<h1>Attack: ${item.name}</h1>Location: Torso`;
messageData.flavor= `<h1>Attack: ${item.name}</h1><div>Location: Torso</div><div>Effect: ${item.data.data.effect}</div>`;
break;
case 5:
messageData.flavor= `<h1>Attack: ${item.name}</h1>Location: R Arm`;
messageData.flavor= `<h1>Attack: ${item.name}</h1><div>Location: R Arm</div><div>Effect: ${item.data.data.effect}</div>`;
formula = `(${formula})*0.5`;
break;
case 6:
messageData.flavor= `<h1>Attack: ${item.name}</h1>Location: L Arm`;
messageData.flavor= `<h1>Attack: ${item.name}</h1><div>Location: L Arm</div><div>Effect: ${item.data.data.effect}</div>`;
formula = `(${formula})*0.5`;
break;
case 7:
case 8:
messageData.flavor= `<h1>Attack: ${item.name}</h1>Location: R Leg`;
messageData.flavor= `<h1>Attack: ${item.name}</h1><div>Location: R Leg</div><div>Effect: ${item.data.data.effect}</div>`;
formula = `(${formula})*0.5`;
break;
case 9:
case 10:
messageData.flavor= `<h1>Attack: ${item.name}</h1>Location: R Leg`;
messageData.flavor= `<h1>Attack: ${item.name}</h1><div>Location: R Leg</div><div>Effect: ${item.data.data.effect}</div>`;
formula = `(${formula})*0.5`;
break;
default:
messageData.flavor= `<h1>Attack: ${item.name}</h1>Location: Torso`;
messageData.flavor= `<h1>Attack: ${item.name}</h1><div>Location: Torso</div><div>Effect: ${item.data.data.effect}</div>`;
}
new Roll(formula).roll().toMessage(messageData)
}
},
LocationRandomMonster: {
label: "Monster",
label: "Random Monster",
callback: (html) => {
let location = getRandomInt(10)
switch(location){
case 1:
messageData.flavor= `<h1>Attack: ${item.name}</h1>Location: Head`;
messageData.flavor= `<h1>Attack: ${item.name}</h1><div>Location: Head</div><div>Effect: ${item.data.data.effect}</div>`;
formula = `(${formula})*3`;
break;
case 2:
case 3:
case 4:
case 5:
messageData.flavor= `<h1>Attack: ${item.name}</h1>Location: Torso`;
messageData.flavor= `<h1>Attack: ${item.name}</h1><div>Location: Torso</div><div>Effect: ${item.data.data.effect}</div>`;
break;
case 6:
case 7:
messageData.flavor= `<h1>Attack: ${item.name}</h1>Location: R Limb`;
messageData.flavor= `<h1>Attack: ${item.name}</h1><div>Location: R Limb</div><div>Effect: ${item.data.data.effect}</div>`;
formula = `(${formula})*0.5`;
break;
case 8:
case 9:
messageData.flavor= `<h1>Attack: ${item.name}</h1>Location: L Limb`;
messageData.flavor= `<h1>Attack: ${item.name}</h1><div>Location: L Limb</div><div>Effect: ${item.data.data.effect}</div>`;
formula = `(${formula})*0.5`;
break;
case 10:
messageData.flavor= `<h1>Attack: ${item.name}</h1>Location: Tail or Wing`;
messageData.flavor= `<h1>Attack: ${item.name}</h1><div>Location: Tail or Wing</div><div>Effect: ${item.data.data.effect}</div>`;
formula = `(${formula})*0.5`;
break;
default:
messageData.flavor= `<h1>Attack: ${item.name}</h1>Location: Torso`;
messageData.flavor= `<h1>Attack: ${item.name}</h1><div>Location: Torso</div><div>Effect: ${item.data.data.effect}</div>`;
}
new Roll(formula).roll().toMessage(messageData)
}
},
LocationHead: {
label: "Head",
callback: (html) => {
messageData.flavor= `<h1>Attack: ${item.name}</h1>Location: Head`,
messageData.flavor= `<h1>Attack: ${item.name}</h1><div>Location: Head</div><div>Effect: ${item.data.data.effect}</div>`,
new Roll(`(${formula})*3`).roll().toMessage(messageData)
}
},
LocationTorso: {
label: "Torso",
callback: (html) => {
messageData.flavor= `<h1>Attack: ${item.name}</h1>Location: Torso`,
messageData.flavor= `<h1>Attack: ${item.name}</h1><div>Location: Torso</div><div>Effect: ${item.data.data.effect}</div>`,
new Roll(formula).roll().toMessage(messageData)
}
},
LocationArm: {
label: "Arm",
callback: (html) => {
messageData.flavor= `<h1>Attack: ${item.name}</h1>Location: Arm`,
messageData.flavor= `<h1>Attack: ${item.name}</h1><div>Location: Arm</div><div>Effect: ${item.data.data.effect}</div>`,
new Roll(`(${formula})*0.5`).roll().toMessage(messageData)
}
},
LocationLeg: {
label: "Leg",
callback: (html) => {
messageData.flavor= `<h1>Attack: ${item.name}</h1>Location: Leg`,
messageData.flavor= `<h1>Attack: ${item.name}</h1><div>Location: Leg</div><div>Effect: ${item.data.data.effect}</div>`,
new Roll(`(${formula})*0.5`).roll().toMessage(messageData)
}
},
LocationTail: {
label: "Tail",
callback: (html) => {
messageData.flavor= `<h1>Attack: ${item.name}</h1>Location: Tail or Wing`,
messageData.flavor= `<h1>Attack: ${item.name}</h1><div>Location: Tail or Wing</div><div>Effect: ${item.data.data.effect}</div>`,
new Roll(`(${formula})*0.5`).roll().toMessage(messageData)
}
}
Expand Down
6 changes: 4 additions & 2 deletions module/witcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ with the Hand to Hand Table, page 48 of Witcher TRPG Handbook.
@param {Actor} actor - The actor passed in from actor-sheet.js to have its properties updated
*/
function updateDerived(actor){

if (actor.data.data.customStats){
return null;
}
console.log(actor.data.data.customStats)
let thisActor = actor;
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;
Expand Down Expand Up @@ -80,7 +83,6 @@ function updateDerived(actor){
}

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 Down
Loading

0 comments on commit ba12e46

Please sign in to comment.