View Javadoc

1   /*
2   @See License.txt@
3    */
4   package spellcast.enchantment;
5   
6   import spellcast.beings.IBeing;
7   import spellcast.beings.IWizard;
8   
9   
10  /***
11   * The Permanency <code>Enchantment</code>.
12   *
13   * @author Barrie Treloar
14   * @version $Revision: 1.1 $
15   */
16  public class PermanencyEnchantment extends EnchantmentImpl {
17      /*** Use serialVersionUID for interoperability. */
18      private static final long serialVersionUID = 1L;
19  
20      /*** The duration for <code>PermanencyEnchantment</code>. */
21      private static final int DURATION = 3;
22  
23      /*** The description for <code>PermanencyEnchantment</code>. */
24      private static final String DESCRIPTION =
25          "This spell only works if cast upon a wizard. The next spell he "
26          + "completes, provided it is on this turn or one of the next 3, and "
27          + "which falls into the category of 'Enchantments' (except "
28          + "'anti-spell', 'disease', 'poison', or 'time-stop') will have its "
29          + "effect made permanent. This means that the effect of the extended "
30          + "spell on the first turn of its duration is repeated eternally. "
31          + "For example, a 'confusion' spell will be the same gesture rather "
32          + "than re-rolling the dice, a 'charm person' will mean repetition of "
33          + "the chosen gesture, etc. If the subject of the 'permanency' casts "
34          + "more than one spell at the same time eligible for permanency, he "
35          + "chooses which has its duration extended. Note that the person who "
36          + "has his spell made permanent does not necessarily have to make "
37          + "himself the subject of the spell. A 'permanency' spell cannot "
38          + "increase its own duration, nor the duration of spells saved by a "
39          + "'delayed effect' (so if both a 'permanency' and 'delayed effect' "
40          + "are eligible for the same spell to be banked or extended, a choice "
41          + "must be made, the losing spell being neutralized and working on the "
42          + "next spell instead).";
43  
44      /*** The name of the <code>PermanencyEnchantment</code>. */
45      private static final String NAME = "Permanency";
46  
47      /***
48       * Provided for serialization, do not use as a constructor.
49       */
50      protected PermanencyEnchantment() {
51      }
52  
53      /***
54       * Creates a new <code>PermanencyEnchantment</code> object.
55       *
56       * @param theCaster the <code>IBeing</code> casting the
57       *        <code>Enchantment</code>.
58       * @param theTarget the <code>IWizard</code> that is the target of the
59       *        <code>Enchantment</code>.
60       */
61      public PermanencyEnchantment(
62          final IBeing theCaster, final IWizard theTarget
63      ) {
64          super(NAME, theCaster, theTarget);
65          setDuration(DURATION);
66          setDescription(DESCRIPTION);
67      }
68  }