View Javadoc

1   /*
2   @See License.txt@
3    */
4   package spellcast.enchantment;
5   
6   import spellcast.beings.IBeing;
7   
8   import spellcast.damage.DamageType;
9   
10  
11  /***
12   * The Resist Heat <code>Enchantment</code>.
13   *
14   * @author Barrie Treloar
15   * @version $Revision: 1.1 $
16   */
17  public class ResistHeatEnchantment extends EnchantmentImpl {
18      /*** Use serialVersionUID for interoperability. */
19      private static final long serialVersionUID = 1L;
20  
21      /*** The duration for <code>ResistHeatEnchantment</code>. */
22      private static final int DURATION = 0;
23  
24      /*** The description for <code>ResistHeatEnchantment</code>. */
25      private static final String DESCRIPTION =
26          "The subject of this spell becomes totally resistant to all forms "
27          + "of heat attack ('fireball', 'fire storm' and fire elementals). "
28          + "Only 'dispel magic' or 'remove enchantment' will terminate this "
29          + "resistance once started (although a 'counter-spell' will prevent "
30          + "it from working if cast at the subject at the same time as this "
31          + "spell). A 'resist heat' cast directly on a fire elemental will "
32          + "destroy it before it can attack that turn, but there is no effect "
33          + "on ice elementals.";
34  
35      /*** The name of the <code>ResistHeatEnchantment</code>. */
36      private static final String NAME = "Resist Heat";
37  
38      /***
39       * Provided for serialization, do not use as a constructor.
40       */
41      protected ResistHeatEnchantment() {
42      }
43  
44      /***
45       * Creates a new <code>ResistHeatEnchantment</code> object.
46       *
47       * @param theCaster the <code>IBeing</code> casting the
48       *        <code>Enchantment</code>.
49       * @param theTarget the <code>IBeing</code> that is the target of the
50       *        <code>Enchantment</code>.
51       */
52      public ResistHeatEnchantment(final IBeing theCaster, final IBeing theTarget) {
53          super(NAME, theCaster, theTarget);
54          setDuration(DURATION);
55          setDescription(DESCRIPTION);
56          setResistance(DamageType.getFireDamageType());
57          setPermanent(true);
58      }
59  }