Fix issues with Strikers always having 20% dodge chance.

This commit is contained in:
sigonasr2 2016-08-14 16:09:42 -05:00
parent a287f66df7
commit 91a7aadcd0
5 changed files with 15 additions and 4 deletions

Binary file not shown.

View File

@ -421,6 +421,9 @@ public class EliteMonster {
m.getEquipment().setHelmet(helm);
m.getEquipment().setHelmet(Loot.GenerateMegaPiece(helm.getType(), true, true, 1));
m.getEquipment().setHelmetDropChance(1.0f);
if (!leaping) {
m.removePotionEffect(PotionEffectType.LEVITATION);
}
if (!enraged) {
if (m.hasPotionEffect(PotionEffectType.INCREASE_DAMAGE)) {
m.removePotionEffect(PotionEffectType.INCREASE_DAMAGE);

View File

@ -2931,7 +2931,9 @@ public class GenericFunctions {
double dodgechance = NewCombat.CalculateDodgeChance((Player)entity);
Player p = (Player)entity;
if (!p.hasPotionEffect(PotionEffectType.GLOWING)) {
TwosideKeeper.log("Dodge chance is "+dodgechance,4);
if (Math.random()<=dodgechance) {
TwosideKeeper.log("Dodged.",4);
p.playSound(p.getLocation(), Sound.ENTITY_PLAYER_ATTACK_SWEEP, 3.0f, 1.0f);
for (int i=0;i<p.getEquipment().getArmorContents().length;i++) {
ItemStack equip = p.getEquipment().getArmorContents()[i];
@ -3307,11 +3309,13 @@ public class GenericFunctions {
Player p = (Player)nearbyentities.get(i);
dodgechance = NewCombat.CalculateDodgeChance(p);
}
TwosideKeeper.log("Dodge chance is "+dodgechance,4);
if (Math.random()>dodgechance) {
//DealDamageToMob(dmg,(LivingEntity)nearbyentities.get(i),null,null,"Explosion");
TwosideKeeper.log("dmg dealt is supposed to be "+dmg, 5);
subtractHealth((LivingEntity)nearbyentities.get(i),null,NewCombat.CalculateDamageReduction(dmg, (LivingEntity)nearbyentities.get(i), null));
} else {
TwosideKeeper.log("Dodged.",4);
if (nearbyentities.get(i) instanceof Player) {
Player p = (Player)nearbyentities.get(i);
p.playSound(p.getLocation(), Sound.ENTITY_PLAYER_ATTACK_SWEEP, 3.0f, 1.0f);
@ -3425,6 +3429,7 @@ public class GenericFunctions {
if (players.get(i) instanceof Player) {
Player p = (Player)players.get(i);
dodgechance = NewCombat.CalculateDodgeChance(p);
TwosideKeeper.log("Dodge chance is "+dodgechance,4);
if (Math.random()>dodgechance) {
TwosideKeeper.log("Dealt "+basedmg+" raw damage.", 5);
//DealDamageToMob(NewCombat.CalculateDamageReduction(basedmg,p,null),(LivingEntity)nearbyentities.get(i),null,null,"Slam");
@ -3433,6 +3438,7 @@ public class GenericFunctions {
p.setVelocity(new Vector(0,knockupamt,0));
}
} else {
TwosideKeeper.log("Dodged.",4);
p.playSound(p.getLocation(), Sound.ENTITY_PLAYER_ATTACK_SWEEP, 3.0f, 1.0f);
for (int j=0;j<p.getEquipment().getArmorContents().length;j++) {
ItemStack equip = p.getEquipment().getArmorContents()[j];

View File

@ -1653,7 +1653,7 @@ public class NewCombat {
}
if (GenericFunctions.isStriker(p) &&
pd.velocity>0) {
93.182445*pd.velocity>4.317) {
dodgechance+=0.2;
}
if (GenericFunctions.isRanger(p)) {

View File

@ -4103,9 +4103,10 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
}
if (Math.random()<=dodgechance) {
TwosideKeeper.log("Dodged.", 4);
//Cancel this event, we dodged the attack.
p.playSound(p.getLocation(), Sound.ENTITY_PLAYER_ATTACK_SWEEP, 3.0f, 1.0f);
log("Triggered Dodge.",3);
log("Triggered Dodge.",4);
for (int i=0;i<p.getEquipment().getArmorContents().length;i++) {
ItemStack equip = p.getEquipment().getArmorContents()[i];
if (ArtifactAbility.containsEnchantment(ArtifactAbility.GRACEFULDODGE, equip)) {
@ -4124,7 +4125,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
p.setNoDamageTicks(10);
ev.setCancelled(true);
}
log("Dodge chance is "+dodgechance,5);
log("Dodge chance is "+dodgechance,4);
}
@ -4417,7 +4418,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
if (Math.random()<=dodgechance) {
//Cancel this event, we dodged the attack.
p.playSound(p.getLocation(), Sound.ENTITY_PLAYER_ATTACK_SWEEP, 3.0f, 1.0f);
log("Triggered Dodge.",3);
log("Triggered Dodge.",4);
for (int i=0;i<p.getEquipment().getArmorContents().length;i++) {
ItemStack equip = p.getEquipment().getArmorContents()[i];
if (ArtifactAbility.containsEnchantment(ArtifactAbility.GRACEFULDODGE, equip)) {
@ -4435,6 +4436,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
}
p.setNoDamageTicks(10);
ev.setCancelled(true);
log("Dodge chance is "+dodgechance,4);
}
}
}