Initial import
This commit is contained in:
parent
522cad2ff8
commit
b3f0af8c12
Binary file not shown.
Before Width: | Height: | Size: 105 KiB |
@ -41,6 +41,8 @@ export class PegasusActorSheet extends ActorSheet {
|
||||
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
|
||||
limited: this.object.limited,
|
||||
specs: this.actor.getSpecs( ),
|
||||
optionsDiceList: PegasusUtility.getOptionsDiceList(),
|
||||
optionsLevel: PegasusUtility.getOptionsLevel(),
|
||||
weapons: this.actor.checkAndPrepareWeapons( duplicate(this.actor.getWeapons()) ),
|
||||
armors: duplicate(this.actor.getArmors()),
|
||||
shields: duplicate(this.actor.getShields()),
|
||||
@ -102,10 +104,14 @@ export class PegasusActorSheet extends ActorSheet {
|
||||
this.actor.incrementeQuantite( li.data("item-id") );
|
||||
} );
|
||||
|
||||
html.find('.skill-roll').click((event) => {
|
||||
html.find('.roll-stat').click((event) => {
|
||||
const statId = $(event.currentTarget).data("stat-key");
|
||||
this.actor.rollStat(statId);
|
||||
});
|
||||
html.find('.roll-spec').click((event) => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
const skillId = li.data("item-id");
|
||||
this.actor.rollSkill(skillId);
|
||||
const specId = li.data("item-id");
|
||||
this.actor.rollSpec(specId);
|
||||
});
|
||||
html.find('.technique-roll').click((event) => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
|
@ -126,13 +126,16 @@ export class PegasusActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getWeapons() {
|
||||
let comp = this.data.items.filter( item => item.type == 'weapon' );
|
||||
let comp = duplicate(this.data.items.filter( item => item.type == 'weapon' ) || []);
|
||||
return comp;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getSpecs() {
|
||||
let comp = this.data.items.filter( item => item.type == 'specialisation');
|
||||
let comp = duplicate(this.data.items.filter( item => item.type == 'specialisation') || []);
|
||||
for (let c of comp) {
|
||||
c.data.dice = PegasusUtility.getDiceFromLevel(c.data.level);
|
||||
}
|
||||
return comp;
|
||||
}
|
||||
|
||||
@ -350,44 +353,89 @@ export class PegasusActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
syncRoll( rollData ) {
|
||||
let linkedRollId = WotGUtility.getDefenseState(this.id);
|
||||
let linkedRollId = PegasusUtility.getDefenseState(this.id);
|
||||
if ( linkedRollId) {
|
||||
rollData.linkedRollId = linkedRollId;
|
||||
}
|
||||
rollData.rollId = randomID(16);
|
||||
this.lastRollId = rollData.rollId;
|
||||
WotGUtility.saveRollData( rollData );
|
||||
PegasusUtility.saveRollData( rollData );
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollSkill( skillId ) {
|
||||
let skill = this.data.items.find( item => item.type == 'skill' && item.id == skillId);
|
||||
if (skill) {
|
||||
getStat( statKey) {
|
||||
let stat = duplicate(this.data.data.statistics[statKey]);
|
||||
stat.dice = PegasusUtility.getDiceFromLevel(stat.value);
|
||||
return stat;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getOneSpec( specId) {
|
||||
let spec = this.data.items.find( item => item.type == 'specialisation' && item.id == specId);
|
||||
if (spec) {
|
||||
spec = duplicate(spec);
|
||||
spec.data.dice = PegasusUtility.getDiceFromLevel(spec.data.level);
|
||||
}
|
||||
return spec;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollStat(statKey) {
|
||||
let stat = this.getStat(statKey) ;
|
||||
if (stat) {
|
||||
let rollData = {
|
||||
mode: "skill",
|
||||
rollId:randomID(16),
|
||||
mode: "stat",
|
||||
alias: this.name,
|
||||
actorImg: this.img,
|
||||
actorId: this.id,
|
||||
img: skill.img,
|
||||
img: this.img,
|
||||
rollMode: game.settings.get("core", "rollMode"),
|
||||
armorModifier: this.getArmorModifier(),
|
||||
title: `Skill ${skill.name} `,
|
||||
skill: duplicate(skill),
|
||||
skillAttr: this.getAttribute( skill.data.data.attribute ),
|
||||
optionsNegative: WotGUtility.getNegativeModifiers(),
|
||||
optionsPositive: WotGUtility.getPositiveModifiers(),
|
||||
negativeModifier: 0,
|
||||
positiveModifier: 0,
|
||||
specialtiesBonus: 0,
|
||||
title: `Stat ${stat.label} `,
|
||||
stat: stat,
|
||||
optionsDiceList: PegasusUtility.getOptionsDiceList(),
|
||||
bonusDicesLevel: 0,
|
||||
hindranceDicesLevel: 0,
|
||||
otherDicesLevel: 0,
|
||||
}
|
||||
|
||||
this.syncRoll( rollData);
|
||||
|
||||
let rollDialog = await WotGRollDialog.create( this, rollData);
|
||||
let rollDialog = await PegasusRollDialog.create( this, rollData);
|
||||
console.log(rollDialog);
|
||||
rollDialog.render( true );
|
||||
} else {
|
||||
ui.notifications.warn("Skill not found !");
|
||||
ui.notifications.warn("Statistic not found !");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollSpec( specId ) {
|
||||
let spec = this.getOneSpec( specId)
|
||||
if (spec) {
|
||||
let rollData = {
|
||||
mode: "spec",
|
||||
alias: this.name,
|
||||
actorImg: this.img,
|
||||
actorId: this.id,
|
||||
img: spec.img,
|
||||
rollMode: game.settings.get("core", "rollMode"),
|
||||
title: `Specialisation Roll : ${spec.name} `,
|
||||
spec : spec ,
|
||||
optionsDiceList: PegasusUtility.getOptionsDiceList(),
|
||||
stat: this.getStat( spec.data.statistic ),
|
||||
bonusDicesLevel: 0,
|
||||
hindranceDicesLevel: 0,
|
||||
otherDicesLevel: 0,
|
||||
}
|
||||
|
||||
this.syncRoll( rollData);
|
||||
|
||||
let rollDialog = await PegasusRollDialog.create( this, rollData);
|
||||
console.log(rollDialog);
|
||||
rollDialog.render( true );
|
||||
} else {
|
||||
ui.notifications.warn("Specialisation not found !");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -59,6 +59,7 @@ export class PegasusItemSheet extends ItemSheet {
|
||||
name: objectData.name,
|
||||
editable: this.isEditable,
|
||||
cssClass: this.isEditable ? "editable" : "locked",
|
||||
optionsDiceList: PegasusUtility.getOptionsDiceList(),
|
||||
data: itemData,
|
||||
limited: this.object.limited,
|
||||
options: this.options,
|
||||
|
@ -28,6 +28,16 @@ Hooks.once("init", async function () {
|
||||
// preload handlebars templates
|
||||
PegasusUtility.preloadHandlebarsTemplates();
|
||||
|
||||
/* -------------------------------------------- */
|
||||
game.settings.register("fvtt-pegasus-rpg", "dice-max-level", {
|
||||
name: "Maximum level value for dices lists",
|
||||
hint: "Se the maximum level value for dices lists",
|
||||
scope: "world",
|
||||
config: true,
|
||||
default: 20,
|
||||
type: Number
|
||||
});
|
||||
|
||||
/* -------------------------------------------- */
|
||||
// Set an initiative formula for the system
|
||||
CONFIG.Combat.initiative = {
|
||||
|
@ -7,12 +7,12 @@ export class PegasusRollDialog extends Dialog {
|
||||
|
||||
let html
|
||||
let options = { classes: ["WotGdialog"], width: 420, height: 320, 'z-index': 99999 };
|
||||
if ( rollData.mode == "skill") {
|
||||
html = await renderTemplate('systems/fvtt-pegasus-rpg/templates/roll-dialog-skill.html', rollData);
|
||||
if ( rollData.mode == "stat") {
|
||||
html = await renderTemplate('systems/fvtt-pegasus-rpg/templates/roll-dialog-stat.html', rollData);
|
||||
options.height = 320;
|
||||
} else if (rollData.mode == "spec") {
|
||||
html = await renderTemplate('systems/fvtt-pegasus-rpg/templates/roll-dialog-spec.html', rollData);
|
||||
options.height = 360;
|
||||
} else if (rollData.mode == "chidamage") {
|
||||
html = await renderTemplate('systems/fvtt-pegasus-rpg/templates/roll-dialog-damage-chi.html', rollData);
|
||||
options.height = 380;
|
||||
} else if (rollData.mode == "technique") {
|
||||
html = await renderTemplate('systems/fvtt-pegasus-rpg/templates/roll-dialog-technique.html', rollData);
|
||||
options.height = 380;
|
||||
@ -53,7 +53,7 @@ export class PegasusRollDialog extends Dialog {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
roll () {
|
||||
PegasusUtility.rollWotG( this.rollData )
|
||||
PegasusUtility.rollPegasus( this.rollData )
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -65,20 +65,14 @@ export class PegasusRollDialog extends Dialog {
|
||||
}
|
||||
$(function () { onLoad(); });
|
||||
|
||||
html.find('#negativeModifier').change((event) => {
|
||||
this.rollData.negativeModifier = Number(event.currentTarget.value);
|
||||
html.find('#bonusDicesLevel').change((event) => {
|
||||
this.rollData.bonusDicesLevel = Number(event.currentTarget.value);
|
||||
});
|
||||
html.find('#positiveModifier').change((event) => {
|
||||
this.rollData.positiveModifier = Number(event.currentTarget.value);
|
||||
html.find('#hindranceDicesLevel').change((event) => {
|
||||
this.rollData.hindranceDicesLevel = Number(event.currentTarget.value);
|
||||
});
|
||||
html.find('#specialtiesBonus').change((event) => {
|
||||
this.rollData.specialtiesBonus = Number(event.currentTarget.value);
|
||||
});
|
||||
html.find('#selectedChi').change((event) => {
|
||||
this.rollData.selectedChi = Number(event.currentTarget.value);
|
||||
});
|
||||
html.find('#bonusMalus').change((event) => {
|
||||
this.rollData.bonusMalus = Number(event.currentTarget.value);
|
||||
html.find('#otherDicesLevel').change((event) => {
|
||||
this.rollData.otherDicesLevel = Number(event.currentTarget.value);
|
||||
});
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
/* -------------------------------------------- */
|
||||
const __level2Dice = [ "d0", "d4", "d6", "d8", "d10", "d12" ];
|
||||
|
||||
/* -------------------------------------------- */
|
||||
export class PegasusUtility {
|
||||
@ -9,6 +10,10 @@ export class PegasusUtility {
|
||||
Hooks.on('renderChatLog', (log, html, data) => PegasusUtility.chatListeners(html));
|
||||
this.rollDataStore = {}
|
||||
this.defenderStore = {}
|
||||
this.diceList = [];
|
||||
this.diceFoundryList = [];
|
||||
this.optionsDiceList = "";
|
||||
this.buildDiceLists();
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
static getSpecs( ) {
|
||||
@ -21,6 +26,47 @@ export class PegasusUtility {
|
||||
this.specs = specs.map(i => i.toObject());
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static buildDiceLists() {
|
||||
let maxLevel = game.settings.get("fvtt-pegasus-rpg", "dice-max-level");
|
||||
let diceList = [ "0" ];
|
||||
let diceFoundryList = [ "d0" ];
|
||||
let diceLevel = 1;
|
||||
let concat = "";
|
||||
let concatFoundry = "";
|
||||
let optionsDiceList = '<option value="0">0</option>';
|
||||
let optionsLevel = '<option value="0">0</option>';
|
||||
for(let i=1; i<=maxLevel;i++) {
|
||||
let currentDices = concat + __level2Dice[diceLevel];
|
||||
diceList.push( currentDices );
|
||||
diceFoundryList.push( concatFoundry + __level2Dice[diceLevel] + "x" );
|
||||
if ( __level2Dice[diceLevel] == "d12") {
|
||||
concat = concat + "d12 ";
|
||||
concatFoundry = concatFoundry + "d12x, ";
|
||||
diceLevel = 1;
|
||||
} else {
|
||||
diceLevel++;
|
||||
}
|
||||
optionsDiceList += `<option value="${i}">${currentDices}</option>`;
|
||||
optionsLevel += `<option value="${i}">${i}</option>`;
|
||||
}
|
||||
this.diceList = diceList;
|
||||
this.diceFoundryList = diceFoundryList;
|
||||
this.optionsDiceList = optionsDiceList;
|
||||
this.optionsLevel = optionsLevel;
|
||||
|
||||
console.log("Defautl dice List", diceList, diceFoundryList);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static getOptionsDiceList() {
|
||||
return this.optionsDiceList;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
static getOptionsLevel() {
|
||||
return this.optionsLevel;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static computeAttackDefense(defenseRollId) {
|
||||
let defenseRollData = this.getRollData(defenseRollId );
|
||||
@ -43,14 +89,6 @@ export class PegasusUtility {
|
||||
defender.processNoDefense( attackRollData ) ;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static reduceDamageWithChi( defenseRollId) {
|
||||
let defenseRollData = this.getRollData(defenseRollId );
|
||||
let attackRollData = this.getRollData(defenseRollData.linkedRollId);
|
||||
let defender = game.actors.get( defenseRollData.actorId);
|
||||
defender.reduceDamageWithChi(defenseRollData, attackRollData);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async chatListeners(html) {
|
||||
|
||||
@ -103,26 +141,17 @@ export class PegasusUtility {
|
||||
}
|
||||
return it;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static getChiList() {
|
||||
let chi = [];
|
||||
chi.push( { name: "Jade" });
|
||||
chi.push( { name: "Crimson" });
|
||||
chi.push( { name: "Gold" });
|
||||
chi.push( { name: "White" });
|
||||
chi.push( { name: "Silver" });
|
||||
return chi;
|
||||
static getDiceFromLevel(level = 0) {
|
||||
level = Number(level)
|
||||
return this.diceList[level];
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
static getskillChiList( ) {
|
||||
let skillsName = [];
|
||||
let skills = this.getSkills();
|
||||
console.log("SKILLS", skills);
|
||||
for (let skill of skills) {
|
||||
skillsName.push( { name: skill.name });
|
||||
}
|
||||
skillsName = skillsName.concat( this.getChiList() );
|
||||
return skillsName;
|
||||
static getFoundryDiceFromLevel(level = 0) {
|
||||
level = Number(level)
|
||||
console.log(this.diceFoundryList);
|
||||
return this.diceFoundryList[level];
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -142,29 +171,6 @@ export class PegasusUtility {
|
||||
}
|
||||
return options;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
static getNegativeModifiers(min, max) {
|
||||
let options = ""
|
||||
options += `<option value="0">0</option>`
|
||||
options += `<option value="-5">-5</option>`
|
||||
options += `<option value="-10">-10</option>`
|
||||
return options;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
static getPositiveModifiers(min, max) {
|
||||
let options = ""
|
||||
options += `<option value="0">0</option>`
|
||||
options += `<option value="5">+5</option>`
|
||||
options += `<option value="10">+10</option>`
|
||||
options += `<option value="15">+15</option>`
|
||||
options += `<option value="20">+20</option>`
|
||||
options += `<option value="30">+30</option>`
|
||||
options += `<option value="40">+40</option>`
|
||||
options += `<option value="50">+60</option>`
|
||||
options += `<option value="60">+50</option>`
|
||||
options += `<option value="70">+70</option>`
|
||||
return options;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static getTarget() {
|
||||
@ -300,93 +306,50 @@ export class PegasusUtility {
|
||||
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async rollWotG( rollData ) {
|
||||
static async rollPegasus( rollData ) {
|
||||
|
||||
if (rollData.mode == "chidamage" ) {
|
||||
let defender = game.actors.get( rollData.actorId);
|
||||
defender.rollChiDamage(rollData);
|
||||
return;
|
||||
let dicePool = [ {name:"stat", level: 0, statmod: 0}, {name: "spec", level: 0}, {name:"bonus", level: 0}, {name:"hindrance", level: 0}, {name:"other", level:0} ];
|
||||
if (rollData.stat) {
|
||||
dicePool[0].level += Number(rollData.stat.value);
|
||||
dicePool[0].statmod = Number(rollData.stat.mod);
|
||||
}
|
||||
if (rollData.spec) {
|
||||
dicePool[1].level += Number(rollData.spec.data.level);
|
||||
}
|
||||
if (rollData.bonusDicesLevel) {
|
||||
dicePool[2].level += Number(rollData.bonusDicesLevel);
|
||||
}
|
||||
if (rollData.hindranceDicesLevel) {
|
||||
dicePool[3].level += Number(rollData.hindranceDicesLevel);
|
||||
}
|
||||
if (rollData.otherDicesLevel) {
|
||||
dicePool[4].level += Number(rollData.otherDicesLevel);
|
||||
}
|
||||
|
||||
let nbDice = 0;
|
||||
if ( rollData.mode == 'skill' || rollData.mode == 'technique') {
|
||||
nbDice = rollData.skill?.data.level || 0;
|
||||
let diceFormulaTab = [];
|
||||
for (let diceGroup of dicePool) {
|
||||
diceFormulaTab.push( this.getFoundryDiceFromLevel( diceGroup.level) )
|
||||
}
|
||||
if ( rollData.mode == 'weapon' ) {
|
||||
rollData.skill = rollData.weapon.data.skills[rollData.skillKey];
|
||||
rollData.skillAttr = rollData.weapon.data.skills[rollData.skillKey].data.attr;
|
||||
nbDice = rollData.skill?.data.level || 0;
|
||||
}
|
||||
if ( rollData.mode == 'technique') {
|
||||
// Compute number of dice
|
||||
if (rollData.attr ) {
|
||||
rollData.skillAttr = rollData.attr;
|
||||
}
|
||||
if (rollData.chi ) {
|
||||
rollData.skillAttr = rollData.chi;
|
||||
nbDice = rollData.skillAttr.value || 0;
|
||||
}
|
||||
}
|
||||
if ( rollData.skill && rollData.skillAttr.value >= rollData.skill.data.level) {
|
||||
nbDice++;
|
||||
}
|
||||
if ( nbDice == 0) nbDice = 1;
|
||||
nbDice += rollData.specialtiesBonus;
|
||||
|
||||
// Build dice formula
|
||||
let diceTab = [];
|
||||
for(let i=0; i<nbDice; i++) {
|
||||
diceTab[i] = "1d10";
|
||||
}
|
||||
let formula = "{"+ diceTab.join(',') + '}';
|
||||
let diceFormula = '{' + diceFormulaTab.join(', ') + '}kh';
|
||||
console.log(diceFormula);
|
||||
|
||||
// Performs roll
|
||||
let myRoll = rollData.roll;
|
||||
if ( !myRoll ) { // New rolls only of no rerolls
|
||||
myRoll = new Roll(formula).roll( { async: false} );
|
||||
console.log("ROLL : ", formula);
|
||||
myRoll = new Roll(diceFormula).roll( { async: false} );
|
||||
console.log("ROLL : ", diceFormula);
|
||||
await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode") );
|
||||
rollData.roll = myRoll
|
||||
}
|
||||
|
||||
// Build the list of dices per number of occurence
|
||||
let sortedRoll = [];
|
||||
let bestScore = 0;
|
||||
let diceResults = [];
|
||||
for (let i=0; i<10; i++) {
|
||||
sortedRoll[i] = 0;
|
||||
}
|
||||
for (let i=0; i<nbDice; i++) {
|
||||
let dice1 = duplicate(myRoll.dice[i]);
|
||||
if (dice1.results[0].result == 10) dice1.results[0].result = 0;
|
||||
dice1.results[0].diceIndex = i;
|
||||
diceResults.push( dice1.results[0] );
|
||||
let nbFound = 1;
|
||||
for (let j=0; j<nbDice; j++) {
|
||||
if (j!=i) {
|
||||
let dice2 = myRoll.dice[j];
|
||||
if (dice2.results[0].result == 10) dice2.results[0].result = 0;
|
||||
if (dice1.results[0].result == dice2.results[0].result) {
|
||||
nbFound++;
|
||||
}
|
||||
}
|
||||
}
|
||||
let score = (nbFound * 10) + dice1.results[0].result;
|
||||
if (score > bestScore) bestScore = score;
|
||||
sortedRoll[dice1.results[0].result] = nbFound;
|
||||
}
|
||||
|
||||
// Final score and keep data
|
||||
rollData.nbDice = nbDice;
|
||||
rollData.bestScore = bestScore;
|
||||
rollData.diceResults = diceResults;
|
||||
rollData.finalScore = bestScore + rollData.negativeModifier + rollData.positiveModifier;
|
||||
rollData.finalScore = myRoll.total + dicePool[0].statmod;
|
||||
console.log("ROLLLL!!!!", rollData);
|
||||
|
||||
let actor = game.actors.get(rollData.actorId);
|
||||
|
||||
this.createChatWithRollMode( rollData.alias, {
|
||||
content: await renderTemplate(`systems/fvtt-weapons-of-the-gods/templates/chat-generic-result.html`, rollData)
|
||||
content: await renderTemplate(`systems/fvtt-pegasus-rpg/templates/chat-generic-result.html`, rollData)
|
||||
});
|
||||
|
||||
if ( rollData.defender ) {
|
||||
@ -401,34 +364,6 @@ export class PegasusUtility {
|
||||
return Math.floor(result/5) + 1;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static removeDice( rollData, diceIndex) {
|
||||
|
||||
let diceResults = rollData.diceResults;
|
||||
diceResults.splice( diceIndex, 1);
|
||||
rollData.diceResults = diceResults;
|
||||
|
||||
rollData.nbDice = diceResults.length;
|
||||
|
||||
this.updateRoll(rollData);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static addDice(rollId, diceValue) {
|
||||
|
||||
let rollData = this.getRollData( rollId );
|
||||
|
||||
let diceResults = rollData.diceResults;
|
||||
let newResult = duplicate(diceResults[0]);
|
||||
newResult.result = diceValue;
|
||||
diceResults.push( newResult);
|
||||
rollData.diceResults = diceResults;
|
||||
|
||||
rollData.nbDice = diceResults.length;
|
||||
|
||||
this.updateRoll(rollData);
|
||||
}
|
||||
|
||||
/* ------------------------- ------------------- */
|
||||
static async updateRoll( rollData) {
|
||||
|
||||
@ -550,18 +485,6 @@ export class PegasusUtility {
|
||||
this.createChatMessage(name, game.settings.get("core", "rollMode"), chatOptions);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static buildDifficultyOptions( ) {
|
||||
let options = ""
|
||||
options += `<option value="0">None</option>`
|
||||
options += `<option value="8">Easy</option>`
|
||||
options += `<option value="12">Moderate</option>`
|
||||
options += `<option value="16">Difficult</option>`
|
||||
options += `<option value="18">Very Difficult</option>`
|
||||
return options;
|
||||
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async confirmDelete(actorSheet, li) {
|
||||
let itemId = li.data("item-id");
|
||||
|
@ -1153,7 +1153,7 @@ ul, li {
|
||||
color: #CCC
|
||||
}
|
||||
#pause > img {
|
||||
content: url(../images/ui/wotg_logo_01.webp);
|
||||
content: url(../images/ui/pegasus_logo_v1.webp);
|
||||
height: 160px;
|
||||
width: 256px;
|
||||
top: -80px;
|
||||
@ -1161,7 +1161,7 @@ ul, li {
|
||||
}
|
||||
|
||||
#logo {
|
||||
content : url(../images/ui/wotg_logo_01.webp);
|
||||
content : url(../images/ui/pegasus_logo_v1.webp);
|
||||
width: 110px;
|
||||
height: 70px;
|
||||
}
|
||||
|
@ -142,10 +142,13 @@
|
||||
},
|
||||
"specialisation": {
|
||||
"statistic": "",
|
||||
"level": 0,
|
||||
"level": 1,
|
||||
"description": ""
|
||||
},
|
||||
"perk": {
|
||||
"level": 1,
|
||||
"active": false,
|
||||
"roundcount": 0,
|
||||
"description": "",
|
||||
"upgrades": "",
|
||||
"rules": ""
|
||||
|
@ -36,10 +36,10 @@
|
||||
<ul>
|
||||
{{#each data.statistics as |stat key|}}
|
||||
<li class="item flexrow list-item" data-attr-key="{{key}}">
|
||||
<span class="stat-label flexrow" name="{{key}}"><h4><a class="roll-stat" data-stat-id="{{key}}"">{{stat.label}}</a></h4></span>
|
||||
<span class="stat-label flexrow" name="{{key}}"><h4><a class="roll-stat" data-stat-key="{{key}}"">{{stat.label}}</a></h4></span>
|
||||
<select class="carac-base flexrow" type="text" name="data.statistics.{{key}}.value" value="{{stat.value}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
|
||||
{{#select stat.value}}
|
||||
{{> systems/fvtt-pegasus-rpg/templates/partial-options-level.html}}
|
||||
{{{@root.optionsDiceList}}}
|
||||
{{/select}}
|
||||
</select>
|
||||
<input type="text" class="input-numeric-short padd-right" name="stat.mod" value="{{stat.mod}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}/>
|
||||
@ -55,7 +55,7 @@
|
||||
<span class="stat-label flexrow" name="{{key}}"><h4>{{stat2.label}}</h4></span>
|
||||
<select class="carac-base flexrow" type="text" name="data.secondary.{{key}}.value" value="{{stat2.value}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
|
||||
{{#select stat2.value}}
|
||||
{{> systems/fvtt-pegasus-rpg/templates/partial-options-level.html}}
|
||||
{{{@root.optionsLevel}}}
|
||||
{{/select}}
|
||||
</select>
|
||||
</li>
|
||||
@ -77,7 +77,9 @@
|
||||
{{#each specs as |spec key|}}
|
||||
<li class="item stat flexrow list-item" data-item-id="{{spec._id}}">
|
||||
<img class="sheet-competence-img" src="{{spec.img}}"/>
|
||||
<span class="stat-label">{{spec.name}}</span>
|
||||
<span class="stat-label"><a class="roll-spec">{{spec.name}}</a></span>
|
||||
<span class="stat-label">{{spec.data.statistic}}</span>
|
||||
<span class="stat-label">{{spec.data.dice}}</span>
|
||||
<div class="item-controls">
|
||||
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||
@ -93,14 +95,6 @@
|
||||
<div class="tab fight" data-group="primary" data-tab="fight">
|
||||
<div class="flexcol">
|
||||
|
||||
<ul class="stat-list alternate-list">
|
||||
<li class="item stat flexrow list-item">
|
||||
<span class="generic-label"><h3>Health</h3></span>
|
||||
<input type="text" class="" name="data.secondary.health.value" value="{{data.secondary.health.value}}" data-dtype="Number"/>
|
||||
/ {{data.secondary.health.max}}
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<span class="generic-label"><h3>Weapons</h3></span>
|
||||
<ul class="stat-list alternate-list">
|
||||
{{#each weapons as |weapon key|}}
|
||||
|
@ -8,11 +8,11 @@
|
||||
<div >
|
||||
<img class="chat-icon" src="{{img}}" alt="{{name}}" />
|
||||
<h4>
|
||||
{{#if (eq mode "skill")}}
|
||||
Skill : {{skill.name}}
|
||||
{{#if (eq mode "stat")}}
|
||||
Statistic : {{stat.label}}
|
||||
{{else}}
|
||||
{{#if (eq mode "technique")}}
|
||||
Technique : {{technique.name}}
|
||||
{{#if (eq mode "spec")}}
|
||||
Technique : {{spec.name}}
|
||||
{{else}}
|
||||
{{#if (eq mode "weapon")}}
|
||||
Weapon attack : {{weapon.name}}
|
||||
@ -23,33 +23,14 @@
|
||||
</div>
|
||||
|
||||
<div class="flexcol">
|
||||
<div class="dice-total">
|
||||
{{#each diceResults as |diceResult key|}}
|
||||
<div class="dice">
|
||||
{{#if (gt @root.nbDice 2)}}
|
||||
<a class="dice-to-river" data-actor-id="{{@root.actorId}}" data-roll-id="{{@root.rollId}}" data-dice-index="{{key}}" data-dice-value="{{diceResult.result}}">
|
||||
{{/if}}
|
||||
<label>{{diceResult.result}}</label>
|
||||
<img src="systems/fvtt-weapons-of-the-gods/images/dice/d10black.svg" />
|
||||
{{#if (gt @root.nbDice 2)}}
|
||||
</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<ul>
|
||||
{{#if (eq mode "technique")}}
|
||||
<li>{{technique.data.chicolor}} Chi cost : {{technique.data.chicost}} </li>
|
||||
<li><button class="chat-card-button apply-technique-cost" data-actor-id="{{actorId}}" data-roll-id="{{@root.rollId}}" data-technique-id="{{technique._id}}">Apply Chi cost</button></li>
|
||||
<li>Effect description : {{technique.data.effectdescription}}</li>
|
||||
{{/if}}
|
||||
{{#if (eq mode "weapon")}}
|
||||
<li>Effect description : {{weapon.data.effectdescription}}</li>
|
||||
{{/if}}
|
||||
<li>Modifiers : {{negativeModifier}} / {{positiveModifier}} </li>
|
||||
<li><strong>Total Roll : {{finalScore}}</strong>
|
||||
<li><strong>Final Result : {{finalScore}}</strong>
|
||||
|
||||
{{#if linkedRollId}}
|
||||
<li><button class="chat-card-button apply-defense-roll" data-roll-score="{{finalScore}}" data-roll-id="{{@root.rollId}}" data-actor-id="{{actorId}}" data-defender-id="{{defenseAttackerId}}">Use this Roll as defense</button></li>
|
||||
|
@ -21,7 +21,7 @@
|
||||
<li class="flexrow"><label class="generic-label">Level</label>
|
||||
<select class="competence-base flexrow" type="text" name="data.level" value="{{data.level}}" data-dtype="Number">
|
||||
{{#select data.level}}
|
||||
{{> systems/fvtt-pegasus-rpg/templates/partial-options-level.html}}
|
||||
{{{optionsDiceList}}}
|
||||
{{/select}}
|
||||
</select>
|
||||
</li>
|
||||
|
@ -1,3 +1,4 @@
|
||||
<option value="0">0</option>
|
||||
<option value="1">d4</option>
|
||||
<option value="2">d6</option>
|
||||
<option value="3">d8</option>
|
||||
|
@ -1,46 +0,0 @@
|
||||
<form class="skill-roll-dialog">
|
||||
<header class="roll-dialog-header">
|
||||
<img class="actor-icon" src="{{img}}" data-edit="img" title="{{name}}" />
|
||||
<h1 class="dialog-roll-title roll-dialog-header">{{title}}</h1>
|
||||
</header>
|
||||
|
||||
<div class="floxrow">
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label" >{{skillAttr.label}} : {{skillAttr.value}}</span>
|
||||
<span class="roll-dialog-label" >Skill Level : {{skill.data.level}}</span>
|
||||
</div>
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label" >Specialties reminder : </span>
|
||||
<span class="roll-dialog-label" >{{skill.data.specialties}}</span>
|
||||
</div>
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label" >Specialties Dices Bonus : </span>
|
||||
<select class="competence-base" id="specialtiesBonus" type="text" name="specialtiesBonus" value="{{specialtiesBonus}}" data-dtype="Number">
|
||||
{{#select specialtiesBonus}}
|
||||
<option value="0">0</option>
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
{{/select}}
|
||||
</select>
|
||||
</div>
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label" >Negative Modifier :</span>
|
||||
<select class="roll-dialog-label" id="negativeModifier" type="text" name="negativeModifier" value="{{negativeModifier}}" data-dtype="Number">
|
||||
{{#select negativeModifier}}
|
||||
{{{optionsNegative}}}
|
||||
{{/select}}
|
||||
</select>
|
||||
</div>
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label" >Positive Modifier :</span>
|
||||
<select class="roll-dialog-label" id="positiveModifier" type="text" name="positiveModifier" value="{{positiveModifier}}" data-dtype="Number">
|
||||
{{#select positiveModifier}}
|
||||
{{{optionsPositive}}}
|
||||
{{/select}}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
Loading…
Reference in New Issue
Block a user