Fixed AOE bug and Earth Wave vehicle bug.

patch_branch
sigonasr2 8 years ago
parent 3d9479b9f2
commit 9874633e69
  1. BIN
      TwosideKeeper.jar
  2. 18
      src/sig/plugin/TwosideKeeper/CustomDamage.java
  3. 2
      src/sig/plugin/TwosideKeeper/HelperStructures/ArtifactAbility.java
  4. 2
      src/sig/plugin/TwosideKeeper/Monster/SniperSkeleton.java
  5. 6
      src/sig/plugin/TwosideKeeper/TwosideKeeper.java
  6. 2
      src/sig/plugin/TwosideKeeper/runServerHeartbeat.java

Binary file not shown.

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

@ -264,7 +264,6 @@ public enum ArtifactAbility {
newstring+=" "+splitstring[j];
}
}
TwosideKeeper.log(newstring,5);
//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]));
}
@ -363,6 +362,7 @@ public enum ArtifactAbility {
}
public static boolean containsEnchantment(ArtifactAbility ability, ItemStack item) {
//TwosideKeeper.log("Enchantment list: "+getEnchantments(item), 0);
return getEnchantments(item).containsKey(ability);
}

@ -167,7 +167,7 @@ public class SniperSkeleton extends GenericBoss{
Projectile arrow = m.launchProjectile(Arrow.class);
arrow.setCustomName("MIRRORED");
//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);
}

@ -303,7 +303,7 @@ import sig.plugin.TwosideKeeper.Rooms.ParkourChallengeRoom;
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;
@ -4643,7 +4643,7 @@ public class TwosideKeeper<E> extends JavaPlugin implements Listener {
}
//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();
//PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
double dmg = 0;
@ -4770,7 +4770,9 @@ public class TwosideKeeper<E> extends JavaPlugin implements Listener {
//TwosideKeeper.log(ev.useInteractedBlock().toString(), 0);
if ((ev.getAction()==Action.RIGHT_CLICK_AIR ||
ev.getAction()==Action.RIGHT_CLICK_BLOCK) && (ev.getClickedBlock()==null || !BlockUtils.isInteractable(ev.getClickedBlock()))) {
if (PlayerMode.getPlayerMode(p)==PlayerMode.DEFENDER) {
aggroMonsters(p, pd, 1000, 16);
}
//See if this player is blocking. If so, give them absorption.
//Player p = ev.getPlayer();
/*Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {

@ -1422,7 +1422,7 @@ final public class runServerHeartbeat implements Runnable {
}
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.
//GenericFunctions.setGlowing(m, GlowAPI.Color.DARK_PURPLE);
boolean hasstruct = false;

Loading…
Cancel
Save