v0.7.5: adjustments to new enemies

This commit is contained in:
Evan Debenham 2019-09-25 15:32:44 -04:00
parent f2f976c36b
commit b9282c42c1
3 changed files with 28 additions and 9 deletions

View File

@ -69,6 +69,8 @@ public class Necromancer extends Mob {
private Emitter summoningEmitter = null; private Emitter summoningEmitter = null;
private int summoningPos = -1; private int summoningPos = -1;
private boolean firstSummon = true;
private NecroSkeleton mySkeleton; private NecroSkeleton mySkeleton;
private int storedSkeletonID = -1; private int storedSkeletonID = -1;
@ -123,13 +125,15 @@ public class Necromancer extends Mob {
} }
private static final String SUMMONING = "summoning"; private static final String SUMMONING = "summoning";
private static final String FIRST_SUMMON = "first_summon";
private static final String SUMMONING_POS = "summoning_pos"; private static final String SUMMONING_POS = "summoning_pos";
private static final String MY_SKELETON = "my_skeleton"; private static final String MY_SKELETON = "my_skeleton";
@Override @Override
public void storeInBundle(Bundle bundle) { public void storeInBundle(Bundle bundle) {
super.storeInBundle(bundle); super.storeInBundle(bundle);
bundle.put( SUMMONING, summoning); bundle.put( SUMMONING, summoning );
bundle.put( FIRST_SUMMON, firstSummon );
if (summoning){ if (summoning){
bundle.put( SUMMONING_POS, summoningPos); bundle.put( SUMMONING_POS, summoningPos);
} }
@ -142,6 +146,7 @@ public class Necromancer extends Mob {
public void restoreFromBundle(Bundle bundle) { public void restoreFromBundle(Bundle bundle) {
super.restoreFromBundle(bundle); super.restoreFromBundle(bundle);
summoning = bundle.getBoolean( SUMMONING ); summoning = bundle.getBoolean( SUMMONING );
if (bundle.contains(FIRST_SUMMON)) firstSummon = bundle.getBoolean(FIRST_SUMMON);
if (summoning){ if (summoning){
summoningPos = bundle.getInt( SUMMONING_POS ); summoningPos = bundle.getInt( SUMMONING_POS );
} }
@ -191,7 +196,7 @@ public class Necromancer extends Mob {
} }
} }
summoning = false; summoning = firstSummon = false;
mySkeleton = new NecroSkeleton(); mySkeleton = new NecroSkeleton();
mySkeleton.pos = summoningPos; mySkeleton.pos = summoningPos;
@ -236,7 +241,7 @@ public class Necromancer extends Mob {
((NecromancerSprite)sprite).charge(summoningPos); ((NecromancerSprite)sprite).charge(summoningPos);
spend(TICK); spend( firstSummon ? TICK : 2*TICK );
} else { } else {
//wait for a turn //wait for a turn
spend(TICK); spend(TICK);
@ -303,6 +308,7 @@ public class Necromancer extends Mob {
} }
} }
//TODO should give this its own sprite
public static class NecroSkeleton extends Skeleton { public static class NecroSkeleton extends Skeleton {
{ {
@ -319,7 +325,5 @@ public class Necromancer extends Mob {
spend(TICK); spend(TICK);
} }
//TODO sometimes skeleton can get blocked behind necromancer, might want to address that
} }
} }

View File

@ -34,7 +34,7 @@ public class Slime extends Mob {
{ {
spriteClass = SlimeSprite.class; spriteClass = SlimeSprite.class;
HP = HT = 25; HP = HT = 20;
defenseSkill = 5; defenseSkill = 5;
EXP = 4; EXP = 4;
@ -53,14 +53,27 @@ public class Slime extends Mob {
return 12; return 12;
} }
private int reduceDamage( int incomingDamage ){
if (incomingDamage <= 4){
return incomingDamage;
} else {
//takes 5/6/7/8/9/10 dmg at 5/7/10/14/19/25 incoming dmg
return 4 + (int)(Math.sqrt(8*(incomingDamage - 4) + 1) - 1)/2;
}
}
@Override @Override
public void damage(int dmg, Object src) { public void damage(int dmg, Object src) {
super.damage(Math.min(dmg, 6), src); if (src instanceof Char) {
super.damage(dmg, src);
} else {
super.damage(reduceDamage(dmg), src);
}
} }
@Override @Override
public int defenseProc(Char enemy, int damage) { public int defenseProc(Char enemy, int damage) {
return super.defenseProc(enemy, Math.min(damage, 6)); return super.defenseProc(enemy, reduceDamage(damage));
} }
@Override @Override

View File

@ -519,6 +519,8 @@ actors.mobs.mimic.desc=Mimics are magical creatures which can take any shape the
actors.mobs.necromancer.name=necromancer actors.mobs.necromancer.name=necromancer
actors.mobs.necromancer.desc=These apprentice dark mages have flocked to the prison, as it is the perfect place to practise their evil craft.\n\nNecromancers will summon and empower skeletons to fight for them. Killing the necromancer will also kill the skeleton it summons. actors.mobs.necromancer.desc=These apprentice dark mages have flocked to the prison, as it is the perfect place to practise their evil craft.\n\nNecromancers will summon and empower skeletons to fight for them. Killing the necromancer will also kill the skeleton it summons.
actors.mobs.necromancer$necroskeleton.name=Necromancer's Skeleton
actors.mobs.necromancer$necroskeleton.desc=This skeleton has been summoned by a necromancer. It behaves just like a regular skeleton, and will die when the necromancer which summoned it is slain.
actors.mobs.mob.died=You hear something die in the distance. actors.mobs.mob.died=You hear something die in the distance.
actors.mobs.mob.rage=#$%^ actors.mobs.mob.rage=#$%^
@ -564,7 +566,7 @@ actors.mobs.skeleton.def_verb=blocked
actors.mobs.skeleton.desc=Skeletons are composed of corpses bones from unlucky adventurers and inhabitants of the dungeon, animated by emanations of evil magic from the depths below. After they have been damaged enough, they disintegrate in an explosion of bones. actors.mobs.skeleton.desc=Skeletons are composed of corpses bones from unlucky adventurers and inhabitants of the dungeon, animated by emanations of evil magic from the depths below. After they have been damaged enough, they disintegrate in an explosion of bones.
actors.mobs.slime.name=slime actors.mobs.slime.name=slime
actors.mobs.slime.desc=Slimes are strange, slightly magical creatures with a rubbery outer body and a liquid core. The city sewers provide them with an ample supply of water and nutrients.\n\nBecause of their elastic outer membrane, slimes will not take more than _6 damage_ from any one attack. actors.mobs.slime.desc=Slimes are strange, slightly magical creatures with a rubbery outer body and a liquid core. The city sewers provide them with an ample supply of water and nutrients.\n\nBecause of their elastic outer membrane, it is difficult to deal more than _6 damage_ to slimes from any one attack.
actors.mobs.snake.name=sewer snake actors.mobs.snake.name=sewer snake
actors.mobs.snake.desc=These oversized serpents are capable of quickly slithering around blows, making them quite hard to hit. Magical attacks or surprise attacks are capable of catching them off-guard however.\n\nYou can perform a surprise attack by attacking while out of the snake's vision. One way is to let a snake chase you through a doorway and then _strike just as it moves into the door._ actors.mobs.snake.desc=These oversized serpents are capable of quickly slithering around blows, making them quite hard to hit. Magical attacks or surprise attacks are capable of catching them off-guard however.\n\nYou can perform a surprise attack by attacking while out of the snake's vision. One way is to let a snake chase you through a doorway and then _strike just as it moves into the door._