Files
MAPPET-ULTIMATE-WIKI/scripts/Ae/transparentOwnerMorphNbt-10.md

76 lines
1.9 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.
# Ae.js — transparentOwnerMorphNbt() (satır 808)
[← Ae.js](index.md) · [← Master](../../wiki.md)
Parça 10/38 · [önceki](transparentOwnerMorphNbt-9.md) · [sonraki](transparentOwnerMorphNbt-11.md)
```javascript
try { damage = c.getValue("damage"); } catch (e1) {}
if (damage !== null && damage !== undefined)
{
safeCancel(c);
if (isOwner(subject)) protectOwner(c, subject, state);
else protectAlly(c, subject, state);
saveState(state);
return true;
}
var eventHint = false;
try
{
eventHint = c.getValue("potion") != null || c.getValue("effect") != null;
}
catch (e2) {}
if (eventHint)
{
safeCancel(c);
if (isOwner(subject)) protectOwner(c, subject, state);
else protectAlly(c, subject, state);
saveState(state);
return true;
}
return false;
}
function forceOwnerProtectionEvent(c)
{
var state = loadState();
if (!state.active) return false;
var subject = getPlayer(c);
if (!subject || !subject.getName || !isProtectedSideName(subject.getName(), state)) return false;
safeCancel(c);
if (isOwner(subject)) protectOwner(c, subject, state);
else protectAlly(c, subject, state);
saveState(state);
return true;
}
function handleProtectedMorphEvent(c)
{
var state = loadState();
if (!state.active && !state.ownerVanished) return false;
var subject = getPlayer(c);
if (!subject || !subject.getName || !isProtectedSideName(subject.getName(), state)) return false;
if (isOwner(subject)) return handleOwnerMorphEvent(c, subject, state);
if (!state.active) return false;
safeCancel(c);
protectAlly(c, subject, state);
saveState(state);
return true;
}
function handleTargetRestrictionEvent(c)
{
var state = loadState();
if (!state.active) return false;
```