Implement Defender Stances. Begin work on Defender Rework.
This commit is contained in:
parent
9874633e69
commit
aa1b74716a
Binary file not shown.
@ -94,6 +94,7 @@ import sig.plugin.TwosideKeeper.Monster.HellfireGhast;
|
|||||||
import sig.plugin.TwosideKeeper.Monster.HellfireSpider;
|
import sig.plugin.TwosideKeeper.Monster.HellfireSpider;
|
||||||
import sig.plugin.TwosideKeeper.Monster.Knight;
|
import sig.plugin.TwosideKeeper.Monster.Knight;
|
||||||
import sig.plugin.TwosideKeeper.Monster.SniperSkeleton;
|
import sig.plugin.TwosideKeeper.Monster.SniperSkeleton;
|
||||||
|
import sig.plugin.TwosideKeeper.PlayerStructures.DefenderStance;
|
||||||
|
|
||||||
public class CustomDamage {
|
public class CustomDamage {
|
||||||
|
|
||||||
@ -723,7 +724,7 @@ public class CustomDamage {
|
|||||||
Player p = (Player)target;
|
Player p = (Player)target;
|
||||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
if (PlayerMode.isDefender(p)) {
|
if (PlayerMode.isDefender(p)) {
|
||||||
GenericFunctions.addStackingPotionEffect(p, PotionEffectType.DAMAGE_RESISTANCE, 20*5, 4);
|
//GenericFunctions.addStackingPotionEffect(p, PotionEffectType.DAMAGE_RESISTANCE, 20*5, 4);
|
||||||
if (p.isBlocking() && ItemSet.hasFullSet(p, ItemSet.SONGSTEEL)) {
|
if (p.isBlocking() && ItemSet.hasFullSet(p, ItemSet.SONGSTEEL)) {
|
||||||
ApplyVendettaStackTimer(pd);
|
ApplyVendettaStackTimer(pd);
|
||||||
pd.vendetta_amt+=((1-CalculateDamageReduction(1,target,damager))*pd.lastrawdamage)*0.40;
|
pd.vendetta_amt+=((1-CalculateDamageReduction(1,target,damager))*pd.lastrawdamage)*0.40;
|
||||||
@ -771,6 +772,7 @@ public class CustomDamage {
|
|||||||
restoreHealthToPartyMembersWithProtectorSet(p);
|
restoreHealthToPartyMembersWithProtectorSet(p);
|
||||||
applySustenanceSetonHitEffects(p);
|
applySustenanceSetonHitEffects(p);
|
||||||
reduceStrengthAmountForStealthSet(p);
|
reduceStrengthAmountForStealthSet(p);
|
||||||
|
increaseBlockStacks(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);}
|
||||||
}
|
}
|
||||||
@ -1061,6 +1063,19 @@ public class CustomDamage {
|
|||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void increaseBlockStacks(Player p) {
|
||||||
|
if (PlayerMode.getPlayerMode(p)==PlayerMode.DEFENDER) {
|
||||||
|
DefenderStance ds = DefenderStance.getDefenderStance(p);
|
||||||
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
|
if (ds == DefenderStance.BLOCK) {
|
||||||
|
SoundUtils.playLocalSound(p, Sound.ENTITY_PLAYER_ATTACK_KNOCKBACK, 1, 1);
|
||||||
|
pd.blockStacks = Math.min(pd.blockStacks+1, 10);
|
||||||
|
GenericFunctions.sendActionBarMessage(p, "", true);
|
||||||
|
pd.customtitle.updateSideTitleStats(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
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))) {
|
||||||
if (target!=null && EntityUtils.isValidEntity(target) && !(target instanceof Player)) {
|
if (target!=null && EntityUtils.isValidEntity(target) && !(target instanceof Player)) {
|
||||||
@ -1462,7 +1477,7 @@ public class CustomDamage {
|
|||||||
p.getWorld().strikeLightningEffect(target.getLocation());
|
p.getWorld().strikeLightningEffect(target.getLocation());
|
||||||
p.getWorld().strikeLightningEffect(target.getLocation());
|
p.getWorld().strikeLightningEffect(target.getLocation());
|
||||||
pd.lastlightningstrike=TwosideKeeper.getServerTickTime();
|
pd.lastlightningstrike=TwosideKeeper.getServerTickTime();
|
||||||
GenericFunctions.DealDamageToNearbyMobs(target.getLocation(), 12, 1, p, TRUEDMG|IGNORE_DAMAGE_TICK);
|
GenericFunctions.DealBlitzenLightningStrikeToNearbyMobs(target.getLocation(), 12, 1, p, TRUEDMG|IGNORE_DAMAGE_TICK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2012,14 +2027,14 @@ public class CustomDamage {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
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
|
||||||
public void run() {
|
public void run() {
|
||||||
p.setVelocity(p.getVelocity().multiply(0.25));
|
p.setVelocity(p.getVelocity().multiply(0.25));
|
||||||
}
|
}
|
||||||
},1);
|
},1);
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setAggroGlowTickTime(Monster m, int duration) {
|
static void setAggroGlowTickTime(Monster m, int duration) {
|
||||||
@ -2085,8 +2100,13 @@ public class CustomDamage {
|
|||||||
if (PlayerMode.isDefender(p)) {
|
if (PlayerMode.isDefender(p)) {
|
||||||
//TwosideKeeper.log("In here.", 0);
|
//TwosideKeeper.log("In here.", 0);
|
||||||
RefreshVendettaStackTimer(p);
|
RefreshVendettaStackTimer(p);
|
||||||
setMonsterTarget(m,p);
|
//setMonsterTarget(m,p);
|
||||||
setAggroGlowTickTime(m,100);
|
//setAggroGlowTickTime(m,100);
|
||||||
|
DefenderStance ds = DefenderStance.getDefenderStance(p);
|
||||||
|
if (ds == DefenderStance.AGGRESSION) {
|
||||||
|
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(m);
|
||||||
|
les.increaseAggro(p, 100);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2493,7 +2513,20 @@ public class CustomDamage {
|
|||||||
if (damager instanceof Player) {
|
if (damager instanceof Player) {
|
||||||
Player p = (Player)damager;
|
Player p = (Player)damager;
|
||||||
attackrate += ItemSet.GetTotalBaseAmount(p, ItemSet.BLITZEN)/100d;
|
attackrate += ItemSet.GetTotalBaseAmount(p, ItemSet.BLITZEN)/100d;
|
||||||
|
if (PlayerMode.getPlayerMode(p)==PlayerMode.DEFENDER) {
|
||||||
|
DefenderStance ds = DefenderStance.getDefenderStance(p);
|
||||||
|
if (ds == DefenderStance.AGGRESSION) {
|
||||||
|
attackrate+=0.25;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (Player pp : PartyManager.getPartyMembers(p)) {
|
||||||
|
if (PlayerMode.getPlayerMode(pp) == PlayerMode.DEFENDER &&
|
||||||
|
DefenderStance.getDefenderStance(pp)==DefenderStance.AGGRESSION) {
|
||||||
|
attackrate+=0.25;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
// TwosideKeeper.log("Attack rate: "+attackrate,0);
|
||||||
return attackrate;
|
return attackrate;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2654,9 +2687,9 @@ public class CustomDamage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dodgechance=addMultiplicativeValue(dodgechance,ItemSet.TotalBaseAmountBasedOnSetBonusCount(p,ItemSet.PANROS,3,3)/100d);
|
dodgechance=addMultiplicativeValue(dodgechance,ItemSet.TotalBaseAmountBasedOnSetBonusCount(p,ItemSet.PANROS,3,3)/100d);
|
||||||
if (p.isBlocking() || pd.lastblock+20*5<=TwosideKeeper.getServerTickTime()) {
|
/*if (p.isBlocking() || pd.lastblock+20*5<=TwosideKeeper.getServerTickTime()) {
|
||||||
dodgechance=addMultiplicativeValue(dodgechance,ItemSet.GetMultiplicativeTotalBaseAmount(p, ItemSet.SONGSTEEL));
|
dodgechance=addMultiplicativeValue(dodgechance,ItemSet.GetMultiplicativeTotalBaseAmount(p, ItemSet.SONGSTEEL)/3);
|
||||||
}
|
}*/
|
||||||
dodgechance=addMultiplicativeValue(dodgechance,ItemSet.TotalBaseAmountBasedOnSetBonusCount(p,ItemSet.JAMDAK,2,2)/100d);
|
dodgechance=addMultiplicativeValue(dodgechance,ItemSet.TotalBaseAmountBasedOnSetBonusCount(p,ItemSet.JAMDAK,2,2)/100d);
|
||||||
dodgechance=addMultiplicativeValue(dodgechance,ItemSet.TotalBaseAmountBasedOnSetBonusCount(p,ItemSet.JAMDAK,3,3)/100d);
|
dodgechance=addMultiplicativeValue(dodgechance,ItemSet.TotalBaseAmountBasedOnSetBonusCount(p,ItemSet.JAMDAK,3,3)/100d);
|
||||||
|
|
||||||
@ -2727,6 +2760,23 @@ public class CustomDamage {
|
|||||||
double tankydiv = 0;
|
double tankydiv = 0;
|
||||||
double artifactmult = 0;
|
double artifactmult = 0;
|
||||||
double dodgechancemult = 0;
|
double dodgechancemult = 0;
|
||||||
|
double defenderstancemult = 0;
|
||||||
|
|
||||||
|
if (getDamagerEntity(damager) instanceof Player) {
|
||||||
|
Player p = (Player)getDamagerEntity(damager);
|
||||||
|
if (PlayerMode.getPlayerMode(p) == PlayerMode.DEFENDER) {
|
||||||
|
DefenderStance ds = DefenderStance.getDefenderStance(p);
|
||||||
|
if (ds==DefenderStance.AGGRESSION) {
|
||||||
|
return basedmg;
|
||||||
|
} else
|
||||||
|
if (ds==DefenderStance.BLOCK) {
|
||||||
|
defenderstancemult = 0.25;
|
||||||
|
} else
|
||||||
|
if (ds==DefenderStance.TANK) {
|
||||||
|
defenderstancemult = 0.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (target instanceof LivingEntity) {
|
if (target instanceof LivingEntity) {
|
||||||
ItemStack[] armor = GenericFunctions.getEquipment(target,true);
|
ItemStack[] armor = GenericFunctions.getEquipment(target,true);
|
||||||
@ -2975,9 +3025,10 @@ public class CustomDamage {
|
|||||||
*(1d-tankydiv)
|
*(1d-tankydiv)
|
||||||
*(1d-artifactmult)
|
*(1d-artifactmult)
|
||||||
*(1d-dodgechancemult)
|
*(1d-dodgechancemult)
|
||||||
|
*(1d-defenderstancemult)
|
||||||
*setbonus
|
*setbonus
|
||||||
*((target instanceof Player && ((Player)target).isBlocking())?(PlayerMode.isDefender((Player)target))?0.30:0.50:1)
|
*((target instanceof Player && ((Player)target).isBlocking())?(PlayerMode.isDefender((Player)target))?0.30:0.50:1)
|
||||||
*((target instanceof Player)?((PlayerMode.isDefender((Player)target))?0.9:(target.getEquipment().getItemInOffHand()!=null && target.getEquipment().getItemInOffHand().getType()==Material.SHIELD)?0.95:1):1);
|
*((target instanceof Player)?((PlayerMode.isDefender((Player)target))?(target.getEquipment().getItemInOffHand()!=null && target.getEquipment().getItemInOffHand().getType()==Material.SHIELD)?0.8:0.9:(target.getEquipment().getItemInOffHand()!=null && target.getEquipment().getItemInOffHand().getType()==Material.SHIELD)?0.95:1):1);
|
||||||
|
|
||||||
if (basedmg!=finaldmg) {
|
if (basedmg!=finaldmg) {
|
||||||
TwosideKeeper.log("Original damage was: "+basedmg,5);
|
TwosideKeeper.log("Original damage was: "+basedmg,5);
|
||||||
@ -3467,7 +3518,7 @@ public class CustomDamage {
|
|||||||
for (int i=0;i<partymembers.size();i++) {
|
for (int i=0;i<partymembers.size();i++) {
|
||||||
Player check = partymembers.get(i);
|
Player check = partymembers.get(i);
|
||||||
if (PartyManager.IsInSameParty(p, check)) {
|
if (PartyManager.IsInSameParty(p, check)) {
|
||||||
TwosideKeeper.log("In here",5);
|
/*TwosideKeeper.log("In here",5);
|
||||||
if (!PlayerMode.isDefender(p) && PlayerMode.isDefender(check) &&
|
if (!PlayerMode.isDefender(p) && PlayerMode.isDefender(check) &&
|
||||||
check.isBlocking() &&
|
check.isBlocking() &&
|
||||||
!p.equals(check) && NotTankReason(reason)) {
|
!p.equals(check) && NotTankReason(reason)) {
|
||||||
@ -3479,13 +3530,13 @@ public class CustomDamage {
|
|||||||
ApplyDamage(defenderdmg, shooter, check, null, "Defender Tank", IGNOREDODGE|IGNORE_DAMAGE_TICK);
|
ApplyDamage(defenderdmg, shooter, check, null, "Defender Tank", IGNOREDODGE|IGNORE_DAMAGE_TICK);
|
||||||
//TwosideKeeper.log("Damage was absorbed by "+check.getName()+". Took "+defenderdmg+" reduced damage. Original damage: "+dmg,0);
|
//TwosideKeeper.log("Damage was absorbed by "+check.getName()+". Took "+defenderdmg+" reduced damage. Original damage: "+dmg,0);
|
||||||
break;
|
break;
|
||||||
} else
|
} else*/
|
||||||
if (!isCupidTank(p) && isCupidTank(check) &&
|
if (!isCupidTank(p) && isCupidTank(check) &&
|
||||||
!p.equals(check) && NotTankReason(reason)) {
|
!p.equals(check) && NotTankReason(reason)) {
|
||||||
//This is a defender. Transfer half the damage to them!
|
//This is a cupid tank. Transfer half the damage to them!
|
||||||
double origdmg = dmg;
|
double origdmg = dmg;
|
||||||
dmg = origdmg-(origdmg*(ItemSet.GetTotalBaseAmount(check, ItemSet.CUPID)/100d));
|
dmg = origdmg-(origdmg*(ItemSet.GetTotalBaseAmount(check, ItemSet.CUPID)/100d));
|
||||||
//Send the rest of the damage to the defender.
|
//Send the rest of the damage to the cupid tanker.
|
||||||
double defenderdmg = origdmg*(ItemSet.GetTotalBaseAmount(check, ItemSet.CUPID)/100d);
|
double defenderdmg = origdmg*(ItemSet.GetTotalBaseAmount(check, ItemSet.CUPID)/100d);
|
||||||
//defenderdmg=CalculateDamageReduction(dmg, check, entity);
|
//defenderdmg=CalculateDamageReduction(dmg, check, entity);
|
||||||
ApplyDamage(defenderdmg, shooter, check, null, "Cupid Set Tank", IGNOREDODGE|IGNORE_DAMAGE_TICK);
|
ApplyDamage(defenderdmg, shooter, check, null, "Cupid Set Tank", IGNOREDODGE|IGNORE_DAMAGE_TICK);
|
||||||
|
@ -120,10 +120,12 @@ public class AdvancedTitle {
|
|||||||
modifyLargeLeftTitle(ChatColor.DARK_AQUA+"☤"+Integer.toString((int)pd.weaponcharges),100);
|
modifyLargeLeftTitle(ChatColor.DARK_AQUA+"☤"+Integer.toString((int)pd.weaponcharges),100);
|
||||||
modifyLargeRightTitle(ChatColor.DARK_PURPLE+Integer.toString((int)pd.damagepool)+"♥",100);
|
modifyLargeRightTitle(ChatColor.DARK_PURPLE+Integer.toString((int)pd.damagepool)+"♥",100);
|
||||||
}
|
}
|
||||||
if (PlayerMode.getPlayerMode(p)==PlayerMode.DEFENDER &&
|
if (PlayerMode.getPlayerMode(p)==PlayerMode.DEFENDER) {
|
||||||
ItemSet.hasFullSet(p, ItemSet.SONGSTEEL)) {
|
if (ItemSet.hasFullSet(p, ItemSet.SONGSTEEL)) {
|
||||||
modifyLargeLeftTitle(ChatColor.YELLOW+Integer.toString((int)pd.vendetta_amt),100);
|
modifyLargeLeftTitle(ChatColor.YELLOW+Integer.toString((int)pd.vendetta_amt),100);
|
||||||
modifyLargeRightTitle(ChatColor.GOLD+Integer.toString((int)pd.thorns_amt),100);
|
}
|
||||||
|
//modifyLargeRightTitle(ChatColor.GOLD+Integer.toString((int)pd.thorns_amt),100);
|
||||||
|
modifyLargeRightTitle(ChatColor.DARK_AQUA+Integer.toString(pd.blockStacks)+"☉",100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4087,7 +4087,7 @@ public class GenericFunctions {
|
|||||||
/**
|
/**
|
||||||
* ONLY FOR BLITZEN LIGHTNING STRIKE
|
* ONLY FOR BLITZEN LIGHTNING STRIKE
|
||||||
*/
|
*/
|
||||||
public static void DealDamageToNearbyMobs(Location l, double basedmg, int range, Entity damager, int flags) {
|
public static void DealBlitzenLightningStrikeToNearbyMobs(Location l, double basedmg, int range, Entity damager, int flags) {
|
||||||
List<LivingEntity> nearbyentities = getNearbyMobs(l,range);
|
List<LivingEntity> nearbyentities = getNearbyMobs(l,range);
|
||||||
for (LivingEntity ent : nearbyentities) {
|
for (LivingEntity ent : nearbyentities) {
|
||||||
boolean allowed=true;
|
boolean allowed=true;
|
||||||
|
@ -26,7 +26,7 @@ import sig.plugin.TwosideKeeper.HelperStructures.Utils.TextUtils;
|
|||||||
|
|
||||||
public enum ItemSet {
|
public enum ItemSet {
|
||||||
PANROS(1,1, 6,4, 10,10, 20,10, 1,6,10,20),
|
PANROS(1,1, 6,4, 10,10, 20,10, 1,6,10,20),
|
||||||
SONGSTEEL(4,2, 6,2, 8,8, 20,10, 4, 6, 8, 20),
|
SONGSTEEL(50,50, 6,2, 8,8, 20,10, 4, 6, 8, 20),
|
||||||
DAWNTRACKER(2,2, 20,10, 10,5, 10,5, 2, 20, 10, 10),
|
DAWNTRACKER(2,2, 20,10, 10,5, 10,5, 2, 20, 10, 10),
|
||||||
LORASYS(2,2, 0,0, 0,0, 0,0, 2, 0, 0, 0),
|
LORASYS(2,2, 0,0, 0,0, 0,0, 2, 0, 0, 0),
|
||||||
JAMDAK(3,3, 5,1, 10,1, 10,2, 3, 5, 10, 10), //Graceful Dodge is in ticks.
|
JAMDAK(3,3, 5,1, 10,1, 10,2, 3, 5, 10, 10), //Graceful Dodge is in ticks.
|
||||||
@ -421,7 +421,7 @@ public enum ItemSet {
|
|||||||
case SONGSTEEL:{
|
case SONGSTEEL:{
|
||||||
lore.add(ChatColor.LIGHT_PURPLE+"Defender Gear");
|
lore.add(ChatColor.LIGHT_PURPLE+"Defender Gear");
|
||||||
lore.add(ChatColor.GOLD+""+ChatColor.BOLD+"T"+tier+" Songsteel Set");
|
lore.add(ChatColor.GOLD+""+ChatColor.BOLD+"T"+tier+" Songsteel Set");
|
||||||
lore.add(ChatColor.YELLOW+"+"+ItemSet.GetBaseAmount(set, tier, 1, p)+"% Block Chance");
|
lore.add(ChatColor.YELLOW+"+"+ItemSet.GetBaseAmount(set, tier, 1, p)+"% Threat Increase");
|
||||||
}break;
|
}break;
|
||||||
case DAWNTRACKER:{
|
case DAWNTRACKER:{
|
||||||
lore.add(ChatColor.LIGHT_PURPLE+"Barbarian Gear");
|
lore.add(ChatColor.LIGHT_PURPLE+"Barbarian Gear");
|
||||||
|
@ -14,10 +14,10 @@ public enum ColoredParticle {
|
|||||||
}
|
}
|
||||||
String name;
|
String name;
|
||||||
public void send(Location location, List<Player> players, int r, int g, int b) {
|
public void send(Location location, List<Player> players, int r, int g, int b) {
|
||||||
ParticleEffect.valueOf(name).display(r/255, g / 255, b / 255, 1, 0, location, players);
|
ParticleEffect.valueOf(name).display(r/255f, g / 255f, b / 255f, 1, 0, location, players);
|
||||||
}
|
}
|
||||||
public void send(Location location, int Distance, int r, int g, int b) {
|
public void send(Location location, int Distance, int r, int g, int b) {
|
||||||
ParticleEffect.valueOf(name).display(r/255, g / 255, b / 255, 1, 0, location, Distance);
|
ParticleEffect.valueOf(name).display(r/255f, g / 255f, b / 255f, 1, 0, location, Distance);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -17,6 +17,7 @@ import org.bukkit.event.entity.EntityTargetEvent.TargetReason;
|
|||||||
import org.inventivetalent.glow.GlowAPI;
|
import org.inventivetalent.glow.GlowAPI;
|
||||||
|
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Channel;
|
import sig.plugin.TwosideKeeper.HelperStructures.Channel;
|
||||||
|
import sig.plugin.TwosideKeeper.HelperStructures.ItemSet;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.LivingEntityDifficulty;
|
import sig.plugin.TwosideKeeper.HelperStructures.LivingEntityDifficulty;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.DebugUtils;
|
import sig.plugin.TwosideKeeper.HelperStructures.Utils.DebugUtils;
|
||||||
@ -406,8 +407,19 @@ public class LivingEntityStructure {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void increaseAggro(LivingEntity target, int amt) {
|
public void increaseAggro(LivingEntity target, int amt) {
|
||||||
|
amt = getNewAggroBasedOnAggroMultipliers(target,amt);
|
||||||
setAggro(target,getAggroRating(target)+amt);
|
setAggro(target,getAggroRating(target)+amt);
|
||||||
}
|
}
|
||||||
|
private int getNewAggroBasedOnAggroMultipliers(LivingEntity target, int amt) {
|
||||||
|
if (target instanceof Player) {
|
||||||
|
Player p = (Player)target;
|
||||||
|
amt = amt * ItemSet.GetTotalBaseAmount(p, ItemSet.SONGSTEEL);
|
||||||
|
if (ItemSet.hasFullSet(p, ItemSet.PRIDE)) {
|
||||||
|
return amt * ItemSet.getHighestTierInSet(p, ItemSet.PRIDE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return amt;
|
||||||
|
}
|
||||||
public void decreaseAggro(LivingEntity target, int amt) {
|
public void decreaseAggro(LivingEntity target, int amt) {
|
||||||
increaseAggro(target,-amt);
|
increaseAggro(target,-amt);
|
||||||
}
|
}
|
||||||
|
@ -180,6 +180,8 @@ public class PlayerStructure {
|
|||||||
public boolean firstPVPMatch=true;
|
public boolean firstPVPMatch=true;
|
||||||
public String lastPVPHitReason="";
|
public String lastPVPHitReason="";
|
||||||
public double lastPVPHitDamage=0;
|
public double lastPVPHitDamage=0;
|
||||||
|
public boolean blocking=false;
|
||||||
|
public long lastShieldCharge=0;
|
||||||
/*State 1
|
/*State 1
|
||||||
* 1: Best of 3 Rounds
|
* 1: Best of 3 Rounds
|
||||||
* 2: Best of 5 Rounds
|
* 2: Best of 5 Rounds
|
||||||
@ -282,6 +284,7 @@ public class PlayerStructure {
|
|||||||
public int unafkLength = 0;
|
public int unafkLength = 0;
|
||||||
public int gracePeriod = 0;
|
public int gracePeriod = 0;
|
||||||
public long lastActiveActivity = 0; //Includes disenchanting / alchemizing.
|
public long lastActiveActivity = 0; //Includes disenchanting / alchemizing.
|
||||||
|
public int blockStacks = 0;
|
||||||
|
|
||||||
//Prevent Automatic AFK moving the camera just to avoid the system.
|
//Prevent Automatic AFK moving the camera just to avoid the system.
|
||||||
public long lastAdjustmentReading = 0; //When the last adjustment reading started.
|
public long lastAdjustmentReading = 0; //When the last adjustment reading started.
|
||||||
@ -815,4 +818,8 @@ public class PlayerStructure {
|
|||||||
mult += Math.max(Math.min(Math.pow(pd.actionRecords/10, 1.05)-1,1000),0);
|
mult += Math.max(Math.min(Math.pow(pd.actionRecords/10, 1.05)-1,1000),0);
|
||||||
return mult;
|
return mult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isBlocking() {
|
||||||
|
return blocking;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,43 @@
|
|||||||
|
package sig.plugin.TwosideKeeper.PlayerStructures;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import sig.plugin.TwosideKeeper.PlayerStructure;
|
||||||
|
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||||
|
import sig.plugin.TwosideKeeper.HelperStructures.PlayerMode;
|
||||||
|
import sig.plugin.TwosideKeeper.HelperStructures.Utils.DebugUtils;
|
||||||
|
|
||||||
|
public enum DefenderStance {
|
||||||
|
AGGRESSION("Aggressive",false,false), //0
|
||||||
|
BLOCK("Block",true,false), //2
|
||||||
|
CHARGE("Charge",false,true), //1
|
||||||
|
TANK("Tank",true,true); //3
|
||||||
|
|
||||||
|
String name;
|
||||||
|
boolean block;
|
||||||
|
boolean sneak;
|
||||||
|
|
||||||
|
DefenderStance(String realname, boolean requiresBlock, boolean requiresSneak) {
|
||||||
|
this.name = realname;
|
||||||
|
this.block = requiresBlock;
|
||||||
|
this.sneak = requiresSneak;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static DefenderStance getDefenderStance(Player p) {
|
||||||
|
if (PlayerMode.getPlayerMode(p)==PlayerMode.DEFENDER) {
|
||||||
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
|
for (DefenderStance check : DefenderStance.values()) {
|
||||||
|
if (p.isSneaking()==check.sneak && pd.isBlocking()==check.block) {
|
||||||
|
return check;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
TwosideKeeper.log("WARNING! We could not find a stance for Player "+p.getName()+"! None of the states match!", 1);
|
||||||
|
DebugUtils.showStackTrace();
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
TwosideKeeper.log("WARNING! We could not find a stance for Player "+p.getName()+"! They are not a Defender! You should probably remove this call.", 1);
|
||||||
|
DebugUtils.showStackTrace();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -298,6 +298,7 @@ import sig.plugin.TwosideKeeper.Monster.HellfireGhast;
|
|||||||
import sig.plugin.TwosideKeeper.Monster.Knight;
|
import sig.plugin.TwosideKeeper.Monster.Knight;
|
||||||
import sig.plugin.TwosideKeeper.Monster.MonsterTemplate;
|
import sig.plugin.TwosideKeeper.Monster.MonsterTemplate;
|
||||||
import sig.plugin.TwosideKeeper.Monster.SniperSkeleton;
|
import sig.plugin.TwosideKeeper.Monster.SniperSkeleton;
|
||||||
|
import sig.plugin.TwosideKeeper.PlayerStructures.DefenderStance;
|
||||||
import sig.plugin.TwosideKeeper.Rooms.DPSChallengeRoom;
|
import sig.plugin.TwosideKeeper.Rooms.DPSChallengeRoom;
|
||||||
import sig.plugin.TwosideKeeper.Rooms.ParkourChallengeRoom;
|
import sig.plugin.TwosideKeeper.Rooms.ParkourChallengeRoom;
|
||||||
import sig.plugin.TwosideKeeper.Rooms.TankChallengeRoom;
|
import sig.plugin.TwosideKeeper.Rooms.TankChallengeRoom;
|
||||||
@ -4399,7 +4400,9 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
LinkPlayerToOtherPlayer(p,pl);
|
LinkPlayerToOtherPlayer(p,pl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
aggroMonsters(p,pd,1000,16);
|
if (PlayerMode.getPlayerMode(p)==PlayerMode.DEFENDER) {
|
||||||
|
pd.blocking=true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LinkPlayerToOtherPlayer(Player p, Player pl) {
|
private void LinkPlayerToOtherPlayer(Player p, Player pl) {
|
||||||
@ -4473,6 +4476,28 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
},1);
|
},1);
|
||||||
|
|
||||||
|
if (ev.getAction() == Action.LEFT_CLICK_AIR || ev.getAction() == Action.LEFT_CLICK_BLOCK) {
|
||||||
|
//PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
|
if (pd.lastShieldCharge+(20*1)<=TwosideKeeper.getServerTickTime()) {
|
||||||
|
if (PlayerMode.getPlayerMode(p) == PlayerMode.DEFENDER &&
|
||||||
|
DefenderStance.getDefenderStance(p)==DefenderStance.CHARGE) {
|
||||||
|
SoundUtils.playGlobalSound(p.getLocation(), Sound.BLOCK_GLASS_PLACE, 1f, 1.25f);
|
||||||
|
p.setVelocity(p.getLocation().getDirection().multiply(2));
|
||||||
|
pd.lastShieldCharge = TwosideKeeper.getServerTickTime();
|
||||||
|
Vector dir = p.getLocation().getDirection();
|
||||||
|
for (int i=0;i<10;i++) {
|
||||||
|
Vector newdir = dir.clone();
|
||||||
|
newdir.multiply(i);
|
||||||
|
Location checkpos = p.getLocation().add(newdir);
|
||||||
|
/*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");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!Christmas.RunPlayerInteractEvent(ev)) {return;}
|
if (!Christmas.RunPlayerInteractEvent(ev)) {return;}
|
||||||
|
|
||||||
if (ev.getClickedBlock()!=null && ev.getClickedBlock().getType()==Material.CHEST &&
|
if (ev.getClickedBlock()!=null && ev.getClickedBlock().getType()==Material.CHEST &&
|
||||||
@ -4768,21 +4793,17 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
|
|
||||||
//Shield related stuff in here.
|
//Shield related stuff in here.
|
||||||
//TwosideKeeper.log(ev.useInteractedBlock().toString(), 0);
|
//TwosideKeeper.log(ev.useInteractedBlock().toString(), 0);
|
||||||
if ((ev.getAction()==Action.RIGHT_CLICK_AIR ||
|
/*if ((ev.getAction()==Action.RIGHT_CLICK_AIR ||
|
||||||
ev.getAction()==Action.RIGHT_CLICK_BLOCK) && (ev.getClickedBlock()==null || !BlockUtils.isInteractable(ev.getClickedBlock()))) {
|
ev.getAction()==Action.RIGHT_CLICK_BLOCK) && (ev.getClickedBlock()==null || !BlockUtils.isInteractable(ev.getClickedBlock()))) {
|
||||||
if (PlayerMode.getPlayerMode(p)==PlayerMode.DEFENDER) {
|
if (PlayerMode.getPlayerMode(p)==PlayerMode.DEFENDER) {
|
||||||
aggroMonsters(p, pd, 1000, 16);
|
aggroMonsters(p, pd, 1000, 16);
|
||||||
}
|
}
|
||||||
//See if this player is blocking. If so, give them absorption.
|
//See if this player is blocking. If so, give them absorption.
|
||||||
//Player p = ev.getPlayer();
|
//Player p = ev.getPlayer();
|
||||||
/*Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
|
}*/
|
||||||
@Override
|
if ((ev.getAction()==Action.RIGHT_CLICK_AIR ||
|
||||||
public void run() {
|
ev.getAction()==Action.RIGHT_CLICK_BLOCK) && (ev.getClickedBlock()==null || !BlockUtils.isInteractable(ev.getClickedBlock()))) {
|
||||||
if (p.isBlocking()) {
|
pd.blocking=true;
|
||||||
//Give absorption hearts.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},8);*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check if we're allowed to open a shop chest.
|
//Check if we're allowed to open a shop chest.
|
||||||
@ -5464,7 +5485,6 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
private void aggroMonsters(final Player p, PlayerStructure pd, int tauntAmt, int range) {
|
private void aggroMonsters(final Player p, PlayerStructure pd, int tauntAmt, int range) {
|
||||||
if (PlayerMode.isDefender(p)) {
|
if (PlayerMode.isDefender(p)) {
|
||||||
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.ABSORPTION,200,1,p);
|
|
||||||
List<Entity> entities = p.getNearbyEntities(range, range, range);
|
List<Entity> entities = p.getNearbyEntities(range, range, range);
|
||||||
for (int i=0;i<entities.size();i++) {
|
for (int i=0;i<entities.size();i++) {
|
||||||
if (entities.get(i) instanceof Monster) {
|
if (entities.get(i) instanceof Monster) {
|
||||||
@ -5479,14 +5499,11 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.ABSORPTION,200,0,p);
|
|
||||||
}
|
}
|
||||||
DecimalFormat df = new DecimalFormat("0.0");
|
DecimalFormat df = new DecimalFormat("0.0");
|
||||||
if (pd.lastblock+20*5<=getServerTickTime()) {
|
if (pd.lastblock+20*5<=getServerTickTime()) {
|
||||||
p.sendMessage(ChatColor.GRAY+"Damage Reduction: "+ChatColor.DARK_AQUA+df.format(((1-CustomDamage.CalculateDamageReduction(1,p,null))*100))+"% "+ChatColor.GRAY+"Block Chance: "+ChatColor.DARK_AQUA+df.format(((CustomDamage.CalculateDodgeChance(p))*100))+"% ");
|
p.sendMessage(ChatColor.GRAY+"Damage Reduction: "+ChatColor.DARK_AQUA+df.format(((1-CustomDamage.CalculateDamageReduction(1,p,null))*100))+"% "+ChatColor.GRAY+"Block Chance: "+ChatColor.DARK_AQUA+df.format(((CustomDamage.CalculateDodgeChance(p))*100))+"% ");
|
||||||
pd.lastblock=getServerTickTime();
|
pd.lastblock=getServerTickTime();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void consumeToken(Player p) {
|
private void consumeToken(Player p) {
|
||||||
@ -6358,7 +6375,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ev.getItemDrop().getItemStack().getType()==Material.SHIELD && !GenericFunctions.isViewingInventory(ev.getPlayer())) {
|
/*if (ev.getItemDrop().getItemStack().getType()==Material.SHIELD && !GenericFunctions.isViewingInventory(ev.getPlayer())) {
|
||||||
ev.setCancelled(true);
|
ev.setCancelled(true);
|
||||||
if (ev.getPlayer().getEquipment().getItemInMainHand()==null || ev.getPlayer().getEquipment().getItemInMainHand().getType()==Material.AIR) {
|
if (ev.getPlayer().getEquipment().getItemInMainHand()==null || ev.getPlayer().getEquipment().getItemInMainHand().getType()==Material.AIR) {
|
||||||
ev.getPlayer().getEquipment().setItemInMainHand(ev.getItemDrop().getItemStack());
|
ev.getPlayer().getEquipment().setItemInMainHand(ev.getItemDrop().getItemStack());
|
||||||
@ -6374,7 +6391,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
ev.getPlayer().getEquipment().setItemInMainHand(new ItemStack(Material.AIR));
|
ev.getPlayer().getEquipment().setItemInMainHand(new ItemStack(Material.AIR));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
if (ev.getItemDrop().getItemStack().getType().name().contains("_AXE") && !GenericFunctions.isViewingInventory(ev.getPlayer())) {
|
if (ev.getItemDrop().getItemStack().getType().name().contains("_AXE") && !GenericFunctions.isViewingInventory(ev.getPlayer())) {
|
||||||
ev.setCancelled(true);
|
ev.setCancelled(true);
|
||||||
|
@ -64,10 +64,13 @@ import sig.plugin.TwosideKeeper.HelperStructures.Utils.EntityUtils;
|
|||||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.InventoryUtils;
|
import sig.plugin.TwosideKeeper.HelperStructures.Utils.InventoryUtils;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.ItemCubeUtils;
|
import sig.plugin.TwosideKeeper.HelperStructures.Utils.ItemCubeUtils;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.MessageUtils;
|
import sig.plugin.TwosideKeeper.HelperStructures.Utils.MessageUtils;
|
||||||
|
import sig.plugin.TwosideKeeper.HelperStructures.Utils.MovementUtils;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.PlayerUtils;
|
import sig.plugin.TwosideKeeper.HelperStructures.Utils.PlayerUtils;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.SoundUtils;
|
import sig.plugin.TwosideKeeper.HelperStructures.Utils.SoundUtils;
|
||||||
|
import sig.plugin.TwosideKeeper.HelperStructures.Utils.Classes.ColoredParticle;
|
||||||
import sig.plugin.TwosideKeeper.HolidayEvents.Christmas;
|
import sig.plugin.TwosideKeeper.HolidayEvents.Christmas;
|
||||||
import sig.plugin.TwosideKeeper.Monster.Dummy;
|
import sig.plugin.TwosideKeeper.Monster.Dummy;
|
||||||
|
import sig.plugin.TwosideKeeper.PlayerStructures.DefenderStance;
|
||||||
|
|
||||||
final public class runServerHeartbeat implements Runnable {
|
final public class runServerHeartbeat implements Runnable {
|
||||||
/**
|
/**
|
||||||
@ -337,8 +340,6 @@ final public class runServerHeartbeat implements Runnable {
|
|||||||
AdventurerModeSetExhaustion(p);
|
AdventurerModeSetExhaustion(p);
|
||||||
TwosideKeeper.HeartbeatLogger.AddEntry("Adventurer Mode Exhaustion", (int)(System.nanoTime()-time));time=System.nanoTime();
|
TwosideKeeper.HeartbeatLogger.AddEntry("Adventurer Mode Exhaustion", (int)(System.nanoTime()-time));time=System.nanoTime();
|
||||||
|
|
||||||
CalculateHealthRegeneration(serverTickTime, p, pd, equips);
|
|
||||||
|
|
||||||
ResetSwordCombo(serverTickTime, p, pd);
|
ResetSwordCombo(serverTickTime, p, pd);
|
||||||
TwosideKeeper.HeartbeatLogger.AddEntry("Reset Sword Combo", (int)(System.nanoTime()-time));time=System.nanoTime();
|
TwosideKeeper.HeartbeatLogger.AddEntry("Reset Sword Combo", (int)(System.nanoTime()-time));time=System.nanoTime();
|
||||||
|
|
||||||
@ -365,6 +366,11 @@ final public class runServerHeartbeat implements Runnable {
|
|||||||
|
|
||||||
checkForHealthUpdate(p);
|
checkForHealthUpdate(p);
|
||||||
TwosideKeeper.HeartbeatLogger.AddEntry("Check for Health Update.", (int)(System.nanoTime()-time));time=System.nanoTime();
|
TwosideKeeper.HeartbeatLogger.AddEntry("Check for Health Update.", (int)(System.nanoTime()-time));time=System.nanoTime();
|
||||||
|
|
||||||
|
UpdatePlayerBlockStatus(p);
|
||||||
|
increaseAbsorptionHealth(p);
|
||||||
|
increaseAggroTowardsTarget(p);
|
||||||
|
//TwosideKeeper.log("Defender Stance: "+DefenderStance.getDefenderStance(p), 0);
|
||||||
}
|
}
|
||||||
//TwosideKeeper.outputArmorDurability(p,">");
|
//TwosideKeeper.outputArmorDurability(p,">");
|
||||||
}
|
}
|
||||||
@ -408,6 +414,47 @@ final public class runServerHeartbeat implements Runnable {
|
|||||||
TwosideKeeper.HeartbeatLogger.AddEntry(ChatColor.LIGHT_PURPLE+"Total Server Heartbeat", (int)(System.nanoTime()-totaltime));totaltime=System.nanoTime();
|
TwosideKeeper.HeartbeatLogger.AddEntry(ChatColor.LIGHT_PURPLE+"Total Server Heartbeat", (int)(System.nanoTime()-totaltime));totaltime=System.nanoTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void increaseAggroTowardsTarget(Player p) {
|
||||||
|
if (PlayerMode.getPlayerMode(p)==PlayerMode.DEFENDER) {
|
||||||
|
if (DefenderStance.getDefenderStance(p)==DefenderStance.BLOCK) {
|
||||||
|
LivingEntity target = aPlugin.API.rayTraceTargetEntity(p, 20);
|
||||||
|
if (target!=null && !(target instanceof Player)) {
|
||||||
|
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(target);
|
||||||
|
les.increaseAggro(p, 100);
|
||||||
|
les.lastHit = TwosideKeeper.getServerTickTime();
|
||||||
|
//TwosideKeeper.log(les.displayAggroTable(), 0);
|
||||||
|
Vector dir = MovementUtils.pointTowardsLocation(target.getLocation(), p.getLocation());
|
||||||
|
for (int i=0;i<p.getLocation().distance(target.getLocation())*4;i++) {
|
||||||
|
Vector newdir = dir.clone();
|
||||||
|
newdir.multiply(i*0.25);
|
||||||
|
newdir.setY(newdir.getY()+2);
|
||||||
|
ColoredParticle.RED_DUST.send(target.getLocation().add(newdir), 50, 255, 255, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void increaseAbsorptionHealth(Player p) {
|
||||||
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
|
if (PlayerMode.getPlayerMode(p)==PlayerMode.DEFENDER) {
|
||||||
|
if (DefenderStance.getDefenderStance(p)==DefenderStance.BLOCK &&
|
||||||
|
pd.isBlocking()) {
|
||||||
|
CustomDamage.setAbsorptionHearts(p, CustomDamage.getAbsorptionHearts(p)+2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (CustomDamage.getAbsorptionHearts(p)>p.getMaxHealth()) {
|
||||||
|
CustomDamage.setAbsorptionHearts(p, (float)p.getMaxHealth());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdatePlayerBlockStatus(Player p) {
|
||||||
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
|
if (!p.isBlocking() && pd.blocking) {
|
||||||
|
pd.blocking=p.isBlocking();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void CheckPlayerLocationAndActionQueue(Player p) {
|
private void CheckPlayerLocationAndActionQueue(Player p) {
|
||||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
if (pd.leashedLoc==null) {
|
if (pd.leashedLoc==null) {
|
||||||
@ -960,6 +1007,9 @@ final public class runServerHeartbeat implements Runnable {
|
|||||||
pd.lastattacked=0;
|
pd.lastattacked=0;
|
||||||
pd.lifestealstacks=0;
|
pd.lifestealstacks=0;
|
||||||
}
|
}
|
||||||
|
if (pd.lastcombat+(20*60)<serverTickTime) {
|
||||||
|
pd.blockStacks=0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ManageSnowmanHunt() {
|
private void ManageSnowmanHunt() {
|
||||||
@ -1077,13 +1127,6 @@ final public class runServerHeartbeat implements Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CalculateHealthRegeneration(final long serverTickTime, Player p, PlayerStructure pd,
|
|
||||||
ItemStack[] equips) {
|
|
||||||
if (PlayerMode.isDefender(p)) {
|
|
||||||
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.REGENERATION,60,(p.isBlocking())?3:1,p,false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void performTimingsReport() {
|
public static void performTimingsReport() {
|
||||||
performTimingsReport(false);
|
performTimingsReport(false);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user