Class ScriptedAbilityBuilder
java.lang.Object
de.gurkenlabs.litiengine.abilities.AbilityBuilder
de.gurkenlabs.litiengine.scripting.combat.ScriptedAbilityBuilder
Fluent builder for constructing and registering
ScriptedAbility instances.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Constructs a new ability without adding it to the executor.Sets how the ability is cast.cooldown(int cooldownMs) Sets the cooldown after a successful cast.description(String description) Sets the player-facing description.Adds anEffectto this ability.impact(int impact) Sets the base impact used by the ability's effects.multiTarget(boolean multiTarget) Sets whether one execution may affect multiple targets.Sets a callback that does not need theAbilityExecutiondetails.onCast(Consumer<AbilityExecution> onCast) Sets the callback invoked when the ability is cast.range(int range) Sets the maximum cast range.value(int value) Sets the general-purpose value exposed through the ability attributes.Methods inherited from class AbilityBuilder
register
-
Constructor Details
-
ScriptedAbilityBuilder
-
-
Method Details
-
description
Description copied from class:AbilityBuilderSets the player-facing description.- Overrides:
descriptionin classAbilityBuilder- Parameters:
description- The description, ornullto use an empty description.- Returns:
- This builder.
-
cooldown
Description copied from class:AbilityBuilderSets the cooldown after a successful cast.- Overrides:
cooldownin classAbilityBuilder- Parameters:
cooldownMs- The cooldown in milliseconds; negative values are treated as zero.- Returns:
- This builder.
-
range
Description copied from class:AbilityBuilderSets the maximum cast range.- Overrides:
rangein classAbilityBuilder- Parameters:
range- The range in map units; negative values are treated as zero.- Returns:
- This builder.
-
impact
Description copied from class:AbilityBuilderSets the base impact used by the ability's effects.- Overrides:
impactin classAbilityBuilder- Parameters:
impact- The impact value; negative values are treated as zero.- Returns:
- This builder.
-
value
Description copied from class:AbilityBuilderSets the general-purpose value exposed through the ability attributes.- Overrides:
valuein classAbilityBuilder- Parameters:
value- The value to expose; unlike the other numeric attributes this may be negative.- Returns:
- This builder.
-
castType
Description copied from class:AbilityBuilderSets how the ability is cast.- Overrides:
castTypein classAbilityBuilder- Parameters:
castType- The cast type.- Returns:
- This builder.
-
multiTarget
Description copied from class:AbilityBuilderSets whether one execution may affect multiple targets.- Overrides:
multiTargetin classAbilityBuilder- Parameters:
multiTarget-trueto permit multiple targets.- Returns:
- This builder.
-
onCast
Description copied from class:AbilityBuilderSets the callback invoked when the ability is cast.- Overrides:
onCastin classAbilityBuilder- Parameters:
onCast- The callback, ornullto remove the current callback.- Returns:
- This builder.
-
onCast
Description copied from class:AbilityBuilderSets a callback that does not need theAbilityExecutiondetails.- Overrides:
onCastin classAbilityBuilder- Parameters:
onCast- The callback, ornullto remove the current callback.- Returns:
- This builder.
-
effect
Description copied from class:AbilityBuilderAdds anEffectto this ability.- Overrides:
effectin classAbilityBuilder- Parameters:
effect- The effect to attach.- Returns:
- This builder instance for chaining.
-
build
Description copied from class:AbilityBuilderConstructs a new ability without adding it to the executor.
Each invocation returns a new ability configured from the builder's current values.
- Overrides:
buildin classAbilityBuilder- Returns:
- A new, unregistered ability.
-