Bow Artifacts gain EXP again. Death messages no longer appear twice.
This commit is contained in:
parent
c9ddbb7bc7
commit
a2e6449ab7
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
name: TwosideKeeper
|
||||
main: sig.plugin.TwosideKeeper.TwosideKeeper
|
||||
version: 3.7.3-alpha3
|
||||
version: 3.7.3-alpha4
|
||||
commands:
|
||||
money:
|
||||
description: Tells the player the amount of money they are holding.
|
||||
|
@ -85,6 +85,8 @@ public class NewCombat {
|
||||
|
||||
double finaldmg = 0.0;
|
||||
if (shooter!=null) {
|
||||
finaldmg += calculateTotalDamage(target, damager);
|
||||
finaldmg = calculateAbsorptionHearts(target, finaldmg);
|
||||
if (shooter instanceof Player) {
|
||||
Player p = (Player)shooter;
|
||||
playerPerformMiscActions(p,target);
|
||||
@ -94,8 +96,6 @@ public class NewCombat {
|
||||
provokeMonster(m,p);
|
||||
}
|
||||
}
|
||||
finaldmg += calculateTotalDamage(target, damager);
|
||||
finaldmg = calculateAbsorptionHearts(target, finaldmg);
|
||||
}
|
||||
|
||||
if (shooter!=null) {
|
||||
@ -457,8 +457,8 @@ public class NewCombat {
|
||||
static boolean isPreemptiveStrike(LivingEntity m,Player p) {
|
||||
if (GenericFunctions.isStriker(p) &&
|
||||
m!=null &&
|
||||
p.getHealth()==p.getMaxHealth() &&
|
||||
m.getHealth()==m.getMaxHealth()) {
|
||||
(m instanceof Monster) &&
|
||||
((Monster)m).getTarget()==null) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@ -536,7 +536,7 @@ public class NewCombat {
|
||||
}
|
||||
}
|
||||
|
||||
applyOnHitEffects(weapon,basedmg * basemult,damager,target);
|
||||
applyOnHitEffects(weapon,basedmg * basemult,damager,target,headshot);
|
||||
} else {
|
||||
if (damager instanceof Arrow) {
|
||||
return 4.5; //This is a basic arrow with no shooter. Deal some damage.
|
||||
@ -881,13 +881,18 @@ public class NewCombat {
|
||||
return mult;
|
||||
}
|
||||
|
||||
static void applyOnHitEffects(ItemStack weapon, double dmg, Entity damager, LivingEntity target) {
|
||||
if (damager instanceof Player && target!=null) {
|
||||
Player p = (Player)damager;
|
||||
private static void applyOnHitEffects(ItemStack weapon, double dmg, Entity damager, LivingEntity target) {
|
||||
applyOnHitEffects(weapon,dmg,damager,target,false);
|
||||
}
|
||||
|
||||
static void applyOnHitEffects(ItemStack weapon, double dmg, Entity damager, LivingEntity target, boolean headshot) {
|
||||
LivingEntity shooter = getDamagerEntity(damager);
|
||||
if ((shooter instanceof Player) && target!=null) {
|
||||
Player p = (Player)shooter;
|
||||
if (GenericFunctions.isArtifactEquip(p.getEquipment().getItemInMainHand()) &&
|
||||
GenericFunctions.isArtifactWeapon(p.getEquipment().getItemInMainHand())) {
|
||||
double ratio = 1.0-CalculateDamageReduction(1,target,p);
|
||||
AwakenedArtifact.addPotentialEXP(p.getEquipment().getItemInMainHand(), (int)(ratio*20)+5, p);
|
||||
AwakenedArtifact.addPotentialEXP(p.getEquipment().getItemInMainHand(), (int)((ratio*20)+5)*((headshot)?2:1), p);
|
||||
increaseArtifactArmorXP(p,(int)(ratio*10)+1);
|
||||
List<LivingEntity> hitlist = getAOEList(weapon,target);
|
||||
|
||||
|
@ -167,7 +167,7 @@ public class RecyclingCenter {
|
||||
|
||||
public void AddItemToRecyclingCenter(Item i) {
|
||||
//There is a % chance of it going to a recycling center.
|
||||
if (Math.random()*100<=TwosideKeeper.RECYCLECHANCE &&
|
||||
if ((Math.random()*100<=TwosideKeeper.RECYCLECHANCE || GenericFunctions.isArtifactEquip(i.getItemStack())) &&
|
||||
IsItemAllowed(i.getItemStack())) {
|
||||
//Recycle allowed. Now figure out which node to go to.
|
||||
if (getNumberOfNodes()>0) {
|
||||
|
@ -3924,15 +3924,20 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
//ev.setCancelled(true);
|
||||
if (ev.getEntity() instanceof LivingEntity) {
|
||||
((LivingEntity)ev.getEntity()).setNoDamageTicks(10);
|
||||
double oldhp=((LivingEntity)ev.getEntity()).getHealth();
|
||||
GenericFunctions.subtractHealth((LivingEntity)ev.getEntity(), NewCombat.getDamagerEntity(ev.getDamager()), dmg);
|
||||
final double oldhp=((LivingEntity)ev.getEntity()).getHealth();
|
||||
if (NewCombat.getDamagerEntity(ev.getDamager()) instanceof Player) {
|
||||
if (ev.getDamager() instanceof Projectile) {
|
||||
ev.getDamager().remove();
|
||||
}
|
||||
GenericFunctions.subtractHealth((LivingEntity)ev.getEntity(), NewCombat.getDamagerEntity(ev.getDamager()), dmg);
|
||||
ev.setCancelled(true);
|
||||
} else {
|
||||
ev.setDamage(dmg);
|
||||
}
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
|
||||
public void run() {
|
||||
log(ChatColor.BLUE+" "+oldhp+"->"+((LivingEntity)ev.getEntity()).getHealth()+" HP",3);
|
||||
}},1);
|
||||
}
|
||||
} //Negative damage doesn't make sense. We'd apply it normally.
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user