|
|
|
|
@@ -21,6 +21,7 @@
|
|
|
|
|
|
|
|
|
|
package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
|
|
|
|
|
|
|
|
|
|
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
|
|
|
|
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
|
|
|
|
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
|
|
|
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
|
|
|
|
@@ -90,24 +91,57 @@ public class YogDzewa extends Mob {
|
|
|
|
|
private static final int MIN_SUMMON_CD = 10;
|
|
|
|
|
private static final int MAX_SUMMON_CD = 15;
|
|
|
|
|
|
|
|
|
|
private static Class getPairedFist(Class fist){
|
|
|
|
|
if (fist == YogFist.BurningFist.class) return YogFist.SoiledFist.class;
|
|
|
|
|
if (fist == YogFist.SoiledFist.class) return YogFist.BurningFist.class;
|
|
|
|
|
if (fist == YogFist.RottingFist.class) return YogFist.RustedFist.class;
|
|
|
|
|
if (fist == YogFist.RustedFist.class) return YogFist.RottingFist.class;
|
|
|
|
|
if (fist == YogFist.BrightFist.class) return YogFist.DarkFist.class;
|
|
|
|
|
if (fist == YogFist.DarkFist.class) return YogFist.BrightFist.class;
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private ArrayList<Class> fistSummons = new ArrayList<>();
|
|
|
|
|
private ArrayList<Class> challengeSummons = new ArrayList<>();
|
|
|
|
|
{
|
|
|
|
|
Random.pushGenerator(Dungeon.seedCurDepth());
|
|
|
|
|
fistSummons.add(Random.Int(2) == 0 ? YogFist.BurningFist.class : YogFist.SoiledFist.class);
|
|
|
|
|
fistSummons.add(Random.Int(2) == 0 ? YogFist.RottingFist.class : YogFist.RustedFist.class);
|
|
|
|
|
fistSummons.add(Random.Int(2) == 0 ? YogFist.BrightFist.class : YogFist.DarkFist.class);
|
|
|
|
|
Random.shuffle(fistSummons);
|
|
|
|
|
//randomly place challenge summons so that two fists of a pair can never spawn together
|
|
|
|
|
if (Random.Int(2) == 0){
|
|
|
|
|
challengeSummons.add(getPairedFist(fistSummons.get(1)));
|
|
|
|
|
challengeSummons.add(getPairedFist(fistSummons.get(2)));
|
|
|
|
|
challengeSummons.add(getPairedFist(fistSummons.get(0)));
|
|
|
|
|
} else {
|
|
|
|
|
challengeSummons.add(getPairedFist(fistSummons.get(2)));
|
|
|
|
|
challengeSummons.add(getPairedFist(fistSummons.get(0)));
|
|
|
|
|
challengeSummons.add(getPairedFist(fistSummons.get(1)));
|
|
|
|
|
}
|
|
|
|
|
Random.popGenerator();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static final int SUMMON_DECK_SIZE = 4;
|
|
|
|
|
private ArrayList<Class> regularSummons = new ArrayList<>();
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < SUMMON_DECK_SIZE; i++){
|
|
|
|
|
if (i >= Statistics.spawnersAlive){
|
|
|
|
|
regularSummons.add(Larva.class);
|
|
|
|
|
} else {
|
|
|
|
|
regularSummons.add(YogRipper.class);
|
|
|
|
|
if (Dungeon.isChallenged(Challenges.STRONGER_BOSSES)){
|
|
|
|
|
for (int i = 0; i < 6; i++){
|
|
|
|
|
if (i >= 4){
|
|
|
|
|
regularSummons.add(YogRipper.class);
|
|
|
|
|
}
|
|
|
|
|
if (i >= Statistics.spawnersAlive){
|
|
|
|
|
regularSummons.add(Larva.class);
|
|
|
|
|
} else {
|
|
|
|
|
regularSummons.add( i % 2 == 0 ? YogEye.class : YogScorpio.class);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
for (int i = 0; i < 6; i++){
|
|
|
|
|
if (i >= Statistics.spawnersAlive){
|
|
|
|
|
regularSummons.add(Larva.class);
|
|
|
|
|
} else {
|
|
|
|
|
regularSummons.add(YogRipper.class);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Random.shuffle(regularSummons);
|
|
|
|
|
@@ -175,7 +209,11 @@ public class YogDzewa extends Mob {
|
|
|
|
|
Dungeon.observe();
|
|
|
|
|
}
|
|
|
|
|
for (Char ch : affected) {
|
|
|
|
|
ch.damage(Random.NormalIntRange(20, 30), new Eye.DeathGaze());
|
|
|
|
|
if (Dungeon.isChallenged(Challenges.STRONGER_BOSSES)){
|
|
|
|
|
ch.damage(Random.NormalIntRange(30, 50), new Eye.DeathGaze());
|
|
|
|
|
} else {
|
|
|
|
|
ch.damage(Random.NormalIntRange(20, 30), new Eye.DeathGaze());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Dungeon.level.heroFOV[pos]) {
|
|
|
|
|
ch.sprite.flash();
|
|
|
|
|
@@ -322,8 +360,11 @@ public class YogDzewa extends Mob {
|
|
|
|
|
GLog.n(Messages.get(this, "darkness"));
|
|
|
|
|
sprite.showStatus(CharSprite.POSITIVE, Messages.get(this, "invulnerable"));
|
|
|
|
|
|
|
|
|
|
YogFist fist = (YogFist) Reflection.newInstance(fistSummons.remove(0));
|
|
|
|
|
fist.pos = Dungeon.level.exit;
|
|
|
|
|
addFist((YogFist)Reflection.newInstance(fistSummons.remove(0)));
|
|
|
|
|
|
|
|
|
|
if (Dungeon.isChallenged(Challenges.STRONGER_BOSSES)){
|
|
|
|
|
addFist((YogFist)Reflection.newInstance(challengeSummons.remove(0)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CellEmitter.get(Dungeon.level.exit-1).burst(ShadowParticle.UP, 25);
|
|
|
|
|
CellEmitter.get(Dungeon.level.exit).burst(ShadowParticle.UP, 100);
|
|
|
|
|
@@ -332,17 +373,6 @@ public class YogDzewa extends Mob {
|
|
|
|
|
if (abilityCooldown < 5) abilityCooldown = 5;
|
|
|
|
|
if (summonCooldown < 5) summonCooldown = 5;
|
|
|
|
|
|
|
|
|
|
int targetPos = Dungeon.level.exit + Dungeon.level.width();
|
|
|
|
|
if (Actor.findChar(targetPos) == null){
|
|
|
|
|
fist.pos = targetPos;
|
|
|
|
|
} else if (Actor.findChar(targetPos-1) == null){
|
|
|
|
|
fist.pos = targetPos-1;
|
|
|
|
|
} else if (Actor.findChar(targetPos+1) == null){
|
|
|
|
|
fist.pos = targetPos+1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GameScene.add(fist, 4);
|
|
|
|
|
Actor.addDelayed( new Pushing( fist, Dungeon.level.exit, fist.pos ), -1 );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
LockedFloor lock = Dungeon.hero.buff(LockedFloor.class);
|
|
|
|
|
@@ -350,6 +380,33 @@ public class YogDzewa extends Mob {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void addFist(YogFist fist){
|
|
|
|
|
fist.pos = Dungeon.level.exit;
|
|
|
|
|
|
|
|
|
|
CellEmitter.get(Dungeon.level.exit-1).burst(ShadowParticle.UP, 25);
|
|
|
|
|
CellEmitter.get(Dungeon.level.exit).burst(ShadowParticle.UP, 100);
|
|
|
|
|
CellEmitter.get(Dungeon.level.exit+1).burst(ShadowParticle.UP, 25);
|
|
|
|
|
|
|
|
|
|
if (abilityCooldown < 5) abilityCooldown = 5;
|
|
|
|
|
if (summonCooldown < 5) summonCooldown = 5;
|
|
|
|
|
|
|
|
|
|
int targetPos = Dungeon.level.exit + Dungeon.level.width();
|
|
|
|
|
|
|
|
|
|
if (!Dungeon.isChallenged(Challenges.STRONGER_BOSSES)
|
|
|
|
|
&& Actor.findChar(targetPos) == null){
|
|
|
|
|
fist.pos = targetPos;
|
|
|
|
|
} else if (Actor.findChar(targetPos-1) == null){
|
|
|
|
|
fist.pos = targetPos-1;
|
|
|
|
|
} else if (Actor.findChar(targetPos+1) == null){
|
|
|
|
|
fist.pos = targetPos+1;
|
|
|
|
|
} else if (Actor.findChar(targetPos) == null){
|
|
|
|
|
fist.pos = targetPos;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GameScene.add(fist, 4);
|
|
|
|
|
Actor.addDelayed( new Pushing( fist, Dungeon.level.exit, fist.pos ), -1 );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void updateVisibility( Level level ){
|
|
|
|
|
if (phase > 1 && isAlive()){
|
|
|
|
|
level.viewDistance = 4 - (phase-1);
|
|
|
|
|
@@ -453,6 +510,7 @@ public class YogDzewa extends Mob {
|
|
|
|
|
|
|
|
|
|
private static final String FIST_SUMMONS = "fist_summons";
|
|
|
|
|
private static final String REGULAR_SUMMONS = "regular_summons";
|
|
|
|
|
private static final String CHALLENGE_SUMMONS = "challenges_summons";
|
|
|
|
|
|
|
|
|
|
private static final String TARGETED_CELLS = "targeted_cells";
|
|
|
|
|
|
|
|
|
|
@@ -465,6 +523,7 @@ public class YogDzewa extends Mob {
|
|
|
|
|
bundle.put(SUMMON_CD, summonCooldown);
|
|
|
|
|
|
|
|
|
|
bundle.put(FIST_SUMMONS, fistSummons.toArray(new Class[0]));
|
|
|
|
|
bundle.put(CHALLENGE_SUMMONS, challengeSummons.toArray(new Class[0]));
|
|
|
|
|
bundle.put(REGULAR_SUMMONS, regularSummons.toArray(new Class[0]));
|
|
|
|
|
|
|
|
|
|
int[] bundleArr = new int[targetedCells.size()];
|
|
|
|
|
@@ -485,6 +544,8 @@ public class YogDzewa extends Mob {
|
|
|
|
|
|
|
|
|
|
fistSummons.clear();
|
|
|
|
|
Collections.addAll(fistSummons, bundle.getClassArray(FIST_SUMMONS));
|
|
|
|
|
challengeSummons.clear();
|
|
|
|
|
Collections.addAll(challengeSummons, bundle.getClassArray(CHALLENGE_SUMMONS));
|
|
|
|
|
regularSummons.clear();
|
|
|
|
|
Collections.addAll(regularSummons, bundle.getClassArray(REGULAR_SUMMONS));
|
|
|
|
|
|
|
|
|
|
@@ -525,7 +586,16 @@ public class YogDzewa extends Mob {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//used so death to yog's ripper demons have their own rankings description and are more aggro
|
|
|
|
|
public static class YogRipper extends RipperDemon {
|
|
|
|
|
//used so death to yog's ripper demons have their own rankings description
|
|
|
|
|
public static class YogRipper extends RipperDemon {}
|
|
|
|
|
public static class YogEye extends Eye {
|
|
|
|
|
{
|
|
|
|
|
maxLvl = -2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public static class YogScorpio extends Scorpio {
|
|
|
|
|
{
|
|
|
|
|
maxLvl = -2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|