mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-04-04 18:56:23 +02:00
Fixing silly calculations by me.
This commit is contained in:
parent
54ef85e1a3
commit
5e26f2e707
@ -44,22 +44,22 @@ public class AcrobaticsCommand extends SkillCommand {
|
|||||||
if (skillValue >= dodgeMaxBonusLevel) dodgeChanceF = dodgeChanceMax;
|
if (skillValue >= dodgeMaxBonusLevel) dodgeChanceF = dodgeChanceMax;
|
||||||
else dodgeChanceF = (float) (((double) dodgeChanceMax / (double) dodgeMaxBonusLevel) * skillValue);
|
else dodgeChanceF = (float) (((double) dodgeChanceMax / (double) dodgeMaxBonusLevel) * skillValue);
|
||||||
dodgeChance = percent.format(dodgeChanceF / 100D);
|
dodgeChance = percent.format(dodgeChanceF / 100D);
|
||||||
if (dodgeChanceF + dodgeChanceF * 0.3333D >= 100D) dodgeChanceLucky = percent.format(1D);
|
if (dodgeChanceF * 1.3333D >= 100D) dodgeChanceLucky = percent.format(1D);
|
||||||
else dodgeChanceLucky = percent.format((dodgeChanceF + dodgeChanceF * 0.3333D) / 100D);
|
else dodgeChanceLucky = percent.format(dodgeChanceF * 1.3333D / 100D);
|
||||||
|
|
||||||
// ROLL
|
// ROLL
|
||||||
if (skillValue >= rollMaxBonusLevel) rollChanceF = rollChanceMax;
|
if (skillValue >= rollMaxBonusLevel) rollChanceF = rollChanceMax;
|
||||||
else rollChanceF = (float) (((double) rollChanceMax / (double) rollMaxBonusLevel) * skillValue);
|
else rollChanceF = (float) (((double) rollChanceMax / (double) rollMaxBonusLevel) * skillValue);
|
||||||
rollChance = percent.format(rollChanceF / 100D);
|
rollChance = percent.format(rollChanceF / 100D);
|
||||||
if (rollChanceF + rollChanceF * 0.3333D >= 100D) rollChanceLucky = percent.format(1D);
|
if (rollChanceF * 1.3333D >= 100D) rollChanceLucky = percent.format(1D);
|
||||||
else rollChanceLucky = percent.format((rollChanceF + rollChanceF * 0.3333D) / 100D);
|
else rollChanceLucky = percent.format(rollChanceF * 1.3333D / 100D);
|
||||||
|
|
||||||
// GRACEFULROLL
|
// GRACEFULROLL
|
||||||
if (skillValue >= gracefulRollMaxBonusLevel) gracefulRollChanceF = gracefulRollChanceMax;
|
if (skillValue >= gracefulRollMaxBonusLevel) gracefulRollChanceF = gracefulRollChanceMax;
|
||||||
else gracefulRollChanceF = (float) (((double) gracefulRollChanceMax / (double) gracefulRollMaxBonusLevel) * skillValue);
|
else gracefulRollChanceF = (float) (((double) gracefulRollChanceMax / (double) gracefulRollMaxBonusLevel) * skillValue);
|
||||||
gracefulRollChance = percent.format(gracefulRollChanceF / 100D);
|
gracefulRollChance = percent.format(gracefulRollChanceF / 100D);
|
||||||
if (gracefulRollChanceF + gracefulRollChanceF * 0.3333D >= 100D) gracefulRollChanceLucky = percent.format(1D);
|
if (gracefulRollChanceF * 1.3333D >= 100D) gracefulRollChanceLucky = percent.format(1D);
|
||||||
else gracefulRollChanceLucky = percent.format((gracefulRollChanceF + gracefulRollChanceF * 0.3333D) / 100D);
|
else gracefulRollChanceLucky = percent.format(gracefulRollChanceF * 1.3333D / 100D);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -50,15 +50,15 @@ public class ArcheryCommand extends SkillCommand {
|
|||||||
if (skillValue >= dazeMaxBonusLevel) dazeChanceF = dazeBonusMax;
|
if (skillValue >= dazeMaxBonusLevel) dazeChanceF = dazeBonusMax;
|
||||||
else dazeChanceF = (float) (((double) dazeBonusMax / (double) dazeMaxBonusLevel) * skillValue);
|
else dazeChanceF = (float) (((double) dazeBonusMax / (double) dazeMaxBonusLevel) * skillValue);
|
||||||
dazeChance = percent.format(dazeChanceF / 100D);
|
dazeChance = percent.format(dazeChanceF / 100D);
|
||||||
if (dazeChanceF + dazeChanceF * 0.3333D >= 100D) dazeChanceLucky = percent.format(1D);
|
if (dazeChanceF * 1.3333D >= 100D) dazeChanceLucky = percent.format(1D);
|
||||||
else dazeChanceLucky = percent.format((dazeChanceF + dazeChanceF * 0.3333D) / 100D);
|
else dazeChanceLucky = percent.format(dazeChanceF * 1.3333D / 100D);
|
||||||
|
|
||||||
// Retrieve
|
// Retrieve
|
||||||
if (skillValue >= retrieveMaxBonusLevel) retrieveChanceF = retrieveBonusMax;
|
if (skillValue >= retrieveMaxBonusLevel) retrieveChanceF = retrieveBonusMax;
|
||||||
else retrieveChanceF = (float) (((double) retrieveBonusMax / (double) retrieveMaxBonusLevel) * skillValue);
|
else retrieveChanceF = (float) (((double) retrieveBonusMax / (double) retrieveMaxBonusLevel) * skillValue);
|
||||||
retrieveChance = percent.format(retrieveChanceF / 100D);
|
retrieveChance = percent.format(retrieveChanceF / 100D);
|
||||||
if (retrieveChanceF + retrieveChanceF * 0.3333D >= 100D) retrieveChanceLucky = percent.format(1D);
|
if (retrieveChanceF * 1.3333D >= 100D) retrieveChanceLucky = percent.format(1D);
|
||||||
else retrieveChanceLucky = percent.format((retrieveChanceF + retrieveChanceF * 0.3333D) / 100D);
|
else retrieveChanceLucky = percent.format(retrieveChanceF * 1.3333D / 100D);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -72,8 +72,8 @@ public class AxesCommand extends SkillCommand {
|
|||||||
if (skillValue >= critMaxBonusLevel) critChanceF = (float) critMaxChance;
|
if (skillValue >= critMaxBonusLevel) critChanceF = (float) critMaxChance;
|
||||||
else critChanceF = (float) ((critMaxChance / critMaxBonusLevel) * skillCheck);
|
else critChanceF = (float) ((critMaxChance / critMaxBonusLevel) * skillCheck);
|
||||||
critChance = percent.format(critChanceF / 100D);
|
critChance = percent.format(critChanceF / 100D);
|
||||||
if (critChanceF + critChanceF * 0.3333D >= 100D) critChanceLucky = percent.format(1D);
|
if (critChanceF * 1.3333D >= 100D) critChanceLucky = percent.format(1D);
|
||||||
else critChanceLucky = percent.format((critChanceF + critChanceF * 0.3333D) / 100D);
|
else critChanceLucky = percent.format(critChanceF * 1.3333D / 100D);
|
||||||
//Axe Mastery
|
//Axe Mastery
|
||||||
if (skillValue >= bonusDamageAxesMaxBonusLevel) bonusDamage = String.valueOf(bonusDamageAxesBonusMax);
|
if (skillValue >= bonusDamageAxesMaxBonusLevel) bonusDamage = String.valueOf(bonusDamageAxesBonusMax);
|
||||||
else bonusDamage = String.valueOf(skillValue / ((double) bonusDamageAxesMaxBonusLevel / (double) bonusDamageAxesBonusMax));
|
else bonusDamage = String.valueOf(skillValue / ((double) bonusDamageAxesMaxBonusLevel / (double) bonusDamageAxesBonusMax));
|
||||||
|
@ -49,14 +49,14 @@ public class FishingCommand extends SkillCommand {
|
|||||||
magicChanceInt = (int) (magicChanceInt * 1.1D);
|
magicChanceInt = (int) (magicChanceInt * 1.1D);
|
||||||
}
|
}
|
||||||
magicChance = percent.format(magicChanceInt / 100D);
|
magicChance = percent.format(magicChanceInt / 100D);
|
||||||
if (magicChanceInt + (magicChanceInt * 0.3333D) >= 100D) magicChanceLucky = percent.format(1D);
|
if (magicChanceInt * 1.3333D >= 100D) magicChanceLucky = percent.format(1D);
|
||||||
else magicChanceLucky = percent.format((magicChanceInt + (magicChanceInt * 0.3333D)) / 100D);
|
else magicChanceLucky = percent.format(magicChanceInt * 1.3333D / 100D);
|
||||||
|
|
||||||
//Shake
|
//Shake
|
||||||
int dropChance = Fishing.getShakeChance(lootTier);
|
int dropChance = Fishing.getShakeChance(lootTier);
|
||||||
shakeChance = percent.format(dropChance / 100D);
|
shakeChance = percent.format(dropChance / 100D);
|
||||||
if (dropChance + (dropChance * 0.3333D) >= 100D) shakeChanceLucky = percent.format(1D);
|
if (dropChance * 1.3333D >= 100D) shakeChanceLucky = percent.format(1D);
|
||||||
else shakeChanceLucky = percent.format((dropChance + (dropChance * 0.3333D)) / 100D);
|
else shakeChanceLucky = percent.format(dropChance * 1.3333D / 100D);
|
||||||
shakeUnlockLevel = advancedConfig.getShakeUnlockLevel();
|
shakeUnlockLevel = advancedConfig.getShakeUnlockLevel();
|
||||||
|
|
||||||
//Fishermans Diet
|
//Fishermans Diet
|
||||||
|
@ -76,14 +76,14 @@ public class HerbalismCommand extends SkillCommand {
|
|||||||
if (skillValue >= greenThumbMaxLevel) greenThumbChanceF = (float) (greenThumbMaxBonus);
|
if (skillValue >= greenThumbMaxLevel) greenThumbChanceF = (float) (greenThumbMaxBonus);
|
||||||
else greenThumbChanceF = (float) ((greenThumbMaxBonus / greenThumbMaxLevel) * skillValue);
|
else greenThumbChanceF = (float) ((greenThumbMaxBonus / greenThumbMaxLevel) * skillValue);
|
||||||
greenThumbChance = percent.format(greenThumbChanceF / 100D);
|
greenThumbChance = percent.format(greenThumbChanceF / 100D);
|
||||||
if (greenThumbChanceF + greenThumbChanceF * 0.3333D >= 100D) greenThumbChanceLucky = percent.format(1D);
|
if (greenThumbChanceF * 1.3333D >= 100D) greenThumbChanceLucky = percent.format(1D);
|
||||||
else greenThumbChanceLucky = percent.format((greenThumbChanceF + greenThumbChanceF * 0.3333D) / 100D);
|
else greenThumbChanceLucky = percent.format(greenThumbChanceF * 1.3333D / 100D);
|
||||||
//DOUBLE DROPS
|
//DOUBLE DROPS
|
||||||
if (skillValue >= doubleDropsMaxLevel) doubleDropChanceF = (float) (doubleDropsMaxBonus);
|
if (skillValue >= doubleDropsMaxLevel) doubleDropChanceF = (float) (doubleDropsMaxBonus);
|
||||||
else doubleDropChanceF = (float) ((doubleDropsMaxBonus / doubleDropsMaxLevel) * skillValue);
|
else doubleDropChanceF = (float) ((doubleDropsMaxBonus / doubleDropsMaxLevel) * skillValue);
|
||||||
doubleDropChance = percent.format(doubleDropChanceF / 100D);
|
doubleDropChance = percent.format(doubleDropChanceF / 100D);
|
||||||
if (doubleDropChanceF + doubleDropChanceF * 0.3333D >= 100D) doubleDropChanceLucky = percent.format(1D);
|
if (doubleDropChanceF * 1.3333D >= 100D) doubleDropChanceLucky = percent.format(1D);
|
||||||
else doubleDropChanceLucky = percent.format((doubleDropChanceF + doubleDropChanceF * 0.3333D) / 100D);
|
else doubleDropChanceLucky = percent.format(doubleDropChanceF * 1.3333D / 100D);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -71,8 +71,8 @@ public class MiningCommand extends SkillCommand {
|
|||||||
if (skillValue >= doubleDropsMaxLevel) doubleDropChanceF = (float) (doubleDropsMaxBonus);
|
if (skillValue >= doubleDropsMaxLevel) doubleDropChanceF = (float) (doubleDropsMaxBonus);
|
||||||
else doubleDropChanceF = (float) ((doubleDropsMaxBonus / doubleDropsMaxLevel) * skillValue);
|
else doubleDropChanceF = (float) ((doubleDropsMaxBonus / doubleDropsMaxLevel) * skillValue);
|
||||||
doubleDropChance = percent.format(doubleDropChanceF / 100D);
|
doubleDropChance = percent.format(doubleDropChanceF / 100D);
|
||||||
if (doubleDropChanceF + doubleDropChanceF * 0.3333D >= 100D) doubleDropChanceLucky = percent.format(1D);
|
if (doubleDropChanceF * 1.3333D >= 100D) doubleDropChanceLucky = percent.format(1D);
|
||||||
else doubleDropChanceLucky = percent.format((doubleDropChanceF + doubleDropChanceF * 0.3333D) / 100D);
|
else doubleDropChanceLucky = percent.format(doubleDropChanceF * 1.3333D / 100D);
|
||||||
|
|
||||||
//Blast Mining
|
//Blast Mining
|
||||||
if (skillValue >= blastMiningRank8) {
|
if (skillValue >= blastMiningRank8) {
|
||||||
|
@ -70,8 +70,8 @@ public class RepairCommand extends SkillCommand {
|
|||||||
if (skillValue >= superRepairMaxBonusLevel) superRepairChanceF = superRepairChanceMax;
|
if (skillValue >= superRepairMaxBonusLevel) superRepairChanceF = superRepairChanceMax;
|
||||||
else superRepairChanceF = (float) (((double) superRepairChanceMax / (double) superRepairMaxBonusLevel) * skillValue);
|
else superRepairChanceF = (float) (((double) superRepairChanceMax / (double) superRepairMaxBonusLevel) * skillValue);
|
||||||
superRepairChance = percent.format(superRepairChanceF / 100D);
|
superRepairChance = percent.format(superRepairChanceF / 100D);
|
||||||
if (superRepairChanceF + superRepairChanceF * 0.3333D >= 100D) superRepairChanceLucky = percent.format(1D);
|
if (superRepairChanceF * 1.3333D >= 100D) superRepairChanceLucky = percent.format(1D);
|
||||||
else superRepairChanceLucky = percent.format((superRepairChanceF + superRepairChanceF * 0.3333D) / 100D);
|
else superRepairChanceLucky = percent.format((superRepairChanceF * 1.3333D) / 100D);
|
||||||
|
|
||||||
arcaneForgingRank = Repair.getArcaneForgingRank(profile);
|
arcaneForgingRank = Repair.getArcaneForgingRank(profile);
|
||||||
}
|
}
|
||||||
|
@ -67,15 +67,15 @@ public class SwordsCommand extends SkillCommand {
|
|||||||
if (skillValue >= bleedMaxLevel) bleedChanceF = bleedChanceMax;
|
if (skillValue >= bleedMaxLevel) bleedChanceF = bleedChanceMax;
|
||||||
else bleedChanceF = (float) (((double) bleedChanceMax / (double) bleedMaxLevel) * skillValue);
|
else bleedChanceF = (float) (((double) bleedChanceMax / (double) bleedMaxLevel) * skillValue);
|
||||||
bleedChance = percent.format(bleedChanceF / 100D);
|
bleedChance = percent.format(bleedChanceF / 100D);
|
||||||
if (bleedChanceF + bleedChanceF * 0.3333D >= 100D) bleedChanceLucky = percent.format(1D);
|
if (bleedChanceF * 1.3333D >= 100D) bleedChanceLucky = percent.format(1D);
|
||||||
else bleedChanceLucky = percent.format((bleedChanceF + bleedChanceF * 0.3333D) / 100D);
|
else bleedChanceLucky = percent.format(bleedChanceF * 1.3333D / 100D);
|
||||||
|
|
||||||
//Counter Attack
|
//Counter Attack
|
||||||
if (skillValue >= counterMaxLevel) counterAttackChanceF = counterChanceMax;
|
if (skillValue >= counterMaxLevel) counterAttackChanceF = counterChanceMax;
|
||||||
else counterAttackChanceF = (float) (((double) counterChanceMax / (double) counterMaxLevel) * skillValue);
|
else counterAttackChanceF = (float) (((double) counterChanceMax / (double) counterMaxLevel) * skillValue);
|
||||||
counterAttackChance = percent.format(counterAttackChanceF / 100D);
|
counterAttackChance = percent.format(counterAttackChanceF / 100D);
|
||||||
if (counterAttackChanceF + counterAttackChanceF * 0.3333D >= 100D) counterAttackChanceLucky = percent.format(1D);
|
if (counterAttackChanceF * 1.3333D >= 100D) counterAttackChanceLucky = percent.format(1D);
|
||||||
else counterAttackChanceLucky = percent.format((counterAttackChanceF + counterAttackChanceF * 0.3333D) / 100D);
|
else counterAttackChanceLucky = percent.format(counterAttackChanceF * 1.3333D / 100D);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -43,8 +43,8 @@ public class TamingCommand extends SkillCommand {
|
|||||||
if (skillValue >= goreMaxLevel) goreChanceF = (goreChanceMax);
|
if (skillValue >= goreMaxLevel) goreChanceF = (goreChanceMax);
|
||||||
else goreChanceF = (float) (((double) goreChanceMax / (double) goreMaxLevel) * skillValue);
|
else goreChanceF = (float) (((double) goreChanceMax / (double) goreMaxLevel) * skillValue);
|
||||||
goreChance = percent.format(goreChanceF / 100D);
|
goreChance = percent.format(goreChanceF / 100D);
|
||||||
if (goreChanceF + goreChanceF * 0.3333D >= 100D) goreChanceLucky = percent.format(1D);
|
if (goreChanceF * 1.3333D >= 100D) goreChanceLucky = percent.format(1D);
|
||||||
else goreChanceLucky = percent.format((goreChanceF + goreChanceF * 0.3333D) / 100D);
|
else goreChanceLucky = percent.format(goreChanceF * 1.3333D / 100D);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -64,15 +64,15 @@ public class UnarmedCommand extends SkillCommand {
|
|||||||
if (skillValue >= disarmMaxLevel) disarmChanceF = disarmChanceMax;
|
if (skillValue >= disarmMaxLevel) disarmChanceF = disarmChanceMax;
|
||||||
else disarmChanceF = (float) (((double) disarmChanceMax / (double) disarmMaxLevel) * skillValue);
|
else disarmChanceF = (float) (((double) disarmChanceMax / (double) disarmMaxLevel) * skillValue);
|
||||||
disarmChance = percent.format(disarmChanceF / 100D);
|
disarmChance = percent.format(disarmChanceF / 100D);
|
||||||
if (disarmChanceF + disarmChanceF * 0.3333D >= 100D) disarmChanceLucky = percent.format(1D);
|
if (disarmChanceF * 1.3333D >= 100D) disarmChanceLucky = percent.format(1D);
|
||||||
else disarmChanceLucky = percent.format((disarmChanceF + disarmChanceF * 0.3333D) / 100D);
|
else disarmChanceLucky = percent.format(disarmChanceF * 1.3333D / 100D);
|
||||||
|
|
||||||
//Deflect
|
//Deflect
|
||||||
if (skillValue >= deflectMaxLevel) deflectChanceF = deflectChanceMax;
|
if (skillValue >= deflectMaxLevel) deflectChanceF = deflectChanceMax;
|
||||||
else deflectChanceF = (float) (((double) deflectChanceMax / (double) deflectMaxLevel) * skillValue);
|
else deflectChanceF = (float) (((double) deflectChanceMax / (double) deflectMaxLevel) * skillValue);
|
||||||
deflectChance = percent.format(deflectChanceF / 100D);
|
deflectChance = percent.format(deflectChanceF / 100D);
|
||||||
if (deflectChanceF + deflectChanceF * 0.3333D >= 100D) deflectChanceLucky = percent.format(1D);
|
if (deflectChanceF * 1.3333D >= 100D) deflectChanceLucky = percent.format(1D);
|
||||||
else deflectChanceLucky = percent.format((deflectChanceF + deflectChanceF * 0.3333D) / 100D);
|
else deflectChanceLucky = percent.format(deflectChanceF * 1.3333D / 100D);
|
||||||
|
|
||||||
//Iron Arm
|
//Iron Arm
|
||||||
if (skillValue >= 250) ironArmBonus = String.valueOf(ironArmMaxBonus);
|
if (skillValue >= 250) ironArmBonus = String.valueOf(ironArmMaxBonus);
|
||||||
|
@ -59,8 +59,8 @@ public class WoodcuttingCommand extends SkillCommand {
|
|||||||
if (skillValue >= doubleDropsMaxLevel) doubleDropChanceF = (float) (doubleDropsMaxBonus);
|
if (skillValue >= doubleDropsMaxLevel) doubleDropChanceF = (float) (doubleDropsMaxBonus);
|
||||||
else doubleDropChanceF = (float) ((doubleDropsMaxBonus / doubleDropsMaxLevel) * skillValue);
|
else doubleDropChanceF = (float) ((doubleDropsMaxBonus / doubleDropsMaxLevel) * skillValue);
|
||||||
doubleDropChance = percent.format(doubleDropChanceF / 100D);
|
doubleDropChance = percent.format(doubleDropChanceF / 100D);
|
||||||
if (doubleDropChanceF + doubleDropChanceF * 0.3333D >= 100D) doubleDropChanceLucky = percent.format(1D);
|
if (doubleDropChanceF * 1.3333D >= 100D) doubleDropChanceLucky = percent.format(1D);
|
||||||
else doubleDropChanceLucky = percent.format((doubleDropChanceF + doubleDropChanceF * 0.3333D) / 100D);
|
else doubleDropChanceLucky = percent.format(doubleDropChanceF * 1.3333D / 100D);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user