Class Spell
java.lang.Object
Spell
Magic spell class.
- Since:
- 2018-12-06
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate static class
Area of effect descriptor.static enum
Mode enumeration.static enum
Area shapes. -
Field Summary
Modifier and TypeFieldDescription(package private) Spell.AreaOfEffect
Area of effect.(package private) SpellCasting.Casting
Game-sim casting formula.(package private) int
Duration in turns (1-minute unit).(package private) int
Level of the spell.(package private) Spell.Mode
Mode of usage.(package private) String
Name of the spell.(package private) int
Range in inches (5-foot unit). -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Cast this spell to help against enemy party.int
Get the duration.int
getLevel()
Get the level.int
Expose casting max targets number.int
Get max targets in area of spell.getMode()
Get the mode.getName()
Get the name.int
getRange()
Get the range.getShape()
Get the shape.int
getSize()
Get the size.boolean
Is this spell an area-effect type?boolean
Does this spell have a casting formula usable in the sim?boolean
isThreatTo
(Monster monster) Expose is-threat to monster check.static void
Main test function.private static Spell.AreaOfEffect
Parse area of effect descriptor.private static int
Parse a duration descriptor.private static Spell.Mode
Parse a mode descriptor.private static int
parseRange
(String s) Parse a range descriptor.private static Spell.Shape
parseShape
(String s) Parse area shape from descriptor.private static int
Parse area size from descriptor.void
Set the game-sim casting formula, if available.toString()
Identify this object as a string.
-
Field Details
-
name
String nameName of the spell. -
level
int levelLevel of the spell. -
range
int rangeRange in inches (5-foot unit). -
duration
int durationDuration in turns (1-minute unit). -
area
Spell.AreaOfEffect areaArea of effect. -
mode
Spell.Mode modeMode of usage. -
casting
SpellCasting.Casting castingGame-sim casting formula.
-
-
Constructor Details
-
Spell
Spell(String[] s) Constructor (from string descriptor).
-
-
Method Details
-
parseRange
Parse a range descriptor. -
parseDuration
Parse a duration descriptor. -
parseMode
Parse a mode descriptor. -
parseArea
Parse area of effect descriptor. -
parseShape
Parse area shape from descriptor. -
parseSize
Parse area size from descriptor. -
getName
Get the name. -
getLevel
public int getLevel()Get the level. -
getRange
public int getRange()Get the range. -
getDuration
public int getDuration()Get the duration. -
getShape
Get the shape. -
getSize
public int getSize()Get the size. -
getMode
Get the mode. -
getMaxTargetsInArea
public int getMaxTargetsInArea()Get max targets in area of spell. Assumes all targets are man-sized (1 inch space). -
isAreaEffect
public boolean isAreaEffect()Is this spell an area-effect type? -
setCasting
Set the game-sim casting formula, if available. -
isCastable
public boolean isCastable()Does this spell have a casting formula usable in the sim? -
getMaxTargetNum
public int getMaxTargetNum()Expose casting max targets number. -
isThreatTo
Expose is-threat to monster check. -
cast
Cast this spell to help against enemy party. -
toString
Identify this object as a string. -
main
Main test function.
-