Compare commits
60 Commits
fvtt-pegas
...
fvtt-pegas
Author | SHA1 | Date | |
---|---|---|---|
fdbfbf0350 | |||
37d27104fc | |||
0d70783e9b | |||
83801b294b | |||
7d05ef495b | |||
329b7839da | |||
571d015c28 | |||
5e3e50535c | |||
eb951f188f | |||
de3e16a3f0 | |||
7fcb5c36b6 | |||
be83dbd055 | |||
662804c658 | |||
4311a4762d | |||
8ddc3ad776 | |||
f4a8aa7927 | |||
45332702dc | |||
d8215301b4 | |||
932573c9ae | |||
d6a57de134 | |||
e2d5a0ec74 | |||
a68db10676 | |||
6e69e151c5 | |||
c2831e4ccd | |||
5a062cc94e | |||
ef740f4c0d | |||
076945c76f | |||
a763efe873 | |||
c49289b88f | |||
8a8bd489f3 | |||
43724596fb | |||
e06572c221 | |||
7bcd4d9c06 | |||
aa1d5e8ecb | |||
536b42dbe0 | |||
00761d57d3 | |||
5fb0221007 | |||
19f7ebca92 | |||
afe4fc2a1b | |||
27029abc88 | |||
d8f8b7198c | |||
908cf4206a | |||
e531b636bc | |||
4065d46ffd | |||
1bb869e715 | |||
c8cc9d6c82 | |||
cfcc9ca557 | |||
a5e17b8276 | |||
428db5e441 | |||
9394e0e851 | |||
18a69ba993 | |||
fb69f24fce | |||
e1d6b1aaff | |||
7977233d93 | |||
e3674f076c | |||
1e020d469f | |||
7d040af19a | |||
0c6faeb9ca | |||
65d0b18191 | |||
01a2fd9ff8 |
@ -61,6 +61,7 @@ export class PegasusActorSheet extends ActorSheet {
|
||||
encCapacity: this.actor.getEncumbranceCapacity(),
|
||||
levelRemainingList: this.actor.getLevelRemainingList(),
|
||||
maxLevelRemainingList: this.actor.getMaxLevelRemainingList(),
|
||||
disabledBonus: (this.actor.system.biodata.noautobonus) ? "" : "disabled",
|
||||
containersTree: this.actor.containersTree,
|
||||
encCurrent: this.actor.encCurrent,
|
||||
encHindrance: this.actor.encHindrance,
|
||||
@ -249,13 +250,13 @@ export class PegasusActorSheet extends ActorSheet {
|
||||
this.actor.rollPool( 'def', true, "defence");
|
||||
});
|
||||
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) => {
|
||||
this.actor.rollPool( 'per', false, "ranged-dmg");
|
||||
});
|
||||
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) => {
|
||||
|
@ -7,7 +7,7 @@ const coverBonusTable = { "nocover": 0, "lightcover": 2, "heavycover": 4, "entre
|
||||
const statThreatLevel = ["agi", "str", "phy", "com", "def", "per"]
|
||||
const __subkey2title = {
|
||||
"melee-dmg": "Melee Damage", "melee-atk": "Melee Attack", "ranged-atk": "Ranged Attack",
|
||||
"ranged-dmg": "Ranged Damage", "defence": "Defence", "dmg-res": "Damare Resistance"
|
||||
"ranged-dmg": "Ranged Damage", "defence": "Defence", "dmg-res": "Damage Resistance", "power-dmg": "Power Damage"
|
||||
}
|
||||
const __statBuild = [
|
||||
{ modules: ["vehiclehull"], field: "hr", itemfield: "hr" },
|
||||
@ -121,11 +121,12 @@ export class PegasusActor extends Actor {
|
||||
this.system.encCapacity = this.getEncumbranceCapacity()
|
||||
this.buildContainerTree()
|
||||
this.updatePPP()
|
||||
this.updateSize()
|
||||
}
|
||||
if (this.type == 'vehicle') {
|
||||
this.computeVehicleStats();
|
||||
this.computeVehicleStats()
|
||||
}
|
||||
super.prepareDerivedData();
|
||||
super.prepareDerivedData()
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -154,7 +155,7 @@ export class PegasusActor extends Actor {
|
||||
let comp = duplicate(this.items.filter(item => item.type == 'perk') || [])
|
||||
for (let perk of comp) {
|
||||
if (perk.system.features.range.flag) {
|
||||
perk.rangeText = PegasusUtility.getRangeText( perk.system.features.range.value)
|
||||
perk.rangeText = PegasusUtility.getRangeText(perk.system.features.range.value)
|
||||
}
|
||||
}
|
||||
return comp;
|
||||
@ -193,8 +194,13 @@ export class PegasusActor extends Actor {
|
||||
let comp = this.items.filter(item => item.type == 'vehiclemodule');
|
||||
return comp;
|
||||
}
|
||||
getVehicleWeaponModules() {
|
||||
let comp = this.items.filter(item => item.type == 'vehicleweaponmodule');
|
||||
getVehicleWeaponModules( activated = false ) {
|
||||
let comp = []
|
||||
if (activated ) {
|
||||
comp = this.items.filter(item => item.type == 'vehicleweaponmodule' && item.system.activated)
|
||||
} else {
|
||||
comp = this.items.filter(item => item.type == 'vehicleweaponmodule' )
|
||||
}
|
||||
return comp;
|
||||
}
|
||||
|
||||
@ -236,12 +242,104 @@ export class PegasusActor extends Actor {
|
||||
let role = this.items.filter(item => item.type == 'role')
|
||||
return role[0] ?? [];
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
getRoleLevel() {
|
||||
let role = this.items.find(item => item.type == 'role')
|
||||
if (role) {
|
||||
console.log("Role", role)
|
||||
return role.system.rolelevel
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
isTactician() {
|
||||
let role = this.items.find(item => item.type == 'role')
|
||||
return role && role.system.perksrole == "tactician"
|
||||
}
|
||||
hasTacticianBonus() {
|
||||
let effect = this.items.find(item => item.name.toLowerCase().includes("tactician bonus dice"))
|
||||
return effect
|
||||
}
|
||||
async addTacticianEffect(name, level) {
|
||||
let effect = duplicate(__bonusEffect)
|
||||
effect.name = `${name} Tactician Bonus Dice`
|
||||
effect.system.effectlevel = level
|
||||
effect.system.stataffected = "mr"
|
||||
effect.system.bonusdice = true
|
||||
await this.createEmbeddedDocuments('Item', [effect])
|
||||
ChatMessage.create({
|
||||
content: `Tactician Bonus Dice has been added to ${this.name} (${level})`,
|
||||
whisper: ChatMessage.getWhisperRecipients('GM')
|
||||
})
|
||||
}
|
||||
async removeTacticianEffect() {
|
||||
let effect = this.items.find(item => item.name.toLowerCase().includes("tactician bonus dice"))
|
||||
if (effect) {
|
||||
await this.deleteEmbeddedDocuments('Item', [effect.id])
|
||||
ChatMessage.create({ content: `Tactician Bonus Dice has been removed to ${this.name}`, whisper: ChatMessage.getWhisperRecipients('GM') })
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
isEnhancer() {
|
||||
let role = this.items.find(item => item.type == 'role')
|
||||
return role && role.system.perksrole == "enhancer"
|
||||
}
|
||||
hasEnhancerBonus() {
|
||||
let effect = this.items.find(item => item.name.toLowerCase().includes("enhancer bonus dice"))
|
||||
return effect
|
||||
}
|
||||
async addEnhancerEffect(name, level) {
|
||||
let effect = duplicate(__bonusEffect)
|
||||
effect.name = `${name} Enhancer Bonus Dice ALL`
|
||||
effect.system.effectlevel = level
|
||||
effect.system.stataffected = "all"
|
||||
effect.system.bonusdice = true
|
||||
await this.createEmbeddedDocuments('Item', [effect])
|
||||
ChatMessage.create({ content: `Enhancer Bonus Dice has been added to ${this.name} (${level})`, whisper: ChatMessage.getWhisperRecipients('GM') })
|
||||
}
|
||||
async removeEnhancerEffect() {
|
||||
let effect = this.items.find(item => item.name.toLowerCase().includes("enhancer bonus dice"))
|
||||
if (effect) {
|
||||
await this.deleteEmbeddedDocuments('Item', [effect.id])
|
||||
ChatMessage.create({ content: `Enhancer Bonus Dice has been removed to ${this.name}`, whisper: ChatMessage.getWhisperRecipients('GM') })
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
isAgitator() {
|
||||
let role = this.items.find(item => item.type == 'role')
|
||||
return role && role.system.perksrole == "agitator"
|
||||
}
|
||||
hasAgitatorHindrance() {
|
||||
let effect = this.items.find(item => item.name.toLowerCase().includes("hindered by agitator"))
|
||||
return effect
|
||||
}
|
||||
async addAgitatorHindrance(name, level) {
|
||||
let effect = duplicate(__bonusEffect)
|
||||
effect.name = `Hindered by Agitator ${name}`
|
||||
effect.system.effectlevel = level
|
||||
effect.system.stataffected = "all"
|
||||
effect.system.genre = "negative"
|
||||
effect.system.hindrance = true
|
||||
await this.createEmbeddedDocuments('Item', [effect])
|
||||
ChatMessage.create({ content: `Agitator Hindrance has been added to ${this.name} (${level})`, whisper: ChatMessage.getWhisperRecipients('GM') })
|
||||
}
|
||||
async removeAgitatorHindrance() {
|
||||
let effect = this.items.find(item => item.name.toLowerCase().includes("hindered by agitator"))
|
||||
if (effect) {
|
||||
await this.deleteEmbeddedDocuments('Item', [effect.id])
|
||||
ChatMessage.create({ content: `Agitator Hindrance has been removed to ${this.name}`, whisper: ChatMessage.getWhisperRecipients('GM') })
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
checkAndPrepareEquipment(item) {
|
||||
if (item.system.resistance) {
|
||||
item.system.resistanceDice = PegasusUtility.getDiceFromLevel(item.system.resistance)
|
||||
}
|
||||
if (item.system.idr) {
|
||||
if (item.system.idr && Number(item.system.idr) > 0) {
|
||||
item.system.idrDice = PegasusUtility.getDiceFromLevel(item.system.idr)
|
||||
}
|
||||
if (item.system.damage) {
|
||||
@ -366,15 +464,25 @@ export class PegasusActor extends Actor {
|
||||
/* -------------------------------------------- */
|
||||
updatePPP() {
|
||||
let ppp = 0
|
||||
for(let power of this.items) {
|
||||
for (let power of this.items) {
|
||||
if (power.type == "power") {
|
||||
ppp += Number(power.system.powerlevelcost)
|
||||
}
|
||||
}
|
||||
console.log("PPP update", ppp)
|
||||
if ( ppp != this.system.ppp.spentPPP) {
|
||||
console.log("PPP update2", ppp)
|
||||
this.update( { 'system.ppp.spentPPP': ppp} )
|
||||
if (ppp != this.system.ppp.spentPPP) {
|
||||
this.update({ 'system.ppp.spentPPP': ppp })
|
||||
}
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
updateSize() {
|
||||
let sizeBonus = 0
|
||||
for (let effect of this.items) {
|
||||
if (effect.type == "effect" && effect.system.effectlevel > 0 && effect.system.affectsize) {
|
||||
sizeBonus += effect.system.effectlevel
|
||||
}
|
||||
}
|
||||
if (sizeBonus != this.system.biodata.sizebonus) {
|
||||
this.update({ 'system.biodata.sizebonus': sizeBonus })
|
||||
}
|
||||
}
|
||||
|
||||
@ -708,9 +816,11 @@ export class PegasusActor extends Actor {
|
||||
ChatMessage.create({ content: "Effects of this type cannot be applied while Immunity is applied" })
|
||||
return
|
||||
}
|
||||
if (item.system.droptext && item.system.droptext.length > 0) {
|
||||
ChatMessage.create({ content: `Effect ${item.name} message : ${item.system.droptext}` })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (item.type == 'race') {
|
||||
this.applyRace(item)
|
||||
} else if (item.type == 'role') {
|
||||
@ -760,6 +870,9 @@ export class PegasusActor extends Actor {
|
||||
if (this.type == 'character') {
|
||||
this.rollMR(true, combatId, combatantId)
|
||||
}
|
||||
if (this.type == 'vehicle') {
|
||||
this.rollMR(true, combatId, combatantId)
|
||||
}
|
||||
console.log("Init required !!!!")
|
||||
return -1;
|
||||
}
|
||||
@ -806,12 +919,16 @@ export class PegasusActor extends Actor {
|
||||
getStat(statKey) {
|
||||
let stat
|
||||
if (this.type == "character" && statKey == 'mr') {
|
||||
stat = duplicate(this.system.mr);
|
||||
stat = duplicate(this.system.mr)
|
||||
} else {
|
||||
stat = duplicate(this.system.statistics[statKey]);
|
||||
stat = duplicate(this.system.statistics[statKey])
|
||||
}
|
||||
stat.dice = PegasusUtility.getDiceFromLevel(stat.value || stat.level);
|
||||
return stat;
|
||||
if (stat.currentlevel) {
|
||||
stat.dice = PegasusUtility.getDiceFromLevel(stat.currentlevel)
|
||||
} else {
|
||||
stat.dice = PegasusUtility.getDiceFromLevel(stat.value || stat.level)
|
||||
}
|
||||
return stat
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -1332,9 +1449,66 @@ export class PegasusActor extends Actor {
|
||||
this.system.combat.hindrancedice = hindrance
|
||||
this.getTraumaState()
|
||||
this.cleanupPerksIfTrauma()
|
||||
this.parseStatEffects()
|
||||
this.parseStatusEffects()
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
parseStatEffects() {
|
||||
if (this.system.biodata.noautobonus) { // If we are in "no-bonus mode
|
||||
return
|
||||
}
|
||||
let effects = this.items.filter(effect => effect.type == "effect" && effect.system.genre == "positive" && effect.system.statdice)
|
||||
for (let statKey in this.system.statistics) {
|
||||
let stat = duplicate(this.system.statistics[statKey])
|
||||
let bonus = 0
|
||||
for (let effect of effects) {
|
||||
if (effect.system.stataffected == statKey) {
|
||||
bonus += Number(effect.system.effectlevel)
|
||||
}
|
||||
}
|
||||
if (bonus != stat.bonuseffect) {
|
||||
stat.bonuseffect = bonus
|
||||
this.update({ [`system.statistics.${statKey}`]: stat })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
parseStatusEffects() {
|
||||
if (this.system.biodata.noautobonus) { // If we are in "no-bonus mode
|
||||
return
|
||||
}
|
||||
let effects = this.items.filter(effect => effect.type == "effect" && effect.system.affectstatus && (Number(effect.system.effectlevel) > 0))
|
||||
for (let statusKey in this.system.secondary) {
|
||||
let status = duplicate(this.system.secondary[statusKey])
|
||||
let bonus = 0
|
||||
for (let effect of effects) {
|
||||
if (effect.system.affectedstatus && effect.system.affectedstatus == statusKey) {
|
||||
bonus += Number(effect.system.effectlevel)
|
||||
}
|
||||
}
|
||||
if (bonus != status.bonus) {
|
||||
status.bonus = bonus
|
||||
this.update({ [`system.secondary.${statusKey}`]: status })
|
||||
}
|
||||
}
|
||||
|
||||
let nrg = duplicate(this.system.nrg)
|
||||
let bonus = 0
|
||||
for (let effect of effects) {
|
||||
if (effect.system.affectedstatus && effect.system.affectedstatus == "nrg") {
|
||||
bonus += Number(effect.system.effectlevel)
|
||||
}
|
||||
}
|
||||
if (bonus != nrg.mod) {
|
||||
nrg.mod = bonus
|
||||
this.update({ [`system.nrg`]: nrg })
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async modStat(key, inc = 1) {
|
||||
let stat = duplicate(this.system.statistics[key])
|
||||
@ -1570,7 +1744,7 @@ export class PegasusActor extends Actor {
|
||||
let effects = this.items.filter(item => item.type == 'effect')
|
||||
for (let effect of effects) {
|
||||
effect = duplicate(effect)
|
||||
if (!effect.system.hindrance
|
||||
if (!effect.system.hindrance && !effect.system.statdice
|
||||
&& (effect.system.stataffected != "notapplicable" || effect.system.specaffected.length > 0)
|
||||
&& effect.system.stataffected != "special"
|
||||
&& effect.system.stataffected != "powerroll"
|
||||
@ -1591,8 +1765,8 @@ export class PegasusActor extends Actor {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
addArmorsShields(rollData, statKey = "none", useShield = false) {
|
||||
if (statKey == 'phy') {
|
||||
addArmorsShields(rollData, statKey = "none", useShield = false, subKey = undefined) {
|
||||
if (statKey == 'phy' && subKey == "dmg-res") {
|
||||
let armors = this.getArmors()
|
||||
for (let armor of armors) {
|
||||
rollData.armorsList.push({ label: `Armor ${armor.name}`, type: "armor", applied: false, value: armor.system.resistance })
|
||||
@ -1632,7 +1806,7 @@ export class PegasusActor extends Actor {
|
||||
}
|
||||
addVehicleWeapons(rollData, vehicle) {
|
||||
if (vehicle) {
|
||||
let modules = vehicle.items.filter(vehicle => vehicle.type == "vehicleweaponmodule")
|
||||
let modules = vehicle.items.filter(item => item.type == "vehicleweaponmodule" && item.system.activated)
|
||||
if (modules && modules.length > 0) {
|
||||
for (let module of modules) {
|
||||
rollData.vehicleWeapons.push({ label: `Weapon ${module.name}`, type: "item", applied: false, weapon: module, value: module.system.damagedicevalue })
|
||||
@ -1641,6 +1815,33 @@ export class PegasusActor extends Actor {
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
processVehicleTargetMessage(rollData) {
|
||||
if (rollData.defenderTokenId) {
|
||||
let vehicle = game.canvas.tokens.get(rollData.defenderTokenId).actor
|
||||
if (vehicle.type == "vehicle") {
|
||||
if (rollData.subKey == "defence" && vehicle.system.statistics.ad.currentspeed == "crawling") {
|
||||
ChatMessage.create({ content: `${vehicle.name} is moving at Crawling speed : add a D8 to your Attack Dice Pool against this Vehicle` })
|
||||
}
|
||||
if (rollData.subKey == "defence" && vehicle.system.statistics.ad.currentspeed == "slow") {
|
||||
ChatMessage.create({ content: `${vehicle.name} is moving at Slow speed : add a D4 to your Attack Dice Pool against this Vehicle` })
|
||||
}
|
||||
}
|
||||
if (this.type == "vehicle" && rollData.statKey == "man" && this.system.statistics.ad.currentspeed == "fast") {
|
||||
ChatMessage.create({ content: `${this.name} is moving at Fast speed : anyone using the vehicles MAN Dice Pool suffers a D8 Hindrance which is added to the Difficulty Dice Pool against this Vehicle` })
|
||||
}
|
||||
if (this.type == "vehicle" && rollData.statKey == "man" && this.system.statistics.ad.currentspeed == "extfast") {
|
||||
ChatMessage.create({ content: `${this.name} is moving at Extremely Fast speed : anyone using the vehicles MAN Dice Pool suffers a D12 Hindrance which is added to the Difficulty Dice Pool against this Vehicle` })
|
||||
}
|
||||
if (rollData.subKey == "defence" && rollData.vehicle && rollData.vehicle.system.statistics.ad.currentspeed == "crawling") {
|
||||
ChatMessage.create({ content: `${this.name} is moving at Crawling speed : add a D8 to your Attack Dice Pool against this Vehicle` })
|
||||
}
|
||||
if (rollData.subKey == "defence" && rollData.vehicle && rollData.vehicle.system.statistics.ad.currentspeed == "slow") {
|
||||
ChatMessage.create({ content: `${this.name} is moving at Slow speed : add a D4 to your Attack Dice Pool against this Vehicle` })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getCommonRollData(statKey = undefined, useShield = false, isInit = false, isPower = false, subKey = "", vehicle = undefined) {
|
||||
let rollData = PegasusUtility.getBasicRollData(isInit)
|
||||
@ -1654,6 +1855,7 @@ export class PegasusActor extends Actor {
|
||||
rollData.diceList = PegasusUtility.getDiceList()
|
||||
rollData.noBonusDice = this.checkNoBonusDice()
|
||||
rollData.dicePool = []
|
||||
rollData.subKey = subKey
|
||||
|
||||
if (subKey == "melee-dmg" || subKey == "ranged-dmg" || subKey == "power-dmg") {
|
||||
rollData.isDamage = true
|
||||
@ -1662,7 +1864,14 @@ export class PegasusActor extends Actor {
|
||||
if (statKey) {
|
||||
rollData.statKey = statKey
|
||||
rollData.stat = this.getStat(statKey)
|
||||
rollData.statDicesLevel = rollData.stat.value || rollData.stat.level
|
||||
if (rollData.stat.value != undefined) {
|
||||
rollData.stat.level = rollData.stat.value // Normalize
|
||||
rollData.statDicesLevel = rollData.stat.level + rollData.stat.bonuseffect
|
||||
}
|
||||
if (rollData.stat.currentlevel) {
|
||||
rollData.stat.level = rollData.stat.currentlevel
|
||||
rollData.statDicesLevel = rollData.stat.currentlevel
|
||||
}
|
||||
rollData.statMod = rollData.stat.mod
|
||||
if (vehicle) {
|
||||
rollData.vehicle = duplicate(vehicle)
|
||||
@ -1689,11 +1898,9 @@ export class PegasusActor extends Actor {
|
||||
rollData.statVehicle = vehicle.system.statistics.man
|
||||
rollData.vehicleKey = "man"
|
||||
}
|
||||
vehicle.addVehicleShields( rollData)
|
||||
vehicle.addVehicleShields(rollData)
|
||||
}
|
||||
vehicle.addEffects(rollData, false, false, false)
|
||||
//this.addVehiculeHindrances(rollData.effectsList, vehicle)
|
||||
//this.addVehicleBonus(rollData, vehicle)
|
||||
}
|
||||
|
||||
rollData.specList = this.getRelevantSpec(statKey)
|
||||
@ -1710,15 +1917,75 @@ export class PegasusActor extends Actor {
|
||||
}
|
||||
}
|
||||
|
||||
if (statKey == "mr") {
|
||||
if (this.type == "character") {
|
||||
rollData.mrVehicle = PegasusUtility.checkIsVehicleCrew(this.id)
|
||||
if (rollData.mrVehicle) {
|
||||
rollData.effectsList.push({
|
||||
label: `Vehicle ${rollData.mrVehicle.name} MR Bonus`,
|
||||
type: "effect", applied: false, isdynamic: true, value: rollData.mrVehicle.system.statistics.mr.currentlevel
|
||||
})
|
||||
}
|
||||
}
|
||||
if (this.type == "vehicle") {
|
||||
for (let member of this.system.crew) {
|
||||
let actor = game.actors.get(member.id)
|
||||
let specList = actor.getRelevantSpec("mr")
|
||||
rollData.effectsList.push({
|
||||
label: `Crew ${actor.name} MR Bonus`,
|
||||
type: "effect", applied: false, isdynamic: true, value: actor.system.mr.value + actor.system.mr.bonuseffect, specList: specList
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.processSizeBonus(rollData)
|
||||
this.addEffects(rollData, isInit, isPower, subKey == "power-dmg")
|
||||
this.addArmorsShields(rollData, statKey, useShield)
|
||||
this.addArmorsShields(rollData, statKey, useShield, subKey)
|
||||
this.addWeapons(rollData, statKey, useShield)
|
||||
this.addEquipments(rollData, statKey)
|
||||
this.processVehicleTargetMessage(rollData)
|
||||
|
||||
console.log("ROLLDATA", rollData)
|
||||
|
||||
return rollData
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
processSizeBonus(rollData) {
|
||||
if (rollData.defenderTokenId) {
|
||||
let diffSize = 0
|
||||
if (this.type == "character") {
|
||||
this.system.biodata.sizenum = this.system.biodata?.sizenum ?? 0
|
||||
this.system.biodata.sizebonus = this.system.biodata?.sizebonus ?? 0
|
||||
diffSize = rollData.defenderSize - this.system.biodata.sizenum + this.system.biodata.sizebonus
|
||||
} else {
|
||||
diffSize = rollData.defenderSize - this.system.statistics.hr.size
|
||||
}
|
||||
//console.log("Diffsize", diffSize)
|
||||
if (rollData.subKey == "melee-atk" || rollData.subKey == "ranged-atk") {
|
||||
if (diffSize > 0) {
|
||||
rollData.effectsList.push({ label: "Size Bonus", type: "effect", applied: false, isdynamic: true, value: diffSize })
|
||||
}
|
||||
}
|
||||
if (rollData.subKey == "dmg-res") {
|
||||
if (diffSize < 0) {
|
||||
rollData.effectsList.push({ label: "Size Bonus", type: "effect", applied: false, isdynamic: true, value: Math.abs(diffSize) })
|
||||
}
|
||||
}
|
||||
if (rollData.subKey == "defence") {
|
||||
if (diffSize > 0) {
|
||||
rollData.effectsList.push({ label: "Size Bonus", type: "effect", applied: false, isdynamic: true, value: Math.abs(diffSize) })
|
||||
}
|
||||
}
|
||||
if (rollData.subKey == "melee-dmg" || rollData.subKey == "ranged-dmg" || rollData.subKey == "power-dmg") {
|
||||
if (diffSize < 0) {
|
||||
rollData.effectsList.push({ label: "Size Bonus", type: "effect", applied: false, isdynamic: true, value: Math.abs(diffSize) })
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getLevelRemainingList() {
|
||||
let options = []
|
||||
@ -1791,7 +2058,7 @@ export class PegasusActor extends Actor {
|
||||
|
||||
/*-------------------------------------------- */
|
||||
rollStat(statKey) {
|
||||
let stat = this.getStat(statKey);
|
||||
let stat = this.getStat(statKey)
|
||||
if (stat) {
|
||||
let rollData = this.getCommonRollData(statKey)
|
||||
rollData.mode = "stat"
|
||||
@ -1824,7 +2091,8 @@ export class PegasusActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollMR(isInit = false, combatId = 0, combatantId = 0) {
|
||||
let mr = duplicate(this.system.mr)
|
||||
|
||||
let mr = duplicate((this.type == "vehicle") ? this.system.statistics.mr : this.system.mr)
|
||||
if (mr) {
|
||||
mr.dice = PegasusUtility.getDiceFromLevel(mr.value);
|
||||
|
||||
@ -1944,6 +2212,23 @@ export class PegasusActor extends Actor {
|
||||
effect.system.isspeed = speed
|
||||
await this.createEmbeddedDocuments("Item", [effect])
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
processVehicleStatEffects() {
|
||||
let effects = this.items.filter(effect => effect.type == "effect" && effect.system.genre == "positive" && effect.system.statdice)
|
||||
for (let statKey in this.system.statistics) {
|
||||
let stat = duplicate(this.system.statistics[statKey])
|
||||
let bonus = 0
|
||||
for (let effect of effects) {
|
||||
if (effect.system.stataffected == statKey) {
|
||||
bonus += Number(effect.system.effectlevel)
|
||||
}
|
||||
}
|
||||
if (bonus != stat.bonuseffect) {
|
||||
stat.bonuseffect = bonus
|
||||
this.update({ [`system.statistics.${statKey}`]: stat })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async computeVehicleStats() {
|
||||
@ -2034,7 +2319,8 @@ export class PegasusActor extends Actor {
|
||||
if (this.system.statistics.hr.currentlevel == 0) {
|
||||
ChatMessage.create({ content: `The vehicle ${this.name} has been destroyed !` })
|
||||
}
|
||||
|
||||
this.processVehicleArmorShields()
|
||||
this.processVehicleStatEffects()
|
||||
}
|
||||
}
|
||||
|
||||
@ -2059,6 +2345,9 @@ export class PegasusActor extends Actor {
|
||||
return
|
||||
}
|
||||
|
||||
if (item.type == "effect" && item.system.droptext && item.system.droptext.length > 0) {
|
||||
ChatMessage.create({ content: `Effect ${item.name} message : ${item.system.droptext}` })
|
||||
}
|
||||
//console.log(">>>>> item", item.type, __isVehicleUnique[item.type])
|
||||
if (__isVehicleUnique[item.type]) {
|
||||
let toDelList = []
|
||||
@ -2096,47 +2385,6 @@ export class PegasusActor extends Actor {
|
||||
}
|
||||
}
|
||||
|
||||
// Armour management
|
||||
if (item.type == "vehiclemodule" && item.system.category == "armor") {
|
||||
let armorsList = this.items.filter(item => item.type == "vehiclemodule" && item.system.category == "armor") || []
|
||||
armorsList.push(item)
|
||||
let arcKey = item.system.location + "arc"
|
||||
let arc = duplicate(this.system.arcs[arcKey])
|
||||
let level = 0
|
||||
for (let armour of armorsList) {
|
||||
if (armour.system.armourdicevalue > 0) {
|
||||
level += Number(armour.system.armourdicevalue)
|
||||
}
|
||||
}
|
||||
if (level != Number(arc.armourlevel)) {
|
||||
arc.armourlevel = level
|
||||
setTimeout(500, this.update({ [`system.arcs.${arcKey}`]: arc }))
|
||||
}
|
||||
}
|
||||
|
||||
// Shield management
|
||||
if (item.type == "vehiclemodule" && item.system.category == "shield") {
|
||||
let shieldsList = this.items.filter(item => item.type == "vehiclemodule" && item.system.category == "shield") || []
|
||||
shieldsList.push(item)
|
||||
let level = 0
|
||||
for (let armour of shieldsList) {
|
||||
if (armour.system.shielddicevalue > 0) {
|
||||
level += Number(armour.system.shielddicevalue)
|
||||
}
|
||||
}
|
||||
let shift = 500
|
||||
for( let loc of __LocationsArmour) {
|
||||
let arcKey = loc + "arc"
|
||||
let arc = duplicate(this.system.arcs[arcKey])
|
||||
if (level != Number(arc.shieldlevel)) {
|
||||
arc.shieldlevel = level
|
||||
setTimeout(shift, this.update({ [`system.arcs.${arcKey}`]: arc }))
|
||||
shift += 200
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
@ -2152,7 +2400,6 @@ export class PegasusActor extends Actor {
|
||||
return crew
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
addCrew(actorId) {
|
||||
if (this.system.crew.length >= this.system.crewmax) {
|
||||
ui.notifications.warn("Vehicle crew is already full.")
|
||||
@ -2162,11 +2409,13 @@ export class PegasusActor extends Actor {
|
||||
crewList.push({ id: actorId })
|
||||
this.update({ 'system.crew': crewList })
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
delCrew(actorId) {
|
||||
let crewList = duplicate(this.system.crew.filter(actorDef => actorDef.id != actorId) || [])
|
||||
this.update({ 'system.crew': crewList })
|
||||
}
|
||||
inCrew(actorId) {
|
||||
return this.system.crew.find(member => member.id == actorId)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
isVehicleFullStop() {
|
||||
@ -2224,7 +2473,7 @@ export class PegasusActor extends Actor {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
addVehicleArmors( rollData) {
|
||||
addVehicleArmors(rollData) {
|
||||
for (let arcKey in this.system.arcs) {
|
||||
let arc = this.system.arcs[arcKey]
|
||||
if (arc.armourlevel > 0) {
|
||||
@ -2239,17 +2488,46 @@ export class PegasusActor extends Actor {
|
||||
if (actor) {
|
||||
let stat = this.getStat("hr")
|
||||
let rollData = this.getCommonRollData("hr")
|
||||
rollData.vehicle = duplicate(this)
|
||||
rollData.isVehicleStun = true
|
||||
rollData.mode = "stat"
|
||||
rollData.title = `Stat ${stat.label}`;
|
||||
rollData.title = `Stat ${stat.label}`
|
||||
|
||||
this.addVehicleArmors(rollData)
|
||||
this.startRoll(rollData)
|
||||
this.modifyVehicleStun(1)
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
activateVehicleModule(itemId) {
|
||||
async addVehicleModuleEffects( mod) {
|
||||
let effects = []
|
||||
for (let effect of mod.system.effects) {
|
||||
if (!effect.system) {
|
||||
effect.system = effect.data
|
||||
}
|
||||
effect.system.effectId = mod.id // Link to the perk, in order to dynamically remove them
|
||||
effects.push(effect)
|
||||
}
|
||||
if (effects.length) {
|
||||
await this.createEmbeddedDocuments('Item', effects)
|
||||
}
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
async removeVehicleModuleEffects( mod) {
|
||||
let toRem = []
|
||||
for (let item of this.items) {
|
||||
if (item.type == 'effect' && item.system.effectId == mod.id) {
|
||||
toRem.push(item.id)
|
||||
}
|
||||
}
|
||||
console.log("TODEL", toRem)
|
||||
if (toRem.length) {
|
||||
await this.deleteEmbeddedDocuments('Item', toRem)
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async activateVehicleModule(itemId) {
|
||||
let mod = this.items.get(itemId)
|
||||
if (mod) {
|
||||
if (mod.system.nrg && mod.system.nrg > 0) {
|
||||
@ -2259,26 +2537,87 @@ export class PegasusActor extends Actor {
|
||||
ChatMessage.create({ content: `The Vehicle ${this.name} does not have enough Energy to Activate this module at this time.` })
|
||||
return
|
||||
}
|
||||
this.updateEmbeddedDocuments('Item', [{ _id: mod.id, 'system.activated': !mod.system.activated }])
|
||||
await this.updateEmbeddedDocuments('Item', [{ _id: mod.id, 'system.activated': !mod.system.activated }])
|
||||
pc.actnrg += Number(mod.system.nrg)
|
||||
pc.maxnrg -= Number(mod.system.nrg)
|
||||
pc.curnrg -= Number(mod.system.nrg)
|
||||
this.update({ 'system.statistics.pc': pc })
|
||||
this.addVehicleModuleEffects(mod)
|
||||
} else { // Now deactivated
|
||||
pc.actnrg -= Number(mod.system.nrg)
|
||||
pc.maxnrg += Number(mod.system.nrg)
|
||||
this.update({ 'system.statistics.pc': pc })
|
||||
this.updateEmbeddedDocuments('Item', [{ _id: mod.id, 'system.activated': !mod.system.activated }])
|
||||
await this.updateEmbeddedDocuments('Item', [{ _id: mod.id, 'system.activated': !mod.system.activated }])
|
||||
this.removeVehicleModuleEffects(mod)
|
||||
}
|
||||
} else {
|
||||
this.updateEmbeddedDocuments('Item', [{ _id: mod.id, 'system.activated': !mod.system.activated }])
|
||||
if ( mod.system.activated) {
|
||||
this.removeVehicleModuleEffects(mod)
|
||||
} else {
|
||||
this.addVehicleModuleEffects(mod)
|
||||
}
|
||||
await this.updateEmbeddedDocuments('Item', [{ _id: mod.id, 'system.activated': !mod.system.activated }])
|
||||
}
|
||||
}
|
||||
|
||||
this.processVehicleArmorShields()
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
processVehicleArmorShields() {
|
||||
// Shield management
|
||||
let shieldsList = this.items.filter(item => item.type == "vehiclemodule" && item.system.category == "shield" && item.system.activated) || []
|
||||
let level = 0
|
||||
for (let armour of shieldsList) {
|
||||
if (armour.system.shielddicevalue > 0) {
|
||||
level += Number(armour.system.shielddicevalue)
|
||||
}
|
||||
}
|
||||
let shift = 500
|
||||
for (let loc of __LocationsArmour) {
|
||||
let arcKey = loc + "arc"
|
||||
let arc = duplicate(this.system.arcs[arcKey])
|
||||
if (level != Number(arc.maxshieldlevel)) {
|
||||
let lvChanged = level - arc.maxshieldlevel
|
||||
arc.maxshieldlevel = level
|
||||
arc.shieldlevel += lvChanged
|
||||
if ( arc.shieldlevel <= 0 || arc.shieldlevel > level) {
|
||||
arc.shieldlevel = level
|
||||
}
|
||||
setTimeout(shift, this.update({ [`system.arcs.${arcKey}`]: arc }))
|
||||
shift += 200
|
||||
}
|
||||
}
|
||||
|
||||
// Armour management
|
||||
let armorsList = this.items.filter(item => item.type == "vehiclemodule" && item.system.category == "armor" && item.system.activated) || []
|
||||
for (let loc of __LocationsArmour) {
|
||||
let arcKey = loc + "arc"
|
||||
let arc = duplicate(this.system.arcs[arcKey])
|
||||
let level = 0
|
||||
for (let armour of armorsList) {
|
||||
if (armour.system.location == loc && armour.system.armourdicevalue > 0) {
|
||||
level += Number(armour.system.armourdicevalue)
|
||||
}
|
||||
}
|
||||
if (level != Number(arc.maxarmourlevel)) {
|
||||
let lvChanged = level - arc.maxarmourlevel
|
||||
arc.maxarmourlevel = level
|
||||
arc.armourlevel += lvChanged
|
||||
if ( arc.armourlevel <= 0 || arc.armourlevel > arc.maxarmourlevel) {
|
||||
arc.armourlevel = level
|
||||
}
|
||||
setTimeout(500, this.update({ [`system.arcs.${arcKey}`]: arc }))
|
||||
}
|
||||
}
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
updateMaxNrg(currentLevel) {
|
||||
this.update({ 'system.statistics.pc.maxnrg': Number( PegasusUtility.getDiceValue(currentLevel) ) })
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
setTurningArc(currentLevel) {
|
||||
this.update({ 'system.statistics.man.turningarc45': currentLevel })
|
||||
this.update({ 'system.statistics.man.turningarc45': Number(currentLevel) })
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
@ -57,8 +57,9 @@ Hooks.once("init", async function () {
|
||||
CONFIG.Combat.documentClass = PegasusCombat
|
||||
CONFIG.Actor.documentClass = PegasusActor
|
||||
CONFIG.Item.documentClass = PegasusItem
|
||||
//CONFIG.Token.objectClass = PegasusToken
|
||||
game.system.pegasus = { };
|
||||
game.system.pegasus = {
|
||||
utility: PegasusUtility
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
// Register sheet application classes
|
||||
@ -69,7 +70,8 @@ Hooks.once("init", async function () {
|
||||
Items.unregisterSheet("core", ItemSheet);
|
||||
Items.registerSheet("fvtt-pegasus", PegasusItemSheet, { makeDefault: true });
|
||||
|
||||
PegasusUtility.init();
|
||||
PegasusUtility.init()
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
@ -49,7 +49,7 @@ export class PegasusRollDialog extends Dialog {
|
||||
effect.applied = toggled
|
||||
|
||||
let level, genre, idVal, key
|
||||
if (effect.type == 'effect') {
|
||||
if (effect.type == 'effect' && effect.effect) {
|
||||
let effectData = effect.effect
|
||||
level = effectData.system.effectlevel
|
||||
genre = effectData.system.genre
|
||||
@ -90,6 +90,9 @@ export class PegasusRollDialog extends Dialog {
|
||||
PegasusUtility.updateDamageDicePool(this.rollData)
|
||||
PegasusUtility.updateEffectsBonusDice(this.rollData)
|
||||
PegasusUtility.updateHindranceBonusDice(this.rollData)
|
||||
if ( effect.specList) {
|
||||
this.rollData.specList = duplicate(effect.specList)
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
@ -8,9 +8,11 @@ import { PegasusRollDialog } from "./pegasus-roll-dialog.js";
|
||||
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 __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",
|
||||
long: "Long", extreme: "Extreme", sight: "Lineof Sight", tz_close: "TZ/Close", close_medium: "Close/Medium", medium_long: "Medium/Long",
|
||||
long_extreme: "Long/Extreme"}
|
||||
const __rangeKeyToText = {
|
||||
notapplicable: "N/A", touch: "Self Only", touchself: "Touch/Self", tz: "Threat Zone", close: "Close", medium: "Medium",
|
||||
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 {
|
||||
@ -21,7 +23,6 @@ export class PegasusUtility {
|
||||
Hooks.on('renderChatLog', (log, html, data) => PegasusUtility.chatListeners(html))
|
||||
Hooks.on('targetToken', (user, token, flag) => PegasusUtility.targetToken(user, token, flag))
|
||||
Hooks.on('renderSidebarTab', (app, html, data) => PegasusUtility.addDiceRollButton(app, html, data))
|
||||
|
||||
Hooks.on("getCombatTrackerEntryContext", (html, options) => {
|
||||
PegasusUtility.pushInitiativeOptions(html, options);
|
||||
});
|
||||
@ -33,9 +34,10 @@ export class PegasusUtility {
|
||||
this.defenderStore = {}
|
||||
this.diceList = [];
|
||||
this.diceFoundryList = [];
|
||||
this.optionsDiceList = "";
|
||||
this.buildDiceLists();
|
||||
PegasusCommands.init();
|
||||
this.optionsDiceList = ""
|
||||
this.lastRoleEffectProcess = Date.now()
|
||||
this.buildDiceLists()
|
||||
PegasusCommands.init()
|
||||
|
||||
Handlebars.registerHelper('count', function (list) {
|
||||
return (list) ? list.length : 0;
|
||||
@ -59,6 +61,16 @@ export class PegasusUtility {
|
||||
Handlebars.registerHelper('mul', function (a, 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"
|
||||
}
|
||||
|
||||
@ -134,8 +146,11 @@ export class PegasusUtility {
|
||||
static updateEffectsBonusDice(rollData) {
|
||||
let newDicePool = rollData.dicePool.filter(dice => dice.name != "effect-bonus-dice")
|
||||
for (let effect of rollData.effectsList) {
|
||||
if (effect && effect.applied && effect.type == "effect" && effect.effect.system.bonusdice) {
|
||||
newDicePool = newDicePool.concat( this.buildDicePool("effect-bonus-dice", effect.effect.system.effectlevel, 0, effect.effect.name ))
|
||||
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))
|
||||
}
|
||||
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
|
||||
@ -146,7 +161,9 @@ export class PegasusUtility {
|
||||
let newDicePool = rollData.dicePool.filter(dice => dice.name != "effect-hindrance")
|
||||
for (let hindrance of rollData.effectsList) {
|
||||
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
|
||||
@ -157,15 +174,16 @@ export class PegasusUtility {
|
||||
let newDicePool = rollData.dicePool.filter(dice => dice.name != "armor-shield")
|
||||
for (let armor of rollData.armorsList) {
|
||||
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) {
|
||||
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
|
||||
}
|
||||
|
||||
@ -176,13 +194,13 @@ export class PegasusUtility {
|
||||
let newDicePool = rollData.dicePool.filter(dice => dice.name != "damage")
|
||||
for (let weapon of rollData.weaponsList) {
|
||||
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) {
|
||||
if (weapon.applied) {
|
||||
newDicePool = newDicePool.concat( this.buildDicePool("damage", weapon.value, 0))
|
||||
newDicePool = newDicePool.concat(this.buildDicePool("damage", weapon.value, 0))
|
||||
}
|
||||
}
|
||||
rollData.dicePool = newDicePool
|
||||
@ -194,13 +212,13 @@ export class PegasusUtility {
|
||||
let newDicePool = rollData.dicePool.filter(dice => dice.name != "stat")
|
||||
let statDice = rollData.dicePool.find(dice => dice.name == "stat")
|
||||
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) {
|
||||
newDicePool = rollData.dicePool.filter(dice => dice.name != "vehiclestat")
|
||||
if (rollData.vehicleStat.currentlevel > 0 ) {
|
||||
newDicePool = newDicePool.concat( this.buildDicePool( "vehiclestat", rollData.vehicleStat.currentlevel, 0))
|
||||
if (rollData.vehicleStat.currentlevel > 0) {
|
||||
newDicePool = newDicePool.concat(this.buildDicePool("vehiclestat", rollData.vehicleStat.currentlevel, 0))
|
||||
}
|
||||
rollData.dicePool = newDicePool
|
||||
}
|
||||
@ -210,7 +228,7 @@ export class PegasusUtility {
|
||||
static updateSpecDicePool(rollData) {
|
||||
let newDicePool = rollData.dicePool.filter(dice => dice.name != "spec")
|
||||
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
|
||||
}
|
||||
@ -254,10 +272,15 @@ export class PegasusUtility {
|
||||
static async ready() {
|
||||
const specs = await PegasusUtility.loadCompendium("fvtt-pegasus-rpg.specialisations");
|
||||
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) {
|
||||
console.log("ITEM DROPPED", actor, item)
|
||||
actor.preprocessItem("none", item, false)
|
||||
let chatData = {
|
||||
user: game.user.id,
|
||||
@ -281,11 +304,16 @@ export class PegasusUtility {
|
||||
for (let token of tokensList) {
|
||||
if (x >= token.x && x <= (token.x + token.width)
|
||||
&& 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) {
|
||||
this.addItemDropToActor(token.actor, item)
|
||||
this.addItemDropToActor(token.actor, itemFull)
|
||||
} 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
|
||||
}
|
||||
@ -554,6 +582,21 @@ export class PegasusUtility {
|
||||
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) {
|
||||
return this.defenderStore[actorId];
|
||||
@ -795,10 +838,13 @@ export class PegasusUtility {
|
||||
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") {
|
||||
actor.modifyStun(+1)
|
||||
}
|
||||
if (rollData.isVehicleStun) {
|
||||
actor.modifyVehicleStun(1)
|
||||
}
|
||||
|
||||
//this.removeUsedPerkEffects( rollData) // Unused for now
|
||||
this.removeOneUseEffects(rollData) // Unused for now
|
||||
@ -899,7 +945,7 @@ export class PegasusUtility {
|
||||
let item
|
||||
if (dataItem.pack) {
|
||||
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)
|
||||
item = items[0] || undefined
|
||||
//item = await fromUuid(dataItem.pack + "." + id)
|
||||
@ -981,11 +1027,16 @@ export class PegasusUtility {
|
||||
static updateWithTarget(rollData) {
|
||||
let target = PegasusUtility.getTarget()
|
||||
if (target) {
|
||||
console.log("TARGET ", target)
|
||||
let defenderActor = target.actor
|
||||
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
|
||||
console.log("DEFENDER", defenderActor)
|
||||
console.log("Target/DEFENDER", defenderActor)
|
||||
defenderActor.addHindrancesList(rollData.effectsList)
|
||||
}
|
||||
}
|
||||
@ -1023,4 +1074,214 @@ export class PegasusUtility {
|
||||
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()
|
||||
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())
|
||||
}
|
||||
|
||||
}
|
@ -51,8 +51,8 @@ export class PegasusVehicleSheet extends ActorSheet {
|
||||
vehicleHull: duplicate(this.actor.getVehicleHull()),
|
||||
mobilityModules: duplicate(this.actor.getMobilityModules()),
|
||||
propulsionModules: duplicate(this.actor.getPropulsionModules()),
|
||||
vehicleModules: duplicate(this.actor.getVehicleModules()),
|
||||
vehicleWeaponModules: duplicate(this.actor.getVehicleWeaponModules()),
|
||||
vehicleModules: this.actor.checkAndPrepareEquipments(duplicate(this.actor.getVehicleModules())),
|
||||
vehicleWeaponModules: this.actor.checkAndPrepareEquipments(duplicate(this.actor.getVehicleWeaponModules())),
|
||||
cargos: this.actor.checkAndPrepareEquipments(duplicate(this.actor.getCargos()) ),
|
||||
cargoCurrent: this.actor.getCurrentCargoCapacity(),
|
||||
moneys: duplicate(this.actor.getMoneys()),
|
||||
@ -134,19 +134,7 @@ export class PegasusVehicleSheet extends ActorSheet {
|
||||
let itemId = li.data("item-id")
|
||||
this.actor.activateVehicleModule( itemId)
|
||||
});
|
||||
|
||||
html.find('.equip-activate').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item")
|
||||
let itemId = li.data("item-id")
|
||||
this.actor.equipActivate( itemId)
|
||||
});
|
||||
html.find('.equip-deactivate').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item")
|
||||
let itemId = li.data("item-id")
|
||||
this.actor.equipDeactivate( itemId)
|
||||
});
|
||||
|
||||
html.find('.effect-used').click(ev => {
|
||||
html.find('.effect-used').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
let itemId = li.data("item-id");
|
||||
this.actor.perkEffectUsed( itemId)
|
||||
@ -227,6 +215,9 @@ export class PegasusVehicleSheet extends ActorSheet {
|
||||
if ( statKey == "man") {
|
||||
this.actor.setTurningArc(event.currentTarget.value)
|
||||
}
|
||||
if ( statKey == "pc") {
|
||||
this.actor.updateMaxNrg(event.currentTarget.value)
|
||||
}
|
||||
})
|
||||
|
||||
html.find('.roll-stat').click((event) => {
|
||||
|
@ -293,6 +293,12 @@ table {border: 1px solid #7a7971;}
|
||||
padding: 0 3px;
|
||||
}
|
||||
|
||||
.long-editor{
|
||||
border: 2;
|
||||
height: 400px;
|
||||
padding: 0 3px;
|
||||
}
|
||||
|
||||
.medium-editor {
|
||||
border: 2;
|
||||
height: 240px;
|
||||
@ -613,6 +619,9 @@ ul, li {
|
||||
flex-grow: 2;
|
||||
margin-left: 4px;
|
||||
}
|
||||
.select-stat {
|
||||
max-width: 5rem;
|
||||
}
|
||||
.status-header-label {
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
@ -23,7 +23,7 @@
|
||||
"manifest": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/raw/branch/master/system.json",
|
||||
"compatibility": {
|
||||
"minimum": "10",
|
||||
"verified": "10.285",
|
||||
"verified": "10.286",
|
||||
"maximum": "10"
|
||||
},
|
||||
"id": "fvtt-pegasus-rpg",
|
||||
@ -253,7 +253,7 @@
|
||||
],
|
||||
"title": "Pegasus RPG",
|
||||
"url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg",
|
||||
"version": "10.0.20",
|
||||
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v10.0.20.zip",
|
||||
"version": "10.1.6",
|
||||
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v10.1.6.zip",
|
||||
"background": "systems/fvtt-pegasus-rpg/images/ui/pegasus_welcome_page.webp"
|
||||
}
|
@ -11,6 +11,7 @@
|
||||
"age": 0,
|
||||
"size": "",
|
||||
"sizenum": 0,
|
||||
"sizebonus": 0,
|
||||
"weight": "",
|
||||
"hair": "",
|
||||
"sex": "",
|
||||
@ -36,6 +37,7 @@
|
||||
"rolename": "",
|
||||
"morality": 5,
|
||||
"bonusselection": "",
|
||||
"noautobonus": false,
|
||||
"moralitythreshold": 0
|
||||
}
|
||||
},
|
||||
@ -49,6 +51,7 @@
|
||||
"abbrev": "AGI",
|
||||
"level": 1,
|
||||
"value": 1,
|
||||
"bonuseffect": 0,
|
||||
"mod": 0,
|
||||
"col": 1
|
||||
},
|
||||
@ -57,6 +60,7 @@
|
||||
"abbrev": "MND",
|
||||
"level": 1,
|
||||
"value": 1,
|
||||
"bonuseffect": 0,
|
||||
"col": 1,
|
||||
"mod": 0
|
||||
},
|
||||
@ -65,6 +69,7 @@
|
||||
"abbrev": "SOC",
|
||||
"level": 1,
|
||||
"value": 1,
|
||||
"bonuseffect": 0,
|
||||
"col": 1,
|
||||
"mod": 0
|
||||
},
|
||||
@ -73,6 +78,7 @@
|
||||
"abbrev": "STR",
|
||||
"level": 1,
|
||||
"value": 1,
|
||||
"bonuseffect": 0,
|
||||
"col": 1,
|
||||
"mod": 0
|
||||
},
|
||||
@ -81,6 +87,7 @@
|
||||
"abbrev": "PHY",
|
||||
"level": 1,
|
||||
"value": 1,
|
||||
"bonuseffect": 0,
|
||||
"col": 1,
|
||||
"mod": 0
|
||||
},
|
||||
@ -89,6 +96,7 @@
|
||||
"abbrev": "COM",
|
||||
"level": 1,
|
||||
"value": 1,
|
||||
"bonuseffect": 0,
|
||||
"col": 2,
|
||||
"mod": 0
|
||||
},
|
||||
@ -97,6 +105,7 @@
|
||||
"abbrev": "DEF",
|
||||
"level": 1,
|
||||
"value": 1,
|
||||
"bonuseffect": 0,
|
||||
"col": 2,
|
||||
"mod": 0
|
||||
},
|
||||
@ -105,6 +114,7 @@
|
||||
"abbrev": "STL",
|
||||
"level": 1,
|
||||
"value": 1,
|
||||
"bonuseffect": 0,
|
||||
"col": 2,
|
||||
"mod": 0
|
||||
},
|
||||
@ -113,6 +123,7 @@
|
||||
"abbrev": "PER",
|
||||
"level": 1,
|
||||
"value": 1,
|
||||
"bonuseffect": 0,
|
||||
"col": 2,
|
||||
"mod": 0
|
||||
},
|
||||
@ -121,6 +132,7 @@
|
||||
"abbrev": "FOC",
|
||||
"level": 1,
|
||||
"value": 1,
|
||||
"bonuseffect": 0,
|
||||
"col": 2,
|
||||
"mod": 0
|
||||
}
|
||||
@ -143,6 +155,7 @@
|
||||
"label": "MR (Initiative)",
|
||||
"type": "dice",
|
||||
"value": 0,
|
||||
"bonuseffect": 0,
|
||||
"mod": 0
|
||||
},
|
||||
"momentum": {
|
||||
@ -208,6 +221,7 @@
|
||||
"label": "FC",
|
||||
"abbrev": "fc",
|
||||
"level": 0,
|
||||
"bonuseffect": 0,
|
||||
"currentlevel": 0,
|
||||
"col": 1
|
||||
},
|
||||
@ -216,6 +230,7 @@
|
||||
"abbrev": "man",
|
||||
"dicevalue": "",
|
||||
"level": 0,
|
||||
"bonuseffect": 0,
|
||||
"currentlevel": 0,
|
||||
"turningarc45": 0,
|
||||
"col": 1
|
||||
@ -224,6 +239,7 @@
|
||||
"label": "HR",
|
||||
"abbrev": "hr",
|
||||
"level": 0,
|
||||
"bonuseffect": 0,
|
||||
"currentlevel": 0,
|
||||
"size": 0,
|
||||
"col": 2
|
||||
@ -232,6 +248,7 @@
|
||||
"label": "PC",
|
||||
"abbrev": "pc",
|
||||
"level": 0,
|
||||
"bonuseffect": 0,
|
||||
"currentlevel": 0,
|
||||
"actnrg": 0,
|
||||
"curnrg": 0,
|
||||
@ -242,6 +259,7 @@
|
||||
"label": "MR",
|
||||
"abbrev": "mr",
|
||||
"level": 0,
|
||||
"bonuseffect": 0,
|
||||
"currentlevel": 0,
|
||||
"col": 3
|
||||
},
|
||||
@ -249,6 +267,7 @@
|
||||
"label": "A/D",
|
||||
"abbrev": "ad",
|
||||
"level": 0,
|
||||
"bonuseffect": 0,
|
||||
"currentlevel": 0,
|
||||
"accmode": "",
|
||||
"currentspeed": "",
|
||||
@ -291,6 +310,8 @@
|
||||
"topspeed": "",
|
||||
"shieldlevel": 0,
|
||||
"armourlevel": 0,
|
||||
"maxshieldlevel": 0,
|
||||
"maxarmourlevel": 0,
|
||||
"is3D": false
|
||||
},
|
||||
"reararc": {
|
||||
@ -298,6 +319,8 @@
|
||||
"topspeed": "",
|
||||
"shieldlevel": 0,
|
||||
"armourlevel": 0,
|
||||
"maxshieldlevel": 0,
|
||||
"maxarmourlevel": 0,
|
||||
"is3D": false
|
||||
},
|
||||
"rightarc": {
|
||||
@ -305,6 +328,8 @@
|
||||
"topspeed": "",
|
||||
"shieldlevel": 0,
|
||||
"armourlevel": 0,
|
||||
"maxshieldlevel": 0,
|
||||
"maxarmourlevel": 0,
|
||||
"is3D": false
|
||||
},
|
||||
"leftarc": {
|
||||
@ -312,6 +337,8 @@
|
||||
"topspeed": "",
|
||||
"shieldlevel": 0,
|
||||
"armourlevel": 0,
|
||||
"maxshieldlevel": 0,
|
||||
"maxarmourlevel": 0,
|
||||
"is3D": false
|
||||
},
|
||||
"toparc": {
|
||||
@ -319,6 +346,8 @@
|
||||
"topspeed": "",
|
||||
"shieldlevel": 0,
|
||||
"armourlevel": 0,
|
||||
"maxshieldlevel": 0,
|
||||
"maxarmourlevel": 0,
|
||||
"is3D": true
|
||||
},
|
||||
"bottomarc": {
|
||||
@ -326,6 +355,8 @@
|
||||
"topspeed": "",
|
||||
"shieldlevel": 0,
|
||||
"armourlevel": 0,
|
||||
"maxshieldlevel": 0,
|
||||
"maxarmourlevel": 0,
|
||||
"is3D": true
|
||||
}
|
||||
}
|
||||
@ -385,6 +416,7 @@
|
||||
"recoveryrollspec": [],
|
||||
"effectstatlevel": false,
|
||||
"effectstat": "",
|
||||
"affectsize": false,
|
||||
"oneuse": false,
|
||||
"ignorehealthpenalty": false,
|
||||
"isthispossible": "",
|
||||
@ -394,6 +426,10 @@
|
||||
"physicalimmunity": false,
|
||||
"nobonusdice": false,
|
||||
"noperksallowed": false,
|
||||
"affectstatus": false,
|
||||
"affectedstatus": "",
|
||||
"locked": false,
|
||||
"droptext": "",
|
||||
"description": ""
|
||||
},
|
||||
"race": {
|
||||
@ -425,7 +461,8 @@
|
||||
"specincrease": [],
|
||||
"perks": [],
|
||||
"perksrole": "",
|
||||
"description": ""
|
||||
"description": "",
|
||||
"rolelevel": 1
|
||||
},
|
||||
"ability": {
|
||||
"affectedstat": "str",
|
||||
@ -548,6 +585,8 @@
|
||||
"activatedtext": "",
|
||||
"deactivatedtext": "",
|
||||
"powerlevelcost": "",
|
||||
"powerdamagetype": "",
|
||||
"powerdamagetypelevel": 0,
|
||||
"dmgroll": false,
|
||||
"dmgstatistic": "",
|
||||
"description": ""
|
||||
|
@ -302,18 +302,30 @@
|
||||
</li>
|
||||
|
||||
{{#each effects as |effect key|}}
|
||||
<li class="item stat flexrow list-item list-item-shadow" data-arme-id="{{effect.id}}"
|
||||
data-item-id="{{effect._id}}">
|
||||
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
|
||||
src="{{effect.img}}" /></a>
|
||||
<li class="item stat flexrow list-item list-item-shadow" data-arme-id="{{effect.id}}" data-item-id="{{effect._id}}">
|
||||
{{#if effect.system.locked}}
|
||||
{{#if @root.isGM}}
|
||||
<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-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.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>
|
||||
<div class="item-filler"> </div>
|
||||
<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>
|
||||
</li>
|
||||
{{/each}}
|
||||
@ -857,6 +869,12 @@
|
||||
<label class="generic-label">Hair</label>
|
||||
<input type="text" class="" name="system.biodata.hair" value="{{data.biodata.hair}}" data-dtype="String" />
|
||||
</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>
|
||||
</div>
|
||||
<div>
|
||||
@ -865,6 +883,8 @@
|
||||
<label class="generic-label">Size</label>
|
||||
<input type="text" class="" name="system.biodata.sizenum" value="{{data.biodata.sizenum}}"
|
||||
data-dtype="Number" />
|
||||
<input type="text" class="" value="{{add data.biodata.sizenum data.biodata.sizebonus}}"
|
||||
data-dtype="Number" disabled />
|
||||
</li>
|
||||
<li class="flexrow item">
|
||||
<label class="generic-label">Origin</label>
|
||||
|
@ -45,6 +45,10 @@
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{#if power}}
|
||||
<li>Power Damage type : {{power.system.powerdamagetype}} {{power.system.powerdamagetypelevel}}</li>
|
||||
{{/if}}
|
||||
|
||||
{{#if isResistance}}
|
||||
<li><strong>Defense Result : {{finalScore}}</strong>
|
||||
{{else}}
|
||||
|
@ -5,8 +5,8 @@
|
||||
{{/if}}
|
||||
<div>{{name}} has just activated the Perk: {{perk.name}}.</div>
|
||||
|
||||
{{#if (count perk.data.activatedtext)}}
|
||||
<div>{{perk.data.activatedtext}}</div>
|
||||
{{#if (count perk.system.activatedtext)}}
|
||||
<div>{{perk.system.activatedtext}}</div>
|
||||
{{/if}}
|
||||
|
||||
</div>
|
||||
|
@ -5,8 +5,8 @@
|
||||
{{/if}}
|
||||
<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)}}
|
||||
<div>{{perk.data.deactivatedtext}}</div>
|
||||
{{#if (count perk.system.deactivatedtext)}}
|
||||
<div>{{perk.system.deactivatedtext}}</div>
|
||||
{{/if}}
|
||||
|
||||
</div>
|
||||
|
@ -34,6 +34,27 @@
|
||||
</select>
|
||||
</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>
|
||||
<label class="attribute-value checkbox"><input type="checkbox" name="system.oneuse" {{checked data.oneuse}}/></label>
|
||||
</li>
|
||||
@ -61,23 +82,28 @@
|
||||
<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>
|
||||
</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 class="flexrow"><label class="generic-label">Locked (Only GM can change/edit) ?</label>
|
||||
<label class="attribute-value checkbox"><input type="checkbox" name="system.locked" {{checked data.locked}}/></label>
|
||||
</li>
|
||||
<li class="flexrow"><label class="generic-label">Display Text when added to Actor</label>
|
||||
<input type="text" class="input-numeric-short padd-right" name="system.droptext" value="{{data.droptext}}" data-dtype="String"/>
|
||||
</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}}
|
||||
<li class="flexrow"><label class="generic-label">Affect Status?</label>
|
||||
<label class="attribute-value checkbox"><input type="checkbox" name="system.affectstatus" {{checked data.affectstatus}}/></label>
|
||||
</li>
|
||||
{{#if data.affectstatus}}
|
||||
<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>
|
||||
</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}}
|
||||
|
||||
<li class="flexrow"> <label class="generic-label">Affected Specialisations </label></li>
|
||||
|
@ -13,25 +13,29 @@
|
||||
|
||||
<div class="tab description" data-group="primary" data-tab="description">
|
||||
<div class="medium-editor item-text-long-line">
|
||||
<label class="generic-label">Description</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>
|
||||
<label class="generic-label"><strong>Power Ups</strong></label>
|
||||
{{editor purchasedeffects target="system.purchasedeffects" button=true owner=owner
|
||||
editable=editable}}
|
||||
</div>
|
||||
<span><label> </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> </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 class="tab details" data-group="primary" data-tab="details">
|
||||
<ul>
|
||||
<li class="flexrow"><label class="generic-label">Roll Needed ?</label>
|
||||
<label class="attribute-value checkbox"><input type="checkbox" name="system.rollneeded" {{checked
|
||||
data.rollneeded}} /></label>
|
||||
<label class="attribute-value checkbox">
|
||||
<input type="checkbox" name="system.rollneeded" {{checked data.rollneeded}} /></label>
|
||||
</li>
|
||||
{{#if data.rollneeded}}
|
||||
<li class="flexrow"><label class="generic-label">Related Statistic (only if roll is needed)</label>
|
||||
@ -104,14 +108,22 @@
|
||||
data.dmgroll}} /></label>
|
||||
</li>
|
||||
{{#if data.dmgroll}}
|
||||
<li class="flexrow"><label class="generic-label">Related DMG Statistic </label>
|
||||
<select class="competence-base flexrow" type="text" name="system.dmgstatistic" value="{{data.dmgstatistic}}"
|
||||
data-dtype="String">
|
||||
{{#select data.dmgstatistic}}
|
||||
{{> systems/fvtt-pegasus-rpg/templates/partial-options-statistics.html}}
|
||||
{{/select}}
|
||||
</select>
|
||||
</li>
|
||||
<li class="flexrow"><label class="generic-label">Related DMG Statistic </label>
|
||||
<select class="competence-base flexrow" type="text" name="system.dmgstatistic" value="{{data.dmgstatistic}}"
|
||||
data-dtype="String">
|
||||
{{#select data.dmgstatistic}}
|
||||
{{> systems/fvtt-pegasus-rpg/templates/partial-options-statistics.html}}
|
||||
{{/select}}
|
||||
</select>
|
||||
</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}}
|
||||
|
||||
<li class="flexrow"><label class="generic-label">When purchased display text</label>
|
||||
|
@ -1,80 +1,92 @@
|
||||
<form class="{{cssClass}}" autocomplete="off">
|
||||
<header class="sheet-header">
|
||||
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}"/>
|
||||
<div class="header-fields">
|
||||
<h1 class="charname">
|
||||
<input name="name" type="text" value="{{name}}" placeholder="Name"/>
|
||||
</h1>
|
||||
</div>
|
||||
</header>
|
||||
{{> systems/fvtt-pegasus-rpg/templates/partial-item-nav.html}}
|
||||
<header class="sheet-header">
|
||||
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}" />
|
||||
<div class="header-fields">
|
||||
<h1 class="charname">
|
||||
<input name="name" type="text" value="{{name}}" placeholder="Name" />
|
||||
</h1>
|
||||
</div>
|
||||
</header>
|
||||
{{> systems/fvtt-pegasus-rpg/templates/partial-item-nav.html}}
|
||||
|
||||
{{!-- Sheet Body --}}
|
||||
<section class="sheet-body">
|
||||
{{!-- 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">
|
||||
<ul>
|
||||
<li class="flexrow"><label class="generic-label">Stat increase 1</label>
|
||||
<select class="competence-base flexrow" type="text" name="system.statincrease1" value="{{data.statincrease1}}" data-dtype="String">
|
||||
{{#select data.statincrease1}}
|
||||
{{> systems/fvtt-pegasus-rpg/templates/partial-options-statistics.html notapplicable=false mr=false}}
|
||||
{{/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>
|
||||
<div class="tab details" data-group="primary" data-tab="details">
|
||||
<ul>
|
||||
<li class="flexrow"><label class="generic-label">Role Level</label>
|
||||
<input type="text" class="input-numeric-short padd-right" name="system.rolelevel" value="{{data.rolelevel}}"
|
||||
data-dtype="Number" />
|
||||
</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>
|
||||
{{#each data.specialability as |ability idx|}}
|
||||
<li class="flexrow">
|
||||
<label name="system.specialability[{{idx}}].name"><a class="view-subitem" data-type="specialability" data-index="{{idx}}">{{ability.name}}</a></label>
|
||||
<div class="item-controls padd-left">
|
||||
<a class="item-control delete-subitem padd-left" data-type="specialability" data-index="{{idx}}" title="Delete Ability"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
<li class="flexrow"><label class="generic-label">Stat increase 1</label>
|
||||
<select class="competence-base flexrow" type="text" name="system.statincrease1" value="{{data.statincrease1}}"
|
||||
data-dtype="String">
|
||||
{{#select data.statincrease1}}
|
||||
{{> systems/fvtt-pegasus-rpg/templates/partial-options-statistics.html notapplicable=false mr=false}}
|
||||
{{/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">
|
||||
<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 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>
|
||||
{{#each data.specialability as |ability idx|}}
|
||||
<li class="flexrow">
|
||||
<label name="system.specialability[{{idx}}].name"><a class="view-subitem" data-type="specialability"
|
||||
data-index="{{idx}}">{{ability.name}}</a></label>
|
||||
<div class="item-controls padd-left">
|
||||
<a class="item-control delete-subitem padd-left" data-type="specialability" data-index="{{idx}}"
|
||||
title="Delete Ability"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
</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>
|
||||
<select class="competence-base flexrow" type="text" name="system.perksrole" value="{{data.perksrole}}" data-dtype="String">
|
||||
{{#select data.perksrole}}
|
||||
<option value="agitator">Agitator</option>
|
||||
<option value="defender">Defender</option>
|
||||
<option value="enhancer">Enhancer</option>
|
||||
<option value="scrapper">Scrapper</option>
|
||||
<option value="ranged">Ranged</option>
|
||||
<option value="tactician">Tactician</option>
|
||||
{{/select}}
|
||||
</select>
|
||||
</li>
|
||||
<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 data.perksrole}}
|
||||
<option value="agitator">Agitator</option>
|
||||
<option value="defender">Defender</option>
|
||||
<option value="enhancer">Enhancer</option>
|
||||
<option value="scrapper">Scrapper</option>
|
||||
<option value="ranged">Ranged</option>
|
||||
<option value="tactician">Tactician</option>
|
||||
{{/select}}
|
||||
</select>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
</section>
|
||||
</form>
|
@ -105,8 +105,8 @@
|
||||
|
||||
|
||||
<li class="flexrow"><label class="generic-label">Turret</label>
|
||||
<select class="competence-base flexrow" type="text" name="system.turret" value="{{data.turret}}" data-dtype="Number">
|
||||
{{#select data.turret}} F Front, F Left, F Right, F Rear, F Up, F Down, T 180 Front, T 180 Left, T 180 Rear, T 180 Right, T 360
|
||||
<select class="competence-base flexrow" type="text" name="system.turret" value="{{data.turret}}" data-dtype="String">
|
||||
{{#select data.turret}}
|
||||
<option value="ffront">F Front</option>
|
||||
<option value="fleft">F Left</option>
|
||||
<option value="fright">F Right</option>
|
||||
|
@ -47,7 +47,7 @@
|
||||
<li class="item flexrow list-item" data-item-id="{{trait.id}}">
|
||||
<img class="sheet-competence-img" src="{{trait.img}}"/>
|
||||
<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">
|
||||
<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>
|
||||
@ -103,17 +103,17 @@
|
||||
<img class="sheet-competence-img" src="{{weapon.img}}"/>
|
||||
<span class="stat-label">{{weapon.name}}</span>
|
||||
<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-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
<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>
|
||||
<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>{{> "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>
|
||||
</ul>
|
||||
{{/each}}
|
||||
@ -151,7 +151,7 @@
|
||||
<span class="equipement-label">{{equip.name}}</span>
|
||||
<span class="equipement-label">{{equip.type}}</span>
|
||||
<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-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
|
@ -24,7 +24,7 @@
|
||||
{{/if}}
|
||||
</span>
|
||||
<span class="item-field-label-short">
|
||||
{{#if equip.data.iscontainer}}
|
||||
{{#if equip.system.iscontainer}}
|
||||
{{equip.system.contentsEnc}}
|
||||
{{else}}
|
||||
{{mul equip.system.weight equip.system.quantity}}
|
||||
@ -32,7 +32,7 @@
|
||||
</span>
|
||||
<span class="item-field-label-medium">
|
||||
{{#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}}
|
||||
-
|
||||
{{/if}}
|
||||
|
@ -5,12 +5,15 @@
|
||||
<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>
|
||||
</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}}>
|
||||
{{#select stat.value}}
|
||||
{{{@root.optionsDiceList}}}
|
||||
{{/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}}"
|
||||
data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}} />
|
||||
</li>
|
@ -18,7 +18,7 @@
|
||||
</label>
|
||||
</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}}.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"/>
|
||||
</li>
|
||||
{{/each}}
|
||||
@ -27,7 +27,7 @@
|
||||
<label class="status-small-label"><strong>{{data.nrg.label}}</strong></label>
|
||||
</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.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"/>
|
||||
<span class="small-label status-small-label"> / {{data.nrg.absolutemax}}</span>
|
||||
</li>
|
||||
|
@ -17,13 +17,13 @@
|
||||
</li>
|
||||
{{else}}
|
||||
|
||||
{{#if (eq effect.effect.data.stataffected "powerroll")}}
|
||||
{{#if (eq effect.effect.system.stataffected "powerroll")}}
|
||||
<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="generic-label">{{effect.label}} ({{effect.value}})</label>
|
||||
</li>
|
||||
{{/if}}
|
||||
{{#if (eq effect.effect.data.stataffected "powerdmgroll")}}
|
||||
{{#if (eq effect.effect.system.stataffected "powerdmgroll")}}
|
||||
<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="generic-label">{{effect.label}} ({{effect.value}})</label>
|
||||
|
@ -9,9 +9,15 @@
|
||||
<span class="item-field-label-long">
|
||||
<label class="short-label">Shield</label>
|
||||
</span>
|
||||
<span class="item-field-label-short">
|
||||
<label class="short-label">Max</label>
|
||||
</span>
|
||||
<span class="item-field-label-long">
|
||||
<label class="short-label">Armour</label>
|
||||
</span>
|
||||
<span class="item-field-label-short">
|
||||
<label class="short-label">Max</label>
|
||||
</span>
|
||||
</li>
|
||||
<li class="item flexrow list-item list-item-shadow" data-arc-name="{{idx}}">
|
||||
|
||||
@ -31,16 +37,18 @@
|
||||
{{#select arc.shieldlevel}}
|
||||
{{{@root.optionsDiceList}}}
|
||||
{{/select}}
|
||||
</select>
|
||||
</select>
|
||||
</span>
|
||||
<span class="item-field-label-short"><label class="short-label">{{getDice arc.maxshieldlevel}}</label></span>
|
||||
|
||||
<span class="item-field-label-long">
|
||||
<select type="text" name="system.arcs.{{idx}}.armourlevel" value="{{arc.armourlevel}}" data-dtype="Number">
|
||||
{{#select arc.armourlevel}}
|
||||
{{{@root.optionsDiceList}}}
|
||||
{{/select}}
|
||||
</select>
|
||||
</select>
|
||||
</span>
|
||||
<span class="item-field-label-short"><label class="short-label">{{getDice arc.maxarmourlevel}}</label></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -14,7 +14,7 @@
|
||||
</span>
|
||||
<select class="status-small-label color-class-common" type="text" name="system.statistics.{{key}}.level"
|
||||
value="{{stat.level}}" data-dtype="Number" disabled>
|
||||
{{#select stat.level}}
|
||||
{{#select (add stat.level stat.bonuseffect)}}
|
||||
{{#if (eq key "ad")}}
|
||||
{{{@root.optionsLevel}}}
|
||||
{{else}}
|
||||
|
@ -115,14 +115,13 @@
|
||||
<option value="none0">==== Combat Arcs</option>
|
||||
<option value="d4">Combat Arc Flank (Grey) d4</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="d4">Slight cover d4</option>
|
||||
<option value="d8">Half cover d8</option>
|
||||
<option value="d12">Full cover d12</option>
|
||||
<option value="d12">Full cover d12</option>
|
||||
<option value="none2">===== Cover Damage Resistance</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="d10">Thick cover d10</option>
|
||||
<option value="d12">Solid cover d12</option>
|
||||
@ -131,7 +130,7 @@
|
||||
<option value="d6">Outnumbered 2 Extra Allies d6</option>
|
||||
<option value="d8">Outnumbered 3 Extra Allies d8</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="d12">Eyes/head d12<option>
|
||||
<option value="none4">===== Impact DMG Bonus</option>
|
||||
|
@ -456,10 +456,10 @@
|
||||
<span class="item-name-label-header-long">
|
||||
<h3><label class="items-title-text">Vehicles modules</label></h3>
|
||||
</span>
|
||||
<span class="item-field-label-long">
|
||||
<span class="item-field-label-medium">
|
||||
<label class="short-label">Category</label>
|
||||
</span>
|
||||
<span class="item-field-label-long">
|
||||
<span class="item-field-label-medium">
|
||||
<label class="short-label">Location</label>
|
||||
</span>
|
||||
<span class="item-field-label-long">
|
||||
@ -480,12 +480,20 @@
|
||||
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
|
||||
src="{{vehiclemod.img}}" /></a>
|
||||
<span class="item-name-label-long"><a class="roll-spec">{{vehiclemod.name}}</a></span>
|
||||
<span class="item-field-label-long">{{vehiclemod.system.category}}</span>
|
||||
<span class="item-field-label-long">{{vehiclemod.system.location}}</span>
|
||||
<span class="item-field-label-medium">{{vehiclemod.system.category}}</span>
|
||||
<span class="item-field-label-medium">{{vehiclemod.system.location}}</span>
|
||||
<span class="item-field-label-long">{{vehiclemod.system.security}}</span>
|
||||
<span class="item-field-label-short">{{vehiclemod.system.nrg}}</span>
|
||||
<span class="item-field-label-medium">{{vehiclemod.system.range}}</span>
|
||||
<span class="item-field-label-short">{{vehiclemod.system.idr}}</span>
|
||||
|
||||
<span class="item-field-label-short">
|
||||
{{#if vehiclemod.system.idrDice}}
|
||||
<a class="roll-idr" data-dice-value="{{vehiclemod.system.idrDice}}">{{vehiclemod.system.idrDice}}</a>
|
||||
{{else}}
|
||||
-
|
||||
{{/if}}
|
||||
</span>
|
||||
|
||||
<div class="item-filler"> </div>
|
||||
<div class="item-controls item-controls-fixed">
|
||||
<a class="item-control vehicle-module-activate" title="Activated">{{#if vehiclemod.system.activated}}<i
|
||||
@ -501,10 +509,10 @@
|
||||
<span class="item-name-label-header-long">
|
||||
<h3><label class="items-title-text">Vehicles weapons</label></h3>
|
||||
</span>
|
||||
<span class="item-field-label-long">
|
||||
<span class="item-field-label-medium">
|
||||
<label class="short-label">Site</label>
|
||||
</span>
|
||||
<span class="item-field-label-long">
|
||||
<span class="item-field-label-medium">
|
||||
<label class="short-label">Location</label>
|
||||
</span>
|
||||
<span class="item-field-label-short">
|
||||
@ -528,13 +536,21 @@
|
||||
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
|
||||
src="{{weapon.img}}" /></a>
|
||||
<span class="item-name-label-long"><a class="roll-spec">{{weapon.name}}</a></span>
|
||||
<span class="item-field-label-long">{{weapon.system.site}}</span>
|
||||
<span class="item-field-label-long">{{weapon.system.location}}</span>
|
||||
<span class="item-field-label-medium">{{weapon.system.site}}</span>
|
||||
<span class="item-field-label-medium">{{weapon.system.location}}</span>
|
||||
<span class="item-field-label-short">{{weapon.system.dmg}}</span>
|
||||
<span class="item-field-label-medium">{{weapon.system.aoe}}</span>
|
||||
<span class="item-field-label-medium">{{weapon.system.turrent}}</span>
|
||||
<span class="item-field-label-short">{{weapon.system.nrg}}</span>
|
||||
<span class="item-field-label-short">{{weapon.system.idr}}</span>
|
||||
|
||||
<span class="item-field-label-short">
|
||||
{{#if weapon.system.idrDice}}
|
||||
<a class="roll-idr" data-dice-value="{{weapon.system.idrDice}}">{{weapon.system.idrDice}}</a>
|
||||
{{else}}
|
||||
-
|
||||
{{/if}}
|
||||
</span>
|
||||
|
||||
<div class="item-filler"> </div>
|
||||
<div class="item-controls item-controls-fixed">
|
||||
<a class="item-control vehicle-weapon-activate" title="Activated">{{#if weapon.system.activated}}<i
|
||||
|
Reference in New Issue
Block a user