public interface MageSpell extends Spell, CostReducer
The implementations of Mage and MageController in the MagicPlugin will adhere to this interface.
The external MagicPlugin base classes for spells are available to use in MagicLib:
http://jenkins.elmakers.com/job/MagicLib/doxygen/
If you wish to create a new custom Spell from scratch, it is much easier (and more consistent) to start withe the BaseSpell class or one of its decendents.
Classes like TargetingSpell, BrushSpell, UndoableSpell all provide a wide range of common functionality that will make sure your spell works just like all the builtins. All of these classes are available in MagicLib, and should remain relatively stable, though MagicLib is not considered a strong API as such.
| Modifier and Type | Method and Description |
|---|---|
void |
activate() |
boolean |
deactivate() |
boolean |
deactivate(boolean force,
boolean quiet) |
Double |
getAttribute(String attributeKey) |
Mage |
getMage() |
long |
getMaxTimeToCast() |
SpellData |
getSpellData() |
Long |
getTimeToCast() |
void |
initialize(MageController controller) |
default void |
load(SpellData spellData)
Deprecated.
|
default void |
save(SpellData spellData)
Deprecated.
|
void |
setActive(boolean active) |
void |
setMage(Mage mage) |
void |
setSpellData(SpellData data) |
void |
tick() |
void |
updateTemplateParameters()
Force a reload of a subset of special parameters that may appear in spell lore.
|
brushIsErase, canCast, cancel, cancelOnCastOther, cancelOnDamage, cancelOnDeactivate, cancelOnDeath, cancelOnNoPermission, cancelOnNoWand, cancelOnWorldChange, cancelSelection, canContinue, canTarget, cast, cast, cast, cast, cast, cast, castMessage, castMessageKey, clearCooldown, finish, getBrush, getChargesRemaining, getController, getCurrentCast, getDirection, getEffectColor, getEffectMaterial, getEffectParticle, getEntity, getEyeLocation, getHandlerParameters, getLastCast, getLocation, getMessage, getProgressLevel, getRemainingCooldown, getRequiredCost, getTargetEntity, getTargetLocation, getVariables, getVariableScope, getWorkingParameters, hasBrushOverride, hasHandlerParameters, isActive, isCancellable, isDisguiseRestricted, isEnabled, isPvpRestricted, messageTargets, playEffects, playEffects, playEffects, reactivate, reduceRemainingCooldown, reloadParameters, requiresBreakPermission, requiresBuildPermission, sendMessage, sendMessageKey, setEnabled, setRemainingCooldown, stop, targetaddLore, createMageSpell, createSpell, disableManaRegenerationWhenActive, getActiveCosts, getAlias, getCastCount, getCategory, getCategoryPermissionNode, getChargeRegeneration, getColor, getConfiguration, getCooldown, getCooldownDescription, getCost, getCosts, getCreator, getCreatorId, getDescription, getDisabledIcon, getDisabledIconURL, getDuration, getDurationDescription, getEarns, getEffects, getEffects, getExtendedDescription, getGlyph, getIcon, getIconURL, getKey, getLevelDescription, getMageCooldownDescription, getMaxCharges, getMaxProgressLevel, getName, getParameterOptions, getParameters, getPermissionNode, getPrerequisiteSpells, getRange, getRequiredUpgradeCasts, getRequiredUpgradePath, getRequiredUpgradeTags, getRequirements, getSpellKey, getSpellParameters, getSpellsToRemove, getTriggers, getUpgrade, getUpgradeDescription, getUsage, getWorth, hasAnyTag, hasCastPermission, hasIcon, hasTag, isHidden, isPassive, isQuickCast, isQuiet, isScheduledUndo, isToggleable, isUndoable, loadPrerequisites, loadTemplate, setCastCount, showBrush, showUndoable, usesBrush, usesBrushSelectioncompareTogetConsumeReduction, getCostReduction, getCostScale, isConsumeFree, isCostFreevoid activate()
boolean deactivate()
boolean deactivate(boolean force,
boolean quiet)
void setActive(boolean active)
void setMage(Mage mage)
Mage getMage()
SpellData getSpellData()
void setSpellData(SpellData data)
void tick()
void initialize(MageController controller)
void updateTemplateParameters()
This may be needed after having updated a Mage's attributes, if those attributes are used in parameters such as cooldown, duration or cost_reduction.
long getMaxTimeToCast()
@Deprecated default void save(SpellData spellData)
@Deprecated default void load(SpellData spellData)
Copyright © 2021 elMakers. All rights reserved.