Package com.sucy.skill.dynamic
Class DynamicSkill
java.lang.Object
com.sucy.skill.api.skills.Skill
com.sucy.skill.dynamic.DynamicSkill
- All Implemented Interfaces:
PassiveSkill,SkillShot,IconHolder,org.bukkit.event.Listener
public class DynamicSkill
extends Skill
implements SkillShot, PassiveSkill, org.bukkit.event.Listener
A skill implementation for the Dynamic system
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleapplyImmediateBuff(double damage) booleancanCast()Checks whether the dynamic skill can be castvoidCancels the event causing a trigger to go offbooleancast(org.bukkit.entity.LivingEntity user, int level) Casts the skillbooleancast(org.bukkit.entity.LivingEntity user, int level, boolean force) Casts the skill if applicablebooleanstatic voidclearCastData(org.bukkit.entity.LivingEntity entity) Clears any stored cast data for the entityintgetActiveLevel(org.bukkit.entity.LivingEntity caster) Retrieves the active level of the caster for the skillprotected ObjectRetrieves an attribute while supporting dynamic skill attribute paths.protected StringgetAttrName(String key) Retrieves the formatted name of an attribute which ignores the dynamic path overhead.getCastData(org.bukkit.entity.LivingEntity caster) Retrieves the cast data for the castervoidinitialize(org.bukkit.entity.LivingEntity user, int level) Initializes any corresponding effects when the skill is unlocked/enabledbooleanisActive(org.bukkit.entity.LivingEntity caster) Checks whether the caster's passives are currently activebooleanisForced(org.bukkit.entity.LivingEntity user) voidload(mc.promcteam.engine.mccore.config.parse.DataSection config) Loads dynamic components in addition to the normal valuesvoidplayPreview(org.bukkit.entity.Player player, int level, int step) Plays the skill previews.voidregisterEvents(SkillAPI plugin) Registers needed events for the skill, ignoring any unused events for efficiencyvoidsave(mc.promcteam.engine.mccore.config.parse.DataSection config) Saves the skill back to the config, appending component data on top of the normal skill datavoidsetImmediateBuff(double value, boolean flat) voidstopEffects(org.bukkit.entity.LivingEntity user, int level) Removes active users from the mapvoidupdate(org.bukkit.entity.LivingEntity user, int prevLevel, int newLevel) Updates the skill effectsMethods inherited from class com.sucy.skill.api.skills.Skill
canAutoLevel, clearCombo, cooldownMessage, damage, damage, damage, damage, format, getCombo, getCooldown, getCost, getDescription, getIcon, getIndicator, getIndicator, getKey, getLevelReq, getManaCost, getMaxLevel, getMessage, getName, getRange, getSettings, getSkillReq, getSkillReqLevel, getToolIndicator, getType, hasCombo, hasDependency, hasInvestedEnough, hasMessage, hasSkillReq, isAllowed, isCompatible, isSkillDamage, needsPermission, sendMessage, setCombo, softSave, trueDamage
-
Constructor Details
-
DynamicSkill
Initializes a new dynamic skill- Parameters:
name- name of the skill
-
-
Method Details
-
getCastData
Retrieves the cast data for the caster- Parameters:
caster- caster to get the data for- Returns:
- cast data for the caster
-
clearCastData
public static void clearCastData(org.bukkit.entity.LivingEntity entity) Clears any stored cast data for the entity- Parameters:
entity- entity to clear cast data for
-
canCast
public boolean canCast()Checks whether the dynamic skill can be cast -
isActive
public boolean isActive(org.bukkit.entity.LivingEntity caster) Checks whether the caster's passives are currently active- Parameters:
caster- caster to check for- Returns:
- true if active, false otherwise
-
getActiveLevel
public int getActiveLevel(org.bukkit.entity.LivingEntity caster) Retrieves the active level of the caster for the skill- Parameters:
caster- caster of the skill- Returns:
- active level of the skill
-
cancelTrigger
public void cancelTrigger()Cancels the event causing a trigger to go off -
checkCancelled
public boolean checkCancelled() -
setImmediateBuff
public void setImmediateBuff(double value, boolean flat) -
applyImmediateBuff
public double applyImmediateBuff(double damage) -
registerEvents
Registers needed events for the skill, ignoring any unused events for efficiency- Parameters:
plugin- plugin reference
-
update
public void update(org.bukkit.entity.LivingEntity user, int prevLevel, int newLevel) Updates the skill effects- Specified by:
updatein interfacePassiveSkill- Parameters:
user- user to refresh the effect forprevLevel- previous skill levelnewLevel- new skill level
-
initialize
public void initialize(org.bukkit.entity.LivingEntity user, int level) Initializes any corresponding effects when the skill is unlocked/enabled- Specified by:
initializein interfacePassiveSkill- Parameters:
user- user to initialize the effects forlevel- skill level
-
stopEffects
public void stopEffects(org.bukkit.entity.LivingEntity user, int level) Removes active users from the map- Specified by:
stopEffectsin interfacePassiveSkill- Parameters:
user- user to stop the effects forlevel- skill level
-
isForced
public boolean isForced(org.bukkit.entity.LivingEntity user) -
cast
public boolean cast(org.bukkit.entity.LivingEntity user, int level, boolean force) Casts the skill if applicable -
cast
public boolean cast(org.bukkit.entity.LivingEntity user, int level) Description copied from interface:SkillShotCasts the skill -
playPreview
public void playPreview(org.bukkit.entity.Player player, int level, int step) Plays the skill previews. This should be implemented by each skill.- Overrides:
playPreviewin classSkill- Parameters:
player- player to base location onlevel- the level of the skill to create forstep- the current progress of the indicator
-
getAttrName
Retrieves the formatted name of an attribute which ignores the dynamic path overhead.- Overrides:
getAttrNamein classSkill- Parameters:
key- attribute key- Returns:
- formatted attribute name
-
getAttr
Retrieves an attribute while supporting dynamic skill attribute paths. Paths are set up by the "icon-key" setting in components. An invalid path will instead return a value of 0. If a path is not provided, this returns a normal attribute on the skill. -
load
public void load(mc.promcteam.engine.mccore.config.parse.DataSection config) Loads dynamic components in addition to the normal values -
save
public void save(mc.promcteam.engine.mccore.config.parse.DataSection config) Saves the skill back to the config, appending component data on top of the normal skill data
-