Skip to content

Commit

Permalink
Hotfix Core Module Release
Browse files Browse the repository at this point in the history
  • Loading branch information
Plushtoast committed Feb 12, 2021
1 parent da19ce5 commit e27b65f
Show file tree
Hide file tree
Showing 42 changed files with 407 additions and 346 deletions.
Binary file removed icons/backgrounds/hg.webp
Binary file not shown.
15 changes: 10 additions & 5 deletions lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@
"animal": "Tier",
"attributeChange": "Eigenschaftsänderung",
"attackOfOpportunity": "Der Kämpfer kann einen Passierschlag ausführen",
"opportunityAttack": "Passierschlag",
"attackFromBehind": "Angriff von Hinten",
"Advances": "Steigerungen",
"attributes": "Eigenschaften",
"astralenergy": "Astralenergie",
Expand Down Expand Up @@ -223,7 +225,7 @@
"guidevalue_small": "Leit- eigenschaft",
"GM notes": "SL Notizen",
"general": "allgemein",
"halfDefense": "der Verteidigungswert des Gegners wird für diesen Angriff halbiert",
"halfDefense": "der Verteidigungswert des Gegners muss für diesen Angriff halbiert werden",
"generalSpecialAbilities": "Allgemeine Sonderfertigkeiten",
"Hair_color": "Haarfarbe",
"Height": "Größe",
Expand Down Expand Up @@ -385,6 +387,7 @@
"Weight": "Gewicht",
"happyTalents": "Wohlgefällige Talente",
"wounds": "Lebenskraft",
"weaponModifier": "Waffenmodifikator",
"weapontype": "Waffengattung",
"worn": "Ausgerüstet",
"wrongHand": "Falsche Hand",
Expand Down Expand Up @@ -559,7 +562,7 @@
"Money-H": "Heller",
"Money-K": "Kreuzer",

"WELCOME": "<p><h2>Willkommen zu DSA5<br> für Foundry VTT</h2></p><p>Wir wünschen dir viel Spaß beim Spielen von DSA5.</p><h3>Erste Schritte</h3><p>Für einen einfachen und schnellen Start empfehlen wir das Grundregelmodul in deinem System zu installieren. So kannst du unverzüglich Aventurien erkunden. Wenn du das Grundregelmodul nicht hast, musst du alle Gegenstände, Zauber, Sonderfertigkeiten, Charaktere, etc. selbst anlegen.</p><p>Das Modul kannst du ab dem 16.2. unter <a href=\"https://ulisses-spiele.de/zum-f-shop/\" target=\"_blank\">https://ulisses-spiele.de/zum-f-shop/</a> erwerben.</p><p>Für die Charaktererstellung stelle sicher, dass du per Drag and Drop die Spezies auf dein Charakterblatt ziehst (zur Berechnung der Attribute).</p><p>Du kannst auch das kostenlose <a href=\"https://github.com/Plushtoast/dsa5_introduction\" target=\"_blank\">Einsteigermodul</a> installieren, das Karten, vorgefertigte Charaktere und ein kleines Abenteuer beinhaltet.</p><h3>Hilfe</h3><p>Bei Problemen benutze die Hilfe (/help im Chat) oder schau in unserem <a href=\"https://github.com/Plushtoast/dsa5-foundryVTT/wiki\" target=\"_blank\">Wiki</a> vorbei.</p><p>Diese Nachricht wird nur einmal angezeigt.</p>",
"WELCOME": "<p><h2>Willkommen zu DSA5<br> für Foundry VTT</h2></p><p>Wir wünschen dir viel Spaß beim Spielen von DSA5.</p><h3>Erste Schritte</h3><p>Für einen einfachen und schnellen Start empfehlen wir das Grundregelmodul in deinem System zu installieren. So kannst du unverzüglich Aventurien erkunden. Wenn du das Grundregelmodul nicht hast, musst du alle Gegenstände, Zauber, Sonderfertigkeiten, Charaktere, etc. selbst anlegen.</p><p>Das Modul kannst du im <a href=\"https://www.f-shop.de/virtual-tabletops/das-schwarze-auge-vtt/\" target=\"_blank\">F-Shop/</a> erwerben.</p><p>Für die Charaktererstellung stelle sicher, dass du per Drag and Drop die Spezies auf dein Charakterblatt ziehst (zur Berechnung der Attribute).</p><p>Du kannst auch das kostenlose <a href=\"https://github.com/Plushtoast/dsa5_introduction\" target=\"_blank\">Einsteigermodul</a> installieren, das Karten, vorgefertigte Charaktere und ein kleines Abenteuer beinhaltet.</p><h3>Hilfe</h3><p>Bei Problemen benutze die Hilfe (/help im Chat), besuche den ulisses-dsa Channel im <a target=\"_blank\" href=\"https://discord.gg/foundryvtt\">Foundry Discord</a> oder schau in unserem <a href=\"https://github.com/Plushtoast/dsa5-foundryVTT/wiki\" target=\"_blank\">Wiki</a> vorbei.</p><p>Diese Nachricht wird nur einmal angezeigt.</p>",

"SHEET": {
"PostItem": "Im Chat posten",
Expand Down Expand Up @@ -620,7 +623,7 @@
},

"HELP": {
"default": "Außerdem kannst du detaillierte Anleitungen und FAQs im <a href=\"https://github.com/Plushtoast/dsa5-foundryVTT/wiki\" target=\"_blank\">Wiki</a> finden.",
"default": "Außerdem kannst du detaillierte Anleitungen und FAQs im <a href=\"https://github.com/Plushtoast/dsa5-foundryVTT/wiki\" target=\"_blank\">Wiki</a> finden und Unterstützung im ulisses-dsa Channel im <a href=\"https://discord.gg/foundryvtt\" target=\"_blank\">Foundry Discord</a> erhalten.",
"command": "Befehl",
"example": "Beispiel",
"pay": "Bezahlen",
Expand Down Expand Up @@ -709,7 +712,8 @@

"OPPOSED": {
"winsFP": "<b>{winner}</b> gewinnt gegen <b>{loser}</b> mit {SL} Qualitätsstufe(n)",
"wins": "<b>{winner}</b> gewinnt gegen <b>{loser}</b>"
"wins": "<b>{winner}</b> gewinnt gegen <b>{loser}</b>",
"attackOfOpportunity": "<b>Beschreibung</b>: Passierschlag, Verteidigung unmöglich"
},

"ReverseSpellRanges": {
Expand Down Expand Up @@ -782,7 +786,8 @@
"MissingChoices": "Noch nicht alle Optionen ausgefüllt.",
"noProperActor": "Dir wurde noch kein Charakter zugewiesen oder du hast keinen Token markiert.",
"noMatch": "Keine Übereinstimmung",
"zeroXP": "Der Charakter hat noch keine Abenteuerpunkte. Möchtest du welche hinzufügen?"
"zeroXP": "Der Charakter hat noch keine Abenteuerpunkte. Möchtest du welche hinzufügen?",
"opposedAttackNoSpecAbs": "Passierschläge können nicht mit Sonderfertigkeiten kombiniert werden"
},

"CEREMONYMODIFIER": {
Expand Down
15 changes: 10 additions & 5 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"DAMAGE": "Damage",
"DODGE": "Dodge",
"modifyable": "mod.",
"AsPCost": "AE Kosten",
"KaPCost": "KP Kosten",
"AsPCost": "AE Cost",
"KaPCost": "KP Cost",
"EFFECT": "Effect test",
"-": "-",
"LEP": "Life Points",
Expand Down Expand Up @@ -110,6 +110,8 @@
"animal": "Animal",
"attributeChange": "Attribute change",
"attackOfOpportunity": "The defender can make an immediate attack of opportunity against the opponent",
"opportunityAttack": "Attack of Opportunity",
"attackFromBehind": "Attack from behind",
"Advances": "Advances",
"attributes": "Attributes",
"astralenergy": "Arcane energy",
Expand Down Expand Up @@ -221,7 +223,7 @@
"guidevalue_small": "Primary attribute",
"GM notes": "GM notes",
"general": "general",
"halfDefense": "Halve the target’s defense stat against the attack",
"halfDefense": "Halve the target’s defense stat against this attack",
"generalSpecialAbilities": "General Special Abilities",
"Hair_color": "Hair color",
"Height": "Height",
Expand Down Expand Up @@ -384,6 +386,7 @@
"happyTalents": "Favored skills",
"wounds": "Life points",
"weapontype": "Weapon type",
"weaponModifier": "Weapon Modifier",
"worn": "Worn",
"wrongHand": "Wrong hand",
"writing": "Writing",
Expand Down Expand Up @@ -706,7 +709,8 @@

"OPPOSED": {
"winsFP": "<b>{winner}</b> wins versus <b>{loser}</b> with {SL} quality level(s)",
"wins": "<b>{winner}</b> wins versus <b>{loser}</b>"
"wins": "<b>{winner}</b> wins versus <b>{loser}</b>",
"attackOfOpportunity": "<b>Description</b>: Attack of Opportunity, no defense allowed"
},

"ReverseSpellRanges": {
Expand Down Expand Up @@ -779,7 +783,8 @@
"MissingChoices": "There are missing choices.",
"noProperActor": "No actor has been assigned to you or you did not select a token.",
"noMatch": "No match",
"zeroXP": "The character has no adventure points yet. Do you want to add some?"
"zeroXP": "The character has no adventure points yet. Do you want to add some?",
"opposedAttackNoSpecAbs": "Attacks of Opportunity can not be combined with Special Abilites"
},

"CEREMONYMODIFIER": {
Expand Down
13 changes: 9 additions & 4 deletions modules/actor/actor-dsa5.js
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,9 @@ export default class Actordsa5 extends Actor {
title: title,
template: "/systems/dsa5/templates/dialog/regeneration-dialog.html",
data: {
rollMode: options.rollMode
rollMode: options.rollMode,
regenerationInterruptOptions: DSA5.regenerationInterruptOptions,
regnerationCampLocations: DSA5.regnerationCampLocations
},
callback: (html) => {
testData.situationalModifiers = []
Expand Down Expand Up @@ -920,7 +922,7 @@ export default class Actordsa5 extends Actor {
callback: (html) => {
cardOptions.rollMode = html.find('[name="rollMode"]').val();
testData.testModifier = Number(html.find('[name="testModifier"]').val());
testData.situationalModifiers = this._parseModifiers('[name = "situationalModifiers"]')
testData.situationalModifiers = this._parseModifiers('[name="situationalModifiers"]')
return { testData, cardOptions };
}
};
Expand Down Expand Up @@ -952,19 +954,22 @@ export default class Actordsa5 extends Actor {
title: title,
template: "/systems/dsa5/templates/dialog/characteristic-dialog.html",
data: {
rollMode: options.rollMode
rollMode: options.rollMode,
difficultyLabels: (DSA5.attributeDifficultyLabels)
},
callback: (html) => {
cardOptions.rollMode = html.find('[name="rollMode"]').val();
testData.testModifier = Number(html.find('[name="testModifier"]').val());
testData.testDifficulty = DSA5.attributeDifficultyModifiers[html.find('[name="testDifficulty"]').val()];
testData.situationalModifiers = this._parseModifiers('[name = "situationalModifiers"]')
testData.situationalModifiers = this._parseModifiers('[name="situationalModifiers"]')
return { testData, cardOptions };
}
};

let cardOptions = this._setupCardOptions("systems/dsa5/templates/chat/roll/characteristic-card.html", title)

console.log(testData)

return DiceDSA5.setupDialog({
dialogOptions: dialogOptions,
testData: testData,
Expand Down
50 changes: 15 additions & 35 deletions modules/actor/actor-sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ export default class ActorSheetDsa5 extends ActorSheet {
$(this._element).find(".import").attr("title", game.i18n.localize("SHEET.Import"));
$(this._element).find(".locksheet").attr("title", game.i18n.localize("SHEET.Lock"));
$(this._element).find(".library").attr("title", game.i18n.localize("SHEET.Library"));

if (this.currentFocus) {
$(this._element).find('[data-item-id="' + this.currentFocus + '"] .skill-advances').focus().select();
this.currentFocus = null;
}
}

static
Expand Down Expand Up @@ -480,25 +485,6 @@ export default class ActorSheetDsa5 extends ActorSheet {
posthand(ev)
});

html.find('.skill-advances').keydown(async event => {
this.skillUpdateFlag = event.keyCode == 9

if (event.keyCode == 13) // Enter
{
if (!this.skillsToEdit)
this.skillsToEdit = []

let itemId = this._getItemId(event);
let itemToEdit = duplicate(this.actor.getEmbeddedEntity("OwnedItem", itemId))
itemToEdit.data.talentValue.value = Number(event.target.value);
this.skillsToEdit.push(itemToEdit);

await this.actor.updateEmbeddedEntity("OwnedItem", this.skillsToEdit);

this.skillsToEdit = [];
}
})

html.find('.item-dropdown').click(ev => {
ev.preventDefault()
$(ev.currentTarget).closest('.item').find('.expandDetails').fadeToggle()
Expand Down Expand Up @@ -529,20 +515,12 @@ export default class ActorSheetDsa5 extends ActorSheet {



html.find('.skill-advances').focusout(async event => {
//event.preventDefault()
if (!this.skillsToEdit)
this.skillsToEdit = []
let itemId = this._getItemId(event);
html.find('.skill-advances').change(async ev => {
let itemId = this._getItemId(ev);
let itemToEdit = duplicate(this.actor.getEmbeddedEntity("OwnedItem", itemId))
itemToEdit.data.talentValue.value = Number(event.target.value);
this.skillsToEdit.push(itemToEdit);

if (!this.skillUpdateFlag)
return;

await this.actor.updateEmbeddedEntity("OwnedItem", this.skillsToEdit);
this.skillsToEdit = [];
itemToEdit.data.talentValue.value = Number(ev.target.value);
await this.actor.updateEmbeddedEntity("OwnedItem", itemToEdit);
this.currentFocus = $(document.activeElement).closest('.row-section').attr('data-item-id');;
});

html.find('.item-edit').click(ev => {
Expand Down Expand Up @@ -949,9 +927,11 @@ export default class ActorSheetDsa5 extends ActorSheet {
elem.data.data.quantity.value = thing.count
}
}
for (let thing of lookup) {
this._manageDragItems(thing, thing.type)
}
//we should improve that so it stacks items
await this.actor.createEmbeddedEntity("OwnedItem", lookup)
//for (let thing of lookup) {
// await this._manageDragItems(thing, thing.type)
//}
} else {
ui.notifications.error(game.i18n.format("DSAError.notFound", { category: thing.type, name: thing.name }))
}
Expand Down
13 changes: 12 additions & 1 deletion modules/dialog/dialog-combat-dsa5.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ export default class DSA5CombatDialog extends Dialog {
let roman = ['', ' I', ' II', ' III', ' IV', ' V', ' VI', ' VII', ' VIII', ' IX']
html.find('.specAbs').mousedown(ev => {

if (html.find('.opportunityAttack').is(":checked")) {
ui.notifications.error(game.i18n.localize("DSAError.opposedAttackNoSpecAbs"))
return
}

let step = Number($(ev.currentTarget).attr('data-step'))
let maxStep = Number($(ev.currentTarget).attr('data-maxStep'))


if (ev.button == 0) {
step = Math.min(maxStep, step + 1)
} else if (ev.button == 2) {
Expand All @@ -34,5 +38,12 @@ export default class DSA5CombatDialog extends Dialog {
}
$(ev.currentTarget).find('.step').text(roman[step])
});
html.find(".opportunityAttack").change(ev => {
if ($(ev.currentTarget).is(":checked")) {
for (let k of html.find('.specAbs')) {
$(k).removeClass('active').attr("data-step", 0).find('.step').text('')
}
}
})
}
}
1 change: 1 addition & 0 deletions modules/hooks/chatlog.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,6 @@ export default function() {
DSA5ChatListeners.showTables()
return false
}

})
}
1 change: 1 addition & 0 deletions modules/hooks/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default function() {

html.find('li[data-pack="dsa5.money"]').hide()
const packs = game.packs.filter(p => p.metadata.langs && !(p.metadata.langs.includes(game.i18n.lang)))

for (let pack of packs) {
let name = `${pack.metadata.system}.${pack.metadata.name}`
game.packs.delete(name)
Expand Down
11 changes: 8 additions & 3 deletions modules/item/item-dsa5.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,16 @@ export default class Itemdsa5 extends Item {

static parseEffect(effect, actor) {
let itemModifiers = {}
let regex = new RegExp(game.i18n.localize("CHARAbbrev.GS"), "gi")
for (let mod of effect.split(",").map(x => x.trim())) {
let vals = mod.replace(/(\s+)/g, ' ').trim().split(" ")
if (vals.length == 2) {
if (Number(vals[0]) != undefined) {
let number = Number(eval(vals[0].replace(/(gs|GS|Gs)/, actor.data.data.status.speed.max)))
let number = vals[0].replace(regex, actor.data.data.status.speed.max)
number = number.replace(/\d{1}[dDwW]\d/, function(match) {
return new Roll(match).roll().total
})
number = Math.round(Number(eval(number)))
if (itemModifiers[vals[1].toLowerCase()] == undefined) {
itemModifiers[vals[1].toLowerCase()] = number
} else {
Expand Down Expand Up @@ -175,7 +180,7 @@ export default class Itemdsa5 extends Item {



static chatData(data) {
static chatData(data, name) {
return []
}

Expand All @@ -188,7 +193,7 @@ export default class Itemdsa5 extends Item {

async postItem() {
let chatData = duplicate(this.data);
const properties = Itemdsa5.getSubClass(this.data.type).chatData(duplicate(chatData.data))
const properties = Itemdsa5.getSubClass(this.data.type).chatData(duplicate(chatData.data), this.name)

chatData["properties"] = properties

Expand Down
2 changes: 1 addition & 1 deletion modules/item/subclasses/aggregatedTest-item-dsa.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Itemdsa5 from "../item-dsa5.js";
export default class aggregatedTestItemDSA5 extends Itemdsa5 {
static chatData(data) {
static chatData(data, name) {
let result = game.i18n.localize("Ongoing")
if (data.cummulatedQS.value >= 10) {
result = game.i18n.localize("Success")
Expand Down
2 changes: 1 addition & 1 deletion modules/item/subclasses/ammunition-item-dsa.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Itemdsa5 from "../item-dsa5.js";

export default class AmmunitionItemDSA5 extends Itemdsa5 {
static chatData(data) {
static chatData(data, name) {
return [
this._chatLineHelper("ammunitiongroup", game.i18n.localize(data.ammunitiongroup.value))
]
Expand Down
2 changes: 1 addition & 1 deletion modules/item/subclasses/armor-item-dsa.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Itemdsa5 from "../item-dsa5.js"

export default class ArmorItemDSA5 extends Itemdsa5 {
static chatData(data) {
static chatData(data, name) {
let properties = [
this._chatLineHelper("protection", data.protection.value),
this._chatLineHelper("encumbrance", data.encumbrance.value)
Expand Down
2 changes: 1 addition & 1 deletion modules/item/subclasses/cantrip-item-dsa.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Itemdsa5 from "../item-dsa5.js";

export default class CantripItemDSA5 extends Itemdsa5 {
static chatData(data) {
static chatData(data, name) {
return [
this._chatLineHelper("duration", data.duration.value),
this._chatLineHelper("targetCategory", data.targetCategory.value),
Expand Down
6 changes: 6 additions & 0 deletions modules/item/subclasses/combatskill-item-dsa.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ import DiceDSA5 from "../../system/dice-dsa5.js";
import Itemdsa5 from "../item-dsa5.js";

export default class CombatskillDSA5 extends Itemdsa5 {
static chatData(data, name) {
return [
this._chatLineHelper("Description", game.i18n.localize(`Combatskilldescr.${name}`)),
]
}

static setupDialog(ev, options, item, actor) {
let mode = options.mode
let title = game.i18n.localize(item.name) + " " + game.i18n.localize(mode + "test");
Expand Down
2 changes: 1 addition & 1 deletion modules/item/subclasses/consumable-item-dsa.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import DSA5_Utility from "../../system/utility-dsa5.js";
import Itemdsa5 from "../item-dsa5.js";

export default class ConsumableItemDSA extends Itemdsa5 {
static chatData(data) {
static chatData(dat, name) {
return [
this._chatLineHelper("qualityStep", data.QL),
this._chatLineHelper("effect", DSA5_Utility.replaceDies(data.QLList.split("\n")[data.QL - 1])),
Expand Down
2 changes: 1 addition & 1 deletion modules/item/subclasses/disease-item-dsa.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import DSA5_Utility from "../../system/utility-dsa5.js";
import Itemdsa5 from "../item-dsa5.js";

export default class DiseaseItemDSA5 extends Itemdsa5 {
static chatData(data) {
static chatData(data, name) {
return [
this._chatLineHelper("stepValue", data.step.value),
this._chatLineHelper("incubation", data.incubation.value),
Expand Down
Loading

0 comments on commit e27b65f

Please sign in to comment.