Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.11 #82

Merged
merged 22 commits into from
Jun 7, 2020
Merged

0.11 #82

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
30bfe2d
Hooks have been moved to their own module/function.
SolarBear Jun 4, 2020
b6b1eab
Remove unneeded event handler
SolarBear Jun 4, 2020
c8245bc
Renamed some language properties to avoid plurals problem
SolarBear Jun 5, 2020
41bdf12
Bug fix: empty Other Items table would not display a message
SolarBear Jun 6, 2020
ed507bf
New NPC attack item
SolarBear Jun 6, 2020
45c114a
Updated NPC sheet size and removed that disgusting hack I was BURNING…
SolarBear Jun 6, 2020
9f69f60
New NPC attack items, most descriptive fields moved into the "info" p…
SolarBear Jun 6, 2020
85f5cd3
NPC sheet update, added mixin for easier editor placement and sizing
SolarBear Jun 6, 2020
d35f353
Default structure for info field (felt cleaner than placing it inside…
SolarBear Jun 6, 2020
433cb99
Related language changes
SolarBear Jun 6, 2020
bc0422f
Adding, deleting and editing NPC attacks-as-items now work
SolarBear Jun 6, 2020
3df7b03
Bug fix: Foundry would throw an Error because deleted NPC attack item…
SolarBear Jun 6, 2020
90e2332
Bug fix: wrong case for NPC attack item type
SolarBear Jun 6, 2020
2718bb0
Bug fix: wrong case for NPC attack item type
SolarBear Jun 6, 2020
06611fc
Finished attack migration
SolarBear Jun 7, 2020
1e27893
Merge branch 'npcRework' of github.com:SolarBear/Numenera-FoundryVTT …
SolarBear Jun 7, 2020
4843d6b
Bug fix: missing localizations
SolarBear Jun 7, 2020
1080aa5
Merge branch 'npcRework' into develop
SolarBear Jun 7, 2020
e6429d9
Bug fix: init skill rolls would use the die roll + bonus value instea…
SolarBear Jun 7, 2020
010ed83
Trademark notices to respect MCG's Fan Use Policy
SolarBear Jun 7, 2020
73bccae
Version 0.11.0
SolarBear Jun 7, 2020
ab32e70
Removed leftover debug
SolarBear Jun 7, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 29 additions & 13 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@
"NUMENERA.pcActorSheet.tab.equipment": "Equipment",
"NUMENERA.pcActorSheet.tab.bio": "Bio",

"NUMENERA.abilities.newAbility": "New Ability",
"NUMENERA.abilities.name": "Abilities",
"NUMENERA.abilities.type.action": "Action",
"NUMENERA.abilities.type.enabler": "Enabler",
"NUMENERA.abilities.tab.createTooltip": "Create",
"NUMENERA.abilities.tab.deleteTooltip": "Delete",
"NUMENERA.abilities.tab.rollTooltip": "Ability Roll",
"NUMENERA.abilities.tab.cost": "Cost",
"NUMENERA.abilities.tab.description": "Description",
"NUMENERA.abilities.tab.name": "Name",
"NUMENERA.abilities.tab.range": "Range",
"NUMENERA.abilities.tab.instructions": "No abilities yet. Create one by clicking the <a><i class=\"fas fa-plus\"></i></a> icon on the top right of the table or pick one from the Items Directory or a Compendium and drag it here.",
"NUMENERA.item.ability.newAbility": "New Ability",
"NUMENERA.item.ability.name": "Abilities",
"NUMENERA.item.ability.type.action": "Action",
"NUMENERA.item.ability.type.enabler": "Enabler",
"NUMENERA.item.ability.tab.createTooltip": "Create",
"NUMENERA.item.ability.tab.deleteTooltip": "Delete",
"NUMENERA.item.ability.tab.rollTooltip": "Ability Roll",
"NUMENERA.item.ability.tab.cost": "Cost",
"NUMENERA.item.ability.tab.description": "Description",
"NUMENERA.item.ability.tab.name": "Name",
"NUMENERA.item.ability.tab.range": "Range",
"NUMENERA.item.ability.tab.instructions": "No abilities yet. Create one by clicking the <a><i class=\"fas fa-plus\"></i></a> icon on the top right of the table or pick one from the Items Directory or a Compendium and drag it here.",

"NUMENERA.pc.advances.statPools": "+4 to stat pools",
"NUMENERA.pc.advances.effort": "+1 to Effort",
Expand All @@ -78,7 +78,11 @@
"NUMENERA.pc.numenera.artifact.name": "Artifacts",
"NUMENERA.pc.numenera.artifact.none": "No artifacts",
"NUMENERA.pc.numenera.artifact.roll": "Roll",
"NUMENERA.pc.numenera.artifact.effect": "Effect",
"NUMENERA.pc.numenera.artifact.form": "Form",
"NUMENERA.pc.numenera.artifact.unidentified": "Unidentified Artifact",
"NUMENERA.pc.numenera.artifact.identified": "Identified?",
"NUMENERA.pc.numenera.artifact.level": "Level",

"NUMENERA.pc.numenera.cypher.deleteTooltip": "Delete",
"NUMENERA.pc.numenera.cypher.effect": "Effect",
Expand Down Expand Up @@ -165,12 +169,24 @@
"NUMENERA.npc.movement": "Movement",
"NUMENERA.npc.armor": "Armor",
"NUMENERA.npc.damage": "Damage",
"NUMENERA.npc.attacks.sectionName": "Attacks",
"NUMENERA.npc.attacks.description": "Description",
"NUMENERA.npc.attacks.placeholder": "Attack Description",
"NUMENERA.npc.attacks.createTooltip": "Create",
"NUMENERA.npc.attacks.deleteTooltip": "Delete",
"NUMENERA.npc.attacks.none": "No attacks yet. Create one by clicking the <a><i class=\"fas fa-plus\"></i></a> icon on the top right of the table or pick one from the Items Directory or a Compendium and drag it here.",
"NUMENERA.npc.modifications": "Modifications",
"NUMENERA.npc.description": "Description",
"NUMENERA.npc.use": "Use",
"NUMENERA.npc.environment": "Environment",
"NUMENERA.npc.loot": "Loot",
"NUMENERA.npc.motive": "Motive",
"NUMENERA.npc.combat": "Combat",
"NUMENERA.npc.interaction": "Interaction",
"NUMENERA.npc.gmIntrusion": "GM Intrusion",

"NUMENERA.npcActorSheet.tab.attacks": "Attacks",
"NUMENERA.npcActorSheet.tab.description": "Description",
"NUMENERA.npcActorSheet.tab.information": "Information",

"NUMENERA.item.ability.isAction": "This ability is an Action",
"NUMENERA.item.ability.isEnabler": "This ability is an Enabler",
Expand Down
42 changes: 29 additions & 13 deletions lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@
"NUMENERA.pcActorSheet.tab.equipment": "Équipement",
"NUMENERA.pcActorSheet.tab.bio": "Bio",

"NUMENERA.abilities.newAbility": "Nouvelle Aptitude",
"NUMENERA.abilities.name": "Aptitudes",
"NUMENERA.abilities.type.action": "Action",
"NUMENERA.abilities.type.enabler": "Catalyseur",
"NUMENERA.abilities.tab.createTooltip": "Créer",
"NUMENERA.abilities.tab.deleteTooltip": "Supprimer",
"NUMENERA.abilities.tab.rollTooltip": "Jet d'aptitude",
"NUMENERA.abilities.tab.cost": "Coût",
"NUMENERA.abilities.tab.description": "Description",
"NUMENERA.abilities.tab.name": "Nom",
"NUMENERA.abilities.tab.range": "Portée",
"NUMENERA.abilities.tab.instructions": "Pas d'aptitudes. Créez-en une en cliquant sur l'icône <a><i class=\"fas fa-plus\"></i></a> en haut à droite du tableau ou sélectionnez-en une du ITEMS DIRECTORY ou d'un Compendium et DRAGGEZ-la jusque ici.",
"NUMENERA.item.ability.newAbility": "Nouvelle Aptitude",
"NUMENERA.item.ability.name": "Aptitudes",
"NUMENERA.item.ability.type.action": "Action",
"NUMENERA.item.ability.type.enabler": "Catalyseur",
"NUMENERA.item.ability.tab.createTooltip": "Créer",
"NUMENERA.item.ability.tab.deleteTooltip": "Supprimer",
"NUMENERA.item.ability.tab.rollTooltip": "Jet d'aptitude",
"NUMENERA.item.ability.tab.cost": "Coût",
"NUMENERA.item.ability.tab.description": "Description",
"NUMENERA.item.ability.tab.name": "Nom",
"NUMENERA.item.ability.tab.range": "Portée",
"NUMENERA.item.ability.tab.instructions": "Pas d'aptitudes. Créez-en une en cliquant sur l'icône <a><i class=\"fas fa-plus\"></i></a> en haut à droite du tableau ou sélectionnez-en une du ITEMS DIRECTORY ou d'un Compendium et DRAGGEZ-la jusque ici.",

"NUMENERA.pc.advances.statPools": "+4 aux Réserves",
"NUMENERA.pc.advances.effort": "+1 en Effort",
Expand All @@ -78,7 +78,11 @@
"NUMENERA.pc.numenera.artifact.name": "Artefacts",
"NUMENERA.pc.numenera.artifact.none": "Pas d'artefacts",
"NUMENERA.pc.numenera.artifact.roll": "Jet",
"NUMENERA.pc.numenera.artifact.effect": "Effet",
"NUMENERA.pc.numenera.artifact.form": "Forme",
"NUMENERA.pc.numenera.artifact.unidentified": "Artefact non identifié",
"NUMENERA.pc.numenera.artifact.identified": "Identifié ?",
"NUMENERA.pc.numenera.artifact.level": "Niveau",

"NUMENERA.pc.numenera.cypher.deleteTooltip": "Supprimer",
"NUMENERA.pc.numenera.cypher.effect": "Effet",
Expand Down Expand Up @@ -165,12 +169,24 @@
"NUMENERA.npc.movement": "Mouvement",
"NUMENERA.npc.armor": "Armure",
"NUMENERA.npc.damage": "Dommages",
"NUMENERA.npc.attacks.sectionName": "Attaques",
"NUMENERA.npc.attacks.description": "Description",
"NUMENERA.npc.attacks.placeholder": "Description de l'attaque",
"NUMENERA.npc.attacks.createTooltip": "Créer",
"NUMENERA.npc.attacks.deleteTooltip": "Supprimer",
"NUMENERA.npc.attacks.none": "Pas d'attaques. Créez-en une en cliquant sur l'icône <a><i class=\"fas fa-plus\"></i></a> en haut à droite du tableau ou sélectionnez-en une du ITEMS DIRECTORY ou d'un Compendium et DRAGGEZ-la jusque ici.",
"NUMENERA.npc.modifications": "Modifications",
"NUMENERA.npc.description": "Description",
"NUMENERA.npc.use": "Utilisation",
"NUMENERA.npc.environment": "Environnement",
"NUMENERA.npc.loot": "Butin",
"NUMENERA.npc.motive": "Motivations",
"NUMENERA.npc.combat": "Combat",
"NUMENERA.npc.interaction": "Interaction",
"NUMENERA.npc.gmIntrusion": "Intrusion du MJ",

"NUMENERA.npcActorSheet.tab.attacks": "Attaques",
"NUMENERA.npcActorSheet.tab.description": "Description",
"NUMENERA.npcActorSheet.tab.information": "Informations",

"NUMENERA.item.ability.isAction": "Cette aptitude est une Action",
"NUMENERA.item.ability.isEnabler": "Cette aptitude est un ENABLER",
Expand Down
15 changes: 15 additions & 0 deletions module/actor/NumeneraNPCActor.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
export class NumeneraNPCActor extends Actor {
static defaultInfo() {
return `<h2>${game.i18n.localize("NUMENERA.npc.motive")}</h2><p>...</p>
<h2>${game.i18n.localize("NUMENERA.npc.combat")}</h2><p>...</p>
<h2>${game.i18n.localize("NUMENERA.npc.interaction")}</h2><p>...</p>
<h2>${game.i18n.localize("NUMENERA.npc.use")}</h2><p>...</p>
<h2>${game.i18n.localize("NUMENERA.npc.loot")}</h2><p>...</p>
<h2>${game.i18n.localize("NUMENERA.npc.gmIntrusion")}</h2><p>...</p>`;
}

constructor(...args) {
super(...args);

this.data.data.info = this.data.data.info || NumeneraNPCActor.defaultInfo();
}

getInitiativeFormula() {
/* TODO: improve this
The init system expects a formula for initiative: fixed values don't seem to work.
Expand Down
40 changes: 20 additions & 20 deletions module/actor/NumeneraPCActor.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { numeneraRoll } from "../roll.js";
import { numeneraRoll, numeneraRollFormula } from "../roll.js";

const effortObject = {
cost: 0,
Expand All @@ -19,21 +19,11 @@ export class NumeneraPCActor extends Actor {
}

getInitiativeFormula() {
//TODO: use numeneraRoll() here instead of duplicating roll logic

//Check for an initiative skill
const initSkill = this.items.find(i => i.type === "skill" && i.name.toLowerCase() === "Initiative")
let initSkillLevel = 0;
if (initSkill)
initSkillLevel = 3 * this.getSkillLevel(initSkill);

//TODO possible assets, effort on init roll
let formula = "1d20"
if (initSkill !== 0) {
formula += `+${initSkillLevel}`;
}
const initSkill = this.items.find(i => i.type === "skill" && i.name.toLowerCase() === "initiative")

return formula;
//TODO possible assets, effort on init roll
return this.getSkillFormula(initSkill);
}

get effort() {
Expand All @@ -56,6 +46,19 @@ export class NumeneraPCActor extends Actor {
}).length;
}

getSkillFormula(skill) {
if (!skill)
return;

const skillLevel = this.getSkillLevel(skill);
return numeneraRollFormula(skillLevel);
}

rollSkillById(skillId) {
const skill = this.getOwnedItem(skillId);
return this.rollSkill(skill);
}

/**
* Given a skill ID, fetch the skill level bonus and roll a d20, adding the skill
* bonus.
Expand All @@ -64,8 +67,8 @@ export class NumeneraPCActor extends Actor {
* @returns
* @memberof NumeneraPCActor
*/
rollSkill(skillId) {
if (!skillId)
rollSkill(skill) {
if (!skill)
return;

switch (this.data.data.damageTrack) {
Expand All @@ -78,10 +81,7 @@ export class NumeneraPCActor extends Actor {
return;
}

const skill = this.getOwnedItem(skillId);
const skillLevel = this.getSkillLevel(skill);

const roll = numeneraRoll(skillLevel);
const roll = new Roll(this.getSkillFormula(skill)).roll();

roll.toMessage({
speaker: ChatMessage.getSpeaker({ actor: this.actor }),
Expand Down
Loading