v2.4.0: fixed cases where lucky enchant wouldn't proc on killing blows
This commit is contained in:
+7
-1
@@ -43,13 +43,19 @@ public class Lucky extends Weapon.Enchantment {
|
|||||||
// lvl 1 ~ 12%
|
// lvl 1 ~ 12%
|
||||||
// lvl 2 ~ 14%
|
// lvl 2 ~ 14%
|
||||||
float procChance = (level+4f)/(level+40f) * procChanceMultiplier(attacker);
|
float procChance = (level+4f)/(level+40f) * procChanceMultiplier(attacker);
|
||||||
if (defender.HP <= damage && Random.Float() < procChance){
|
if (Random.Float() < procChance){
|
||||||
|
|
||||||
float powerMulti = Math.max(1f, procChance);
|
float powerMulti = Math.max(1f, procChance);
|
||||||
|
|
||||||
//default is -5: 80% common, 20% uncommon, 0% rare
|
//default is -5: 80% common, 20% uncommon, 0% rare
|
||||||
//ring level increases by 1 for each 20% above 100% proc rate
|
//ring level increases by 1 for each 20% above 100% proc rate
|
||||||
Buff.affect(defender, LuckProc.class).ringLevel = -10 + Math.round(5*powerMulti);
|
Buff.affect(defender, LuckProc.class).ringLevel = -10 + Math.round(5*powerMulti);
|
||||||
|
} else {
|
||||||
|
//in rare cases where we attack many times at once (e.g. gladiator fury)
|
||||||
|
// make sure that failed luck procs override prior succeeded ones
|
||||||
|
if (defender.buff(LuckProc.class) != null){
|
||||||
|
defender.buff(LuckProc.class).detach();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return damage;
|
return damage;
|
||||||
|
|||||||
Reference in New Issue
Block a user