Esempio n. 1
0
 @Override
 public void remove(Hero hero) {
   super.remove(hero);
   Player p = hero.getPlayer();
   broadcast(p.getLocation(), expireText, p.getDisplayName());
   if (lastLoc != null) {
     p.sendBlockChange(lastLoc, lastMat, lastData);
   }
 }
Esempio n. 2
0
 @Override
 public void tick(Hero hero) {
   super.tick(hero);
   Player player = hero.getPlayer();
   double healAmount = hero.getMaxHealth() * tickHealPercent;
   hero.setHealth(hero.getHealth() + healAmount);
   hero.syncHealth();
   if (hero.isVerbose()) {
     player.sendMessage(Messaging.createFullHealthBar(hero.getHealth(), hero.getMaxHealth()));
   }
 }
Esempio n. 3
0
 @Override
 public void apply(Hero hero) {
   super.apply(hero);
   Player p = hero.getPlayer();
   broadcast(p.getLocation(), applyText, p.getDisplayName());
   Block thisBlock = p.getLocation().getBlock().getRelative(BlockFace.DOWN);
   if (allowedBlocks.contains(thisBlock.getType())) {
     lastLoc = thisBlock.getLocation();
     lastMat = thisBlock.getType();
     lastData = thisBlock.getData();
     p.sendBlockChange(lastLoc, Material.GLOWSTONE, (byte) 0);
   }
 }
Esempio n. 4
0
 @Override
 public void tick(Hero hero) {
   super.tick(hero);
   Player p = hero.getPlayer();
   Block thisBlock = p.getLocation().getBlock().getRelative(BlockFace.DOWN);
   if (thisBlock.getLocation().equals(lastLoc)) {
     return;
   } else if (allowedBlocks.contains(thisBlock.getType())) {
     if (lastLoc != null) {
       p.sendBlockChange(lastLoc, lastMat, lastData);
     }
     lastLoc = thisBlock.getLocation();
     lastMat = thisBlock.getType();
     lastData = thisBlock.getData();
     p.sendBlockChange(lastLoc, Material.GLOWSTONE, (byte) 0);
   } else if (lastLoc != null) {
     p.sendBlockChange(lastLoc, lastMat, lastData);
   }
 }
Esempio n. 5
0
  @Override
  public SkillResult use(Hero hero, LivingEntity target, String[] args) {
    Player player = hero.getPlayer();
    if (target.equals(player) || hero.getSummons().contains(target)) {
      return SkillResult.INVALID_TARGET;
    }

    long duration = SkillConfigManager.getUseSetting(hero, this, Setting.DURATION, 10000, false);
    long period = SkillConfigManager.getUseSetting(hero, this, Setting.PERIOD, 2000, true);
    int tickDamage = SkillConfigManager.getUseSetting(hero, this, "tick-damage", 1, false);
    BleedSkillEffect bEffect = new BleedSkillEffect(this, duration, period, tickDamage, player);

    if (target instanceof Player) {
      plugin.getHeroManager().getHero((Player) target).addEffect(bEffect);
    } else plugin.getEffectManager().addEntityEffect(target, bEffect);

    broadcastExecuteText(hero, target);
    return SkillResult.NORMAL;
  }
Esempio n. 6
0
 @Override
 public void apply(Hero hero) {
   super.apply(hero);
   Player player = hero.getPlayer();
   broadcast(player.getLocation(), applyText, player.getDisplayName());
 }
Esempio n. 7
0
 @Override
 public void remove(Hero hero) {
   super.remove(hero);
   Player player = hero.getPlayer();
   broadcast(player.getLocation(), expireText, player.getDisplayName());
 }