Make hearts not as ridiculous. Mob Healthbars display in all damage
scenarios now.
This commit is contained in:
parent
79c3577469
commit
f56eec16dc
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
name: TwosideKeeper
|
name: TwosideKeeper
|
||||||
main: sig.plugin.TwosideKeeper.TwosideKeeper
|
main: sig.plugin.TwosideKeeper.TwosideKeeper
|
||||||
version: 3.7.3cr4
|
version: 3.7.3cr5
|
||||||
commands:
|
commands:
|
||||||
money:
|
money:
|
||||||
description: Tells the player the amount of money they are holding.
|
description: Tells the player the amount of money they are holding.
|
||||||
|
@ -2609,16 +2609,15 @@ public class GenericFunctions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void DealDamageToMob(double dmg, LivingEntity target, Entity damager) {
|
public static void DealDamageToMob(double dmg, LivingEntity target, Entity damager) {
|
||||||
DealDamageToMob(dmg,target,NewCombat.getDamagerEntity(damager),null,"");
|
DealDamageToMob(dmg,target,NewCombat.getDamagerEntity(damager),null,"");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void DealDamageToMob(double dmg, LivingEntity target, LivingEntity damager, ItemStack artifact) {
|
public static void DealDamageToMob(double dmg, LivingEntity target, Entity damager, ItemStack artifact) {
|
||||||
DealDamageToMob(dmg,target,damager,artifact,"");
|
DealDamageToMob(dmg,target,damager,artifact,"");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void DealDamageToMob(double dmg, LivingEntity target, LivingEntity damager, ItemStack artifact, String reason) {
|
public static void DealDamageToMob(double dmg, LivingEntity target, Entity damager, ItemStack artifact, String reason) {
|
||||||
if (damager!=null && (target instanceof Monster)) {
|
if (damager!=null && (target instanceof Monster)) {
|
||||||
Monster m = (Monster)target;
|
Monster m = (Monster)target;
|
||||||
if (damager instanceof Player) {
|
if (damager instanceof Player) {
|
||||||
@ -2640,23 +2639,26 @@ public class GenericFunctions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
double oldhp=((LivingEntity)target).getHealth();
|
double oldhp=((LivingEntity)target).getHealth();
|
||||||
GenericFunctions.subtractHealth(target, damager, dmg, artifact);
|
LivingEntity le = NewCombat.getDamagerEntity(damager);
|
||||||
|
if (le!=null) {
|
||||||
|
GenericFunctions.subtractHealth(target, le, dmg, artifact);
|
||||||
if (artifact!=null &&
|
if (artifact!=null &&
|
||||||
GenericFunctions.isArtifactEquip(artifact) &&
|
GenericFunctions.isArtifactEquip(artifact) &&
|
||||||
(damager instanceof Player)) {
|
(le instanceof Player)) {
|
||||||
Player p = (Player)damager;
|
Player p = (Player)le;
|
||||||
double ratio = 1.0-NewCombat.CalculateDamageReduction(1,target,p);
|
double ratio = 1.0-NewCombat.CalculateDamageReduction(1,target,p);
|
||||||
AwakenedArtifact.addPotentialEXP(damager.getEquipment().getItemInMainHand(), (int)((ratio*20)+5), p);
|
AwakenedArtifact.addPotentialEXP(le.getEquipment().getItemInMainHand(), (int)((ratio*20)+5), p);
|
||||||
NewCombat.increaseArtifactArmorXP(p,(int)(ratio*10)+1);
|
NewCombat.increaseArtifactArmorXP(p,(int)(ratio*10)+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (damager instanceof Player) {
|
if (le instanceof Player) {
|
||||||
Player p = (Player)damager;
|
Player p = (Player)le;
|
||||||
if (GenericFunctions.isEquip(p.getEquipment().getItemInMainHand())) {
|
if (GenericFunctions.isEquip(p.getEquipment().getItemInMainHand())) {
|
||||||
aPlugin.API.damageItem(p, p.getEquipment().getItemInMainHand(), 1);
|
aPlugin.API.damageItem(p, p.getEquipment().getItemInMainHand(), 1);
|
||||||
}
|
}
|
||||||
knockOffGreed(p);
|
knockOffGreed(p);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
TwosideKeeper.log(ChatColor.BLUE+" "+oldhp+"->"+((LivingEntity)target).getHealth()+" HP",3);
|
TwosideKeeper.log(ChatColor.BLUE+" "+oldhp+"->"+((LivingEntity)target).getHealth()+" HP",3);
|
||||||
}
|
}
|
||||||
@ -2807,7 +2809,7 @@ public class GenericFunctions {
|
|||||||
|
|
||||||
TwosideKeeper.log("Damage goes from "+dmg+"->"+(dmg+TwosideKeeper.CUSTOM_DAMAGE_IDENTIFIER),5);
|
TwosideKeeper.log("Damage goes from "+dmg+"->"+(dmg+TwosideKeeper.CUSTOM_DAMAGE_IDENTIFIER),5);
|
||||||
entity.damage(dmg+TwosideKeeper.CUSTOM_DAMAGE_IDENTIFIER,damager);
|
entity.damage(dmg+TwosideKeeper.CUSTOM_DAMAGE_IDENTIFIER,damager);
|
||||||
aPlugin.API.showDamage(entity, (int)(dmg/10));
|
aPlugin.API.showDamage(entity, GetHeartAmount(dmg));
|
||||||
|
|
||||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
if (pd.damagelogging) {
|
if (pd.damagelogging) {
|
||||||
@ -2815,6 +2817,9 @@ public class GenericFunctions {
|
|||||||
DecimalFormat df = new DecimalFormat("0.0");
|
DecimalFormat df = new DecimalFormat("0.0");
|
||||||
TwosideKeeper.updateTitle(p,ChatColor.AQUA+df.format(dmg));
|
TwosideKeeper.updateTitle(p,ChatColor.AQUA+df.format(dmg));
|
||||||
TwosideKeeper.log("In here",2);
|
TwosideKeeper.log("In here",2);
|
||||||
|
} else {
|
||||||
|
pd.target=entity;
|
||||||
|
TwosideKeeper.updateTitle(p);
|
||||||
}
|
}
|
||||||
//Bukkit.getPluginManager().callEvent(new EntityDamageByEntityEvent(damager,entity,DamageCause.CUSTOM,dmg+TwosideKeeper.CUSTOM_DAMAGE_IDENTIFIER));
|
//Bukkit.getPluginManager().callEvent(new EntityDamageByEntityEvent(damager,entity,DamageCause.CUSTOM,dmg+TwosideKeeper.CUSTOM_DAMAGE_IDENTIFIER));
|
||||||
} else {
|
} else {
|
||||||
@ -2842,7 +2847,7 @@ public class GenericFunctions {
|
|||||||
if (entity.getHealth()>dmg && entity instanceof Player) {
|
if (entity.getHealth()>dmg && entity instanceof Player) {
|
||||||
if (!AttemptRevive((Player)entity,dmg)) {
|
if (!AttemptRevive((Player)entity,dmg)) {
|
||||||
entity.setHealth(((Player)entity).getHealth()-dmg);
|
entity.setHealth(((Player)entity).getHealth()-dmg);
|
||||||
aPlugin.API.showDamage(entity, (int)(dmg/10));
|
aPlugin.API.showDamage(entity, GetHeartAmount(dmg));
|
||||||
aPlugin.API.sendEntityHurtAnimation((Player)entity);
|
aPlugin.API.sendEntityHurtAnimation((Player)entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2879,6 +2884,16 @@ public class GenericFunctions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static int GetHeartAmount(double dmg) {
|
||||||
|
int heartcount = 1;
|
||||||
|
double dmgamountcopy = dmg;
|
||||||
|
while (dmgamountcopy>10) {
|
||||||
|
dmgamountcopy/=2;
|
||||||
|
heartcount++;
|
||||||
|
}
|
||||||
|
return heartcount;
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean isViewingInventory(Player p) {
|
public static boolean isViewingInventory(Player p) {
|
||||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
return pd.isViewingInventory;
|
return pd.isViewingInventory;
|
||||||
|
@ -150,7 +150,7 @@ public class NewCombat {
|
|||||||
double mult1 = calculatePlayerCriticalStrike(weapon,damager);
|
double mult1 = calculatePlayerCriticalStrike(weapon,damager);
|
||||||
addMultiplierToPlayerLogger(damager,"Critical Strike Mult",mult1);
|
addMultiplierToPlayerLogger(damager,"Critical Strike Mult",mult1);
|
||||||
if (mult1>1.0) {
|
if (mult1>1.0) {
|
||||||
aPlugin.API.critEntity(target, 10);
|
aPlugin.API.critEntity(target, 15);
|
||||||
}
|
}
|
||||||
bonusmult*=mult1;
|
bonusmult*=mult1;
|
||||||
}
|
}
|
||||||
|
@ -4037,9 +4037,6 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
log("Stored Damage is "+storeddmg+". CUSTOM_DAMAGE_IDENTIFIER:"+CUSTOM_DAMAGE_IDENTIFIER+"\n...Subtracted damage is "+(storeddmg-CUSTOM_DAMAGE_IDENTIFIER),4);
|
log("Stored Damage is "+storeddmg+". CUSTOM_DAMAGE_IDENTIFIER:"+CUSTOM_DAMAGE_IDENTIFIER+"\n...Subtracted damage is "+(storeddmg-CUSTOM_DAMAGE_IDENTIFIER),4);
|
||||||
ev.setDamage(DamageModifier.BASE,storeddmg-CUSTOM_DAMAGE_IDENTIFIER);
|
ev.setDamage(DamageModifier.BASE,storeddmg-CUSTOM_DAMAGE_IDENTIFIER);
|
||||||
ev.setDamage(storeddmg-CUSTOM_DAMAGE_IDENTIFIER);
|
ev.setDamage(storeddmg-CUSTOM_DAMAGE_IDENTIFIER);
|
||||||
if (ev.getEntity() instanceof LivingEntity) {
|
|
||||||
aPlugin.API.showDamage((LivingEntity)ev.getEntity(), (int)((storeddmg-CUSTOM_DAMAGE_IDENTIFIER)/10));
|
|
||||||
}
|
|
||||||
log("New Damage: "+ev.getFinalDamage(),4);
|
log("New Damage: "+ev.getFinalDamage(),4);
|
||||||
} else {
|
} else {
|
||||||
double dmg = 0.0;
|
double dmg = 0.0;
|
||||||
@ -4133,7 +4130,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
GenericFunctions.knockOffGreed(p);
|
GenericFunctions.knockOffGreed(p);
|
||||||
}
|
}
|
||||||
aPlugin.API.showDamage((LivingEntity)ev.getEntity(), (int)(dmg/10));
|
//aPlugin.API.showDamage((LivingEntity)ev.getEntity(), (int)(dmg/10));
|
||||||
}
|
}
|
||||||
} //Negative damage doesn't make sense. We'd apply it normally.
|
} //Negative damage doesn't make sense. We'd apply it normally.
|
||||||
}
|
}
|
||||||
|
@ -159,6 +159,9 @@ public final class TwosideKeeperAPI {
|
|||||||
public static void DealDamageToEntity(double dmg, LivingEntity target, Entity damager) {
|
public static void DealDamageToEntity(double dmg, LivingEntity target, Entity damager) {
|
||||||
GenericFunctions.DealDamageToMob(dmg, target, damager);
|
GenericFunctions.DealDamageToMob(dmg, target, damager);
|
||||||
}
|
}
|
||||||
|
public static void DealDamageToEntity(double dmg, LivingEntity target, Entity damager, String reason) {
|
||||||
|
GenericFunctions.DealDamageToMob(dmg, target, damager, null, reason);
|
||||||
|
}
|
||||||
|
|
||||||
//Message COMMANDS.
|
//Message COMMANDS.
|
||||||
public static void playMessageNotification(Player sender) {
|
public static void playMessageNotification(Player sender) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user