Added delay attacks and effects

This commit is contained in:
Light2
2013-09-15 18:48:13 +02:00
parent f15a390d0f
commit 654fa6b49f
5 changed files with 288 additions and 9 deletions
+13 -2
View File
@@ -33,7 +33,7 @@ import engine.clientdata.ClientFileManager;
import engine.clientdata.visitors.DatatableVisitor;
import engine.resources.common.CRC;
@Persistent(version=4)
@Persistent(version=5)
public class Buff implements IListObject {
@NotPersistent
@@ -56,6 +56,7 @@ public class Buff implements IListObject {
private boolean decayOnPvPDeath;
private long startTime;
private int totalPlayTime;
private byte decayCounter;
public Buff(String buffName, long ownerId) {
@@ -335,7 +336,9 @@ public class Buff implements IListObject {
long currentTime = System.currentTimeMillis();
long timeDiff = (currentTime - startTime) / 1000;
int remaining = (int) (duration - timeDiff);
System.out.println("Buff remaining: " + remaining);
for(int i = 0; i < decayCounter; i++) {
remaining /= 2;
}
return remaining;
}
@@ -348,4 +351,12 @@ public class Buff implements IListObject {
this.totalPlayTime = totalPlayTime;
}
public byte getDecayCounter() {
return decayCounter;
}
public void incDecayCounter(byte decayCounter) {
this.decayCounter++;
}
}