hit roll formula fixed
This commit is contained in:
1 parent
9cc102ca2a
commit
1a13f3f096
2 files changed
+26
-7
No files matched your search
@@ -663,15 +663,24 @@ public enum CombatManager {
|
||||
//int roll = ThreadLocalRandom.current().nextInt(100);
|
||||
DeferredPowerJob dpj = null;
|
||||
|
||||
int atrRoll = ThreadLocalRandom.current().nextInt(ac.level * 10,(int)atr);
|
||||
int max = (int)atr;
|
||||
int min = (int)(max * 0.5f);
|
||||
if(max < min){
|
||||
min = max - 1;
|
||||
}
|
||||
int atrRoll = ThreadLocalRandom.current().nextInt(min,max);
|
||||
int defRoll = 0;
|
||||
if(AbstractCharacter.IsAbstractCharacter(target)){
|
||||
AbstractCharacter tar = (AbstractCharacter) target;
|
||||
defRoll = ThreadLocalRandom.current().nextInt(tar.level * 10,tar.defenseRating);
|
||||
max = tar.defenseRating;
|
||||
min = (int)(max * 0.5f);
|
||||
if(max < min){
|
||||
min = max - 1;
|
||||
}
|
||||
defRoll = ThreadLocalRandom.current().nextInt(min,max);
|
||||
}
|
||||
|
||||
|
||||
if (atrRoll < defRoll) {
|
||||
if (atrRoll > defRoll) {
|
||||
|
||||
if (ac.getObjectType().equals(GameObjectType.PlayerCharacter))
|
||||
updateAttackTimers((PlayerCharacter) ac, target, true);
|
||||
|
||||
Reference in new issue
Block a user