more fixies

This commit is contained in:
Cheese 2015-11-21 10:34:08 +11:00
parent 4d128d9c7a
commit 4a70e4da90
5 changed files with 16 additions and 9 deletions

View File

@ -113,7 +113,7 @@ public class Inferno extends SkillActive
itemStack.setItemMeta(meta); itemStack.setItemMeta(meta);
Item fire = cur.getWorld().dropItem(cur.getEyeLocation().add(cur.getLocation().getDirection()), itemStack); Item fire = cur.getWorld().dropItem(cur.getEyeLocation().add(cur.getLocation().getDirection()), itemStack);
Factory.Fire().Add(fire, cur, 0.7, 0, 0.3 + (0.1 * level), 1, GetName()); Factory.Fire().Add(fire, cur, 0.7, 0, 0.3 + (0.1 * level), 1, GetName(), false);
fire.teleport(cur.getEyeLocation()); fire.teleport(cur.getEyeLocation());
double x = 0.07 - (UtilMath.r(14)/100d); double x = 0.07 - (UtilMath.r(14)/100d);

View File

@ -156,7 +156,7 @@ public class NapalmShot extends SkillActive
{ {
Projectile proj = event.getEntity(); Projectile proj = event.getEntity();
if (!_arrows.remove(proj)) if (!_arrows.contains(proj))
return; return;
if (proj.getShooter() == null) if (proj.getShooter() == null)
@ -179,7 +179,7 @@ public class NapalmShot extends SkillActive
itemStack.setItemMeta(meta); itemStack.setItemMeta(meta);
Item fire = proj.getWorld().dropItemNaturally(proj.getLocation(), itemStack); Item fire = proj.getWorld().dropItemNaturally(proj.getLocation(), itemStack);
Factory.Fire().Add(fire, damager, 16, 0.25, 2, 0.25, GetName()); Factory.Fire().Add(fire, damager, 16, 0.25, 2, 0.25, GetName(), true);
fire.setVelocity(fire.getVelocity().multiply(1 + (0.15 * level))); fire.setVelocity(fire.getVelocity().multiply(1 + (0.15 * level)));
} }

View File

@ -42,9 +42,9 @@ public class Fire extends MiniPlugin
_damageManager = damageManager; _damageManager = damageManager;
} }
public void Add(Item item, LivingEntity owner, double expireTime, double delayTime, double burnTime, double damage, String skillName) public void Add(Item item, LivingEntity owner, double expireTime, double delayTime, double burnTime, double damage, String skillName, boolean hitSelf)
{ {
_fire.put(item, new FireData(owner, expireTime, delayTime, burnTime, damage, skillName)); _fire.put(item, new FireData(owner, expireTime, delayTime, burnTime, damage, skillName, hitSelf));
item.setPickupDelay(0); item.setPickupDelay(0);
} }
@ -79,7 +79,7 @@ public class Fire extends MiniPlugin
if (ent.getLocation().getBlock().getTypeId() == 8 || ent.getLocation().getBlock().getTypeId() == 9) if (ent.getLocation().getBlock().getTypeId() == 8 || ent.getLocation().getBlock().getTypeId() == 9)
continue; continue;
if (ent.equals(_fire.get(fire).GetOwner())) if (!_fire.get(fire).canHitOwner() && ent.equals(_fire.get(fire).GetOwner()))
continue; continue;
if (_conditionManager.HasCondition(ent, ConditionType.FIRE_ITEM_IMMUNITY, null)) if (_conditionManager.HasCondition(ent, ConditionType.FIRE_ITEM_IMMUNITY, null))
@ -111,7 +111,7 @@ public class Fire extends MiniPlugin
if (!_fire.containsKey(fire)) if (!_fire.containsKey(fire))
return; return;
if (_fire.get(fire).GetOwner().equals(player)) if (!_fire.get(fire).canHitOwner() && _fire.get(fire).GetOwner().equals(player))
return; return;
event.setCancelled(true); event.setCancelled(true);

View File

@ -10,8 +10,9 @@ public class FireData
private double _burnTime; private double _burnTime;
private double _damage; private double _damage;
private String _skillName; private String _skillName;
private boolean _hitOwner;
public FireData(LivingEntity owner, double expireTime, double delayTime, double burnTime, double damage, String skillName) public FireData(LivingEntity owner, double expireTime, double delayTime, double burnTime, double damage, String skillName, boolean hitSelf)
{ {
_owner = owner; _owner = owner;
_expireTime = System.currentTimeMillis() + (long)(1000 * expireTime); _expireTime = System.currentTimeMillis() + (long)(1000 * expireTime);
@ -19,6 +20,7 @@ public class FireData
_burnTime = burnTime; _burnTime = burnTime;
_damage = damage; _damage = damage;
_skillName = skillName; _skillName = skillName;
_hitOwner = hitSelf;
} }
public LivingEntity GetOwner() public LivingEntity GetOwner()
@ -50,4 +52,9 @@ public class FireData
{ {
return System.currentTimeMillis() > _expireTime; return System.currentTimeMillis() > _expireTime;
} }
public boolean canHitOwner()
{
return _hitOwner;
}
} }

View File

@ -129,7 +129,7 @@ public class PerkFlamingSwordEVO extends Perk
{ {
//Fire //Fire
Item fire = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.BLAZE_POWDER)); Item fire = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.BLAZE_POWDER));
Manager.GetFire().Add(fire, player, 0.7, 0, 0.5, 1, "Inferno"); Manager.GetFire().Add(fire, player, 0.7, 0, 0.5, 1, "Inferno", false);
fire.teleport(player.getEyeLocation()); fire.teleport(player.getEyeLocation());
double x = 0.07 - (UtilMath.r(14)/100d); double x = 0.07 - (UtilMath.r(14)/100d);