v0.3.1b: refactored paralysis, now works properly when there are multiple paralysis sources
This commit is contained in:
@@ -36,7 +36,7 @@ public class Paralysis extends FlavourBuff {
|
||||
@Override
|
||||
public boolean attachTo( Char target ) {
|
||||
if (super.attachTo( target )) {
|
||||
target.paralysed = true;
|
||||
target.paralysed++;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@@ -46,7 +46,8 @@ public class Paralysis extends FlavourBuff {
|
||||
@Override
|
||||
public void detach() {
|
||||
super.detach();
|
||||
unfreeze(target);
|
||||
if (target.paralysed > 0)
|
||||
target.paralysed--;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -79,12 +80,4 @@ public class Paralysis extends FlavourBuff {
|
||||
Resistance r = ch.buff( Resistance.class );
|
||||
return r != null ? r.durationFactor() * DURATION : DURATION;
|
||||
}
|
||||
|
||||
public static void unfreeze( Char ch ) {
|
||||
if (ch.buff( Paralysis.class ) == null &&
|
||||
ch.buff( Frost.class ) == null) {
|
||||
|
||||
ch.paralysed = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user