source: lost-haven/main/ChangeDamage.java

Last change on this file 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: 1.0 KB
RevLine 
[8edd04e]1package main;
2
3public class ChangeDamage extends TimedEffect {
4
5 private double damageChange;
6
7 public ChangeDamage(double damageChange, TargetType target, long duration) {
8 super(EffectType.ChangeDamage, target, duration);
9 this.damageChange = damageChange;
10 }
11
12 public ChangeDamage(ChangeDamage e) {
13 super(e);
14 this.damageChange = e.damageChange;
15 }
16
17 public ChangeDamage copy() {
18 return new ChangeDamage(this);
19 }
20
21 public double getDamageChange() {
22 return this.damageChange;
23 }
24
25 public void setDamageChange(int damageChange) {
26 this.damageChange = damageChange;
27 }
28
29 public void applyEffect(Object o) {
30 Creature cr = (Creature)o;
31 EquippedWeapon weap = cr.getWeapon();
32 weap.setDamage((int)(weap.getDamage() * this.damageChange));
33 cr.addEffect(this);
34 cr.passive++;
35 }
36
37 public void cancelEffect(Object o) {
38 Creature cr = (Creature)o;
39 EquippedWeapon weap = cr.getWeapon();
40 weap.setDamage((int)(weap.getDamage() / this.damageChange));
41 cr.passive--;
42 }
43}
Note: See TracBrowser for help on using the repository browser.