v0.3.3: implemented BOSS and MINIBOSS properties
This commit is contained in:
parent
e09f40378d
commit
3d8e104b9b
src/com/shatteredpixel/shatteredpixeldungeon
|
@ -165,7 +165,7 @@ public abstract class Char extends Actor {
|
|||
|
||||
if ( this instanceof Yog ) {
|
||||
Dungeon.fail( Utils.format( ResultDescriptions.NAMED, name) );
|
||||
} if (Bestiary.isUnique( this )) {
|
||||
} else if (properties().contains(Property.MINIBOSS) || properties().contains(Property.BOSS)) {
|
||||
Dungeon.fail( Utils.format( ResultDescriptions.UNIQUE, name) );
|
||||
} else {
|
||||
Dungeon.fail( Utils.format( ResultDescriptions.MOB, Utils.indefinite( name )) );
|
||||
|
|
|
@ -179,10 +179,4 @@ public class Bestiary {
|
|||
|
||||
return classes[ Random.chances( chances )];
|
||||
}
|
||||
|
||||
public static boolean isUnique( Char mob ) {
|
||||
return mob instanceof Goo || mob instanceof Tengu || mob instanceof DM300 || mob instanceof King
|
||||
|| mob instanceof Yog.BurningFist || mob instanceof Yog.RottingFist
|
||||
|| mob instanceof FetidRat || mob instanceof GnollTrickster || mob instanceof GreatCrab;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,6 +64,8 @@ public class DM300 extends Mob {
|
|||
|
||||
loot = new CapeOfThorns().identify();
|
||||
lootChance = 0.333f;
|
||||
|
||||
properties.add(Property.BOSS);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -44,6 +44,8 @@ public class FetidRat extends Rat {
|
|||
EXP = 4;
|
||||
|
||||
state = WANDERING;
|
||||
|
||||
properties.add(Property.MINIBOSS);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -50,6 +50,8 @@ public class GnollTrickster extends Gnoll {
|
|||
|
||||
loot = Generator.random(CurareDart.class);
|
||||
lootChance = 1f;
|
||||
|
||||
properties.add(Property.MINIBOSS);
|
||||
}
|
||||
|
||||
private int combo = 0;
|
||||
|
|
|
@ -61,6 +61,8 @@ public class Goo extends Mob {
|
|||
|
||||
loot = new LloydsBeacon().identify();
|
||||
lootChance = 0.333f;
|
||||
|
||||
properties.add(Property.BOSS);
|
||||
}
|
||||
|
||||
private int pumpedUp = 0;
|
||||
|
|
|
@ -42,6 +42,8 @@ public class GreatCrab extends Crab {
|
|||
EXP = 6;
|
||||
|
||||
state = WANDERING;
|
||||
|
||||
properties.add(Property.MINIBOSS);
|
||||
}
|
||||
|
||||
private int moving = 0;
|
||||
|
|
|
@ -66,6 +66,8 @@ public class King extends Mob {
|
|||
defenseSkill = 25;
|
||||
|
||||
Undead.count = 0;
|
||||
|
||||
properties.add(Property.BOSS);
|
||||
}
|
||||
|
||||
private boolean nextPedestal = true;
|
||||
|
|
|
@ -40,6 +40,7 @@ public class NewbornElemental extends Elemental {
|
|||
|
||||
EXP = 7;
|
||||
|
||||
properties.add(Property.MINIBOSS);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -45,6 +45,7 @@ public class RotHeart extends Mob {
|
|||
state = PASSIVE;
|
||||
|
||||
properties.add(Property.IMMOVABLE);
|
||||
properties.add(Property.MINIBOSS);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -64,6 +64,8 @@ public class Tengu extends Mob {
|
|||
HUNTING = new Hunting();
|
||||
|
||||
flying = true; //doesn't literally fly, but he is fleet-of-foot enough to avoid hazards
|
||||
|
||||
properties.add(Property.BOSS);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -71,6 +71,7 @@ public class Yog extends Mob {
|
|||
|
||||
state = PASSIVE;
|
||||
|
||||
properties.add(Property.BOSS);
|
||||
properties.add(Property.IMMOVABLE);
|
||||
}
|
||||
|
||||
|
@ -230,6 +231,8 @@ public class Yog extends Mob {
|
|||
EXP = 0;
|
||||
|
||||
state = WANDERING;
|
||||
|
||||
properties.add(Property.BOSS);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -320,6 +323,8 @@ public class Yog extends Mob {
|
|||
EXP = 0;
|
||||
|
||||
state = WANDERING;
|
||||
|
||||
properties.add(Property.BOSS);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -292,8 +292,10 @@ public class CursedWand {
|
|||
cursedFX(user, bolt, new Callback() {
|
||||
public void call() {
|
||||
Char ch = Actor.findChar( bolt.collisionPos );
|
||||
//TODO: this is lazy, should think of a better way to ID bosses, or have this effect be more sophisticated.
|
||||
if (ch != null && ch != user && !Dungeon.bossLevel()){
|
||||
|
||||
if (ch != null && ch != user
|
||||
&& !ch.properties().contains(Char.Property.BOSS)
|
||||
&& !ch.properties().contains(Char.Property.MINIBOSS)){
|
||||
Sheep sheep = new Sheep();
|
||||
sheep.lifespan = 10;
|
||||
sheep.pos = ch.pos;
|
||||
|
|
|
@ -48,13 +48,6 @@ public class WandOfCorruption extends Wand {
|
|||
image = ItemSpriteSheet.WAND_CORRUPTION;
|
||||
}
|
||||
|
||||
//FIXME: sloppy
|
||||
private static HashSet<Class> bosses = new HashSet<Class>(Arrays.asList(
|
||||
FetidRat.class, GnollTrickster.class, GreatCrab.class,
|
||||
Goo.class, Tengu.class, DM300.class, King.class,
|
||||
Yog.class, Yog.BurningFist.class, Yog.RottingFist.class
|
||||
));
|
||||
|
||||
@Override
|
||||
protected void onZap(Ballistica bolt) {
|
||||
Char ch = Actor.findChar(bolt.collisionPos);
|
||||
|
@ -66,7 +59,7 @@ public class WandOfCorruption extends Wand {
|
|||
return;
|
||||
}
|
||||
|
||||
if (bosses.contains(ch.getClass())){
|
||||
if (ch.properties().contains(Char.Property.BOSS) || ch.properties().contains(Char.Property.MINIBOSS)){
|
||||
GLog.w("Bosses are immune to corruption");
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user