Compare commits

..

3 Commits

Author SHA1 Message Date
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
3 changed files with 38 additions and 10 deletions

View File

@ -136,11 +136,34 @@ export class PegasusActor extends Actor {
}
/* -------------------------------------------- */
getMT() {
return PegasusUtility.getDiceValue(this.system.statistics.mnd.value) + this.system.statistics.mnd.mod + PegasusUtility.getDiceValue(this.system.statistics.mnd.bonuseffect)
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
}
}
}
return PegasusUtility.getDiceValue(this.system.statistics.mnd.value) + this.system.statistics.mnd.mod + PegasusUtility.getDiceValue(this.system.statistics.mnd.bonuseffect) + modifier
}
/* -------------------------------------------- */
getKBV() {
return this.system.statistics.phy.value + this.system.statistics.phy.mod + this.system.statistics.phy.bonuseffect
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
}
}
}
return this.system.statistics.phy.value + this.system.statistics.phy.mod + this.system.statistics.phy.bonuseffect + modifier
}
/* -------------------------------------------- */
getEncumbranceCapacity() {
@ -253,7 +276,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
@ -452,7 +475,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
}
}
@ -483,7 +506,7 @@ 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
}
}
@ -494,8 +517,11 @@ export class PegasusActor extends Actor {
/* -------------------------------------------- */
increaseRoleAbility() {
let role = this.getRole()
let level = role.system.rolelevel + 1
this.updateEmbeddedDocuments('Item', [ {_id: role.id, 'system.rolelevel': level} ])
}
/* -------------------------------------------- */
setBonusInformation( info) {
this.update( {'system.biodata.bonusselection': info})
@ -586,7 +612,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
}
}
@ -595,7 +621,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
}
}

View File

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

View File

@ -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>