Proceeding with DefenceTrait adjustments.

This commit is contained in:
MobiusDevelopment 2019-07-14 22:14:43 +00:00
parent c248b6ff85
commit 967476c7b3
36 changed files with 72 additions and 72 deletions

View File

@ -45,7 +45,7 @@ public final class AttackTrait extends AbstractEffect
for (Entry<String, Object> param : params.getSet().entrySet())
{
_attackTraits.put(TraitType.valueOf(param.getKey()), (Float.parseFloat((String) param.getValue()) / 100) + 1);
_attackTraits.put(TraitType.valueOf(param.getKey()), Float.parseFloat((String) param.getValue()) / 100);
}
}

View File

@ -90,7 +90,7 @@ public class CreatureStat
for (int i = 0; i < TraitType.values().length; i++)
{
_attackTraitValues[i] = 1;
_defenceTraitValues[i] = 1;
_defenceTraitValues[i] = 0;
}
}
@ -591,7 +591,7 @@ public class CreatureStat
_lock.readLock().lock();
try
{
_attackTraitValues[traitType.ordinal()] *= value;
_attackTraitValues[traitType.ordinal()] += value;
_attackTraits.add(traitType);
}
finally
@ -605,7 +605,7 @@ public class CreatureStat
_lock.readLock().lock();
try
{
_attackTraitValues[traitType.ordinal()] /= value;
_attackTraitValues[traitType.ordinal()] -= value;
if (_attackTraitValues[traitType.ordinal()] == 1)
{
_attackTraits.remove(traitType);
@ -663,7 +663,7 @@ public class CreatureStat
try
{
_defenceTraitValues[traitType.ordinal()] -= value;
if (_defenceTraitValues[traitType.ordinal()] == 1)
if (_defenceTraitValues[traitType.ordinal()] == 0)
{
_defenceTraits.remove(traitType);
}

View File

@ -1331,7 +1331,7 @@ public final class Formulas
public static double calcWeaponTraitBonus(Creature attacker, Creature target)
{
return Math.max(0, 2.0 - target.getStat().getDefenceTrait(attacker.getAttackType().getTraitType()));
return Math.max(0, 1.0 - target.getStat().getDefenceTrait(attacker.getAttackType().getTraitType()));
}
public static double calcAttackTraitBonus(Creature attacker, Creature target)

View File

@ -45,7 +45,7 @@ public final class AttackTrait extends AbstractEffect
for (Entry<String, Object> param : params.getSet().entrySet())
{
_attackTraits.put(TraitType.valueOf(param.getKey()), (Float.parseFloat((String) param.getValue()) / 100) + 1);
_attackTraits.put(TraitType.valueOf(param.getKey()), Float.parseFloat((String) param.getValue()) / 100);
}
}

View File

@ -90,7 +90,7 @@ public class CreatureStat
for (int i = 0; i < TraitType.values().length; i++)
{
_attackTraitValues[i] = 1;
_defenceTraitValues[i] = 1;
_defenceTraitValues[i] = 0;
}
}
@ -591,7 +591,7 @@ public class CreatureStat
_lock.readLock().lock();
try
{
_attackTraitValues[traitType.ordinal()] *= value;
_attackTraitValues[traitType.ordinal()] += value;
_attackTraits.add(traitType);
}
finally
@ -605,7 +605,7 @@ public class CreatureStat
_lock.readLock().lock();
try
{
_attackTraitValues[traitType.ordinal()] /= value;
_attackTraitValues[traitType.ordinal()] -= value;
if (_attackTraitValues[traitType.ordinal()] == 1)
{
_attackTraits.remove(traitType);
@ -663,7 +663,7 @@ public class CreatureStat
try
{
_defenceTraitValues[traitType.ordinal()] -= value;
if (_defenceTraitValues[traitType.ordinal()] == 1)
if (_defenceTraitValues[traitType.ordinal()] == 0)
{
_defenceTraits.remove(traitType);
}

View File

@ -1331,7 +1331,7 @@ public final class Formulas
public static double calcWeaponTraitBonus(Creature attacker, Creature target)
{
return Math.max(0, 2.0 - target.getStat().getDefenceTrait(attacker.getAttackType().getTraitType()));
return Math.max(0, 1.0 - target.getStat().getDefenceTrait(attacker.getAttackType().getTraitType()));
}
public static double calcAttackTraitBonus(Creature attacker, Creature target)

View File

@ -45,7 +45,7 @@ public final class AttackTrait extends AbstractEffect
for (Entry<String, Object> param : params.getSet().entrySet())
{
_attackTraits.put(TraitType.valueOf(param.getKey()), (Float.parseFloat((String) param.getValue()) / 100) + 1);
_attackTraits.put(TraitType.valueOf(param.getKey()), Float.parseFloat((String) param.getValue()) / 100);
}
}

View File

@ -90,7 +90,7 @@ public class CreatureStat
for (int i = 0; i < TraitType.values().length; i++)
{
_attackTraitValues[i] = 1;
_defenceTraitValues[i] = 1;
_defenceTraitValues[i] = 0;
}
}
@ -591,7 +591,7 @@ public class CreatureStat
_lock.readLock().lock();
try
{
_attackTraitValues[traitType.ordinal()] *= value;
_attackTraitValues[traitType.ordinal()] += value;
_attackTraits.add(traitType);
}
finally
@ -605,7 +605,7 @@ public class CreatureStat
_lock.readLock().lock();
try
{
_attackTraitValues[traitType.ordinal()] /= value;
_attackTraitValues[traitType.ordinal()] -= value;
if (_attackTraitValues[traitType.ordinal()] == 1)
{
_attackTraits.remove(traitType);
@ -663,7 +663,7 @@ public class CreatureStat
try
{
_defenceTraitValues[traitType.ordinal()] -= value;
if (_defenceTraitValues[traitType.ordinal()] == 1)
if (_defenceTraitValues[traitType.ordinal()] == 0)
{
_defenceTraits.remove(traitType);
}

View File

@ -1331,7 +1331,7 @@ public final class Formulas
public static double calcWeaponTraitBonus(Creature attacker, Creature target)
{
return Math.max(0, 2.0 - target.getStat().getDefenceTrait(attacker.getAttackType().getTraitType()));
return Math.max(0, 1.0 - target.getStat().getDefenceTrait(attacker.getAttackType().getTraitType()));
}
public static double calcAttackTraitBonus(Creature attacker, Creature target)

View File

@ -45,7 +45,7 @@ public final class AttackTrait extends AbstractEffect
for (Entry<String, Object> param : params.getSet().entrySet())
{
_attackTraits.put(TraitType.valueOf(param.getKey()), (Float.parseFloat((String) param.getValue()) / 100) + 1);
_attackTraits.put(TraitType.valueOf(param.getKey()), Float.parseFloat((String) param.getValue()) / 100);
}
}

View File

@ -90,7 +90,7 @@ public class CreatureStat
for (int i = 0; i < TraitType.values().length; i++)
{
_attackTraitValues[i] = 1;
_defenceTraitValues[i] = 1;
_defenceTraitValues[i] = 0;
}
}
@ -591,7 +591,7 @@ public class CreatureStat
_lock.readLock().lock();
try
{
_attackTraitValues[traitType.ordinal()] *= value;
_attackTraitValues[traitType.ordinal()] += value;
_attackTraits.add(traitType);
}
finally
@ -605,7 +605,7 @@ public class CreatureStat
_lock.readLock().lock();
try
{
_attackTraitValues[traitType.ordinal()] /= value;
_attackTraitValues[traitType.ordinal()] -= value;
if (_attackTraitValues[traitType.ordinal()] == 1)
{
_attackTraits.remove(traitType);
@ -663,7 +663,7 @@ public class CreatureStat
try
{
_defenceTraitValues[traitType.ordinal()] -= value;
if (_defenceTraitValues[traitType.ordinal()] == 1)
if (_defenceTraitValues[traitType.ordinal()] == 0)
{
_defenceTraits.remove(traitType);
}

View File

@ -1331,7 +1331,7 @@ public final class Formulas
public static double calcWeaponTraitBonus(Creature attacker, Creature target)
{
return Math.max(0, 2.0 - target.getStat().getDefenceTrait(attacker.getAttackType().getTraitType()));
return Math.max(0, 1.0 - target.getStat().getDefenceTrait(attacker.getAttackType().getTraitType()));
}
public static double calcAttackTraitBonus(Creature attacker, Creature target)

View File

@ -45,7 +45,7 @@ public final class AttackTrait extends AbstractEffect
for (Entry<String, Object> param : params.getSet().entrySet())
{
_attackTraits.put(TraitType.valueOf(param.getKey()), (Float.parseFloat((String) param.getValue()) / 100) + 1);
_attackTraits.put(TraitType.valueOf(param.getKey()), Float.parseFloat((String) param.getValue()) / 100);
}
}

View File

@ -90,7 +90,7 @@ public class CreatureStat
for (int i = 0; i < TraitType.values().length; i++)
{
_attackTraitValues[i] = 1;
_defenceTraitValues[i] = 1;
_defenceTraitValues[i] = 0;
}
}
@ -591,7 +591,7 @@ public class CreatureStat
_lock.readLock().lock();
try
{
_attackTraitValues[traitType.ordinal()] *= value;
_attackTraitValues[traitType.ordinal()] += value;
_attackTraits.add(traitType);
}
finally
@ -605,7 +605,7 @@ public class CreatureStat
_lock.readLock().lock();
try
{
_attackTraitValues[traitType.ordinal()] /= value;
_attackTraitValues[traitType.ordinal()] -= value;
if (_attackTraitValues[traitType.ordinal()] == 1)
{
_attackTraits.remove(traitType);
@ -663,7 +663,7 @@ public class CreatureStat
try
{
_defenceTraitValues[traitType.ordinal()] -= value;
if (_defenceTraitValues[traitType.ordinal()] == 1)
if (_defenceTraitValues[traitType.ordinal()] == 0)
{
_defenceTraits.remove(traitType);
}

View File

@ -1331,7 +1331,7 @@ public final class Formulas
public static double calcWeaponTraitBonus(Creature attacker, Creature target)
{
return Math.max(0, 2.0 - target.getStat().getDefenceTrait(attacker.getAttackType().getTraitType()));
return Math.max(0, 1.0 - target.getStat().getDefenceTrait(attacker.getAttackType().getTraitType()));
}
public static double calcAttackTraitBonus(Creature attacker, Creature target)

View File

@ -45,7 +45,7 @@ public final class AttackTrait extends AbstractEffect
for (Entry<String, Object> param : params.getSet().entrySet())
{
_attackTraits.put(TraitType.valueOf(param.getKey()), (Float.parseFloat((String) param.getValue()) / 100) + 1);
_attackTraits.put(TraitType.valueOf(param.getKey()), Float.parseFloat((String) param.getValue()) / 100);
}
}

View File

@ -90,7 +90,7 @@ public class CreatureStat
for (int i = 0; i < TraitType.values().length; i++)
{
_attackTraitValues[i] = 1;
_defenceTraitValues[i] = 1;
_defenceTraitValues[i] = 0;
}
}
@ -591,7 +591,7 @@ public class CreatureStat
_lock.readLock().lock();
try
{
_attackTraitValues[traitType.ordinal()] *= value;
_attackTraitValues[traitType.ordinal()] += value;
_attackTraits.add(traitType);
}
finally
@ -605,7 +605,7 @@ public class CreatureStat
_lock.readLock().lock();
try
{
_attackTraitValues[traitType.ordinal()] /= value;
_attackTraitValues[traitType.ordinal()] -= value;
if (_attackTraitValues[traitType.ordinal()] == 1)
{
_attackTraits.remove(traitType);
@ -663,7 +663,7 @@ public class CreatureStat
try
{
_defenceTraitValues[traitType.ordinal()] -= value;
if (_defenceTraitValues[traitType.ordinal()] == 1)
if (_defenceTraitValues[traitType.ordinal()] == 0)
{
_defenceTraits.remove(traitType);
}

View File

@ -1331,7 +1331,7 @@ public final class Formulas
public static double calcWeaponTraitBonus(Creature attacker, Creature target)
{
return Math.max(0, 2.0 - target.getStat().getDefenceTrait(attacker.getAttackType().getTraitType()));
return Math.max(0, 1.0 - target.getStat().getDefenceTrait(attacker.getAttackType().getTraitType()));
}
public static double calcAttackTraitBonus(Creature attacker, Creature target)

View File

@ -45,7 +45,7 @@ public final class AttackTrait extends AbstractEffect
for (Entry<String, Object> param : params.getSet().entrySet())
{
_attackTraits.put(TraitType.valueOf(param.getKey()), (Float.parseFloat((String) param.getValue()) / 100) + 1);
_attackTraits.put(TraitType.valueOf(param.getKey()), Float.parseFloat((String) param.getValue()) / 100);
}
}

View File

@ -90,7 +90,7 @@ public class CreatureStat
for (int i = 0; i < TraitType.values().length; i++)
{
_attackTraitValues[i] = 1;
_defenceTraitValues[i] = 1;
_defenceTraitValues[i] = 0;
}
}
@ -591,7 +591,7 @@ public class CreatureStat
_lock.readLock().lock();
try
{
_attackTraitValues[traitType.ordinal()] *= value;
_attackTraitValues[traitType.ordinal()] += value;
_attackTraits.add(traitType);
}
finally
@ -605,7 +605,7 @@ public class CreatureStat
_lock.readLock().lock();
try
{
_attackTraitValues[traitType.ordinal()] /= value;
_attackTraitValues[traitType.ordinal()] -= value;
if (_attackTraitValues[traitType.ordinal()] == 1)
{
_attackTraits.remove(traitType);
@ -663,7 +663,7 @@ public class CreatureStat
try
{
_defenceTraitValues[traitType.ordinal()] -= value;
if (_defenceTraitValues[traitType.ordinal()] == 1)
if (_defenceTraitValues[traitType.ordinal()] == 0)
{
_defenceTraits.remove(traitType);
}

View File

@ -1331,7 +1331,7 @@ public final class Formulas
public static double calcWeaponTraitBonus(Creature attacker, Creature target)
{
return Math.max(0, 2.0 - target.getStat().getDefenceTrait(attacker.getAttackType().getTraitType()));
return Math.max(0, 1.0 - target.getStat().getDefenceTrait(attacker.getAttackType().getTraitType()));
}
public static double calcAttackTraitBonus(Creature attacker, Creature target)

View File

@ -45,7 +45,7 @@ public final class AttackTrait extends AbstractEffect
for (Entry<String, Object> param : params.getSet().entrySet())
{
_attackTraits.put(TraitType.valueOf(param.getKey()), (Float.parseFloat((String) param.getValue()) / 100) + 1);
_attackTraits.put(TraitType.valueOf(param.getKey()), Float.parseFloat((String) param.getValue()) / 100);
}
}

View File

@ -90,7 +90,7 @@ public class CreatureStat
for (int i = 0; i < TraitType.values().length; i++)
{
_attackTraitValues[i] = 1;
_defenceTraitValues[i] = 1;
_defenceTraitValues[i] = 0;
}
}
@ -581,7 +581,7 @@ public class CreatureStat
_lock.readLock().lock();
try
{
_attackTraitValues[traitType.ordinal()] *= value;
_attackTraitValues[traitType.ordinal()] += value;
_attackTraits.add(traitType);
}
finally
@ -595,7 +595,7 @@ public class CreatureStat
_lock.readLock().lock();
try
{
_attackTraitValues[traitType.ordinal()] /= value;
_attackTraitValues[traitType.ordinal()] -= value;
if (_attackTraitValues[traitType.ordinal()] == 1)
{
_attackTraits.remove(traitType);
@ -653,7 +653,7 @@ public class CreatureStat
try
{
_defenceTraitValues[traitType.ordinal()] -= value;
if (_defenceTraitValues[traitType.ordinal()] == 1)
if (_defenceTraitValues[traitType.ordinal()] == 0)
{
_defenceTraits.remove(traitType);
}

View File

@ -1331,7 +1331,7 @@ public final class Formulas
public static double calcWeaponTraitBonus(Creature attacker, Creature target)
{
return Math.max(0, 2.0 - target.getStat().getDefenceTrait(attacker.getAttackType().getTraitType()));
return Math.max(0, 1.0 - target.getStat().getDefenceTrait(attacker.getAttackType().getTraitType()));
}
public static double calcAttackTraitBonus(Creature attacker, Creature target)

View File

@ -45,7 +45,7 @@ public final class AttackTrait extends AbstractEffect
for (Entry<String, Object> param : params.getSet().entrySet())
{
_attackTraits.put(TraitType.valueOf(param.getKey()), (Float.parseFloat((String) param.getValue()) / 100) + 1);
_attackTraits.put(TraitType.valueOf(param.getKey()), Float.parseFloat((String) param.getValue()) / 100);
}
}

View File

@ -90,7 +90,7 @@ public class CreatureStat
for (int i = 0; i < TraitType.values().length; i++)
{
_attackTraitValues[i] = 1;
_defenceTraitValues[i] = 1;
_defenceTraitValues[i] = 0;
}
}
@ -581,7 +581,7 @@ public class CreatureStat
_lock.readLock().lock();
try
{
_attackTraitValues[traitType.ordinal()] *= value;
_attackTraitValues[traitType.ordinal()] += value;
_attackTraits.add(traitType);
}
finally
@ -595,7 +595,7 @@ public class CreatureStat
_lock.readLock().lock();
try
{
_attackTraitValues[traitType.ordinal()] /= value;
_attackTraitValues[traitType.ordinal()] -= value;
if (_attackTraitValues[traitType.ordinal()] == 1)
{
_attackTraits.remove(traitType);
@ -653,7 +653,7 @@ public class CreatureStat
try
{
_defenceTraitValues[traitType.ordinal()] -= value;
if (_defenceTraitValues[traitType.ordinal()] == 1)
if (_defenceTraitValues[traitType.ordinal()] == 0)
{
_defenceTraits.remove(traitType);
}

View File

@ -1331,7 +1331,7 @@ public final class Formulas
public static double calcWeaponTraitBonus(Creature attacker, Creature target)
{
return Math.max(0, 2.0 - target.getStat().getDefenceTrait(attacker.getAttackType().getTraitType()));
return Math.max(0, 1.0 - target.getStat().getDefenceTrait(attacker.getAttackType().getTraitType()));
}
public static double calcAttackTraitBonus(Creature attacker, Creature target)

View File

@ -45,7 +45,7 @@ public final class AttackTrait extends AbstractEffect
for (Entry<String, Object> param : params.getSet().entrySet())
{
_attackTraits.put(TraitType.valueOf(param.getKey()), (Float.parseFloat((String) param.getValue()) / 100) + 1);
_attackTraits.put(TraitType.valueOf(param.getKey()), Float.parseFloat((String) param.getValue()) / 100);
}
}

View File

@ -90,7 +90,7 @@ public class CreatureStat
for (int i = 0; i < TraitType.values().length; i++)
{
_attackTraitValues[i] = 1;
_defenceTraitValues[i] = 1;
_defenceTraitValues[i] = 0;
}
}
@ -581,7 +581,7 @@ public class CreatureStat
_lock.readLock().lock();
try
{
_attackTraitValues[traitType.ordinal()] *= value;
_attackTraitValues[traitType.ordinal()] += value;
_attackTraits.add(traitType);
}
finally
@ -595,7 +595,7 @@ public class CreatureStat
_lock.readLock().lock();
try
{
_attackTraitValues[traitType.ordinal()] /= value;
_attackTraitValues[traitType.ordinal()] -= value;
if (_attackTraitValues[traitType.ordinal()] == 1)
{
_attackTraits.remove(traitType);
@ -653,7 +653,7 @@ public class CreatureStat
try
{
_defenceTraitValues[traitType.ordinal()] -= value;
if (_defenceTraitValues[traitType.ordinal()] == 1)
if (_defenceTraitValues[traitType.ordinal()] == 0)
{
_defenceTraits.remove(traitType);
}

View File

@ -1331,7 +1331,7 @@ public final class Formulas
public static double calcWeaponTraitBonus(Creature attacker, Creature target)
{
return Math.max(0, 2.0 - target.getStat().getDefenceTrait(attacker.getAttackType().getTraitType()));
return Math.max(0, 1.0 - target.getStat().getDefenceTrait(attacker.getAttackType().getTraitType()));
}
public static double calcAttackTraitBonus(Creature attacker, Creature target)

View File

@ -45,7 +45,7 @@ public final class AttackTrait extends AbstractEffect
for (Entry<String, Object> param : params.getSet().entrySet())
{
_attackTraits.put(TraitType.valueOf(param.getKey()), (Float.parseFloat((String) param.getValue()) / 100) + 1);
_attackTraits.put(TraitType.valueOf(param.getKey()), Float.parseFloat((String) param.getValue()) / 100);
}
}

View File

@ -90,7 +90,7 @@ public class CreatureStat
for (int i = 0; i < TraitType.values().length; i++)
{
_attackTraitValues[i] = 1;
_defenceTraitValues[i] = 1;
_defenceTraitValues[i] = 0;
}
}
@ -581,7 +581,7 @@ public class CreatureStat
_lock.readLock().lock();
try
{
_attackTraitValues[traitType.ordinal()] *= value;
_attackTraitValues[traitType.ordinal()] += value;
_attackTraits.add(traitType);
}
finally
@ -595,7 +595,7 @@ public class CreatureStat
_lock.readLock().lock();
try
{
_attackTraitValues[traitType.ordinal()] /= value;
_attackTraitValues[traitType.ordinal()] -= value;
if (_attackTraitValues[traitType.ordinal()] == 1)
{
_attackTraits.remove(traitType);
@ -653,7 +653,7 @@ public class CreatureStat
try
{
_defenceTraitValues[traitType.ordinal()] -= value;
if (_defenceTraitValues[traitType.ordinal()] == 1)
if (_defenceTraitValues[traitType.ordinal()] == 0)
{
_defenceTraits.remove(traitType);
}

View File

@ -1331,7 +1331,7 @@ public final class Formulas
public static double calcWeaponTraitBonus(Creature attacker, Creature target)
{
return Math.max(0, 2.0 - target.getStat().getDefenceTrait(attacker.getAttackType().getTraitType()));
return Math.max(0, 1.0 - target.getStat().getDefenceTrait(attacker.getAttackType().getTraitType()));
}
public static double calcAttackTraitBonus(Creature attacker, Creature target)

View File

@ -45,7 +45,7 @@ public final class AttackTrait extends AbstractEffect
for (Entry<String, Object> param : params.getSet().entrySet())
{
_attackTraits.put(TraitType.valueOf(param.getKey()), (Float.parseFloat((String) param.getValue()) / 100) + 1);
_attackTraits.put(TraitType.valueOf(param.getKey()), Float.parseFloat((String) param.getValue()) / 100);
}
}

View File

@ -90,7 +90,7 @@ public class CreatureStat
for (int i = 0; i < TraitType.values().length; i++)
{
_attackTraitValues[i] = 1;
_defenceTraitValues[i] = 1;
_defenceTraitValues[i] = 0;
}
}
@ -581,7 +581,7 @@ public class CreatureStat
_lock.readLock().lock();
try
{
_attackTraitValues[traitType.ordinal()] *= value;
_attackTraitValues[traitType.ordinal()] += value;
_attackTraits.add(traitType);
}
finally
@ -595,7 +595,7 @@ public class CreatureStat
_lock.readLock().lock();
try
{
_attackTraitValues[traitType.ordinal()] /= value;
_attackTraitValues[traitType.ordinal()] -= value;
if (_attackTraitValues[traitType.ordinal()] == 1)
{
_attackTraits.remove(traitType);
@ -653,7 +653,7 @@ public class CreatureStat
try
{
_defenceTraitValues[traitType.ordinal()] -= value;
if (_defenceTraitValues[traitType.ordinal()] == 1)
if (_defenceTraitValues[traitType.ordinal()] == 0)
{
_defenceTraits.remove(traitType);
}

View File

@ -1331,7 +1331,7 @@ public final class Formulas
public static double calcWeaponTraitBonus(Creature attacker, Creature target)
{
return Math.max(0, 2.0 - target.getStat().getDefenceTrait(attacker.getAttackType().getTraitType()));
return Math.max(0, 1.0 - target.getStat().getDefenceTrait(attacker.getAttackType().getTraitType()));
}
public static double calcAttackTraitBonus(Creature attacker, Creature target)