Goony
Constructive!
|
What if they used percentages instead of comparing values? Here is some code based on block chance, the advantage is that it would eliminate minimum and maximum chance ;) AS3 code:
var attackerDex:Number = 0; // attackers dexterity
var defenderDex:Number = 0; // defenders dexterity
var attLuckyStrike:Number = 0;// Can be 0,2 or 7
var defNinjaReflexes:Number = 0; // Can be 0 or 4
var block:Boolean = ; //Can be true or false
function block():void
{
totalDex = attackerDex + defenderDex;
defenderPercent = defenderDex/totalDex; //This will give a number between 0 and 1
attackerPercent = attackerDex/totalDex; //This will give a number between 0 and 1
blockChance =((defenderPercent + (defNinjaReflexes)) / (attackerPercent + (attLuckyStrike/100)}) * 8;
//8 is the modifier, so if there are no cores and dexterity was equal, then: 0.5/0.5 = 1*8 thus block chance is 8%
blockRandom = Math.Random()*100
if blockChance < blockRandom
{
block = true
}
else
{
block = false
}
} Any mathematicians here that may be able to prove that this would be worse than the current formula :p Formula:
Block Chance = 8% + (Defender's Dexterity - Attacker's Dexterity) / 2.5
< Message edited by Goony -- 2/7/2014 7:36:21 >
|