v2.1.1: big consistency pass on rooted. Now prevents dash, blink, & leap

This commit is contained in:
Evan Debenham
2023-06-09 12:27:33 -04:00
parent 2ff3e26bbc
commit 70f5b796e0
11 changed files with 42 additions and 4 deletions

View File

@@ -347,7 +347,7 @@ actors.buffs.revealedchar.desc=This character is revealed to the hero, They will
actors.buffs.roots.name=rooted
actors.buffs.roots.heromsg=You can't move!
actors.buffs.roots.desc=Roots (magical or natural) grab at the feet, forcing them down to the ground.\n\nRoots lock a target in place, making it impossible for them to move, but other actions are not affected.\n\nTurns of root remaining: %s.
actors.buffs.roots.desc=Roots (magical or natural) grab at the feet, forcing them down to the ground.\n\nRoots lock a target in place, making movement and most movement abilities impossible. Other actions are not affected, including teleportation effects.\n\nTurns of root remaining: %s.
actors.buffs.scrollempower.name=scroll empower
actors.buffs.scrollempower.desc=The energy from the Mage's recently read scroll is empowering his wands!\n\nLevel Boost: +%1$d.\nZaps remaining: %2$d.

View File

@@ -45,6 +45,7 @@ import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndCombo;
import com.watabou.noosa.BitmapText;
import com.watabou.noosa.Camera;
import com.watabou.noosa.Image;
import com.watabou.noosa.Visual;
import com.watabou.noosa.audio.Sample;
@@ -473,6 +474,9 @@ public class Combo extends Buff implements ActionIndicator.Action {
final int leapPos = c.path.get(c.dist-1);
if (!Dungeon.level.passable[leapPos]){
GLog.w(Messages.get(Combo.class, "bad_target"));
} else if (Dungeon.hero.rooted) {
Camera.main.shake( 1, 1f );
GLog.w(Messages.get(Combo.class, "bad_target"));
} else {
Dungeon.hero.busy();
target.sprite.jump(target.pos, leapPos, new Callback() {

View File

@@ -50,6 +50,7 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndMonkAbilities;
import com.watabou.noosa.BitmapText;
import com.watabou.noosa.Camera;
import com.watabou.noosa.Image;
import com.watabou.noosa.Visual;
import com.watabou.noosa.audio.Sample;
@@ -480,6 +481,12 @@ public class MonkEnergy extends Buff implements ActionIndicator.Action {
range += 3;
}
if (Dungeon.hero.rooted){
Camera.main.shake( 1, 1f );
GLog.w(Messages.get(MeleeWeapon.class, "ability_bad_position"));
return;
}
if (Dungeon.level.distance(hero.pos, target) > range){
GLog.w(Messages.get(MeleeWeapon.class, "ability_bad_position"));
return;

View File

@@ -41,6 +41,7 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon;
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.noosa.BitmapText;
import com.watabou.noosa.Camera;
import com.watabou.noosa.Image;
import com.watabou.noosa.Visual;
import com.watabou.noosa.audio.Sample;
@@ -305,6 +306,7 @@ public class Preparation extends Buff implements ActionIndicator.Action {
if (dest == -1 || PathFinder.distance[dest] == Integer.MAX_VALUE || Dungeon.hero.rooted){
GLog.w(Messages.get(Preparation.class, "out_of_reach"));
if (Dungeon.hero.rooted) Camera.main.shake( 1, 1f );
return;
}

View File

@@ -46,6 +46,7 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon;
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.noosa.Camera;
import com.watabou.noosa.audio.Sample;
import com.watabou.utils.Bundle;
import com.watabou.utils.PathFinder;
@@ -111,7 +112,7 @@ public class Challenge extends ArmorAbility {
int[] reachable = PathFinder.distance.clone();
int blinkpos = hero.pos;
if (hero.hasTalent(Talent.CLOSE_THE_GAP)){
if (hero.hasTalent(Talent.CLOSE_THE_GAP) && !hero.rooted){
int blinkrange = 1 + hero.pointsInTalent(Talent.CLOSE_THE_GAP);
PathFinder.buildDistanceMap(hero.pos, BArray.not(Dungeon.level.solid,null), blinkrange);
@@ -135,11 +136,13 @@ public class Challenge extends ArmorAbility {
if (PathFinder.distance[blinkpos] == Integer.MAX_VALUE){
GLog.w(Messages.get(this, "unreachable_target"));
if (hero.rooted) Camera.main.shake( 1, 1f );
return;
}
if (Dungeon.level.distance(blinkpos, targetCh.pos) > 5){
GLog.w(Messages.get(this, "distant_target"));
if (hero.rooted) Camera.main.shake( 1, 1f );
return;
}

View File

@@ -46,6 +46,7 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.MirrorSprite;
import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon;
import com.shatteredpixel.shatteredpixeldungeon.ui.TargetHealthIndicator;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.noosa.Camera;
import com.watabou.noosa.audio.Sample;
import com.watabou.noosa.tweeners.AlphaTweener;
import com.watabou.noosa.tweeners.Delayer;
@@ -83,6 +84,12 @@ public class Feint extends ArmorAbility {
return;
}
if (Dungeon.hero.rooted){
Camera.main.shake( 1, 1f );
GLog.w(Messages.get(this, "bad_location"));
return;
}
if (!Dungeon.level.passable[target] || Actor.findChar(target) != null){
GLog.w(Messages.get(this, "bad_location"));
return;

View File

@@ -51,6 +51,7 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.MobSprite;
import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon;
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.noosa.Camera;
import com.watabou.noosa.TextureFilm;
import com.watabou.noosa.audio.Sample;
import com.watabou.utils.PathFinder;
@@ -86,11 +87,16 @@ public class SmokeBomb extends ArmorAbility {
protected void activate(ClassArmor armor, Hero hero, Integer target) {
if (target != null) {
if (target != hero.pos && hero.rooted){
Camera.main.shake( 1, 1f );
return;
}
PathFinder.buildDistanceMap(hero.pos, BArray.not(Dungeon.level.solid,null), 6);
if ( PathFinder.distance[target] == Integer.MAX_VALUE ||
!Dungeon.level.heroFOV[target] ||
Actor.findChar( target ) != null) {
(target != hero.pos && Actor.findChar( target ) != null)) {
GLog.w( Messages.get(this, "fov") );
return;

View File

@@ -67,6 +67,11 @@ public class HeroicLeap extends ArmorAbility {
public void activate( ClassArmor armor, Hero hero, Integer target ) {
if (target != null) {
if (hero.rooted){
Camera.main.shake( 1, 1f );
return;
}
Ballistica route = new Ballistica(hero.pos, target, Ballistica.STOP_TARGET | Ballistica.STOP_SOLID);
int cell = route.collisionPos;

View File

@@ -102,7 +102,7 @@ public class Succubus extends Mob {
@Override
protected boolean getCloser( int target ) {
if (fieldOfView[target] && Dungeon.level.distance( pos, target ) > 2 && blinkCooldown <= 0) {
if (fieldOfView[target] && Dungeon.level.distance( pos, target ) > 2 && blinkCooldown <= 0 && !rooted) {
if (blink( target )) {
spend(-1 / speed());

View File

@@ -44,6 +44,7 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap;
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.noosa.Camera;
import com.watabou.noosa.audio.Sample;
import com.watabou.utils.Callback;
import com.watabou.utils.PathFinder;
@@ -206,6 +207,7 @@ public class EtherealChains extends Artifact {
//don't pull if rooted
if (hero.rooted){
Camera.main.shake( 1, 1f );
GLog.w( Messages.get(EtherealChains.class, "rooted") );
return;
}

View File

@@ -33,6 +33,7 @@ import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.ui.AttackIndicator;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.noosa.Camera;
import com.watabou.noosa.audio.Sample;
import com.watabou.utils.Callback;
import com.watabou.utils.PathFinder;
@@ -89,6 +90,7 @@ public class Rapier extends MeleeWeapon {
if (hero.rooted || Dungeon.level.distance(hero.pos, target) < 2
|| Dungeon.level.distance(hero.pos, target)-1 > wep.reachFactor(hero)){
GLog.w(Messages.get(wep, "ability_bad_position"));
if (hero.rooted) Camera.main.shake( 1, 1f );
return;
}