Fixed AOE bug and Earth Wave vehicle bug.

This commit is contained in:
sigonasr2 2017-09-03 04:26:44 -05:00
parent 3d9479b9f2
commit 9874633e69
6 changed files with 25 additions and 17 deletions

Binary file not shown.

View File

@ -896,7 +896,8 @@ public class CustomDamage {
if (!Dummy.isDummy(target)) { if (!Dummy.isDummy(target)) {
increaseArtifactArmorXP(p,(int)(ratio*10)+1); increaseArtifactArmorXP(p,(int)(ratio*10)+1);
} }
hitlist = getAOEList(weapon,target); hitlist = getAOEList(weapon,target,p);
//TwosideKeeper.log("AOE List: "+hitlist, 0);
} }
boolean applyDeathMark=false; boolean applyDeathMark=false;
@ -904,6 +905,7 @@ public class CustomDamage {
if (ArtifactAbility.getEnchantmentLevel(ArtifactAbility.DEATHMARK, p.getEquipment().getItemInMainHand())>0 && if (ArtifactAbility.getEnchantmentLevel(ArtifactAbility.DEATHMARK, p.getEquipment().getItemInMainHand())>0 &&
pd.last_deathmark+GenericFunctions.GetModifiedCooldown(TwosideKeeper.DEATHMARK_COOLDOWN,p)<TwosideKeeper.getServerTickTime()) { pd.last_deathmark+GenericFunctions.GetModifiedCooldown(TwosideKeeper.DEATHMARK_COOLDOWN,p)<TwosideKeeper.getServerTickTime()) {
applyDeathMark=true; applyDeathMark=true;
//TwosideKeeper.log("Also apply Death Mark.", 0);
} }
for (LivingEntity ent : hitlist) { for (LivingEntity ent : hitlist) {
@ -918,6 +920,7 @@ public class CustomDamage {
if (!ent.equals(target)) { if (!ent.equals(target)) {
//hitlist.get(i).damage(dmg); //hitlist.get(i).damage(dmg);
//GenericFunctions.DealDamageToMob(CalculateDamageReduction(dmg,target,damager), hitlist.get(i), shooter, weapon, "AoE Damage"); //GenericFunctions.DealDamageToMob(CalculateDamageReduction(dmg,target,damager), hitlist.get(i), shooter, weapon, "AoE Damage");
//TwosideKeeper.log("Apply AOE Damage.", 0);
ApplyDamage(0,damager,ent,weapon,"AoE Damage",setFlag(flags,NOAOE)); ApplyDamage(0,damager,ent,weapon,"AoE Damage",setFlag(flags,NOAOE));
}; };
} }
@ -1062,13 +1065,16 @@ public class CustomDamage {
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)) {
LivingEntity damaging_ent = getDamagerEntity(damager); LivingEntity damaging_ent = getDamagerEntity(damager);
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(target);
double mult = 1.0; double mult = 1.0;
if (damaging_ent instanceof Player) { if (damaging_ent instanceof Player) {
if (PlayerMode.getPlayerMode((Player)damaging_ent)==PlayerMode.BARBARIAN) { if (PlayerMode.getPlayerMode((Player)damaging_ent)==PlayerMode.BARBARIAN) {
mult += 4-((damaging_ent.getHealth()/damaging_ent.getMaxHealth())*4d); mult += 4-((damaging_ent.getHealth()/damaging_ent.getMaxHealth())*4d);
} }
if (PlayerMode.getPlayerMode((Player)damaging_ent)==PlayerMode.DEFENDER) {
les.increaseAggro(getDamagerEntity(damager), 100);
}
} }
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(target);
les.increaseAggro(getDamagerEntity(damager), (int)(damage*mult)); les.increaseAggro(getDamagerEntity(damager), (int)(damage*mult));
//TwosideKeeper.log(les.displayAggroTable(),0); //TwosideKeeper.log(les.displayAggroTable(),0);
if (les.GetTarget()!=null && if (les.GetTarget()!=null &&
@ -2297,16 +2303,16 @@ public class CustomDamage {
} }
} }
static List<LivingEntity> getAOEList(ItemStack weapon, LivingEntity target) { static List<LivingEntity> getAOEList(ItemStack weapon, LivingEntity target, Player p) {
List<LivingEntity> list = new ArrayList<LivingEntity>(); List<LivingEntity> list = new ArrayList<LivingEntity>();
if (target instanceof Player) { if (ArtifactAbility.containsEnchantment(ArtifactAbility.AOE, weapon)) {
if (ArtifactAbility.containsEnchantment(ArtifactAbility.AOE, weapon)) { //TwosideKeeper.log("Weapon contains AOE", 0);
double aoerange = 1+GenericFunctions.getAbilityValue(ArtifactAbility.AOE, weapon, (Player)target); double aoerange = 1+GenericFunctions.getAbilityValue(ArtifactAbility.AOE, weapon, p);
if (target!=null) { //TwosideKeeper.log("AOE Range: "+aoerange, 0);
List<Entity> nearbylist=target.getNearbyEntities(aoerange,aoerange,aoerange); if (target!=null) {
list = trimNonLivingEntities(nearbylist); List<Entity> nearbylist=target.getNearbyEntities(aoerange,aoerange,aoerange);
//list.remove(target); list = trimNonLivingEntities(nearbylist);
} //list.remove(target);
} }
} }
list.add(target); list.add(target);

View File

@ -264,7 +264,6 @@ public enum ArtifactAbility {
newstring+=" "+splitstring[j]; newstring+=" "+splitstring[j];
} }
} }
TwosideKeeper.log(newstring,5);
//This is the name of the enchantment. Now connect it with the name map we made. //This is the name of the enchantment. Now connect it with the name map we made.
abilities.put(AwakenedArtifact.name_map.get(ChatColor.stripColor(newstring)),Integer.parseInt(splitstring[splitstring.length-1])); abilities.put(AwakenedArtifact.name_map.get(ChatColor.stripColor(newstring)),Integer.parseInt(splitstring[splitstring.length-1]));
} }
@ -363,6 +362,7 @@ public enum ArtifactAbility {
} }
public static boolean containsEnchantment(ArtifactAbility ability, ItemStack item) { public static boolean containsEnchantment(ArtifactAbility ability, ItemStack item) {
//TwosideKeeper.log("Enchantment list: "+getEnchantments(item), 0);
return getEnchantments(item).containsKey(ability); return getEnchantments(item).containsKey(ability);
} }

View File

@ -167,7 +167,7 @@ public class SniperSkeleton extends GenericBoss{
Projectile arrow = m.launchProjectile(Arrow.class); Projectile arrow = m.launchProjectile(Arrow.class);
arrow.setCustomName("MIRRORED"); arrow.setCustomName("MIRRORED");
//arrow.setMetadata("SNIPER_"+mode.name(), new FixedMetadataValue(TwosideKeeper.plugin,false)); //arrow.setMetadata("SNIPER_"+mode.name(), new FixedMetadataValue(TwosideKeeper.plugin,false));
TwosideKeeper.log(TwosideKeeper.getServerTickTime()+": Shooting arrow", 0); //TwosideKeeper.log(TwosideKeeper.getServerTickTime()+": Shooting arrow", 0);
} }
}, 20); }, 20);
} }

View File

@ -303,7 +303,7 @@ import sig.plugin.TwosideKeeper.Rooms.ParkourChallengeRoom;
import sig.plugin.TwosideKeeper.Rooms.TankChallengeRoom; import sig.plugin.TwosideKeeper.Rooms.TankChallengeRoom;
public class TwosideKeeper<E> extends JavaPlugin implements Listener { public class TwosideKeeper extends JavaPlugin implements Listener {
public final static int CUSTOM_DAMAGE_IDENTIFIER = 500000; public final static int CUSTOM_DAMAGE_IDENTIFIER = 500000;
@ -4643,7 +4643,7 @@ public class TwosideKeeper<E> extends JavaPlugin implements Listener {
} }
//Check for Earth Wave attack. //Check for Earth Wave attack.
if ((ev.getAction()==Action.RIGHT_CLICK_AIR || ev.getAction()==Action.RIGHT_CLICK_BLOCK) && !p.isOnGround()) { if ((ev.getAction()==Action.RIGHT_CLICK_AIR || ev.getAction()==Action.RIGHT_CLICK_BLOCK) && !p.isOnGround() && !p.isInsideVehicle()) {
ItemStack weapon = p.getEquipment().getItemInMainHand(); ItemStack weapon = p.getEquipment().getItemInMainHand();
//PlayerStructure pd = PlayerStructure.GetPlayerStructure(p); //PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
double dmg = 0; double dmg = 0;
@ -4770,7 +4770,9 @@ public class TwosideKeeper<E> extends JavaPlugin implements Listener {
//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()))) {
aggroMonsters(p, pd, 1000, 16); if (PlayerMode.getPlayerMode(p)==PlayerMode.DEFENDER) {
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() { /*Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {

View File

@ -1422,7 +1422,7 @@ final public class runServerHeartbeat implements Runnable {
} }
public void AddEliteStructureIfOneDoesNotExist(LivingEntityStructure ms) { public void AddEliteStructureIfOneDoesNotExist(LivingEntityStructure ms) {
if (ms.isElite || (ms.m instanceof Monster && MonsterController.getMonsterDifficulty((Monster)(ms.m))==MonsterDifficulty.ELITE)) { if ((ms.isElite && ms.m instanceof Monster) || (ms.m instanceof Monster && MonsterController.getMonsterDifficulty((Monster)(ms.m))==MonsterDifficulty.ELITE)) {
//Make it glow dark purple. //Make it glow dark purple.
//GenericFunctions.setGlowing(m, GlowAPI.Color.DARK_PURPLE); //GenericFunctions.setGlowing(m, GlowAPI.Color.DARK_PURPLE);
boolean hasstruct = false; boolean hasstruct = false;