Class SpellCasting
java.lang.Object
SpellCasting
Code to handle casting spells in the combat simulator.
Compare use of Casting classes here to the Strategy pattern.
Some implementations will be rough approximations of the real spell.
- Since:
- 2021-12-18
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Casting abstract base class.(package private) static class
Charm Monster spell effect.(package private) static class
Charm Person spell effect.(package private) static class
Cloudkill spell effect.(package private) static class
Confusion spell effect.(package private) static class
Conjure Elemental effect.(package private) static class
Darkness spell effect.(package private) static class
Death Spell effect.(package private) static class
Disintegrate spell effect.(package private) static class
Dispel Magic effect.(package private) static class
Fear spell effect.(package private) static class
Feeblemind effect.(package private) static class
Fireball spell effect.(package private) static class
Hold Monster spell effect.(package private) static class
Hold Person spell effect.(package private) static class
Ice Storm spell effect.(package private) static class
Lightning Bolt spell effect.(package private) static class
Magic Missile spell effect.(package private) static class
Polymorph Other spell effect.(package private) static class
Sleep spell effect.(package private) static class
Suggestion spell effect.(package private) static class
Web spell effect. -
Field Summary
Modifier and TypeFieldDescriptionprivate static final SpellCasting.Casting[]
List of available castings.private static final int
Infinity integer.private static final int
Code to compute num affected by area. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
linkSpellWithCasting
(Spell spell) Try to link a spell with its casting formula.static void
Main test function.
-
Field Details
-
INF
private static final int INFInfinity integer.- See Also:
-
NUM_BY_AREA
private static final int NUM_BY_AREACode to compute num affected by area.- See Also:
-
castingFormula
List of available castings.
-
-
Constructor Details
-
SpellCasting
public SpellCasting()
-
-
Method Details
-
linkSpellWithCasting
Try to link a spell with its casting formula.- Returns:
- true if casting was found.
-
main
Main test function.
-