Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/calculations/calculations.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -417,13 +417,13 @@ function Calculations() {
sourceLink={"https://github.com/Frostiae/Flyffulator/blob/main/src/flyff/flyffentity.js#L535"}
/>

<BasicStat title={"Melee Block"} value={Utils.clamp(Context.player.getBlockChance(false, Context.defender), 6.25, 92.5)}
<BasicStat title={"Melee Block"} value={Context.player.getTrueBlockChance(false, Context.defender)}
information={"How often you block melee attacks from the current target.\n\nThis value may be different than the one you see in the character window as it takes everything into account, such as minimums, maximums and the opponent's stats. This is your true block rate."}
sourceLink={"https://github.com/Frostiae/Flyffulator/blob/main/src/flyff/flyffentity.js#L965"}
percentage
/>

<BasicStat title={"Ranged Block"} value={Utils.clamp(Context.player.getBlockChance(true, Context.defender), 6.25, 92.5)}
<BasicStat title={"Ranged Block"} value={Context.player.getTrueBlockChance(true, Context.defender)}
information={"How often you block ranged attacks from the current target.\n\nThis value may be different than the one you see in the character window as it takes everything into account, such as minimums, maximums and the opponent's stats. This is your true block rate."}
sourceLink={"https://github.com/Frostiae/Flyffulator/blob/main/src/flyff/flyffentity.js#L965"}
percentage
Expand Down
26 changes: 26 additions & 0 deletions src/flyff/flyffentity.js
Original file line number Diff line number Diff line change
Expand Up @@ -1412,6 +1412,32 @@ export default class Entity {
}
}

getTrueBlockChance(ranged, attacker) {
const blockChance = this.getBlockChance(ranged, attacker);
if (this.isPlayer()) {
if (blockChance <= 6) {
// minimum of 6.25% chance to block
return 6.25;
}
if (blockChance >= 75) {
// maximum of 92.5% chance to block
return 92.5;
}
return (blockChance - 1) / 80 * 100;
}
else {
if (blockChance <= 6) {
// minimum of 5% chance blockrate
return 5;
}
if (blockChance >= 95) {
// maximum of 94% chance blockrate
return 94;
}
return blockChance - 1;
}
}

getStatScale(parameter, skillProp, level) {
const levelProp = skillProp.levels[level];
if (levelProp == undefined) {
Expand Down