Files

35 lines
1.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Hector_Tudors.js — cast_drain() (satır 985)
[← Hector_Tudors.js](index.md) · [← Master](../../wiki.md)
```javascript
function cast_drain(c) {
var p = c.getPlayer(); if (!p) return;
if (guard(p, "drain")) return;
var w = c.getWorld(), pos = p.getPosition();
title(p, "§4§lCAN EMME", "§cçek!");
w.playSound("minecraft:entity.wither.hurt", pos.x, pos.y, pos.z, 1.5, 0.6);
var es = enemies(w, pos.x, pos.y + 1, pos.z, 8, p), healed = 0;
for (var i = 0; i < es.length; i++) {
var e = es[i], ep = e.getPosition();
hurt(e, 6, p); healed += 2;
for (var s = 0; s <= 6; s++) {
var f = s / 6;
fx(w, "reddust",
ep.x + (pos.x - ep.x) * f,
(ep.y + 1) + ((pos.y + 1) - (ep.y + 1)) * f,
ep.z + (pos.z - ep.z) * f, 2, 0.05, 0.05, 0.05, 0);
}
showHead(w, ep.x, ep.y + e.getHeight() + 0.3, ep.z, 1.0, 2);
}
if (healed > 0) {
try { p.setHp(Math.min(p.getMaxHp(), p.getHp() + healed)); } catch (e) {}
fx(w, "heart", pos.x, pos.y + 1.2, pos.z, 6, 0.5, 0.6, 0.5, 0);
p.sendActionBar("§a+ " + healed + " §7can emildi");
} else {
p.sendActionBar("§7Yakında düşman yok");
}
}
```