Defender Updates included here. More to be announced.

This commit is contained in:
sigonasr2 2017-09-18 09:46:27 -05:00
parent 5bcf1a2dea
commit ba7af310ac
6 changed files with 42 additions and 13 deletions

1
.gitignore vendored
View File

@ -1,4 +1,3 @@
.* .*
/bin /bin
/projectBuilder.xml /projectBuilder.xml
/TwosideKeeper.jar

BIN
TwosideKeeper.jar Normal file

Binary file not shown.

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xml>
<project name="TwosideKeeper.makejar" default="makejar" basedir=".">
<target name ="makejar" description="Create a jar for the TwosideKeeper project">
<jar jarfile="TwosideKeeper.jar" includes="**/*.class,**/*.yml" basedir="bin"/>
<jar jarfile="D:/Documents/Test Server/plugins/TwosideKeeper.jar" includes="**/*.class,**/*.yml" basedir="bin"/>
</target>
</project>

View File

@ -772,7 +772,7 @@ public class CustomDamage {
restoreHealthToPartyMembersWithProtectorSet(p); restoreHealthToPartyMembersWithProtectorSet(p);
applySustenanceSetonHitEffects(p); applySustenanceSetonHitEffects(p);
reduceStrengthAmountForStealthSet(p); reduceStrengthAmountForStealthSet(p);
increaseBlockStacks(p); handleBlockStacks(p);
if (!isFlagSet(flags,NOAOE)) { if (!isFlagSet(flags,NOAOE)) {
if (damage<p.getHealth()) {increaseArtifactArmorXP(p,(int)damage);} if (damage<p.getHealth()) {increaseArtifactArmorXP(p,(int)damage);}
} }
@ -1063,7 +1063,7 @@ public class CustomDamage {
return damage; return damage;
} }
private static void increaseBlockStacks(Player p) { private static double handleBlockStacks(Player p, double damage) {
if (PlayerMode.getPlayerMode(p)==PlayerMode.DEFENDER) { if (PlayerMode.getPlayerMode(p)==PlayerMode.DEFENDER) {
DefenderStance ds = DefenderStance.getDefenderStance(p); DefenderStance ds = DefenderStance.getDefenderStance(p);
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p); PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
@ -1072,9 +1072,17 @@ public class CustomDamage {
pd.blockStacks = Math.min(pd.blockStacks+1, 10); pd.blockStacks = Math.min(pd.blockStacks+1, 10);
GenericFunctions.sendActionBarMessage(p, "", true); GenericFunctions.sendActionBarMessage(p, "", true);
pd.customtitle.updateSideTitleStats(p); pd.customtitle.updateSideTitleStats(p);
} else
if (ds == DefenderStance.TANK) {
if (pd.blockStacks>0) {
pd.blockStacks--;
GenericFunctions.sendActionBarMessage(p, "", true);
pd.customtitle.updateSideTitleStats(p);
} }
} }
} }
return damage;
}
private static void updateAggroValues(LivingEntity damager, LivingEntity target, double damage, String reason) { private static void updateAggroValues(LivingEntity damager, LivingEntity target, double damage, String reason) {
if (getDamagerEntity(damager)!=null && EntityUtils.isValidEntity(getDamagerEntity(damager))) { if (getDamagerEntity(damager)!=null && EntityUtils.isValidEntity(getDamagerEntity(damager))) {
@ -2027,6 +2035,16 @@ public class CustomDamage {
} }
return; return;
} }
if (PlayerMode.isDefender(p)) {
if (DefenderStance.getDefenderStance(p)==DefenderStance.TANK) {
Bukkit.getScheduler().scheduleSyncDelayedTask(TwosideKeeper.plugin, new Runnable() {
@Override
public void run() {
p.setVelocity(p.getVelocity().multiply(0));
}
},1);
}
}
/*if (PlayerMode.isDefender(p) && p.isBlocking()) { /*if (PlayerMode.isDefender(p) && p.isBlocking()) {
Bukkit.getScheduler().scheduleSyncDelayedTask(TwosideKeeper.plugin, new Runnable() { Bukkit.getScheduler().scheduleSyncDelayedTask(TwosideKeeper.plugin, new Runnable() {
@Override @Override
@ -2772,6 +2790,9 @@ public class CustomDamage {
if (ds==DefenderStance.BLOCK) { if (ds==DefenderStance.BLOCK) {
defenderstancemult = 0.25; defenderstancemult = 0.25;
} else } else
if (ds==DefenderStance.CHARGE) {
defenderstancemult = 0.1;
} else
if (ds==DefenderStance.TANK) { if (ds==DefenderStance.TANK) {
defenderstancemult = 0.5; defenderstancemult = 0.5;
} }

View File

@ -4134,6 +4134,7 @@ public class GenericFunctions {
basedmg=origdmg; basedmg=origdmg;
boolean isForcefulStrike = (reason!=null && reason.equalsIgnoreCase("forceful strike")); boolean isForcefulStrike = (reason!=null && reason.equalsIgnoreCase("forceful strike"));
boolean isSweepUp = (reason!=null && reason.equalsIgnoreCase("sweep up")); boolean isSweepUp = (reason!=null && reason.equalsIgnoreCase("sweep up"));
boolean isShieldCharge = (reason!=null && reason.equalsIgnoreCase("shield charge"));
if (isSweepUp) { if (isSweepUp) {
aPlugin.API.sendSoundlessExplosion(m.getLocation(), 1.5f); aPlugin.API.sendSoundlessExplosion(m.getLocation(), 1.5f);
if (damager instanceof Player) { if (damager instanceof Player) {
@ -4141,6 +4142,12 @@ public class GenericFunctions {
p.playEffect(m.getLocation(), Effect.LAVA_POP, null); p.playEffect(m.getLocation(), Effect.LAVA_POP, null);
} }
} }
if (isShieldCharge) {
GenericFunctions.addSuppressionTime(m, (int)(20*0.5));
Player p = (Player)damager;
double dmg = CustomDamage.getBaseWeaponDamage(p.getEquipment().getItemInMainHand(), p, m);;
CustomDamage.ApplyDamage(dmg*0.25, p, m, p.getEquipment().getItemInMainHand(), "Shield Charge", CustomDamage.IGNORE_DAMAGE_TICK|CustomDamage.TRUEDMG);
}
if (isForcefulStrike) { if (isForcefulStrike) {
GenericFunctions.addSuppressionTime(m, 20*2); GenericFunctions.addSuppressionTime(m, 20*2);
} }
@ -4152,7 +4159,7 @@ public class GenericFunctions {
} }
} }
} else { } else {
if (CustomDamage.ApplyDamage(basedmg, damager, m, weapon, reason)) { if (CustomDamage.ApplyDamage(basedmg, damager, m, weapon, reason, CustomDamage.IGNORE_DAMAGE_TICK)) {
if (knockup) { if (knockup) {
m.setVelocity(new Vector(0,knockupamt,0)); m.setVelocity(new Vector(0,knockupamt,0));
} }

View File

@ -4492,9 +4492,19 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
/*double dmg = CustomDamage.CalculateDamage(0,p,); /*double dmg = CustomDamage.CalculateDamage(0,p,);
CustomDamage.ApplyDamage(, damager, target, weapon, reason, flags)*/ CustomDamage.ApplyDamage(, damager, target, weapon, reason, flags)*/
//GenericFunctions.DealBlitzenLightningStrikeToNearbyMobs(l, basedmg, range, damager, flags); //GenericFunctions.DealBlitzenLightningStrikeToNearbyMobs(l, basedmg, range, damager, flags);
Block bb = checkpos.getBlock().getRelative(0, -1, 0);
if (bb!=null && bb.getType()!=Material.AIR) {
GenericFunctions.DealDamageToNearbyMobs(checkpos, 0, 1, true, 2, p, p.getEquipment().getItemInMainHand(), false, "Shield Charge"); GenericFunctions.DealDamageToNearbyMobs(checkpos, 0, 1, true, 2, p, p.getEquipment().getItemInMainHand(), false, "Shield Charge");
} }
} }
List<LivingEntity> ents = GenericFunctions.getNearbyMobs(p.getLocation(), 16);
for (LivingEntity ent : ents) {
if (!(ent instanceof Player)) {
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(ent);
les.increaseAggro(p, 50);
}
}
}
} }
} }