Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions src/module/actor/actor.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,6 @@ export class DemonlordActor extends Actor {
// Health and Healing Rate
system.characteristics.health.max += system.attributes.strength.value



// Armor
system.characteristics.defense = (system.bonuses.armor.fixed || system.attributes.agility.value + system.bonuses.armor.agility) // + system.characteristics.defense // Applied as ActiveEffect further down
}
Expand All @@ -190,6 +188,9 @@ export class DemonlordActor extends Actor {
system.characteristics.defense = system.characteristics.defense || system.bonuses.armor.fixed || system.attributes.agility.value + system.bonuses.armor.agility
}

// Insanity
if (this.type !== 'vehicle') system.characteristics.insanity.max += system.attributes.will.value

// --- Valid for all type of actors
// Healing Rate
system.characteristics.health.healingrate = system.characteristics.health.max / 4
Expand All @@ -200,8 +201,6 @@ export class DemonlordActor extends Actor {
}
// And then round down
system.characteristics.health.healingrate = Math.floor(system.characteristics.health.healingrate)
// Insanity
system.characteristics.insanity.max += system.attributes.will.value

// Final armor computation
system.characteristics.defense += system.bonuses.armor.defense
Expand Down Expand Up @@ -592,7 +591,8 @@ getTargetAttackBane(target) {

for (let effect of this.appliedEffects) {
const specialDuration = foundry.utils.getProperty(effect, `flags.${game.system.id}.specialDuration`)
if (specialDuration === 'NextD20Roll' || specialDuration === 'NextAttackRoll') await effect?.delete()
const animate = foundry.utils.getProperty(effect, `flags.${game.system.id}.doNotAnimate`) === undefined ? true: false
if (specialDuration === 'NextD20Roll' || specialDuration === 'NextAttackRoll') await effect?.delete({animate:animate})
}

Hooks.call('DL.RollAttack', {
Expand Down Expand Up @@ -678,11 +678,8 @@ getTargetAttackBane(target) {

for (let effect of this.appliedEffects) {
const specialDuration = foundry.utils.getProperty(effect, `flags.${game.system.id}.specialDuration`)
const doNotAnimate = foundry.utils.getProperty(effect, `flags.${game.system.id}.doNotAnimate`) === undefined ? false: true
if (specialDuration === 'NextD20Roll' || specialDuration === 'NextChallengeRoll') {
if (doNotAnimate) await effect?.delete({animate: false})
else await effect?.delete()
}
const animate = foundry.utils.getProperty(effect, `flags.${game.system.id}.doNotAnimate`) === undefined ? true: false
if (specialDuration === 'NextD20Roll' || specialDuration === 'NextChallengeRoll') await effect?.delete({animate:animate})
}

return challengeRoll
Expand Down Expand Up @@ -737,7 +734,8 @@ getTargetAttackBane(target) {

for (let effect of this.appliedEffects) {
const specialDuration = foundry.utils.getProperty(effect, `flags.${game.system.id}.specialDuration`)
if (specialDuration === 'NextD20Roll' || specialDuration === 'NextAttackRoll') await effect?.delete()
const animate = foundry.utils.getProperty(effect, `flags.${game.system.id}.doNotAnimate`) === undefined ? true: false
if (specialDuration === 'NextD20Roll' || specialDuration === 'NextAttackRoll') await effect?.delete({animate:animate})
}

return attackRoll
Expand Down Expand Up @@ -823,7 +821,8 @@ getTargetAttackBane(target) {

for (let effect of this.appliedEffects) {
const specialDuration = foundry.utils.getProperty(effect, `flags.${game.system.id}.specialDuration`)
if (specialDuration === 'NextD20Roll' || specialDuration === 'NextAttackRoll') await effect?.delete()
const animate = foundry.utils.getProperty(effect, `flags.${game.system.id}.doNotAnimate`) === undefined ? true: false
if (specialDuration === 'NextD20Roll' || specialDuration === 'NextAttackRoll') await effect?.delete({animate:animate})
}

if (itemMacroEnabled) {
Expand Down Expand Up @@ -945,7 +944,8 @@ getTargetAttackBane(target) {

for (let effect of this.appliedEffects) {
const specialDuration = foundry.utils.getProperty(effect, `flags.${game.system.id}.specialDuration`)
if (specialDuration === 'NextD20Roll' || specialDuration === 'NextAttackRoll') await effect?.delete()
const animate = foundry.utils.getProperty(effect, `flags.${game.system.id}.doNotAnimate`) === undefined ? true: false
if (specialDuration === 'NextD20Roll' || specialDuration === 'NextAttackRoll') await effect?.delete({animate:animate})
}

// Add concentration if it's in the spell duration
Expand Down Expand Up @@ -1081,7 +1081,8 @@ getTargetAttackBane(target) {

for (let effect of this.appliedEffects) {
const specialDuration = foundry.utils.getProperty(effect, `flags.${game.system.id}.specialDuration`)
if (specialDuration === 'NextD20Roll' || specialDuration === 'NextAttackRoll') await effect?.delete()
const animate = foundry.utils.getProperty(effect, `flags.${game.system.id}.doNotAnimate`) === undefined ? true: false
if (specialDuration === 'NextD20Roll' || specialDuration === 'NextAttackRoll') await effect?.delete({animate:animate})
}
if (itemMacroEnabled) {
const defender = target?.actor
Expand Down
61 changes: 40 additions & 21 deletions src/templates/actor/tabs/creature-reference.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
<div class="dl-creature-title row">
<div class="col-6">{{actor.name}}</div>
<div class="col-6" style="margin-right: 0; margin-left: auto">
{{localize "DL.CreatureDifficulty"}} {{system.difficulty}}
{{#unless (eq actor.type 'vehicle')}}
{{localize "DL.CreatureDifficulty"}} {{system.difficulty}}
{{else}}
{{localize "DL.VehiclePrice"}} {{system.price}}
{{/unless}}
</div>
</div>
<div class="dl-creature-sub-title">
Expand All @@ -17,29 +21,33 @@
<!-- STATS AND TRAITS -->
<div class="dl-creature-section-section">
<div>
{{#if system.attributes.perception.immune}}
<b>{{localize "DL.AttributePerception"}}</b> –&nbsp;;
{{else}}
<b>{{localize "DL.AttributePerception"}}</b>&nbsp; {{system.attributes.perception.value}} ({{plusify system.attributes.perception.modifier}});
{{/if}}
{{system.perceptionsenses}}
{{#unless (eq actor.type 'vehicle')}}
{{#if system.attributes.perception.immune}}
<b>{{localize "DL.AttributePerception"}}</b> –&nbsp;;
{{else}}
<b>{{localize "DL.AttributePerception"}}</b>&nbsp; {{system.attributes.perception.value}} ({{plusify system.attributes.perception.modifier}});
{{/if}}
{{system.perceptionsenses}}
{{/unless}}
</div>
<div>
<b>{{localize "DL.ArmorDefense"}}</b> {{system.characteristics.defense}}{{#if system.armor}}
({{system.armor}}){{/if}};&nbsp;
<b>{{localize "DL.CreatureHealth"}}</b> {{system.characteristics.health.max}};&nbsp;
<b>{{localize "DL.CharInsanity"}}</b>
{{#if system.characteristics.insanity.immune}}
–;&nbsp;
{{else}}
{{system.characteristics.insanity.value}};&nbsp;
{{/if}}
<b>{{localize "DL.CharCorruption"}}</b>
{{#if system.characteristics.corruption.immune}}
–&nbsp;
{{else}}
{{system.characteristics.corruption.value}}&nbsp;
{{/if}}
{{#unless (eq actor.type 'vehicle')}}
<b>{{localize "DL.CharInsanity"}}</b>
{{#if system.characteristics.insanity.immune}}
–;&nbsp;
{{else}}
{{system.characteristics.insanity.value}};&nbsp;
{{/if}}
<b>{{localize "DL.CharCorruption"}}</b>
{{#if system.characteristics.corruption.immune}}
–&nbsp;
{{else}}
{{system.characteristics.corruption.value}}&nbsp;
{{/if}}
{{/unless}}
</div>
<div>
{{#if system.attributes.strength.immune}}
Expand All @@ -64,8 +72,19 @@
{{/if}}
</div>
<div>
<b>{{localize "DL.CharSpeed"}}</b> {{system.characteristics.speed}}
{{system.speedtraits}}
{{#unless (eq actor.type 'vehicle')}}
<b>{{localize "DL.CharSpeed"}}</b> {{system.characteristics.speed}}
{{system.speedtraits}}
{{else}}
<b>{{localize "DL.VehicleSpace"}}</b> {{system.space}} <b>{{localize "DL.VehicleMaximumSpeed"}}</b> {{system.maximumspeed}};
{{system.speedtraits}}
<div>
<b>{{localize "DL.VehicleCrew"}}</b> {{system.crew}}
</div>
<div>
<b>{{localize "DL.VehicleCargo"}}</b> {{system.cargo}}
</div>
{{/unless}}
</div>
{{#each actor.features as |item id|}}
{{#unless (dlHideItem2025Trait item.name)}}
Expand Down
Loading