mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-07 22:16:44 +01:00
Move feed ability to the secondary slot for changelings and make the dispell ability available
This commit is contained in:
parent
b5f41d2244
commit
34065d3919
6 changed files with 26 additions and 14 deletions
|
@ -47,7 +47,7 @@ public interface Abilities {
|
||||||
|
|
||||||
// changeling
|
// changeling
|
||||||
Ability<?> DISGUISE = register(new ChangelingDisguiseAbility(), "disguise", AbilitySlot.SECONDARY);
|
Ability<?> DISGUISE = register(new ChangelingDisguiseAbility(), "disguise", AbilitySlot.SECONDARY);
|
||||||
Ability<?> FEED = register(new ChangelingFeedAbility(), "feed", AbilitySlot.TERTIARY);
|
Ability<?> FEED = register(new ChangelingFeedAbility(), "feed", AbilitySlot.SECONDARY);
|
||||||
|
|
||||||
// bat
|
// bat
|
||||||
Ability<?> HANG = register(new BatPonyHangAbility(), "hang", AbilitySlot.SECONDARY);
|
Ability<?> HANG = register(new BatPonyHangAbility(), "hang", AbilitySlot.SECONDARY);
|
||||||
|
|
|
@ -41,7 +41,10 @@ public class PegasusFlightToggleAbility implements Ability<Hit> {
|
||||||
@Override
|
@Override
|
||||||
public Identifier getIcon(Pony player, boolean swap) {
|
public Identifier getIcon(Pony player, boolean swap) {
|
||||||
Identifier id = Abilities.REGISTRY.getId(this);
|
Identifier id = Abilities.REGISTRY.getId(this);
|
||||||
return new Identifier(id.getNamespace(), "textures/gui/ability/" + id.getPath() + (player.getPhysics().isFlying() ? "_land" : "_takeoff") + ".png");
|
return new Identifier(id.getNamespace(), "textures/gui/ability/" + id.getPath()
|
||||||
|
+ (player.getPhysics().isFlying() ? "_land" : "_takeoff")
|
||||||
|
+ (player.getSpecies() == Race.CHANGELING ? "_changeling" : "")
|
||||||
|
+ ".png");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -14,6 +14,7 @@ import com.minelittlepony.unicopia.util.TraceHelper;
|
||||||
import com.minelittlepony.unicopia.util.VecHelper;
|
import com.minelittlepony.unicopia.util.VecHelper;
|
||||||
|
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
|
import net.minecraft.util.Identifier;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dispells an active spell
|
* Dispells an active spell
|
||||||
|
@ -32,7 +33,13 @@ public class UnicornDispellAbility implements Ability<Pos> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canUse(Race race) {
|
public boolean canUse(Race race) {
|
||||||
return race.canCast();
|
return race.canCast() || race == Race.CHANGELING;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Identifier getIcon(Pony player, boolean swap) {
|
||||||
|
Identifier id = Abilities.REGISTRY.getId(this);
|
||||||
|
return new Identifier(id.getNamespace(), "textures/gui/ability/" + id.getPath() + (player.getSpecies() == Race.CHANGELING ? "_changeling" : "") + ".png");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -43,19 +50,21 @@ public class UnicornDispellAbility implements Ability<Pos> {
|
||||||
@Override
|
@Override
|
||||||
public boolean onQuickAction(Pony player, ActivationType type) {
|
public boolean onQuickAction(Pony player, ActivationType type) {
|
||||||
|
|
||||||
if (type.getTapCount() > 1) {
|
if (player.getSpecies() != Race.CHANGELING) {
|
||||||
player.setAnimation(Animation.WOLOLO, 10);
|
if (type.getTapCount() > 1) {
|
||||||
if (player.getSpellSlot().clear()) {
|
player.setAnimation(Animation.WOLOLO, 10);
|
||||||
player.getMaster().sendMessage(Text.translatable("gui.unicopia.action.spells_cleared"), true);
|
if (player.getSpellSlot().clear()) {
|
||||||
} else {
|
player.getMaster().sendMessage(Text.translatable("gui.unicopia.action.spells_cleared"), true);
|
||||||
player.getMaster().sendMessage(Text.translatable("gui.unicopia.action.no_spells_cleared"), true);
|
} else {
|
||||||
|
player.getMaster().sendMessage(Text.translatable("gui.unicopia.action.no_spells_cleared"), true);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (type == ActivationType.TAP && player.isClient()) {
|
if (type == ActivationType.TAP && player.isClient()) {
|
||||||
InteractionManager.instance().openScreen(InteractionManager.SCREEN_DISPELL_ABILITY);
|
InteractionManager.instance().openScreen(InteractionManager.SCREEN_DISPELL_ABILITY);
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 5.2 KiB |
Binary file not shown.
After Width: | Height: | Size: 5.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 5.3 KiB |
Loading…
Reference in a new issue