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