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 Protection from Evil <code>Enchantment</code>.
13   *
14   * @author Barrie Treloar
15   * @version $Revision: 1.1 $
16   */
17  public class ProtectionFromEvilEnchantment extends EnchantmentImpl {
18      /*** Use serialVersionUID for interoperability. */
19      private static final long serialVersionUID = 1L;
20  
21      /*** The duration for <code>ProtectionFromEvilEnchantment</code>. */
22      private static final int DURATION = 3;
23  
24      /*** The description for <code>ProtectionFromEvilEnchantment</code>. */
25      private static final String DESCRIPTION =
26          "For this turn and the following 3 turns the subject of this spell "
27          + "is protected as if using a 'shield' spell, thus leaving both hands "
28          + "free. Concurrent 'shield' spells offer no further protection and "
29          + "compound 'protection from evil' spells merely overlap offering "
30          + "no extra cover.";
31  
32      /*** The name of the <code>ProtectionFromEvilEnchantment</code>. */
33      private static final String NAME = "Protection From Evil";
34  
35      /***
36       * Provided for serialization, do not use as a constructor.
37       */
38      protected ProtectionFromEvilEnchantment() {
39      }
40  
41      /***
42       * Creates a new <code>ProtectionFromEvilEnchantment</code> object.
43       *
44       * @param theCaster the <code>IBeing</code> casting the
45       *        <code>Enchantment</code>.
46       * @param theTarget the <code>IBeing</code> that is the target of the
47       *        <code>Enchantment</code>.
48       */
49      public ProtectionFromEvilEnchantment(
50          final IBeing theCaster, final IBeing theTarget
51      ) {
52          super(NAME, theCaster, theTarget);
53          setDuration(DURATION);
54          setDescription(DESCRIPTION);
55          setResistance(DamageType.getPhysicalDamageType());
56      }
57  }