V0.2.1 : Improved Great Crab logic, made item generation from ghost slightly more generous.
This commit is contained in:
parent
0e0faecc25
commit
2955d830ef
|
@ -29,10 +29,13 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Crab;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Crab;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Gnoll;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Gnoll;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Lightning;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Wound;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Wound;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat;
|
import com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.CurareDart;
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.CurareDart;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.LightningTrap;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.*;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.*;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||||
|
@ -336,11 +339,11 @@ public class Ghost extends Mob.NPC {
|
||||||
do {
|
do {
|
||||||
another = Generator.randomWeapon(10+i);
|
another = Generator.randomWeapon(10+i);
|
||||||
} while (another instanceof MissileWeapon);
|
} while (another instanceof MissileWeapon);
|
||||||
if (another.level > weapon.level) {
|
if (another.level >= weapon.level) {
|
||||||
weapon = (Weapon) another;
|
weapon = (Weapon) another;
|
||||||
}
|
}
|
||||||
another = Generator.randomArmor(10+i);
|
another = Generator.randomArmor(10+i);
|
||||||
if (another.level > armor.level) {
|
if (another.level >= armor.level) {
|
||||||
armor = (Armor) another;
|
armor = (Armor) another;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -537,6 +540,7 @@ public class Ghost extends Mob.NPC {
|
||||||
|
|
||||||
HP = HT = 30;
|
HP = HT = 30;
|
||||||
defenseSkill = 0; //see damage()
|
defenseSkill = 0; //see damage()
|
||||||
|
baseSpeed = 1f;
|
||||||
|
|
||||||
EXP = 6;
|
EXP = 6;
|
||||||
|
|
||||||
|
@ -561,24 +565,22 @@ public class Ghost extends Mob.NPC {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean getCloser( int target ) {
|
protected boolean getCloser( int target ) {
|
||||||
|
|
||||||
//this is used such that the crab remains slow, but still detects the player at the expected rate.
|
//this is used such that the crab remains slow, but still detects the player at the expected rate.
|
||||||
if (moving) {
|
if (moving) {
|
||||||
moving = false;
|
moving = false;
|
||||||
return super.getCloser( target );
|
return super.getCloser( target );
|
||||||
} else {
|
} else {
|
||||||
moving = true;
|
moving = true;
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: New functionality, test this with a variety of items/effects
|
|
||||||
@Override
|
@Override
|
||||||
public void damage( int dmg, Object src ){
|
public void damage( int dmg, Object src ){
|
||||||
//crab blocks all attacks originating from the hero or enemy characters if it is alerted.
|
//crab blocks all attacks originating from the hero or enemy characters if it is alerted.
|
||||||
//All direct damage from these sources is negated, no exceptions. blob/debuff effects go through as normal.
|
//All direct damage from these sources is negated, no exceptions. blob/debuff effects go through as normal.
|
||||||
if (enemySeen && (src instanceof Weapon || src instanceof Char)){
|
if (enemySeen && (src instanceof Wand || src instanceof LightningTrap.Electricity || src instanceof Char)){
|
||||||
GLog.w("The crab notices the attack and blocks with its massive claw.");
|
GLog.w("The crab notices the attack and blocks with its massive claw.");
|
||||||
sprite.showStatus( CharSprite.NEUTRAL, "blocked" );
|
sprite.showStatus( CharSprite.NEUTRAL, "blocked" );
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user