Abilities

This page shows a way you could further build onto the framework and customize abilities.

Ability attributes

What I like to do for customizing abilities is adding an abstract class to handle ability attributes and then extending all my abilities off of my own class. This would be an example of my own AbilityAttributes class:

import com.jewishbanana.uiframework.items.Ability;

public abstract class AbilityAttributes extends Ability {
	
	protected double damage;
	protected double range;
	protected double knockbackMultiplier;
	
	public double getDamage() {
		return damage;
	}
	public void setDamage(double damage) {
		this.damage = damage;
	}
	public double getRange() {
		return range;
	}
	public void setRange(double range) {
		this.range = range;
	}
	public double getKnockbackMultiplier() {
		return knockbackMultiplier;
	}
	public void setKnockbackMultiplier(double knockbackMultiplier) {
		this.knockbackMultiplier = knockbackMultiplier;
	}
}

This gives me the ability to extend my ability classes to this and modify some extra attributes that can be configurable in the config. For example:

Now you can easily fetch and cast your abilities from the AbilityType class to configure your custom attributes like this:

Last updated