Skip to content

Commit

Permalink
Various Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Solaris333 committed Mar 19, 2024
1 parent bec6a96 commit b4335bc
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 21 deletions.
4 changes: 2 additions & 2 deletions common/data/altspecials.js
Original file line number Diff line number Diff line change
Expand Up @@ -610,9 +610,9 @@ window.altspecials = {
},
},
4100: {
superAffinity: function(p) { return p.unit.class.has("Driven") ? 1.5 : 1; },
superClass: function(p) { return { "Driven": 1.5 }; },
},
4058: {
4102: {
atkbase: function(p) { return p.unit.type == "STR" || p.unit.class.has("Driven") || p.unit.class.has("Fighter") ? 1250 : 0; },
},
4115: {
Expand Down
10 changes: 5 additions & 5 deletions common/data/captains.js
Original file line number Diff line number Diff line change
Expand Up @@ -14473,11 +14473,11 @@ window.captains = {
atk: function(p) { return (window.specials[4098].turnedOn[p.sourceSlot]) && p.slot == p.sourceSlot ? [5.25, 5.75][CrunchUtils.llimitUnlock(p, "captains")] : p.unit.class.has("Fighter") || p.unit.class.has("Slasher") || p.unit.class.has("Cerebral") ? [4.5, 5][CrunchUtils.llimitUnlock(p, "captains")] : 1; },
},
4099: {
atk: function(p) { return p.unit.class.has("Driven") || p.unit.class.has("Powerhouse") ? p.classCount.Fighter > 1 && p.classCount.Slasher > 1 && p.classCount.Striker > 1 && p.classCount.Shooter > 1 ? 5.75 : 5 : 1; },
atk: function(p) { return p.unit.class.has("Driven") || p.unit.class.has("Powerhouse") ? p.classCount.Fighter >= 1 && p.classCount.Slasher >= 1 && p.classCount.Striker >= 1 && p.classCount.Shooter >= 1 ? 5.75 : 5 : 1; },
hp: function(p) { return p.unit.class.has("Driven") || p.unit.class.has("Powerhouse") ? 1.2 : 1; },
},
4100: {
atk: function(p) { return p.unit.class.has("Driven") || p.unit.class.has("Powerhouse") ? p.classCount.Fighter > 1 && p.classCount.Slasher > 1 && p.classCount.Striker > 1 && p.classCount.Shooter > 1 ? 5.75 : 5 : 1; },
atk: function(p) { return p.unit.class.has("Driven") || p.unit.class.has("Powerhouse") ? p.classCount.Fighter >= 1 && p.classCount.Slasher >= 1 && p.classCount.Striker >= 1 && p.classCount.Shooter >= 1 ? 5.75 : 5 : 1; },
hp: function(p) { return p.unit.class.has("Driven") || p.unit.class.has("Powerhouse") ? 1.2 : 1; },
},
4101: {
Expand Down Expand Up @@ -14534,17 +14534,17 @@ window.captains = {
},
4114: {
atk: function(p) { return p.unit.type == "STR" || p.unit.class.has("Powerhouse") || p.unit.class.has("Driven") ? [ 'wano', 'tnd' ].includes(p.orb) ? 5.5 : 5.25 : 1; },
status: function(p) { return p.increasedDamageTaken ? 1.1 : (p.delayed > 1 || p.defenseDown || p.poisoned || p.paralysis) ? 1.05 : 1; },
status: function(p) { return p.enemyEffects.increaseDamageTaken ? 1.1 : (p.enemyEffects.delayed > 1 || p.defenseDown || p.poisoned || p.paralysis) ? 1.05 : 1; },
hp: function(p) { return p.unit.type == "STR" || p.unit.class.has("Powerhouse") || p.unit.class.has("Driven") ? 1.25 : 1; },
},
4115: {
atk: function(p) { return p.unit.type == "STR" || p.unit.class.has("Powerhouse") || p.unit.class.has("Driven") ? [ 'wano', 'tnd' ].includes(p.orb) ? 5.5 : 5.25 : 1; },
status: function(p) { return p.increasedDamageTaken ? 1.1 : (p.delayed > 1 || p.defenseDown || p.poisoned || p.paralysis) ? 1.05 : 1; },
status: function(p) { return p.enemyEffects.increaseDamageTaken ? 1.1 : (p.enemyEffects.delayed > 1 || p.defenseDown || p.poisoned || p.paralysis) ? 1.05 : 1; },
hp: function(p) { return p.unit.type == "STR" || p.unit.class.has("Powerhouse") || p.unit.class.has("Driven") ? 1.25 : 1; },
},
4116: {
atk: function(p) { return p.unit.type == "STR" || p.unit.class.has("Cerebral") || p.unit.class.has("Driven") ? [ 'wano', 'tnd' ].includes(p.orb) ? 4.5 : 3.75 : 1; },
status: function(p) { return p.increasedDamageTaken || p.delayed > 1 || p.defenseDown || p.poisoned || p.paralysis ? 1.2 : 1; },
status: function(p) { return p.increaseDamageTaken || p.enemyEffects.delayed > 1 || p.defenseDown || p.poisoned || p.paralysis ? 1.2 : 1; },
hp: function(p) { return p.unit.type == "STR" || p.unit.class.has("Cerebral") || p.unit.class.has("Driven") ? 1.25 : 1; },
},
4117: {
Expand Down
7 changes: 5 additions & 2 deletions common/data/specials.js
Original file line number Diff line number Diff line change
Expand Up @@ -17711,7 +17711,7 @@ window.specials = {
4114: {
atk: function(p) { return p.unit.type == "STR" || p.unit.class.has("Driven") || p.unit.class.has("Powerhouse") ? [1, 2.5, 2.5, 1, 1, 2.5, 2.5][p.cached.multiplier] : 1; },
type: "class",
chain: function(p) { return [0, 1.8, 1.8, 0, 0, 1.8, 1.8][p.cached.multiplier]; },
chainAddition: function(p) { return [0, 1.8, 1.8, 0, 0, 1.8, 1.8][p.cached.multiplier]; },
affinity: function(p) { return p.unit.type == "STR" || p.unit.class.has("Driven") || p.unit.class.has("Powerhouse") ? [2.75, 1, 2.75, 1, 2.75, 1, 2.75][p.cached.multiplier] : 1; },
onActivation: function(p) {
var levels = [0, 1, 2, 3, 4, 5, 6];
Expand All @@ -17727,7 +17727,7 @@ window.specials = {
4115: {
atk: function(p) { return p.unit.type == "STR" || p.unit.class.has("Driven") || p.unit.class.has("Powerhouse") ? [1, 2.5, 2.5, 1, 1, 2.5, 2.5][p.cached.multiplier] : 1; },
type: "class",
chain: function(p) { return [0, 1.8, 1.8, 0, 0, 1.8, 1.8][p.cached.multiplier]; },
chainAddition: function(p) { return [0, 1.8, 1.8, 0, 0, 1.8, 1.8][p.cached.multiplier]; },
affinity: function(p) { return p.unit.type == "STR" || p.unit.class.has("Driven") || p.unit.class.has("Powerhouse") ? [2.75, 1, 2.75, 1, 2.75, 1, 2.75][p.cached.multiplier] : 1; },
onActivation: function(p) {
var levels = [0, 1, 2, 3, 4, 5, 6];
Expand All @@ -17746,6 +17746,9 @@ window.specials = {
status: function(p) { return p.enemyEffects.increaseDamageTaken || p.delayed > 0 ? 2.25 : 1; },
affinity: function(p) { return p.unit.type == "STR" || p.unit.class.has("Driven") || p.unit.class.has("Cerebral") ? 1.5 : 1; },
},
4117: {
atk: function(p) { return p.unit.class.has("Driven") ? 2 : 1; },
},
4119: {
atk: function(p) { return p.unit.class.has("Striker") || p.unit.class.has("Slasher") ? [2, 1, 2][p.cached.multiplier] : 1; },
type: "class",
Expand Down
43 changes: 31 additions & 12 deletions damage/js/cruncher.js
Original file line number Diff line number Diff line change
Expand Up @@ -617,8 +617,19 @@ var CruncherCtrl = function($scope, $rootScope, $timeout) {
atkbaseDamage += atkbaseTemp+(atkbaseTemp > 0 ? atkbasePlusTemp : 0);
atkbaseDamage = parseFloat($scope.data.customATKBase) != 0 && stat == "atk" ? parseFloat($scope.data.customATKBase) : atkbaseDamage;

if (Array.isArray(data.unit.class)) { superClassBoost *= ($scope.data["superClass" + data.unit.class[0].replace(" ","")]) ? 1.2 : 1; superClassBoost *= ($scope.data["superClass" + data.unit.class[1].replace(" ","")]) ? 1.2 : 1; }
else superClassBoost = ($scope.data["superClass" + data.unit.class.replace(" ","")]) ? 1.2 : 1;
var superClassBuffs = { "Fighter": 1.2, "Striker": 1.2, "Slasher": 1.2, "Shooter": 1.2, "Free Spirit": 1.2, "Cerebral": 1.2, "Driven": 1.2, "Powerhouse": 1.2 };
enabledSpecials.forEach(function(data) {
if (data.hasOwnProperty('superClass')){
superParams = getParameters(slot);
params["sourceSlot"] = data.sourceSlot;
var temp = data.superClass(params);
for([key, value] of Object.entries(temp)){
if(stat == "atk") superClassBuffs[key] = Math.max(superClassBuffs[key], value);
}
}
});
if (Array.isArray(data.unit.class)) { superClassBoost *= ($scope.data["superClass" + data.unit.class[0].replace(" ","")]) ? superClassBuffs[data.unit.class[0]] : 1; superClassBoost *= ($scope.data["superClass" + data.unit.class[1].replace(" ","")]) ? superClassBuffs[data.unit.class[1]] : 1; }
else superClassBoost = ($scope.data["superClass" + data.unit.class.replace(" ","")]) ? superClassBuffs[data.unit.class] : 1;

birdBoost = $scope.data.birdBuff ? 1.5 : 1;

Expand Down Expand Up @@ -752,22 +763,30 @@ var CruncherCtrl = function($scope, $rootScope, $timeout) {
return effects[$scope.data.effect][type](unit.unit || unit);
};

var getAffinity = function(strength, attackerType){
if(strength == 'strong') return $scope.data["superType" + attackerType] ? $scope.data.enemySuperType ? 2 : 2.5 : $scope.data.enemySuperType ? 1.5 : 2;
var getAffinity = function(strength, attackerType, teamSlot){
var superAffinity = [ 2, 0.5 ];
enabledSpecials.forEach(function(data) {
if (data.hasOwnProperty('superAffinity')){
superParams = getParameters(teamSlot);
params["sourceSlot"] = data.sourceSlot;
superAffinity[0] = data.superAffinity(params) > 1 ? data.superAffinity(params) : superAffinity[0];
}
});
if(strength == 'strong') return $scope.data["superType" + attackerType] ? $scope.data.enemySuperType ? superAffinity[0] : superAffinity[0] : $scope.data.enemySuperType ? 1.5 : superAffinity[0];
else return $scope.data["superType" + attackerType] ? $scope.data.enemySuperType ? 0.5 : 0.75 : $scope.data.enemySuperType ? 0.25 : 0.5;
};

var getTypeMultiplierOfUnit = function(attackerType, attackedType, unit, teamSlot) {
var typeMult = 1, affinityMult = 1, captAffinityMult = 1;

if (attackerType == 'STR' && attackedType == 'DEX') typeMult = getAffinity('strong', attackerType);
if (attackerType == 'QCK' && attackedType == 'STR') typeMult = getAffinity('strong', attackerType);
if (attackerType == 'DEX' && attackedType == 'QCK') typeMult = getAffinity('strong', attackerType);
if (attackerType == 'INT' && attackedType == 'PSY') typeMult = getAffinity('strong', attackerType);
if (attackerType == 'PSY' && attackedType == 'INT') typeMult = getAffinity('strong', attackerType);
if (attackerType == 'STR' && attackedType == 'QCK') typeMult = getAffinity('weak', attackerType);
if (attackerType == 'QCK' && attackedType == 'DEX') typeMult = getAffinity('weak', attackerType);
if (attackerType == 'DEX' && attackedType == 'STR') typeMult = getAffinity('weak', attackerType);
if (attackerType == 'STR' && attackedType == 'DEX') typeMult = getAffinity('strong', attackerType, unit, teamSlot);
if (attackerType == 'QCK' && attackedType == 'STR') typeMult = getAffinity('strong', attackerType, unit, teamSlot);
if (attackerType == 'DEX' && attackedType == 'QCK') typeMult = getAffinity('strong', attackerType, unit, teamSlot);
if (attackerType == 'INT' && attackedType == 'PSY') typeMult = getAffinity('strong', attackerType, unit, teamSlot);
if (attackerType == 'PSY' && attackedType == 'INT') typeMult = getAffinity('strong', attackerType, unit, teamSlot);
if (attackerType == 'STR' && attackedType == 'QCK') typeMult = getAffinity('weak', attackerType, unit, teamSlot);
if (attackerType == 'QCK' && attackedType == 'DEX') typeMult = getAffinity('weak', attackerType, unit, teamSlot);
if (attackerType == 'DEX' && attackedType == 'STR') typeMult = getAffinity('weak', attackerType, unit, teamSlot);

if ([2650, 2651, 2681].indexOf(unit.unit.number + 1) != -1 && teamSlot < 2) typeMult = getAffinity('strong', attackerType);
if ([3070, 3071, 3369, 3847, 3848].indexOf(unit.unit.number + 1) != -1 && teamSlot == 1 && $scope.data.actionright) typeMult = getAffinity('strong', attackerType);
Expand Down

0 comments on commit b4335bc

Please sign in to comment.