Compare commits

...

10 Commits

Author SHA1 Message Date
dc07b27801 Minor changes 2023-09-14 23:23:16 +02:00
2394026d0c Minor changes 2023-09-14 21:03:08 +02:00
47db569efd Add hindrance dice 2023-09-13 21:26:47 +02:00
ba98d9c264 Add hindrance dice 2023-09-13 21:25:44 +02:00
c1eb33bc21 Add new init system 2023-09-13 17:37:30 +02:00
d5f27ae9ea Manage hindrance dices 2023-09-13 08:06:08 +02:00
b81e5ec17e Switch to v11 2023-09-11 20:35:03 +02:00
6a3cb66391 Switch to v11 2023-09-11 20:34:33 +02:00
ba50c86800 Addd gitignore 2023-09-11 20:34:15 +02:00
8cc2380f0a Sync compendiums 2022-11-30 12:00:09 +01:00
25 changed files with 790 additions and 210 deletions

14
.gitignore vendored Normal file
View File

@ -0,0 +1,14 @@
.vscode/settings.json
.idea
.history
todo.md
/.vscode
/ignored/
/node_modules/
/jsconfig.json
/package.json
/package-lock.json
/packs/*/
/packs/*/CURRENT
/packs/*/LOG
/packs/*/LOCK

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

View File

@ -1,25 +1,33 @@
{ {
"ITEM": { "TYPES": {
"TypeRace": "Race", "Actor": {
"TypeRole": "Role", "character": "Character",
"TypeAbility": "Ability", "npc": "NPC",
"TypeSpecialisation": "Specialisation", "vehicle": "Vehicle"
"TypePerk": "Perk", },
"TypePower": "Power", "Item": {
"TypeArmor": "Armor", "race": "Race",
"TypeShield": "Shield", "role": "Role",
"TypeEquipment": "Equipment", "ability": "Ability",
"TypeWeapon": "Weapon", "specialisation": "Specialisation",
"TypeEffect": "Effect", "perk": "Perk",
"TypeMoney": "Money", "power": "Power",
"TypeVirtue": "Virtue", "armor": "Armor",
"TypeVice": "Vice", "shield": "Shield",
"TypeVehiclehull": "Vehicule Hull", "equipment": "Equipment",
"TypePowercoremodule": "Power Core Module", "weapon": "Weapon",
"TypeMobilitymodule": "Mobility Module", "effect": "Effect",
"TypeCombatmodule": "Combat Module", "money": "Money",
"TypeVehiclemodule": "Vehicle Module", "virtue": "Virtue",
"TypeVehicleweaponmodule" : "Vehicle Weapon Module", "vice": "Vice",
"TypePropulsionmodule": "Propulsion module" "vehiclehull": "Vehicule Hull",
} "powercoremodule": "Power Core Module",
"mobilitymodule": "Mobility Module",
"combatmodule": "Combat Module",
"vehiclemodule": "Vehicle Module",
"vehicleweaponmodule" : "Vehicle Weapon Module",
"propulsionmodule": "Propulsion module"
}
}
} }

View File

@ -41,6 +41,7 @@ export class PegasusActorSheet extends ActorSheet {
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)), effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
limited: this.object.limited, limited: this.object.limited,
specs: this.actor.getSpecs( ), specs: this.actor.getSpecs( ),
config: game.system.pegasus.config,
optionsDiceList: PegasusUtility.getOptionsDiceList(), optionsDiceList: PegasusUtility.getOptionsDiceList(),
optionsLevel: PegasusUtility.getOptionsLevel(), optionsLevel: PegasusUtility.getOptionsLevel(),
weapons: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getWeapons()) ), weapons: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getWeapons()) ),
@ -53,7 +54,7 @@ export class PegasusActorSheet extends ActorSheet {
powers: duplicate(this.actor.getPowers()), powers: duplicate(this.actor.getPowers()),
subActors: duplicate(this.actor.getSubActors()), subActors: duplicate(this.actor.getSubActors()),
race: duplicate(this.actor.getRace()), race: duplicate(this.actor.getRace()),
role: duplicate(this.actor.getRole()), role: this.actor.getRole(),
effects: duplicate(this.actor.getEffects()), effects: duplicate(this.actor.getEffects()),
moneys: duplicate(this.actor.getMoneys()), moneys: duplicate(this.actor.getMoneys()),
virtues: duplicate(this.actor.getVirtues()), virtues: duplicate(this.actor.getVirtues()),

View File

@ -92,9 +92,7 @@ export class PegasusActor extends Actor {
return actor; return actor;
} }
if (data.type == 'character') { if (data.type == 'character'|| this.type == 'npc') {
}
if (data.type == 'npc') {
} }
@ -112,11 +110,19 @@ export class PegasusActor extends Actor {
/* -------------------------------------------- */ /* -------------------------------------------- */
prepareDerivedData() { prepareDerivedData() {
if (this.system.secondary.stealthhealth) {
this.update({ "system.secondary": { "-=stealthhealth": null } })
}
if (this.system.secondary.socialhealth) {
this.update({ "system.secondary": { "-=socialhealth": null } })
}
if (!this.traumaState) { if (!this.traumaState) {
this.traumaState = "none" this.traumaState = "none"
} }
if (this.type == 'character') { if (this.type == 'character' || this.type == 'npc') {
this.computeNRGHealth(); this.computeNRGHealth();
this.system.encCapacity = this.getEncumbranceCapacity() this.system.encCapacity = this.getEncumbranceCapacity()
this.buildContainerTree() this.buildContainerTree()
@ -275,8 +281,8 @@ export class PegasusActor extends Actor {
return race[0] ?? []; return race[0] ?? [];
} }
getRole() { getRole() {
let role = this.items.filter(item => item.type == 'role') let role = this.items.find(item => item.type == 'role')
return role[0] ?? []; return role;
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
getRoleLevel() { getRoleLevel() {
@ -668,7 +674,7 @@ export class PegasusActor extends Actor {
for (let spec of specThreat) { for (let spec of specThreat) {
tl += PegasusUtility.getDiceValue(spec.system.level) tl += PegasusUtility.getDiceValue(spec.system.level)
} }
tl += this.system.nrg.absolutemax + this.system.secondary.health.max + this.system.secondary.delirium.max tl += this.system.nrg.absolutemax /* NO MORE USED + this.system.secondary.health.max + this.system.secondary.delirium.max*/
tl += this.getPerks().length * 5 tl += this.getPerks().length * 5
let weapons = this.getWeapons() let weapons = this.getWeapons()
@ -758,10 +764,11 @@ export class PegasusActor extends Actor {
/* -------------------------------------------- */ /* -------------------------------------------- */
modifyStun(incDec) { modifyStun(incDec) {
let combat = duplicate(this.system.combat) let myself = this
let combat = duplicate(myself.system.combat)
combat.stunlevel += incDec combat.stunlevel += incDec
if (combat.stunlevel >= 0) { if (combat.stunlevel >= 0) {
this.update({ 'system.combat': combat }) myself.update({ 'system.combat': combat })
let chatData = { let chatData = {
user: game.user.id, user: game.user.id,
rollMode: game.settings.get("core", "rollMode"), rollMode: game.settings.get("core", "rollMode"),
@ -780,11 +787,12 @@ export class PegasusActor extends Actor {
if (stunAbove > 0) { if (stunAbove > 0) {
ChatMessage.create({ content: `${this.name} Stun threshold has been exceeded.` }) ChatMessage.create({ content: `${this.name} Stun threshold has been exceeded.` })
} }
/* NO MORE AUTOMATION HERE
if (incDec > 0 && stunAbove > 0) { if (incDec > 0 && stunAbove > 0) {
let delirium = duplicate(this.system.secondary.delirium) let delirium = duplicate(myself.system.secondary.delirium)
delirium.value -= incDec delirium.value -= incDec
this.update({ 'system.secondary.delirium': delirium }) myself.update({ 'system.secondary.delirium': delirium })
} }*/
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -949,13 +957,13 @@ export class PegasusActor extends Actor {
async equipGear(equipmentId) { async equipGear(equipmentId) {
let item = this.items.find(item => item.id == equipmentId); let item = this.items.find(item => item.id == equipmentId);
if (item && item.system) { if (item && item.system) {
let update = { _id: item.id, "data.equipped": !item.system.equipped }; let update = { _id: item.id, "system.equipped": !item.system.equipped };
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
} }
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
getInitiativeScore(combatId, combatantId) { getInitiativeScore(combatId, combatantId) {
if (this.type == 'character') { if (this.type == 'character' || this.type == 'npc') {
this.rollMR(true, combatId, combatantId) this.rollMR(true, combatId, combatantId)
} }
if (this.type == 'vehicle') { if (this.type == 'vehicle') {
@ -1006,7 +1014,7 @@ export class PegasusActor extends Actor {
/* -------------------------------------------- */ /* -------------------------------------------- */
getStat(statKey) { getStat(statKey) {
let stat let stat
if (this.type == "character" && statKey == 'mr') { if ((this.type == "character" || this.type == 'npc') && statKey == 'mr') {
stat = duplicate(this.system.mr) stat = duplicate(this.system.mr)
} else { } else {
stat = duplicate(this.system.statistics[statKey]) stat = duplicate(this.system.statistics[statKey])
@ -1144,7 +1152,7 @@ export class PegasusActor extends Actor {
async updatePerkUsed(itemId, index, checked) { async updatePerkUsed(itemId, index, checked) {
let item = this.items.get(itemId) let item = this.items.get(itemId)
if (item && index) { if (item && index) {
let key = "data.used" + index let key = "system.used" + index
await this.updateEmbeddedDocuments('Item', [{ _id: itemId, [`${key}`]: checked }]) await this.updateEmbeddedDocuments('Item', [{ _id: itemId, [`${key}`]: checked }])
item = this.items.get(itemId) // Refresh item = this.items.get(itemId) // Refresh
if (item.system.nbuse == "next1action" && item.system.used1) { if (item.system.nbuse == "next1action" && item.system.used1) {
@ -1183,7 +1191,7 @@ export class PegasusActor extends Actor {
/* -------------------------------------------- */ /* -------------------------------------------- */
incDecNRG(value) { incDecNRG(value) {
if (this.type == "character") { if (this.type == "character" || this.type == 'npc') {
let nrg = duplicate(this.system.nrg) let nrg = duplicate(this.system.nrg)
nrg.value += value nrg.value += value
if (nrg.value >= 0 && nrg.value <= nrg.max) { if (nrg.value >= 0 && nrg.value <= nrg.max) {
@ -1236,6 +1244,7 @@ export class PegasusActor extends Actor {
nrg.max += item.system.features.nrgcost.value nrg.max += item.system.features.nrgcost.value
await this.update({ 'system.nrg': nrg }) await this.update({ 'system.nrg': nrg })
} }
/* NO MORE USED
if (item.system.features.bonushealth.flag) { if (item.system.features.bonushealth.flag) {
let health = duplicate(this.system.secondary.health) let health = duplicate(this.system.secondary.health)
health.value -= Number(item.system.features.bonushealth.value) || 0 health.value -= Number(item.system.features.bonushealth.value) || 0
@ -1253,7 +1262,7 @@ export class PegasusActor extends Actor {
nrg.value -= Number(item.system.features.bonusnrg.value) || 0 nrg.value -= Number(item.system.features.bonusnrg.value) || 0
nrg.max -= Number(item.system.features.bonusnrg.value) || 0 nrg.max -= Number(item.system.features.bonusnrg.value) || 0
await this.update({ 'system.nrg': nrg }) await this.update({ 'system.nrg': nrg })
} }*/
this.disableWeaverPerk(item) this.disableWeaverPerk(item)
PegasusUtility.createChatWithRollMode(item.name, { PegasusUtility.createChatWithRollMode(item.name, {
content: await renderTemplate(`systems/fvtt-pegasus-rpg/templates/chat-perk-ready.html`, { name: this.name, perk: duplicate(item) }) content: await renderTemplate(`systems/fvtt-pegasus-rpg/templates/chat-perk-ready.html`, { name: this.name, perk: duplicate(item) })
@ -1286,6 +1295,7 @@ export class PegasusActor extends Actor {
ui.notifications.warn("Not enough NRG to activate the Perk " + item.name) ui.notifications.warn("Not enough NRG to activate the Perk " + item.name)
} }
} }
/* NO MORE USED
if (item.system.features.bonushealth.flag) { if (item.system.features.bonushealth.flag) {
let health = duplicate(this.system.secondary.health) let health = duplicate(this.system.secondary.health)
health.value += Number(item.system.features.bonushealth.value) || 0 health.value += Number(item.system.features.bonushealth.value) || 0
@ -1297,7 +1307,7 @@ export class PegasusActor extends Actor {
delirium.value += Number(item.system.features.bonusdelirium.value) || 0 delirium.value += Number(item.system.features.bonusdelirium.value) || 0
delirium.max += Number(item.system.features.bonusdelirium.value) || 0 delirium.max += Number(item.system.features.bonusdelirium.value) || 0
await this.update({ 'system.secondary.delirium': delirium }) await this.update({ 'system.secondary.delirium': delirium })
} }*/
if (item.system.features.bonusnrg.flag) { if (item.system.features.bonusnrg.flag) {
let nrg = duplicate(this.system.nrg) let nrg = duplicate(this.system.nrg)
nrg.value += Number(item.system.features.bonusnrg.value) || 0 nrg.value += Number(item.system.features.bonusnrg.value) || 0
@ -1333,15 +1343,12 @@ export class PegasusActor extends Actor {
/* -------------------------------------------- */ /* -------------------------------------------- */
getTraumaState() { getTraumaState() {
this.traumaState = "none" this.traumaState = "none"
if (this.type == "character") { if (this.type == "character"|| this.type == 'npc') {
let negDelirium = -Math.floor((this.system.secondary.delirium.max + 1) / 2) if (this.system.secondary.delirium.status == "trauma") {
if (this.type == "character") { this.traumaState = "trauma"
if (this.system.secondary.delirium.value <= 0 && this.system.secondary.delirium.value >= negDelirium) { }
this.traumaState = "trauma" if (this.system.secondary.delirium.status == "severetrauma" || this.system.secondary.delirium.status == "defeated") {
} this.traumaState = "severetrauma"
if (this.system.secondary.delirium.value < negDelirium) {
this.traumaState = "severetrauma"
}
} }
} }
return this.traumaState return this.traumaState
@ -1438,6 +1445,7 @@ export class PegasusActor extends Actor {
if (this.isOwner || game.user.isGM) { if (this.isOwner || game.user.isGM) {
let updates = {} let updates = {}
/* No more used
let phyDiceValue = PegasusUtility.getDiceValue(this.system.statistics.phy.value) + this.system.secondary.health.bonus + this.system.statistics.phy.mod + PegasusUtility.getDiceValue(this.system.statistics.phy.bonuseffect); let phyDiceValue = PegasusUtility.getDiceValue(this.system.statistics.phy.value) + this.system.secondary.health.bonus + this.system.statistics.phy.mod + PegasusUtility.getDiceValue(this.system.statistics.phy.bonuseffect);
if (phyDiceValue != this.system.secondary.health.max) { if (phyDiceValue != this.system.secondary.health.max) {
updates['system.secondary.health.max'] = phyDiceValue updates['system.secondary.health.max'] = phyDiceValue
@ -1466,7 +1474,7 @@ export class PegasusActor extends Actor {
} }
if (this.computeValue) { if (this.computeValue) {
updates['system.secondary.socialhealth.value'] = socDiceValue updates['system.secondary.socialhealth.value'] = socDiceValue
} }*/
let nrgValue = PegasusUtility.getDiceValue(this.system.statistics.foc.value) + this.system.nrg.mod + this.system.statistics.foc.mod + PegasusUtility.getDiceValue(this.system.statistics.foc.bonuseffect) let nrgValue = PegasusUtility.getDiceValue(this.system.statistics.foc.value) + this.system.nrg.mod + this.system.statistics.foc.mod + PegasusUtility.getDiceValue(this.system.statistics.foc.bonuseffect)
if (nrgValue != this.system.nrg.absolutemax) { if (nrgValue != this.system.nrg.absolutemax) {
@ -1510,11 +1518,11 @@ export class PegasusActor extends Actor {
} }
let race = this.getRace() let race = this.getRace()
if (race && race.name && (race.name != this.system.biodata.racename)) { if (race?.name && (race.name != this.system.biodata.racename)) {
updates['system.biodata.racename'] = race.name updates['system.biodata.racename'] = race.name
} }
let role = this.getRole() let role = this.getRole()
if (role && role.name && (role.name != this.system.biodata.rolename)) { if (role?.name && (role.name != this.system.biodata.rolename)) {
updates['system.biodata.rolename'] = role.name updates['system.biodata.rolename'] = role.name
} }
if (Object.entries(updates).length > 0) { if (Object.entries(updates).length > 0) {
@ -1527,22 +1535,91 @@ export class PegasusActor extends Actor {
// Update current hindrance level // Update current hindrance level
let hindrance = this.system.combat.hindrancedice let hindrance = this.system.combat.hindrancedice
if (!this.checkIgnoreHealth()) { if (!this.checkIgnoreHealth()) {
if (this.system.secondary.health.value < 0) { if (this.system.secondary.health.status == "wounded") {
if (this.system.secondary.health.value < -Math.floor((this.system.secondary.health.max + 1) / 2)) { // Severe wounded hindrance += 1
hindrance += 3 }
} else { if (this.system.secondary.health.status == "severlywounded" || this.system.secondary.health.status == "defeated") {
hindrance += 1 hindrance += 3
}
} }
} }
this.system.combat.hindrancedice = hindrance this.system.combat.hindrancedice = hindrance
this.getTraumaState() this.getTraumaState()
this.cleanupPerksIfTrauma() this.cleanupPerksIfTrauma()
await this.parseStatEffects() this.parseStatEffects()
this.parseDamageValues()
await this.parseStatusEffects() await this.parseStatusEffects()
} }
} }
/* -------------------------------------------- */
getArmorResistanceBonus() {
let bonus = 0
for (let a of armors) {
bonus += Number(a.system.resistance)
}
return bonus
}
/* -------------------------------------------- */
parseDamageValues() {
if (this.system.biodata.noautobonus) { // If we are in "no-bonus mode
return
}
let updates = []
let role = this.getRole() // Get the role for optionnal bonuses
let roleBonus = 0
/* Get MDL bonus */
let meleeBonus = 0
let effects = this.items.filter(effect => effect.type == "effect" && effect.system.affectstatus && effect.system.affectstatus == "mdl" && (Number(effect.system.effectlevel) > 0))
for (let e of effects) {
meleeBonus += Number(e.system.effectlevel)
}
let weaponsMelee = this.items.filter(it => it.type == "weapon" && it.system.damagestatistic.toLowerCase() == "str")
for (let w of weaponsMelee) {
let damage = Number(w.system.damage) + this.system.biodata.sizenum + this.system.biodata.sizebonus + this.system.statistics.str.value + this.system.statistics.str.bonuseffect + meleeBonus
if (damage != w.system.mdl) {
updates.push({ _id: w.id, "system.mdl": damage })
}
}
let rangedBonus = 0
effects = this.items.filter(effect => effect.type == "effect" && effect.system.affectstatus && effect.system.affectstatus == "rdl" && (Number(effect.system.effectlevel) > 0))
for (let e of effects) {
rangedBonus += Number(e.system.effectlevel)
}
if (role?.name?.toLowerCase() == "ranged") { // Add ranged bonus to ADRL
roleBonus = this.getRoleLevel()
}
let weaponsRanged = this.items.filter(it => it.type == "weapon" && it.system.damagestatistic.toLowerCase() == "pre")
for (let w of weaponsRanged) {
let damage = roleBonus + Number(w.system.damage) + rangedBonus
if (damage != w.system.rdl) {
updates.push({ _id: w.id, "system.rdl": damage })
}
}
let armorBonus = 0
effects = this.items.filter(effect => effect.type == "effect" && effect.system.affectstatus && effect.system.affectstatus == " adrl" && (Number(effect.system.effectlevel) > 0))
for (let e of effects) {
armorBonus += Number(e.system.effectlevel)
}
roleBonus = 0
if (role?.name?.toLowerCase() == "defender") { // Add defender bonus to ADRL
roleBonus = this.getRoleLevel()
}
let armors = this.items.filter(it => it.type == "armor")
for (let a of armors) {
let adrl = roleBonus + this.system.statistics.phy.value + this.system.statistics.phy.bonuseffect + this.system.biodata.sizenum + this.system.biodata.sizebonus + a.system.resistance + armorBonus
if (adrl != a.system.adrl) {
updates.push({ _id: a.id, "system.adrl": adrl })
}
}
if (updates.length > 0) {
this.updateEmbeddedDocuments('Item', updates)
}
}
/* -------------------------------------------- */ /* -------------------------------------------- */
parseStatEffects() { parseStatEffects() {
if (this.system.biodata.noautobonus) { // If we are in "no-bonus mode if (this.system.biodata.noautobonus) { // If we are in "no-bonus mode
@ -1623,7 +1700,7 @@ export class PegasusActor extends Actor {
async modStat(key, inc = 1) { async modStat(key, inc = 1) {
let stat = duplicate(this.system.statistics[key]) let stat = duplicate(this.system.statistics[key])
stat.mod += parseInt(inc) stat.mod += parseInt(inc)
await this.update({ [`data.statistics.${key}`]: stat }) await this.update({ [`system.statistics.${key}`]: stat })
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -1631,7 +1708,7 @@ export class PegasusActor extends Actor {
key = key.toLowerCase() key = key.toLowerCase()
let stat = duplicate(this.system.statistics[key]) let stat = duplicate(this.system.statistics[key])
stat.value += parseInt(inc) stat.value += parseInt(inc)
await this.update({ [`data.statistics.${key}`]: stat }) await this.update({ [`system.statistics.${key}`]: stat })
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -1639,11 +1716,11 @@ export class PegasusActor extends Actor {
if (key == "nrg") { if (key == "nrg") {
let nrg = duplicate(this.system.nrg) let nrg = duplicate(this.system.nrg)
nrg.mod += parseInt(inc) nrg.mod += parseInt(inc)
await this.update({ [`data.nrg`]: nrg }) await this.update({ [`system.nrg`]: nrg })
} else { } else {
let status = duplicate(this.system.secondary[key]) let status = duplicate(this.system.secondary[key])
status.bonus += parseInt(inc) status.bonus += parseInt(inc)
await this.update({ [`data.secondary.${key}`]: status }) await this.update({ [`system.secondary.${key}`]: status })
} }
} }
@ -1682,7 +1759,7 @@ export class PegasusActor extends Actor {
if (objetQ) { if (objetQ) {
let newQ = objetQ.system.quantity + incDec let newQ = objetQ.system.quantity + incDec
if (newQ >= 0) { if (newQ >= 0) {
const updated = await this.updateEmbeddedDocuments('Item', [{ _id: objetQ.id, 'system.quantity': newQ }]) // pdates one EmbeddedEntity await this.updateEmbeddedDocuments('Item', [{ _id: objetQ.id, 'system.quantity': newQ }]) // pdates one EmbeddedEntity
} }
} }
} }
@ -1692,26 +1769,26 @@ export class PegasusActor extends Actor {
if (objetQ) { if (objetQ) {
let newQ = objetQ.system.ammocurrent + incDec; let newQ = objetQ.system.ammocurrent + incDec;
if (newQ >= 0 && newQ <= objetQ.system.ammomax) { if (newQ >= 0 && newQ <= objetQ.system.ammomax) {
const updated = await this.updateEmbeddedDocuments('Item', [{ _id: objetQ.id, 'system.ammocurrent': newQ }]); // pdates one EmbeddedEntity await this.updateEmbeddedDocuments('Item', [{ _id: objetQ.id, 'system.ammocurrent': newQ }]); // pdates one EmbeddedEntity
} }
} }
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
async applyAbility(ability, updates = [], directUpdate = false) { async applyAbility(ability, updates = {}, directUpdate = false) {
// manage stat bonus // manage stat bonus
if (!ability.system) { if (!ability.system) {
ability.system = ability.data ability.system = ability.data
} }
if (ability.system.affectedstat != "notapplicable") { if (ability.system.affectedstat != "notapplicable") {
if ( ability.system.affectedstat == "mr") { if (ability.system.affectedstat == "mr") {
let stat = duplicate(this.system.mr) let stat = duplicate(this.system.mr)
stat.mod += Number(ability.system.statmodifier) stat.mod += Number(ability.system.statmodifier)
updates[`system.mr`] = stat updates[`system.mr`] = stat
} else { } else {
let stat = duplicate(this.system.statistics[ability.system.affectedstat]) let stat = duplicate(this.system.statistics[ability.system.affectedstat])
stat.mod += Number(ability.system.statmodifier) stat.mod += Number(ability.system.statmodifier)
updates[`system.statistics.${ability.system.affectedstat}`] = stat updates[`system.statistics.${ability.system.affectedstat}`] = stat
} }
} }
// manage status bonus // manage status bonus
@ -1721,6 +1798,7 @@ export class PegasusActor extends Actor {
nrg.mod += Number(ability.system.statusmodifier) nrg.mod += Number(ability.system.statusmodifier)
updates[`system.nrg`] = nrg updates[`system.nrg`] = nrg
} }
/* NO MORE USED
if (ability.system.statusaffected == 'health') { if (ability.system.statusaffected == 'health') {
let health = duplicate(this.system.secondary.health) let health = duplicate(this.system.secondary.health)
health.bonus += Number(ability.system.statusmodifier) health.bonus += Number(ability.system.statusmodifier)
@ -1740,7 +1818,7 @@ export class PegasusActor extends Actor {
let stealthhealth = duplicate(this.system.secondary.stealthhealth) let stealthhealth = duplicate(this.system.secondary.stealthhealth)
stealthhealth.bonus += Number(ability.system.statusmodifier) stealthhealth.bonus += Number(ability.system.statusmodifier)
updates[`system.secondary.stealthhealth`] = delirium updates[`system.secondary.stealthhealth`] = delirium
} }*/
} }
if (directUpdate) { if (directUpdate) {
await this.update(updates) await this.update(updates)
@ -1810,7 +1888,7 @@ export class PegasusActor extends Actor {
getIncreaseStatValue(updates, statKey) { getIncreaseStatValue(updates, statKey) {
let stat = duplicate(this.system.statistics[statKey]) let stat = duplicate(this.system.statistics[statKey])
stat.value += 1; stat.value += 1;
updates[`data.statistics.${statKey}`] = stat updates[`system.statistics.${statKey}`] = stat
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -1835,10 +1913,52 @@ export class PegasusActor extends Actor {
} }
/* -------------------------------------------- */
computeCurrentHindrances() {
let hindrancesDices = 0
if (this.type == "character" || this.type == 'npc') {
if (this.system.combat.stunlevel > 0) {
hindrancesDices += 2
}
hindrancesDices += this.system.combat.hindrancedice
let overCapacity = Math.floor(this.encCurrent / this.getEncumbranceCapacity())
if (overCapacity > 0) {
hindrancesDices += overCapacity
}
let effects = this.items.filter(item => item.type == 'effect')
for (let effect of effects) {
if (effect.system.hindrance) {
hindrancesDices += effect.system.effectlevel
}
}
}
if (this.type == "vehicle") {
if (this.system.stun.value > 0) {
hindrancesDices += 2
}
if (this.isVehicleCrawling()) {
hindrancesDices += 3
}
if (this.isVehicleSlow()) {
hindrancesDices += 1
}
if (this.isVehicleAverage()) {
hindrancesDices += 1
}
if (this.isVehicleFast()) {
hindrancesDices += 3
}
if (this.isVehicleExFast()) {
hindrancesDices += 5
}
}
return hindrancesDices
}
/* -------------------------------------------- */ /* -------------------------------------------- */
addHindrancesList(effectsList) { addHindrancesList(effectsList) {
if (this.type == "character") { if (this.type == "character"|| this.type == 'npc') {
if (this.system.combat.stunlevel > 0) { if (this.system.combat.stunlevel > 0) {
effectsList.push({ label: "Stun Hindrance", type: "hindrance", foreign: true, actorId: this.id, applied: false, value: 2 }) effectsList.push({ label: "Stun Hindrance", type: "hindrance", foreign: true, actorId: this.id, applied: false, value: 2 })
} }
@ -1886,12 +2006,8 @@ export class PegasusActor extends Actor {
/* ROLL SECTION /* ROLL SECTION
/* -------------------------------------------- */ /* -------------------------------------------- */
pushEffect(rollData, effect) { pushEffect(rollData, effect) {
if (this.getTraumaState() == "none" && !this.checkNoBonusDice()) { if ((this.getTraumaState() == "none" && !this.checkNoBonusDice()) || !effect.system.bonusdice) {
rollData.effectsList.push({ label: effect.name, type: "effect", applied: false, effect: effect, value: effect.system.effectlevel }) rollData.effectsList.push({ label: effect.name, type: "effect", applied: false, effect: effect, value: effect.system.effectlevel })
} else {
if (!effect.system.bonusdice) { // Do not push bonus dice effect when TraumaState is activated
rollData.effectsList.push({ label: effect.name, type: "effect", applied: false, effect: effect, value: effect.system.effectlevel })
}
} }
} }
@ -1922,15 +2038,15 @@ export class PegasusActor extends Actor {
/* -------------------------------------------- */ /* -------------------------------------------- */
addRoleBonus(rollData, statKey, subKey) { addRoleBonus(rollData, statKey, subKey) {
let role = this.getRole() let role = this.getRole()
if (role.name.toLowerCase() == "ranged" && subKey == "ranged-dmg") { if (role && role.name.toLowerCase() == "ranged" && subKey == "ranged-dmg") {
rollData.effectsList.push({ label: "Ranged Role Bonus", type: "effect", applied: true, isdynamic: true, value: this.getRoleLevel() }) rollData.effectsList.push({ label: "Ranged Role Bonus", type: "effect", applied: true, isdynamic: true, value: this.getRoleLevel() })
rollData.dicePool = rollData.dicePool.concat(PegasusUtility.buildDicePool("effect-bonus-dice", this.getRoleLevel(), 0, "Ranged Role Bonus")) rollData.dicePool = rollData.dicePool.concat(PegasusUtility.buildDicePool("effect-bonus-dice", this.getRoleLevel(), 0, "Ranged Role Bonus"))
} }
if (role.name.toLowerCase() == "defender" && subKey == "defence") { if (role && role.name.toLowerCase() == "defender" && (subKey == "defence" || subKey == "dmg-res")) {
rollData.effectsList.push({ label: "Defender Role Bonus", type: "effect", applied: true, isdynamic: true, value: this.getRoleLevel() }) rollData.effectsList.push({ label: "Defender Role Bonus", type: "effect", applied: true, isdynamic: true, value: this.getRoleLevel() })
rollData.dicePool = rollData.dicePool.concat(PegasusUtility.buildDicePool("effect-bonus-dice", this.getRoleLevel(), 0, "Defender Role Bonus")) rollData.dicePool = rollData.dicePool.concat(PegasusUtility.buildDicePool("effect-bonus-dice", this.getRoleLevel(), 0, "Defender Role Bonus"))
} }
if (role.name.toLowerCase() == "scrapper" && statKey == "com") { if (role && role.name.toLowerCase() == "scrapper" && statKey == "com") {
rollData.effectsList.push({ label: "Scrapper Role Bonus", type: "effect", applied: true, isdynamic: true, value: this.getRoleLevel() }) rollData.effectsList.push({ label: "Scrapper Role Bonus", type: "effect", applied: true, isdynamic: true, value: this.getRoleLevel() })
rollData.dicePool = rollData.dicePool.concat(PegasusUtility.buildDicePool("effect-bonus-dice", this.getRoleLevel(), 0, "Scrapper Role Bonus")) rollData.dicePool = rollData.dicePool.concat(PegasusUtility.buildDicePool("effect-bonus-dice", this.getRoleLevel(), 0, "Scrapper Role Bonus"))
} }
@ -1941,7 +2057,7 @@ export class PegasusActor extends Actor {
if (statKey == 'phy' && subKey == "dmg-res") { if (statKey == 'phy' && subKey == "dmg-res") {
let armors = this.getArmors() let armors = this.getArmors()
for (let armor of armors) { for (let armor of armors) {
rollData.armorsList.push({ label: `Armor ${armor.name}`, type: "armor", applied: false, value: armor.system.resistance }) rollData.armorsList.push({ label: `Armor ${armor.name}`, type: "armor", applied: false, value: armor.system.resistance, adrl:armor.system.adrl })
} }
} }
if (useShield) { if (useShield) {
@ -2019,7 +2135,9 @@ export class PegasusActor extends Actor {
let rollData = PegasusUtility.getBasicRollData(isInit) let rollData = PegasusUtility.getBasicRollData(isInit)
rollData.alias = this.name rollData.alias = this.name
rollData.actorImg = this.img rollData.actorImg = this.img
rollData.actorId = this.id rollData.actorType = this.type
rollData.tokenId = this.token?.id
rollData.actorId = (this.token) ? this.token.actor.id : this.id
rollData.img = this.img rollData.img = this.img
rollData.traumaState = this.getTraumaState() rollData.traumaState = this.getTraumaState()
rollData.levelRemaining = this.getLevelRemaining() rollData.levelRemaining = this.getLevelRemaining()
@ -2028,6 +2146,8 @@ export class PegasusActor extends Actor {
rollData.noBonusDice = this.checkNoBonusDice() rollData.noBonusDice = this.checkNoBonusDice()
rollData.dicePool = [] rollData.dicePool = []
rollData.subKey = subKey rollData.subKey = subKey
rollData.tic1 = "NONE"
rollData.tic2 = "NONE"
if (subKey == "melee-dmg" || subKey == "ranged-dmg" || subKey == "power-dmg") { if (subKey == "melee-dmg" || subKey == "ranged-dmg" || subKey == "power-dmg") {
rollData.isDamage = true rollData.isDamage = true
@ -2090,7 +2210,7 @@ export class PegasusActor extends Actor {
} }
if (statKey == "mr") { if (statKey == "mr") {
if (this.type == "character") { if (this.type == "character"|| this.type == 'npc') {
rollData.mrVehicle = PegasusUtility.checkIsVehicleCrew(this.id) rollData.mrVehicle = PegasusUtility.checkIsVehicleCrew(this.id)
if (rollData.mrVehicle) { if (rollData.mrVehicle) {
rollData.effectsList.push({ rollData.effectsList.push({
@ -2109,7 +2229,9 @@ export class PegasusActor extends Actor {
}) })
} }
} }
} }
rollData.hindranceDices = this.computeCurrentHindrances()
this.processSizeBonus(rollData) this.processSizeBonus(rollData)
this.addEffects(rollData, isInit, isPower, subKey == "power-dmg") this.addEffects(rollData, isInit, isPower, subKey == "power-dmg")
@ -2128,7 +2250,7 @@ export class PegasusActor extends Actor {
processSizeBonus(rollData) { processSizeBonus(rollData) {
if (rollData.defenderTokenId) { if (rollData.defenderTokenId) {
let diffSize = 0 let diffSize = 0
if (this.type == "character") { if (this.type == "character"|| this.type == 'npc') {
this.system.biodata.sizenum = this.system.biodata?.sizenum ?? 0 this.system.biodata.sizenum = this.system.biodata?.sizenum ?? 0
this.system.biodata.sizebonus = this.system.biodata?.sizebonus ?? 0 this.system.biodata.sizebonus = this.system.biodata?.sizebonus ?? 0
diffSize = rollData.defenderSize - this.system.biodata.sizenum + this.system.biodata.sizebonus diffSize = rollData.defenderSize - this.system.biodata.sizenum + this.system.biodata.sizebonus

View File

@ -1,21 +1,133 @@
import { PegasusUtility } from "./pegasus-utility.js"; import { PegasusUtility } from "./pegasus-utility.js";
/* -------------------------------------------- */ /* -------------------------------------------- */
export class PegasusCombat extends Combat { export class PegasusCombatTracker extends CombatTracker {
/* -------------------------------------------- */ /* -------------------------------------------- */
async rollInitiative(ids, formula = undefined, messageOptions = {} ) { static get defaultOptions() {
let path = "systems/fvtt-pegasus-rpg/templates/pegasus-combat-tracker.html";
return foundry.utils.mergeObject(super.defaultOptions, {
template: path,
});
}
/* -------------------------------------------- */
activateListeners(html) {
super.activateListeners(html)
html.find('.combat-tracker-tic').click(ev => {
let ticNum = $(ev.currentTarget).data("tic-num")
let combatantId = $(ev.currentTarget).data("combatant-id")
game.combat.revealTIC(ticNum, combatantId)
})
html.find('.reset-npc-initiative').click(ev => {
game.combat.resetNPCInitiative()
})
}
}
/* -------------------------------------------- */
export class PegasusCombat extends Combat {
/* -------------------------------------------- */
async rollInitiative(ids, formula = undefined, messageOptions = {}) {
ids = typeof ids === "string" ? [ids] : ids; ids = typeof ids === "string" ? [ids] : ids;
for (let cId = 0; cId < ids.length; cId++) { for (let cId = 0; cId < ids.length; cId++) {
const c = this.combatants.get(ids[cId]); const c = this.combatants.get(ids[cId]);
let id = c._id || c.id; let id = c._id || c.id;
let initBonus = c.actor ? c.actor.getInitiativeScore( this.id, id ) : -1; let initBonus = c.actor ? c.actor.getInitiativeScore(this.id, id) : -1;
await this.updateEmbeddedDocuments("Combatant", [ { _id: id, initiative: initBonus } ]); await this.updateEmbeddedDocuments("Combatant", [{ _id: id, initiative: initBonus }]);
} }
return this; return this;
} }
/* -------------------------------------------- */
async resetNPCInitiative() {
for(let c of this.combatants) {
if (c.actor && c.actor.type == "npc") {
await this.updateEmbeddedDocuments("Combatant", [{ _id: c.id, initiative: -1 }]);
}
}
}
/* -------------------------------------------- */
isCharacter(combatantId) {
const combatant = game.combat.combatants.get(combatantId)
if (combatant) {
return combatant.actor.type == "character"
}
return false
}
/* -------------------------------------------- */
async setTic(combatantId, rollData) {
if (!combatantId) {
return
}
const combatant = game.combat.combatants.get(combatantId)
if (combatant) {
await combatant.setFlag("world", "tic1", { revealed: false, text: rollData.tic1, displayed: false })
await combatant.setFlag("world", "tic2", { revealed: false, text: rollData.tic2, displayed: false })
}
}
/* -------------------------------------------- */
getTIC(num, combatantId) {
if (!combatantId) {
return ""
}
const combatant = game.combat.combatants.get(combatantId)
if (combatant) {
let ticData = combatant.getFlag("world", "tic" + num)
if (ticData) {
/* returns if revealed */
if (ticData.revealed && ticData.displayed) {
return "ACTED"
}
if (ticData.revealed && !ticData.displayed) {
ticData.displayed = true
combatant.setFlag("world", "tic" + num, ticData ).then(() => {
let chatData = {
user: game.user.id,
alias: combatant.actor.name,
rollMode: game.settings.get("core", "rollMode"),
whisper: [game.user.id].concat(ChatMessage.getWhisperRecipients('GM')),
content: `<div>${combatant.actor.name} is performing ${ticData.text}</div`
};
ChatMessage.create(chatData);
return "ACTED"
})
}
}
}
return "TIC " + num
}
/* -------------------------------------------- */
async revealTIC(num, combatantId) {
if (!num || !combatantId) {
return
}
const combatant = game.combat.combatants.get(combatantId)
if (combatant) {
let ticData = combatant.getFlag("world", "tic" + num)
if (ticData) {
ticData.revealed = true
await combatant.setFlag("world", "tic" + num, ticData)
}
}
}
/* -------------------------------------------- */
nextRound() {
for(let c of this.combatants) {
c.setFlag("world", "tic1", { revealed: false, text: "", displayed: false })
c.setFlag("world", "tic2", { revealed: false, text: "", displayed: false })
}
super.nextRound()
}
/* -------------------------------------------- */ /* -------------------------------------------- */
_onUpdate(changed, options, userId) { _onUpdate(changed, options, userId) {
} }
@ -28,11 +140,11 @@ export class PegasusCombat extends Combat {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static async decInitBy10( combatantId, value) { static async decInitBy10(combatantId, value) {
const combatant = game.combat.combatants.get(combatantId) const combatant = game.combat.combatants.get(combatantId)
let initValue = combatant.initiative + value let initValue = combatant.initiative + value
await game.combat.setInitiative(combatantId, initValue) await game.combat.setInitiative(combatantId, initValue)
setTimeout( this.checkTurnPosition, 400) // The setInitiative is no more blocking for unknown reason setTimeout(this.checkTurnPosition, 400) // The setInitiative is no more blocking for unknown reason
} }
} }

30
modules/pegasus-config.js Normal file
View File

@ -0,0 +1,30 @@
export const PEGASUS_CONFIG = {
healthStatus: {
healthy: { key: "healthy", name: 'Healthy', hindrance: 0 },
injured: { key: "injured",name: 'Injured',hindrance: 0 },
wounded: { key: "wounded",name: 'Wounded',hindrance: 1, rolls: 'ALL' },
severlywounded: { key: "severlywounded",name: 'Severly Wounded',hindrance: 3, rolls: 'ALL' },
defeated: { key: "defeated",name:'Defeated',hindrance: 3, defeated: true}
},
deliriumStatus: {
stable: { key:'stable', name: 'Stable', hindrance: 0 },
unstable: { key:'unstable',name: 'Unstable', hindrance: 0 },
trauma: { key:'trauma',name: 'Trauma', hindrance: 0, nobonusdice: true },
severetrauma: { key:'severetrauma',name: 'Severe Trauma', hindrance: 0, nobonusdice: true, noperks: true },
defeated: { key:'defeated',name:'Defeated',hindrance: 0, defeated: true}
},
concealmentStatus: {
hidden: { key:'hidden',name: 'Hidden', hindrance: 0 },
covered: { key:'covered',name: 'Covered', hindrance: 0 },
exposed: { key:'exposed',name: 'Exposed', hindrance: 1, rolls: 'STL' },
detected: { key:'detected',name: 'Detected', hindrance: 3, rolls: 'STL'},
located: { key:'located',name: 'Located', hindrance: 0 }
},
confidenceStatus: {
confident: { key:'confident',name: 'Confident', hindrance: 0 },
uncertain: { key:'uncertain',name: 'Uncertain', hindrance: 0 },
shaken: { key:'shaken',name: 'Shaken', hindrance: 0, hasfear: true },
anxious: { key:'anxious',name: 'Anxious', hindrance: 0, nostunrecover: true },
lostface: { key:'lostface',name: 'Lost Face', hindrance: 0 }
}
}

View File

@ -92,9 +92,11 @@ export class PegasusActorCreate {
if (step == 'select-race-optionnal') { if (step == 'select-race-optionnal') {
let ability = this.raceOptionnalAbilities.optionnalabilities.find(item => item._id == itemId); let ability = this.raceOptionnalAbilities.optionnalabilities.find(item => item._id == itemId);
let update = [] let update = {}
await this.actor.applyAbility(ability, update); await this.actor.applyAbility(ability, update);
this.actor.update(update) if (!jQuery.isEmptyObject(update)) {
this.actor.update(update)
}
this.actor.createEmbeddedDocuments('Item', [ability]); this.actor.createEmbeddedDocuments('Item', [ability]);
PegasusUtility.removeChatMessageId(PegasusUtility.findChatMessageId(event.currentTarget)); PegasusUtility.removeChatMessageId(PegasusUtility.findChatMessageId(event.currentTarget));
this.raceOptionnalAbilities.optionnalabilities = this.raceOptionnalAbilities.optionnalabilities.filter(item => item._id != itemId); this.raceOptionnalAbilities.optionnalabilities = this.raceOptionnalAbilities.optionnalabilities.filter(item => item._id != itemId);

View File

@ -0,0 +1,25 @@
export class PegasusHindranceDie extends Die {
constructor(termData ) {
termData.faces=6;
super(termData);
}
/* -------------------------------------------- */
/** @override */
static DENOMINATION = "h";
/* -------------------------------------------- */
/** @override */
getResultLabel(result) {
return {
"1": '<img src="systems/fvtt-pegasus-rpg/images/dice/hindrance-dice-empty.png" />',
"2": '<img src="systems/fvtt-pegasus-rpg/images/dice/hindrance-dice-empty.png" />',
"3": '<img src="systems/fvtt-pegasus-rpg/images/dice/hindrance-dice-empty.png" />',
"4": '<img src="systems/fvtt-pegasus-rpg/images/dice/hindrance-dice-empty.png" />',
"5": '<img src="systems/fvtt-pegasus-rpg/images/dice/hindrance-dice-empty.png" />',
"6": '<img src="systems/fvtt-pegasus-rpg/images/dice/hindrance-dice.png" />'
}[result.result];
}
}

View File

@ -423,7 +423,6 @@ export class PegasusItemSheet extends ItemSheet {
} }
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
async _onDrop(event) { async _onDrop(event) {

View File

@ -12,11 +12,11 @@ import { PegasusActor } from "./pegasus-actor.js";
import { PegasusItemSheet } from "./pegasus-item-sheet.js"; import { PegasusItemSheet } from "./pegasus-item-sheet.js";
import { PegasusActorSheet } from "./pegasus-actor-sheet.js"; import { PegasusActorSheet } from "./pegasus-actor-sheet.js";
import { PegasusVehicleSheet } from "./pegasus-vehicle-sheet.js"; import { PegasusVehicleSheet } from "./pegasus-vehicle-sheet.js";
import { PegasusNPCSheet } from "./pegasus-npc-sheet.js";
import { PegasusUtility } from "./pegasus-utility.js"; import { PegasusUtility } from "./pegasus-utility.js";
import { PegasusCombat } from "./pegasus-combat.js"; import { PegasusCombatTracker,PegasusCombat } from "./pegasus-combat.js";
import { PegasusItem } from "./pegasus-item.js"; import { PegasusItem } from "./pegasus-item.js";
import { PegasusToken } from "./pegasus-token.js"; import { PegasusHindranceDie } from "./pegasus-hindrance-die.js";
import { PEGASUS_CONFIG } from "./pegasus-config.js"
/* -------------------------------------------- */ /* -------------------------------------------- */
/* Foundry VTT Initialization */ /* Foundry VTT Initialization */
@ -57,14 +57,18 @@ Hooks.once("init", async function () {
CONFIG.Combat.documentClass = PegasusCombat CONFIG.Combat.documentClass = PegasusCombat
CONFIG.Actor.documentClass = PegasusActor CONFIG.Actor.documentClass = PegasusActor
CONFIG.Item.documentClass = PegasusItem CONFIG.Item.documentClass = PegasusItem
CONFIG.ui.combat = PegasusCombatTracker
CONFIG.Dice.terms["h"] = PegasusHindranceDie
game.system.pegasus = { game.system.pegasus = {
utility: PegasusUtility utility: PegasusUtility,
config: PEGASUS_CONFIG
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
// Register sheet application classes // Register sheet application classes
Actors.unregisterSheet("core", ActorSheet); Actors.unregisterSheet("core", ActorSheet);
Actors.registerSheet("fvtt-pegasus", PegasusActorSheet, { types: ["character"], makeDefault: true }) Actors.registerSheet("fvtt-pegasus", PegasusActorSheet, { types: ["character"], makeDefault: true })
Actors.registerSheet("fvtt-pegasus", PegasusActorSheet, { types: ["npc"], makeDefault: true })
Actors.registerSheet("fvtt-pegasus", PegasusVehicleSheet, { types: ["vehicle"], makeDefault: false }) Actors.registerSheet("fvtt-pegasus", PegasusVehicleSheet, { types: ["vehicle"], makeDefault: false })
Items.unregisterSheet("core", ItemSheet); Items.unregisterSheet("core", ItemSheet);
@ -72,7 +76,6 @@ Hooks.once("init", async function () {
PegasusUtility.init() PegasusUtility.init()
}); });
/* -------------------------------------------- */ /* -------------------------------------------- */

View File

@ -39,6 +39,8 @@ export class PegasusRollDialog extends Dialog {
/* -------------------------------------------- */ /* -------------------------------------------- */
roll() { roll() {
this.rollData.tic1 = $('#roll-input-tic1').val()
this.rollData.tic2 = $('#roll-input-tic2').val()
PegasusUtility.rollPegasus(this.rollData) PegasusUtility.rollPegasus(this.rollData)
} }

View File

@ -23,9 +23,32 @@ export class PegasusUtility {
Hooks.on('renderChatLog', (log, html, data) => PegasusUtility.chatListeners(html)) Hooks.on('renderChatLog', (log, html, data) => PegasusUtility.chatListeners(html))
Hooks.on('targetToken', (user, token, flag) => PegasusUtility.targetToken(user, token, flag)) Hooks.on('targetToken', (user, token, flag) => PegasusUtility.targetToken(user, token, flag))
Hooks.on('renderSidebarTab', (app, html, data) => PegasusUtility.addDiceRollButton(app, html, data)) Hooks.on('renderSidebarTab', (app, html, data) => PegasusUtility.addDiceRollButton(app, html, data))
Hooks.on("getCombatTrackerEntryContext", (html, options) => { /* Deprecated, no more used in rules Hooks.on("getCombatTrackerEntryContext", (html, options) => {
PegasusUtility.pushInitiativeOptions(html, options); PegasusUtility.pushInitiativeOptions(html, options);
}); });*/
Hooks.once('diceSoNiceReady', (dice3d) => {
dice3d.addSystem({ id: "pegasus-hindrance", name: "Hindrance Die" }, "preferred");
dice3d.addDicePreset({
type: "dh",
labels: [
'systems/fvtt-pegasus-rpg/images/dice/hindrance-dice-empty.png',
'systems/fvtt-pegasus-rpg/images/dice/hindrance-dice-empty.png',
'systems/fvtt-pegasus-rpg/images/dice/hindrance-dice-empty.png',
'systems/fvtt-pegasus-rpg/images/dice/hindrance-dice-empty.png',
'systems/fvtt-pegasus-rpg/images/dice/hindrance-dice-empty.png',
'systems/fvtt-pegasus-rpg/images/dice/hindrance-dice.png'
],
bumpMaps: [
'systems/fvtt-pegasus-rpg/images/dice/hindrance-dice-empty.png',
'systems/fvtt-pegasus-rpg/images/dice/hindrance-dice-empty.png',
'systems/fvtt-pegasus-rpg/images/dice/hindrance-dice-empty.png',
'systems/fvtt-pegasus-rpg/images/dice/hindrance-dice-empty.png',
'systems/fvtt-pegasus-rpg/images/dice/hindrance-dice-empty.png',
'systems/fvtt-pegasus-rpg/images/dice/hindrance-dice.png'
],
system: "pegasus-hindrance"
}, "d6")
})
Hooks.on("dropCanvasData", (canvas, data) => { Hooks.on("dropCanvasData", (canvas, data) => {
PegasusUtility.dropItemOnToken(canvas, data) PegasusUtility.dropItemOnToken(canvas, data)
}); });
@ -70,6 +93,29 @@ export class PegasusUtility {
Handlebars.registerHelper('getDice', function (a) { Handlebars.registerHelper('getDice', function (a) {
return PegasusUtility.getDiceFromLevel(a) return PegasusUtility.getDiceFromLevel(a)
}) })
Handlebars.registerHelper('getStatusConfig', function (a) {
let key = a + "Status"
//console.log("TABE", key, game.system.pegasus.config[key] )
return game.system.pegasus.config[key]
})
Handlebars.registerHelper('valueAtIndex', function (arr, idx) {
return arr[idx];
})
Handlebars.registerHelper('for', function (from, to, incr, block) {
let accum = '';
for (let i = from; i <= to; i += incr)
accum += block.fn(i);
return accum;
})
Handlebars.registerHelper('isGM', function () {
return game.user.isGM
})
Handlebars.registerHelper('getTIC', function (num, id) {
return game.combat.getTIC(num, id)
})
Handlebars.registerHelper('isCharacter', function (id) {
return game.combat.isCharacter(id)
})
} }
@ -131,10 +177,10 @@ export class PegasusUtility {
let diceKey = PegasusUtility.getDiceFromLevel(level) let diceKey = PegasusUtility.getDiceFromLevel(level)
let diceList = diceKey.split(" ") let diceList = diceKey.split(" ")
for (let myDice of diceList) { for (let myDice of diceList) {
myDice = myDice.trim() let myDiceTrim = myDice.trim()
let newDice = { let newDice = {
name: name, key: myDice, level: PegasusUtility.getLevelFromDice(myDice), mod: mod, effect: effectName, name: name, key: myDiceTrim, level: PegasusUtility.getLevelFromDice(myDiceTrim), mod: mod, effect: effectName,
img: `systems/fvtt-pegasus-rpg/images/dice/${myDice}.webp` img: `systems/fvtt-pegasus-rpg/images/dice/${myDiceTrim}.webp`
} }
dicePool.push(newDice) dicePool.push(newDice)
mod = 0 // Only first dice has modifier mod = 0 // Only first dice has modifier
@ -146,10 +192,10 @@ export class PegasusUtility {
static updateEffectsBonusDice(rollData) { static updateEffectsBonusDice(rollData) {
let newDicePool = rollData.dicePool.filter(dice => dice.name != "effect-bonus-dice") let newDicePool = rollData.dicePool.filter(dice => dice.name != "effect-bonus-dice")
for (let effect of rollData.effectsList) { for (let effect of rollData.effectsList) {
if (effect && effect.applied && effect.type == "effect" && !effect.effect?.system?.hindrance && effect.effect && effect.effect.system.bonusdice) { if (effect?.applied && effect.type == "effect" && !effect.effect?.system?.hindrance && effect.effect && effect.effect.system.bonusdice) {
newDicePool = newDicePool.concat(this.buildDicePool("effect-bonus-dice", effect.effect.system.effectlevel, 0, effect.effect.name)) newDicePool = newDicePool.concat(this.buildDicePool("effect-bonus-dice", effect.effect.system.effectlevel, 0, effect.effect.name))
} }
if (effect && effect.applied && effect.type == "effect" && effect.value && effect.isdynamic && !effect.effect?.system?.hindrance) { if (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)) newDicePool = newDicePool.concat(this.buildDicePool("effect-bonus-dice", effect.value, 0, effect.name))
} }
} }
@ -160,7 +206,7 @@ export class PegasusUtility {
static updateHindranceBonusDice(rollData) { static updateHindranceBonusDice(rollData) {
let newDicePool = rollData.dicePool.filter(dice => dice.name != "effect-hindrance") let newDicePool = rollData.dicePool.filter(dice => dice.name != "effect-hindrance")
for (let hindrance of rollData.effectsList) { for (let hindrance of rollData.effectsList) {
if (hindrance && hindrance.applied && (hindrance.type == "hindrance" || (hindrance.type == "effect" && hindrance.effect?.system?.hindrance))) { if (hindrance?.applied && (hindrance.type == "hindrance" || (hindrance.type == "effect" && hindrance.effect?.system?.hindrance))) {
console.log("Adding Hindrance 1", hindrance, newDicePool) 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)) newDicePool = newDicePool.concat(this.buildDicePool("effect-hindrance", (hindrance.value) ? hindrance.value : hindrance.effect.system.effectlevel, 0, hindrance.name))
console.log("Adding Hindrance 2", newDicePool) console.log("Adding Hindrance 2", newDicePool)
@ -201,9 +247,9 @@ export class PegasusUtility {
for (let weapon of rollData.vehicleWeapons) { for (let weapon of rollData.vehicleWeapons) {
if (weapon.applied) { if (weapon.applied) {
newDicePool = newDicePool.concat(this.buildDicePool("damage", weapon.value, 0)) newDicePool = newDicePool.concat(this.buildDicePool("damage", weapon.value, 0))
if( weapon.weapon.system.extradamage) { if (weapon.weapon.system.extradamage) {
for(let i=0; i < weapon.weapon.system.extradamagevalue; i++) { for (let i = 0; i < weapon.weapon.system.extradamagevalue; i++) {
newDicePool = newDicePool.concat(this.buildDicePool("damage", 5, 0) ) newDicePool = newDicePool.concat(this.buildDicePool("damage", 5, 0))
} }
} }
} }
@ -544,7 +590,7 @@ export class PegasusUtility {
/* -------------------------------------------- */ /* -------------------------------------------- */
static getDiceFromLevel(level = 0) { static getDiceFromLevel(level = 0) {
level = Math.max( Number(level), 0) level = Math.max(Number(level), 0)
return this.diceList[level]; return this.diceList[level];
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -803,6 +849,12 @@ export class PegasusUtility {
/* -------------------------------------------- */ /* -------------------------------------------- */
static async rollPegasus(rollData) { static async rollPegasus(rollData) {
let actor = game.actors.get(rollData.actorId) let actor = game.actors.get(rollData.actorId)
if (rollData.tokenId) {
let token = canvas.tokens.placeables.find(t => t.id == rollData.tokenId)
if (token) {
actor = token.actor
}
}
let diceFormulaTab = [] let diceFormulaTab = []
for (let dice of rollData.dicePool) { for (let dice of rollData.dicePool) {
@ -815,11 +867,22 @@ export class PegasusUtility {
let myRoll = rollData.roll let myRoll = rollData.roll
if (!myRoll || rollData.rerollHero || rollData.rerollMomentum) { // New rolls only of no rerolls if (!myRoll || rollData.rerollHero || rollData.rerollMomentum) { // New rolls only of no rerolls
myRoll = new Roll(diceFormula).roll({ async: false }) myRoll = new Roll(diceFormula).roll({ async: false })
await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
rollData.roll = myRoll rollData.roll = myRoll
} }
if (rollData.hindranceDices > 0) {
rollData.hindranceRoll = new Roll(rollData.hindranceDices + "dh").roll({ async: false })
this.showDiceSoNice(rollData.hindranceRoll, game.settings.get("core", "rollMode"))
for (let res of rollData.hindranceRoll.terms[0].results) {
if (res.result == 6) {
rollData.hindranceFailure = true
rollData.img = `systems/fvtt-pegasus-rpg/images/dice/hindrance-dice.png`
}
}
}
await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
// Final score and keep data // Final score and keep data
rollData.finalScore = myRoll.total rollData.finalScore = (rollData.hindranceFailure) ? 0 : myRoll.total
if (rollData.damages) { if (rollData.damages) {
let dmgFormula = this.getFoundryDiceFromLevel(rollData.damages.value) let dmgFormula = this.getFoundryDiceFromLevel(rollData.damages.value)
@ -835,6 +898,7 @@ export class PegasusUtility {
// Init stuf // Init stuf
if (rollData.isInit) { if (rollData.isInit) {
let combat = game.combats.get(rollData.combatId) let combat = game.combats.get(rollData.combatId)
await combat.setTic(rollData.combatantId, rollData)
combat.updateEmbeddedDocuments("Combatant", [{ _id: rollData.combatantId, initiative: rollData.finalScore }]) combat.updateEmbeddedDocuments("Combatant", [{ _id: rollData.combatantId, initiative: rollData.finalScore }])
} }
@ -1030,14 +1094,14 @@ export class PegasusUtility {
let defenderActor = target.actor let defenderActor = target.actor
rollData.defenderTokenId = target.id rollData.defenderTokenId = target.id
rollData.defenderSize = 0 rollData.defenderSize = 0
if ( defenderActor.type == "character") { if (defenderActor.type == "character") {
rollData.defenderSize = Number(defenderActor.system.biodata.sizenum) + Number(defenderActor.system.biodata.sizebonus) rollData.defenderSize = Number(defenderActor.system.biodata.sizenum) + Number(defenderActor.system.biodata.sizebonus)
} else if ( defenderActor.type == "vehicle" ){ } else if (defenderActor.type == "vehicle") {
rollData.defenderSize = Number(defenderActor.system.statistics.hr.size) rollData.defenderSize = Number(defenderActor.system.statistics.hr.size)
} }
//rollData.attackerId = this.id //rollData.attackerId = this.id
console.log("Target/DEFENDER", defenderActor) console.log("Target/DEFENDER", defenderActor)
defenderActor.addHindrancesList(rollData.effectsList) //defenderActor.addHindrancesList(rollData.effectsList) /* No more used */
} }
} }
@ -1076,10 +1140,10 @@ export class PegasusUtility {
/* -------------------------------------------- */ /* -------------------------------------------- */
static checkIsVehicleCrew(actorId) { static checkIsVehicleCrew(actorId) {
let vehicles = game.actors.filter( actor=> actor.type == "vehicle") || [] let vehicles = game.actors.filter(actor => actor.type == "vehicle") || []
for(let vehicle of vehicles) { for (let vehicle of vehicles) {
console.log("Checking", vehicle.name) console.log("Checking", vehicle.name)
if ( vehicle.inCrew(actorId) ) { if (vehicle.inCrew(actorId)) {
return vehicle return vehicle
} }
} }
@ -1112,10 +1176,10 @@ export class PegasusUtility {
let tacticianTokens = canvas.tokens.placeables.filter(token => token.actor.isTactician() && !token.document.hidden) let tacticianTokens = canvas.tokens.placeables.filter(token => token.actor.isTactician() && !token.document.hidden)
for (let token of tacticianTokens) { for (let token of tacticianTokens) {
token.refresh() token.refresh()
let friends = canvas.tokens.placeables.filter(newToken => newToken.actor.type == "character" && !newToken.document.hidden && newToken.document.disposition == token.document.disposition) 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) { for (let friend of friends) {
if (friend.actor.id != token.actor.id) { if (friend.actor.id != token.actor.id) {
let existing = toApply[friend.actor.id] || { actor: friend.actor, add: false, level: 0, names: [] } let existing = toApply[friend.id] || { token: friend, add: false, level: 0, names: [] }
let visible = canvas.effects.visibility.testVisibility(friend.center, { object: token }) let visible = canvas.effects.visibility.testVisibility(friend.center, { object: token })
console.log("parse visible TACTICIAN : ", visible, token.name, friend.name) console.log("parse visible TACTICIAN : ", visible, token.name, friend.name)
if (visible) { if (visible) {
@ -1123,22 +1187,22 @@ export class PegasusUtility {
existing.level += token.actor.getRoleLevel() existing.level += token.actor.getRoleLevel()
existing.names.push(token.actor.name) existing.names.push(token.actor.name)
} }
toApply[friend.actor.id] = existing toApply[friend.id] = existing
} }
} }
} }
for (let id in toApply) { for (let id in toApply) {
let applyDef = toApply[id] let applyDef = toApply[id]
let hasBonus = applyDef.actor.hasTacticianBonus() let hasBonus = applyDef.token.actor.hasTacticianBonus()
if (applyDef.add) { if (applyDef.add) {
if (!hasBonus) { if (!hasBonus) {
applyDef.actor.addTacticianEffect(applyDef.names.toString(), applyDef.level) await applyDef.token.actor.addTacticianEffect(applyDef.names.toString(), applyDef.level)
} else if (applyDef.level != hasBonus.system.effectlevel) { } else if (applyDef.level != hasBonus.system.effectlevel) {
await applyDef.actor.removeTacticianEffect() await applyDef.token.actor.removeTacticianEffect()
applyDef.actor.addTacticianEffect(applyDef.names.toString(), applyDef.level) await applyDef.token.actor.addTacticianEffect(applyDef.names.toString(), applyDef.level)
} }
} else if (hasBonus) { } else if (hasBonus) {
applyDef.actor.removeTacticianEffect() await applyDef.token.actor.removeTacticianEffect()
} }
} }
//Delete all effects if no more tacticians (ie deleted case) //Delete all effects if no more tacticians (ie deleted case)
@ -1146,7 +1210,7 @@ export class PegasusUtility {
let allTokens = canvas.tokens.placeables.filter(token => token.actor.type == "character") let allTokens = canvas.tokens.placeables.filter(token => token.actor.type == "character")
for (let token of allTokens) { for (let token of allTokens) {
if (token.actor.hasTacticianBonus()) { if (token.actor.hasTacticianBonus()) {
token.actor.removeTacticianEffect() await token.actor.removeTacticianEffect()
} }
} }
} }
@ -1160,10 +1224,10 @@ export class PegasusUtility {
let enhancerTokens = canvas.tokens.placeables.filter(token => token.actor.isEnhancer() && !token.document.hidden) let enhancerTokens = canvas.tokens.placeables.filter(token => token.actor.isEnhancer() && !token.document.hidden)
for (let token of enhancerTokens) { for (let token of enhancerTokens) {
token.refresh() token.refresh()
let friends = canvas.tokens.placeables.filter(newToken => newToken.actor.type == "character" && !newToken.document.hidden && newToken.document.disposition == token.document.disposition) 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) { for (let friend of friends) {
if (friend.actor.id != token.actor.id) { if (friend.actor.id != token.actor.id) {
let existing = toApply[friend.actor.id] || { actor: friend.actor, add: false, level: 0, names: [] } let existing = toApply[friend.id] || { token: friend, add: false, level: 0, names: [] }
let visible = canvas.effects.visibility.testVisibility(friend.center, { object: token }) let visible = canvas.effects.visibility.testVisibility(friend.center, { object: token })
console.log("parse visible ENHANCER: ", visible, token.name, friend.name) console.log("parse visible ENHANCER: ", visible, token.name, friend.name)
if (visible) { if (visible) {
@ -1174,22 +1238,22 @@ export class PegasusUtility {
existing.names.push(token.actor.name) existing.names.push(token.actor.name)
} }
} }
toApply[friend.actor.id] = existing toApply[friend.id] = existing
} }
} }
} }
for (let id in toApply) { for (let id in toApply) {
let applyDef = toApply[id] let applyDef = toApply[id]
let hasBonus = applyDef.actor.hasEnhancerBonus() let hasBonus = applyDef.token.actor.hasEnhancerBonus()
if (applyDef.add) { if (applyDef.add) {
if (!hasBonus) { if (!hasBonus) {
applyDef.actor.addEnhancerEffect(applyDef.names.toString(), applyDef.level) await applyDef.token.actor.addEnhancerEffect(applyDef.names.toString(), applyDef.level)
} else if (applyDef.level != hasBonus.system.effectlevel) { } else if (applyDef.level != hasBonus.system.effectlevel) {
await applyDef.actor.removeEnhancerEffect() await applyDef.token.actor.removeEnhancerEffect()
applyDef.actor.addEnhancerEffect(applyDef.names.toString(), applyDef.level) await applyDef.token.actor.addEnhancerEffect(applyDef.names.toString(), applyDef.level)
} }
} else if (hasBonus) { } else if (hasBonus) {
applyDef.actor.removeEnhancerEffect() await applyDef.token.actor.removeEnhancerEffect()
} }
} }
// Delete all effects if no more tacticians (ie deleted case) // Delete all effects if no more tacticians (ie deleted case)
@ -1197,7 +1261,7 @@ export class PegasusUtility {
let allTokens = canvas.tokens.placeables.filter(token => token.actor.type == "character") let allTokens = canvas.tokens.placeables.filter(token => token.actor.type == "character")
for (let token of allTokens) { for (let token of allTokens) {
if (token.actor.hasEnhancerBonus()) { if (token.actor.hasEnhancerBonus()) {
token.actor.removeEnhancerEffect() await token.actor.removeEnhancerEffect()
} }
} }
} }
@ -1212,17 +1276,19 @@ export class PegasusUtility {
token.refresh() token.refresh()
let ennemies = [] let ennemies = []
if (token.document.disposition == -1) { 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 )) 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) { 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 )) 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) { 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 )) ennemies = canvas.tokens.placeables.filter(newToken => newToken.actor.type == "character" && !newToken.document.hidden && (newToken.document.disposition == -1 || newToken.document.disposition == 1))
} }
console.log("Ennemies for token", token.actor.name, ennemies)
for (let ennemy of ennemies) { for (let ennemy of ennemies) {
if (ennemy.actor.id != token.actor.id) { if (ennemy.actor.id != token.actor.id) {
let existing = toApply[ennemy.actor.id] || { actor: ennemy.actor, add: false, level: 0, names: [] } //console.log("Adding ennemy", ennemy.id)
let existing = toApply[ennemy.id] || { token: ennemy, add: false, level: 0, names: [] }
let visible = canvas.effects.visibility.testVisibility(ennemy.center, { object: token }) let visible = canvas.effects.visibility.testVisibility(ennemy.center, { object: token })
if (visible) { if (visible) {
let dist = canvas.grid.measureDistances([{ ray: new Ray(token.center, ennemy.center) }], { gridSpaces: false }) let dist = canvas.grid.measureDistances([{ ray: new Ray(token.center, ennemy.center) }], { gridSpaces: false })
@ -1232,30 +1298,31 @@ export class PegasusUtility {
existing.names.push(token.actor.name) existing.names.push(token.actor.name)
} }
} }
toApply[ennemy.actor.id] = existing toApply[ennemy.id] = existing
} }
} }
} }
//console.log("To apply stuff : ", toApply)
for (let id in toApply) { for (let id in toApply) {
let applyDef = toApply[id] let applyDef = toApply[id]
let hasHindrance = applyDef.actor.hasAgitatorHindrance() let hasHindrance = applyDef.token.actor.hasAgitatorHindrance()
if (applyDef.add) { if (applyDef.add) {
if (!hasHindrance) { if (!hasHindrance) {
applyDef.actor.addAgitatorHindrance(applyDef.names.toString(), applyDef.level) await applyDef.token.actor.addAgitatorHindrance(applyDef.names.toString(), applyDef.level)
} else if (applyDef.level != hasHindrance.system.effectlevel) { } else if (applyDef.level != hasHindrance.system.effectlevel) {
await applyDef.actor.removeAgitatorHindrance() await applyDef.token.actor.removeAgitatorHindrance()
applyDef.actor.addAgitatorHindrance(applyDef.names.toString(), applyDef.level) await applyDef.token.actor.addAgitatorHindrance(applyDef.names.toString(), applyDef.level)
} }
} else if (hasHindrance) { } else if (hasHindrance) {
applyDef.actor.removeAgitatorHindrance() await applyDef.token.actor.removeAgitatorHindrance()
} }
} }
// Delete all effects if no more agtators (ie deleted case) // Delete all effects if no more agitators (ie deleted case)
if (agitatorTokens.length == 0) { if (agitatorTokens.length == 0) {
let allTokens = canvas.tokens.placeables.filter(token => token.actor.type == "character") let allTokens = canvas.tokens.placeables.filter(token => token.actor.type == "character")
for (let token of allTokens) { for (let token of allTokens) {
if (token.actor.hasAgitatorHindrance()) { if (token.actor.hasAgitatorHindrance()) {
token.actor.removeAgitatorHindrance() await token.actor.removeAgitatorHindrance()
} }
} }
} }
@ -1273,9 +1340,9 @@ export class PegasusUtility {
this.lastRoleEffectProcess = now this.lastRoleEffectProcess = now
console.log("=========================+> Searching/Processing roles effects") console.log("=========================+> Searching/Processing roles effects")
await this.processTactician() /*NO MORE USED : await this.processTactician()*/
await this.processEnhancer() await this.processEnhancer()
await this.processAgitator() /*NO MORE USED : await this.processAgitator()*/
} }

View File

@ -1142,7 +1142,6 @@ ul, li {
position: relative; position: relative;
margin:4px; margin:4px;
} }
.chat-card-button { .chat-card-button {
box-shadow: inset 0px 1px 0px 0px #a6827e; box-shadow: inset 0px 1px 0px 0px #a6827e;
background: linear-gradient(to bottom, #21374afc 5%, #152833ab 100%); background: linear-gradient(to bottom, #21374afc 5%, #152833ab 100%);
@ -1352,6 +1351,20 @@ Focus FOC: #ff0084
max-height: 26px; max-height: 26px;
margin-top: 4px; margin-top: 4px;
} }
.combat-tracker-tic-section {
max-width: 5rem;
min-width: 5rem;
align-content: center;
}
.combat-tracker-tic {
text-align: center;
background: linear-gradient(to bottom, #21374afc 5%, #152833ab 100%);
border-radius: 3px;
border: 2px ridge #846109;
color: #ffffff;
font-size: 0.8rem;
margin:2px;
}
.no-grow { .no-grow {
flex-grow: 1; flex-grow: 1;
max-width: 32px; max-width: 32px;

View File

@ -23,8 +23,7 @@
"manifest": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/raw/branch/master/system.json", "manifest": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/raw/branch/master/system.json",
"compatibility": { "compatibility": {
"minimum": "10", "minimum": "10",
"verified": "10", "verified": "11"
"maximum": "10"
}, },
"id": "fvtt-pegasus-rpg", "id": "fvtt-pegasus-rpg",
"packs": [ "packs": [
@ -253,7 +252,7 @@
], ],
"title": "Pegasus RPG", "title": "Pegasus RPG",
"url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg", "url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg",
"version": "10.2.6", "version": "11.0.8",
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v10.2.6.zip", "download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v11.0.8.zip",
"background": "systems/fvtt-pegasus-rpg/images/ui/pegasus_welcome_page.webp" "background": "systems/fvtt-pegasus-rpg/images/ui/pegasus_welcome_page.webp"
} }

View File

@ -2,6 +2,7 @@
"Actor": { "Actor": {
"types": [ "types": [
"character", "character",
"npc",
"vehicle" "vehicle"
], ],
"templates": { "templates": {
@ -171,6 +172,7 @@
"type": "value", "type": "value",
"ismax": true, "ismax": true,
"iscombat": true, "iscombat": true,
"status": "healthy",
"bonus": 0, "bonus": 0,
"max": 0 "max": 0
}, },
@ -180,22 +182,25 @@
"type": "value", "type": "value",
"ismax": true, "ismax": true,
"iscombat": true, "iscombat": true,
"status": "stable",
"bonus": 0, "bonus": 0,
"max": 0 "max": 0
}, },
"stealthhealth": { "concealment": {
"label": "STL Health", "label": "Concealment",
"type": "value", "type": "value",
"value": 0, "value": 0,
"ismax": true, "ismax": true,
"status": "hidden",
"bonus": 0, "bonus": 0,
"max": 0 "max": 0
}, },
"socialhealth": { "confidence": {
"label": "SOC Health", "label": "Confidence",
"type": "value", "type": "value",
"value": 0, "value": 0,
"ismax": true, "ismax": true,
"status": "confident",
"bonus": 0, "bonus": 0,
"max": 0 "max": 0
} }
@ -368,6 +373,12 @@
"core" "core"
] ]
}, },
"npc": {
"templates": [
"biodata",
"core"
]
},
"vehicle": { "vehicle": {
"templates": [ "templates": [
"vehicle" "vehicle"
@ -595,6 +606,7 @@
"armor": { "armor": {
"statistic": "", "statistic": "",
"resistance": "", "resistance": "",
"adrl": 0,
"weight": 0, "weight": 0,
"cost": 0, "cost": 0,
"idr": "", "idr": "",
@ -645,6 +657,8 @@
"weapon": { "weapon": {
"statistic": "", "statistic": "",
"damagestatistic": "", "damagestatistic": "",
"mdl": 0,
"rdl": 0,
"damage": "", "damage": "",
"canbethrown": false, "canbethrown": false,
"cost": 0, "cost": 0,

View File

@ -59,12 +59,6 @@
<div class="stat-item status-block"> <div class="stat-item status-block">
{{> systems/fvtt-pegasus-rpg/templates/partial-actor-status.html}} {{> systems/fvtt-pegasus-rpg/templates/partial-actor-status.html}}
</div> </div>
<!--
<label class="status-small-label">Active NRG</label>
<input type="text" class="padd-right status-small-label no-grow" name="system.nrg.activated" value="{{data.nrg.activated}}" data-dtype="Number"/>
-->
</div> </div>
</div> </div>
</div> </div>

View File

@ -26,6 +26,7 @@
{{/if}} {{/if}}
{{#if isResistance}} {{#if isResistance}}
<li>Armor Resistance Dice : {{armor.system.resistanceDice}}</li> <li>Armor Resistance Dice : {{armor.system.resistanceDice}}</li>
<li>ADRL : {{armor.system.adrl}}</li>
{{/if}} {{/if}}
{{#if stat}} {{#if stat}}
<li>Statistic : {{stat.label}}</li> <li>Statistic : {{stat.label}}</li>
@ -38,24 +39,39 @@
<li>Weapon : {{weaponName}}</li> <li>Weapon : {{weaponName}}</li>
{{/if}} {{/if}}
{{#if weapon}} {{#if weapon}}
{{#if (eq weapon.weapon.system.damagestatistic "str")}}
<li>MDL : {{weapon.weapon.system.mdl}}</li>
{{/if}}
{{#if (eq weapon.weapon.system.statistic "agi")}}
<li>RDL : {{weapon.weapon.system.rdl}}</li>
{{/if}}
{{#if vehicle}} {{#if vehicle}}
<li>Damage type : {{weapon.weapon.system.damagetype}}</li> <li>Damage type : {{weapon.weapon.system.damagetype}}</li>
{{else}} {{else}}
<li>Damage type : {{weapon.weapon.system.damagetype}} {{weapon.weapon.system.damagetypelevel}}</li> <li>Damage type : {{weapon.weapon.system.damagetype}} {{weapon.weapon.system.damagetypelevel}}</li>
{{/if}} {{/if}}
{{/if}} {{/if}}
{{#if (eq subKey "dmg-res")}}
<li>Damage Resistance</li>
{{#each armorsList as |armor idx|}}
{{#if armor.applied}}
<li>ADRL: {{armor.adrl}}</li>
{{/if}}
{{/each}}
{{/if}}
{{#if power}} {{#if power}}
<li>Power Damage type : {{power.system.powerdamagetype}} {{power.system.powerdamagetypelevel}}</li> <li>Power Damage type : {{power.system.powerdamagetype}} {{power.system.powerdamagetypelevel}}</li>
{{/if}} {{/if}}
{{#if isResistance}} {{#if hindranceFailure}}
<li><strong>Defense Result : {{finalScore}}</strong> <li><strong>Failed due to Hindrance Dice !!</strong>
{{else}} {{else}}
{{#if isDamage}} {{#if isResistance}}
<li><strong>Damages : {{finalScore}}</strong> <li><strong>Defense Result : {{finalScore}}</strong>
{{else}} {{else}}
<li><strong>Final Result : {{finalScore}}</strong> <li><strong>Final Result : {{finalScore}}</strong>
{{/if}} {{/if}}
{{/if}} {{/if}}

View File

@ -26,13 +26,21 @@
</select> </select>
</li> </li>
<li class="flexrow"><label class="generic-label">DMG RES Dice</label> <li class="flexrow"><label class="generic-label">Damage Resistance</label>
<select class="competence-base flexrow" type="text" name="system.resistance" value="{{data.resistance}}" data-dtype="Number"> <select class="competence-base flexrow" type="text" name="system.resistance" value="{{data.resistance}}" data-dtype="Number">
{{#select data.resistance}} {{#select data.resistance}}
{{{optionsDiceList}}} {{{optionsDiceList}}}
{{/select}} {{/select}}
</select> </select>
</li> </li>
{{#if owner}}
<li class="flexrow">
<label class="generic-label">ADRL</label>
<label class="generic-label">{{data.adrl}}</label>
</li>
{{/if}}
<li class="flexrow"><label class="generic-label">Location Protected</label> <li class="flexrow"><label class="generic-label">Location Protected</label>
<input type="text" class="" name="system.locationprotected" value="{{data.locationprotected}}" data-dtype="String"/> <input type="text" class="" name="system.locationprotected" value="{{data.locationprotected}}" data-dtype="String"/>
</li> </li>

View File

@ -93,13 +93,12 @@
<label class="attribute-value checkbox"><input type="checkbox" name="system.affectstatus" {{checked data.affectstatus}}/></label> <label class="attribute-value checkbox"><input type="checkbox" name="system.affectstatus" {{checked data.affectstatus}}/></label>
</li> </li>
{{#if data.affectstatus}} {{#if data.affectstatus}}
<li class="flexrow"><label class="generic-label">Affected status</label> <li class="flexrow"><label class="generic-label">Affected status/Auto damage</label>
<select class="competence-base flexrow" type="text" name="system.affectedstatus" value="{{data.affectedstatus}}" data-dtype="String"> <select class="competence-base flexrow" type="text" name="system.affectedstatus" value="{{data.affectedstatus}}" data-dtype="String">
{{#select data.affectedstatus}} {{#select data.affectedstatus}}
<option value="health">Health</option> <option value="mdl">MDL</option>
<option value="delirium">Delirium</option> <option value="rdl">RDL</option>
<option value="socialhealth">Social Health</option> <option value="adrl">ADRL</option>
<option value="stealthhealth">Stealth Health</option>
<option value="nrg">NRG</option> <option value="nrg">NRG</option>
<option value="mt">MT</option> <option value="mt">MT</option>
<option value="kbv">KBV</option> <option value="kbv">KBV</option>

View File

@ -38,6 +38,19 @@
</select> </select>
</li> </li>
{{#if (and owner (eq data.damagestatistic "str"))}}
<li class="flexrow">
<label class="generic-label">MDL</label>
<label class="competence-base">{{data.mdl}}</label>
</li>
{{/if}}
{{#if (and owner (eq data.damagestatistic "pre"))}}
<li class="flexrow">
<label class="generic-label">RDL</label>
<label class="competence-base">{{data.rdl}}</label>
</li>
{{/if}}
<li class="flexrow"><label class="generic-label">Item size</label> <li class="flexrow"><label class="generic-label">Item size</label>
<input type="text" class="" name="system.itemsize" value="{{data.itemsize}}" data-dtype="String"/> <input type="text" class="" name="system.itemsize" value="{{data.itemsize}}" data-dtype="String"/>
</li> </li>

View File

@ -1,25 +1,17 @@
<ul class="status-block"> <ul class="status-block">
<li class="item flexrow"> <li class="item flexrow">
<span class="stat-label status-small-label status-col-name"><label class="status-small-label"><strong>Status</strong></label></span> <span class="stat-label status-small-label status-col-name"><label class="status-small-label"><strong>Status</strong></label></span>
<span class="status-header-label status-small-label no-grow"><label class="status-small-label">Cur</label></span> <span class="status-header-label status-small-label no-grow"><label class="status-medium-label">State</label></span>
<span class="status-header-label status-small-label no-grow"><label class="status-small-label">Mod</label></span>
<span class="status-header-label status-small-label no-grow"><label class="status-small-label">Max</label></span>
</li> </li>
{{#each data.secondary as |stat2 key|}} {{#each data.secondary as |stat2 key|}}
<li class="item flexrow " data-attr-key="{{key}}"> <li class="item flexrow " data-attr-key="{{key}}">
<span class="stat-label flexrow status-col-name" name="{{key}}"> <span class="stat-label flexrow status-col-name" name="{{key}}">
<label class="status-small-label"><strong>{{stat2.label}}</strong><br> <label class="status-small-label"><strong>{{stat2.label}}</strong><br>
{{#if (eq key "health")}}
(KOV -{{stat2.max}})
{{/if}}
{{#if (eq key "delirium")}}
(MV -{{stat2.max}})
{{/if}}
</label> </label>
</span> </span>
<input type="text" class="padd-right status-small-label no-grow" name="system.secondary.{{key}}.value" value="{{stat2.value}}" data-dtype="Number"/> <select class="padd-right status-small-label" type="text" name="system.secondary.{{key}}.status" value="{{stat2.status}}" data-dtype="String">
<input type="text" class="padd-right status-small-label no-grow" name="system.secondary.{{key}}.bonus" value="{{stat2.bonus}}" data-dtype="Number" {{@root.disabledBonus}}/> {{selectOptions (getStatusConfig key) selected=stat2.status nameAttr="key" labelAttr="name" }}
<input type="text" class="padd-right status-small-label no-grow" name="system.secondary.{{key}}.max" value="{{stat2.max}}" data-dtype="Number"/> </select>
</li> </li>
{{/each}} {{/each}}
<li class="item flexrow " data-key="nrg"> <li class="item flexrow " data-key="nrg">

View File

@ -0,0 +1,135 @@
<section class="{{cssClass}} directory flexcol" id="{{cssId}}" data-tab="{{tabName}}">
<header class="combat-tracker-header">
{{#if user.isGM}}
<nav class="encounters flexrow" aria-label="{{localize 'COMBAT.NavLabel'}}">
<a class="combat-button combat-create" aria-label="{{localize 'COMBAT.Create'}}" role="button" data-tooltip="COMBAT.Create">
<i class="fas fa-plus"></i>
</a>
{{#if combatCount}}
<a class="combat-button combat-cycle" aria-label="{{localize 'COMBAT.EncounterPrevious'}}" role="button" data-tooltip="COMBAT.EncounterPrevious"
{{#if previousId}}data-document-id="{{previousId}}"{{else}}disabled{{/if}}>
<i class="fas fa-caret-left"></i>
</a>
<h4 class="encounter">{{localize "COMBAT.Encounter"}} {{currentIndex}} / {{combatCount}}</h4>
<a class="combat-button combat-cycle" aria-label="{{localize 'COMBAT.EncounterNext'}}" role="button" data-tooltip="COMBAT.EncounterNext"
{{#if nextId}}data-document-id="{{nextId}}"{{else}}disabled{{/if}}>
<i class="fas fa-caret-right"></i>
</a>
{{/if}}
<a class="combat-button combat-control" aria-label="{{localize 'COMBAT.Delete'}}" role="button" data-tooltip="COMBAT.Delete" data-control="endCombat" {{#unless combatCount}}disabled{{/unless}}>
<i class="fas fa-trash"></i>
</a>
</nav>
{{/if}}
<div class="encounter-controls flexrow {{#if hasCombat}}combat{{/if}}">
{{#if user.isGM}}
<a class="combat-button combat-control" aria-label="{{localize 'COMBAT.RollAll'}}" role="button" data-tooltip="COMBAT.RollAll" data-control="rollAll" {{#unless turns}}disabled{{/unless}}>
<i class="fas fa-users"></i>
</a>
<a class="combat-button combat-control" aria-label="{{localize 'COMBAT.RollNPC'}}" role="button" data-tooltip="COMBAT.RollNPC" data-control="rollNPC" {{#unless turns}}disabled{{/unless}}>
<i class="fas fa-users-cog"></i>
</a>
<a class="combat-button reset-npc-initiative" aria-label="Reset NPC" role="button" data-tooltip="Reset NPC Initiative" data-control="resetNPC" {{#unless turns}}disabled{{/unless}}>
<i class="fas fa-pickaxe"></i>
</a>
{{/if}}
{{#if combatCount}}
{{#if combat.round}}
<h3 class="encounter-title noborder">{{localize 'COMBAT.Round'}} {{combat.round}}</h3>
{{else}}
<h3 class="encounter-title noborder">{{localize 'COMBAT.NotStarted'}}</h3>
{{/if}}
{{else}}
<h3 class="encounter-title noborder">{{localize "COMBAT.None"}}</h3>
{{/if}}
{{#if user.isGM}}
<a class="combat-button combat-control" aria-label="{{localize 'COMBAT.InitiativeReset'}}" role="button" data-tooltip="COMBAT.InitiativeReset" data-control="resetAll"
{{#unless hasCombat}}disabled{{/unless}}>
<i class="fas fa-undo"></i>
</a>
<a class="combat-button combat-control" aria-label="{{localize 'labels.scope'}}" role="button" data-tooltip="{{labels.scope}}"
data-control="toggleSceneLink" {{#unless hasCombat}}disabled{{/unless}}>
<i class="fas fa-{{#unless linked}}un{{/unless}}link"></i>
</a>
{{/if}}
<a class="combat-button combat-settings" aria-label="{{localize 'COMBAT.Settings'}}" role="button" data-tooltip="COMBAT.Settings" data-control="trackerSettings">
<i class="fas fa-cog"></i>
</a>
</div>
</header>
<ol id="combat-tracker" class="directory-list">
{{#each turns}}
<li class="combatant actor directory-item flexrow {{this.css}}" data-combatant-id="{{this.id}}">
<img class="token-image" data-src="{{this.img}}" alt="{{this.name}}"/>
<div class="token-name flexcol">
<h4>{{this.name}}</h4>
<div class="combatant-controls flexrow">
{{#if ../user.isGM}}
<a class="combatant-control {{#if this.hidden}}active{{/if}}" aria-label="{{localize 'COMBAT.ToggleVis'}}" role="button" data-tooltip="COMBAT.ToggleVis" data-control="toggleHidden">
<i class="fas fa-eye-slash"></i>
</a>
<a class="combatant-control {{#if this.defeated}}active{{/if}}" aria-label="{{localize 'COMBAT.ToggleDead'}}" role="button" data-tooltip="COMBAT.ToggleDead" data-control="toggleDefeated">
<i class="fas fa-skull"></i>
</a>
{{/if}}
{{#if this.canPing}}
<a class="combatant-control" aria-label="{{localize 'COMBAT.PingCombatant'}}" role="button" data-tooltip="COMBAT.PingCombatant" data-control="pingCombatant">
<i class="fa-solid fa-bullseye-arrow"></i>
</a>
{{/if}}
<div class="token-effects">
{{#each this.effects}}
<img class="token-effect" src="{{this}}"/>
{{/each}}
</div>
</div>
</div>
{{#if this.hasResource}}
<div class="token-resource">
<span class="resource">{{this.resource}}</span>
</div>
{{/if}}
<div class="combat-tracker-tic-section flexcol" id="{{this.id}}">
<a class="combat-tracker-tic" data-tic-num="1" data-combatant-id="{{this.id}}">{{getTIC 1 this.id}}</a>
{{#if (isCharacter this.id)}}
<a class="combat-tracker-tic" data-tic-num="2" data-combatant-id="{{this.id}}">{{getTIC 2 this.id}}</a>
{{/if}}
</div>
<div class="token-initiative">
{{#if this.hasRolled}}
<span class="initiative">{{this.initiative}}</span>
{{else if this.owner}}
<a class="combatant-control roll" aria-label="{{localize 'COMBAT.InitiativeRoll'}}" role="button" data-tooltip="COMBAT.InitiativeRoll" data-control="rollInitiative"></a>
{{/if}}
</div>
</li>
{{/each}}
</ol>
<nav id="combat-controls" class="directory-footer flexrow" data-tooltip-direction="UP">
{{#if hasCombat}}
{{#if user.isGM}}
{{#if round}}
<a class="combat-control" aria-label="{{localize 'COMBAT.RoundPrev'}}" role="button" data-tooltip="COMBAT.RoundPrev" data-control="previousRound"><i class="fas fa-step-backward"></i></a>
<a class="combat-control" aria-label="{{localize 'COMBAT.TurnPrev'}}" role="button" data-tooltip="COMBAT.TurnPrev" data-control="previousTurn"><i class="fas fa-arrow-left"></i></a>
<a class="combat-control center" aria-label="{{localize 'COMBAT.End'}}" role="button" data-control="endCombat">{{localize 'COMBAT.End'}}</a>
<a class="combat-control" aria-label="{{localize 'COMBAT.TurnNext'}}" role="button" data-tooltip="COMBAT.TurnNext" data-control="nextTurn"><i class="fas fa-arrow-right"></i></a>
<a class="combat-control" aria-label="{{localize 'COMBAT.RoundNext'}}" role="button" data-tooltip="COMBAT.RoundNext" data-control="nextRound"><i class="fas fa-step-forward"></i></a>
{{else}}
<a class="combat-control center" aria-label="{{localize 'COMBAT.Begin'}}" role="button" data-control="startCombat">{{localize 'COMBAT.Begin'}}</a>
{{/if}}
{{else if control}}
<a class="combat-control" aria-label="{{localize 'COMBAT.TurnPrev'}}" role="button" data-tooltip="COMBAT.TurnPrev" data-control="previousTurn"><i class="fas fa-arrow-left"></i></a>
<a class="combat-control center" aria-label="{{localize 'COMBAT.TurnEnd'}}" role="button" data-control="nextTurn">{{localize 'COMBAT.TurnEnd'}}</a>
<a class="combat-control" aria-label="{{localize 'COMBAT.TurnNext'}}" role="button" data-tooltip="COMBAT.TurnNext" data-control="nextTurn"><i class="fas fa-arrow-right"></i></a>
{{/if}}
{{/if}}
</nav>
</section>

View File

@ -64,21 +64,6 @@
{{/if}} {{/if}}
{{/if}} {{/if}}
<!--
{{#if isDamage}}
<div class="flexrow">
<span class="roll-dialog-label">Weapon Damage :</span>
<select class="roll-dialog-label" id="damageDiceLevel" type="text" name="damageDiceLevel"
value="{{damageDiceLevel}}" data-dtype="Number">
{{#select damageDiceLevel}}
{{{optionsDiceList}}}
{{/select}}
</select>
<span class="small-label">&nbsp;</span>
</div>
{{/if}}
-->
<div class="dice-pool-div"> <div class="dice-pool-div">
<span> <span>
@ -87,7 +72,7 @@
<div class="flexrow dice-pool-stack"> <div class="flexrow dice-pool-stack">
{{#each dicePool as |dice idx|}} {{#each dicePool as |dice idx|}}
<span><a class="pool-remove-dice" data-dice-idx="{{idx}}" data-dice-level="{{dice.level}}" data-dice-key="{{dice.key}}"><img class="dice-pool-image" <span><a class="pool-remove-dice" data-dice-idx="{{idx}}" data-dice-level="{{dice.level}}" data-dice-key="{{dice.key}}"><img class="dice-pool-image"
src="{{dice.img}}"></a></span> src="{{dice.img}}" alt="dices"></a></span>
{{/each}} {{/each}}
</div> </div>
</div> </div>
@ -100,10 +85,24 @@
<div class="flexrow"> <div class="flexrow">
{{#each diceList as |dice idx|}} {{#each diceList as |dice idx|}}
<span><a class="pool-add-dice" data-dice-key="{{dice.key}}" data-dice-level="{{dice.level}}"><img class="dice-pool-image" <span><a class="pool-add-dice" data-dice-key="{{dice.key}}" data-dice-level="{{dice.level}}"><img class="dice-pool-image"
src="{{dice.img}}"></a></span> src="{{dice.img}}" alt="dices"></a></span>
{{/each}} {{/each}}
</div> </div>
{{/if}} {{/if}}
{{#if hindranceDices}}
<div class="dice-pool-div">
<span>
<h3 class="dice-pool-label">Hindrance Dice</h3>
</span>
<div class="flexrow dice-pool-stack">
{{#for 1 hindranceDices 1}}
<span><a class="" data-dice-idx="{{idx}}" data-dice-level="2" data-dice-key="d6"><img class="dice-pool-image"
src="systems/fvtt-pegasus-rpg/images/dice/hindrance-dice.png" alt="dices"></a></span>
{{/for}}
</div>
</div>
{{/if}}
<div class="flexrow"> <div class="flexrow">
@ -156,6 +155,19 @@
{{> systems/fvtt-pegasus-rpg/templates/partial-roll-select-effects.html}} {{> systems/fvtt-pegasus-rpg/templates/partial-roll-select-effects.html}}
{{/if}} {{/if}}
{{#if isInit}}
<div class="flexrow">
<span class="roll-dialog-label">TIC 1:</span>
<input class="roll-input-tic" id="roll-input-tic1" type="text" name="tic1" value="{{tic1}}" data-dtype="String">
</div>
{{#if (eq actorType "character")}}
<div class="flexrow">
<span class="roll-dialog-label">TIC 2:</span>
<input class="roll-input-tic" id="roll-input-tic2" type="text" name="tic2" value="{{tic2}}" data-dtype="String">
</div>
{{/if}}
{{/if}}
</div> </div>
</div> </div>