Skip to content

Commit

Permalink
Merge pull request #82 from SolarBear/develop
Browse files Browse the repository at this point in the history
0.11
  • Loading branch information
SolarBear committed Jun 7, 2020
2 parents 95928f4 + ab32e70 commit 34a9b2a
Show file tree
Hide file tree
Showing 23 changed files with 637 additions and 427 deletions.
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

0 comments on commit 34a9b2a

Please sign in to comment.