v0.5 fixes
This commit is contained in:
parent
bf52b61a0d
commit
2ab1cbe24c
@ -57,6 +57,8 @@ export class PegasusActorSheet extends ActorSheet {
|
|||||||
role: duplicate(this.actor.getRole()),
|
role: duplicate(this.actor.getRole()),
|
||||||
effects: duplicate(this.actor.getEffects()),
|
effects: duplicate(this.actor.getEffects()),
|
||||||
moneys: duplicate(this.actor.getMoneys()),
|
moneys: duplicate(this.actor.getMoneys()),
|
||||||
|
virtues: duplicate(this.actor.getVirtues()),
|
||||||
|
vices: duplicate(this.actor.getVices()),
|
||||||
encCapacity: this.actor.getEncumbranceCapacity(),
|
encCapacity: this.actor.getEncumbranceCapacity(),
|
||||||
levelRemainingList: this.actor.getLevelRemainingList(),
|
levelRemainingList: this.actor.getLevelRemainingList(),
|
||||||
containersTree: this.actor.containersTree,
|
containersTree: this.actor.containersTree,
|
||||||
@ -321,7 +323,12 @@ export class PegasusActorSheet extends ActorSheet {
|
|||||||
this.actor.activatePower( li.data("item-id") );
|
this.actor.activatePower( li.data("item-id") );
|
||||||
this.render(true);
|
this.render(true);
|
||||||
});
|
});
|
||||||
|
html.find('.vice-virtue-activate').click(ev => {
|
||||||
|
const li = $(ev.currentTarget).parents(".item")
|
||||||
|
this.actor.activateViceOrVirtue( li.data("item-id") )
|
||||||
|
this.render(true);
|
||||||
|
})
|
||||||
|
|
||||||
html.find('.change-worstfear').change(ev => {
|
html.find('.change-worstfear').change(ev => {
|
||||||
this.actor.manageWorstFear( ev.currentTarget.checked )
|
this.actor.manageWorstFear( ev.currentTarget.checked )
|
||||||
});
|
});
|
||||||
|
@ -110,6 +110,16 @@ export class PegasusActor extends Actor {
|
|||||||
return comp;
|
return comp;
|
||||||
}
|
}
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
getVirtues() {
|
||||||
|
let comp = this.data.items.filter(item => item.type == 'virtue');
|
||||||
|
return comp;
|
||||||
|
}
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
getVices() {
|
||||||
|
let comp = this.data.items.filter(item => item.type == 'vice');
|
||||||
|
return comp;
|
||||||
|
}
|
||||||
|
/* -------------------------------------------- */
|
||||||
getArmors() {
|
getArmors() {
|
||||||
let comp = duplicate(this.data.items.filter(item => item.type == 'armor') || []);
|
let comp = duplicate(this.data.items.filter(item => item.type == 'armor') || []);
|
||||||
return comp;
|
return comp;
|
||||||
@ -222,6 +232,37 @@ export class PegasusActor extends Actor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
async activateViceOrVirtue(itemId) {
|
||||||
|
let item = this.data.items.find(item => item.id == itemId)
|
||||||
|
if (item && item.data.data) {
|
||||||
|
let nrg = duplicate(this.data.data.nrg)
|
||||||
|
if (!item.data.data.activated) { // Current value
|
||||||
|
|
||||||
|
let effects = []
|
||||||
|
for (let effect of item.data.data.effectsgained) {
|
||||||
|
effect.data.powerId = itemId // Link to the perk, in order to dynamically remove them
|
||||||
|
effects.push(effect)
|
||||||
|
}
|
||||||
|
if (effects.length) {
|
||||||
|
await this.createEmbeddedDocuments('Item', effects)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
let toRem = []
|
||||||
|
for (let item of this.data.items) {
|
||||||
|
if (item.type == 'effect' && item.data.data.powerId == itemId) {
|
||||||
|
toRem.push(item.id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (toRem.length) {
|
||||||
|
await this.deleteEmbeddedDocuments('Item', toRem)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let update = { _id: item.id, "data.activated": !item.data.data.activated }
|
||||||
|
await this.updateEmbeddedDocuments('Item', [update]) // Updates one EmbeddedEntity
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async activatePower(itemId) {
|
async activatePower(itemId) {
|
||||||
let item = this.data.items.find(item => item.id == itemId)
|
let item = this.data.items.find(item => item.id == itemId)
|
||||||
@ -444,6 +485,9 @@ export class PegasusActor extends Actor {
|
|||||||
chatData.content = `<div>${this.name} has used a Momentum</div`
|
chatData.content = `<div>${this.name} has used a Momentum</div`
|
||||||
}
|
}
|
||||||
ChatMessage.create(chatData)
|
ChatMessage.create(chatData)
|
||||||
|
if (incDec < 0) {
|
||||||
|
PegasusUtility.showMomentumDialog(this.id)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
ui.notifications.warn("Momentum cannot go below 0")
|
ui.notifications.warn("Momentum cannot go below 0")
|
||||||
}
|
}
|
||||||
@ -862,10 +906,10 @@ export class PegasusActor extends Actor {
|
|||||||
return this.data.data.biodata.currentlevelremaining
|
return this.data.data.biodata.currentlevelremaining
|
||||||
}
|
}
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
modifyHeroLevelRemaining( incDec) {
|
modifyHeroLevelRemaining(incDec) {
|
||||||
let biodata = duplicate(this.data.data.biodata)
|
let biodata = duplicate(this.data.data.biodata)
|
||||||
biodata.currentlevelremaining = Math.max(biodata.currentlevelremaining+incDec, 0)
|
biodata.currentlevelremaining = Math.max(biodata.currentlevelremaining + incDec, 0)
|
||||||
this.update( {"data.biodata": biodata} )
|
this.update({ "data.biodata": biodata })
|
||||||
return biodata.currentlevelremaining
|
return biodata.currentlevelremaining
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1236,7 +1280,7 @@ export class PegasusActor extends Actor {
|
|||||||
}
|
}
|
||||||
let diceKey = PegasusUtility.getDiceFromLevel(rollData.stat.value)
|
let diceKey = PegasusUtility.getDiceFromLevel(rollData.stat.value)
|
||||||
rollData.dicePool.push({
|
rollData.dicePool.push({
|
||||||
name: "stat", key: diceKey, mod: rollData.stat.mod,
|
name: "stat", key: diceKey, level: rollData.stat.value, mod: rollData.stat.mod,
|
||||||
img: `systems/fvtt-pegasus-rpg/images/dice/${diceKey}.webp`
|
img: `systems/fvtt-pegasus-rpg/images/dice/${diceKey}.webp`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -1245,15 +1289,16 @@ export class PegasusActor extends Actor {
|
|||||||
this.addArmorsShields(rollData, statKey, useShield)
|
this.addArmorsShields(rollData, statKey, useShield)
|
||||||
this.addWeapons(rollData, statKey, useShield)
|
this.addWeapons(rollData, statKey, useShield)
|
||||||
this.addEquipments(rollData, statKey)
|
this.addEquipments(rollData, statKey)
|
||||||
|
console.log("ROLLDATA", rollData)
|
||||||
|
|
||||||
return rollData
|
return rollData
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getLevelRemainingList( ) {
|
getLevelRemainingList() {
|
||||||
let options = []
|
let options = []
|
||||||
for (let i=0; i<=this.data.data.biodata.maxlevelremaining; i++) {
|
for (let i = 0; i <= this.data.data.biodata.maxlevelremaining; i++) {
|
||||||
options.push( `<option value="${i}">${i}</option>`)
|
options.push(`<option value="${i}">${i}</option>`)
|
||||||
}
|
}
|
||||||
return options.join("\n")
|
return options.join("\n")
|
||||||
}
|
}
|
||||||
@ -1262,10 +1307,9 @@ export class PegasusActor extends Actor {
|
|||||||
async startRoll(rollData) {
|
async startRoll(rollData) {
|
||||||
this.syncRoll(rollData);
|
this.syncRoll(rollData);
|
||||||
//console.log("ROLL DATA", rollData)
|
//console.log("ROLL DATA", rollData)
|
||||||
let rollDialog = await PegasusRollDialog.create(this, rollData);
|
let rollDialog = await PegasusRollDialog.create(this, rollData)
|
||||||
console.log(rollDialog);
|
console.log(rollDialog)
|
||||||
rollDialog.render(true);
|
rollDialog.render(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
@ -48,7 +48,7 @@ export class PegasusRollDialog extends Dialog {
|
|||||||
if (effect) {
|
if (effect) {
|
||||||
effect.applied = toggled
|
effect.applied = toggled
|
||||||
|
|
||||||
let level, genre, idVal
|
let level, genre, idVal, key
|
||||||
if (effect.type == 'hindrance') {
|
if (effect.type == 'hindrance') {
|
||||||
level = effect.value
|
level = effect.value
|
||||||
genre = 'positive'
|
genre = 'positive'
|
||||||
@ -61,30 +61,36 @@ export class PegasusRollDialog extends Dialog {
|
|||||||
effectData.data.isUsed = toggled
|
effectData.data.isUsed = toggled
|
||||||
if (effectData.data.reducedicevalue || effectData.data.statdice) {
|
if (effectData.data.reducedicevalue || effectData.data.statdice) {
|
||||||
idVal = "#statDicesLevel"
|
idVal = "#statDicesLevel"
|
||||||
|
key = "statLevelBonus"
|
||||||
}
|
}
|
||||||
if (effectData.data.otherdice) {
|
if (effectData.data.otherdice) {
|
||||||
idVal = "#damageDiceLevel"
|
idVal = "#damageDiceLevel"
|
||||||
|
key = "damageLevelBonus"
|
||||||
}
|
}
|
||||||
if (effectData.data.hindrance) {
|
if (effectData.data.hindrance) {
|
||||||
idVal = "#hindranceDicesLevel"
|
idVal = "#hindranceDicesLevel"
|
||||||
genre = 'positive' // Dynamic fix
|
genre = 'positive' // Dynamic fix
|
||||||
|
key = "hindranceLevelBonus"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Now process the dice level update
|
// Now process the dice level update
|
||||||
if (idVal) {
|
if (idVal) {
|
||||||
|
let newLevel = Number($(idVal).val())
|
||||||
if (toggled) {
|
if (toggled) {
|
||||||
let newLevel = Number($(idVal).val())
|
if (genre == 'positive') {
|
||||||
console.log("Ongoing", newLevel, toggled, idVal)
|
|
||||||
if (genre == 'positive') {
|
|
||||||
newLevel += Number(level)
|
newLevel += Number(level)
|
||||||
|
this.rollData[key] += Number(level)
|
||||||
} else {
|
} else {
|
||||||
newLevel -= Number(level)
|
newLevel -= Number(level)
|
||||||
|
this.rollData[key] -= Number(level)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (genre == 'positive') {
|
if (genre == 'positive') {
|
||||||
newLevel -= Number(level)
|
newLevel -= Number(level)
|
||||||
|
this.rollData[key] -= Number(level)
|
||||||
} else {
|
} else {
|
||||||
newLevel += Number(level)
|
newLevel += Number(level)
|
||||||
|
this.rollData[key] += Number(level)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
newLevel = (newLevel < 0) ? 0 : newLevel
|
newLevel = (newLevel < 0) ? 0 : newLevel
|
||||||
@ -210,7 +216,7 @@ export class PegasusRollDialog extends Dialog {
|
|||||||
html.find('#statDicesLevel').change((event) => {
|
html.find('#statDicesLevel').change((event) => {
|
||||||
this.rollData.statDicesLevel = Number(event.currentTarget.value)
|
this.rollData.statDicesLevel = Number(event.currentTarget.value)
|
||||||
});
|
});
|
||||||
html.find('#specDicesLevel').change( async (event) => {
|
html.find('#specDicesLevel').change(async (event) => {
|
||||||
this.rollData.specDicesLevel = Number(event.currentTarget.value)
|
this.rollData.specDicesLevel = Number(event.currentTarget.value)
|
||||||
PegasusUtility.updateSpecDicePool(this.rollData)
|
PegasusUtility.updateSpecDicePool(this.rollData)
|
||||||
this.refreshDialog()
|
this.refreshDialog()
|
||||||
@ -244,15 +250,16 @@ export class PegasusRollDialog extends Dialog {
|
|||||||
|
|
||||||
html.find('.pool-add-dice').click(async (event) => {
|
html.find('.pool-add-dice').click(async (event) => {
|
||||||
let diceKey = $(event.currentTarget).data("dice-key")
|
let diceKey = $(event.currentTarget).data("dice-key")
|
||||||
PegasusUtility.addDicePool( this.rollData, diceKey)
|
let diceLevel = $(event.currentTarget).data("dice-level")
|
||||||
|
PegasusUtility.addDicePool(this.rollData, diceKey, diceLevel)
|
||||||
this.refreshDialog()
|
this.refreshDialog()
|
||||||
})
|
})
|
||||||
html.find('.pool-remove-dice').click(async (event) => {
|
html.find('.pool-remove-dice').click(async (event) => {
|
||||||
let idx = $(event.currentTarget).data("dice-idx")
|
let idx = $(event.currentTarget).data("dice-idx")
|
||||||
PegasusUtility.removeFromDicePool( this.rollData, idx)
|
PegasusUtility.removeFromDicePool(this.rollData, idx)
|
||||||
this.refreshDialog()
|
this.refreshDialog()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -60,9 +60,9 @@ export class PegasusUtility {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static getDiceList() {
|
static getDiceList() {
|
||||||
return [{ key: "d4", img: "systems/fvtt-pegasus-rpg/images/dice/d4.webp" }, { key: "d6", img: "systems/fvtt-pegasus-rpg/images/dice/d6.webp" },
|
return [{ key: "d4", level: 1, img: "systems/fvtt-pegasus-rpg/images/dice/d4.webp" }, { key: "d6", level: 2, img: "systems/fvtt-pegasus-rpg/images/dice/d6.webp" },
|
||||||
{ key: "d8", img: "systems/fvtt-pegasus-rpg/images/dice/d8.webp" }, { key: "d10", img: "systems/fvtt-pegasus-rpg/images/dice/d10.webp" },
|
{ key: "d8", level: 3, img: "systems/fvtt-pegasus-rpg/images/dice/d8.webp" }, { key: "d10", level: 4, img: "systems/fvtt-pegasus-rpg/images/dice/d10.webp" },
|
||||||
{ key: "d12", img: "systems/fvtt-pegasus-rpg/images/dice/d12.webp" }]
|
{ key: "d12", level: 5, img: "systems/fvtt-pegasus-rpg/images/dice/d12.webp" }]
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -72,7 +72,7 @@ export class PegasusUtility {
|
|||||||
if (effect && effect.applied && effect.effect.data.bonusdice) {
|
if (effect && effect.applied && effect.effect.data.bonusdice) {
|
||||||
let diceKey = PegasusUtility.getDiceFromLevel(effect.effect.data.effectlevel)
|
let diceKey = PegasusUtility.getDiceFromLevel(effect.effect.data.effectlevel)
|
||||||
let newDice = {
|
let newDice = {
|
||||||
name: "effect-bonus-dice", key: diceKey, effect: effect.effect.name,
|
name: "effect-bonus-dice", key: diceKey, level: effect.effect.data.effectlevel, effect: effect.effect.name,
|
||||||
img: `systems/fvtt-pegasus-rpg/images/dice/${diceKey}.webp`
|
img: `systems/fvtt-pegasus-rpg/images/dice/${diceKey}.webp`
|
||||||
}
|
}
|
||||||
newDicePool.push(newDice)
|
newDicePool.push(newDice)
|
||||||
@ -90,7 +90,7 @@ export class PegasusUtility {
|
|||||||
let diceList = diceKey.split(" ")
|
let diceList = diceKey.split(" ")
|
||||||
for(let myDice of diceList) {
|
for(let myDice of diceList) {
|
||||||
let newDice = {
|
let newDice = {
|
||||||
name: "damage", key: myDice,
|
name: "damage", key: myDice, level: rollData.damageDiceLevel,
|
||||||
img: `systems/fvtt-pegasus-rpg/images/dice/${myDice}.webp`
|
img: `systems/fvtt-pegasus-rpg/images/dice/${myDice}.webp`
|
||||||
}
|
}
|
||||||
newDicePool.push(newDice)
|
newDicePool.push(newDice)
|
||||||
@ -108,7 +108,7 @@ export class PegasusUtility {
|
|||||||
let diceList = diceKey.split(" ")
|
let diceList = diceKey.split(" ")
|
||||||
for(let myDice of diceList) {
|
for(let myDice of diceList) {
|
||||||
let newDice = {
|
let newDice = {
|
||||||
name: "spec", key: myDice,
|
name: "spec", key: myDice, level: rollData.specDicesLevel,
|
||||||
img: `systems/fvtt-pegasus-rpg/images/dice/${myDice}.webp`
|
img: `systems/fvtt-pegasus-rpg/images/dice/${myDice}.webp`
|
||||||
}
|
}
|
||||||
newDicePool.push(newDice)
|
newDicePool.push(newDice)
|
||||||
@ -118,9 +118,9 @@ export class PegasusUtility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static addDicePool(rollData, diceKey) {
|
static addDicePool(rollData, diceKey, level) {
|
||||||
let newDice = {
|
let newDice = {
|
||||||
name: "dice-click", key: diceKey,
|
name: "dice-click", key: diceKey, level: level,
|
||||||
img: `systems/fvtt-pegasus-rpg/images/dice/${diceKey}.webp`
|
img: `systems/fvtt-pegasus-rpg/images/dice/${diceKey}.webp`
|
||||||
}
|
}
|
||||||
rollData.dicePool.push(newDice)
|
rollData.dicePool.push(newDice)
|
||||||
@ -451,22 +451,22 @@ export class PegasusUtility {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static updateRollData(rollData) {
|
static updateRollData(rollData) {
|
||||||
|
|
||||||
let id = rollData.rollId;
|
let id = rollData.rollId
|
||||||
let oldRollData = this.rollDataStore[id] || {};
|
let oldRollData = this.rollDataStore[id] || {}
|
||||||
let newRollData = mergeObject(oldRollData, rollData);
|
let newRollData = mergeObject(oldRollData, rollData)
|
||||||
this.rollDataStore[id] = newRollData;
|
this.rollDataStore[id] = newRollData
|
||||||
}
|
}
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static saveRollData(rollData) {
|
static saveRollData(rollData) {
|
||||||
game.socket.emit("system.pegasus-rpg", {
|
game.socket.emit("system.pegasus-rpg", {
|
||||||
name: "msg_update_roll", data: rollData
|
name: "msg_update_roll", data: rollData
|
||||||
}); // Notify all other clients of the roll
|
}); // Notify all other clients of the roll
|
||||||
this.updateRollData(rollData);
|
this.updateRollData(rollData)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static getRollData(id) {
|
static getRollData(id) {
|
||||||
return this.rollDataStore[id];
|
return this.rollDataStore[id]
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -570,15 +570,51 @@ export class PegasusUtility {
|
|||||||
for (let effect of rollData.effectsList) {
|
for (let effect of rollData.effectsList) {
|
||||||
if (effect.effect.data.isUsed && effect.effect.data.oneuse) {
|
if (effect.effect.data.isUsed && effect.effect.data.oneuse) {
|
||||||
toRem.push(effect.effect._id)
|
toRem.push(effect.effect._id)
|
||||||
|
ChatMessage.create({content: `One used effect ${effect.effect.name} has been auto-deleted.`})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (toRem.length > 0) {
|
if (toRem.length > 0) {
|
||||||
console.log("Going to remove one use effects", toRem)
|
//console.log("Going to remove one use effects", toRem)
|
||||||
let actor = game.actors.get(rollData.actorId)
|
let actor = game.actors.get(rollData.actorId)
|
||||||
actor.deleteEmbeddedDocuments('Item', toRem)
|
actor.deleteEmbeddedDocuments('Item', toRem)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
static async momentumReroll(actorId) {
|
||||||
|
let actor = game.actors.get(actorId)
|
||||||
|
let rollData = actor.lastRoll
|
||||||
|
if (rollData) {
|
||||||
|
rollData.rerollMomentum = true
|
||||||
|
PegasusUtility.rollPegasus(rollData)
|
||||||
|
this.actor.lastRoll = undefined
|
||||||
|
} else {
|
||||||
|
ui.notifications.warn("No last roll registered....")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
static async showMomentumDialog( actorId) {
|
||||||
|
let d = new Dialog({
|
||||||
|
title: "Momentum reroll",
|
||||||
|
content: "<p>Do you want to re-roll your last roll ?</p>",
|
||||||
|
buttons: {
|
||||||
|
one: {
|
||||||
|
icon: '<i class="fas fa-check"></i>',
|
||||||
|
label: "Cancel",
|
||||||
|
callback: () => this.close()
|
||||||
|
},
|
||||||
|
two: {
|
||||||
|
icon: '<i class="fas fa-times"></i>',
|
||||||
|
label: "Reroll",
|
||||||
|
callback: () => PegasusUtility.momentumReroll(actorId)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
default: "Reroll",
|
||||||
|
})
|
||||||
|
d.render(true)
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static async rollPegasus(rollData) {
|
static async rollPegasus(rollData) {
|
||||||
|
|
||||||
@ -626,13 +662,17 @@ export class PegasusUtility {
|
|||||||
|
|
||||||
let diceFormulaTab = []
|
let diceFormulaTab = []
|
||||||
for (let dice of rollData.dicePool) {
|
for (let dice of rollData.dicePool) {
|
||||||
diceFormulaTab.push(dice.key)
|
let level = dice.level
|
||||||
|
if (dice.name == "stat" ) {
|
||||||
|
level += rollData.statLevelBonus
|
||||||
|
}
|
||||||
|
diceFormulaTab.push( this.getFoundryDiceFromLevel(level) )
|
||||||
}
|
}
|
||||||
let diceFormula = '{' + diceFormulaTab.join(', ') + '}kh + ' + (rollData.stat?.mod || 0)
|
let diceFormula = '{' + diceFormulaTab.join(', ') + '}kh + ' + (rollData.stat?.mod || 0)
|
||||||
|
|
||||||
// Performs roll
|
// Performs roll
|
||||||
let myRoll = rollData.roll
|
let myRoll = rollData.roll
|
||||||
if (!myRoll || rollData.reroll) { // New rolls only of no rerolls
|
if (!myRoll || rollData.reroll || rollData.rerollMomentum) { // New rolls only of no rerolls
|
||||||
myRoll = new Roll(diceFormula).roll({ async: false })
|
myRoll = new Roll(diceFormula).roll({ async: false })
|
||||||
await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
|
await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
|
||||||
rollData.roll = myRoll
|
rollData.roll = myRoll
|
||||||
@ -669,7 +709,8 @@ export class PegasusUtility {
|
|||||||
this.removeOneUseEffects(rollData) // Unused for now
|
this.removeOneUseEffects(rollData) // Unused for now
|
||||||
|
|
||||||
// And save the roll
|
// And save the roll
|
||||||
this.saveRollData(rollData);
|
this.saveRollData(rollData)
|
||||||
|
actor.lastRoll = rollData
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -812,6 +853,10 @@ export class PegasusUtility {
|
|||||||
rollId: randomID(16),
|
rollId: randomID(16),
|
||||||
rollMode: game.settings.get("core", "rollMode"),
|
rollMode: game.settings.get("core", "rollMode"),
|
||||||
bonusDicesLevel: 0,
|
bonusDicesLevel: 0,
|
||||||
|
statLevelBonus: 0,
|
||||||
|
damageLevelBonus: 0,
|
||||||
|
specLevelBonus: 0,
|
||||||
|
hindranceLevelBonus: 0,
|
||||||
hindranceDicesLevel: 0,
|
hindranceDicesLevel: 0,
|
||||||
otherDicesLevel: 0,
|
otherDicesLevel: 0,
|
||||||
statDicesLevel: 0,
|
statDicesLevel: 0,
|
||||||
|
@ -1412,6 +1412,11 @@ Focus FOC: #ff0084
|
|||||||
max-width: 14rem;
|
max-width: 14rem;
|
||||||
min-width: 14rem;
|
min-width: 14rem;
|
||||||
}
|
}
|
||||||
|
.item-name-label-header-long2 {
|
||||||
|
flex-grow:2;
|
||||||
|
max-width: 24rem;
|
||||||
|
min-width: 24rem;
|
||||||
|
}
|
||||||
.item-name-label {
|
.item-name-label {
|
||||||
flex-grow:2;
|
flex-grow:2;
|
||||||
max-width: 10rem;
|
max-width: 10rem;
|
||||||
@ -1422,6 +1427,11 @@ Focus FOC: #ff0084
|
|||||||
max-width: 12rem;
|
max-width: 12rem;
|
||||||
min-width: 12rem;
|
min-width: 12rem;
|
||||||
}
|
}
|
||||||
|
.item-name-label-long2 {
|
||||||
|
flex-grow:2;
|
||||||
|
max-width: 22rem;
|
||||||
|
min-width: 22rem;
|
||||||
|
}
|
||||||
.item-name-label-level2 {
|
.item-name-label-level2 {
|
||||||
flex-grow:2;
|
flex-grow:2;
|
||||||
max-width: 9rem;
|
max-width: 9rem;
|
||||||
|
@ -180,9 +180,9 @@
|
|||||||
"styles": [
|
"styles": [
|
||||||
"styles/simple.css"
|
"styles/simple.css"
|
||||||
],
|
],
|
||||||
"templateVersion": 94,
|
"templateVersion": 95,
|
||||||
"title": "Pegasus RPG",
|
"title": "Pegasus RPG",
|
||||||
"url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg",
|
"url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg",
|
||||||
"version": "0.5.15",
|
"version": "0.6.0",
|
||||||
"background" : "./images/ui/pegasus_welcome_page.webp"
|
"background" : "./images/ui/pegasus_welcome_page.webp"
|
||||||
}
|
}
|
||||||
|
@ -271,12 +271,14 @@
|
|||||||
"unavailablevice": [],
|
"unavailablevice": [],
|
||||||
"effectsgained": [],
|
"effectsgained": [],
|
||||||
"threatlevel": 0,
|
"threatlevel": 0,
|
||||||
|
"activated": false,
|
||||||
"description": ""
|
"description": ""
|
||||||
},
|
},
|
||||||
"vice": {
|
"vice": {
|
||||||
"unavailablevirtue": [],
|
"unavailablevirtue": [],
|
||||||
"effectsgained": [],
|
"effectsgained": [],
|
||||||
"threatlevel": 0,
|
"threatlevel": 0,
|
||||||
|
"activated": false,
|
||||||
"description": ""
|
"description": ""
|
||||||
},
|
},
|
||||||
"specialisation": {
|
"specialisation": {
|
||||||
|
@ -175,14 +175,14 @@
|
|||||||
<h3><label class="items-title-text">Perks</label></h3>
|
<h3><label class="items-title-text">Perks</label></h3>
|
||||||
</span>
|
</span>
|
||||||
<span class="item-field-label-short">
|
<span class="item-field-label-short">
|
||||||
<label class="short-label">#Targets</label>
|
|
||||||
</span>
|
|
||||||
<span class="item-field-label-long">
|
|
||||||
<label class="short-label">Level</label>
|
<label class="short-label">Level</label>
|
||||||
</span>
|
</span>
|
||||||
<span class="item-field-label-medium">
|
<span class="item-field-label-medium">
|
||||||
<label class="short-label">Range</label>
|
<label class="short-label">Range</label>
|
||||||
</span>
|
</span>
|
||||||
|
<span class="item-field-label-short">
|
||||||
|
<label class="short-label">#Targets</label>
|
||||||
|
</span>
|
||||||
<span class="item-field-label-long">
|
<span class="item-field-label-long">
|
||||||
<label class="short-label">Status</label>
|
<label class="short-label">Status</label>
|
||||||
</span>
|
</span>
|
||||||
@ -208,9 +208,9 @@
|
|||||||
<span class="item-field-label-short">{{perk.data.level}}</span>
|
<span class="item-field-label-short">{{perk.data.level}}</span>
|
||||||
|
|
||||||
{{#if perk.data.features.range.flag}}
|
{{#if perk.data.features.range.flag}}
|
||||||
<span class="item-field-label-long">{{perk.data.features.range.value}}</span>
|
<span class="item-field-label-medium">{{perk.data.features.range.value}}</span>
|
||||||
{{else}}
|
{{else}}
|
||||||
<span class="item-field-label-long"> - </span>
|
<span class="item-field-label-medium"> - </span>
|
||||||
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if perk.data.features.nbtargets.flag}}
|
{{#if perk.data.features.nbtargets.flag}}
|
||||||
@ -219,6 +219,7 @@
|
|||||||
<span class="item-field-label-short"> - </span>
|
<span class="item-field-label-short"> - </span>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
|
||||||
<span class="item-field-label-long">
|
<span class="item-field-label-long">
|
||||||
<select class="perk-status" type="text" value="{{perk.data.status}}" data-dtype="String">
|
<select class="perk-status" type="text" value="{{perk.data.status}}" data-dtype="String">
|
||||||
{{#select perk.data.status}}
|
{{#select perk.data.status}}
|
||||||
@ -279,7 +280,7 @@
|
|||||||
|
|
||||||
<ul class="stat-list alternate-list">
|
<ul class="stat-list alternate-list">
|
||||||
<li class="item flexrow list-item items-title-bg">
|
<li class="item flexrow list-item items-title-bg">
|
||||||
<span class="item-name-label-header">
|
<span class="item-name-label-header-long2">
|
||||||
<h3><label class="items-title-text">Effects</label></h3>
|
<h3><label class="items-title-text">Effects</label></h3>
|
||||||
</span>
|
</span>
|
||||||
<span class="item-field-label-short">
|
<span class="item-field-label-short">
|
||||||
@ -301,7 +302,7 @@
|
|||||||
data-item-id="{{effect._id}}">
|
data-item-id="{{effect._id}}">
|
||||||
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
|
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
|
||||||
src="{{effect.img}}" /></a>
|
src="{{effect.img}}" /></a>
|
||||||
<span class="item-name-label">{{effect.name}}</span>
|
<span class="item-name-label-long2">{{effect.name}}</span>
|
||||||
<span class="item-field-label-short">{{effect.data.effectlevel}}</span>
|
<span class="item-field-label-short">{{effect.data.effectlevel}}</span>
|
||||||
<span class="item-field-label-short">{{upperFirst effect.data.type}}</span>
|
<span class="item-field-label-short">{{upperFirst effect.data.type}}</span>
|
||||||
<span class="item-field-label-short">{{upperFirst effect.data.genre}}</span>
|
<span class="item-field-label-short">{{upperFirst effect.data.genre}}</span>
|
||||||
@ -840,7 +841,7 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<ul>
|
<ul>
|
||||||
<li class="flexrow item">
|
<li class="flexrow item">
|
||||||
<label class="generic-label">Weight</label>
|
<label class="generic-label">Weight</label>
|
||||||
@ -878,8 +879,79 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3 class="items-title-bg">Psychology : </h3>
|
<div>
|
||||||
|
<ul class="stat-list alternate-list">
|
||||||
|
<li class="item flexrow list-item items-title-bg">
|
||||||
|
<span class="item-name-label-header">
|
||||||
|
<h3><label class="items-title-text">Virtues</label></h3>
|
||||||
|
</span>
|
||||||
|
<span class="item-field-label-short">Status</label></span>
|
||||||
|
</li>
|
||||||
|
{{#each virtues as |virtue key|}}
|
||||||
|
<li class="item stat flexrow list-item list-item-shadow" data-arme-id="{{virtue.id}}"
|
||||||
|
data-item-id="{{virtue._id}}">
|
||||||
|
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
|
||||||
|
src="{{virtue.img}}" /></a>
|
||||||
|
<span class="item-name-label">{{virtue.name}}</span>
|
||||||
|
<span class="item-field-label-short"><label class="short-label">
|
||||||
|
{{#if virtue.data.activated}}
|
||||||
|
Activated
|
||||||
|
{{else}}
|
||||||
|
-
|
||||||
|
{{/if}}
|
||||||
|
</label>
|
||||||
|
</span>
|
||||||
|
<div class="item-filler"> </div>
|
||||||
|
<div class="item-controls item-controls-fixed">
|
||||||
|
<a class="item-control vice-virtue-activate" title="Activated">{{#if virtue.data.activated}}<i
|
||||||
|
class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
|
||||||
|
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
{{/each}}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<ul class="stat-list alternate-list">
|
||||||
|
<li class="item flexrow list-item items-title-bg">
|
||||||
|
<span class="item-name-label-header">
|
||||||
|
<h3><label class="items-title-text">Vices</label></h3>
|
||||||
|
</span>
|
||||||
|
<span class="item-field-label-short">Status</label></span>
|
||||||
|
</li>
|
||||||
|
{{#each vices as |vice key|}}
|
||||||
|
<li class="item stat flexrow list-item list-item-shadow" data-arme-id="{{vice.id}}"
|
||||||
|
data-item-id="{{vice._id}}">
|
||||||
|
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
|
||||||
|
src="{{vice.img}}" /></a>
|
||||||
|
<span class="item-name-label">{{vice.name}}</span>
|
||||||
|
<span class="item-field-label-short"><label class="short-label">
|
||||||
|
{{#if vice.data.activated}}
|
||||||
|
Activated
|
||||||
|
{{else}}
|
||||||
|
-
|
||||||
|
{{/if}}
|
||||||
|
</label>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<div class="item-filler"> </div>
|
||||||
|
<div class="item-controls item-controls-fixed">
|
||||||
|
<a class="item-control vice-virtue-activate" title="Activated">{{#if vice.data.activated}}<i
|
||||||
|
class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
|
||||||
|
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
{{/each}}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
|
<li class="item flexrow list-item items-title-bg">
|
||||||
|
<span class="item-name-label-header">
|
||||||
|
<h3><label class="items-title-text">Psychology</label></h3>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
<li class="flexrow">
|
<li class="flexrow">
|
||||||
<label class="short-label">Worst Fear </label>
|
<label class="short-label">Worst Fear </label>
|
||||||
<input type="text" class="" name="data.biodata.worstfear" value="{{data.biodata.worstfear}}"
|
<input type="text" class="" name="data.biodata.worstfear" value="{{data.biodata.worstfear}}"
|
||||||
@ -915,8 +987,12 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h3 class="items-title-bg">Development : </h3>
|
|
||||||
<ul>
|
<ul>
|
||||||
|
<li class="item flexrow list-item items-title-bg">
|
||||||
|
<span class="item-name-label-header">
|
||||||
|
<h3><label class="items-title-text">Development</label></h3>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
<li class="flexrow">
|
<li class="flexrow">
|
||||||
<label class="short-label">Character Value : </label>
|
<label class="short-label">Character Value : </label>
|
||||||
<input type="text" class="" name="data.biodata.charactervalue" value="{{data.biodata.charactervalue}}"
|
<input type="text" class="" name="data.biodata.charactervalue" value="{{data.biodata.charactervalue}}"
|
||||||
|
@ -31,6 +31,12 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li class="flexrow">
|
||||||
|
<label class="generic-label">Activated ? </label>
|
||||||
|
<label class="attribute-value checkbox"><input type="checkbox" name="data.activated" {{checked
|
||||||
|
data.activated}} /></label>
|
||||||
|
</li>
|
||||||
|
|
||||||
<li class="flexrow"><label class="generic-label">Effects Gained</label>
|
<li class="flexrow"><label class="generic-label">Effects Gained</label>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
@ -31,6 +31,12 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li class="flexrow">
|
||||||
|
<label class="generic-label">Activated ? </label>
|
||||||
|
<label class="attribute-value checkbox"><input type="checkbox" name="data.activated" {{checked
|
||||||
|
data.activated}} /></label>
|
||||||
|
</li>
|
||||||
|
|
||||||
<li class="flexrow"><label class="generic-label">Effects Gained</label>
|
<li class="flexrow"><label class="generic-label">Effects Gained</label>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
</li>
|
</li>
|
||||||
{{else}}
|
{{else}}
|
||||||
{{#if (count effect.effect.data.specaffected)}}
|
{{#if (count effect.effect.data.specaffected)}}
|
||||||
{{#each effect.effect.data.specaffected as |spec idx|}}
|
{{#each effect.effect.data.specaffected as |spec idx2|}}
|
||||||
{{#if (eq @root.specName spec.name)}}
|
{{#if (eq @root.specName spec.name)}}
|
||||||
<li class="flex-group-left">
|
<li class="flex-group-left">
|
||||||
<label class="attribute-value checkbox"><input type="checkbox" class="effect-clicked" id="effect-{{idx}}" data-effect-idx="{{idx}}" {{checked effect.applied}}/></label>
|
<label class="attribute-value checkbox"><input type="checkbox" class="effect-clicked" id="effect-{{idx}}" data-effect-idx="{{idx}}" {{checked effect.applied}}/></label>
|
||||||
|
@ -71,7 +71,7 @@
|
|||||||
</span>
|
</span>
|
||||||
<div class="flexrow dice-pool-stack">
|
<div class="flexrow dice-pool-stack">
|
||||||
{{#each dicePool as |dice idx|}}
|
{{#each dicePool as |dice idx|}}
|
||||||
<span><a class="pool-remove-dice" data-dice-idx="{{idx}}" data-dice-key="{{dice.key}}"><img class="dice-pool-image"
|
<span><a class="pool-remove-dice" data-dice-idx="{{idx}}" data-dice-level="{{dice.level}}" data-dice-key="{{dice.key}}"><img class="dice-pool-image"
|
||||||
src="{{dice.img}}"></a></span>
|
src="{{dice.img}}"></a></span>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
@ -79,7 +79,7 @@
|
|||||||
|
|
||||||
<div class="flexrow">
|
<div class="flexrow">
|
||||||
{{#each diceList as |dice idx|}}
|
{{#each diceList as |dice idx|}}
|
||||||
<span><a class="pool-add-dice" data-dice-key="{{dice.key}}"><img class="dice-pool-image"
|
<span><a class="pool-add-dice" data-dice-key="{{dice.key}}" data-dice-level="{{dice.level}}"><img class="dice-pool-image"
|
||||||
src="{{dice.img}}"></a></span>
|
src="{{dice.img}}"></a></span>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user