mirror of
https://gitlab.com/phoenix-dvpmt/mmocore.git
synced 2024-11-26 00:35:17 +01:00
Fixed passive skills being castable thru combos
This commit is contained in:
parent
e17a8f903a
commit
1661b8d6eb
@ -15,8 +15,11 @@ public class BoundSkillInfo implements Closeable {
|
|||||||
private final ClassSkill classSkill;
|
private final ClassSkill classSkill;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PASSIVE skills must be registered inside MythicLib when
|
* Non-permanent passive skills must be registered inside
|
||||||
* bound. When set to null, the skill is not registered.
|
* MythicLib when bound. When set to null, the skill is either
|
||||||
|
* active or permanent passive.
|
||||||
|
* <p>
|
||||||
|
* This does NOT indicate the skill being passive!
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
private final PassiveSkill registered;
|
private final PassiveSkill registered;
|
||||||
@ -55,7 +58,7 @@ public class BoundSkillInfo implements Closeable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isPassive() {
|
public boolean isPassive() {
|
||||||
return registered != null;
|
return classSkill.getSkill().getTrigger().isPassive();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -63,7 +66,7 @@ public class BoundSkillInfo implements Closeable {
|
|||||||
Validate.isTrue(open, "BoundSkillInfo has already been closed");
|
Validate.isTrue(open, "BoundSkillInfo has already been closed");
|
||||||
open = false;
|
open = false;
|
||||||
|
|
||||||
// Unregister skill if passive
|
// Unregister skill if non-permanent passive
|
||||||
if (registered != null) registered.unregister(playerData.getMMOPlayerData());
|
if (registered != null) registered.unregister(playerData.getMMOPlayerData());
|
||||||
|
|
||||||
// Remove skill buffs associated to the slot
|
// Remove skill buffs associated to the slot
|
||||||
|
@ -12,6 +12,7 @@ import net.Indyuce.mmocore.MMOCore;
|
|||||||
import net.Indyuce.mmocore.api.event.PlayerKeyPressEvent;
|
import net.Indyuce.mmocore.api.event.PlayerKeyPressEvent;
|
||||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
import net.Indyuce.mmocore.api.player.PlayerData;
|
||||||
import net.Indyuce.mmocore.gui.api.item.Placeholders;
|
import net.Indyuce.mmocore.gui.api.item.Placeholders;
|
||||||
|
import net.Indyuce.mmocore.skill.ClassSkill;
|
||||||
import net.Indyuce.mmocore.skill.cast.*;
|
import net.Indyuce.mmocore.skill.cast.*;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
@ -146,9 +147,11 @@ public class KeyCombos extends SkillCastingHandler {
|
|||||||
else playerData.leaveSkillCasting(true);
|
else playerData.leaveSkillCasting(true);
|
||||||
|
|
||||||
// Cast spell
|
// Cast spell
|
||||||
if (playerData.hasSkillBound(spellSlot)) {
|
final ClassSkill boundSkill;
|
||||||
|
if (playerData.hasSkillBound(spellSlot) &&
|
||||||
|
!(boundSkill = playerData.getBoundSkill(spellSlot)).getSkill().getTrigger().isPassive()) {
|
||||||
final PlayerMetadata caster = playerData.getMMOPlayerData().getStatMap().cache(EquipmentSlot.MAIN_HAND);
|
final PlayerMetadata caster = playerData.getMMOPlayerData().getStatMap().cache(EquipmentSlot.MAIN_HAND);
|
||||||
final SkillResult result = playerData.getBoundSkill(spellSlot).toCastable(playerData).cast(new TriggerMetadata(caster, null, null));
|
final SkillResult result = boundSkill.toCastable(playerData).cast(new TriggerMetadata(caster, TriggerType.CAST, null, null));
|
||||||
if (!result.isSuccessful()) if (failSkillSound != null) failSkillSound.playTo(player);
|
if (!result.isSuccessful()) if (failSkillSound != null) failSkillSound.playTo(player);
|
||||||
} else if (stayIn) {
|
} else if (stayIn) {
|
||||||
if (failComboSound != null) failComboSound.playTo(player);
|
if (failComboSound != null) failComboSound.playTo(player);
|
||||||
|
Loading…
Reference in New Issue
Block a user