- Added onDamageTaken to Ability

- Reworked AbilityGuard
- Added AbilityOrbBarrage
- Updated translation
- Updated onDamageTaken method calls
This commit is contained in:
Vidal committed 2026-02-03 05:43:50 -03:00
1 parent 0004029de9
commit 60b846b35e
11 files changed
+986 -86

No files matched your search

@@ -2,6 +2,7 @@ package kamkeel.npcs.controllers.data.ability;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import kamkeel.npcs.controllers.data.ability.type.AbilityGuard;
import kamkeel.npcs.controllers.data.telegraph.Telegraph;
import kamkeel.npcs.controllers.data.telegraph.TelegraphInstance;
import kamkeel.npcs.controllers.data.telegraph.TelegraphType;
@@ -148,6 +149,9 @@ public abstract class Ability implements IAbility {
public void onComplete(EntityLivingBase caster, EntityLivingBase target) {
}
public void onDamageTaken(EntityLivingBase caster, EntityLivingBase attacker, DamageSource source, float damage) {
}
/**
* Apply damage to an entity with ability hit event support.
* Fires the abilityHit script event, allowing scripts to modify or cancel the damage.
@@ -427,6 +431,17 @@ public abstract class Ability implements IAbility {
this::getActiveAnimationName, this::setActiveAnimationName)
.tab("Effects"));
if (this instanceof AbilityGuard) {
defs.add(FieldDef.animSubGui("ability.counterAnimation",
() -> ((AbilityGuard) this).getCounterAnimationId(),
(id) -> ((AbilityGuard) this).setCounterAnimationId(id),
() -> ((AbilityGuard) this).getCounterAnimationName(),
(name) -> ((AbilityGuard) this).setCounterAnimationName(name))
.tab("Effects")
.visibleWhen(() -> ((AbilityGuard) this).canCounter())
);
}
// Effects tab - Telegraph
TelegraphType tType = getTelegraphType();
if (tType != null && tType != TelegraphType.NONE) {