v0.8.0: fixed various errors with life link
This commit is contained in:
parent
ea563afd40
commit
ac8d44c6fd
core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors
|
@ -423,7 +423,7 @@ public abstract class Char extends Actor {
|
|||
link.detach();
|
||||
}
|
||||
}
|
||||
dmg /= (links.size()+1);
|
||||
dmg = (int)Math.ceil(dmg / (float)(links.size()+1));
|
||||
for (LifeLink link : links){
|
||||
Char ch = (Char)Actor.findById(link.object);
|
||||
ch.damage(dmg, LifeLink.class);
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
|
||||
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.ui.BuffIndicator;
|
||||
import com.watabou.utils.Bundle;
|
||||
|
@ -36,6 +38,19 @@ public class LifeLink extends FlavourBuff {
|
|||
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
|
||||
public void storeInBundle( Bundle bundle ) {
|
||||
super.storeInBundle( bundle );
|
||||
|
|
Loading…
Reference in New Issue
Block a user