source: lost-haven/main/ManaDrain.java@ 8edd04e

Last change on this file since 8edd04e was 8edd04e, checked in by Dmitry Portnoy <dmitry.portnoy@…>, 4 years ago

Make the decompiled game code compile successfully

  • Property mode set to 100644
File size: 693 bytes
Line 
1package main;
2
3public class ManaDrain extends Effect {
4
5 private int mana;
6
7 public ManaDrain(int mana, TargetType target) {
8 super(EffectType.ManaDrain, target);
9 this.mana = mana;
10 }
11
12 public ManaDrain(ManaDrain e) {
13 super(e);
14 this.mana = e.mana;
15 }
16
17 public ManaDrain copy() {
18 return new ManaDrain(this);
19 }
20
21 public int getMana() {
22 return this.mana;
23 }
24
25 public void applyEffect(Object o) {
26 Creature cr = (Creature)o;
27 cr.setManapoints(cr.getManapoints() - this.mana);
28 if (cr.getManapoints() < 0) {
29 cr.setManapoints(0);
30 } else if (cr.getManapoints() > cr.getMaxManapoints()) {
31 cr.setManapoints(cr.getMaxManapoints());
32 }
33 }
34}
Note: See TracBrowser for help on using the repository browser.