Last change
on this file since 8e945fc was 8edd04e, checked in by Dmitry Portnoy <dmitry.portnoy@…>, 5 years ago |
Make the decompiled game code compile successfully
|
-
Property mode
set to
100644
|
File size:
990 bytes
|
Line | |
---|
1 | package main;
|
---|
2 |
|
---|
3 | public class AttackSpeed extends TimedEffect {
|
---|
4 |
|
---|
5 | private double speedChange;
|
---|
6 |
|
---|
7 | public AttackSpeed(double speedChange, TargetType target, long duration) {
|
---|
8 | super(EffectType.AttackSpeed, target, duration);
|
---|
9 | this.speedChange = speedChange;
|
---|
10 | }
|
---|
11 |
|
---|
12 | public AttackSpeed(AttackSpeed e) {
|
---|
13 | super(e);
|
---|
14 | this.speedChange = e.speedChange;
|
---|
15 | }
|
---|
16 |
|
---|
17 | public AttackSpeed copy() {
|
---|
18 | return new AttackSpeed(this);
|
---|
19 | }
|
---|
20 |
|
---|
21 | public double getSpeedChange() {
|
---|
22 | return this.speedChange;
|
---|
23 | }
|
---|
24 |
|
---|
25 | public void applyEffect(Object o) {
|
---|
26 | Creature cr = (Creature)o;
|
---|
27 | cr.getWeapon().setAttackSpeed((int)(cr.getWeapon().getAttackSpeed() * this.speedChange));
|
---|
28 | cr.addEffect(this);
|
---|
29 | cr.passive++;
|
---|
30 | }
|
---|
31 |
|
---|
32 | public void cancelEffect(Object o) {
|
---|
33 | Creature cr = (Creature)o;
|
---|
34 | cr.getWeapon().setAttackSpeed((int)(cr.getWeapon().getAttackSpeed() / this.speedChange));
|
---|
35 | cr.passive--;
|
---|
36 | }
|
---|
37 |
|
---|
38 | public String toString() {
|
---|
39 | return Double.toString(this.speedChange);
|
---|
40 | }
|
---|
41 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.