Custom Ability Telegraph Controls, Inner Radius Fix

This commit is contained in:
Kam committed 2026-03-05 02:18:34 -05:00
1 parent dbca3da639
commit e309794fd7
8 files changed
+440 -43

No files matched your search

@@ -597,6 +597,18 @@ public abstract class Ability implements IAbility, IAbilityAction {
return 45.0f;
}
public float getTelegraphInnerRadius() {
return 0.0f;
}
/**
* Override to return true if the ability type manages its own telegraph GUI controls.
* When true, the base class will skip adding the default telegraph section.
*/
public boolean hasOwnTelegraphControls() {
return false;
}
/**
* Returns true if the caster is a player (not an NPC).
* Use this instead of checking {@code target != null} to make NPC/Player
@@ -875,7 +887,7 @@ public abstract class Ability implements IAbility, IAbilityAction {
.tab("Effects"));
TelegraphType tType = getTelegraphType();
if (tType != null && tType != TelegraphType.NONE) {
if (tType != null && tType != TelegraphType.NONE && !hasOwnTelegraphControls()) {
defs.add(FieldDef.section("ability.section.telegraph").tab("Effects")
.hover("telegraph." + tType.name().toLowerCase()));
defs.add(FieldDef.boolField("ability.showTelegraph", this::isShowTelegraph, this::setShowTelegraph)
@@ -1015,13 +1027,13 @@ public abstract class Ability implements IAbility, IAbilityAction {
telegraph = Telegraph.circle(getTelegraphRadius());
break;
case RING:
telegraph = Telegraph.ring(getTelegraphRadius(), getTelegraphRadius() * 0.5f);
telegraph = Telegraph.ring(getTelegraphRadius(), getTelegraphInnerRadius());
break;
case LINE:
telegraph = Telegraph.line(getTelegraphLength(), getTelegraphWidth());
break;
case CONE:
telegraph = Telegraph.cone(getTelegraphLength(), getTelegraphAngle());
telegraph = Telegraph.cone(getTelegraphLength(), getTelegraphAngle(), getTelegraphInnerRadius());
break;
case POINT:
telegraph = new Telegraph("", TelegraphType.POINT);