From 4c102eb3f31a2e808d1b8137fb45691157a74b5c Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 9 Oct 2014 16:04:15 -0400 Subject: [PATCH] V0.2.1: tweaked some code in gnoll trickster and great crab. --- .../actors/mobs/npcs/Ghost.java | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java index e00f023f5..b645f4484 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java @@ -468,22 +468,20 @@ public class Ghost extends Mob.NPC { public int attackProc( Char enemy, int damage ) { //The gnoll's attacks get more severe the more the player lets it hit them int effect = Random.Int(3)+combo; - Burning aflame = enemy.buff(Burning.class); - if (effect <= 2) { Buff.prolong(enemy, Cripple.class, 2f); } else { - if (effect >=4 && aflame == null){ + if (effect >=4 && enemy.buff(Burning.class) == null){ if (Level.flamable[enemy.pos]) GameScene.add( Blob.seed( enemy.pos, 4, Fire.class ) ); Buff.affect( enemy, Burning.class ).reignite( enemy ); } else - Buff.affect( enemy, Poison.class).set(Random.Int(effect-2, effect) * Poison.durationFactor(enemy)); + Buff.affect( enemy, Poison.class).set((effect-1) * Poison.durationFactor(enemy)); } return damage; @@ -535,12 +533,13 @@ public class Ghost extends Mob.NPC { HP = HT = 30; defenseSkill = 0; //see damage() - baseSpeed = 0.67f; EXP = 6; } + private boolean moving = true; + @Override public int damageRoll() { return Random.NormalIntRange( 4, 6 ); @@ -556,6 +555,20 @@ public class Ghost extends Mob.NPC { return 4; } + @Override + protected boolean getCloser( int target ) { + + //this is used such that the crab remains slow, but still detects the player at the expected rate. + if (moving) { + moving = false; + return super.getCloser( target ); + } else { + moving = true; + return false; + } + + } + //TODO: New functionality, test this with a variety of items/effects @Override public void damage( int dmg, Object src ){ @@ -563,7 +576,7 @@ public class Ghost extends Mob.NPC { //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)){ GLog.w("The crab notices the attack and blocks with its massive claw."); - sprite.showStatus( CharSprite.DEFAULT, "blocked" ); + sprite.showStatus( CharSprite.NEUTRAL, "blocked" ); } else { super.damage( dmg, src ); }