from totem to vermine - v0.0.12
This commit is contained in:
+24
-24
@@ -1,4 +1,4 @@
|
||||
export const TOTEM = {};
|
||||
export const VERMINE = {};
|
||||
|
||||
/**
|
||||
* The set of Ability Scores used within the sytem.
|
||||
@@ -6,16 +6,16 @@ export const TOTEM = {};
|
||||
*/
|
||||
|
||||
|
||||
TOTEM.SkillLevels = {
|
||||
1:{ "label":"TOTEM.skill_level.beginner", "dicePool":1, "reroll":0},
|
||||
2:{ "label":"TOTEM.skill_level.proficient", "dicePool":1, "reroll":1},
|
||||
3:{ "label":"TOTEM.skill_level.expert", "dicePool":2, "reroll":1},
|
||||
4:{ "label":"TOTEM.skill_level.master", "dicePool":2, "reroll":2},
|
||||
5:{ "label":"TOTEM.skill_level.archmaster", "dicePool":3, "reroll":2},
|
||||
5:{ "label":"TOTEM.skill_level.legend", "dicePool":3, "reroll":3},
|
||||
VERMINE.SkillLevels = {
|
||||
1:{ "label":"VERMINE.skill_level.beginner", "dicePool":1, "reroll":0},
|
||||
2:{ "label":"VERMINE.skill_level.proficient", "dicePool":1, "reroll":1},
|
||||
3:{ "label":"VERMINE.skill_level.expert", "dicePool":2, "reroll":1},
|
||||
4:{ "label":"VERMINE.skill_level.master", "dicePool":2, "reroll":2},
|
||||
5:{ "label":"VERMINE.skill_level.archmaster", "dicePool":3, "reroll":2},
|
||||
5:{ "label":"VERMINE.skill_level.legend", "dicePool":3, "reroll":3},
|
||||
}
|
||||
|
||||
TOTEM.Instincts = {
|
||||
VERMINE.Instincts = {
|
||||
1:{ "key":"architect"},
|
||||
2:{ "key":"sword"},
|
||||
3:{ "key":"flail"},
|
||||
@@ -29,45 +29,45 @@ TOTEM.Instincts = {
|
||||
}
|
||||
|
||||
|
||||
TOTEM.abilityCategories = {
|
||||
VERMINE.abilityCategories = {
|
||||
"physical": {
|
||||
"label":"TOTEM.ability_category.physical"
|
||||
"label":"VERMINE.ability_category.physical"
|
||||
},
|
||||
"manual": {
|
||||
"label":"TOTEM.ability_category.manual"
|
||||
"label":"VERMINE.ability_category.manual"
|
||||
},
|
||||
"mental": {
|
||||
"label":"TOTEM.ability_category.mental"
|
||||
"label":"VERMINE.ability_category.mental"
|
||||
},
|
||||
"social": {
|
||||
"label":"TOTEM.ability_category.social"
|
||||
"label":"VERMINE.ability_category.social"
|
||||
}
|
||||
}
|
||||
|
||||
TOTEM.skillCategories = {
|
||||
VERMINE.skillCategories = {
|
||||
"man": {
|
||||
"label":"TOTEM.skill_category.man"
|
||||
"label":"VERMINE.skill_category.man"
|
||||
},
|
||||
"animal": {
|
||||
"label":"TOTEM.skill_category.animal"
|
||||
"label":"VERMINE.skill_category.animal"
|
||||
},
|
||||
"tool": {
|
||||
"label":"TOTEM.skill_category.tool"
|
||||
"label":"VERMINE.skill_category.tool"
|
||||
},
|
||||
"weapon": {
|
||||
"label":"TOTEM.skill_category.weapon"
|
||||
"label":"VERMINE.skill_category.weapon"
|
||||
},
|
||||
"survival": {
|
||||
"label":"TOTEM.skill_category.survival"
|
||||
"label":"VERMINE.skill_category.survival"
|
||||
},
|
||||
"world": {
|
||||
"label":"TOTEM.skill_category.world"
|
||||
"label":"VERMINE.skill_category.world"
|
||||
}
|
||||
}
|
||||
|
||||
TOTEM.sexes = {"male": "TOTEM.sexes.male", "female": "TOTEM.sexes.female"};
|
||||
VERMINE.sexes = {"male": "VERMINE.sexes.male", "female": "VERMINE.sexes.female"};
|
||||
|
||||
TOTEM.totems = {"human":"TOTEMS.human.name",
|
||||
VERMINE.totems = {"human":"TOTEMS.human.name",
|
||||
"predator": "TOTEMS.predator.name" ,
|
||||
"scavenger": "TOTEMS.scavenger.name" ,
|
||||
"symbiote": "TOTEMS.symbiote.name" ,
|
||||
@@ -78,7 +78,7 @@ TOTEM.totems = {"human":"TOTEMS.human.name",
|
||||
"loner": "TOTEMS.loner.name",
|
||||
"adapted": "TOTEMS.adapted.name" }
|
||||
|
||||
TOTEM.origins = {"aon":"Aon",
|
||||
VERMINE.origins = {"aon":"Aon",
|
||||
"avhorae": "Avhorae" ,
|
||||
"babel": "Babel",
|
||||
"soleil_noir": "Empire du Soleil Noir",
|
||||
|
||||
@@ -36,13 +36,13 @@
|
||||
}
|
||||
|
||||
export const getRollBox = async function(data) {
|
||||
let html = await renderTemplate('systems/totem/templates/roll.hbs', data);
|
||||
let html = await renderTemplate('systems/vermine2047/templates/roll.hbs', data);
|
||||
let ui = new Dialog({
|
||||
title: game.i18n.localize("TOTEM.roll_tool"),
|
||||
title: game.i18n.localize("VERMINE.roll_tool"),
|
||||
content: html,
|
||||
buttons: {
|
||||
roll: {
|
||||
label: game.i18n.localize('TOTEM.roll_dice'),
|
||||
label: game.i18n.localize('VERMINE.roll_dice'),
|
||||
callback: (html) => {
|
||||
let form = html.find('#dice-pool-form');
|
||||
if (!form[0].checkValidity()) {
|
||||
@@ -88,7 +88,7 @@
|
||||
if (formData.helped !== undefined && formData.helped == 1){
|
||||
NoD += 1;
|
||||
}
|
||||
return game.totem.TotemRoll.roll(data.actorId, data.label, NoD, Reroll, data);
|
||||
return game.vermine2047.VermineRoll.roll(data.actorId, data.label, NoD, Reroll, data);
|
||||
}
|
||||
},
|
||||
close: {
|
||||
|
||||
+28
-28
@@ -1,8 +1,8 @@
|
||||
import { TOTEM } from "./config.mjs";
|
||||
import { VERMINE } from "./config.mjs";
|
||||
import { getActorSkillScore,updateActorSkillScore } from "./functions.mjs";
|
||||
import { CombatResultDialog } from "./dialogs.mjs";
|
||||
|
||||
export class TotemFight {
|
||||
export class VermineFight {
|
||||
|
||||
async performTest(enemyAchievement, enemyConservation, skillKey, skill, params, actor) {
|
||||
const dicePool = (params.spleen != undefined || params.purpose != undefined) ? '5' : '4';
|
||||
@@ -32,7 +32,7 @@ export class TotemFight {
|
||||
|
||||
bonusText += bonus;
|
||||
|
||||
let targetText = game.i18n.format('TOTEM.Selected') + ' : ' + game.i18n.format(skillKey) + " " + skill + bonusText;
|
||||
let targetText = game.i18n.format('VERMINE.Selected') + ' : ' + game.i18n.format(skillKey) + " " + skill + bonusText;
|
||||
if (params.specialization != undefined){
|
||||
targetText += " (S)";
|
||||
}
|
||||
@@ -41,10 +41,10 @@ export class TotemFight {
|
||||
|
||||
if (params.purpose != undefined){
|
||||
discardedRoll = r.terms[0].results.shift();
|
||||
dicePoolHint = ' - ' + game.i18n.format('TOTEM.PurposeTrait');
|
||||
dicePoolHint = ' - ' + game.i18n.format('VERMINE.PurposeTrait');
|
||||
} else if (params.spleen != undefined){
|
||||
discardedRoll = r.terms[0].results.pop();
|
||||
dicePoolHint = ' - ' + game.i18n.format('TOTEM.SpleenTrait');
|
||||
dicePoolHint = ' - ' + game.i18n.format('VERMINE.SpleenTrait');
|
||||
}
|
||||
const discardedRollText = (discardedRoll.result != undefined) ? '<div class="discarded-roll">' + discardedRoll.result + '</div>' : "";
|
||||
|
||||
@@ -53,11 +53,11 @@ export class TotemFight {
|
||||
diceString += '<li class="roll die d6 die-'+ i +'">' + result + '</li>';
|
||||
}
|
||||
|
||||
let hintText = game.i18n.format('TOTEM.ConfrontationHint');
|
||||
let hintText = game.i18n.format('VERMINE.ConfrontationHint');
|
||||
|
||||
// Build a dynamic html using the variables from above.
|
||||
const html = `
|
||||
<div class="totem roll confrontation">
|
||||
<div class="vermine2047 roll confrontation">
|
||||
<div class="dice-roll">
|
||||
<div class="dice-result">
|
||||
<div class="dice-formula">
|
||||
@@ -76,8 +76,8 @@ export class TotemFight {
|
||||
</div>` +
|
||||
`<p class="step1-text" id="step1">` + hintText + `</p>
|
||||
<div class="row">
|
||||
<a class="inline-block button add-to-achievement">` + game.i18n.format('TOTEM.Achievement') + `</a>
|
||||
<a class="inline-block button add-to-conservation">` + game.i18n.format('TOTEM.Conservation') + `</a>
|
||||
<a class="inline-block button add-to-achievement">` + game.i18n.format('VERMINE.Achievement') + `</a>
|
||||
<a class="inline-block button add-to-conservation">` + game.i18n.format('VERMINE.Conservation') + `</a>
|
||||
<a class="inline-block button reset"><i class="fa-solid fa-rotate-right"></i></a>
|
||||
<a class="inline-block button resolve"><i class="fa-solid fa-check"></i></a>
|
||||
</div>
|
||||
@@ -119,24 +119,24 @@ export class TotemFight {
|
||||
static instance = null;
|
||||
|
||||
static get() {
|
||||
if (!TotemFight.instance)
|
||||
TotemFight.instance = new TotemFight();
|
||||
return TotemFight.instance;
|
||||
if (!VermineFight.instance)
|
||||
VermineFight.instance = new VermineFight();
|
||||
return VermineFight.instance;
|
||||
}
|
||||
|
||||
|
||||
// data injected to char data
|
||||
static previousValues = {
|
||||
dicePool: 4,
|
||||
skills: TOTEM.skillsList,
|
||||
cskills: TOTEM.cskills,
|
||||
skills: VERMINE.skillsList,
|
||||
cskills: VERMINE.cskills,
|
||||
cephalic: false,
|
||||
achievementReroll: TOTEM.achievementReroll,
|
||||
conservationReroll: TOTEM.conservationReroll
|
||||
achievementReroll: VERMINE.achievementReroll,
|
||||
conservationReroll: VERMINE.conservationReroll
|
||||
};
|
||||
|
||||
static rollerTemplate = 'systems/totem/templates/fight.html';
|
||||
static CombatResultTemplate = 'systems/totem/templates/fight-result.html';
|
||||
static rollerTemplate = 'systems/vermine2047/templates/fight.html';
|
||||
static CombatResultTemplate = 'systems/vermine2047/templates/fight-result.html';
|
||||
|
||||
static async chatMessageHandler(message, html, data) {
|
||||
// console.log("accès au fin du fin", message._id);
|
||||
@@ -225,15 +225,15 @@ export class TotemFight {
|
||||
if (actor == null && externalData.speakerId != undefined && externalData.speakerId != null){
|
||||
// on récupère le speakerId, et de là l'objet actor
|
||||
actor = game.actors.get(externalData.speakerId);
|
||||
TotemFight.previousValues['speakerName'] = actor.name;
|
||||
TotemFight.previousValues['speakerImg'] = actor.img;
|
||||
VermineFight.previousValues['speakerName'] = actor.name;
|
||||
VermineFight.previousValues['speakerImg'] = actor.img;
|
||||
} else {
|
||||
TotemFight.previousValues['speakerName'] = "Anonyme";
|
||||
VermineFight.previousValues['speakerName'] = "Anonyme";
|
||||
}
|
||||
|
||||
// get the data
|
||||
let charData = (externalData) => {
|
||||
let o = Object.assign({ _template: TotemFight.rollerTemplate }, {...TotemFight.previousValues, ...externalData});
|
||||
let o = Object.assign({ _template: VermineFight.rollerTemplate }, {...VermineFight.previousValues, ...externalData});
|
||||
return o;
|
||||
};
|
||||
let data = charData(externalData);
|
||||
@@ -243,11 +243,11 @@ export class TotemFight {
|
||||
let html = await renderTemplate(data._template, data);
|
||||
|
||||
let ui = new Dialog({
|
||||
title: game.i18n.localize("TOTEM.FightTool"),
|
||||
title: game.i18n.localize("VERMINE.FightTool"),
|
||||
content: html,
|
||||
buttons: {
|
||||
roll: {
|
||||
label: game.i18n.localize('TOTEM.Roll4Fight'),
|
||||
label: game.i18n.localize('VERMINE.Roll4Fight'),
|
||||
callback: (html) => {
|
||||
let form = html.find('#dice-pool-form');
|
||||
if (!form[0].checkValidity()) {
|
||||
@@ -298,7 +298,7 @@ export class TotemFight {
|
||||
updateActorSkillScore(actor, skillKey, 'spent', newSpentScore);
|
||||
}
|
||||
|
||||
return TotemFight.get().performTest(enemyAchievement + enemySkill, enemyConservation + enemySkill, skillKey, skill, params, actor);
|
||||
return VermineFight.get().performTest(enemyAchievement + enemySkill, enemyConservation + enemySkill, skillKey, skill, params, actor);
|
||||
}
|
||||
},
|
||||
cancel: {
|
||||
@@ -321,7 +321,7 @@ export class TotemFight {
|
||||
}
|
||||
}
|
||||
|
||||
export class TotemCombat extends Combat {
|
||||
export class VermineCombat extends Combat {
|
||||
_encounterCheck(){
|
||||
console.log('encounter combat object', this);
|
||||
}
|
||||
@@ -365,7 +365,7 @@ export class TotemCombat extends Combat {
|
||||
});
|
||||
|
||||
if (combatant.type != 'character'){
|
||||
let warningDialogHTML = await renderTemplate('systems/totem/templates/dialogs/warning.html', {
|
||||
let warningDialogHTML = await renderTemplate('systems/vermine2047/templates/dialogs/warning.html', {
|
||||
warningText: "Seuls les PJs peuvent initier des confrontations. Relancer l'opération au tour du PJ actif."
|
||||
});
|
||||
Dialog.prompt({
|
||||
@@ -379,7 +379,7 @@ export class TotemCombat extends Combat {
|
||||
} else {
|
||||
// étape 2 : on envoie les infos
|
||||
let fightingActor = game.actors.get(combatant.actorId);
|
||||
TotemFight.ui({
|
||||
VermineFight.ui({
|
||||
speakerId: combatant.actorId,
|
||||
speakerWeapons: fightingActor.items.filter(item => item.type == 'weapon'),
|
||||
speakerExperience:fightingActor.system.attributes.experience.value,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { TOTEM } from './config.mjs'
|
||||
import { VERMINE } from './config.mjs'
|
||||
/**
|
||||
* renvoie le score d'une compétence d'un actor existant
|
||||
* @param {TotemActor}
|
||||
* @param {VermineActor}
|
||||
* @return {number||null} Data for rendering or null
|
||||
*/
|
||||
export function getActorSkillScore(actor, skillLabel, property = "value") {
|
||||
@@ -27,15 +27,15 @@ export function getActorSkillScore(actor, skillLabel, property = "value") {
|
||||
|
||||
/**
|
||||
* renvoie le type d'une compétence
|
||||
* @param {TotemActor}
|
||||
* @param {VermineActor}
|
||||
* @return {string||null} Data for rendering or null
|
||||
*/
|
||||
export function getSkillTypeFromLabel(skillLabel) {
|
||||
let returnedValue = null;
|
||||
|
||||
for(let i in TOTEM.skills){
|
||||
for(let j in TOTEM.skills[i].data){
|
||||
if (TOTEM.skills[i].data[j].label == skillLabel){
|
||||
for(let i in VERMINE.skills){
|
||||
for(let j in VERMINE.skills[i].data){
|
||||
if (VERMINE.skills[i].data[j].label == skillLabel){
|
||||
returnedValue = j;
|
||||
}
|
||||
}
|
||||
@@ -46,7 +46,7 @@ export function getSkillTypeFromLabel(skillLabel) {
|
||||
|
||||
/**
|
||||
* met à jour le score d'une compétence d'un actor existant
|
||||
* @param {TotemActor}
|
||||
* @param {VermineActor}
|
||||
* @return {boolean} bool
|
||||
*/
|
||||
export function updateActorSkillScore(selectedActor, skillLabel, property = "value", updatedValue) {
|
||||
@@ -84,7 +84,7 @@ export function updateActorSkillScore(selectedActor, skillLabel, property = "val
|
||||
|
||||
/**
|
||||
* réinitialise toutes les dépenses d'usure
|
||||
* @param {TotemActor}
|
||||
* @param {VermineActor}
|
||||
* @return {boolean} bool
|
||||
*/
|
||||
export function resetActorSkillUsure(selectedActor) {
|
||||
|
||||
@@ -8,21 +8,21 @@
|
||||
|
||||
|
||||
// Actor partials.
|
||||
"systems/totem/templates/actor/parts/actor-spells.html",
|
||||
"systems/totem/templates/actor/parts/actor-features.html",
|
||||
"systems/totem/templates/actor/parts/actor-spells.html",
|
||||
"systems/totem/templates/actor/parts/actor-id.hbs",
|
||||
"systems/totem/templates/actor/parts/actor-totem.hbs",
|
||||
"systems/totem/templates/actor/parts/character-features.hbs",
|
||||
"systems/totem/templates/actor/parts/character-header.hbs",
|
||||
"systems/totem/templates/actor/parts/actor-items.html",
|
||||
"systems/totem/templates/actor/parts/actor-weapons.hbs",
|
||||
"systems/totem/templates/actor/parts/actor-defenses.hbs",
|
||||
"systems/totem/templates/actor/parts/actor-stories.hbs",
|
||||
"systems/totem/templates/actor/parts/actor-effects.html",
|
||||
"systems/vermine2047/templates/actor/parts/actor-spells.html",
|
||||
"systems/vermine2047/templates/actor/parts/actor-features.html",
|
||||
"systems/vermine2047/templates/actor/parts/actor-spells.html",
|
||||
"systems/vermine2047/templates/actor/parts/actor-id.hbs",
|
||||
"systems/vermine2047/templates/actor/parts/actor-totem.hbs",
|
||||
"systems/vermine2047/templates/actor/parts/character-features.hbs",
|
||||
"systems/vermine2047/templates/actor/parts/character-header.hbs",
|
||||
"systems/vermine2047/templates/actor/parts/actor-items.html",
|
||||
"systems/vermine2047/templates/actor/parts/actor-weapons.hbs",
|
||||
"systems/vermine2047/templates/actor/parts/actor-defenses.hbs",
|
||||
"systems/vermine2047/templates/actor/parts/actor-stories.hbs",
|
||||
"systems/vermine2047/templates/actor/parts/actor-effects.html",
|
||||
|
||||
// additional templates
|
||||
"systems/totem/templates/roll.hbs",
|
||||
"systems/vermine2047/templates/roll.hbs",
|
||||
]);
|
||||
};
|
||||
|
||||
|
||||
+11
-11
@@ -5,19 +5,19 @@ export const registerHooks = function () {
|
||||
*/
|
||||
|
||||
Hooks.once("ready", async () => {
|
||||
console.info("Totem | System Initialized.");
|
||||
console.info("Vermine 2047 | System Initialized.");
|
||||
});
|
||||
|
||||
// changement de la pause
|
||||
/*Hooks.on("renderPause", async function () {
|
||||
if ($("#pause").attr("class") !== "paused") return;
|
||||
$(".paused img").attr("src", 'systems/totem/assets/images/ui/vermine_pause.webp');
|
||||
$(".paused img").attr("src", 'systems/vermine2047/assets/images/ui/vermine_pause.webp');
|
||||
$(".paused img").css({ "opacity": 1});
|
||||
$("#pause.paused figcaption").text("Communauté endormie...");
|
||||
});*/
|
||||
|
||||
// Hooks.on('renderChatLog', (log, html, data) => TotemFight.chatListeners(html));
|
||||
// Hooks.on('renderChatMessage', (message, html, data) => TotemFight.chatMessageHandler(message, html, data));
|
||||
// Hooks.on('renderChatLog', (log, html, data) => VermineFight.chatListeners(html));
|
||||
// Hooks.on('renderChatMessage', (message, html, data) => VermineFight.chatMessageHandler(message, html, data));
|
||||
|
||||
/**
|
||||
* Create a macro when dropping an entity on the hotbar
|
||||
@@ -35,11 +35,11 @@ export const registerHooks = function () {
|
||||
Hooks.on('getSceneControlButtons', (controls) => {
|
||||
/*controls.find((c) => c.name === 'token').tools.push({
|
||||
name: 'Dice Roller',
|
||||
title: game.i18n.localize("TOTEM.RollTool"),
|
||||
title: game.i18n.localize("VERMINE.RollTool"),
|
||||
icon: 'fas fa-dice-d6',
|
||||
button: true,
|
||||
onClick() {
|
||||
TotemRoll.ui();
|
||||
VermineRoll.ui();
|
||||
}
|
||||
});*/
|
||||
});
|
||||
@@ -51,15 +51,15 @@ export const registerHooks = function () {
|
||||
Hooks.on("preCreateActor", function (actor) {
|
||||
// console.log('pre create actor', actor);
|
||||
if (actor.img == "icons/svg/mystery-man.svg") {
|
||||
// actor.updateSource({"img": `systems/totem/icons/actors/${actor.type}.webp`});
|
||||
// item.updateSource({"img": `systems/totem/icons/competence.webp`});
|
||||
// actor.updateSource({"img": `systems/vermine2047/icons/actors/${actor.type}.webp`});
|
||||
// item.updateSource({"img": `systems/vermine2047/icons/competence.webp`});
|
||||
}
|
||||
});
|
||||
|
||||
Hooks.on("preCreateItem", function (item) {
|
||||
if (item.img == "icons/svg/item-bag.svg") {
|
||||
item.updateSource({"img": `systems/totem/icons/items/${item.type}.webp`});
|
||||
// item.updateSource({"img": `systems/totem/icons/competence.webp`});
|
||||
item.updateSource({"img": `systems/vermine2047/icons/items/${item.type}.webp`});
|
||||
// item.updateSource({"img": `systems/vermine2047/icons/competence.webp`});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -98,7 +98,7 @@ export const registerHooks = function () {
|
||||
},
|
||||
shouldDisplayToChat: false,
|
||||
iconClass: "fa-dice-d6",
|
||||
description: "Roll Totem check"
|
||||
description: "Roll Vermine 2047 check"
|
||||
}));
|
||||
});*/
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export class TotemRoll {
|
||||
export class VermineRoll {
|
||||
|
||||
static roll(actorId, label, NoD, Reroll = 0, params = {}){
|
||||
const actor = game.actors.get(actorId);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
export const registerSettings = function () {
|
||||
game.settings.register("totem", "game-mode", {
|
||||
name: game.i18n.localize("TOTEM.WorldSettings.GameMode.Name"),
|
||||
hint: game.i18n.localize("TOTEM.WorldSettings.GameMode.Hint"),
|
||||
game.settings.register("vermine2047", "game-mode", {
|
||||
name: game.i18n.localize("VERMINE.WorldSettings.GameMode.Name"),
|
||||
hint: game.i18n.localize("VERMINE.WorldSettings.GameMode.Hint"),
|
||||
scope: "system",
|
||||
config: true,
|
||||
type: String,
|
||||
|
||||
Reference in New Issue
Block a user