Compare commits
7 Commits
fvtt-pegas
...
fvtt-pegas
Author | SHA1 | Date | |
---|---|---|---|
72ff709682 | |||
588c6655b3 | |||
9de2bc48b8 | |||
460fd1f0d6 | |||
2647983e8d | |||
d1fdc5a97f | |||
9e92b904fb |
@ -771,6 +771,11 @@ export class PegasusActor extends Actor {
|
||||
let myself = this
|
||||
let combat = duplicate(myself.system.combat)
|
||||
combat.stunlevel += incDec
|
||||
let daze = this.effects.find( e => e.label == "Daze")
|
||||
|
||||
if (daze && combat.stunlevel == 0) {
|
||||
this.deleteEmbeddedDocuments("ActiveEffect", [ daze.id ] )
|
||||
}
|
||||
if (combat.stunlevel >= 0) {
|
||||
myself.update({ 'system.combat': combat })
|
||||
let chatData = {
|
||||
@ -778,10 +783,11 @@ export class PegasusActor extends Actor {
|
||||
rollMode: game.settings.get("core", "rollMode"),
|
||||
whisper: [game.user.id].concat(ChatMessage.getWhisperRecipients('GM'))
|
||||
}
|
||||
this.createEmbeddedDocuments("ActiveEffect", [
|
||||
{ label: 'EFFECT.StatusDaze', icon: 'icons/svg/daze.svg', flags: { core: { statusId: 'daze' } } }
|
||||
])
|
||||
|
||||
if (!daze) {
|
||||
this.createEmbeddedDocuments("ActiveEffect", [
|
||||
{ label: 'Daze', icon: 'icons/svg/daze.svg', flags: { core: { statusId: 'daze' } } }
|
||||
])
|
||||
}
|
||||
if (incDec > 0) {
|
||||
chatData.content = `<div>${this.name} suffered a Stun level.</div`
|
||||
} else {
|
||||
@ -805,7 +811,7 @@ export class PegasusActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
modifyMomentum(incDec) {
|
||||
if ( this.system.stun.value > 0 ) {
|
||||
if ( this.system.combat.stunlevel > 0 ) {
|
||||
ui.notifications.warn("Unable to gain/use Momentum while stunned")
|
||||
return
|
||||
}
|
||||
@ -1461,7 +1467,7 @@ export class PegasusActor extends Actor {
|
||||
updates['system.momentum.max'] = momentum
|
||||
}
|
||||
|
||||
let mrLevel = (this.system.statistics.agi.value + this.system.statistics.str.value) - this.system.statistics.phy.value
|
||||
let mrLevel = (this.system.statistics.agi.value + + this.system.statistics.agi.mod + this.system.statistics.str.value + this.system.statistics.str.mod) - (this.system.statistics.phy.value+this.system.statistics.phy.mod)
|
||||
mrLevel = (mrLevel < 1) ? 1 : mrLevel;
|
||||
if (mrLevel != this.system.mr.value) {
|
||||
updates['system.mr.value'] = mrLevel
|
||||
@ -1567,6 +1573,7 @@ export class PegasusActor extends Actor {
|
||||
for (let e of effects) {
|
||||
meleeBonus += Number(e.system.effectlevel)
|
||||
}
|
||||
this.baseMDL = this.system.biodata.sizenum + this.system.biodata.sizebonus + this.system.statistics.str.value + this.system.statistics.str.bonuseffect + meleeBonus
|
||||
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
|
||||
@ -1600,6 +1607,7 @@ export class PegasusActor extends Actor {
|
||||
if (role?.name?.toLowerCase() == "defender") { // Add defender bonus to ADRL
|
||||
roleBonus = this.getRoleLevel()
|
||||
}
|
||||
this.baseADRL = roleBonus + this.system.statistics.phy.value + this.system.statistics.phy.bonuseffect + this.system.biodata.sizenum + this.system.biodata.sizebonus
|
||||
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
|
||||
@ -1612,7 +1620,10 @@ export class PegasusActor extends Actor {
|
||||
this.updateEmbeddedDocuments('Item', updates)
|
||||
}
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
getBaseADRL() {
|
||||
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
parseStatEffects() {
|
||||
if (this.system.biodata.noautobonus) { // If we are in "no-bonus mode
|
||||
@ -2139,6 +2150,8 @@ export class PegasusActor extends Actor {
|
||||
rollData.noBonusDice = this.checkNoBonusDice()
|
||||
rollData.dicePool = []
|
||||
rollData.subKey = subKey
|
||||
rollData.MDL = this.baseMDL
|
||||
rollData.ADRL = this.baseADRL
|
||||
|
||||
if (subKey == "melee-dmg" || subKey == "ranged-dmg" || subKey == "power-dmg") {
|
||||
rollData.isDamage = true
|
||||
@ -2276,7 +2289,7 @@ export class PegasusActor extends Actor {
|
||||
let effects = this.items.filter(it => it.type == "effect" && Number(it.system.extratics)>0)
|
||||
let nbTics = 0
|
||||
for (let e of effects) {
|
||||
nbTics += Number(it.system.extratics)
|
||||
nbTics += Number(e.system.extratics)
|
||||
}
|
||||
return nbTics
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ export class PegasusCombatTracker extends CombatTracker {
|
||||
let combatData = await super.getData()
|
||||
for (let t of combatData.turns) {
|
||||
let c = game.combat.combatants.get(t.id)
|
||||
t.displayTIC = (c.actor.isOwner && c.actor.hasPlayerOwner && !game.user.isGM) || (c.actor.type == "npc" && !c.actor.hasPlayerOwner && game.user.isGM)
|
||||
let TICs = c.getFlag("world", "TICs")
|
||||
if (TICs) {
|
||||
t.TICs = TICs
|
||||
@ -23,7 +24,7 @@ export class PegasusCombatTracker extends CombatTracker {
|
||||
t.TICs = []
|
||||
}
|
||||
}
|
||||
console.log("CBT", combatData)
|
||||
//console.log("CBT", combatData)
|
||||
return combatData
|
||||
}
|
||||
|
||||
@ -88,13 +89,24 @@ export class PegasusCombat extends Combat {
|
||||
selectActor(combatantId) {
|
||||
const combatant = game.combat.combatants.get(combatantId)
|
||||
if (combatant) {
|
||||
let TICs = combatant.getFlag("world", "TICs") || []
|
||||
let allRevealed = true
|
||||
for(let tic of TICs) {
|
||||
if (!tic.revealed ) {
|
||||
allRevealed = false
|
||||
}
|
||||
}
|
||||
let msg = `<div>${combatant.actor.name} has been nominated to act, ${combatant.actor.name} choose which TIC you wish to activate!</div`
|
||||
if ( allRevealed) {
|
||||
msg = `<div>${combatant.actor.name} has used all its TIC's please choose a different character.</div`
|
||||
}
|
||||
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} has been nominated to act, ${combatant.actor.name} choose which TIC you wish to activate!</div`
|
||||
}
|
||||
content: msg
|
||||
}
|
||||
ChatMessage.create(chatData);
|
||||
}
|
||||
}
|
||||
@ -123,6 +135,17 @@ export class PegasusCombat extends Combat {
|
||||
if (ticData) {
|
||||
console.log('revealTIC', num, combatantId, ticData)
|
||||
num = Number(num)
|
||||
if ( ticData[num].revealed && ticData[num].displayed ) {
|
||||
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} : This Action has already been performed please choose a different TIC</div`
|
||||
};
|
||||
ChatMessage.create(chatData);
|
||||
return
|
||||
}
|
||||
ticData[num].revealed = true
|
||||
ticData[num].displayed = true
|
||||
combatant.setFlag("world", "TICs", ticData).then(() => {
|
||||
|
@ -104,6 +104,12 @@ export class PegasusRollDialog extends Dialog {
|
||||
if (armor) {
|
||||
armor.applied = toggled
|
||||
}
|
||||
this.rollData.armorUsed = false
|
||||
for(let a of this.rollData.armorsList) {
|
||||
if (a.applied) {
|
||||
this.rollData.armorUsed = true
|
||||
}
|
||||
}
|
||||
console.log("Armor", armorIdx, toggled)
|
||||
PegasusUtility.updateArmorDicePool(this.rollData)
|
||||
}
|
||||
@ -120,6 +126,12 @@ export class PegasusRollDialog extends Dialog {
|
||||
}
|
||||
weapon.applied = toggled
|
||||
}
|
||||
this.rollData.weaponUsed = false
|
||||
for(let a of this.rollData.weaponsList) {
|
||||
if (a.applied) {
|
||||
this.rollData.weaponUsed = true
|
||||
}
|
||||
}
|
||||
console.log("Weapon", weaponIdx, toggled, weapon)
|
||||
PegasusUtility.updateDamageDicePool(this.rollData)
|
||||
}
|
||||
|
@ -244,15 +244,15 @@
|
||||
"flags": {}
|
||||
}
|
||||
],
|
||||
"primaryTokenAttribute": "secondary.health.status",
|
||||
"secondaryTokenAttribute": "secondary.delirium.status",
|
||||
"primaryTokenAttribute": "",
|
||||
"secondaryTokenAttribute": "",
|
||||
"socket": true,
|
||||
"styles": [
|
||||
"styles/simple.css"
|
||||
],
|
||||
"title": "Pegasus RPG",
|
||||
"url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg",
|
||||
"version": "11.0.10",
|
||||
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v11.0.10.zip",
|
||||
"version": "11.0.17",
|
||||
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v11.0.17.zip",
|
||||
"background": "systems/fvtt-pegasus-rpg/images/ui/pegasus_welcome_page.webp"
|
||||
}
|
@ -57,7 +57,16 @@
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{#if (eq subKey "melee-dmg")}}
|
||||
{{#if (not weaponUsed)}}
|
||||
<li>MDL : {{MDL}}</li>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{#if (eq subKey "dmg-res")}}
|
||||
{{#if (not armorUsed)}}
|
||||
<li>ADRL : {{ADRL}}</li>
|
||||
{{/if}}
|
||||
{{#each armorsList as |armor idx|}}
|
||||
{{#if armor.applied}}
|
||||
<li>ADRL: {{armor.adrl}}</li>
|
||||
|
@ -101,7 +101,11 @@
|
||||
{{#if tic.revealed}}
|
||||
ACTED
|
||||
{{else}}
|
||||
TIC: {{add index 1}}
|
||||
{{#if ../displayTIC}}
|
||||
{{tic.text}}
|
||||
{{else}}
|
||||
TIC: {{add index 1}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</a></button>
|
||||
{{/each}}
|
||||
|
Reference in New Issue
Block a user