v0.8.0: fixed various errors with life link
This commit is contained in:
@@ -423,7 +423,7 @@ public abstract class Char extends Actor {
|
|||||||
link.detach();
|
link.detach();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dmg /= (links.size()+1);
|
dmg = (int)Math.ceil(dmg / (float)(links.size()+1));
|
||||||
for (LifeLink link : links){
|
for (LifeLink link : links){
|
||||||
Char ch = (Char)Actor.findById(link.object);
|
Char ch = (Char)Actor.findById(link.object);
|
||||||
ch.damage(dmg, LifeLink.class);
|
ch.damage(dmg, LifeLink.class);
|
||||||
|
|||||||
+15
@@ -21,6 +21,8 @@
|
|||||||
|
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
|
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||||
import com.watabou.utils.Bundle;
|
import com.watabou.utils.Bundle;
|
||||||
@@ -36,6 +38,19 @@ public class LifeLink extends FlavourBuff {
|
|||||||
announced = true;
|
announced = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void detach() {
|
||||||
|
super.detach();
|
||||||
|
Char ch = (Char)Actor.findById(object);
|
||||||
|
if (!target.isAlive() && ch != null){
|
||||||
|
for (LifeLink l : ch.buffs(LifeLink.class)){
|
||||||
|
if (l.object == target.id()){
|
||||||
|
l.detach();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void storeInBundle( Bundle bundle ) {
|
public void storeInBundle( Bundle bundle ) {
|
||||||
super.storeInBundle( bundle );
|
super.storeInBundle( bundle );
|
||||||
|
|||||||
Reference in New Issue
Block a user