Defender Updates included here. More to be announced.

master
sigonasr2 8 years ago
parent 5bcf1a2dea
commit ba7af310ac
  1. 1
      .gitignore
  2. BIN
      TwosideKeeper.jar
  3. 8
      projectBuilder.xml
  4. 25
      src/sig/plugin/TwosideKeeper/CustomDamage.java
  5. 9
      src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java
  6. 12
      src/sig/plugin/TwosideKeeper/TwosideKeeper.java

1
.gitignore vendored

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

Binary file not shown.

@ -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>

@ -772,7 +772,7 @@ public class CustomDamage {
restoreHealthToPartyMembersWithProtectorSet(p);
applySustenanceSetonHitEffects(p);
reduceStrengthAmountForStealthSet(p);
increaseBlockStacks(p);
handleBlockStacks(p);
if (!isFlagSet(flags,NOAOE)) {
if (damage<p.getHealth()) {increaseArtifactArmorXP(p,(int)damage);}
}
@ -1063,7 +1063,7 @@ public class CustomDamage {
return damage;
}
private static void increaseBlockStacks(Player p) {
private static double handleBlockStacks(Player p, double damage) {
if (PlayerMode.getPlayerMode(p)==PlayerMode.DEFENDER) {
DefenderStance ds = DefenderStance.getDefenderStance(p);
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
@ -1072,8 +1072,16 @@ public class CustomDamage {
pd.blockStacks = Math.min(pd.blockStacks+1, 10);
GenericFunctions.sendActionBarMessage(p, "", true);
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) {
@ -2027,6 +2035,16 @@ public class CustomDamage {
}
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()) {
Bukkit.getScheduler().scheduleSyncDelayedTask(TwosideKeeper.plugin, new Runnable() {
@Override
@ -2772,6 +2790,9 @@ public class CustomDamage {
if (ds==DefenderStance.BLOCK) {
defenderstancemult = 0.25;
} else
if (ds==DefenderStance.CHARGE) {
defenderstancemult = 0.1;
} else
if (ds==DefenderStance.TANK) {
defenderstancemult = 0.5;
}

@ -4134,6 +4134,7 @@ public class GenericFunctions {
basedmg=origdmg;
boolean isForcefulStrike = (reason!=null && reason.equalsIgnoreCase("forceful strike"));
boolean isSweepUp = (reason!=null && reason.equalsIgnoreCase("sweep up"));
boolean isShieldCharge = (reason!=null && reason.equalsIgnoreCase("shield charge"));
if (isSweepUp) {
aPlugin.API.sendSoundlessExplosion(m.getLocation(), 1.5f);
if (damager instanceof Player) {
@ -4141,6 +4142,12 @@ public class GenericFunctions {
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) {
GenericFunctions.addSuppressionTime(m, 20*2);
}
@ -4152,7 +4159,7 @@ public class GenericFunctions {
}
}
} else {
if (CustomDamage.ApplyDamage(basedmg, damager, m, weapon, reason)) {
if (CustomDamage.ApplyDamage(basedmg, damager, m, weapon, reason, CustomDamage.IGNORE_DAMAGE_TICK)) {
if (knockup) {
m.setVelocity(new Vector(0,knockupamt,0));
}

@ -4492,7 +4492,17 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
/*double dmg = CustomDamage.CalculateDamage(0,p,);
CustomDamage.ApplyDamage(, damager, target, weapon, reason, flags)*/
//GenericFunctions.DealBlitzenLightningStrikeToNearbyMobs(l, basedmg, range, damager, flags);
GenericFunctions.DealDamageToNearbyMobs(checkpos, 0, 1, true, 2, p, p.getEquipment().getItemInMainHand(), false, "Shield Charge");
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");
}
}
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);
}
}
}
}

Loading…
Cancel
Save