Skip to content

Commit

Permalink
Fix for integrated Many-headed #623
Browse files Browse the repository at this point in the history
  • Loading branch information
bithir committed Aug 30, 2023
1 parent 3a8c254 commit 295ebe6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions script/common/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,9 @@ SYMBAROUM.abilityArmor = [
"armored"
]

SYMBAROUM.traitManyHeaded = 'many-headed';


SYMBAROUM.expCosts = {
"ritual": {
"free":6,
Expand Down
19 changes: 19 additions & 0 deletions script/common/item.js
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,14 @@ export class SymbaroumItem extends Item {
{
let lvl = this.getLevel();
if(lvl.level == 0) return;
// Many headed penalties
let hasManyHeaded = this.actor.items.filter( manyheaded => { return game.symbaroum.config.traitManyHeaded == manyheaded.system.reference });
if(hasManyHeaded.length > 0 && hasManyHeaded[0].getLevel().level > 1) {
lvl.level = Math.max(0, lvl.level - hasManyHeaded[0].getLevel().level +1);
hasManyHeaded[0].system.isIntegrated = true;
this.system.isIntegrated = true;

}
for(let i = 0; i < armors.length; i++)
{
if(armors[i].system.isStackableArmor) {
Expand Down Expand Up @@ -1477,6 +1485,17 @@ export class SymbaroumItem extends Item {
getItemModifierRobust(combatMods, armors, weapons, abilities) {
let lvl = this.getLevel();
if(lvl.level == 0) return;

// Many headed penalties
let hasManyHeaded = this.actor.items.filter( manyheaded => { return game.symbaroum.config.traitManyHeaded == manyheaded.system.reference });
if(hasManyHeaded.length > 0 && hasManyHeaded[0].getLevel().level > 1) {
lvl.level = Math.max(0, lvl.level - hasManyHeaded[0].getLevel().level +1);
hasManyHeaded[0].system.isIntegrated = true;
this.system.isIntegrated = true;

}


for(let i = 0; i < armors.length; i++) {
if(armors[i].system.isStackableArmor) {
continue;
Expand Down

0 comments on commit 295ebe6

Please sign in to comment.