Compare commits

..

42 Commits

Author SHA1 Message Date
932573c9ae Fix #98 hindrance stuff 2022-10-05 14:44:35 +02:00
d6a57de134 Fix #98 hindrance stuff 2022-10-05 14:44:12 +02:00
e2d5a0ec74 Fix #96 hindrance stuff 2022-10-05 14:38:31 +02:00
a68db10676 Fix #95 message for GM 2022-10-05 10:24:42 +02:00
6e69e151c5 Fix #95 message for GM 2022-10-05 10:00:30 +02:00
c2831e4ccd Fix #90 MR management with vehicles 2022-10-05 09:58:07 +02:00
5a062cc94e Fix #89 agitators hindrance 2022-10-05 09:40:34 +02:00
ef740f4c0d Fix #94 agitators hindrance 2022-10-05 09:19:59 +02:00
076945c76f Fix #92 armors 2022-10-05 09:16:22 +02:00
a763efe873 Fix #62 armors 2022-10-05 09:13:17 +02:00
c49289b88f Better management of roles effects 2022-10-04 08:15:54 +02:00
8a8bd489f3 Fix #77 2022-10-03 17:18:10 +02:00
43724596fb Fix #77 2022-10-03 17:17:28 +02:00
e06572c221 Fix #77 2022-10-03 15:32:22 +02:00
7bcd4d9c06 Implements #77 2022-10-03 10:01:41 +02:00
aa1d5e8ecb Fix #80 2022-09-30 15:35:04 +02:00
536b42dbe0 Fix #84 2022-09-30 14:00:29 +02:00
00761d57d3 Fix #81 2022-09-30 13:44:59 +02:00
5fb0221007 Fix #83 2022-09-30 12:02:04 +02:00
19f7ebca92 Fix #82 2022-09-30 11:55:45 +02:00
afe4fc2a1b Fix #80 2022-09-30 11:54:48 +02:00
27029abc88 #Fix 78 : add role level 2022-09-29 20:04:55 +02:00
d8f8b7198c #Fix 78 : add role level 2022-09-29 20:04:27 +02:00
908cf4206a #Fix 78 : add role level 2022-09-29 14:14:48 +02:00
e531b636bc #Fix 78 : add role level 2022-09-29 14:12:16 +02:00
4065d46ffd #Fix 78 : add role level 2022-09-29 13:14:34 +02:00
1bb869e715 Release 10.0.23 2022-09-29 13:11:07 +02:00
c8cc9d6c82 Fix #75 Token drag&drop 2022-09-29 13:10:41 +02:00
cfcc9ca557 Fix #75 Token drag&drop 2022-09-29 13:07:57 +02:00
a5e17b8276 Fix #71 : Display perk text 2022-09-29 10:59:47 +02:00
428db5e441 Fix #74 : Power damage type 2022-09-28 20:23:21 +02:00
9394e0e851 Fix #73 : Power damage type 2022-09-28 20:21:04 +02:00
18a69ba993 Fix #70 : effect OK for dmr roll 2022-09-28 20:14:24 +02:00
fb69f24fce Fix #72 : effect OK for dmr roll 2022-09-28 20:04:04 +02:00
e1d6b1aaff Fix #69 : Size management 2022-09-28 16:43:28 +02:00
7977233d93 #68 : Process stat effects automatically 2022-09-28 16:27:16 +02:00
e3674f076c Fix #67 2022-09-28 14:02:05 +02:00
1e020d469f Fix #66 2022-09-28 14:01:34 +02:00
7d040af19a Prepare for release 2022-09-28 13:54:57 +02:00
0c6faeb9ca Fix #65 2022-09-28 13:54:06 +02:00
65d0b18191 Fix #53 2022-09-28 13:48:50 +02:00
01a2fd9ff8 Fix #52 2022-09-28 13:43:36 +02:00
22 changed files with 2447 additions and 1844 deletions

View File

@ -61,6 +61,7 @@ export class PegasusActorSheet extends ActorSheet {
encCapacity: this.actor.getEncumbranceCapacity(), encCapacity: this.actor.getEncumbranceCapacity(),
levelRemainingList: this.actor.getLevelRemainingList(), levelRemainingList: this.actor.getLevelRemainingList(),
maxLevelRemainingList: this.actor.getMaxLevelRemainingList(), maxLevelRemainingList: this.actor.getMaxLevelRemainingList(),
disabledBonus: (this.actor.system.biodata.noautobonus) ? "" : "disabled",
containersTree: this.actor.containersTree, containersTree: this.actor.containersTree,
encCurrent: this.actor.encCurrent, encCurrent: this.actor.encCurrent,
encHindrance: this.actor.encHindrance, encHindrance: this.actor.encHindrance,
@ -249,13 +250,13 @@ export class PegasusActorSheet extends ActorSheet {
this.actor.rollPool( 'def', true, "defence"); this.actor.rollPool( 'def', true, "defence");
}); });
html.find('.damage-melee').click((event) => { html.find('.damage-melee').click((event) => {
this.actor.rollPool( 'str', false, "melee-dmg"); this.actor.rollPool( 'str', false, "melee-dmg")
}); });
html.find('.damage-ranged').click((event) => { html.find('.damage-ranged').click((event) => {
this.actor.rollPool( 'per', false, "ranged-dmg"); this.actor.rollPool( 'per', false, "ranged-dmg");
}); });
html.find('.damage-resistance').click((event) => { html.find('.damage-resistance').click((event) => {
this.actor.rollPool( 'phy', false, "dmg-res"); this.actor.rollPool( 'phy', false, "dmg-res")
}); });
html.find('.roll-stat').click((event) => { html.find('.roll-stat').click((event) => {

File diff suppressed because it is too large Load Diff

View File

@ -57,8 +57,9 @@ Hooks.once("init", async function () {
CONFIG.Combat.documentClass = PegasusCombat CONFIG.Combat.documentClass = PegasusCombat
CONFIG.Actor.documentClass = PegasusActor CONFIG.Actor.documentClass = PegasusActor
CONFIG.Item.documentClass = PegasusItem CONFIG.Item.documentClass = PegasusItem
//CONFIG.Token.objectClass = PegasusToken game.system.pegasus = {
game.system.pegasus = { }; utility: PegasusUtility
}
/* -------------------------------------------- */ /* -------------------------------------------- */
// Register sheet application classes // Register sheet application classes
@ -69,8 +70,9 @@ Hooks.once("init", async function () {
Items.unregisterSheet("core", ItemSheet); Items.unregisterSheet("core", ItemSheet);
Items.registerSheet("fvtt-pegasus", PegasusItemSheet, { makeDefault: true }); Items.registerSheet("fvtt-pegasus", PegasusItemSheet, { makeDefault: true });
PegasusUtility.init(); PegasusUtility.init()
}); });
/* -------------------------------------------- */ /* -------------------------------------------- */

View File

@ -49,7 +49,7 @@ export class PegasusRollDialog extends Dialog {
effect.applied = toggled effect.applied = toggled
let level, genre, idVal, key let level, genre, idVal, key
if (effect.type == 'effect') { if (effect.type == 'effect' && effect.effect) {
let effectData = effect.effect let effectData = effect.effect
level = effectData.system.effectlevel level = effectData.system.effectlevel
genre = effectData.system.genre genre = effectData.system.genre
@ -90,6 +90,9 @@ export class PegasusRollDialog extends Dialog {
PegasusUtility.updateDamageDicePool(this.rollData) PegasusUtility.updateDamageDicePool(this.rollData)
PegasusUtility.updateEffectsBonusDice(this.rollData) PegasusUtility.updateEffectsBonusDice(this.rollData)
PegasusUtility.updateHindranceBonusDice(this.rollData) PegasusUtility.updateHindranceBonusDice(this.rollData)
if ( effect.specList) {
this.rollData.specList = duplicate(effect.specList)
}
} }
/* -------------------------------------------- */ /* -------------------------------------------- */

View File

@ -8,9 +8,11 @@ import { PegasusRollDialog } from "./pegasus-roll-dialog.js";
const __level2Dice = ["d0", "d4", "d6", "d8", "d10", "d12"] const __level2Dice = ["d0", "d4", "d6", "d8", "d10", "d12"]
const __name2DiceValue = { "0": 0, "d0": 0, "d4": 4, "d6": 6, "d8": 8, "d10": 10, "d12": 12 } const __name2DiceValue = { "0": 0, "d0": 0, "d4": 4, "d6": 6, "d8": 8, "d10": 10, "d12": 12 }
const __dice2Level = { "d0": 0, "d4": 1, "d6": 2, "d8": 3, "d10": 4, "d12": 5 } const __dice2Level = { "d0": 0, "d4": 1, "d6": 2, "d8": 3, "d10": 4, "d12": 5 }
const __rangeKeyToText = { notapplicable: "N/A", touch: "Self Only", touchself: "Touch/Self", tz: "Threat Zone", close: "Close", medium: "Medium", const __rangeKeyToText = {
long: "Long", extreme: "Extreme", sight: "Lineof Sight", tz_close: "TZ/Close", close_medium: "Close/Medium", medium_long: "Medium/Long", notapplicable: "N/A", touch: "Self Only", touchself: "Touch/Self", tz: "Threat Zone", close: "Close", medium: "Medium",
long_extreme: "Long/Extreme"} long: "Long", extreme: "Extreme", sight: "Lineof Sight", tz_close: "TZ/Close", close_medium: "Close/Medium", medium_long: "Medium/Long",
long_extreme: "Long/Extreme"
}
/* -------------------------------------------- */ /* -------------------------------------------- */
export class PegasusUtility { export class PegasusUtility {
@ -21,7 +23,6 @@ export class PegasusUtility {
Hooks.on('renderChatLog', (log, html, data) => PegasusUtility.chatListeners(html)) Hooks.on('renderChatLog', (log, html, data) => PegasusUtility.chatListeners(html))
Hooks.on('targetToken', (user, token, flag) => PegasusUtility.targetToken(user, token, flag)) Hooks.on('targetToken', (user, token, flag) => PegasusUtility.targetToken(user, token, flag))
Hooks.on('renderSidebarTab', (app, html, data) => PegasusUtility.addDiceRollButton(app, html, data)) Hooks.on('renderSidebarTab', (app, html, data) => PegasusUtility.addDiceRollButton(app, html, data))
Hooks.on("getCombatTrackerEntryContext", (html, options) => { Hooks.on("getCombatTrackerEntryContext", (html, options) => {
PegasusUtility.pushInitiativeOptions(html, options); PegasusUtility.pushInitiativeOptions(html, options);
}); });
@ -33,9 +34,10 @@ export class PegasusUtility {
this.defenderStore = {} this.defenderStore = {}
this.diceList = []; this.diceList = [];
this.diceFoundryList = []; this.diceFoundryList = [];
this.optionsDiceList = ""; this.optionsDiceList = ""
this.buildDiceLists(); this.lastRoleEffectProcess = Date.now()
PegasusCommands.init(); this.buildDiceLists()
PegasusCommands.init()
Handlebars.registerHelper('count', function (list) { Handlebars.registerHelper('count', function (list) {
return (list) ? list.length : 0; return (list) ? list.length : 0;
@ -59,6 +61,16 @@ export class PegasusUtility {
Handlebars.registerHelper('mul', function (a, b) { Handlebars.registerHelper('mul', function (a, b) {
return parseInt(a) * parseInt(b); return parseInt(a) * parseInt(b);
}) })
Handlebars.registerHelper('add', function (a, b) {
return parseInt(a) + parseInt(b);
});
Handlebars.registerHelper('sub', function (a, b) {
return parseInt(a) - parseInt(b);
})
Handlebars.registerHelper('getDice', function (a) {
return PegasusUtility.getDiceFromLevel(a)
})
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -102,7 +114,7 @@ export class PegasusUtility {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static getRangeText( rangeKey) { static getRangeText(rangeKey) {
return __rangeKeyToText[rangeKey] || "N/A" return __rangeKeyToText[rangeKey] || "N/A"
} }
@ -134,8 +146,11 @@ export class PegasusUtility {
static updateEffectsBonusDice(rollData) { static updateEffectsBonusDice(rollData) {
let newDicePool = rollData.dicePool.filter(dice => dice.name != "effect-bonus-dice") let newDicePool = rollData.dicePool.filter(dice => dice.name != "effect-bonus-dice")
for (let effect of rollData.effectsList) { for (let effect of rollData.effectsList) {
if (effect && effect.applied && effect.type == "effect" && effect.effect.system.bonusdice) { if (effect && effect.applied && effect.type == "effect" && !effect.effect?.system?.hindrance && effect.effect && effect.effect.system.bonusdice) {
newDicePool = newDicePool.concat( this.buildDicePool("effect-bonus-dice", effect.effect.system.effectlevel, 0, effect.effect.name )) newDicePool = newDicePool.concat(this.buildDicePool("effect-bonus-dice", effect.effect.system.effectlevel, 0, effect.effect.name))
}
if (effect && effect.applied && effect.type == "effect" && effect.value && effect.isdynamic && !effect.effect?.system?.hindrance) {
newDicePool = newDicePool.concat(this.buildDicePool("effect-bonus-dice", effect.value, 0, effect.name))
} }
} }
rollData.dicePool = newDicePool rollData.dicePool = newDicePool
@ -146,7 +161,9 @@ export class PegasusUtility {
let newDicePool = rollData.dicePool.filter(dice => dice.name != "effect-hindrance") let newDicePool = rollData.dicePool.filter(dice => dice.name != "effect-hindrance")
for (let hindrance of rollData.effectsList) { for (let hindrance of rollData.effectsList) {
if (hindrance && hindrance.applied && (hindrance.type == "hindrance" || (hindrance.type == "effect" && hindrance.effect?.system?.hindrance))) { if (hindrance && hindrance.applied && (hindrance.type == "hindrance" || (hindrance.type == "effect" && hindrance.effect?.system?.hindrance))) {
newDicePool = newDicePool.concat( this.buildDicePool("effect-hindrance", (hindrance.value) ? hindrance.value : hindrance.effect.system.effectlevel, 0, hindrance.name )) console.log("Adding Hindrance 1", hindrance, newDicePool)
newDicePool = newDicePool.concat(this.buildDicePool("effect-hindrance", (hindrance.value) ? hindrance.value : hindrance.effect.system.effectlevel, 0, hindrance.name))
console.log("Adding Hindrance 2", newDicePool)
} }
} }
rollData.dicePool = newDicePool rollData.dicePool = newDicePool
@ -157,15 +174,16 @@ export class PegasusUtility {
let newDicePool = rollData.dicePool.filter(dice => dice.name != "armor-shield") let newDicePool = rollData.dicePool.filter(dice => dice.name != "armor-shield")
for (let armor of rollData.armorsList) { for (let armor of rollData.armorsList) {
if (armor.applied) { if (armor.applied) {
newDicePool = newDicePool.concat( this.buildDicePool("armor-shield", armor.value, 0)) newDicePool = newDicePool.concat(this.buildDicePool("armor-shield", armor.value, 0))
} }
} }
newDicePool = rollData.dicePool.filter(dice => dice.name != "vehicle-shield") newDicePool = newDicePool.filter(dice => dice.name != "vehicle-shield")
for (let shield of rollData.vehicleShieldList) { for (let shield of rollData.vehicleShieldList) {
if (shield.applied) { if (shield.applied) {
newDicePool = newDicePool.concat( this.buildDicePool("vehicle-shield", shield.value, 0)) newDicePool = newDicePool.concat(this.buildDicePool("vehicle-shield", shield.value, 0))
} }
} }
console.log(">>>>Dicepoool", newDicePool)
rollData.dicePool = newDicePool rollData.dicePool = newDicePool
} }
@ -176,17 +194,17 @@ export class PegasusUtility {
let newDicePool = rollData.dicePool.filter(dice => dice.name != "damage") let newDicePool = rollData.dicePool.filter(dice => dice.name != "damage")
for (let weapon of rollData.weaponsList) { for (let weapon of rollData.weaponsList) {
if (weapon.applied && weapon.type == "damage") { if (weapon.applied && weapon.type == "damage") {
newDicePool = newDicePool.concat( this.buildDicePool("damage", weapon.value, 0)) newDicePool = newDicePool.concat(this.buildDicePool("damage", weapon.value, 0))
} }
} }
for (let weapon of rollData.vehicleWeapons) { for (let weapon of rollData.vehicleWeapons) {
if (weapon.applied) { if (weapon.applied) {
newDicePool = newDicePool.concat( this.buildDicePool("damage", weapon.value, 0)) newDicePool = newDicePool.concat(this.buildDicePool("damage", weapon.value, 0))
} }
} }
rollData.dicePool = newDicePool rollData.dicePool = newDicePool
} }
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -194,13 +212,13 @@ export class PegasusUtility {
let newDicePool = rollData.dicePool.filter(dice => dice.name != "stat") let newDicePool = rollData.dicePool.filter(dice => dice.name != "stat")
let statDice = rollData.dicePool.find(dice => dice.name == "stat") let statDice = rollData.dicePool.find(dice => dice.name == "stat")
if (statDice.level > 0) { if (statDice.level > 0) {
newDicePool = newDicePool.concat( this.buildDicePool( "stat", rollData.statDicesLevel, statDice.mod)) newDicePool = newDicePool.concat(this.buildDicePool("stat", rollData.statDicesLevel, statDice.mod))
} }
if (rollData.vehicleStat) { if (rollData.vehicleStat) {
newDicePool = rollData.dicePool.filter(dice => dice.name != "vehiclestat") newDicePool = rollData.dicePool.filter(dice => dice.name != "vehiclestat")
if (rollData.vehicleStat.currentlevel > 0 ) { if (rollData.vehicleStat.currentlevel > 0) {
newDicePool = newDicePool.concat( this.buildDicePool( "vehiclestat", rollData.vehicleStat.currentlevel, 0)) newDicePool = newDicePool.concat(this.buildDicePool("vehiclestat", rollData.vehicleStat.currentlevel, 0))
} }
rollData.dicePool = newDicePool rollData.dicePool = newDicePool
} }
@ -210,7 +228,7 @@ export class PegasusUtility {
static updateSpecDicePool(rollData) { static updateSpecDicePool(rollData) {
let newDicePool = rollData.dicePool.filter(dice => dice.name != "spec") let newDicePool = rollData.dicePool.filter(dice => dice.name != "spec")
if (rollData.specDicesLevel > 0) { if (rollData.specDicesLevel > 0) {
newDicePool = newDicePool.concat( this.buildDicePool( "spec", rollData.specDicesLevel, 0)) newDicePool = newDicePool.concat(this.buildDicePool("spec", rollData.specDicesLevel, 0))
} }
rollData.dicePool = newDicePool rollData.dicePool = newDicePool
} }
@ -254,10 +272,15 @@ export class PegasusUtility {
static async ready() { static async ready() {
const specs = await PegasusUtility.loadCompendium("fvtt-pegasus-rpg.specialisations"); const specs = await PegasusUtility.loadCompendium("fvtt-pegasus-rpg.specialisations");
this.specs = specs.map(i => i.toObject()); this.specs = specs.map(i => i.toObject());
if (game.user.isGM) {
Hooks.on('sightRefresh', (app, html, data) => PegasusUtility.refreshSightForEffect(app, html, data))
}
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static async addItemDropToActor(actor, item) { static async addItemDropToActor(actor, item) {
console.log("ITEM DROPPED", actor, item)
actor.preprocessItem("none", item, false) actor.preprocessItem("none", item, false)
let chatData = { let chatData = {
user: game.user.id, user: game.user.id,
@ -281,11 +304,16 @@ export class PegasusUtility {
for (let token of tokensList) { for (let token of tokensList) {
if (x >= token.x && x <= (token.x + token.width) if (x >= token.x && x <= (token.x + token.width)
&& y >= token.y && y <= (token.y + token.height)) { && y >= token.y && y <= (token.y + token.height)) {
let item = await this.searchItem(data) const item = fromUuidSync(data.uuid)
if (item == undefined) {
item = this.actor.items.get(data.uuid)
}
let itemFull = await PegasusUtility.searchItem(item)
//console.log("DROPPED DATA", data.uuid)
if (game.user.isGM || token.actor.isOwner) { if (game.user.isGM || token.actor.isOwner) {
this.addItemDropToActor(token.actor, item) this.addItemDropToActor(token.actor, itemFull)
} else { } else {
game.socket.emit("system.fvtt-pegasus-rpg", { name: "msg_gm_item_drop", data: { actorId: token.actor.id, itemId: item.id, isPack: item.pack } }) game.socket.emit("system.fvtt-pegasus-rpg", { name: "msg_gm_item_drop", data: { actorId: token.actor.id, itemId: itemFull.id, isPack: item.pack } })
} }
return return
} }
@ -554,6 +582,21 @@ export class PegasusUtility {
return undefined; return undefined;
} }
/* -------------------------------------------- */
static computeDistance() {
let mytarget = game.user.targets.first()
console.log("target", mytarget, mytarget)
let mytoken = _token
if (mytarget) {
let dist = canvas.grid.measureDistances(
[{ ray: new Ray(mytoken.center, mytarget.center) }],
{ gridSpaces: true });
console.log("DIST", dist)
} else {
console.log("NO TARGET")
}
}
/* -------------------------------------------- */ /* -------------------------------------------- */
static getDefenseState(actorId) { static getDefenseState(actorId) {
return this.defenderStore[actorId]; return this.defenderStore[actorId];
@ -795,10 +838,13 @@ export class PegasusUtility {
combat.updateEmbeddedDocuments("Combatant", [{ _id: rollData.combatantId, initiative: rollData.finalScore }]) combat.updateEmbeddedDocuments("Combatant", [{ _id: rollData.combatantId, initiative: rollData.finalScore }])
} }
// Stun specific -> Suffere a stun level when dmg-res // Stun specific -> Suffer a stun level when dmg-res for character
if (rollData.subKey && rollData.subKey == "dmg-res") { if (rollData.subKey && rollData.subKey == "dmg-res") {
actor.modifyStun(+1) actor.modifyStun(+1)
} }
if (rollData.isVehicleStun) {
actor.modifyVehicleStun(1)
}
//this.removeUsedPerkEffects( rollData) // Unused for now //this.removeUsedPerkEffects( rollData) // Unused for now
this.removeOneUseEffects(rollData) // Unused for now this.removeOneUseEffects(rollData) // Unused for now
@ -899,7 +945,7 @@ export class PegasusUtility {
let item let item
if (dataItem.pack) { if (dataItem.pack) {
let id = dataItem.id || dataItem._id let id = dataItem.id || dataItem._id
let items = await this.loadCompendium( dataItem.pack, item => item.id == id) let items = await this.loadCompendium(dataItem.pack, item => item.id == id)
//console.log(">>>>>> PACK", items) //console.log(">>>>>> PACK", items)
item = items[0] || undefined item = items[0] || undefined
//item = await fromUuid(dataItem.pack + "." + id) //item = await fromUuid(dataItem.pack + "." + id)
@ -981,11 +1027,16 @@ export class PegasusUtility {
static updateWithTarget(rollData) { static updateWithTarget(rollData) {
let target = PegasusUtility.getTarget() let target = PegasusUtility.getTarget()
if (target) { if (target) {
console.log("TARGET ", target)
let defenderActor = target.actor let defenderActor = target.actor
rollData.defenderTokenId = target.id rollData.defenderTokenId = target.id
rollData.defenderSize = 0
if ( defenderActor.type == "character") {
rollData.defenderSize = Number(defenderActor.system.biodata.sizenum) + Number(defenderActor.system.biodata.sizebonus)
} else if ( defenderActor.type == "vehicle" ){
rollData.defenderSize = Number(defenderActor.system.statistics.hr.size)
}
//rollData.attackerId = this.id //rollData.attackerId = this.id
console.log("DEFENDER", defenderActor) console.log("Target/DEFENDER", defenderActor)
defenderActor.addHindrancesList(rollData.effectsList) defenderActor.addHindrancesList(rollData.effectsList)
} }
} }
@ -1023,4 +1074,217 @@ export class PegasusUtility {
d.render(true); d.render(true);
} }
/* -------------------------------------------- */
static checkIsVehicleCrew(actorId) {
let vehicles = game.actors.filter( actor=> actor.type == "vehicle") || []
for(let vehicle of vehicles) {
console.log("Checking", vehicle.name)
if ( vehicle.inCrew(actorId) ) {
return vehicle
}
}
return false
}
/* -------------------------------------------- */
static async getRelevantTokens() {
if (!_token) { return }
let tokens = canvas.tokens.placeables.filter(token => token.document.disposition == 1)
for (let token of tokens) {
console.log("Parsing tokens", token.name)
let dist = canvas.grid.measureDistances(
[{ ray: new Ray(_token.center, token.center) }], { gridSpaces: false })
if (dist && dist[0] && dist[0] > 0) {
console.log(" Friendly Tokens at : ", token.name, dist / canvas.grid.grid.options.dimensions.distance)
}
let visible = canvas.effects.visibility.testVisibility(token.center, { object: _token })
if (visible && dist[0] > 0) {
this.glowToken(token)
}
console.log(" Visible!", visible)
}
}
/* -------------------------------------------- */
static async processTactician() {
// Tactician management
let toApply = {}
let tacticianTokens = canvas.tokens.placeables.filter(token => token.actor.isTactician() && !token.document.hidden)
for (let token of tacticianTokens) {
token.refresh()
let friends = canvas.tokens.placeables.filter(newToken => newToken.actor.type == "character" && !newToken.document.hidden && newToken.document.disposition == token.document.disposition)
for (let friend of friends) {
if (friend.actor.id != token.actor.id) {
let existing = toApply[friend.actor.id] || { actor: friend.actor, add: false, level: 0, names: [] }
let visible = canvas.effects.visibility.testVisibility(friend.center, { object: token })
console.log("parse visible TACTICIAN : ", visible, token.name, friend.name)
if (visible) {
existing.add = true
existing.level += token.actor.getRoleLevel()
existing.names.push(token.actor.name)
}
toApply[friend.actor.id] = existing
}
}
}
for (let id in toApply) {
let applyDef = toApply[id]
let hasBonus = applyDef.actor.hasTacticianBonus()
if (applyDef.add) {
if (!hasBonus) {
applyDef.actor.addTacticianEffect(applyDef.names.toString(), applyDef.level)
} else if (applyDef.level != hasBonus.system.effectlevel) {
await applyDef.actor.removeTacticianEffect()
applyDef.actor.addTacticianEffect(applyDef.names.toString(), applyDef.level)
}
} else if (hasBonus) {
applyDef.actor.removeTacticianEffect()
}
}
//Delete all effects if no more tacticians (ie deleted case)
if (tacticianTokens.length == 0) {
let allTokens = canvas.tokens.placeables.filter(token => token.actor.type == "character")
for (let token of allTokens) {
if (token.actor.hasTacticianBonus()) {
token.actor.removeTacticianEffect()
}
}
}
}
/* -------------------------------------------- */
static async processEnhancer() {
// Enhancer management
let toApply = {}
let enhancerTokens = canvas.tokens.placeables.filter(token => token.actor.isEnhancer() && !token.document.hidden)
for (let token of enhancerTokens) {
token.refresh()
let friends = canvas.tokens.placeables.filter(newToken => newToken.actor.type == "character" && !newToken.document.hidden && newToken.document.disposition == token.document.disposition)
for (let friend of friends) {
if (friend.actor.id != token.actor.id) {
let existing = toApply[friend.actor.id] || { actor: friend.actor, add: false, level: 0, names: [] }
let visible = canvas.effects.visibility.testVisibility(friend.center, { object: token })
console.log("parse visible ENHANCER: ", visible, token.name, friend.name)
if (visible) {
let dist = canvas.grid.measureDistances([{ ray: new Ray(token.center, friend.center) }], { gridSpaces: false })
if (dist && dist[0] && (dist[0] / canvas.grid.grid.options.dimensions.distance) <= 5) {
existing.add = true
existing.level += token.actor.getRoleLevel()
existing.names.push(token.actor.name)
}
}
toApply[friend.actor.id] = existing
}
}
}
for (let id in toApply) {
let applyDef = toApply[id]
let hasBonus = applyDef.actor.hasEnhancerBonus()
if (applyDef.add) {
if (!hasBonus) {
applyDef.actor.addEnhancerEffect(applyDef.names.toString(), applyDef.level)
} else if (applyDef.level != hasBonus.system.effectlevel) {
await applyDef.actor.removeEnhancerEffect()
applyDef.actor.addEnhancerEffect(applyDef.names.toString(), applyDef.level)
}
} else if (hasBonus) {
applyDef.actor.removeEnhancerEffect()
}
}
// Delete all effects if no more tacticians (ie deleted case)
if (enhancerTokens.length == 0) {
let allTokens = canvas.tokens.placeables.filter(token => token.actor.type == "character")
for (let token of allTokens) {
if (token.actor.hasEnhancerBonus()) {
token.actor.removeEnhancerEffect()
}
}
}
}
/* -------------------------------------------- */
static async processAgitator() {
// Agitator management
let toApply = {}
let agitatorTokens = canvas.tokens.placeables.filter(token => token.actor.isAgitator() && !token.document.hidden)
for (let token of agitatorTokens) {
token.refresh()
if (token.document.disposition == 0) {
continue
}
let ennemies = []
if (token.document.disposition == -1) {
ennemies = canvas.tokens.placeables.filter(newToken => newToken.actor.type == "character" && !newToken.document.hidden && (newToken.document.disposition == 1 || newToken.document.disposition == 0 ))
}
if (token.document.disposition == 1) {
ennemies = canvas.tokens.placeables.filter(newToken => newToken.actor.type == "character" && !newToken.document.hidden && (newToken.document.disposition == -1 || newToken.document.disposition == 0 ))
}
if (token.document.disposition == 0) {
ennemies = canvas.tokens.placeables.filter(newToken => newToken.actor.type == "character" && !newToken.document.hidden && (newToken.document.disposition == -1 || newToken.document.disposition == 1 ))
}
for (let ennemy of ennemies) {
if (ennemy.actor.id != token.actor.id) {
let existing = toApply[ennemy.actor.id] || { actor: ennemy.actor, add: false, level: 0, names: [] }
let visible = canvas.effects.visibility.testVisibility(ennemy.center, { object: token })
if (visible) {
let dist = canvas.grid.measureDistances([{ ray: new Ray(token.center, ennemy.center) }], { gridSpaces: false })
if (dist && dist[0] && (dist[0] / canvas.grid.grid.options.dimensions.distance) <= 5) {
existing.add = true
existing.level += token.actor.getRoleLevel()
existing.names.push(token.actor.name)
}
}
toApply[ennemy.actor.id] = existing
}
}
}
for (let id in toApply) {
let applyDef = toApply[id]
let hasHindrance = applyDef.actor.hasAgitatorHindrance()
if (applyDef.add) {
if (!hasHindrance) {
applyDef.actor.addAgitatorHindrance(applyDef.names.toString(), applyDef.level)
} else if (applyDef.level != hasHindrance.system.effectlevel) {
await applyDef.actor.removeAgitatorHindrance()
applyDef.actor.addAgitatorHindrance(applyDef.names.toString(), applyDef.level)
}
} else if (hasHindrance) {
applyDef.actor.removeAgitatorHindrance()
}
}
// Delete all effects if no more agtators (ie deleted case)
if (agitatorTokens.length == 0) {
let allTokens = canvas.tokens.placeables.filter(token => token.actor.type == "character")
for (let token of allTokens) {
if (token.actor.hasAgitatorHindrance()) {
token.actor.removeAgitatorHindrance()
}
}
}
}
/* -------------------------------------------- */
static async processRoleEffects() {
// Small optimization
let now = Date.now()
if (now - this.lastRoleEffectProcess < 300) {
return // Save some processing
}
this.lastRoleEffectProcess = now
console.log("=========================+> Searching/Processing roles effects")
await this.processTactician()
await this.processEnhancer()
await this.processAgitator()
}
/* -------------------------------------------- */
static async refreshSightForEffect() {
setTimeout(500, this.processRoleEffects())
}
} }

View File

@ -227,6 +227,9 @@ export class PegasusVehicleSheet extends ActorSheet {
if ( statKey == "man") { if ( statKey == "man") {
this.actor.setTurningArc(event.currentTarget.value) this.actor.setTurningArc(event.currentTarget.value)
} }
if ( statKey == "pc") {
this.actor.updateMaxNrg(event.currentTarget.value)
}
}) })
html.find('.roll-stat').click((event) => { html.find('.roll-stat').click((event) => {

View File

@ -293,6 +293,12 @@ table {border: 1px solid #7a7971;}
padding: 0 3px; padding: 0 3px;
} }
.long-editor{
border: 2;
height: 400px;
padding: 0 3px;
}
.medium-editor { .medium-editor {
border: 2; border: 2;
height: 240px; height: 240px;
@ -613,6 +619,9 @@ ul, li {
flex-grow: 2; flex-grow: 2;
margin-left: 4px; margin-left: 4px;
} }
.select-stat {
max-width: 5rem;
}
.status-header-label { .status-header-label {
margin-left: 2px; margin-left: 2px;
} }

View File

@ -253,7 +253,7 @@
], ],
"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": "10.0.20", "version": "10.1.1",
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v10.0.20.zip", "download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v10.1.1.zip",
"background": "systems/fvtt-pegasus-rpg/images/ui/pegasus_welcome_page.webp" "background": "systems/fvtt-pegasus-rpg/images/ui/pegasus_welcome_page.webp"
} }

View File

@ -11,6 +11,7 @@
"age": 0, "age": 0,
"size": "", "size": "",
"sizenum": 0, "sizenum": 0,
"sizebonus": 0,
"weight": "", "weight": "",
"hair": "", "hair": "",
"sex": "", "sex": "",
@ -36,6 +37,7 @@
"rolename": "", "rolename": "",
"morality": 5, "morality": 5,
"bonusselection": "", "bonusselection": "",
"noautobonus": false,
"moralitythreshold": 0 "moralitythreshold": 0
} }
}, },
@ -49,6 +51,7 @@
"abbrev": "AGI", "abbrev": "AGI",
"level": 1, "level": 1,
"value": 1, "value": 1,
"bonuseffect": 0,
"mod": 0, "mod": 0,
"col": 1 "col": 1
}, },
@ -57,6 +60,7 @@
"abbrev": "MND", "abbrev": "MND",
"level": 1, "level": 1,
"value": 1, "value": 1,
"bonuseffect": 0,
"col": 1, "col": 1,
"mod": 0 "mod": 0
}, },
@ -65,6 +69,7 @@
"abbrev": "SOC", "abbrev": "SOC",
"level": 1, "level": 1,
"value": 1, "value": 1,
"bonuseffect": 0,
"col": 1, "col": 1,
"mod": 0 "mod": 0
}, },
@ -73,6 +78,7 @@
"abbrev": "STR", "abbrev": "STR",
"level": 1, "level": 1,
"value": 1, "value": 1,
"bonuseffect": 0,
"col": 1, "col": 1,
"mod": 0 "mod": 0
}, },
@ -81,6 +87,7 @@
"abbrev": "PHY", "abbrev": "PHY",
"level": 1, "level": 1,
"value": 1, "value": 1,
"bonuseffect": 0,
"col": 1, "col": 1,
"mod": 0 "mod": 0
}, },
@ -89,6 +96,7 @@
"abbrev": "COM", "abbrev": "COM",
"level": 1, "level": 1,
"value": 1, "value": 1,
"bonuseffect": 0,
"col": 2, "col": 2,
"mod": 0 "mod": 0
}, },
@ -97,6 +105,7 @@
"abbrev": "DEF", "abbrev": "DEF",
"level": 1, "level": 1,
"value": 1, "value": 1,
"bonuseffect": 0,
"col": 2, "col": 2,
"mod": 0 "mod": 0
}, },
@ -105,6 +114,7 @@
"abbrev": "STL", "abbrev": "STL",
"level": 1, "level": 1,
"value": 1, "value": 1,
"bonuseffect": 0,
"col": 2, "col": 2,
"mod": 0 "mod": 0
}, },
@ -113,6 +123,7 @@
"abbrev": "PER", "abbrev": "PER",
"level": 1, "level": 1,
"value": 1, "value": 1,
"bonuseffect": 0,
"col": 2, "col": 2,
"mod": 0 "mod": 0
}, },
@ -121,6 +132,7 @@
"abbrev": "FOC", "abbrev": "FOC",
"level": 1, "level": 1,
"value": 1, "value": 1,
"bonuseffect": 0,
"col": 2, "col": 2,
"mod": 0 "mod": 0
} }
@ -143,6 +155,7 @@
"label": "MR (Initiative)", "label": "MR (Initiative)",
"type": "dice", "type": "dice",
"value": 0, "value": 0,
"bonuseffect": 0,
"mod": 0 "mod": 0
}, },
"momentum": { "momentum": {
@ -208,6 +221,7 @@
"label": "FC", "label": "FC",
"abbrev": "fc", "abbrev": "fc",
"level": 0, "level": 0,
"bonuseffect": 0,
"currentlevel": 0, "currentlevel": 0,
"col": 1 "col": 1
}, },
@ -216,6 +230,7 @@
"abbrev": "man", "abbrev": "man",
"dicevalue": "", "dicevalue": "",
"level": 0, "level": 0,
"bonuseffect": 0,
"currentlevel": 0, "currentlevel": 0,
"turningarc45": 0, "turningarc45": 0,
"col": 1 "col": 1
@ -224,6 +239,7 @@
"label": "HR", "label": "HR",
"abbrev": "hr", "abbrev": "hr",
"level": 0, "level": 0,
"bonuseffect": 0,
"currentlevel": 0, "currentlevel": 0,
"size": 0, "size": 0,
"col": 2 "col": 2
@ -232,6 +248,7 @@
"label": "PC", "label": "PC",
"abbrev": "pc", "abbrev": "pc",
"level": 0, "level": 0,
"bonuseffect": 0,
"currentlevel": 0, "currentlevel": 0,
"actnrg": 0, "actnrg": 0,
"curnrg": 0, "curnrg": 0,
@ -242,6 +259,7 @@
"label": "MR", "label": "MR",
"abbrev": "mr", "abbrev": "mr",
"level": 0, "level": 0,
"bonuseffect": 0,
"currentlevel": 0, "currentlevel": 0,
"col": 3 "col": 3
}, },
@ -249,6 +267,7 @@
"label": "A/D", "label": "A/D",
"abbrev": "ad", "abbrev": "ad",
"level": 0, "level": 0,
"bonuseffect": 0,
"currentlevel": 0, "currentlevel": 0,
"accmode": "", "accmode": "",
"currentspeed": "", "currentspeed": "",
@ -385,6 +404,7 @@
"recoveryrollspec": [], "recoveryrollspec": [],
"effectstatlevel": false, "effectstatlevel": false,
"effectstat": "", "effectstat": "",
"affectsize": false,
"oneuse": false, "oneuse": false,
"ignorehealthpenalty": false, "ignorehealthpenalty": false,
"isthispossible": "", "isthispossible": "",
@ -394,6 +414,9 @@
"physicalimmunity": false, "physicalimmunity": false,
"nobonusdice": false, "nobonusdice": false,
"noperksallowed": false, "noperksallowed": false,
"affectstatus": false,
"affectedstatus": "",
"locked": false,
"description": "" "description": ""
}, },
"race": { "race": {
@ -425,7 +448,8 @@
"specincrease": [], "specincrease": [],
"perks": [], "perks": [],
"perksrole": "", "perksrole": "",
"description": "" "description": "",
"rolelevel": 1
}, },
"ability": { "ability": {
"affectedstat": "str", "affectedstat": "str",
@ -548,6 +572,8 @@
"activatedtext": "", "activatedtext": "",
"deactivatedtext": "", "deactivatedtext": "",
"powerlevelcost": "", "powerlevelcost": "",
"powerdamagetype": "",
"powerdamagetypelevel": 0,
"dmgroll": false, "dmgroll": false,
"dmgstatistic": "", "dmgstatistic": "",
"description": "" "description": ""

View File

@ -302,18 +302,30 @@
</li> </li>
{{#each effects as |effect key|}} {{#each effects as |effect key|}}
<li class="item stat flexrow list-item list-item-shadow" data-arme-id="{{effect.id}}" <li class="item stat flexrow list-item list-item-shadow" data-arme-id="{{effect.id}}" data-item-id="{{effect._id}}">
data-item-id="{{effect._id}}"> {{#if effect.system.locked}}
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img" {{#if @root.isGM}}
src="{{effect.img}}" /></a> <a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img" src="{{effect.img}}" /></a>
{{else}}
<img class="sheet-competence-img" src="{{effect.img}}" />
{{/if}}
{{else}}
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img" src="{{effect.img}}" /></a>
{{/if}}
<span class="item-name-label-long2">{{effect.name}}</span> <span class="item-name-label-long2">{{effect.name}}</span>
<span class="item-field-label-short">{{effect.system.effectlevel}}</span> <span class="item-field-label-short">{{effect.system.effectlevel}}</span>
<span class="item-field-label-short">{{upperFirst effect.system.type}}</span> <span class="item-field-label-short">{{upperFirst effect.system.type}}</span>
<span class="item-field-label-short">{{upperFirst effect.datsystema.genre}}</span> <span class="item-field-label-short">{{upperFirst effect.system.genre}}</span>
<span class="item-field-label-short">{{upper effect.system.stataffected}}</span> <span class="item-field-label-short">{{upper effect.system.stataffected}}</span>
<div class="item-filler">&nbsp;</div> <div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed"> <div class="item-controls item-controls-fixed">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a> {{#if effect.system.locked}}
{{#if @root.isGM}}
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
{{/if}}
{{else}}
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
{{/if}}
</div> </div>
</li> </li>
{{/each}} {{/each}}
@ -857,6 +869,12 @@
<label class="generic-label">Hair</label> <label class="generic-label">Hair</label>
<input type="text" class="" name="system.biodata.hair" value="{{data.biodata.hair}}" data-dtype="String" /> <input type="text" class="" name="system.biodata.hair" value="{{data.biodata.hair}}" data-dtype="String" />
</li> </li>
{{#if isGM}}
<li class="item flexrow">
<label class="generic-label">Manual bonuses only ?</label>
<input type="checkbox" class="change-worstfear" name="system.biodata.noautobonus" {{checked data.biodata.noautobonus}} />
</li>
{{/if}}
</ul> </ul>
</div> </div>
<div> <div>
@ -865,6 +883,8 @@
<label class="generic-label">Size</label> <label class="generic-label">Size</label>
<input type="text" class="" name="system.biodata.sizenum" value="{{data.biodata.sizenum}}" <input type="text" class="" name="system.biodata.sizenum" value="{{data.biodata.sizenum}}"
data-dtype="Number" /> data-dtype="Number" />
<input type="text" class="" value="{{add data.biodata.sizenum data.biodata.sizebonus}}"
data-dtype="Number" disabled />
</li> </li>
<li class="flexrow item"> <li class="flexrow item">
<label class="generic-label">Origin</label> <label class="generic-label">Origin</label>

View File

@ -45,6 +45,10 @@
{{/if}} {{/if}}
{{/if}} {{/if}}
{{#if power}}
<li>Power Damage type : {{power.system.powerdamagetype}} {{power.system.powerdamagetypelevel}}</li>
{{/if}}
{{#if isResistance}} {{#if isResistance}}
<li><strong>Defense Result : {{finalScore}}</strong> <li><strong>Defense Result : {{finalScore}}</strong>
{{else}} {{else}}

View File

@ -5,8 +5,8 @@
{{/if}} {{/if}}
<div>{{name}} has just activated the Perk: {{perk.name}}.</div> <div>{{name}} has just activated the Perk: {{perk.name}}.</div>
{{#if (count perk.data.activatedtext)}} {{#if (count perk.system.activatedtext)}}
<div>{{perk.data.activatedtext}}</div> <div>{{perk.system.activatedtext}}</div>
{{/if}} {{/if}}
</div> </div>

View File

@ -5,8 +5,8 @@
{{/if}} {{/if}}
<div>{{name}} has just deactivated the Perk: {{perk.name}}, make sure to manually delete all Effects provided by this Perk from Targets.</div> <div>{{name}} has just deactivated the Perk: {{perk.name}}, make sure to manually delete all Effects provided by this Perk from Targets.</div>
{{#if (count perk.data.deactivatedtext)}} {{#if (count perk.system.deactivatedtext)}}
<div>{{perk.data.deactivatedtext}}</div> <div>{{perk.system.deactivatedtext}}</div>
{{/if}} {{/if}}
</div> </div>

View File

@ -34,6 +34,27 @@
</select> </select>
</li> </li>
<li class="flexrow"><label class="generic-label">Effect Level is a Stat?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.effectstatlevel" {{checked data.effectstatlevel}}/></label>
</li>
{{#if data.effectstatlevel}}
<li class="flexrow"><label class="generic-label">Stat to use for Effect Level</label>
<select class="competence-base flexrow" type="text" name="system.effectstat" value="{{data.effectstat}}" data-dtype="String">
{{#select data.effectstat}}
{{> systems/fvtt-pegasus-rpg/templates/partial-options-statistics.html notapplicable=false mr=true all=false}}
{{/select}}
</select>
</li>
{{else}}
<li class="flexrow"><label class="generic-label">Effect Level</label>
<input type="text" class="input-numeric-short padd-right" name="system.effectlevel" value="{{data.effectlevel}}" data-dtype="Number"/>
</li>
<li class="flexrow"><label class="generic-label">Affect size ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.affectsize" {{checked data.affectsize}}/></label>
</li>
{{/if}}
<li class="flexrow"><label class="generic-label">One use?</label> <li class="flexrow"><label class="generic-label">One use?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.oneuse" {{checked data.oneuse}}/></label> <label class="attribute-value checkbox"><input type="checkbox" name="system.oneuse" {{checked data.oneuse}}/></label>
</li> </li>
@ -61,25 +82,27 @@
<li class="flexrow"><label class="generic-label">No perks allowed ?</label> <li class="flexrow"><label class="generic-label">No perks allowed ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.noperksallowed" {{checked data.noperksallowed}}/></label> <label class="attribute-value checkbox"><input type="checkbox" name="system.noperksallowed" {{checked data.noperksallowed}}/></label>
</li> </li>
<li class="flexrow"><label class="generic-label">Locked (Only GM can change/edit) ?</label>
<li class="flexrow"><label class="generic-label">Effect Level is a Stat?</label> <label class="attribute-value checkbox"><input type="checkbox" name="system.locked" {{checked data.locked}}/></label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.effectstatlevel" {{checked data.effectstatlevel}}/></label>
</li> </li>
{{#if data.effectstatlevel}} <li class="flexrow"><label class="generic-label">Affect Status?</label>
<li class="flexrow"><label class="generic-label">Stat to use for Effect Level</label> <label class="attribute-value checkbox"><input type="checkbox" name="system.affectstatus" {{checked data.affectstatus}}/></label>
<select class="competence-base flexrow" type="text" name="system.effectstat" value="{{data.effectstat}}" data-dtype="String"> </li>
{{#select data.effectstat}} {{#if data.affectstatus}}
{{> systems/fvtt-pegasus-rpg/templates/partial-options-statistics.html notapplicable=false mr=true all=false}} <li class="flexrow"><label class="generic-label">Affected status</label>
<select class="competence-base flexrow" type="text" name="system.affectedstatus" value="{{data.affectedstatus}}" data-dtype="String">
{{#select data.affectedstatus}}
<option value="health">Health</option>
<option value="delirium">Delirium</option>
<option value="socialhealth">Social Health</option>
<option value="stealthhealth">Stealth Health</option>
<option value="nrg">NRG</option>
{{/select}} {{/select}}
</select> </select>
</li> </li>
{{else}}
<li class="flexrow"><label class="generic-label">Effect Level</label>
<input type="text" class="input-numeric-short padd-right" name="system.effectlevel" value="{{data.effectlevel}}" data-dtype="Number"/>
</li>
{{/if}} {{/if}}
<li class="flexrow"> <label class="generic-label">Affected Specialisations </label></li> <li class="flexrow"> <label class="generic-label">Affected Specialisations </label></li>
<li class="flexrow"> <li class="flexrow">
<ul class="ul-level1"> <ul class="ul-level1">

View File

@ -13,25 +13,29 @@
<div class="tab description" data-group="primary" data-tab="description"> <div class="tab description" data-group="primary" data-tab="description">
<div class="medium-editor item-text-long-line"> <div class="medium-editor item-text-long-line">
<label class="generic-label">Description</label> <label class="generic-label"><strong>Power Ups</strong></label>
{{editor description target="system.description" button=true owner=owner editable=editable}}
</div>
<div class="medium-editor item-text-long-line">
<label class="generic-label">Available Effects</label>
{{editor effects target="system.effects" button=true owner=owner editable=editable}}
</div>
<div class="medium-editor item-text-long-line">
<label class="generic-label">Purchased Effects</label>
{{editor purchasedeffects target="system.purchasedeffects" button=true owner=owner {{editor purchasedeffects target="system.purchasedeffects" button=true owner=owner
editable=editable}} editable=editable}}
</div> </div>
<span><label>&nbsp;</label></span>
<hr>
<div class="long-editor item-text-long-line">
<label class="generic-label"><strong>Description</strong></label>
{{editor description target="system.description" button=true owner=owner editable=editable}}
</div>
<span><label>&nbsp;</label></span>
<hr>
<div class="medium-editor item-text-long-line">
<label class="generic-label"><strong>Available Upgrades</strong></label>
{{editor effects target="system.effects" button=true owner=owner editable=editable}}
</div>
</div> </div>
<div class="tab details" data-group="primary" data-tab="details"> <div class="tab details" data-group="primary" data-tab="details">
<ul> <ul>
<li class="flexrow"><label class="generic-label">Roll Needed ?</label> <li class="flexrow"><label class="generic-label">Roll Needed ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.rollneeded" {{checked <label class="attribute-value checkbox">
data.rollneeded}} /></label> <input type="checkbox" name="system.rollneeded" {{checked data.rollneeded}} /></label>
</li> </li>
{{#if data.rollneeded}} {{#if data.rollneeded}}
<li class="flexrow"><label class="generic-label">Related Statistic (only if roll is needed)</label> <li class="flexrow"><label class="generic-label">Related Statistic (only if roll is needed)</label>
@ -104,14 +108,22 @@
data.dmgroll}} /></label> data.dmgroll}} /></label>
</li> </li>
{{#if data.dmgroll}} {{#if data.dmgroll}}
<li class="flexrow"><label class="generic-label">Related DMG Statistic </label> <li class="flexrow"><label class="generic-label">Related DMG Statistic </label>
<select class="competence-base flexrow" type="text" name="system.dmgstatistic" value="{{data.dmgstatistic}}" <select class="competence-base flexrow" type="text" name="system.dmgstatistic" value="{{data.dmgstatistic}}"
data-dtype="String"> data-dtype="String">
{{#select data.dmgstatistic}} {{#select data.dmgstatistic}}
{{> systems/fvtt-pegasus-rpg/templates/partial-options-statistics.html}} {{> systems/fvtt-pegasus-rpg/templates/partial-options-statistics.html}}
{{/select}} {{/select}}
</select> </select>
</li> </li>
<li class="flexrow"><label class="generic-label">Damage Type</label>
<input type="text" class="padd-right" name="system.powerdamagetype" value="{{data.powerdamagetype}}"
data-dtype="String" />
</li>
<li class="flexrow"><label class="generic-label">Damage Type Level</label>
<input type="text" class="padd-right" name="system.powerdamagetypelevel" value="{{data.powerdamagetypelevel}}"
data-dtype="Number" />
</li>
{{/if}} {{/if}}
<li class="flexrow"><label class="generic-label">When purchased display text</label> <li class="flexrow"><label class="generic-label">When purchased display text</label>

View File

@ -1,80 +1,92 @@
<form class="{{cssClass}}" autocomplete="off"> <form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header"> <header class="sheet-header">
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}"/> <img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}" />
<div class="header-fields"> <div class="header-fields">
<h1 class="charname"> <h1 class="charname">
<input name="name" type="text" value="{{name}}" placeholder="Name"/> <input name="name" type="text" value="{{name}}" placeholder="Name" />
</h1> </h1>
</div> </div>
</header> </header>
{{> systems/fvtt-pegasus-rpg/templates/partial-item-nav.html}} {{> systems/fvtt-pegasus-rpg/templates/partial-item-nav.html}}
{{!-- Sheet Body --}} {{!-- Sheet Body --}}
<section class="sheet-body"> <section class="sheet-body">
{{> systems/fvtt-pegasus-rpg/templates/partial-item-description.html}} {{> systems/fvtt-pegasus-rpg/templates/partial-item-description.html}}
<div class="tab details" data-group="primary" data-tab="details"> <div class="tab details" data-group="primary" data-tab="details">
<ul> <ul>
<li class="flexrow"><label class="generic-label">Stat increase 1</label> <li class="flexrow"><label class="generic-label">Role Level</label>
<select class="competence-base flexrow" type="text" name="system.statincrease1" value="{{data.statincrease1}}" data-dtype="String"> <input type="text" class="input-numeric-short padd-right" name="system.rolelevel" value="{{data.rolelevel}}"
{{#select data.statincrease1}} data-dtype="Number" />
{{> systems/fvtt-pegasus-rpg/templates/partial-options-statistics.html notapplicable=false mr=false}} </li>
{{/select}}
</select>
</li>
<li class="flexrow"><label class="generic-label">Stat increase 2</label>
<select class="competence-base flexrow" type="text" name="system.statincrease2" value="{{data.statincrease2}}" data-dtype="String">
{{#select data.statincrease2}}
{{> systems/fvtt-pegasus-rpg/templates/partial-options-statistics.html notapplicable=false mr=false}}
{{/select}}
</select>
</li>
<li class="flexrow"> <li class="flexrow"><label class="generic-label">Stat increase 1</label>
<label class="generic-label">Role Ability</label> <select class="competence-base flexrow" type="text" name="system.statincrease1" value="{{data.statincrease1}}"
</li> data-dtype="String">
<ul class="ul-level1"> {{#select data.statincrease1}}
<li class="flexrow"><div class="drop-specialability"><label>Drop Abilities here !</label></div> {{> systems/fvtt-pegasus-rpg/templates/partial-options-statistics.html notapplicable=false mr=false}}
</li> {{/select}}
{{#each data.specialability as |ability idx|}} </select>
<li class="flexrow"> </li>
<label name="system.specialability[{{idx}}].name"><a class="view-subitem" data-type="specialability" data-index="{{idx}}">{{ability.name}}</a></label> <li class="flexrow"><label class="generic-label">Stat increase 2</label>
<div class="item-controls padd-left"> <select class="competence-base flexrow" type="text" name="system.statincrease2" value="{{data.statincrease2}}"
<a class="item-control delete-subitem padd-left" data-type="specialability" data-index="{{idx}}" title="Delete Ability"><i class="fas fa-trash"></i></a> data-dtype="String">
</div> {{#select data.statincrease2}}
</li> {{> systems/fvtt-pegasus-rpg/templates/partial-options-statistics.html notapplicable=false mr=false}}
{{/each}} {{/select}}
</ul> </select>
</li>
<li class="flexrow">
<label class="generic-label">Role Ability</label>
</li>
<ul class="ul-level1">
<li class="flexrow">
<div class="drop-specialability"><label>Drop Abilities here !</label></div>
</li> </li>
<li class="flexrow"><label class="generic-label">Statistic increase (Choose 2 at +1 DT)</label> {{#each data.specialability as |ability idx|}}
</li> <li class="flexrow">
<ul class="ul-level1"> <label name="system.specialability[{{idx}}].name"><a class="view-subitem" data-type="specialability"
<li class="flexrow"> data-index="{{idx}}">{{ability.name}}</a></label>
{{#each data.statincreasechoice as |stat idx|}} <div class="item-controls padd-left">
<label name="statchoice{{idx}}">{{stat.name}}</label> <a class="item-control delete-subitem padd-left" data-type="specialability" data-index="{{idx}}"
<label class="attribute-value checkbox"><input type="checkbox" class="stat-choice-flag" data-stat-idx="{{idx}}" {{checked stat.flag}}/></label> title="Delete Ability"><i class="fas fa-trash"></i></a>
{{/each}} </div>
</li> </li>
</ul> {{/each}}
</li> </ul>
</li>
<li class="flexrow"><label class="generic-label">Statistic increase (Choose 2 at +1 DT)</label>
</li>
<ul class="ul-level1">
<li class="flexrow">
{{#each data.statincreasechoice as |stat idx|}}
<label name="statchoice{{idx}}">{{stat.name}}</label>
<label class="attribute-value checkbox"><input type="checkbox" class="stat-choice-flag"
data-stat-idx="{{idx}}" {{checked stat.flag}} /></label>
{{/each}}
</li>
</ul>
</li>
<li class="flexrow"><label class="generic-label">Role category for available perks</label> <li class="flexrow"><label class="generic-label">Role category for available perks</label>
<select class="competence-base flexrow" type="text" name="system.perksrole" value="{{data.perksrole}}" data-dtype="String"> <select class="competence-base flexrow" type="text" name="system.perksrole" value="{{data.perksrole}}"
{{#select data.perksrole}} data-dtype="String">
<option value="agitator">Agitator</option> {{#select data.perksrole}}
<option value="defender">Defender</option> <option value="agitator">Agitator</option>
<option value="enhancer">Enhancer</option> <option value="defender">Defender</option>
<option value="scrapper">Scrapper</option> <option value="enhancer">Enhancer</option>
<option value="ranged">Ranged</option> <option value="scrapper">Scrapper</option>
<option value="tactician">Tactician</option> <option value="ranged">Ranged</option>
{{/select}} <option value="tactician">Tactician</option>
</select> {{/select}}
</li> </select>
</li>
</ul> </ul>
</div> </div>
</section> </section>
</form> </form>

View File

@ -47,7 +47,7 @@
<li class="item flexrow list-item" data-item-id="{{trait.id}}"> <li class="item flexrow list-item" data-item-id="{{trait.id}}">
<img class="sheet-competence-img" src="{{trait.img}}"/> <img class="sheet-competence-img" src="{{trait.img}}"/>
<span class="competence-label">{{trait.name}}</span> <span class="competence-label">{{trait.name}}</span>
<span class="competence-label">{{trait.data.data.type}}</span> <span class="competence-label">{{trait.system.type}}</span>
<div class="item-controls"> <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-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> <a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
@ -103,17 +103,17 @@
<img class="sheet-competence-img" src="{{weapon.img}}"/> <img class="sheet-competence-img" src="{{weapon.img}}"/>
<span class="stat-label">{{weapon.name}}</span> <span class="stat-label">{{weapon.name}}</span>
<div class="item-controls"> <div class="item-controls">
<a class="item-control item-equip" title="Worn">{{#if weapon.data.data.equipped}}<i class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a> <a class="item-control item-equip" title="Worn">{{#if weapon.system.equipped}}<i class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a> <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> <a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div> </div>
</li> </li>
<li class="item stat flexrow list-item stats-table" data-armure-id="{{weapon.id}}" data-item-id="{{weapon.id}}"> <li class="item stat flexrow list-item stats-table" data-armure-id="{{weapon.id}}" data-item-id="{{weapon.id}}">
{{#each weapon.data.data.weaponstats as |weaponstat statkey|}} {{#each weapon.system.weaponstats as |weaponstat statkey|}}
<ul> <ul>
<li class="item stat flexrow list-item" data-item-id="{{weapon.id}}" data-stat-id={{statkey}}><span class="stat-label weapon-label"><a name="{{weapon.name}}">Attack with {{weaponstat.name}}</a></span> <li class="item stat flexrow list-item" data-item-id="{{weapon.id}}" data-stat-id={{statkey}}><span class="stat-label weapon-label"><a name="{{weapon.name}}">Attack with {{weaponstat.name}}</a></span>
</li> </li>
<li>{{> "systems/fvtt-fragged-kingdom/templates/weapon-stats-section.html" stats=weaponstat.data.statstotal isfinal=false header=true}} <li>{{> "systems/fvtt-fragged-kingdom/templates/weapon-stats-section.html" stats=weaponstat.system.statstotal isfinal=false header=true}}
</li> </li>
</ul> </ul>
{{/each}} {{/each}}
@ -151,7 +151,7 @@
<span class="equipement-label">{{equip.name}}</span> <span class="equipement-label">{{equip.name}}</span>
<span class="equipement-label">{{equip.type}}</span> <span class="equipement-label">{{equip.type}}</span>
<div class="item-controls"> <div class="item-controls">
<a class="item-control item-equip" title="Worn">{{#if equip.data.data.equipped}}<i class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a> <a class="item-control item-equip" title="Worn">{{#if equip.system.equipped}}<i class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a> <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> <a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div> </div>

View File

@ -24,7 +24,7 @@
{{/if}} {{/if}}
</span> </span>
<span class="item-field-label-short"> <span class="item-field-label-short">
{{#if equip.data.iscontainer}} {{#if equip.system.iscontainer}}
{{equip.system.contentsEnc}} {{equip.system.contentsEnc}}
{{else}} {{else}}
{{mul equip.system.weight equip.system.quantity}} {{mul equip.system.weight equip.system.quantity}}
@ -32,7 +32,7 @@
</span> </span>
<span class="item-field-label-medium"> <span class="item-field-label-medium">
{{#if equip.system.idrDice}} {{#if equip.system.idrDice}}
<a class="roll-idr" data-dice-value="{{equip.data.idrDice}}">{{equip.system.idrDice}}</a> <a class="roll-idr" data-dice-value="{{equip.system.idrDice}}">{{equip.system.idrDice}}</a>
{{else}} {{else}}
&nbsp;-&nbsp; &nbsp;-&nbsp;
{{/if}} {{/if}}

View File

@ -5,12 +5,15 @@
<span class="stat-label stat-margin" name="{{key}}"> <span class="stat-label stat-margin" name="{{key}}">
<h4 class="stat-text-white stat-margin"><a class="roll-stat stat-margin" data-stat-key="{{key}}">{{stat.abbrev}}</a></h4> <h4 class="stat-text-white stat-margin"><a class="roll-stat stat-margin" data-stat-key="{{key}}">{{stat.abbrev}}</a></h4>
</span> </span>
<select class="status-small-label color-class-common" type="text" name="system.statistics.{{key}}.value" value="{{stat.value}}" <select class="status-small-label color-class-common select-stat" type="text" name="system.statistics.{{key}}.value" value="{{stat.value}}"
data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}> data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
{{#select stat.value}} {{#select stat.value}}
{{{@root.optionsDiceList}}} {{{@root.optionsDiceList}}}
{{/select}} {{/select}}
</select> </select>
<span class="stat-label stat-margin" name="{{key}}">
<h4 class="stat-text-white stat-margin">{{getDice (add stat.value stat.bonuseffect)}}</h4>
</span>
<input type="text" class="input-numeric-short padd-right status-small-label color-class-common" name="system.statistics.{{key}}.mod" value="{{stat.mod}}" <input type="text" class="input-numeric-short padd-right status-small-label color-class-common" name="system.statistics.{{key}}.mod" value="{{stat.mod}}"
data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}} /> data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}} />
</li> </li>

View File

@ -18,7 +18,7 @@
</label> </label>
</span> </span>
<input type="text" class="padd-right status-small-label no-grow" name="system.secondary.{{key}}.value" value="{{stat2.value}}" data-dtype="Number"/> <input type="text" class="padd-right status-small-label no-grow" name="system.secondary.{{key}}.value" value="{{stat2.value}}" data-dtype="Number"/>
<input type="text" class="padd-right status-small-label no-grow" name="system.secondary.{{key}}.bonus" value="{{stat2.bonus}}" data-dtype="Number"/> <input type="text" class="padd-right status-small-label no-grow" name="system.secondary.{{key}}.bonus" value="{{stat2.bonus}}" data-dtype="Number" {{@root.disabledBonus}}/>
<input type="text" class="padd-right status-small-label no-grow" name="system.secondary.{{key}}.max" value="{{stat2.max}}" data-dtype="Number"/> <input type="text" class="padd-right status-small-label no-grow" name="system.secondary.{{key}}.max" value="{{stat2.max}}" data-dtype="Number"/>
</li> </li>
{{/each}} {{/each}}
@ -27,7 +27,7 @@
<label class="status-small-label"><strong>{{data.nrg.label}}</strong></label> <label class="status-small-label"><strong>{{data.nrg.label}}</strong></label>
</span> </span>
<input type="text" class="padd-right status-small-label no-grow" name="system.nrg.value" value="{{data.nrg.value}}" data-dtype="Number"/> <input type="text" class="padd-right status-small-label no-grow" name="system.nrg.value" value="{{data.nrg.value}}" data-dtype="Number"/>
<input type="text" class="padd-right status-small-label no-grow" name="system.nrg.mod" value="{{data.nrg.mod}}" data-dtype="Number"/> <input type="text" class="padd-right status-small-label no-grow" name="system.nrg.mod" value="{{data.nrg.mod}}" data-dtype="Number" {{@root.disabledBonus}}/>
<input type="text" class="padd-right status-small-label no-grow" name="system.nrg.max" value="{{data.nrg.max}}" data-dtype="Number"/> <input type="text" class="padd-right status-small-label no-grow" name="system.nrg.max" value="{{data.nrg.max}}" data-dtype="Number"/>
<span class="small-label status-small-label">&nbsp;/ {{data.nrg.absolutemax}}</span> <span class="small-label status-small-label">&nbsp;/ {{data.nrg.absolutemax}}</span>
</li> </li>

View File

@ -17,13 +17,13 @@
</li> </li>
{{else}} {{else}}
{{#if (eq effect.effect.data.stataffected "powerroll")}} {{#if (eq effect.effect.system.stataffected "powerroll")}}
<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>
<label class="generic-label">{{effect.label}} ({{effect.value}})</label> <label class="generic-label">{{effect.label}} ({{effect.value}})</label>
</li> </li>
{{/if}} {{/if}}
{{#if (eq effect.effect.data.stataffected "powerdmgroll")}} {{#if (eq effect.effect.system.stataffected "powerdmgroll")}}
<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>
<label class="generic-label">{{effect.label}} ({{effect.value}})</label> <label class="generic-label">{{effect.label}} ({{effect.value}})</label>

View File

@ -115,14 +115,13 @@
<option value="none0">==== Combat Arcs</option> <option value="none0">==== Combat Arcs</option>
<option value="d4">Combat Arc Flank (Grey) d4</option> <option value="d4">Combat Arc Flank (Grey) d4</option>
<option value="d6">Combat Arc Blind Spot (Red) d6</option> <option value="d6">Combat Arc Blind Spot (Red) d6</option>
<option value="d6">Slight cover d4</option>
<option value="none1">===== Cover defence</option> <option value="none1">===== Cover defence</option>
<option value="d4">Slight cover d4</option>
<option value="d8">Half cover d8</option> <option value="d8">Half cover d8</option>
<option value="d12">Full cover d12</option> <option value="d12">Full cover d12</option>
<option value="d12">Full cover d12</option>
<option value="none2">===== Cover Damage Resistance</option> <option value="none2">===== Cover Damage Resistance</option>
<option value="d4">Soft cover d4</option> <option value="d4">Soft cover d4</option>
<option value="d6">Dense cover d16</option> <option value="d6">Dense cover d6</option>
<option value="d8">Light cover d8</option> <option value="d8">Light cover d8</option>
<option value="d10">Thick cover d10</option> <option value="d10">Thick cover d10</option>
<option value="d12">Solid cover d12</option> <option value="d12">Solid cover d12</option>
@ -131,7 +130,7 @@
<option value="d6">Outnumbered 2 Extra Allies d6</option> <option value="d6">Outnumbered 2 Extra Allies d6</option>
<option value="d8">Outnumbered 3 Extra Allies d8</option> <option value="d8">Outnumbered 3 Extra Allies d8</option>
<option value="d10">Outnumbered 4 Extra Allies d10</option> <option value="d10">Outnumbered 4 Extra Allies d10</option>
<option value="d12">Outnumbered 5 Extra Allies d1<option> <option value="d12">Outnumbered 5 Extra Allies d12<option>
<option value="none4">===== Called DMG Shot Bonus</option> <option value="none4">===== Called DMG Shot Bonus</option>
<option value="d12">Eyes/head d12<option> <option value="d12">Eyes/head d12<option>
<option value="none4">===== Impact DMG Bonus</option> <option value="none4">===== Impact DMG Bonus</option>