Compare commits

...

11 Commits

Author SHA1 Message Date
502887a820 Fix #169 Add new ability stuff 2022-11-29 21:38:43 +01:00
b5755db5ca Fix #169 Add new ability stuff 2022-11-29 21:21:03 +01:00
8b0685e35d Minor various fixes 2022-11-28 13:58:20 +01:00
9e70a12b98 Minor various fixes 2022-11-28 13:58:04 +01:00
7755d87e48 Fix #160 - Add new values... 2022-11-27 20:39:45 +01:00
fcde81b0a4 Fix #160 - Add new values... 2022-11-27 19:07:54 +01:00
f61e5b4b41 Fix #160 - Add new values... 2022-11-27 19:07:34 +01:00
cb896c9813 Fix #160 - Add new values... 2022-11-27 18:54:52 +01:00
7d46699c62 Fix #150 - Message 2022-11-27 16:17:51 +01:00
b5f196f942 #Fix 150 - Message 2022-11-27 16:14:29 +01:00
11270eb450 #Fix 149 2022-11-27 16:12:44 +01:00
14 changed files with 243 additions and 120 deletions

View File

@ -62,6 +62,8 @@ export class PegasusActorSheet extends ActorSheet {
levelRemainingList: this.actor.getLevelRemainingList(),
maxLevelRemainingList: this.actor.getMaxLevelRemainingList(),
disabledBonus: (this.actor.system.biodata.noautobonus) ? "" : "disabled",
mt: this.actor.getMT(),
kbv: this.actor.getKBV(),
containersTree: this.actor.containersTree,
encCurrent: this.actor.encCurrent,
encHindrance: this.actor.encHindrance,
@ -352,13 +354,13 @@ export class PegasusActorSheet extends ActorSheet {
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
/*setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
return position;
}
}*/
/* -------------------------------------------- */
async _onDropItem(event, dragData) {

View File

@ -134,7 +134,43 @@ export class PegasusActor extends Actor {
super._preUpdate(changed, options, user);
}
/* -------------------------------------------- */
getMT() {
let modifier = 0
for (let effect of this.items) {
if (effect.type == "effect" && effect.system.affectstatus && effect.system.affectedstatus == "mt") {
if (effect.system.genre == "positive") {
modifier += effect.system.effectlevel
}
if (effect.system.genre == "negative") {
modifier -= effect.system.effectlevel
}
}
if (effect.type == "ability" && effect.system.statusaffected && effect.system.statusaffected == "mt") {
modifier += effect.system.statusmodifier
}
}
return PegasusUtility.getDiceValue(this.system.statistics.mnd.value) + this.system.statistics.mnd.mod + PegasusUtility.getDiceValue(this.system.statistics.mnd.bonuseffect) + modifier
}
/* -------------------------------------------- */
getKBV() {
let modifier = 0
for (let effect of this.items) {
if (effect.type == "effect" && effect.system.affectstatus && effect.system.affectedstatus == "kbv") {
if (effect.system.genre == "positive") {
modifier += effect.system.effectlevel
}
if (effect.system.genre == "negative") {
modifier -= effect.system.effectlevel
}
}
if (effect.type == "ability" && effect.system.statusaffected && effect.system.statusaffected == "kbv") {
modifier += effect.system.statusmodifier
}
}
return this.system.statistics.phy.value + this.system.statistics.phy.mod + this.system.statistics.phy.bonuseffect + modifier
}
/* -------------------------------------------- */
getEncumbranceCapacity() {
return this.system.statistics.str.value * 25
@ -246,7 +282,7 @@ export class PegasusActor extends Actor {
getRoleLevel() {
let role = this.items.find(item => item.type == 'role')
if (role) {
console.log("Role", role)
//console.log("Role", role)
return role.system.rolelevel
}
return 0
@ -445,7 +481,7 @@ export class PegasusActor extends Actor {
async activatePerk(perkId) {
let item = this.items.find(item => item.id == perkId);
if (item && item.system) {
let update = { _id: item.id, "data.active": !item.system.active };
let update = { _id: item.id, "system.active": !item.system.active };
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
}
}
@ -476,31 +512,38 @@ export class PegasusActor extends Actor {
await this.deleteEmbeddedDocuments('Item', toRem)
}
}
let update = { _id: item.id, "data.activated": !item.system.activated }
let update = { _id: item.id, "system.activated": !item.system.activated }
await this.updateEmbeddedDocuments('Item', [update]) // Updates one EmbeddedEntity
}
}
}
/* -------------------------------------------- */
setHandInformation( info) {
this.update( {'system.biodata.preferredhand': info} )
setHandInformation(info) {
this.update({ 'system.biodata.preferredhand': info })
}
/* -------------------------------------------- */
increaseRoleAbility() {
let role = this.getRole()
let level = role.system.rolelevel + 1
this.updateEmbeddedDocuments('Item', [{ _id: role.id, 'system.rolelevel': level }])
}
/* -------------------------------------------- */
addCDP( value) {
setBonusInformation(info) {
this.update({ 'system.biodata.bonusselection': info })
}
/* -------------------------------------------- */
addCDP(value) {
let cdp = this.system.biodata.cdp
cdp += value
this.update( {'system.biodata.cdp': cdp})
this.update({ 'system.biodata.cdp': cdp })
}
/* -------------------------------------------- */
addPPP(value) {
let ppp = duplicate(this.system.ppp)
ppp.availablePPP += value
console.log("PPP", ppp)
ppp.availablePPP += Number(value)
this.update({ 'system.ppp': ppp })
}
@ -575,7 +618,7 @@ export class PegasusActor extends Actor {
ChatMessage.create({ content: `Power ${item.name} deactivated : ${item.system.deactivatedtext}` })
}
}
let update = { _id: item.id, "data.activated": !item.system.activated }
let update = { _id: item.id, "system.activated": !item.system.activated }
await this.updateEmbeddedDocuments('Item', [update]) // Updates one EmbeddedEntity
}
}
@ -584,7 +627,7 @@ export class PegasusActor extends Actor {
async equipItem(itemId) {
let item = this.items.find(item => item.id == itemId);
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
}
}
@ -867,11 +910,11 @@ export class PegasusActor extends Actor {
}
}
if (item.type == 'race') {
if (item.type == "race") {
this.applyRace(item)
} else if (item.type == 'role') {
} else if (item.type == "role") {
this.applyRole(item)
} else if (item.type == 'ability') {
} else if (item.type == "ability") {
this.applyAbility(item, [], true)
if (!onDrop) {
await this.createEmbeddedDocuments('Item', [item])
@ -1274,7 +1317,8 @@ export class PegasusActor extends Actor {
/* -------------------------------------------- */
async deleteAllItemsByType(itemType) {
let items = this.items.filter(item => item.type == itemType);
let items = this.items.filter(item => item.type == itemType).map(item => item.id)
console.log("Dele....", items)
await this.deleteEmbeddedDocuments('Item', items);
}
@ -1456,9 +1500,9 @@ export class PegasusActor extends Actor {
updates['system.biodata.moralitythreshold'] = moralitythreshold
}
if (!this.isToken) {
if (this.warnMorality != this.system.biodata.morality && this.system.biodata.morality < 0) {
console.log("CHAR", this)
if (this.warnMorality != this.system.biodata.morality && this.system.biodata.morality <= 0) {
ChatMessage.create({ content: "WARNING: Your character is dangerously close to becoming corrupted and defeated. Start on a path of redemption!" })
ChatMessage.create({ content: "This character can no longer spend CDP until their Morality has reached 1 or higher" })
}
if (this.warnMorality != this.system.biodata.morality) {
this.warnMorality = this.system.biodata.morality
@ -1494,8 +1538,8 @@ export class PegasusActor extends Actor {
this.system.combat.hindrancedice = hindrance
this.getTraumaState()
this.cleanupPerksIfTrauma()
this.parseStatEffects()
this.parseStatusEffects()
await this.parseStatEffects()
await this.parseStatusEffects()
}
}
@ -1531,11 +1575,13 @@ export class PegasusActor extends Actor {
}
/* -------------------------------------------- */
parseStatusEffects() {
async 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))
let abilities = this.items.filter(ability => ability.type == "ability" && ability.system.statusaffected != "notapplicable")
for (let statusKey in this.system.secondary) {
let status = duplicate(this.system.secondary[statusKey])
let bonus = 0
@ -1544,9 +1590,14 @@ export class PegasusActor extends Actor {
bonus += Number(effect.system.effectlevel)
}
}
for (let ability of abilities) {
if (ability.system.statusaffected && ability.system.statusaffected == statusKey) {
bonus += Number(effect.system.statusmodifier)
}
}
if (bonus != status.bonus) {
status.bonus = bonus
this.update({ [`system.secondary.${statusKey}`]: status })
await this.update({ [`system.secondary.${statusKey}`]: status })
}
}
@ -1557,11 +1608,15 @@ export class PegasusActor extends Actor {
bonus += Number(effect.system.effectlevel)
}
}
for (let ability of abilities) {
if (ability.system.statusaffected && ability.system.statusaffected == "nrg") {
bonus += Number(ability.system.statusmodifier)
}
}
if (bonus != nrg.mod) {
nrg.mod = bonus
this.update({ [`system.nrg`]: nrg })
await this.update({ [`system.nrg`]: nrg })
}
}
/* -------------------------------------------- */
@ -1645,10 +1700,19 @@ export class PegasusActor extends Actor {
/* -------------------------------------------- */
async applyAbility(ability, updates = [], directUpdate = false) {
// manage stat bonus
if (!ability.system) {
ability.system = ability.data
}
if (ability.system.affectedstat != "notapplicable") {
let stat = duplicate(this.system.statistics[ability.system.affectedstat])
stat.mod += Number(ability.system.statmodifier)
updates[`system.statistics.${ability.system.affectedstat}`] = stat
if ( ability.system.affectedstat == "mr") {
let stat = duplicate(this.system.mr)
stat.mod += Number(ability.system.statmodifier)
updates[`system.mr`] = stat
} else {
let stat = duplicate(this.system.statistics[ability.system.affectedstat])
stat.mod += Number(ability.system.statmodifier)
updates[`system.statistics.${ability.system.affectedstat}`] = stat
}
}
// manage status bonus
if (ability.system.statusaffected != "notapplicable") {
@ -1667,6 +1731,16 @@ export class PegasusActor extends Actor {
delirium.bonus += Number(ability.system.statusmodifier)
updates[`system.secondary.delirium`] = delirium
}
if (ability.system.statusaffected == 'socialhealth') {
let socialhealth = duplicate(this.system.secondary.socialhealth)
socialhealth.bonus += Number(ability.system.statusmodifier)
updates[`system.secondary.socialhealth`] = delirium
}
if (ability.system.statusaffected == 'stealthhealth') {
let stealthhealth = duplicate(this.system.secondary.stealthhealth)
stealthhealth.bonus += Number(ability.system.statusmodifier)
updates[`system.secondary.stealthhealth`] = delirium
}
}
if (directUpdate) {
await this.update(updates)
@ -1709,11 +1783,11 @@ export class PegasusActor extends Actor {
/* -------------------------------------------- */
async applyRace(race) {
let updates = { 'system.biodata.racename': race.name }
updates['system.biodata.sizenum'] = race.system.size
let newItems = []
await this.deleteAllItemsByType('race')
newItems.push(race);
await this.deleteAllItemsByType("race")
newItems.push(race)
console.log("DROPPED RACE", race)
for (let ability of race.system.abilities) {
if (!ability.system) ability.system = ability.data
newItems.push(ability)
@ -1775,9 +1849,9 @@ export class PegasusActor extends Actor {
if (overCapacity > 0) {
effectsList.push({ label: "Encumbrance Hindrance", type: "hindrance", foreign: true, actorId: this.id, applied: false, value: overCapacity })
}
if (this.system.biodata.morality <= 0) {
/* Remove as per ticket #159if (this.system.biodata.morality <= 0) {
effectsList.push({ label: "Morality Hindrance", type: "hindrance", foreign: true, actorId: this.id, applied: false, value: 3 })
}
}*/
let effects = this.items.filter(item => item.type == 'effect')
for (let effect of effects) {
effect = duplicate(effect)
@ -1842,7 +1916,23 @@ export class PegasusActor extends Actor {
if (isPowerDmg && effect.system.stataffected == "powerdmgroll") {
this.pushEffect(rollData, effect)
}
}
}
/* -------------------------------------------- */
addRoleBonus(rollData, statKey, subKey) {
let role = this.getRole()
if (role.name.toLowerCase() == "ranged" && subKey == "ranged-dmg") {
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"))
}
if (role.name.toLowerCase() == "defender" && subKey == "defence") {
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"))
}
if (role.name.toLowerCase() == "scrapper" && statKey == "com") {
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"))
}
}
@ -2026,6 +2116,7 @@ export class PegasusActor extends Actor {
this.addArmorsShields(rollData, statKey, useShield, subKey)
this.addWeapons(rollData, statKey, useShield)
this.addEquipments(rollData, statKey)
this.addRoleBonus(rollData, statKey, subKey)
this.processVehicleTargetMessage(rollData)
console.log("ROLLDATA", rollData)

View File

@ -75,7 +75,7 @@ export class PegasusActorCreate {
if (step == "select-race") {
let race = this.races.find(item => item._id == itemId);
this.currentRace = race;
this.actor.applyRace(race);
await this.actor.applyRace(race);
PegasusUtility.removeChatMessageId(PegasusUtility.findChatMessageId(event.currentTarget));
if (race.system.nboptionnal > 0 && race.system.optionnalabilities.length > 0) {
this.manageOptionnalAbilities(race);
@ -93,7 +93,7 @@ export class PegasusActorCreate {
if (step == 'select-race-optionnal') {
let ability = this.raceOptionnalAbilities.optionnalabilities.find(item => item._id == itemId);
let update = []
this.actor.applyAbility(ability, update);
await this.actor.applyAbility(ability, update);
this.actor.update(update)
this.actor.createEmbeddedDocuments('Item', [ability]);
PegasusUtility.removeChatMessageId(PegasusUtility.findChatMessageId(event.currentTarget));
@ -104,7 +104,7 @@ export class PegasusActorCreate {
if (step == 'select-race-stats') {
let statKey = $(event.currentTarget).data("stat-key");
this.actor.modStat(statKey, 1);
await this.actor.modStat(statKey, 1);
this.raceSelectableStats.stats[statKey].used = true;
this.raceSelectableStats.numberstats -= 1;
PegasusUtility.removeChatMessageId(PegasusUtility.findChatMessageId(event.currentTarget));
@ -114,7 +114,7 @@ export class PegasusActorCreate {
if (step == 'select-race-perks') {
PegasusUtility.removeChatMessageId(PegasusUtility.findChatMessageId(event.currentTarget));
let perk = this.racePerks.find(item => item._id == itemId);
this.actor.createEmbeddedDocuments('Item', [perk]);
await this.actor.createEmbeddedDocuments('Item', [perk]);
this.racePerks = this.racePerks.filter(item => item._id != itemId);
this.nbRacePerks -= 1;
if (this.nbRacePerks == 0 || this.racePerks.length == 0) {
@ -127,7 +127,7 @@ export class PegasusActorCreate {
if (step == 'select-role') {
let role = this.roles.find(item => item._id == itemId);
PegasusUtility.removeChatMessageId(PegasusUtility.findChatMessageId(event.currentTarget));
this.actor.applyRole(role);
await this.actor.applyRole(role);
this.currentRole = role;
this.nbRoleStat = 2;
this.roleStats = duplicate(role.system.statincreasechoice)
@ -137,7 +137,7 @@ export class PegasusActorCreate {
if (step == 'select-role-start-spec') {
PegasusUtility.removeChatMessageId(PegasusUtility.findChatMessageId(event.currentTarget));
let spec = this.roleSpecStart.find(item => item._id == itemId);
this.actor.addIncSpec(spec, 1);
await this.actor.addIncSpec(spec, 1);
this.nbRoleSpecStart--;
this.roleSpecStart = this.roleSpecStart.filter(item => item._id != itemId);//Remove selected spec
if (this.nbRoleSpecStart == 0) {
@ -150,7 +150,7 @@ export class PegasusActorCreate {
if (step == 'select-role-stat') {
PegasusUtility.removeChatMessageId(PegasusUtility.findChatMessageId(event.currentTarget));
let statKey = $(event.currentTarget).data("stat-key");
this.actor.valueStat(statKey, 1);
await this.actor.valueStat(statKey, 1);
for (let stat of this.roleStats) {
if (stat.name.toLowerCase() == statKey.toLowerCase()) {
@ -172,15 +172,15 @@ export class PegasusActorCreate {
PegasusUtility.removeChatMessageId(PegasusUtility.findChatMessageId(event.currentTarget));
let spec = this.roleSpec.find(item => item._id == itemId);
if (this.nbDT2 > 0) {
this.actor.addIncSpec(spec, 2)
await this.actor.addIncSpec(spec, 2)
this.nbDT2--;
} else {
this.actor.addIncSpec(spec, 1)
await this.actor.addIncSpec(spec, 1)
this.nbDT1--;
}
this.roleSpec = this.roleSpec.filter(item => item._id != itemId);//Remove selected spec
if (this.nbDT1 == 0 || this.roleSpec.length == 0) {
this.rolePerks = this.getPerksFromRole(this.currentRole) // duplicate(this.currentRole.data.perks)
this.rolePerks = this.getPerksFromRole(this.currentRole)
this.nbPerks = 2;
this.showRolePerks()
} else {
@ -191,7 +191,7 @@ export class PegasusActorCreate {
if (step == 'select-role-perk') {
PegasusUtility.removeChatMessageId(PegasusUtility.findChatMessageId(event.currentTarget));
let perk = this.rolePerks.find(item => item._id == itemId);
this.actor.addIncPerk(perk, 1)
await this.actor.addIncPerk(perk, 1)
let excludedPerks = this.actor.items.filter(it => it.type == "perk" && !it.system.upgradable)
this.rolePerks = []
for (let perk of this.rolePerks) {
@ -199,7 +199,7 @@ export class PegasusActorCreate {
this.rolePerks.push(perk)
}
}
this.rolePerks.sort(function (a, b) { if (a.name < b.name) { return -1 } else { return 1 } })
this.rolePerks.sort(function compare(a, b) { if (a.name < b.name) { return -1 } else { return 1 } })
this.nbPerks--;
if (this.nbPerks == 0 || this.rolePerks.length == 0) {
this.nbGlobalSpec = 5
@ -216,7 +216,7 @@ export class PegasusActorCreate {
if (step == 'select-global-spec') {
PegasusUtility.removeChatMessageId(PegasusUtility.findChatMessageId(event.currentTarget));
let spec = this.specs.find(item => item._id == itemId);
this.actor.addIncSpec(spec, 1)
await this.actor.addIncSpec(spec, 1)
this.nbGlobalSpec--;
if (this.nbGlobalSpec == 0) {
this.nbGlobalStat = 5
@ -233,7 +233,7 @@ export class PegasusActorCreate {
if (step == 'select-global-stat') {
PegasusUtility.removeChatMessageId(PegasusUtility.findChatMessageId(event.currentTarget))
let statKey = $(event.currentTarget).data("stat-key")
this.actor.valueStat(statKey, 1)
await this.actor.valueStat(statKey, 1)
this.nbGlobalStat--
if (this.nbGlobalStat == 0) {
this.nbGlobalPerk = 1
@ -250,13 +250,14 @@ export class PegasusActorCreate {
if (step == 'select-global-perk') {
PegasusUtility.removeChatMessageId(PegasusUtility.findChatMessageId(event.currentTarget))
let perk = this.perks.find(item => item._id == itemId);
this.actor.addIncPerk(perk, 1)
await this.actor.addIncPerk(perk, 1)
this.nbGlobalPerk--;
if (this.nbGlobalPerk == 0) {
this.nbGlobalStatus = 1
if (this.forceVirtue) {
this.showVirtue()
} else {
this.statusCount = {}
this.showGlobalStatus()
}
} else {
@ -267,7 +268,8 @@ export class PegasusActorCreate {
if (step == 'select-global-status') {
PegasusUtility.removeChatMessageId(PegasusUtility.findChatMessageId(event.currentTarget))
let statusKey = $(event.currentTarget).data("status-key")
this.actor.addStatusBonus(statusKey, 1)
await this.actor.addStatusBonus(statusKey, 1)
this.statusCount[statusKey] = (this.statusCount[statusKey]) ? this.statusCount[statusKey]+1 : 1;
this.nbGlobalStatus--;
if (this.nbGlobalStatus == 0) {
this.nbBonusSelection = 1
@ -286,48 +288,63 @@ export class PegasusActorCreate {
let nextStep = $(event.currentTarget).data("bonus-key")
this.forceVirtue = true
if (nextStep == "bonus-statistic") {
this.actor.setBonusInformation("Stats Increased")
this.nbGlobalStat = 2
this.showGlobalStat()
}
if (nextStep == "bonus-specialisation") {
this.actor.setBonusInformation("Specialisations Increased")
this.nbGlobalSpec = 4
this.showGlobalSpec()
}
if (nextStep == "bonus-perk") {
this.actor.setBonusInformation("Perks - Check Effects & Perk Details.")
this.nbGlobalPerk = 2
this.showGlobalPerk()
}
if (nextStep == "bonus-status") {
this.actor.setBonusInformation("Status Modifiers")
this.nbGlobalStatus = 5
this.statusCount = {}
this.showGlobalStatus()
}
if (nextStep == "bonus-roleability") {
this.actor.setBonusInformation("Role Ability Level Increased")
this.actor.increaseRoleAbility()
this.showVirtue()
}
if (nextStep == "bonus-ppp5") {
this.actor.setBonusInformation("Power Purchase Points")
this.actor.addPPP(5)
this.showVirtue()
}
if (nextStep == "bonus-wealthy") {
this.actor.setBonusInformation("x2 Starting Funds")
ChatMessage.create({ content: "NOT AUTOMATED! Your character starts with x2 Starting Funds" })
this.showVirtue()
}
if (nextStep == "bonus-heirloom") {
this.actor.setBonusInformation("Family Heirloom (Level 1 Bonus Dice Item)")
ChatMessage.create({ content: "NOT AUTOMATED! Your character starts with an item of choice (GM Must approve). This item provides a Level 1 Bonus Dice to a Stat of choice" })
this.showVirtue()
}
if (nextStep == "bonus-vehicle") {
this.actor.setBonusInformation("Vehicle")
ChatMessage.create({ content: "NOT AUTOMATED! Your character starts with a Vehicle of Choice (GM Must approve)." })
this.showVirtue()
}
if (nextStep == "bonus-mount") {
this.actor.setBonusInformation("Mount")
ChatMessage.create({ content: "NOT AUTOMATED! Your character starts with a Mount of Choice (GM Must approve)." })
this.showVirtue()
}
if (nextStep == "bonus-sidekick") {
this.actor.setBonusInformation("Sidekick")
ChatMessage.create({ content: "NOT AUTOMATED! Your character starts with a Sidekick of Choice (GM Must approve)." })
this.showVirtue()
}
if (nextStep == "bonus-ambidextrious") {
this.actor.setBonusInformation("Ambidextrious")
this.actor.setHandInformation("Ambidextrious")
this.showVirtue()
}
@ -411,9 +428,9 @@ export class PegasusActorCreate {
manageSelectableStats(race) {
this.raceSelectableStats = {
"race": race,
"statsonlyonce": race.data.statsonlyonce,
"numberstats": race.data.numberstats,
"stats": duplicate(this.actor.data.data.statistics)
"statsonlyonce": race.system.statsonlyonce,
"numberstats": race.system.numberstats,
"stats": duplicate(this.actor.system.statistics)
}
this.processSelectableStats()
}
@ -433,20 +450,21 @@ export class PegasusActorCreate {
/* --------------- -------------------- --------- */
manageRacePerks(race) {
if (!this.currentRace.data.perksgained) {
if (!this.currentRace.system.perksgained) {
this.showRoles()
return;
}
if (!this.racePerks) { // First init
if (this.currentRace.data.perksall) {
if (this.currentRace.system.perksall) {
this.racePerks = duplicate(this.perks)
} else {
this.racePerks = duplicate(this.currentRace.data.perks)
this.racePerks = duplicate(this.currentRace.system.perks)
}
this.nbRacePerks = this.currentRace.data.perksnumber;
this.nbRacePerks = this.currentRace.system.perksnumber;
}
let formData = this.createFormData("select-race-perks")
formData.raceperks = this.racePerks;
formData.raceperks.sort( function compare(a, b) { if (a.name<b.name){ return -1}else{return 1}} )
formData.nbraceperks = this.nbRacePerks;
this.renderChatMessage(formData)
}
@ -473,8 +491,8 @@ export class PegasusActorCreate {
/* --------------- ----------------------------- */
manageOptionnalAbilities(race) {
this.raceOptionnalAbilities = {
"nboptionnal": race.data.nboptionnal,
"optionnalabilities": duplicate(race.data.optionnalabilities),
"nboptionnal": race.system.nboptionnal,
"optionnalabilities": duplicate(race.system.optionnalabilities),
}
this.processOptionnalAbilitiesStep()
}
@ -512,8 +530,6 @@ export class PegasusActorCreate {
async showRoleStartSpec() {
if (!this.roleSpecStart) {
this.roleSpecStart = this.specs.filter(spec => spec.system.statistic.toUpperCase() == this.currentRole.system.statincrease1.toUpperCase() || spec.system.statistic.toUpperCase() == this.currentRole.system.statincrease2.toUpperCase())
//console.log("SPEC FOUND", this.roleSpecStart)
//this.roleSpecStart = duplicate(this.currentRole.data.specialisationsplus1)
this.nbRoleSpecStart = 2;
}
let formData = this.createFormData("select-role-start-spec")
@ -529,7 +545,10 @@ export class PegasusActorCreate {
formData.rolestats = []
for (let stat of this.roleStats) {
if (stat.flag) {
formData.rolestats.push(duplicate(this.actor.system.statistics[stat.name.toLowerCase()]))
let actorStat = this.actor.system.statistics[stat.name.toLowerCase()]
if ( actorStat.value < 5) { // Only below D12
formData.rolestats.push(duplicate(actorStat))
}
}
}
//console.log("STAT", this.roleStats, formData)
@ -561,7 +580,7 @@ export class PegasusActorCreate {
/* -------------------------------------------- */
async showGlobalSpec() {
let formData = this.createFormData("select-global-spec")
let excludedSpecs = this.actor.items.filter(it => it.type == "specialisation" && it.system.level >= 4)
let excludedSpecs = this.actor.items.filter(it => it.type == "specialisation" && it.system.level >= 5)
formData.specs = []
for (let spec of this.specs) {
let isOK = true
@ -585,7 +604,7 @@ export class PegasusActorCreate {
formData.stats = {}
for (let key in this.actor.system.statistics) {
let stat = this.actor.system.statistics[key]
if (stat.level < 5) {
if (stat.value < 5) {
formData.stats[key] = duplicate(stat)
}
}
@ -616,8 +635,18 @@ export class PegasusActorCreate {
/* -------------------------------------------- */
async showGlobalStatus() {
let formData = this.createFormData("select-global-status")
formData.status = duplicate(this.actor.system.secondary)
formData.status["nrg"] = duplicate(this.actor.system.nrg)
formData.status = {}
for(let statusKey in this.actor.system.secondary) {
if ( this.statusCount[statusKey] == undefined) {
this.statusCount[statusKey] = 0
}
if ( this.statusCount[statusKey] < 3) {
formData.status[statusKey] = duplicate(this.actor.system.secondary[statusKey])
}
}
if ( this.statusCount["nrg"] < 3) {
formData.status["nrg"] = duplicate(this.actor.system.nrg)
}
this.renderChatMessage(formData)
}

View File

@ -60,7 +60,6 @@ export class PegasusItemSheet extends ItemSheet {
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
optionsDiceList: PegasusUtility.getOptionsDiceList(),
optionsStatusList: PegasusUtility.getOptionsStatusList(),
data: itemData.system,
description: await TextEditor.enrichHTML(this.object.system.description, {async: true}),
limited: this.object.limited,

View File

@ -369,14 +369,9 @@ export class PegasusUtility {
this.optionsDiceList = optionsDiceList;
this.optionsLevel = optionsLevel;
this.optionsStatusList = '<option value="notapplicable">Not applicable</option><option value="health">Health</option><option value="nrg">NRG</option><option value="delirium">Delirium</option>';
}
/* -------------------------------------------- */
static getOptionsStatusList() {
return this.optionsStatusList;
}
/* -------------------------------------------- */
static getOptionsDiceList() {
return this.optionsDiceList;

View File

@ -253,7 +253,7 @@
],
"title": "Pegasus RPG",
"url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg",
"version": "10.2.0",
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v10.2.0.zip",
"version": "10.2.5",
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v10.2.5.zip",
"background": "systems/fvtt-pegasus-rpg/images/ui/pegasus_welcome_page.webp"
}

View File

@ -446,6 +446,7 @@
"perksgained": false,
"perksall": false,
"perksnumber": 0,
"size": 0,
"perks": [],
"perksrole": "",
"statistics": ""

View File

@ -168,6 +168,22 @@
</div>
</div>
<div>
<ul class="stat-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header-long">
<h3><label class="items-title-text">Status Thresholds</label></h3>
</span>
<span class="item-name-label-header-long">
<label class="items-title-text">Madness Threshold (MT): {{mt}}</label>
</span>
<span class="item-name-label-header-long">
<label class="items-title-text">Knock Back Value (KBV): {{kbv}}</label>
</span>
</li>
</ul>
</div>
<div>
<ul class="stat-list alternate-list">
<li class="item flexrow list-item items-title-bg">
@ -410,7 +426,7 @@
<h4>Power Purchase Points (PPP)</h4>
</span>
<span class="small-label padd-right packed-left">Available PPP</span><input type="text"
class="padd-right input-numeric-short" name="system.ppp.available" value="{{data.ppp.available}}"
class="padd-right input-numeric-short" name="system.ppp.availablePPP" value="{{data.ppp.availablePPP}}"
data-dtype="Number" />
&nbsp;&nbsp;
<span class="small-label padd-right packed-left">Spent PPP</span><input type="text"

View File

@ -239,10 +239,10 @@
{{/if}}
{{#if (eq step "character-end")}}
<div>Choose Starting Gear, Worst Fear, Desires, Catchphrase & Catchphrase Trigger
and fill in the empty fields in the Bio Tab.<br>
Automated character creation is over.
</div>
<div>
Choose Starting Gear, Worst Fear, Desires, Catchphrase & Catchphrase Trigger and fill in the empty fields in the Bio Tab. Lastly, make sure any UPGRADED (Level 2+) Perks and Perk Effects have been updated according to the rules. <br>
Games Masters May have to create new Effects and attach to the Perk Items in some cases.
</div>
{{/if}}

View File

@ -1,24 +0,0 @@
{{#if (eq traumaState "none")}}
<div class="flexrow">
<span class="roll-dialog-label" >Bonus Dice : </span>
<select class="roll-dialog-label" id="bonusDicesLevel" type="text" name="bonusDicesLevel" value="{{bonusDicesLevel}}" data-dtype="Number">
{{#select bonusDicesLevel}}
{{{optionsDiceList}}}
{{/select}}
</select>
<span class="small-label">&nbsp;</span>
</div>
{{/if}}
{{#if isInit}}
{{else}}
<div class="flexrow">
<span class="roll-dialog-label" >Hindrance Dice :</span>
<select class="roll-dialog-label" id="hindranceDicesLevel" type="text" name="hindranceDicesLevel" value="{{hindranceDicesLevel}}" data-dtype="Number">
{{#select hindranceDicesLevel}}
{{{optionsDiceList}}}
{{/select}}
</select>
<span class="small-label">&nbsp;</span>
</div>
{{/if}}

View File

@ -16,25 +16,32 @@
<div class="tab details" data-group="primary" data-tab="details">
<ul>
<li class="flexrow"><label class="generic-label">Affected stat</label>
<select class="competence-base flexrow" type="text" name="data.affectedstat" value="{{data.affectedstat}}" data-dtype="String">
<select class="competence-base flexrow" type="text" name="system.affectedstat" value="{{data.affectedstat}}" data-dtype="String">
{{#select data.affectedstat}}
{{> systems/fvtt-pegasus-rpg/templates/partial-options-statistics.html notapplicable=true mr=false}}
{{> systems/fvtt-pegasus-rpg/templates/partial-options-statistics.html notapplicable=true mr=true}}
{{/select}}
</select>
</li>
<li class="flexrow"><label class="generic-label">Stat modifier</label>
<input type="text" class="padd-right" name="data.statmodifier" value="{{data.statmodifier}}" data-dtype="Number"/>
<input type="text" class="padd-right" name="system.statmodifier" value="{{data.statmodifier}}" data-dtype="Number"/>
</li>
<li class="flexrow"><label class="generic-label">Affected status</label>
<select class="competence-base flexrow" type="text" name="data.statusaffected" value="{{data.statusaffected}}" data-dtype="String">
<select class="competence-base flexrow" type="text" name="system.statusaffected" value="{{data.statusaffected}}" data-dtype="String">
{{#select data.statusaffected}}
{{{optionsStatusList}}}
<option value="notapplicable">Not Applicable</option>
<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>
<option value="mt">MT</option>
<option value="kbv">KBV</option>
{{/select}}
</select>
</li>
<li class="flexrow"><label class="generic-label">Status modifier</label>
<input type="text" class="padd-right" name="data.statusmodifier" value="{{data.statusmodifier}}" data-dtype="Number"/>
<input type="text" class="padd-right" name="system.statusmodifier" value="{{data.statusmodifier}}" data-dtype="Number"/>
</li>
<li class="flexrow"><label class="generic-label">Effects Gained</label>
@ -45,7 +52,7 @@
</li>
{{#each data.effectsgained as |effect idx|}}
<li class="flexrow">
<label name="data.effectsgained[{{idx}}].name"><a class="view-subitem" data-type="effectsgained" data-index="{{idx}}">{{effect.name}}</a></label>
<label name="system.effectsgained[{{idx}}].name"><a class="view-subitem" data-type="effectsgained" data-index="{{idx}}">{{effect.name}}</a></label>
<div class="item-controls padd-left">
<a class="item-control delete-subitem padd-left" data-type="effectsgained" data-index="{{idx}}" title="Delete Effect"><i class="fas fa-trash"></i></a>
</div>
@ -62,7 +69,7 @@
</li>
{{#each data.powersgained as |power idx|}}
<li class="flexrow">
<label name="data.powersgained[{{idx}}].name"><a class="view-subitem" data-type="powersgained" data-index="{{idx}}">{{power.name}}</a></label>
<label name="system.powersgained[{{idx}}].name"><a class="view-subitem" data-type="powersgained" data-index="{{idx}}">{{power.name}}</a></label>
<div class="item-controls padd-left">
<a class="item-control delete-subitem padd-left" data-type="powersgained" data-index="{{idx}}" title="Delete Power"><i class="fas fa-trash"></i></a>
</div>
@ -78,7 +85,7 @@
</li>
{{#each data.specialisations as |spec idx|}}
<li class="flexrow">
<label name="data.specialisations[{{idx}}].name"><a class="view-subitem" data-type="specialisations" data-index="{{idx}}">{{spec.name}}</a></label>
<label name="system.specialisations[{{idx}}].name"><a class="view-subitem" data-type="specialisations" data-index="{{idx}}">{{spec.name}}</a></label>
<div class="item-controls padd-left">
<a class="item-control delete-subitem padd-left" data-type="specialisations" data-index="{{idx}}" title="Delete Specialisation"><i class="fas fa-trash"></i></a>
</div>
@ -89,7 +96,7 @@
</li>
<li class="flexrow"><label class="generic-label">Threat Level Value</label>
<input type="text" class="input-numeric-short padd-right" name="data.threatlevel" value="{{data.threatlevel}}" data-dtype="Number"/>
<input type="text" class="input-numeric-short padd-right" name="system.threatlevel" value="{{data.threatlevel}}" data-dtype="Number"/>
</li>
<li class="flexrow"><label class="generic-label">Attacks Gained</label>
@ -99,7 +106,7 @@
</li>
{{#each data.attackgained as |weapon idx|}}
<li class="flexrow">
<label name="data.specialisations[{{idx}}].name"><a class="view-subitem" data-type="attackgained" data-index="{{idx}}">{{weapon.name}}</a></label>
<label name="system.specialisations[{{idx}}].name"><a class="view-subitem" data-type="attackgained" data-index="{{idx}}">{{weapon.name}}</a></label>
<div class="item-controls padd-left">
<a class="item-control delete-subitem padd-left" data-type="attackgained" data-index="{{idx}}" title="Delete Weapon"><i class="fas fa-trash"></i></a>
</div>
@ -116,7 +123,7 @@
</li>
{{#each data.armorgained as |armor idx|}}
<li class="flexrow">
<label name="data.specialisations[{{idx}}].name"><a class="view-subitem" data-type="armorgained" data-index="{{idx}}">{{armor.name}}</a></label>
<label name="dasystema.specialisations[{{idx}}].name"><a class="view-subitem" data-type="armorgained" data-index="{{idx}}">{{armor.name}}</a></label>
<div class="item-controls padd-left">
<a class="item-control delete-subitem padd-left" data-type="armorgained" data-index="{{idx}}" title="Delete Armor"><i class="fas fa-trash"></i></a>
</div>

View File

@ -82,7 +82,7 @@
<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">Locked (Only GM can change/edit) ?</label>
<li class="flexrow"><label class="generic-label">Permanent/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>
@ -101,6 +101,8 @@
<option value="socialhealth">Social Health</option>
<option value="stealthhealth">Stealth Health</option>
<option value="nrg">NRG</option>
<option value="mt">MT</option>
<option value="kbv">KBV</option>
{{/select}}
</select>
</li>

View File

@ -14,19 +14,19 @@
<label class="generic-label">Description</label>
<div class="medium-editor item-text-long-line">
{{editor data.description target="data.description" button=true owner=owner editable=editable}}
{{editor description target="system.description" button=true owner=owner editable=editable}}
</div>
<label class="generic-label">Environment</label>
<div class="medium-editor item-text-long-line">
{{editor data.environment target="data.environment" button=true owner=owner editable=editable}}
{{editor data.environment target="system.environment" button=true owner=owner editable=editable}}
</div>
<label class="generic-label">Society/Culture</label>
<div class="medium-editor item-text-long-line">
{{editor data.society_culture target="data.society_culture" button=true owner=owner editable=editable}}
{{editor data.society_culture target="system.society_culture" button=true owner=owner editable=editable}}
</div>
<label class="generic-label">Outlook</label>
<div class="medium-editor item-text-long-line">
{{editor data.outlook target="data.outlook" button=true owner=owner editable=editable}}
{{editor data.outlook target="system.outlook" button=true owner=owner editable=editable}}
</div>
</div>
@ -52,6 +52,10 @@
</ul>
<ul>
<li class="flexrow">
<label class="generic-label">Size</label>
<input type="text" class="input-numeric-short padd-right" name="system.size" value="{{data.size}}" data-dtype="Number"/>
</li>
<li class="flexrow"><label class="generic-label">Selectable Stats ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.selectablestats" {{checked
system.selectablestats}} /></label>

View File

@ -142,6 +142,7 @@
<option value="none5">===== Other Circumstances</option>
<option value="d4">Concentrated<option>
<option value="d4">Off Hand d4<option>
<option value="d6">Higher Ground d6</option>
{{/select}}
</select>
</div>