Skip to content

Commit

Permalink
Deploying to gh-pages from @ dc08e78 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
Sainan committed Jun 23, 2024
1 parent 665dae7 commit 75f83c3
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions rivencalc.html
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,16 @@ <h4 class="card-header">Curses</h4>
"WeaponToxinDamageMod": "DT_POISON",
}

// Test vectors for rollable physicals

// Weapons with projectile:
// - Aeolak: Puncture, Impact, Slash.
// - Acceltra: Impact.
// Weapons without projectile:
// - Braton: Puncture, Impact, Slash.
// - Bronco: Impact.
// - Lex: Puncture.

function addStatCompatInfo(div, weaponData, tag, buff)
{
let incompatible = false;
Expand All @@ -435,7 +445,7 @@ <h4 class="card-header">Curses</h4>
if (tag in upgradeTagToDamageType)
{
const damageType = upgradeTagToDamageType[tag];
if (!weaponHasInnateDamage(weaponData, damageType))
if (!weaponCanRollDamageType(weaponData, damageType))
{
const isPhysical = (damageType == "DT_IMPACT" || damageType == "DT_PUNCTURE" || damageType == "DT_SLASH");
if (isPhysical || !buff)
Expand All @@ -458,18 +468,19 @@ <h4 class="card-header">Curses</h4>
}
}

function weaponHasInnateDamage(weaponData, damageType)
function weaponCanRollDamageType(weaponData, damageType)
{
if (weaponData
&& weaponData.behaviors
&& weaponData.behaviors[0]
&& weaponData.behaviors[0].projectile
&& weaponData.behaviors[0].projectile.attack
)
const behavior = weaponData.behaviors[0];
if (behavior.projectile?.attack)
{
return (damageType in behavior.projectile.attack);
}
if (damageType in behavior.impact)
{
return (damageType in weaponData.behaviors[0].projectile.attack);
const totalDamage = Object.values(behavior.impact).reduce((a, b) => a + b, 0);
return (behavior.impact[damageType] / totalDamage) > 0.15;
}
return true;
return false;
}

function getBuffValue(rivenType, tag, tagValue, omegaAttenuation, lvl, buffs, curses)
Expand Down

0 comments on commit 75f83c3

Please sign in to comment.