v0.9.4: refactored char interaction and fixed it reducing momentum.
This commit is contained in:
@@ -47,6 +47,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hex;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LifeLink;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LifeLink;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicalSleep;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicalSleep;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Momentum;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Ooze;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Ooze;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Poison;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Poison;
|
||||||
@@ -191,13 +192,13 @@ public abstract class Char extends Actor {
|
|||||||
int curPos = pos;
|
int curPos = pos;
|
||||||
|
|
||||||
//warp instantly with allies in this case
|
//warp instantly with allies in this case
|
||||||
if (Dungeon.hero.hasTalent(Talent.ALLY_WARP)){
|
if (c == Dungeon.hero && Dungeon.hero.hasTalent(Talent.ALLY_WARP)){
|
||||||
PathFinder.buildDistanceMap(c.pos, BArray.or(Dungeon.level.passable, Dungeon.level.avoid, null));
|
PathFinder.buildDistanceMap(c.pos, BArray.or(Dungeon.level.passable, Dungeon.level.avoid, null));
|
||||||
if (PathFinder.distance[pos] == Integer.MAX_VALUE){
|
if (PathFinder.distance[pos] == Integer.MAX_VALUE){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
ScrollOfTeleportation.appear(this, Dungeon.hero.pos);
|
ScrollOfTeleportation.appear(this, c.pos);
|
||||||
ScrollOfTeleportation.appear(Dungeon.hero, curPos);
|
ScrollOfTeleportation.appear(c, curPos);
|
||||||
Dungeon.observe();
|
Dungeon.observe();
|
||||||
GameScene.updateFog();
|
GameScene.updateFog();
|
||||||
return true;
|
return true;
|
||||||
@@ -208,14 +209,21 @@ public abstract class Char extends Actor {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
moveSprite( pos, Dungeon.hero.pos );
|
moveSprite( pos, c.pos );
|
||||||
move( Dungeon.hero.pos );
|
move( c.pos );
|
||||||
|
|
||||||
Dungeon.hero.sprite.move( Dungeon.hero.pos, curPos );
|
c.sprite.move( c.pos, curPos );
|
||||||
Dungeon.hero.move( curPos );
|
c.move( curPos );
|
||||||
|
|
||||||
Dungeon.hero.spend( 1 / Dungeon.hero.speed() );
|
c.spend( 1 / c.speed() );
|
||||||
Dungeon.hero.busy();
|
|
||||||
|
if (c == Dungeon.hero){
|
||||||
|
if (Dungeon.hero.subClass == HeroSubClass.FREERUNNER){
|
||||||
|
Buff.affect(Dungeon.hero, Momentum.class).gainStack();
|
||||||
|
}
|
||||||
|
|
||||||
|
Dungeon.hero.busy();
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user